Traffic flow prediction method and system based on space-time multi-graph attention neural network
By constructing a deep learning model of multiple traffic maps and space-time map attention modules, the problem of insufficient spatial information mining and insufficient fusion of space-time information in the prior art is solved, and more stable and accurate traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202510498595.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-12
AI Technical Summary
The mining of space-related information in the prior art is not comprehensive enough to achieve deep fusion of space-time information, resulting in insufficient accuracy and stability of traffic flow prediction models.
The geographical distance map, road connection map and traffic pattern similarity map are constructed, combined with the attention module and residual connection of the space-time map, traffic flow prediction is performed through deep learning models, and missing and outliers are processed using Lagrangian interpolation method.
It improves the comprehensive capture of spatially related information, enhances the stability and accuracy of the model, solves the problem of loss of time and space feature information, and improves the prediction effect.
Smart Images

Figure CN120472658A_ABST
Abstract
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 and system based on a spatiotemporal multi-graph attention neural network. Background Art
[0002] With the continuous advancement of urbanization, traffic pressure on urban roads is increasing, leading to an increase in traffic congestion and various accidents, which in turn reduces the travel experience of urban residents. Traffic flow refers to the number of vehicles passing through a road section per unit time. Traffic flow forecasting helps analyze the traffic load on urban roads over a period of time and, in turn, determines the congestion level of each road section. This not only helps drivers plan travel routes, avoid congestion, and save travel time, but also assists traffic management departments in traffic planning and vehicle scheduling decisions.
[0003] Among the most advanced current methods for predicting road traffic flow is the one that combines various graph neural networks to construct spatiotemporal graph models. By deeply exploring the temporal and spatial characteristics of historical traffic flow information and incorporating internal and external factors such as road structure and weather, these methods can predict traffic flow for a specific period of time. However, these current methods generally suffer from insufficient depth in spatial information mining and an inability to achieve deep integration of spatiotemporal information.
[0004] In the existing technology, traffic flow prediction models are constructed and predictions are performed based on spatiotemporal multi-scale graph convolutional networks, but the mining of spatial-related information is not comprehensive enough. When constructing the graph model, only the connectivity between nodes is considered from the road structure level, ignoring that the distance between nodes is also an important factor affecting road traffic flow information; and the connection method between the temporal attention mechanism for mining temporal correlation and the adaptive dynamic graph convolutional network for mining spatial correlation is simple splicing, which cannot achieve deep fusion of spatiotemporal information. The temporal correlation features obtained by the temporal attention mechanism are directly input into the subsequent graph convolutional network module, which may cause the loss of temporal correlation feature information. Summary of the Invention
[0005] To solve the above problems, the present invention provides a traffic flow prediction method and system based on spatiotemporal multi-graph attention neural network.
[0006] To this end, the technical solution adopted in the present invention is:
[0007] A traffic flow prediction method based on a spatiotemporal multi-graph attention neural network is provided, the method comprising:
[0008] Obtaining the original road traffic flow data of each road node in the area to be predicted, and preprocessing the original road traffic flow data to form a data set;
[0009] Divide the dataset into training set, validation set and test set in a certain proportion and perform standardization;
[0010] Constructing a traffic map for the area to be predicted and building a deep learning model based on the traffic map; the traffic map includes a geographic distance map, a road connectivity map, and a traffic pattern similarity map;
[0011] Input the standardized training set data into the deep learning model for training to obtain a trained deep learning model;
[0012] Obtain the road traffic flow data for the initial period to be predicted and input it into the trained deep learning model to obtain the predicted road traffic flow data for the future period.
[0013] According to the above scheme, the original data of road traffic flow includes the historical traffic flow information collected by each road node for a period of time and the latitude and longitude coordinates of the corresponding road node; the traffic flow information includes the average speed, average road occupancy rate and traffic flow of vehicles passing through the road node.
[0014] According to the above scheme, the preprocessing of the original road traffic flow data includes:
[0015] Delete the original road traffic flow data where all data are null or the proportion of null data exceeds a certain proportion, as well as duplicate road nodes;
[0016] Check whether the remaining road traffic flow raw data contains null values and outliers, and use the Lagrange interpolation method to fill and replace the null values and outliers.
[0017] According to the above scheme, outliers are determined by the 3-sigma principle: if a data falls outside the interval of the mean of all data plus or minus three standard deviations, the data is judged to be abnormal.
[0018] According to the above scheme, the traffic map is specifically constructed by a set of road nodes, a set of edges and a weighted adjacency matrix; the elements in the weighted adjacency matrix in the geographic distance map are calculated by the geographic distance between each node and the hyperparameter controlling the distance scaling factor; the elements in the weighted adjacency matrix in the road connectivity map are determined by the connection between nodes; and the elements in the weighted adjacency matrix in the traffic pattern similarity map are calculated by the traffic flow, road occupancy rate and average vehicle speed corresponding to each node in the time window.
[0019] According to the above scheme, the construction of the deep learning model specifically includes:
[0020] Constructing an encoder: Input historical traffic flow information collected from each road node into the traffic map. Through the spatiotemporal graph attention module, residual connections, and layer normalization operations, the spatiotemporal information corresponding to each traffic map is obtained. The spatiotemporal information is fused through a gating mechanism to obtain a context vector.
[0021] Construct a decoder: The predicted traffic flow information of each road node at the previous moment is processed through the spatiotemporal graph attention module, residual connection and layer normalization operation to obtain the processed predicted traffic flow information; the processed predicted traffic flow information is fused with the context vector, and the traffic flow prediction value for the future moment is output through the spatiotemporal graph attention module, residual connection, layer normalization operation and fully connected layer operation.
[0022] According to the above scheme, the encoding method of the spatiotemporal graph attention module includes node centrality encoding, space encoding and edge feature encoding.
[0023] According to the above scheme, training the deep learning model is specifically as follows:
[0024] The mean absolute error between the traffic flow prediction value output by the deep learning model and the actual traffic flow value is used as the loss function, and Adam is used as the optimizer for preliminary training;
[0025] Input the standardized validation set to evaluate the prediction effect of the initially trained deep learning model, adjust the model's hyperparameters based on the prediction effect, and obtain the optimal value of the hyperparameters, thereby obtaining the trained deep learning model.
[0026] A traffic flow prediction system based on a spatiotemporal multi-graph attention neural network is provided, the system comprising:
[0027] A data acquisition module is used to obtain the original road traffic flow data of each road node in the area to be predicted, and pre-process the original road traffic flow data to form a data set;
[0028] The dataset processing module is used to divide the dataset into training set, validation set and test set in a certain proportion and perform standardization;
[0029] A model construction module is used to construct a traffic map within the area to be predicted and build a deep learning model based on the traffic map; the traffic map includes a geographic distance map, a road connectivity map, and a traffic pattern similarity map;
[0030] The training module is used to input the standardized training set data into the deep learning model for training to obtain a trained deep learning model;
[0031] The prediction module is used to obtain the road traffic flow data of the initial period to be predicted and input it into the trained deep learning model to obtain the predicted road traffic flow data of the future period.
[0032] A computer storage medium is provided, which stores a computer program executable by a processor, and the computer program executes the traffic flow prediction method based on spatiotemporal multi-graph attention neural network described above.
[0033] The beneficial effects produced by the present invention are:
[0034] 1. By constructing three traffic graph structures, the present invention comprehensively captures spatial information, including the distance between road nodes, connectivity, and traffic pattern similarity information, providing a more comprehensive representation of spatially related information. The introduction of traffic pattern similarity graphs helps extract potential dynamic spatial correlation features in traffic flows and makes the flow characteristics in coarse-grained traffic graphs more stable and less susceptible to noise data, thereby enhancing the stability of the modeling.
[0035] 2. The present invention introduces a spatiotemporal graph attention module into the specific structure of the deep learning model, which can simultaneously capture effective information in both time and space dimensions, organically integrate the capture of time correlation and space correlation, and through the attention operation on the traffic map, it realizes the simultaneous mining of feature information in both time and space dimensions, avoiding the loss of features first acquired when time and space learning are performed successively, making the modeling capability of the model more comprehensive and powerful.
[0036] 3. The present invention uses residual connections to help solve the gradient vanishing problem during deep network training, breaking through the depth limitation of the network model, thereby improving training efficiency and performance.
[0037] 4. The present invention uses the Lagrange interpolation method to process missing values and outliers, which helps to improve the quality of the original data, allowing the model to learn more effective information and ultimately obtain more accurate prediction values. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a flow chart of a traffic flow prediction method based on a spatiotemporal multi-graph attention neural network according to an embodiment of the present invention;
[0039] Figure 2 is a prediction flow chart of an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the deep learning model structure according to an embodiment of the present invention;
[0041] Figure 4 is a schematic diagram of the gated fusion mechanism structure according to an embodiment of the present invention;
[0042] Figure 5 2 is a schematic diagram of the structure of a spatiotemporal graph attention module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0044] In order to solve the problem that the existing technology is not comprehensive enough in mining spatial related information and cannot achieve deep integration of spatiotemporal information, the embodiment of the present invention provides a traffic flow prediction method based on spatiotemporal multi-graph attention neural network, such as Figure 1 and Figure 2 As shown, the method includes:
[0045] S1. Obtaining the original road traffic flow data of each road node in the area to be predicted, and preprocessing the original road traffic flow data to form a data set.
[0046] Specifically, raw road traffic flow data includes historical traffic flow information collected at each road node over a long period of time, as well as the latitude and longitude coordinates of each road node. Traffic flow information includes data such as the average speed, average lane occupancy, and traffic volume of vehicles passing through that road section. Traffic volume is the variable to be predicted, while average vehicle speed and average lane occupancy are related variables.
[0047] In addition, after obtaining the original traffic flow data, it is necessary to perform simple preprocessing on the original data to improve the data quality and achieve more accurate prediction results.
[0048] Specifically, the preprocessing process mainly includes:
[0049] Delete the original traffic flow data of roads where all data are null or the proportion of null data exceeds a certain proportion, as well as duplicate road nodes;
[0050] The remaining raw data of road traffic flows is checked for null values and outliers, and Lagrange interpolation is used to fill and replace these null values and outliers. Outliers are identified using the 3-sigma principle: if a data point falls outside the range of the mean plus or minus three standard deviations, the data is considered an outlier.
[0051] S2. Divide the dataset into training set, validation set and test set in a certain proportion and perform standardization.
[0052] Specifically, the z-score method is used to normalize the dataset to avoid the adverse effects of scale differences between different features on model training, thereby improving the stability and convergence speed of the model. During the normalization process of the validation and test sets, the statistical data of the training set are used for calculation.
[0053] In a preferred embodiment of the present invention, the division ratio of the training set, the validation set and the test set is 8:1:1.
[0054] S3. Construct a traffic map for the area to be predicted and build a deep learning model based on the traffic map.
[0055] In the real world, road traffic networks exhibit a typical graph structure. Previous studies have demonstrated the effectiveness of using graph structures to mine potential spatial information within road traffic networks. In this embodiment, three types of traffic graph models are constructed to abstract three types of spatial information that influence traffic flow within the road traffic network.
[0056] In a preferred embodiment of the present invention, the traffic map includes a geographical distance map, a road connectivity map, and a traffic pattern similarity map.
[0057] Specifically, the traffic flow information between two road sections with a relatively close geographical distance generally has a relatively strong correlation. Therefore, the embodiment of the present invention constructs a geographical distance graph G. d =(V,E d ,W d ), used to encode spatial distance information, where V,E d ,W d They are respectively a set of nodes, a set of edges and a weighted adjacency matrix. In the geographic distance graph, each road node is regarded as a node of the graph. If the geographic distance between two nodes is less than the preset distance threshold th d , then they are considered to be connected by an edge, and the weight of the edge is inversely proportional to the distance. The weighted adjacency matrix W d The element in row i and column j can be calculated as follows:
[0058]
[0059] Among them, dist(v i ,v j ) represents v i and v j The geographical distance between them can be calculated by longitude and latitude; σ d is a hyperparameter that controls the distance scaling factor.
[0060] Specifically, in real-world scenarios, traffic congestion often exhibits a significant characteristic of occurring continuously along a specific route, that is, sections on the same route will have similar traffic flow information. Therefore, in the embodiment of the present invention, a road connectivity graph G is constructed. c =(V,E c ,W c), and each road node is used as a node of the graph. By querying the road map, the specific structure of the road can be obtained, and the connection between nodes can be determined. i and v j are two adjacent nodes on the same trunk road, then the adjacency matrix W c The element in row i and column j is 1, otherwise it is 0.
[0061] Specifically, in addition to geographical distance and whether they are on the same road, urban functional zoning will also affect traffic flow information. For example, even if different sections of roads are located near different schools, similar traffic flow increases will always occur during the school hours. Therefore, the embodiment of the present invention uses a coarse-grained regional traffic pattern similarity graph G s The construction process includes: first, using the DTW distance algorithm to construct a fine-grained traffic pattern similarity graph G′ s =(V,E s ,W s ). If node v i and v j The DTW similarity between them is greater than the preset distance threshold th s , then the nodes are connected by edges. And the weight of the edge is proportional to the DTW similarity. Among them, the weighted adjacency matrix W s The element in row i and column j can be calculated as follows:
[0062]
[0063] Among them, X i 、OCC i and SP i is node v i The corresponding traffic flow, lane occupancy rate and average vehicle speed within the time window.
[0064] Then, for W s The Laplace matrix of the spectral clustering algorithm is executed. Each cluster in the clustering result corresponds to a region in the coarse-grained traffic pattern similarity graph. Each region is mapped to a node, and the traffic flow data of this node is the average traffic flow of all fine-grained nodes in the region. In this way, the coarse-grained regional traffic pattern similarity graph G can be constructed. s .
[0065] While geographic distance maps and road connectivity maps reflect static, unchanging spatial features of the traffic space, the specific structure of the traffic pattern similarity map changes over time, reflecting the dynamic spatial correlation of traffic information. Furthermore, the coarse-grained traffic pattern similarity map can reduce the impact of occasional noise on the overall model, enhancing modeling stability.
[0066] Specifically, the construction of deep learning models adopts forward propagation, such as Figure 3 As shown, specifically including:
[0067] Constructing an encoder: Input historical traffic flow information collected from each road node into the traffic map. Through the spatiotemporal graph attention module, residual connections, and layer normalization operations, the spatiotemporal information corresponding to each traffic map is obtained. The spatiotemporal information is fused through a gating mechanism to obtain a context vector.
[0068] Construct a decoder: The predicted traffic flow information of each road node at the previous moment is processed through the spatiotemporal graph attention module, residual connection and layer normalization operation to obtain the processed predicted traffic flow information; the processed predicted traffic flow information is fused with the context vector, and the traffic flow prediction value for the future moment is output through the spatiotemporal graph attention module, residual connection, layer normalization operation and fully connected layer operation.
[0069] The encoder's primary responsibility is to encode the input sequence, converting it into a vector that retains all valid information; the decoder is responsible for decoding the context vector generated by the encoder into the output sequence. The core component of the decoder and encoder is the spatiotemporal graph attention module.
[0070] In addition, in a preferred embodiment of the present invention, the specific calculation method for constructing the encoder and decoder is:
[0071] In the encoder, assume that node v i The corresponding historical traffic data is X i ,but:
[0072] H′ i =Norm(STATT(X,G i )+X),i={d,c,s}
[0073] H i =Norm(STATT(H′ i ,G i )+H′ i ),i={d,c,s}
[0074] Among them, STATT(X,G i ) represents the spatiotemporal graph attention module for the three traffic graphs shown in (1), and Norm(x) represents the layer normalization operation.
[0075] like Figure 4 As shown in Figure 2, the spatiotemporal information obtained from the three traffic maps is fused through a gating mechanism to obtain the context vector P generated by the encoder. This can be described by the formula:
[0076] z i =σ(W z [Hd ,H s ,H c ]),i={d,c,s}
[0077] f i =tanh(W f H i ),i={d,c,s}
[0078] P=z d *f d +z c *f c +z s *f s
[0079] Where tanh represents the hyperbolic tangent function, * represents the Hadamard product, and [x,y] represents the concatenation operation of x and y. z and W f are the parameters to be learned.
[0080] The decoder receives the predicted traffic information of each node at the previous moment Similarly, the information I obtained by the spatiotemporal graph attention module, residual connection and layer normalization operation is fused with the context vector P generated by the encoder, and then the final prediction result is obtained by the spatiotemporal graph attention module, residual connection and layer normalization operation and the fully connected layer. It can be described by the formula:
[0081]
[0082] Where FC represents the fully connected layer operation, It is the output traffic flow prediction value at time t.
[0083] S4. Input the standardized training set data into the deep learning model for training to obtain a trained deep learning model.
[0084] Among them, training deep learning models specifically includes:
[0085] S41. The mean absolute error between the traffic flow prediction value output by the deep learning model and the actual traffic flow value is used as the loss function, and Adam is used as the optimizer for preliminary training.
[0086] S42. Input the standardized validation set to evaluate the prediction effect of the initially trained deep learning model, adjust the model's hyperparameters based on the prediction effect, and obtain the optimal values of the hyperparameters, thereby obtaining the trained deep learning model.
[0087] S5. Obtain the road traffic flow data for the initial period to be predicted, and input it into the trained deep learning model to obtain the predicted road traffic flow data for the future period.
[0088] In addition, an embodiment of the present invention further provides a traffic flow prediction system based on a spatiotemporal multi-graph attention neural network, which is used to implement the traffic flow prediction method based on a spatiotemporal multi-graph attention neural network described in this embodiment. The system includes:
[0089] A data acquisition module is used to obtain the original road traffic flow data of each road node in the area to be predicted, and pre-process the original road traffic flow data to form a data set;
[0090] The dataset processing module is used to divide the dataset into training set, validation set and test set in a certain proportion and perform standardization;
[0091] The model construction module is used to construct a traffic map within the area to be predicted and build a deep learning model based on the traffic map;
[0092] The training module is used to input the standardized training set data into the deep learning model for training to obtain a trained deep learning model;
[0093] The prediction module is used to obtain the road traffic flow data of the initial period to be predicted and input it into the trained deep learning model to obtain the predicted road traffic flow data of the future period.
[0094] Finally, an embodiment of the present invention also provides a computer storage medium, which stores a computer program that can be executed by a processor, and the computer program executes the traffic flow prediction method based on the spatiotemporal multi-graph attention neural network described above.
[0095] By constructing three traffic graph structures, the present invention comprehensively captures spatial information, including the distance between road nodes, connectivity, and similarity information of traffic patterns, and provides a more comprehensive representation of spatially related information. The introduction of traffic pattern similarity graphs helps to extract potential dynamic spatial correlation features in traffic flows, and can make the flow characteristics in coarse-grained traffic graphs more stable and less susceptible to the influence of noise data, thereby enhancing the stability of modeling.
[0096] In addition, the present invention introduces a spatiotemporal graph attention module into the specific structure of the deep learning model, which can simultaneously capture effective information in both time and space dimensions, organically integrate the capture of time correlation and space correlation, and through the attention operation on the traffic map, it realizes the simultaneous mining of feature information in both time and space dimensions, avoiding the loss of features first acquired when time and space learning are performed successively; and through residual connection, it helps to solve the gradient vanishing problem during deep network training, breaks through the depth limitation of the network model, and thus improves training efficiency and performance; and uses the Lagrange interpolation method to process missing values and outliers, which helps to improve the quality of the original data, so that the model can learn more effective information, and ultimately obtain more accurate prediction values.
[0097] Example 2
[0098] The principles and methods of this embodiment are basically the same as those of embodiment 1, except that:
[0099] In step S2, Figure 5 As shown in Figure 1, the encoding methods used in the spatiotemporal graph attention module for building deep learning models specifically include: node centrality encoding, spatial encoding, and edge feature encoding.
[0100] Among them, the node centrality code measures the importance of each node in the traffic graph. Using the out-degree and in-degree of the graph to represent the node centrality, the node centrality code can be calculated as follows:
[0101]
[0102] in and is the in-degree of the graph deg - (v i ) and out-degree deg + (v i ) related learnable embedding vector, x i is node v i Corresponding historical traffic data.
[0103] Spatial encoding can capture the global information of a graph. Specifically, for a graph, a function φ(v i ,v j ) to measure node v i and v j As an example, φ(v i ,v j )=SPD(v i ,v j ), SPD represents the shortest path of the graph. If two nodes are not connected, then φ(v i ,vj )=-1. The element in row i and column j of the spatial coding matrix A′ is:
[0104]
[0105] in is given by φ(v i ,v j ) is a trainable scalar determined by and shared by all layers, W Q and W K is a learnable parameter matrix.
[0106] Edge feature encoding is used to capture the spatial correlation between nodes in the traffic graph. It is mainly measured by the shortest path between nodes. Assume that node v i and v j The shortest path between them is SP ij =(e1,e2,...,e N ). The calculation formula for the element in row i and column j of the query key-value matrix A in the attention mechanism is as follows:
[0107] A i,j =A′ i,j +c ij
[0108]
[0109] in Is the path SP ij The adjacency weight corresponding to the nth edge in , is a learnable embedding vector and N is the number of edges contained in the shortest path.
[0110] The traffic flow prediction method based on the spatiotemporal multi-graph attention neural network provided in this embodiment introduces multiple encoding methods in the core module of constructing the deep learning model, namely the temporal graph attention module, to deeply capture spatial topological information. At the same time, it combines the temporal attention mechanism to mine time-related information including periodicity, making the modeling capability of the model more comprehensive and powerful.
[0111] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, or two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.
[0112] The size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0113] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the appended claims of the present invention.
Claims
1. A traffic flow prediction method based on spatiotemporal multi-graph attention neural network, characterized in that: The method comprises: Obtaining the original road traffic flow data of each road node in the area to be predicted, and preprocessing the original road traffic flow data to form a data set; Divide the dataset into training set, validation set and test set in a certain proportion and perform standardization; Constructing a traffic map for the area to be predicted and building a deep learning model based on the traffic map; the traffic map includes a geographic distance map, a road connectivity map, and a traffic pattern similarity map; Input the standardized training set data into the deep learning model for training to obtain a trained deep learning model; Obtain the road traffic flow data for the initial period to be predicted and input it into the trained deep learning model to obtain the predicted road traffic flow data for the future period.
2. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 1 is characterized in that: The road traffic flow raw data includes historical traffic flow information collected from each road node over a period of time and the latitude and longitude coordinates of the corresponding road node; the traffic flow information includes the average speed, average road occupancy rate and traffic flow of vehicles passing through the road node.
3. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 1 is characterized in that: The preprocessing of the original road traffic flow data includes: Delete the original road traffic flow data where all data are null or the proportion of null data exceeds a certain proportion, as well as duplicate road nodes; Check whether the remaining road traffic flow raw data contains null values and outliers, and use the Lagrange interpolation method to fill and replace the null values and outliers.
4. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 3 is characterized in that: Outliers are determined using the 3-sigma principle: if a data point falls outside the range of the mean of all data plus or minus three standard deviations, the data point is considered abnormal.
5. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 1 is characterized in that: The traffic map is specifically constructed by a set of road nodes, a set of edges, and a weighted adjacency matrix; wherein the elements in the weighted adjacency matrix in the geographic distance map are calculated by the geographic distance between each node and a hyperparameter controlling the distance scaling factor; and the elements in the weighted adjacency matrix in the road connectivity map are determined by the connectivity between nodes. The elements in the weighted adjacency matrix in the traffic pattern similarity graph are calculated based on the traffic flow, lane occupancy rate and average vehicle speed of each node in the time window.
6. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 1 is characterized in that: The construction of a deep learning model specifically includes: Constructing an encoder: Input historical traffic flow information collected from each road node into the traffic map. Through the spatiotemporal graph attention module, residual connections, and layer normalization operations, the spatiotemporal information corresponding to each traffic map is obtained. The spatiotemporal information is fused through a gating mechanism to obtain a context vector. Construct a decoder: The predicted traffic flow information of each road node at the previous moment is processed through the spatiotemporal graph attention module, residual connection and layer normalization operation to obtain the processed predicted traffic flow information; the processed predicted traffic flow information is fused with the context vector, and the traffic flow prediction value for the future moment is output through the spatiotemporal graph attention module, residual connection, layer normalization operation and fully connected layer operation.
7. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 6 is characterized in that: The encoding method of the spatiotemporal graph attention module includes node centrality encoding, space encoding and edge feature encoding.
8. The traffic flow prediction method based on spatiotemporal multi-graph attention neural network according to claim 1 is characterized in that: Training a deep learning model involves: The mean absolute error between the traffic flow prediction value output by the deep learning model and the actual traffic flow value is used as the loss function, and Adam is used as the optimizer for preliminary training; Input the standardized validation set to evaluate the prediction effect of the initially trained deep learning model, adjust the model's hyperparameters based on the prediction effect, and obtain the optimal value of the hyperparameters, thereby obtaining the trained deep learning model.
9. A traffic flow prediction system based on spatiotemporal multi-graph attention neural network, characterized in that: The system comprises: A data acquisition module is used to obtain the original road traffic flow data of each road node in the area to be predicted, and pre-process the original road traffic flow data to form a data set; The dataset processing module is used to divide the dataset into training set, validation set and test set in a certain proportion and perform standardization; The model construction module is used to construct a traffic map within the area to be predicted and build a deep learning model based on the traffic map; The training module is used to input the standardized training set data into the deep learning model for training to obtain a trained deep learning model; The prediction module is used to obtain the road traffic flow data of the initial period to be predicted and input it into the trained deep learning model to obtain the predicted road traffic flow data of the future period.
10. A computer storage medium, characterized in that A computer program executable by a processor is stored therein, and the computer program executes the traffic flow prediction method based on a spatiotemporal multi-graph attention neural network as described in any one of claims 1 to 8.