Traffic flow prediction method, device and storage medium integrating multi-source spatiotemporal data

By constructing a regional spatiotemporal relationship diagram and integrating the spatiotemporal characteristics of historical flow and trajectory data, the problem of separate consideration of time and space correlation in the prior art is solved, and the accuracy and calculation efficiency of traffic flow prediction are improved.

CN116089875BActive Publication Date: 2025-01-17GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310084450.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-13
Publication Date
2025-01-17
Estimated Expiration
2043-01-13

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods separate the temporal correlation and spatial correlation, ignoring the results of the interaction between the two, resulting in low accuracy of traffic flow prediction.

Method used

By obtaining the historical traffic data and trajectory data of the region, a regional spatiotemporal relationship diagram is constructed, and spatial characteristics, temporal characteristics and traffic flow characteristics are trained to obtain spatial and temporal correlations, and finally a fully connected neural network is used to predict traffic flow.

Benefits of technology

It improves the accuracy of traffic flow prediction, breaks through the limitations of the long-tail effect, and improves computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089875B_ABST
    Figure CN116089875B_ABST
Patent Text Reader

Abstract

The present invention discloses a traffic flow prediction method, device and storage medium that fuse multi-source spatiotemporal data. The method includes obtaining historical traffic flow data and trajectory data of regional traffic from time 0 to t-1; constructing a regional spatiotemporal relationship diagram according to the trajectory data; training the regional spatiotemporal relationship diagram according to the historical traffic flow data and the regional spatial relationship to obtain the spatial feature vector, time feature and traffic flow feature of each region; fusing the spatial feature vector, time feature and traffic flow feature to obtain the spatiotemporal feature of each region at time t; learning the spatiotemporal correlation between regions according to the graph neural network and spatiotemporal features to obtain the final regional features; predicting according to the fully connected neural network and the final regional features to obtain the traffic inflow prediction value and the traffic outflow prediction value. The method improves the accuracy of traffic flow prediction by fusing historical traffic flow data with trajectory data and fusing time and space correlation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a traffic flow prediction method, device and storage medium integrating multi-source spatiotemporal data. Background Art

[0002] At present, the traffic flow in different areas of the city reflects the travel needs of urban residents. Accurate and efficient prediction of traffic flow in different areas is the basis for accurate vehicle dispatching and optimization of public transportation systems, which helps to alleviate urban traffic congestion and improve urban traffic efficiency. It is crucial to promote the coordinated development of smart transportation and smart cities. For example, based on accurate traffic flow prediction results, the traffic police department can conduct timely traffic diversion to alleviate congestion caused by excessive traffic; taxis, online car-hailing, shared bicycles and other companies can dispatch vehicles to ensure the car needs of citizens. At the same time, by accurately and timely predicting the flow of people at future moments, it can scientifically help government departments to timely dispatch security personnel to scenic spots and attractions with dense crowds, take temporary crowd control and evacuation measures, and minimize the probability of stampede accidents caused by excessive crowds, and avoid tragedies.

[0003] In one existing technology, traffic flow prediction methods are mainly based on regression models, such as ARIMA models and non-parametric regression models. These models consider the temporal correlation between future regional traffic flow and historical data, but lack consideration of spatial correlation between regions. At the same time, by extracting features from traffic data and using machine learning algorithms such as support vector machines, gradient boosting regression trees, random forests and other methods to predict traffic, they rely more on artificially defined features and lack in-depth consideration of spatiotemporal relationships.

[0004] In another existing technology, deep learning is used for short-term traffic flow prediction. For example, convolutional neural networks (CNN), graph neural networks (GNN), recurrent neural networks (RNN) and their variants, long short-term memory (LSTM), and GRU are used to train the spatial correlation between regions or the temporal correlation in historical traffic flow data. However, these methods focus on the correlation between local regions and have difficulty capturing the correlation between distant regions or the correlation over a long period of time.

[0005] In summary, the traffic flow prediction methods in the prior art consider temporal correlation and spatial correlation separately, ignoring the interaction between the two, resulting in low accuracy of traffic flow prediction. Summary of the invention

[0006] The present invention provides a traffic flow prediction method, device and storage medium that integrate multi-source spatiotemporal data to solve the technical problem that the traffic flow prediction method in the prior art considers time correlation and spatial correlation separately, ignores the result of the interaction between the two, and leads to low accuracy of traffic flow prediction.

[0007] In the first aspect, in order to solve the above technical problems, the present invention provides a traffic flow prediction method, device and storage medium integrating multi-source spatiotemporal data, including:

[0008] Obtain historical traffic flow data and trajectory data of regional traffic from time 0 to time t-1;

[0009] Constructing a regional spatiotemporal relationship diagram according to the trajectory data;

[0010] The regional spatiotemporal relationship diagram is trained according to the historical traffic data and the regional spatial relationship to obtain the spatial feature vector, time feature and traffic flow feature of each region;

[0011] The spatial feature vector, the time feature and the traffic flow feature are integrated to obtain the spatiotemporal feature of each area at time t;

[0012] The spatiotemporal correlation between regions is learned according to the graph neural network and the spatiotemporal features to obtain the final regional features;

[0013] Prediction is performed based on the fully connected neural network and the final regional characteristics to obtain a predicted value of traffic inflow and a predicted value of traffic outflow for each region at time t.

[0014] Preferably, constructing a regional spatiotemporal relationship graph according to the trajectory data includes:

[0015] For any two position points in the same trajectory data, the nodes r represented by the areas corresponding to the two position points are i With r j , connected by edges in the regional spatiotemporal relationship graph; where each region r in the regional spatiotemporal relationship graph i Represented by a node.

[0016] Preferably, the regional spatiotemporal relationship graph is trained according to the historical traffic data and the regional spatial relationship to obtain the spatial feature vector of each region, including:

[0017] The q-layer graph neural network is used to train the spatial features of each node in the regional spatiotemporal relationship graph:

[0018]

[0019] In the regional spatiotemporal relationship graph, each region is represented by a node r i express, Indicates the k-th layer network r i The spatial feature vector of , d is a hyperparameter, is a learnable parameter. Mean(·) represents the bitwise averaging operation of the vector. Neigh S (r i ) represents the space diagram r i Neighbor nodes, || represents the connection operation of two vectors, is a random vector;

[0020] The spatial features are learned by predicting whether two nodes are neighbor nodes:

[0021]

[0022] Among them, y ij To predict the result, 1 is used to indicate that two nodes are neighbor nodes, and 0 is used to indicate that two nodes are non-neighbor nodes; Sigmoid(·) indicates the Sigmoid activation function, and tanh(·) indicates the tanh activation function. and is a learnable parameter,

[0023] After the training As area r i The spatial feature vector of .

[0024] Preferably, the regional spatiotemporal relationship graph is trained according to the historical traffic data and the regional spatial relationship to obtain the time characteristics of each region, including:

[0025] Assume the prediction time interval is a hours, and train the time features based on the neural network:

[0026]

[0027] in, represents the time feature, Relu(·) is the Relu activation function, is the one-hot encoding at time t, one-hot encoding The length is and are learnable parameters.

[0028] Preferably, the regional spatiotemporal relationship graph is trained according to the historical traffic data and the regional spatial relationship to obtain the traffic flow characteristics of each region, including:

[0029] Using ri Traffic inflow from time t-1 to time t-k and traffic outflow for node r i Traffic flow characteristics at time t are learned; where represents the traffic inflow of r at time t-1 i , represents the traffic outflow of r at time t-1 i , and the historical traffic flow data includes and

[0030] Use a one-dimensional convolutional network to learn the traffic flow characteristics as follows:

[0031]

[0032] where Conv1(·) and Conv2(·) represent one-dimensional convolutional networks, the size of the convolutional kernel is 1×p (p<k), the stride is 1, the number of output channels is f, || represents the concatenation of two feature vectors, are learnable parameters, and l = 2×f×(k-p+1).

[0033] Preferably, learning the spatio-temporal correlation between regions according to the graph neural network and the spatio-temporal features to obtain the final region features includes:

[0034] Adopt a multi-head learning mechanism and a multi-layer network for learning. For the k-th layer network in the m-th head, the correlation and spatio-temporal features between two regions r i , r j at time t are calculated as:

[0035]

[0036]

[0037]

[0038] where is the spatio-temporal feature of region r i at time t in the (k-1)-th layer network in the m-th head, are learnable parameters, and d is the length of the feature vector;

[0039] Use the output of the last layer in each head as the region feature of that head

[0040] By fusing the regional features of each head, the final regional features are obtained

[0041]

[0042] in, is a learnable parameter, || represents the connection between two vectors, and M is the total number of heads.

[0043] Preferably, the prediction is performed based on the fully connected neural network and the final regional features to obtain the traffic inflow prediction value and the traffic outflow prediction value of each region at time t, including:

[0044] Based on each region i Final regional characteristics at time t Prediction via a fully connected neural network:

[0045]

[0046] in, Represents region r i The predicted value of traffic inflow at time t, Represents region r i The predicted value of traffic outflow at time t, are learnable parameters.

[0047] Preferably, the method further comprises:

[0048] Select RMSE as the loss function to train the traffic flow prediction model:

[0049]

[0050] Here, n represents the number of training data.

[0051] In a second aspect, the present invention provides a traffic flow prediction device integrating multi-source spatiotemporal data, comprising:

[0052] A data acquisition module is used to obtain historical flow data and trajectory data of regional traffic from time 0 to time t-1;

[0053] A space-time graph construction module, used to construct a regional space-time relationship graph based on the trajectory data;

[0054] A space-time graph training module is used to train the space-time relationship graph of the region according to the historical traffic data to obtain the spatial feature vector, time feature and traffic flow feature of each region;

[0055] A feature fusion module, used to fuse the spatial feature vector, the time feature and the traffic flow feature to obtain the spatiotemporal feature of each area at time t;

[0056] A feature learning module, used to learn the spatiotemporal correlation between regions based on the graph neural network and the spatiotemporal features to obtain final regional features;

[0057] The traffic flow prediction module is used to make predictions based on the fully connected neural network and the final regional characteristics to obtain the traffic inflow prediction value and the traffic outflow prediction value of each area at time t.

[0058] In a third aspect, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned traffic flow prediction methods for integrating multi-source spatiotemporal data.

[0059] Compared with the prior art, the present invention has the following beneficial effects:

[0060] The present invention provides a traffic flow prediction method integrating multi-source spatiotemporal data, comprising: obtaining historical traffic flow data and trajectory data of regional traffic from time 0 to time t-1; constructing a regional spatiotemporal relationship diagram according to the trajectory data; training the regional spatiotemporal relationship diagram according to the historical traffic flow data and the regional spatial relationship to obtain a spatial feature vector, a temporal feature and a traffic flow feature of each region; fusing the spatial feature vector, the temporal feature and the traffic flow feature to obtain the spatiotemporal feature of each region at time t; learning the spatiotemporal correlation between regions according to a graph neural network and the spatiotemporal features to obtain final regional features; and predicting according to a fully connected neural network and the final regional features to obtain a traffic inflow prediction value and a traffic outflow prediction value of each region at time t.

[0061] The present invention integrates the time and space correlation by integrating the historical traffic data and trajectory data, and by learning the spatiotemporal characteristics of the nodes, and considers the impact of the combined effect of time and space correlation in the final traffic prediction, thereby improving the accuracy of traffic flow prediction. At the same time, the present invention only calculates the correlation between related areas, breaking through the limitation of the long tail effect and improving the efficiency of calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flow chart of a traffic flow prediction method for integrating multi-source spatiotemporal data provided by the first embodiment of the present invention;

[0063] Figure 2It is a schematic diagram of the structure of a traffic flow prediction device that integrates multi-source spatiotemporal data provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] Reference Figure 1 The first embodiment of the present invention provides a traffic flow prediction method integrating multi-source spatiotemporal data, comprising the following steps:

[0066] S11, obtaining historical traffic flow data and trajectory data of regional traffic from time 0 to time t-1;

[0067] S12, constructing a regional spatiotemporal relationship diagram according to the trajectory data;

[0068] S13, training the regional spatiotemporal relationship graph according to the historical traffic data and the regional spatial relationship to obtain the spatial feature vector, time feature and traffic flow feature of each region;

[0069] S14, fusing the spatial feature vector, the time feature and the traffic flow feature to obtain the spatiotemporal feature of each area at time t;

[0070] S15, learning the spatiotemporal correlation between regions according to the graph neural network and the spatiotemporal features to obtain final regional features;

[0071] S16, predicting based on the fully connected neural network and the final regional characteristics to obtain a predicted value of traffic inflow and a predicted value of traffic outflow for each region at time t.

[0072] It is worth noting that short-term traffic flow prediction refers to predicting the traffic flow of different regions at future times (e.g., 15 minutes, half an hour, etc.) based on historical traffic data, including inflow and outflow. In order to achieve accurate short-term traffic flow prediction, it is necessary to consider both the traffic flow characteristics of the region itself and the complex dynamic spatiotemporal correlation between different regions.

[0073] (1) Local and global correlation between regions: Traffic flows in adjacent regions often have strong correlation (local correlation); at the same time, regions that are far away may also have greater correlation (global correlation) due to factors such as road network structure and vehicle flow. Taking into account the local and global correlation between regions helps improve the accuracy of model prediction.

[0074] (2) The combined effect of temporal and spatial correlation: The correlation between regional traffic flow and historical data varies from region to region and also changes dynamically over time. In addition, the correlation between regions has a delayed effect in the temporal dimension. For example, when the flow at an intersection increases, the flow in the region with a strong correlation with it will also gradually increase after a certain period of time. This shows that the correlation between regions is the result of the combined effect of temporal and spatial factors. Modeling the combined effect of temporal and spatial correlation is crucial to improving the accuracy of model predictions.

[0075] In the present invention, unlike the prior art that models temporal correlation and spatial correlation separately, the present invention integrates the effects of temporal correlation and spatial correlation, integrates global and local spatiotemporal correlation, considers the correlation between adjacent areas and distant areas, and further improves the prediction accuracy. At the same time, by integrating historical traffic data and trajectory data, more information is provided for the correlation between areas, improving the expression and prediction capabilities of the model.

[0076] In steps S11 and S12, the historical traffic flow data of the area from time 0 to time t-1 and the trajectory data between areas, such as vehicle trajectory, are first obtained. Then, a regional spatiotemporal relationship graph is constructed to represent the spatiotemporal relationship between different areas. In the regional spatiotemporal relationship graph, each area r i Represented by a node, the edges between nodes in the spatiotemporal relationship graph are constructed through trajectory data.

[0077] Specifically, for any two position points in the same trajectory data, the nodes r represented by the regions corresponding to the two position points are i With r j , connected by edges in the regional spatiotemporal relationship graph; where each region r in the regional spatiotemporal relationship graph i Represented by a node.

[0078] For example, given a vehicle trajectory Tra = {(p1, t′1), (p2, t′2), …, (p n ,t′ n )}, where p i =(lat i ,lon i ) represents the latitude and longitude of the location, t′ iIndicates that the vehicle is at p i For any two positions in the same trajectory data, the nodes r represented by the areas corresponding to the two positions are i With r j , connected by edges in the space-time graph, indicating that there is a trajectory passing through these two areas.

[0079] In the present invention, the trajectory data between regions is used to construct the edges between nodes, and the spatiotemporal characteristics of the nodes (regions) are learned through historical traffic data. i The prediction of time t is to obtain node r by integrating the information of space, time and flow. i The space-time feature vector at time t.

[0080] In step S13, the regional spatiotemporal relationship diagram is trained according to the historical traffic data and the regional spatial relationship to obtain the spatial feature vector, time feature and traffic flow feature of each region.

[0081] In one implementation, a spatial graph is constructed and the spatial feature vector of each region is obtained through pre-training. If two nodes are adjacent in space, they are connected with an edge to construct a spatial graph. For each node in the graph, a q-layer graph neural network is used to learn the spatial features:

[0082]

[0083] in, Indicates the k-th layer network r i The characteristic representation of , d is a hyperparameter, is a learnable parameter. Mean(·) represents the bitwise averaging operation of the vector. Neigh S (r i ) represents the space diagram r i Neighbor nodes, || represents the connection operation of two vectors, is a random vector.

[0084] The spatial features are learned by predicting whether two nodes are neighbor nodes:

[0085]

[0086] Among them, y ij To predict the result, 1 is used to indicate that two nodes are neighbor nodes, and 0 is used to indicate that two nodes are non-neighbor nodes; Sigmoid(·) indicates the Sigmoid activation function, and tanh(·) indicates the tanh activation function. and is a learnable parameter,

[0087] Furthermore, for training, for each node, the nodes adjacent to it are collected as positive samples, and the same number of non-adjacent nodes are collected as negative samples, and the cross entropy loss function is used as the loss function for pre-training. As area r i The spatial feature vector of contains the spatial relationship with other regions.

[0088] In one implementation, the 24 hours of a day are divided into For example, if the prediction time interval is 0.5 hours, a day can be divided into 48 time periods. Therefore, for the case where the prediction time interval is a hours, a time period of length One-Hot Encoding Indicates time.

[0089] Among them, the front Indicates the hour information. For the predicted time t, which time period it belongs to, the corresponding position value is 1, and the rest of the values ​​are 0; for the last seven digits, it indicates Monday to Sunday. For the predicted time t, which day of the week it belongs to, the corresponding position value is 1, and the rest of the positions are 0. For example, if the prediction time interval is 0.5 hours, the time information is represented by a one-hot encoding with a length of 55. For Monday morning 0:30, the values ​​of the second and 49th positions are 1, and the values ​​of the rest of the positions are 0.

[0090] Specifically, let the prediction time interval be a hours, and use the neural network to learn the time features:

[0091]

[0092] Among them, Relu(·) is the Relu activation function, is the one-hot encoding at time t, and are learnable parameters.

[0093] In one implementation, the regional spatiotemporal characteristics change dynamically over time. i Traffic flow prediction at time t is done by using r i Traffic inflow from time t-1 to time tk Traffic outflow For node r i Traffic flow characteristics at time t To study. represents the time r at t-1 i The traffic inflow, Denote the traffic outflow at time t-1 of r i The historical traffic flow data includes and

[0094] Use a one-dimensional convolutional network to learn The size of the convolutional kernel is 1×p (p<k), the stride is 1, and the number of output channels is f:

[0095]

[0096] Among them, Conv1(·) and Conv2(·) represent one-dimensional convolutional networks, || represents the connection of two feature vectors, are learnable parameters, l = 2×f×(k - p + 1).

[0097] In step S14, fuse the spatial feature vector, the time feature, and the traffic flow feature to obtain the spatio-temporal feature of each region at time t.

[0098] Specifically, further fuse information such as space, time, and traffic flow to obtain the spatio-temporal feature of region r i at time t, which can be calculated in the following way:

[0099]

[0100] Among them, represents the spatio-temporal feature of region r i at time t, is a learnable parameter.

[0101] In step S15, learn the spatio-temporal correlation between regions according to the graph neural network and the spatio-temporal feature to obtain the final region feature.

[0102] In one implementation, learn the spatio-temporal correlation between regions through a Transformer-graph neural network. To improve the model's learning ability for correlation, a multi-head learning mechanism and a multi-layer network are used for learning. For the k-th layer network in the m-th head, the correlation and spatio-temporal feature between two regions r i and r j at time t are calculated as:

[0103]

[0104]

[0105]

[0106] Among them, is the region r in the k-1th layer network in the mth head i The spatiotemporal characteristics at time t, is a learnable parameter, d is the length of the feature vector;

[0107] Use the last layer output of each head as the feature of the region in the head:

[0108] By fusing the regional features of each head, the final regional features are obtained:

[0109]

[0110] in, is a learnable parameter, || represents the connection between two vectors, and M is the total number of heads.

[0111] It should be noted that the traditional Transformer calculates the attention score between any two areas and normalizes it using the softmax function to represent the correlation between the areas. However, since the traffic flow in an area is often only related to a few areas, calculating the attention score between the area and all areas, on the one hand, easily leads to the long-tail effect, introduces unnecessary noise and affects the model accuracy; on the other hand, it also increases unnecessary calculations. Therefore, the present invention combines the Transformer with the spatiotemporal relationship graph proposed above, and optimizes the traditional Transformer using the spatiotemporal relationship graph. In an embodiment of the present invention, it is only necessary to calculate the attention scores of two connected areas in the graph, and there is no need to calculate the attention scores of any two areas, thereby alleviating the impact of the long-tail effect, while reducing the amount of calculation and improving the calculation efficiency.

[0112] In step S16, prediction is performed based on the fully connected neural network and the final regional characteristics to obtain the traffic inflow prediction value and traffic outflow prediction value of each region at time t.

[0113] Specifically, based on each region r i Final regional characteristics at time t Prediction via a fully connected neural network:

[0114]

[0115] in, Represents region r i The predicted value of traffic inflow at time t, Represents region r i The predicted value of traffic outflow at time t, are learnable parameters.

[0116] In one implementation, RMSE can also be selected as the loss function to train the traffic flow prediction model:

[0117]

[0118] Here, n represents the number of training data.

[0119] The present invention provides a traffic flow prediction method integrating multi-source spatiotemporal data, comprising: obtaining historical traffic flow data and trajectory data of regional traffic from time 0 to time t-1; constructing a regional spatiotemporal relationship diagram according to the trajectory data; training the regional spatiotemporal relationship diagram according to the historical traffic flow data to obtain a spatial feature vector, a temporal feature and a traffic flow feature of each region; fusing the spatial feature vector, the temporal feature and the traffic flow feature to obtain the spatiotemporal feature of each region at time t; learning the spatiotemporal correlation between regions according to a graph neural network and the spatiotemporal features to obtain final regional features; and predicting according to a fully connected neural network and the final regional features to obtain a traffic inflow prediction value and a traffic outflow prediction value of each region at time t.

[0120] The present invention integrates the time and space correlation by integrating the historical traffic data and trajectory data, and by learning the spatiotemporal characteristics of the nodes, and considers the impact of the combined effect of time and space correlation in the final traffic prediction, thereby improving the accuracy of traffic flow prediction. At the same time, the present invention only calculates the correlation between related areas, breaking through the limitation of the long tail effect and improving the efficiency of calculation.

[0121] In summary, the present invention has the following advantages:

[0122] (1) Compared with the existing technology that focuses on a single data source, the present invention integrates historical traffic data and trajectory data, giving full play to the characteristics and advantages of the two types of data in traffic prediction and spatiotemporal correlation modeling;

[0123] (2) The present invention uses trajectory data to construct edges in the spatiotemporal relationship graph, breaking through the limitation of local correlation in the prior art and integrating local and global spatiotemporal correlation;

[0124] (3) Different from the prior art that models spatiotemporal correlation and spatial correlation separately, the present invention integrates temporal and spatial correlation by learning the spatiotemporal characteristics of nodes, taking into account the impact of the combined effect of temporal and spatial correlation, and further improving the prediction accuracy;

[0125] (4) Traditional Transformers need to calculate the correlation between any two regions, which results in high event complexity. Moreover, since a region is often strongly correlated with only a few regions, traditional Transformers are prone to long-tail effects, which limits their prediction performance. Different from the prior art that directly uses Transformers to learn the correlation between regions, the present invention applies the Transformer network structure to the spatiotemporal relationship graph and only calculates the correlation between related regions, thus breaking through the limitation of the long-tail effect and improving the calculation efficiency.

[0126] Reference Figure 2 The second embodiment of the present invention provides a traffic flow prediction device integrating multi-source spatiotemporal data, comprising:

[0127] A data acquisition module is used to obtain historical flow data and trajectory data of regional traffic from time 0 to time t-1;

[0128] A space-time graph construction module, used to construct a regional space-time relationship graph based on the trajectory data;

[0129] A space-time graph training module is used to train the space-time relationship graph of the region according to the historical traffic data to obtain the spatial feature vector, time feature and traffic flow feature of each region;

[0130] A feature fusion module, used to fuse the spatial feature vector, the time feature and the traffic flow feature to obtain the spatiotemporal feature of each area at time t;

[0131] A feature learning module, used to learn the spatiotemporal correlation between regions based on the graph neural network and the spatiotemporal features to obtain final regional features;

[0132] The traffic flow prediction module is used to make predictions based on the fully connected neural network and the final regional characteristics to obtain the traffic inflow prediction value and the traffic outflow prediction value of each area at time t.

[0133] It should be noted that a traffic flow prediction device integrating multi-source spatiotemporal data provided in an embodiment of the present invention is used to execute all process steps of a traffic flow prediction method integrating multi-source spatiotemporal data in the above-mentioned embodiment. The working principles and beneficial effects of the two correspond one to one, and thus will not be elaborated on herein.

[0134] The embodiment of the present invention further provides a terminal device. The terminal device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a traffic flow prediction program integrating multi-source spatiotemporal data. When the processor executes the computer program, the steps in the above-mentioned embodiments of the traffic flow prediction method integrating multi-source spatiotemporal data are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, such as the traffic prediction module.

[0135] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0136] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of terminal devices and do not constitute a limitation on the terminal device. The terminal device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0137] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0138] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0139] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0140] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0141] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A traffic flow prediction method integrating multi-source spatiotemporal data, characterized in that: include: Obtain historical traffic flow data and trajectory data of regional traffic from time 0 to time t-1; Constructing a regional spatiotemporal relationship diagram according to the trajectory data; The regional spatiotemporal relationship diagram is trained according to the historical traffic data and the regional spatial relationship to obtain the spatial feature vector, time feature and traffic flow feature of each region; The spatial feature vector, the time feature and the traffic flow feature are integrated to obtain the spatiotemporal feature of each area at time t; The spatiotemporal correlation between regions is learned according to the graph neural network and the spatiotemporal features to obtain the final regional features; Predicting based on the fully connected neural network and the final regional features to obtain a predicted value of traffic inflow and a predicted value of traffic outflow for each region at time t; in, The step of constructing a regional spatiotemporal relationship diagram according to the trajectory data includes: For any two position points in the same trajectory data, the nodes represented by the areas corresponding to the two position points are and , connected by edges in the regional spatiotemporal relationship graph; where each region in the regional spatiotemporal relationship graph Represented by a node; The learning of the spatiotemporal correlation between regions based on the graph neural network and the spatiotemporal features to obtain the final regional features includes: Using a multi-head learning mechanism and a multi-layer network for learning, for the k-th layer network in the m-th head, the two regions and Between The correlation of moments and the spatiotemporal characteristics are calculated as: = in, is the area in the k-1th layer of the network in the mth head The spatiotemporal characteristics at time t, , , are learnable parameters; Use the last layer output in each head as the regional feature of the head ; By fusing the regional features of each head, the final regional features are obtained : in, is a learnable parameter, represents the connection of two vectors, M is the total number of heads; the length of the spatiotemporal feature is the same as the length of the regional feature, and both are expressed as hyperparameters .

2. The traffic flow prediction method based on the fusion of multi-source spatiotemporal data according to claim 1 is characterized in that: The regional spatiotemporal relationship diagram is trained according to the historical traffic data and the regional spatial relationship to obtain the spatial feature vector of each region, including: based on The graph neural network of the layer trains the spatial features of each node in the regional spatiotemporal relationship graph: In the regional spatiotemporal relationship diagram, each region is represented by a node express, Indicates Layer Network The spatial eigenvector of is a learnable parameter, It represents the bitwise averaging operation on the vector. Represented in the space diagram The neighbor nodes of Represents the concatenation operation of two vectors, is a random vector; The spatial features are learned by predicting whether two nodes are neighbor nodes: in, To predict the results, 1 is used to indicate that the two nodes are neighbor nodes, and 0 is used to indicate that the two nodes are non-neighbor nodes; represents the Sigmoid activation function, represents the tanh activation function, and is a learnable parameter, , ; After the training As a region The spatial feature vector of .

3. The traffic flow prediction method based on the fusion of multi-source spatiotemporal data according to claim 1 is characterized in that: The regional spatiotemporal relationship diagram is trained according to the historical traffic data and the regional spatial relationship to obtain the time characteristics of each region, including: Assume the prediction time interval is Hours, time features are trained based on neural networks: in, Represents time characteristics, is the Relu activation function, is the one-hot encoding at time t, one-hot encoding The length is , and are learnable parameters.

4. The traffic flow prediction method of integrating multi-source spatiotemporal data according to claim 1 is characterized in that: The regional spatiotemporal relationship diagram is trained according to the historical traffic data and the regional spatial relationship to obtain the traffic flow characteristics of each region, including: use exist arrive Traffic inflow at the time Traffic outflow , for nodes exist Traffic flow characteristics at each time To study; among them, express time The traffic inflow, express time Traffic outflow volume, the historical traffic data includes and ; Traffic flow characteristics using one-dimensional convolutional network To learn: in, and Represents a 1D convolutional network, and the size of the convolution kernel is , the step size is 1, and the output channel quantity is , represents the concatenation of two eigenvectors, is a learnable parameter, .

5. The traffic flow prediction method of integrating multi-source spatiotemporal data according to claim 4 is characterized in that: The prediction is performed based on the fully connected neural network and the final regional features to obtain the traffic inflow prediction value and the traffic outflow prediction value of each region at time t, including: Based on each area Final regional characteristics at time t , predicted by a fully connected neural network: in, Indicates area The predicted value of traffic inflow at time t, Indicates area The predicted value of traffic outflow at time t, are learnable parameters.

6. The traffic flow prediction method of integrating multi-source spatiotemporal data according to claim 5 is characterized in that: The method further comprises: Select RMSE as the loss function to train the traffic flow prediction model: Here, n represents the number of training data.

7. A traffic flow prediction device integrating multi-source spatiotemporal data, characterized in that: include: A data acquisition module is used to obtain historical flow data and trajectory data of regional traffic from time 0 to time t-1; A space-time graph construction module, used to construct a regional space-time relationship graph based on the trajectory data; A space-time graph training module is used to train the space-time relationship graph of the region according to the historical traffic data to obtain the spatial feature vector, time feature and traffic flow feature of each region; A feature fusion module, used to fuse the spatial feature vector, the time feature and the traffic flow feature to obtain the spatiotemporal feature of each area at time t; A feature learning module, used to learn the spatiotemporal correlation between regions based on the graph neural network and the spatiotemporal features to obtain final regional features; A traffic flow prediction module, used to make predictions based on the fully connected neural network and the final regional characteristics to obtain a predicted value of traffic inflow and a predicted value of traffic outflow for each region at time t; in, The space-time graph construction module is specifically used for: For any two position points in the same trajectory data, the nodes represented by the areas corresponding to the two position points are and , connected by edges in the regional spatiotemporal relationship graph; where each region in the regional spatiotemporal relationship graph Represented by a node The feature learning module is specifically used for: Using a multi-head learning mechanism and a multi-layer network for learning, for the k-th layer network in the m-th head, the two regions Between The correlation of moments and the spatiotemporal characteristics are calculated as: = in, The area in the k-1th layer network The spatiotemporal characteristics of the moment, , , are learnable parameters; Use the last layer output in each head as the regional feature of the head ; By fusing the regional features of each head, the final regional features are obtained : in, is a learnable parameter, represents the connection of two vectors, M is the total number of heads; the length of the spatiotemporal feature is the same as the length of the regional feature, and both are expressed as hyperparameters .

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the traffic flow prediction method integrating multi-source spatiotemporal data as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Urban traffic flow network analysis method based on complex network theory

    CN110111575A

  • Scenic spot passenger flow prediction method and device based on hybrid neural network model

    CN111160622A