Urban area traffic prediction system and method oriented to vehicle track big data

文档序号:1906372 发布日期:2021-11-30 浏览:21次 中文

阅读说明:本技术 一种面向车辆轨迹大数据的城市区域流量预测系统及方法 (Urban area traffic prediction system and method oriented to vehicle track big data ) 是由 陈红阳 肖大鹏 肖竹 于 2021-08-06 设计创作,主要内容包括:本发明公开了一种面向车辆轨迹大数据的城市区域流量预测系统及方法。首先通过采集车辆的轨迹数据和环境信息数据构成历史信息数据集,构建得到整体历史流入流出矩阵和城市区域流量转移图,然后构建基于联合特征的时空卷积-注意力网络流量预测深度学习模型,其次基于该模型分别提取流量转移时空特征和区域间流量转移时空特征,并嵌入外部特征。最后,该模型通过流量全局时空特征和区域间流量转移特征,嵌入环境信息等外部特征,进行联合预测,得到下一时刻车流量的预测结果。(The invention discloses an urban area traffic prediction system and method oriented to vehicle track big data. The method comprises the steps of firstly, forming a historical information data set by collecting track data and environment information data of a vehicle, constructing and obtaining an integral historical inflow and outflow matrix and an urban area flow transfer graph, then constructing a space-time convolution-attention network flow prediction deep learning model based on joint characteristics, then respectively extracting flow transfer space-time characteristics and inter-area flow transfer space-time characteristics based on the model, and embedding external characteristics. And finally, the model carries out joint prediction by embedding external characteristics such as environment information and the like through the global flow space-time characteristics and the flow transfer characteristics among the areas to obtain the prediction result of the traffic flow at the next moment.)

1. The urban regional traffic prediction system for the vehicle track big data is characterized by comprising a data acquisition module and a traffic prediction module;

the data acquisition module acquires track data and environmental information data of a vehicle to form a historical information data set, and specifically comprises the following steps: acquiring vehicle track data without privacy information through a terminal with a GPS or Beidou positioning function; obtaining regional weather data through an API (application program interface) of weather query service; counting time information and holiday data by inquiring a calendar; acquiring event data through a web crawler technology; clustering the shop information provided by a map service provider to obtain spatial information and regional POI information; the historical information data set forms an integral historical inflow and outflow matrix and an urban area traffic transfer diagram;

the flow prediction module extracts the characteristics of the track data of the vehicle and predicts the vehicle flow; the system comprises a global space-time feature extraction module, a flow transfer feature extraction module, a flow change feature fusion module, an external feature embedding module and a combined feature prediction module;

the global space-time feature extraction module uses a 5 multiplied by 5 two-dimensional convolution core to carry out local space feature extraction on the whole historical inflow and outflow matrix at each moment so as to obtain local space features of a plurality of time segments; then, stacking the extracted local space characteristics of a plurality of time segments and inputting the stacked local space characteristics into a multilayer space-time convolution neural network for convolution operation to obtain historical flow space-time characteristics;

the flow transfer characteristic extraction module extracts the flow transfer space-time characteristics of the urban area flow transfer graph by combining a graph convolution neural network with a long-term and short-term memory network; the long-short term memory network is used for extracting the time characteristic of the flow transfer;

the flow change characteristic fusion module: fusing historical flow space-time characteristics output by the global space-time characteristic extraction module and flow transfer space-time characteristics output by the flow transfer characteristic extraction module by adopting a two-dimensional convolution layer and an activation layer, and outputting fused flow change characteristics;

the external feature embedding module: respectively encoding time information, space information and environment information, embedding the time information, the space information and the environment information through a two-layer full-connection network to obtain a time embedded vector, a space embedded vector and an environment embedded vector, and fusing the 3 embedded vectors to obtain embedded external features;

the joint feature prediction module: inputting the fused external features output by the external feature embedding module and the flow change features output by the flow change feature fusing module, and adding the external features and the flow change features of the corresponding time and place to obtain flow combined features embedded with the external features; and stacking convolutional attention units based on a convolutional neural network layer and a multi-head attention network, learning attention weights in the joint features at the previous moment, and predicting the inflow and outflow flow of the region at the next moment.

2. The urban area traffic prediction method for the vehicle trajectory big data by applying the system of claim 1 is characterized by comprising the following steps:

(1) recording the track data of the vehicle through a data acquisition module, and collecting environment information data of relevant areas and relevant time according to the corresponding track data to form a historical information data set; the track data of the vehicle is vehicle track data without privacy information, and comprises historical travel track data and the residence time of the vehicle; the environment information data comprises regional weather data, time information, holiday data, event data, spatial information, a city map, road network information and regional POI information; clustering all POI information of each region to obtain functional region classification information;

(2) constructing an integral historical inflow and outflow matrix of each time segment according to the historical travel track data acquired in the step (1);

(3) according to the environmental information such as the urban map, the road network information and the functional area information collected in the step (1), combining historical travel track data to construct a regional flow transfer graph among various regions;

(4) the method for constructing the spatio-temporal convolution-attention network traffic prediction deep learning model based on the joint features comprises the following steps of:

(4.1) inputting the whole inflow and outflow matrix of each historical time segment constructed in the step (2) into a global space-time feature extraction module, and outputting historical flow space-time features;

(4.2) inputting the regional flow transfer graphs among the regions obtained in the step (3) into a flow transfer feature extraction module, and extracting flow transfer spatio-temporal features of the urban regional flow transfer graphs by adopting a graph convolution-based neural network and a long-short term memory network;

(4.3) fusing the flow transfer space-time characteristics obtained in the step (4.2) with the historical flow space-time characteristics obtained in the step (4.1) by using a flow change characteristic fusion module to obtain fused flow space-time characteristics;

(4.4) respectively encoding time information, spatial information and environmental information by using an external feature embedding module, passing the historical information data sets of the external features such as the environmental information and the like acquired in the step (1) through a two-layer fully-connected network, and simultaneously performing word embedding operation on the time information and the spatial information of the fused flow space-time feature output in the step (4.3) to obtain embedded external features;

(4.5) inputting the fused flow space-time characteristics obtained in the step (4.3) and the embedded external characteristics obtained in the step (4.4) into a joint characteristic prediction module, outputting flow joint characteristics in which the external characteristics are embedded, and obtaining a space-time convolution-attention network flow prediction deep learning model based on the joint characteristics when the area at the next moment flows in and flows out;

(5) training the space-time convolution-attention network flow prediction deep learning model based on the joint features output in the step (4) by using the historical travel track data acquired in the step (1), comparing the prediction output after the model is trained with a true value, and updating the parameters of the model by adopting an adam optimization algorithm if an error function is out of a set threshold value; if the error function meets the threshold value, the parameters are saved, and a trained space-time convolution-attention network model based on the joint features is obtained.

3. The urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, wherein the step (2) is specifically as follows: dividing the entire region of investigation intoRectangular subregions, L and H being the length and width of the entire investigation region, L and H being the length and width of the rectangular subregions,with time of tauInterval, historical trajectory data of the vehicle collected from step (1)In (ii), count the ith sub-region GiThe inflow and outflow amount of the vehicle in the whole area at the moment ((a-1) × tau, a × tau) is obtained in the a-th time periodAnd vehicle outflowThe city overall inflow and outflow matrix of the whole area in the a-th time period can be represented as a two-dimensional matrix of two channels n × nArranging the traffic flow of the t time slices according to the time sequence to obtain an integral inflow and outflow matrix Vol ═ Vol of the city history1,Vol2,...,VoltAnd (c) the step of (c) in which,

4. the urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, wherein the step (3) is specifically as follows: the road network structure of the urban area is built into a graph structureWhereinIs in all sub-regions (G)1,G2,...,Gn) The set of components is composed of a plurality of groups, is a connectivity matrix in which the element AC[i,j]Representing connectivity of the space between the corresponding ith and jth sub-regions; edge epsilon between nodeskRepresenting the specific flow transfer quantity among the sub-areas in the k time period; then dividing the time interval of tau into (k-1) x tau, k x tau) time intervals to obtain a city area flow transfer graphWhere N × N represents the number of nodes, and d represents the number of types of the historical observation features.

5. The urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, characterized in that the step (4.1) is specifically:

firstly, using a 5 multiplied by 5 two-dimensional convolution core to check a historical integral inflow and outflow matrix of a city at each moment to extract local spatial features, and obtaining the local spatial features of a plurality of time slices; then, stacking the extracted local space characteristics of a plurality of time segments, inputting the stacked local space characteristics into a multilayer space-time convolution neural network for convolution operation to obtain historical flow space-time characteristics; the multilayer space-time convolution neural network is composed of basic neural network layers such as an input layer, a plurality of two-dimensional convolution layers, a three-dimensional convolution layer, a pooling layer, a full-connection layer and an output layer; the convolutional neuron matrix of the ith layer of space-time convolutional neural network convolutional the mth channel is positioned at the output of (x, y, z)The following were used:

wherein the content of the first and second substances,the parameter at (p, q, R) in the convolution neuron matrix of the m-channel, which is the ith layer of the three-dimensional convolution kernel, RiIs the dimension of the Conv3D convolution kernel on the time axis,is the output value in the i-1 st layer convolution at (x + p, y + q, z + r) in the m channel, bimIs the deviation vector of the three-dimensional convolution kernel; ReLU is an excitation function;

finally, the global space-time characteristic extraction module outputs historical flow space-time characteristics of the whole historical inflow and outflow matrix

6. The urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, characterized in that said step (4.2) comprises the following sub-steps:

(4.2.1) extracting the flow transfer spatial correlation among the sub-regions by using a flow transfer characteristic extraction module through a graph convolution network, wherein the calculation formula is as follows:

whereinAs an input to the graph convolution network,is the output of the network and is,lNis an identity matrix of dimension N,for the fineness matrix, W is the parameter to be learned by the graph convolution network, sinThe number of time segments for inputting the graph convolution network;

(4.2.2) extracting the time correlation and the short-term time change rule of flow transfer among the sub-regions by using a long-term and short-term memory network, and fusing the flow transfer space correlation and the time correlation of flow transfer into flow transfer space-time characteristics through a full-connection network; historical regional traffic diversion graphAs input, the flow transfer characteristic extraction module is used for extracting characteristics and outputting flow transfer space-time characteristics

7. The urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, characterized in that the step (4.3) is specifically:

by utilizing a flow change characteristic fusion module, the flow space-time characteristics are obtained by fusing the vehicle travel flow global space-time characteristics and the inter-area flow transfer characteristics

Wherein, W is the learning parameter of the converged network layer, b is the deviation vector, and Concat (■) represents the splicing operation of the element matrix in the brackets.

8. The urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, characterized in that the step (4.4) is specifically:

spatial information embedding: taking the vector of the node as input, and obtaining a space embedded vector by using a two-layer fully-connected neural network

Time information embedding: embedding each time slice in the historical information data set to obtain a corresponding time embedding vector: dividing one day into T time sections, and encoding the day of the week and the time section of each day into T time sections by using one-hot encodingAndis spliced intoUsing two layers of fully connected neural networks to obtain time-embedded vectorsWherein k represents the kth time slice;

embedding environmental information: selecting four pieces of environmental information of weather, temperature, special events and holidays to embed the characteristics, wherein the weather comprises: in sunny weather, rain weather, snow weather, wind, cloud weather and thunder weather, vectors are generated by adopting single-hot coding, and the temperature is an original temperature value; the special events and the holidays are respectively represented by using a 1-dimensional vector; splicing the vectors to obtainUsing two layers of fully connected neural networks to obtain the environment embedded vector of the k time period

Then, the 3 feature embedding vectors are fused to obtain the embedded external features

9. The urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, characterized in that the step (4.5) is specifically:

and predicting by adopting an Attention network, wherein the Attention (Q, K, V) of each node is as follows:

wherein the content of the compound Q is as follows,representing queries, keys and values of respective nodes, dkIs the query and key dimensions of each node, dvIs the dimension of the value of each node;

flow space-time characteristics output by the flow change characteristic fusion moduleAnd external featuresMerging is carried outTo obtain (h)1,...,hk) And stack them asSuperscript viRepresenting its corresponding node; then to the matrixLinear transformation to queries for individual nodesKey with a key bodyAnd a value V:

the parameters of the transformation matrix to be learned are shared by all the nodes; the attention structure is as follows:

10. the urban area traffic prediction method oriented to vehicle trajectory big data according to claim 2, wherein the step (5) is specifically as follows:

the model for the whole area traffic prediction is represented by f (),the predicted value of the urban area flow from the k +1 th time to the k + T' is historical dataT is the length of the sliding window of the model input data, T' is the time length of the prediction sequence:

Technical Field

The invention mainly relates to the field of intelligent traffic systems, in particular to a system and a method for predicting urban area traffic oriented to vehicle track big data.

Background

Along with the continuous improvement of the living standard of people and the promotion of the urbanization process. The amount of personal belongings, which are one of the main means of transportation for people to travel, is also increasing dramatically. Taking China as an example, according to statistics, by 2019, the amount of private cars is guaranteed to break through 2 hundred million cars, 66 city cars in the country are guaranteed to exceed million cars, and 30 cities exceed 200 million cars. The contradiction between the rapid increase of the holding capacity of various vehicles and the limited urban space resources is increasingly intensified, and the urban road traffic brings huge pressure and also causes the problems of congestion, accidents, difficult parking and the like.

The urban area traffic flow prediction is taken as a research hotspot in the field of intelligent transportation, aims to predict future traffic flow by using historical urban area traffic flow, and can be particularly applied to the aspects of reasonable traffic resource allocation, risk early warning, urban planning, trip planning and the like. With the popularization of services such as a Global Positioning System (GPS) based on location technology and the like on various device platforms, a convenient method is provided for collecting massive vehicle trajectory data in real time. The vehicle track characteristics reflect the travel preference of a driver to a certain extent, the track data records the time-space characteristics that the travel rule of the driver implies the urban traffic flow transfer, and the different attractiveness of each area of the city to people is shown.

Statistical methods such as ARIMA and Kalman filtering are widely applied in the field of traffic flow prediction, but these methods can only study the traffic flow of a single area and cannot extract effective time-space correlation. At present, the machine learning method obtains good results in the field, and still has some defects: the long-term and short-term memory network regards the traffic data as sequence data and can only capture time correlation; but still cannot well capture the complex spatio-temporal correlations between the whole urban area; the convolutional neural network method can only process the tensor structure of the euclidean space; graph structures prove their effectiveness in modeling non-euclidean type spatial data, and previous studies have generally modeled traffic data as a space-time graph and extracted spatial correlations of geographic locations using graph neural networks, temporal correlations of sequences using cyclic neural networks, and the like. However, the conventional graph convolutional neural network research mainly focuses on a static undirected graph, and dynamic relations between vertexes are not usually considered, so that global spatial relations changing at each moment cannot be captured, and influences on flow caused by different vertex region functional regions are ignored. Meanwhile, the existing work mainly considers the inflow and outflow amount among the areas, but does not research the inflow source and the outflow destination, neglects the mutual influence of traffic flow change among the areas, and the outflow flow of a certain area is finally the inflow flow of other areas in the global aspect, and the inflow flow of the area is composed of the outflow flow of other areas similarly; the influence of external factors such as weather, events, holidays and the like on the traffic flow is also ignored.

Disclosure of Invention

The invention aims to provide a system and a method for predicting urban area traffic oriented to vehicle track big data aiming at the defects of the prior art.

The purpose of the invention is realized by the following technical scheme: an urban area traffic prediction system for vehicle track big data comprises a data acquisition module and a traffic prediction module;

the data acquisition module acquires track data and environmental information data of a vehicle to form a historical information data set, and specifically comprises the following steps: acquiring vehicle track data without privacy information through a terminal with a GPS or Beidou positioning function; obtaining regional weather data through an API (application program interface) of weather query service; counting time information and holiday data by inquiring a calendar; acquiring event data through a web crawler technology; clustering the shop information provided by a map service provider to obtain spatial information and regional POI information; the historical information data set forms an integral historical inflow and outflow matrix and an urban area traffic transfer diagram;

the flow prediction module extracts the characteristics of the trajectory data of the vehicle and predicts the vehicle flow; the system comprises a global space-time feature extraction module, a flow transfer feature extraction module, a flow change feature fusion module, an external feature embedding module and a combined feature prediction module;

the global space-time feature extraction module uses a 5 multiplied by 5 two-dimensional convolution core to carry out local space feature extraction on the whole historical inflow and outflow matrix at each moment so as to obtain local space features of a plurality of time segments; then, stacking the extracted local space characteristics of a plurality of time segments and inputting the stacked local space characteristics into a multilayer space-time convolution neural network for convolution operation to obtain historical flow space-time characteristics;

the flow transfer characteristic extraction module extracts the flow transfer space-time characteristics of the urban area flow transfer graph by combining a graph convolution neural network with a long-term and short-term memory network; the long-short term memory network is used for extracting the time characteristic of the flow transfer;

the flow change characteristic fusion module: fusing historical flow space-time characteristics output by the global space-time characteristic extraction module and flow transfer space-time characteristics output by the flow transfer characteristic extraction module by adopting a two-dimensional convolution layer and an activation layer, and outputting fused flow change characteristics;

the external feature embedding module: respectively encoding time information, space information and environment information, embedding the time information, the space information and the environment information through a two-layer full-connection network to obtain a time embedded vector, a space embedded vector and an environment embedded vector, and fusing the 3 embedded vectors to obtain embedded external features;

the joint feature prediction module: inputting the fused external features output by the external feature embedding module and the flow change features output by the flow change feature fusing module, and adding the external features and the flow change features of the corresponding time and place to obtain flow combined features embedded with the external features; and stacking convolutional attention units based on a convolutional neural network layer and a multi-head attention network, learning attention weights in the joint features at the previous moment, and predicting the inflow and outflow flow of the region at the next moment.

A city area traffic prediction method facing vehicle track big data specifically comprises the following steps:

(1) recording the track data of the vehicle through a data acquisition module, and collecting environment information data of relevant areas and relevant time according to the corresponding track data to form a historical information data set; the track data of the vehicle is vehicle track data without privacy information, and comprises historical travel track data and the residence time of the vehicle; the environment information data comprises regional weather data, time information, holiday data, event data, spatial information, a city map, road network information and regional POI information; clustering all POI information of each region to obtain functional region classification information;

(2) constructing an integral historical inflow and outflow matrix of each time segment according to the historical travel track data acquired in the step (1);

(3) according to the environmental information such as the urban map, the road network information and the functional area information collected in the step (1), combining historical travel track data to construct a regional flow transfer graph among various regions;

(4) the method for constructing the spatio-temporal convolution-attention network traffic prediction deep learning model based on the joint features comprises the following steps of:

(4.1) inputting the whole inflow and outflow matrix of each historical time segment constructed in the step (2) into a global space-time feature extraction module, and outputting historical flow space-time features;

(4.2) inputting the regional flow transfer graphs among the regions obtained in the step (3) into a flow transfer feature extraction module, and extracting flow transfer spatio-temporal features of the urban regional flow transfer graphs by adopting a graph convolution-based neural network and a long-short term memory network;

(4.3) fusing the flow transfer space-time characteristics obtained in the step (4.2) with the historical flow space-time characteristics obtained in the step (4.1) by using a flow change characteristic fusion module to obtain fused flow space-time characteristics;

(4.4) respectively encoding time information, space information and environment information by using an external feature embedding module, enabling historical information data sets of external features such as the environment information and the like acquired in the step (1) to pass through a two-layer full-connection network, and simultaneously performing word embedding operation on the time information and the space information of the fused flow space-time feature output in the step (6) to obtain embedded external features;

(4.5) inputting the fused flow space-time characteristics obtained in the step (4.3) and the embedded external characteristics obtained in the step (4.4) into a joint characteristic prediction module, outputting flow joint characteristics in which the external characteristics are embedded, and obtaining a space-time convolution-attention network flow prediction deep learning model based on the joint characteristics when the area at the next moment flows in and flows out;

(5) training the space-time convolution-attention network flow prediction deep learning model based on the joint features output in the step (4) by using the historical travel track data acquired in the step (1), comparing the prediction output after the model is trained with a true value, and updating the parameters of the model by adopting an adam optimization algorithm if an error function is out of a set threshold value; if the error function meets the threshold value, the parameters are saved, and a trained space-time convolution-attention network model based on the joint features is obtained.

Further, the step (2) is specifically: divide the whole research area intoRectangular subregions, L and H being the length and width of the entire investigation region, and L and H being the length and width of the rectangular subregions. The historical track data (y) of the vehicle collected from the step (1) is taken as a time interval by tau1,...,yT) In (ii), count the ith sub-region GiThe inflow and outflow amount of the vehicle in the whole area at the moment ((a-1) × tau, a × tau) is obtained in the a-th time periodAnd vehicle outflowThe city overall inflow and outflow matrix of the whole area in the a-th time period can be represented as a two-dimensional matrix of two channels n × nT timesArranging the traffic flow of the segments according to the time sequence to obtain an integral inflow and outflow matrix Vol ═ Vol of the city history1,Vol2,...,VoltAnd (c) the step of (c) in which,

further, the step (3) is specifically: the road network structure of the urban area is built into a graph structureWhereinIs in all sub-regions (G)1,G2,...,Gn) The set of components is composed of a plurality of groups, is a connectivity matrix in which the element AC[i,j]Representing connectivity of the space between the corresponding ith and jth sub-regions; edge epsilon between nodeskRepresenting the specific flow transfer quantity among the sub-areas in the k time period; then dividing the time interval of tau into (k-1) x tau, k x tau) time intervals to obtain a city area flow transfer graph Where N × N represents the number of nodes, and d represents the number of types of the historical observation features.

Further, the step (4.1) is specifically:

firstly, using a 5 multiplied by 5 two-dimensional convolution core to check a historical integral inflow and outflow matrix of a city at each moment to extract local spatial features, and obtaining the local spatial features of a plurality of time slices; then extracting a plurality of timesStacking the local spatial features of the segments, inputting the stacked local spatial features into a multilayer space-time convolution neural network, and performing convolution operation to obtain historical flow space-time features; the multilayer space-time convolution neural network is composed of basic neural network layers such as an input layer, a plurality of two-dimensional convolution layers, a three-dimensional convolution layer, a pooling layer, a full-connection layer and an output layer; the convolutional neuron matrix of the ith layer of space-time convolutional neural network convolutional the mth channel is positioned at the output of (x, y, z)The following were used:

wherein the content of the first and second substances,the parameter at (p, q, R) in the convolution neuron matrix of the m-channel, which is the ith layer of the three-dimensional convolution kernel, RiIs the dimension of the Conv3D convolution kernel on the time axis,is the output value in the i-1 st layer convolution at (x + p, y + q, z + r) in the m channel, bimIs the deviation vector of the three-dimensional convolution kernel; ReLU is an excitation function;

finally, the global space-time characteristic extraction module outputs historical flow space-time characteristics of the whole historical inflow and outflow matrix

Further, said step (4.2) comprises the sub-steps of:

(4.2.1) extracting the flow transfer spatial correlation among the sub-regions by using a flow transfer characteristic extraction module through a graph convolution network, wherein the calculation formula is as follows:

whereinAs an input to the graph convolution network,is the output of the network and is,INis an identity matrix of dimension N,for the fineness matrix, W is the parameter to be learned by the graph convolution network, sinThe number of time segments for inputting the graph convolution network;

(4.2.2) extracting the time correlation and the short-term time change rule of flow transfer among the sub-regions by using a long-term and short-term memory network, and fusing the flow transfer space correlation and the time correlation of flow transfer into flow transfer space-time characteristics through a full-connection network; historical regional traffic diversion graphAs input, the flow transfer characteristic extraction module is used for extracting characteristics and outputting flow transfer space-time characteristics

Further, the step (4.3) is specifically:

by utilizing a flow change characteristic fusion module, the flow space-time characteristics are obtained by fusing the vehicle travel flow global space-time characteristics and the inter-area flow transfer characteristics

Wherein, W is the learning parameter of the converged network layer, b is the deviation vector, and Concat (■) represents the splicing operation of the element matrix in the brackets.

Further, the step (4.4) is specifically:

spatial information embedding: taking the vector of the node as input, and obtaining a space embedded vector by using a two-layer fully-connected neural network

Time information embedding: embedding each time slice in the historical information data set to obtain a corresponding time embedding vector: dividing one day into T time sections, and encoding the day of the week and the time section of each day into T time sections by using one-hot encodingAndis spliced intoUsing two layers of fully connected neural networks to obtain time-embedded vectorsWherein k represents the kth time slice;

embedding environmental information: selecting four pieces of environmental information of weather, temperature, special events and holidays to embed the characteristics, wherein the weather comprises: in sunny weather, rain weather, snow weather, wind, cloud weather and thunder weather, vectors are generated by adopting single-hot coding, and the temperature is an original temperature value; the special events and the holidays are respectively represented by using a 1-dimensional vector; splicing the vectors to obtainUsing two layers of fully connected neural networks to obtain the environment embedded vector of the k time period

Then, the 3 feature embedding vectors are fused to obtain the embedded external features

Further, the step (4.5) is specifically:

and predicting by adopting an Attention network, wherein the Attention (Q, K, V) of each node is as follows:

wherein the content of the compound Q is as follows,representing queries, keys and values of respective nodes, dkIs the query and key dimensions of each node, dvIs the dimension of the value of each node;

flow space-time characteristics output by the flow change characteristic fusion moduleAnd external featuresMerging is carried outTo obtain (h)1,...,hk) And stack them asSuperscript viRepresenting its corresponding node; is connected withAlignment matrixLinear transformation into queries, keys and values for each node:

the parameters of the transformation matrix to be learned are shared by all the nodes. The attention structure is as follows:

further, the step (5) is specifically:

the model for the whole region traffic prediction is represented by f (), (y)1,...,yk) The predicted value of the urban area flow from the k +1 th time to the k + T' is historical dataT is the length of the sliding window of the model input data, T' is the time length of the prediction sequence:

the invention has the beneficial effects that: the invention can provide the effective time-space correlation extraction and can predict the urban area flow for a long time. The method and the device can be applied to urban vehicle flow prediction and other types of flow prediction, such as high-speed vehicle flow, scenic spot pedestrian flow and the like. And even the scenes of the prediction of the spatio-temporal events in other fields, such as the prediction of the volume of a takeout order, the demand of taking a car by a network appointment and the like. According to the urban regional traffic flow prediction method, the regional traffic flow change, the weather and other external characteristics are taken into consideration, so that the urban regional traffic flow prediction result is more accurate.

Drawings

FIG. 1 is a flow chart of a method of an urban area traffic prediction system oriented to vehicle trajectory big data according to the present invention;

FIG. 2 is a basic structure of a spatio-temporal convolution-attention network traffic prediction deep learning model based on joint features.

Detailed Description

The invention is further described below with reference to the drawings and specific preferred embodiments of the description, without thereby limiting the scope of protection of the invention.

The traffic flow of an urban vehicle is made up of the number of vehicles driving into and out of the urban area. The generation of the flow is influenced by the dynamic interaction of regional functions and inter-regional travel flow, and is also related to the parking time of the vehicle in the track. Different functional areas at the same time have different traffic flow characteristics: for example, in the morning, the flow rate is mainly transferred from the residential area to the work area, and in the evening, the flow rate is transferred from the work area to the residential area. And the same type of functional area in different areas also has different time characteristics: also in schools, primary school and high school areas have distinct time characteristics due to different school hours. How to extract the space-time characteristics of vehicle travel in each region is the key for accurately predicting the traffic flow, and meanwhile, the influence of other external characteristics such as weather, holidays and the like on the traffic flow is also taken into consideration.

The invention discloses an urban area traffic prediction system facing vehicle track big data, which comprises a data acquisition module and a traffic prediction module.

The data acquisition module is responsible for gathering the trajectory data and the environmental information data of vehicle, specifically is: acquiring vehicle track data without privacy information through a terminal with a GPS or Beidou positioning function; obtaining regional weather data through an API (application program interface) of weather query service; counting holiday data by inquiring a calendar; acquiring event data through a web crawler technology; and clustering the shop information provided by the map service provider to acquire the POI information of the region. The historical information data set constitutes an overall historical inflow and outflow matrix

The flow prediction module is responsible for extracting various characteristics of historical track data and predicting the traffic flow; the system comprises a global space-time feature extraction module, a flow transfer feature extraction module, a flow change feature fusion module, an external feature embedding module and a combined feature prediction module.

The global space-time characteristic extraction module extracts the flow space-time characteristics of the whole historical inflow and outflow matrix through a multilayer space-time convolution neural network, and the multilayer space-time convolution neural network is composed of basic neural network layers such as an input layer, a two-dimensional convolution layer, a three-dimensional convolution layer, a pooling layer, a full connection layer and an output layer.

The flow transfer feature extraction module: the method comprises the steps of extracting flow transfer space-time characteristics of an urban area flow transfer diagram by adopting a diagram convolution neural network and a long and short term memory network, wherein the diagram convolution neural network is used for extracting the spatial correlation of flow transfer, the long and short term memory network is used for extracting the time correlation of flow transfer, and the two correlations are synthesized through a full connection layer to output the flow transfer space-time characteristics.

The flow change characteristic fusion module: and fusing the flow space-time characteristics and the flow global space-time transfer characteristics by adopting a two-dimensional convolutional layer and an active layer, and outputting flow change characteristics.

The external feature embedding module: respectively coding the time characteristic, the space characteristic and the environment characteristic, embedding through a two-layer full-connection network to obtain a time embedded vector, a space embedded vector and an environment embedded vector, and then fusing the 3 embedded vectors to obtain fused external characteristics.

The joint feature prediction module: and inputting the fused external features output by the external feature embedding module and the flow change features output by the flow change feature fusion module, and adding the external features and the flow change features of the corresponding time and place to obtain the flow combination features embedded with the external features. And then, stacking convolutional attention units based on a convolutional neural network layer and a multi-head attention network, learning attention weights in the joint features at the previous moment, and predicting the inflow and outflow flow of the region at the next moment.

The invention provides a vehicle trajectory big data-oriented urban area traffic prediction method, which specifically comprises the following steps as shown in a flow chart of figure 1:

(1) recording track data of the vehicle through a data acquisition module, and collecting environment information data of relevant time of relevant areas according to the corresponding track data to form a historical information data set; the track data of the vehicle is vehicle track data without privacy information, and comprises time, longitude and latitude and the residence time of the vehicle; the environment information data comprises regional weather data, holiday data, event data, city maps, road network information and regional POI information; and clustering all POI information of each region to obtain functional region classification information.

(2) Constructing an integral historical inflow and outflow matrix of each time segment according to the historical information data set output in the step (1), wherein the specific steps are as follows;

the invention divides the whole research area intoRectangular subregions, L and H being the length and width of the entire investigation region, L and H being the length and width of the rectangular subregions,the historical track data (y) of the vehicle collected from the step (1) is taken as a time interval by tau1,...,yT) In (ii), count the ith sub-region GiThe inflow and outflow amount of the vehicle in the whole area at the moment ((a-1) × tau, a × tau) is obtained in the a-th time periodAnd vehicle outflowThe city total inflow and outflow matrix of the whole area in the a-th time periodExpressed as a two-dimensional matrix of two channels n x nArranging the traffic flow of the t time slices according to the time sequence to obtain an integral inflow and outflow matrix Vol ═ Vol of the city history1,Vol2,...,VoltAnd (c) the step of (c) in which,

(3) according to the environmental information such as the urban map, the road network information and the functional area information collected in the step (1), combining historical travel track data to construct a regional flow transfer graph among various regions, wherein the specific method is as follows;

firstly, a flow transfer graph of an urban area is constructed, and a graph structure is constructed by a road network structure of the urban areaWhereinIs in all sub-regions (G)1,G2,...,Gn) The set of components is composed of a plurality of groups, is a connectivity matrix in which the element AC[i,j]The connectivity of the space between the corresponding ith and jth sub-regions is represented and calculated according to the number and distance of the connected roads between the regions; edge epsilon between nodeskRepresenting the specific flow transfer quantity among all the sub-areas in the kth time period, and combining the staying time of each section of track, functional area classification and the like as edges epsilonkA weight of (2). If the edge between two nodes is epsilonkAnd if the sub-regions do not exist, the sub-regions are not in traffic transfer relationship. Then dividing the time interval by tau to obtain the time interval of ((k-1) × tau, k × tau)City area traffic transfer diagram of time slotsWhere N × N represents the number of nodes, and d represents the number of types of the historical observation features.

(4) The method comprises the following steps of constructing a spatio-temporal convolution-attention network traffic prediction deep learning model based on joint features, wherein the structural diagram of the spatio-temporal convolution-attention network traffic prediction deep learning model based on the joint features is shown in FIG. 2, and the method comprises the following steps:

(4.1) inputting the integral historical inflow and outflow matrix constructed in the step (2) into a global space-time characteristic extraction module, and outputting historical flow space-time characteristics, wherein the specific method is as follows;

due to the continuity of inflow and outflow tracks of vehicles, any flow transfer can pass through a plurality of areas around the area, so that the historical integral inflow and outflow matrix of the city at each moment is checked by using a 5 x 5 two-dimensional convolution to extract local spatial features, and the local spatial features of a plurality of time segments are obtained; and then stacking the extracted local spatial features of the plurality of time segments as input, performing convolution operation by using a multilayer space-time convolution neural network, and extracting the global space-time feature of the vehicle flow. The multilayer space-time convolution neural network is composed of basic neural network layers such as an input layer, a plurality of two-dimensional convolution layers, a three-dimensional convolution layer, a pooling layer, a full-connection layer and an output layer, wherein the convolution kernel can be Conv3D three-dimensional convolution kernels with the sizes of 3 x 3 and 3 x 12. The convolutional neuron matrix of the ith layer of space-time convolutional neural network convolutional the mth channel is positioned at the output of (x, y, z)Obtained from the formula (1).

Wherein the content of the first and second substances,the parameter at (p, q, R) in the convolution neuron matrix of the m-channel, which is the ith layer of the three-dimensional convolution kernel, RiIs the dimension of the Conv3D convolution kernel on the time axis,is the output value in the i-1 st layer convolution at (x + p, y + q, z + r) in the m channel, bimIs the deviation vector of the three-dimensional convolution kernel. The excitation function ReLU is specifically expressed as formula (2):

ReLU(x)=max(0,x) (2)

finally, the global space-time characteristic extraction module outputs historical flow space-time characteristics of the whole historical inflow and outflow matrix

(4.2) inputting the historical regional flow transfer graph obtained in the step (3) into a flow transfer feature extraction module, and extracting flow transfer spatio-temporal features between regions by using a graph convolution-based long-short term memory network structure, wherein the flow transfer spatio-temporal features comprise the following substeps;

(4.2.1) extracting the spatial correlation of the flow transfer among the sub-regions by using a flow transfer characteristic extraction module through a graph and volume network (GCN), wherein the detailed formula is shown in a formula (3):

whereinAs an input to the graph convolution network,is the output of the network and is,INis an identity matrix of dimension N,for the fineness matrix, W is the parameter to be learned by the graph convolution network, sinIs the number of time segments input into the graph convolution network.

(4.2.2) the long-short term memory network (LSTM) is responsible for extracting the time relevance and the short-term time change rule of the flow transfer among the sub-regions, which are detailed in the formulas (4) and (5);

ft=σ(Wxfxt+Whfht-1+bf)

it=σ(Wxixt+Whiht-1+bi)

ot=σ(Wxoxt+Whoht-1+bo)

ct=ft⊙ct-1+it⊙tanh(Wxcxt+Whcht-1+bc

ht=ot⊙tanh(ct) (4)

where t is the t-th LSTM memory cell, ft,itAnd otIs the gate vector of the t-th LSTM memory cell, which controls the forgetting, updating and outputting of the LSTM memory cell, respectively, ctAndas the state vector and hidden state of the memory cell, ct-1And ht-1For the state vector and the hidden state of the last memory cell, the activation function isIndicates multiplication of corresponding elements of matrix, xtIs an input vector of the memory cell, Wxf,Whf,Wxi,Whi,Wxo,Who,Wxc,WhcFor the parameters to be learned in the linear transformation matrix, bf,bi,bo,bcIs the corresponding deviation vector, XoutTo provide the memory forThe input of the cell, the output of the graph convolution network.

The expression of the LSTM layer is simplified to formula (5):

ht,ct=LSTM(xt,ht-1,ct-1) (5)

the flow transfer characteristic extraction module is formed by combining and stacking a graph convolution network and a long-term and short-term memory network; finally, the spatial relevance of the flow transfer and the temporal relevance of the flow transfer are fused into flow transfer space-time characteristics through a full-connection network; historical regional traffic diversion graphAs input, the flow transfer characteristic extraction module is used for extracting characteristics and outputting flow transfer space-time characteristics

(4.3) fusing the flow transfer space-time characteristics obtained in the step (4.2) with the historical flow space-time characteristics obtained in the step (4.1) by using a flow change characteristic fusion module to obtain fused flow space-time characteristics, wherein the specific method is as follows;

from the perspective of regional global and longer time segments of division, the inflow of a certain region is composed of the outflow of other regions, and likewise, the outflow of the certain region will be converted into the inflow of other regions. By utilizing a flow change characteristic fusion module, the flow space-time characteristics are obtained by fusing the vehicle travel flow global space-time characteristics and the inter-area flow transfer characteristicsAs in equation (6):

wherein, W is the learning parameter of the converged network layer, b is the deviation vector, and Concat (■) represents the splicing operation of the element matrix in the brackets.

(4.4) respectively encoding time information, spatial information and environmental information by using an external feature embedding module, performing word embedding (embedding) operation on historical information data sets of external features such as the environmental information and the like acquired in the step (1) through a two-layer full-connection network, and simultaneously performing word embedding (embedding) operation on the time information and the spatial information in the flow space-time feature output in the step (4.3) to obtain embedded external features, wherein the specific method comprises the following steps:

spatial information embedding: in order to model spatial relation among all sub-regions, road network structure information is transmitted into a joint prediction module, vectors of nodes are used as input, and spatial embedded vectors are obtained by using two layers of fully-connected neural networks

Time information embedding: simultaneously embedding each time slice in the historical information data set to obtain a corresponding time embedding vector: dividing a day into T time segments, One-hot coding can be used to code the day of the week and the time segments of each day intoAndis spliced intoUsing two layers of fully connected neural networks to obtain time-embedded vectorsWhere k denotes the kth time slice.

Embedding environmental information: in the section, four pieces of environmental information of weather, temperature, special events and holidays are selected for characteristic embedding, wherein the weather comprises the following steps: the vector is generated by adopting single-hot coding for six meteorology of sunny weather, rain weather, snow weather, wind weather, cloud weather and thunder weather(ii) a The temperature is an original temperature value and is a 2-dimensional vector; the special event and the holiday are respectively represented by a 1-dimensional vector, wherein 0 represents no and 1 represents yes; splicing the vectors to obtainUsing two layers of fully connected neural networks to obtain the environment embedded vector of the k time period

Then, the 3 feature embedding vectors are fused to obtain the embedded external featuresAs shown in equation (7):

(4.5) inputting the fused flow space-time characteristics obtained in the step (4.3) and the embedded external characteristics obtained in the step (4.4) into a joint characteristic prediction module, outputting flow joint characteristics embedded with the external characteristics, and obtaining a space-time convolution-attention network flow prediction deep learning model based on the joint characteristics by flowing in and flowing out of an area at the next moment, wherein the specific method comprises the following steps:

in the joint feature prediction module, an Attention network is used for prediction, and the Attention (Q, K, V) of each node is calculated by the following formula, as shown in formula (8)

Wherein the content of the compound Q is as follows,representing queries, keys and values of respective nodes, dkIs the query and key dimensions of each node, dvIs the value of each nodeOf (c) is calculated.

Flow space-time characteristics output by the flow change characteristic fusion moduleAnd external featuresMerging is carried outTo obtain (h)1,...,hk) And stack them asThe superscript indicates that the corresponding node is vi. Then to the matrixLinear transformation to queryKey with a key bodyAnd a value V, as shown in equation (9):

the parameters of the transformation matrix to be learned are shared by all the nodes. Attention structureCan be written as shown in equation (10) as follows:

(5) training the space-time convolution-attention network (MSTC-AN) flow prediction deep learning model based on the joint features constructed in the step (4) by using historical data, comparing the prediction output after the model training with a true value, and updating the parameters of the model by adopting AN adam optimization algorithm if AN error function is out of a set threshold value; if the error function meets the threshold value, the parameters are saved, and a trained space-time convolution-attention network model based on the joint features is obtained.

The model of the whole area flow prediction represented by f () is expressed by the formulas (11), (y)1,...yk) The predicted value of the urban area flow from the k +1 th time to the k + T' is historical dataT is the length of the sliding window of the model input data, T' is the time length of the prediction sequence:

in this embodiment, the threshold is set to 1, and the threshold can be adjusted according to the requirement of prediction accuracy. The model is trained to minimize the loss function of the output predicted value and the real value, and the loss function in the model is calculated by adopting the following method, such as formula (12):

as shown in table 1, the urban traffic flow prediction framework method based on the space-time convolutional attention network with joint features performs multi-step prediction on Shenzhen data set (i.e. when the length of the prediction sequence is T' ═ 3), and compares with ARIMA (differential autoregressive moving average model), SVR (support vector machine linear regression model), stepdata (3-dimensional convolutional-based flow prediction model), FC-LSTM (fully-connected long-short term memory network model), T-GCN (time map convolutional network model), RMSE (root mean square error) and MAPE (mean absolute percentage error) of MDL;

TABLE 1

As shown in Table 1, the spatio-temporal convolution-attention network (MSTC-AN) flow prediction deep learning model based on the combined features has the smallest RMSE and MAPE in experiments with time intervals of 30 minutes and 60 minutes, and has more accurate prediction results compared with other prediction models.

The foregoing is considered as illustrative of the preferred embodiments of the invention and is not to be construed as limiting the invention in any way. Although the invention has been described with reference to preferred embodiments, it is to be understood that the invention is not limited thereto. Those skilled in the art will recognize that many changes and modifications may be made to the disclosed embodiments, or equivalent embodiments may be modified, without departing from the scope of the disclosed embodiments, without departing from the spirit and scope of the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical spirit of the present invention should fall within the protection scope of the technical scheme of the present invention, unless the technical spirit of the present invention departs from the content of the technical scheme of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种能够实现网络协同的道路交通信号控制机

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!