Traffic flow prediction method based on time-space diagram attention neural network
By adopting a method based on space-time graph attention neural network in traffic flow prediction, optimizing the graph structure and combining spatial and temporal attention mechanisms, the problem of insufficient traffic flow prediction accuracy in the existing technology is solved, and higher prediction accuracy and model generalization performance are achieved, providing more accurate data support for intelligent traffic systems.
Patent Information
- Application Number
- CN202311163860.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2025-03-11
AI Technical Summary
The existing traffic flow prediction methods have insufficient in capturing the dependencies between traffic flows, resulting in insufficient prediction accuracy.
The traffic flow prediction method based on the space-time graph attention neural network is adopted to optimize the graph structure and combine the spatial and temporal attention mechanism to re-explorate the spatial and temporal characteristics in the traffic flow data.
It improves the accuracy of traffic flow prediction and the generalization performance of the model, provides more accurate data support for intelligent traffic systems, and coordinates and manages road traffic.
Smart Images

Figure CN119600795A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of road vehicle flow analysis and prediction, and in particular to a traffic flow prediction method based on a spatiotemporal graph attention neural network. Background Art
[0002] As one of the effective means to solve traffic problems, intelligent transportation system is increasingly respected by people. Intelligent transportation system (ITS) is an advanced traffic management and control system. It aims to combine advanced information technologies such as digital communication and computer networks to provide innovative services to the transportation system that are different from the original transportation methods and traffic management. This enables users to better understand the traffic situation and use a safer, more coordinated and more intelligent transportation network. In the intelligent transportation system, traffic flow prediction occupies a prominent position. Traffic flow prediction is the basis and key to the realization of intelligent transportation system. Scientific management methods must be supported by data. Only by making high-precision traffic flow prediction based on historical traffic data can more effective road traffic information be provided to travelers, and data support can be provided for dynamic traffic planning, so as to achieve the purpose of alleviating road traffic congestion and facilitating people's travel. Therefore, traffic flow prediction is very necessary. The prediction results can guide the traffic management department to scientifically manage road traffic, thereby improving the utilization rate of road resources.
[0003] However, the current methods of traffic flow prediction still have many shortcomings. On the one hand, the road network in the real world has a complex spatial structure, and the road traffic flow is non-Euclidean and directional; on the other hand, the change of road traffic flow over time is non-stationary and has a strong time dependence. For example, morning and evening rush hours, holidays or unpredictable traffic accidents will affect the road traffic speed.
[0004] Existing prediction methods use graph neural networks (GNNs), but the graph structure used by existing GNNs is predefined and only represents the physical structure of the road network. Therefore, it cannot guarantee the best description of the dependencies between traffic flows. The relationship between two traffic flows that are far apart but have similar trends is also important for traffic prediction, and this dependency cannot be captured in a predefined graph based on road topology, which will affect the accuracy of traffic flow prediction. Summary of the invention
[0005] The purpose of the present invention is to provide a traffic flow prediction method based on spatiotemporal graph attention neural network in order to overcome the defect of insufficient prediction accuracy caused by predefined graph structure.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A traffic flow prediction method based on spatiotemporal graph attention neural network includes the following steps:
[0008] Obtain traffic flow data, input the traffic flow data into the trained traffic flow prediction model, and obtain the prediction result. The traffic flow prediction model includes multiple encoders and a decoder. The traffic flow data enters the first encoder after passing through the embedding unit. The input of each encoder is the output of the previous encoder and the initial graph. The input of the first encoder is the traffic flow data and the initial graph after passing through the embedding unit. The encoder includes a spatial attention module and a temporal attention module. The training process of the traffic flow prediction model is as follows:
[0009] Step S1, obtain historical traffic flow data X and the initial graph G, the historical traffic flow data X enters the first encoder after passing through the embedding unit; for any encoder, generate a hidden state H=[H t-p+1 , ...H t ], extract features in the data space domain through the graph attention mechanism input in the spatial attention module, calculate the relationship R between the nodes in the initial graph and the input of the encoder, and then execute S2;
[0010] Step S2, convolve the relationship R between the nodes in the initial graph and the input of the encoder to obtain the output channel of the node i attribute of the encoder, and one encoder corresponds to multiple channels;
[0011] Step S3, based on the output channel of S2, deriving the learning relationship A[i, j] between two nodes of the initial graph by learning the metric function represented by the dual node;
[0012] Step S4: Through the multi-head attention mechanism of the spatial attention module, the results of the spatial attention modules of the first K encoders of the encoder are averaged, and the average value X of the spatial attention results of the encoder is output. g , where the result of the spatial attention module of the k-th encoder is: A(k)W(k)H(t), where A(k) is the relationship between nodes obtained in S3 of the spatial attention module of the k-th encoder, W(k) is the spatial trainable parameter of the k-th encoder, and H(t) is the hidden state generated by the k-th encoder;
[0013] Step S5: Based on the embedding unit X E , add residual connection X R , combined with the mean value X g Get the final feature X output by the spatial attention module S ;
[0014] Step S6: In the same encoder, the historical traffic flow data that has passed through the embedding unit is used as input, the query matrix Q, the key matrix K, and the value matrix V of each feature of the data are determined, and the weights between the various features of the historical traffic flow data that has passed through the embedding unit are calculated through the temporal self-attention mechanism;
[0015] Step S7, calculating the temporal attention feature h of each feature according to the weights between the features, and concatenating the temporal attention features of the first K encoders including the encoder through the multi-head attention mechanism of the temporal attention module;
[0016] Step S8: Input the concatenated result into the feedforward network, and the feedforward network outputs the temporal attention result X A ;
[0017] Step S9: Based on the embedding unit X E , add residual connection X R , combined with the temporal attention result X A Get the final feature X output by the temporal attention module T , the final feature X that fuses the output of the spatial attention module of S5 and S9 S and the final feature X output by the temporal attention module T , the fused features are used as the input of the next encoder, and the fused features of the output of the last encoder are Hn;
[0018] Step S10: Input the fused feature Hn output by the last encoder, as well as the historical time series X and future time series Y after the embedding unit into the decoder, and calculate the predicted time step t i With the historical time step t j similarities between;
[0019] Step S11, activating the similarity of S10 to obtain a similarity coefficient;
[0020] Step S12, normalizing the similarity coefficient;
[0021] Step S13: Perform weighted combination based on the normalized similarity coefficient to obtain a prediction result with a prediction time step of ti;
[0022] Step S14, obtaining a future traffic flow prediction value based on a linear transformation of the prediction result;
[0023] Step S15, calculate the loss function, determine whether the loss function meets the requirements or the number of iterations reaches the maximum value, if so, end the training and obtain the trained traffic flow prediction model, otherwise return to S1.
[0024] Furthermore, the learning relationship between two nodes is:
[0025]
[0026] Among them, M i is the output signal of node i, represents the metric function, and A[i, j] represents the learning relationship between node i and node j.
[0027] Furthermore, the final feature X output by the spatial attention module is S for:
[0028] X S =X G ×sigmoid(X E )+X R
[0029] Among them, X G is the average value of the spatial attention results, X E is the embedded unit, X R is the residual connection.
[0030] Furthermore, the residual connection is:
[0031]
[0032] Among them, F is the feature dimension.
[0033] Furthermore, the final feature X output by the temporal attention module is T for
[0034] X T =X A ×sigmoid(X E )+X R
[0035] Among them, X A is the temporal attention result, X E is the embedded unit, X R is the residual connection.
[0036] Furthermore, the temporal attention result is:
[0037] X A =FFN(Multihead(Q i , K i , V i ))
[0038] Among them, FFN represents the feedforward network and Multihead represents the concatenated result.
[0039] Furthermore, the prediction time step is t j The prediction results are:
[0040]
[0041] Among them, σ is the activation function, α i,j is the normalized attention coefficient, e ti is the similarity coefficient.
[0042] Furthermore, the future traffic flow forecast value is:
[0043] Y′=wF O +b
[0044] Among them, w is the parameter matrix of the fully connected layer and b is the bias coefficient.
[0045] Furthermore, the loss function is an L2 loss function.
[0046] Furthermore, the loss function is:
[0047] L(Y′,W θ )=||Y′(x t-p+1 , …, x t , W θ )-y t+1 ||
[0048] Among them, W θ are all trainable parameters, Y′ is the future traffic flow prediction value, y t+1 is the true value, x t-p+1 , ..., x t Historical traffic flow data.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] The present invention optimizes the original graph structure from the calculation of traffic flow data, re-explores the hidden spatial features therein, and further obtains the time features of different time lengths in combination with the graph attention mechanism. The embedding unit based on the attention factor decomposition machine model is used to enhance the feature expression. While improving the prediction accuracy, the generalization performance of the model is effectively improved, providing data support for the coordinated management of the intelligent transportation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flow chart of the present invention;
[0052] Figure 2 It is a structural diagram of the traffic flow prediction model of the present invention;
[0053] Figure 3 The structure diagram of the traffic flow prediction model encoder of the present invention;
[0054] Figure 4This is a structural diagram of the traffic flow prediction model decoder of the present invention. DETAILED DESCRIPTION
[0055] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0056] The present invention proposes a traffic flow prediction method based on spatiotemporal graph attention neural network to improve the existing graph neural network model. The spatiotemporal graph attention method can relearn the original traffic flow data, update and optimize the original graph structure, and then link the long-term and short-term time relationships based on the spatiotemporal learning module of the self-attention mechanism, effectively capture the time patterns of different historical time series, and improve the prediction accuracy of the model. The flowchart of the method is as follows Figure 1 shown.
[0057] The traffic flow prediction method based on spatiotemporal graph attention neural network includes the following steps:
[0058] Obtain traffic flow data, input the traffic flow data into the trained traffic flow prediction model, and obtain the prediction result. The traffic flow prediction model includes multiple encoders and a decoder. The traffic flow data enters the first encoder after passing through the embedding unit. The input of each encoder is the output of the previous encoder and the initial graph. The input of the first encoder is the traffic flow data and the initial graph after passing through the embedding unit. The encoder includes a spatial attention module and a temporal attention module. The overall structure of the traffic flow prediction model is as follows: Figure 2 The structure of the traffic flow prediction model encoder is shown in Figure 3 As shown, the decoder structure is as follows Figure 4 shown.
[0059] The training process of the traffic flow prediction model is as follows:
[0060] Step S1, obtain historical traffic flow data X and the initial graph G, the historical traffic flow data X enters the first encoder after passing through the embedding unit; for any encoder, generate a hidden state H=[H t-p+1 , ...H t ], extract features in the data space domain through the graph attention mechanism input in the spatial attention module, calculate the relationship R between the nodes in the initial graph and the input of the encoder, and then execute S2;
[0061] Step S2, convolve the relationship R between the nodes in the initial graph and the input of the encoder to obtain the output channel of the node i attribute of the encoder, and one encoder corresponds to multiple channels;
[0062] Step S3, based on the output channel of S2, deriving the learning relationship A[i, j] between two nodes of the initial graph by learning the metric function represented by the dual node;
[0063] Step S4: Through the multi-head attention mechanism of the spatial attention module, the results of the spatial attention modules of the first K encoders of the encoder are averaged, and the average value X of the spatial attention results of the encoder is output. g , where the result of the spatial attention module of the k-th encoder is: A(k)W(k)H(t), where A(k) is the relationship between nodes obtained in S3 of the spatial attention module of the k-th encoder, W(k) is the spatial trainable parameter of the k-th encoder, and H(t) is the hidden state generated by the k-th encoder;
[0064] Step S5: Based on the embedding unit X E , add residual connection X R , combined with the mean value X g Get the final feature X output by the spatial attention module S ;
[0065] Step S6: In the same encoder, the historical traffic flow data that has passed through the embedding unit is used as input, the query matrix Q, the key matrix K, and the value matrix V of each feature of the data are determined, and the weights between the various features of the historical traffic flow data that has passed through the embedding unit are calculated through the temporal self-attention mechanism;
[0066] Step S7, calculating the temporal attention feature h of each feature according to the weights between the features, and concatenating the temporal attention features of the first K encoders including the encoder through the multi-head attention mechanism of the temporal attention module;
[0067] Step S8: Input the concatenated result into the feedforward network, and the feedforward network outputs the temporal attention result X A ;
[0068] Step S9: Based on the embedding unit X E , add residual connection X R , combined with the temporal attention result X A Get the final feature X output by the temporal attention module T , the final feature X that fuses the output of the spatial attention module of S5 and S9 S and the final feature X output by the temporal attention module T , the fused features are used as the input of the next encoder, and the fused features of the output of the last encoder are Hn;
[0069] Step S10: Input the fused feature Hn output by the last encoder, as well as the historical time series X and future time series Y after the embedding unit into the decoder, and calculate the predicted time step t i With the historical time step t j similarities between;
[0070] Step S11, activating the similarity of S10 to obtain a similarity coefficient;
[0071] Step S12, normalizing the similarity coefficient;
[0072] Step S13: Perform weighted combination based on the normalized similarity coefficient to obtain a prediction time step of t j The prediction results;
[0073] Step S14, obtaining a future traffic flow prediction value based on a linear transformation of the prediction result;
[0074] Step S15, calculate the loss function, determine whether the loss function meets the requirements or the number of iterations reaches the maximum value, if so, end the training and obtain the trained traffic flow prediction model, otherwise return to S1.
[0075] In S1, given the historical traffic flow data:
[0076] X=[X t-p+1 , ...X t ]
[0077] Generate hidden state:
[0078] H=[H t-p+1 , ...H t ]
[0079] Through the input of the graph attention mechanism in the spatial attention module, highly meaningful features in the data are extracted in the spatial domain, and the nodes in the calculation graph are related to the input H(t)∈R N×F The relationship between R is as follows:
[0080] H1(t)=WH(t)
[0081] R=H1(t)H1(t) T
[0082] Among them, R i,j Represents the relationship from node i to node j, W∈R F×F ′ is a learning parameter.
[0083] In S2, R contains the nodes and their hidden related information, which affect the spatial relationship of the nodes. The convolution operation is performed on R, and the formula is as follows:
[0084]
[0085] Among them, H i,f is the f-th channel of the input signal, that is, the hidden information of the f-th channel of the attribute of node i. i,f′ is the f′th channel of the output signal. f,f′ is a trainable parameter that describes the correlation between the f′th output channel and the fth input channel. The convolution operation can reduce the time dimension to the size of the convolution kernel, and the size of these kernels is set to p, which is equal to the length of the historical sequence.
[0086] In S3, after completing the above cross-time dimension aggregation of data, a metric learning method is used to learn the metric function represented by the dual node To deduce the relationship between nodes, the formula is as follows:
[0087]
[0088] Among them, A[i, j] represents the learning relationship between node i and node j. The similarity between nodes is expressed by dot product calculation, and the metric learning function is expressed in the form of matrix multiplication: A = M·M T .
[0089] In S4, a multi-head attention mechanism is adopted, using K independent attention mechanisms and averaging their results to make the model learning process more stable. The formula is as follows:
[0090]
[0091] The above operation, H O Indicates the average value X g , from input X to X G The change of can be described as: G = Gatt(X, G), where X∈R N×F , N represents the number of nodes, F is the feature dimension, G∈R N×N Output X is the graph network constructed in the study area. G ∈R N ×F .
[0092] In S5, an AFM-based embedding unit X is used E To associate information between nodes, improve the learning ability of the attention mechanism for neighboring information, and add residual connection X R Avoid gradient vanishing and make propagation more successful. Combined with similarity calculation, the formula is as follows:
[0093]
[0094] Among them, X, XE ∈R N×T×F , the spatial attention module is finally expressed as: X S =X G ×sigmoid(X E )+X R In S6, the temporal relationship between sequences is calculated through the self-attention mechanism, and the formula is as follows:
[0095]
[0096] Where Q∈R T×dk , K∈R T×dk , V∈R T×dv In the selection of Q, K, and V, we select input X as Q and K, directly calculate the similarity between time series, and embed the output into V. By calculating the Q of each team element i and K i , the similarity of (i, j∈T) and the result w ij (i, j∈T).
[0097] In S7, the output of the ith cycle is applied to V j Perform weighted sum, respectively with w ij is the weighting coefficient. The dot product calculation and scaling dot product method are used to avoid the gradient disappearance phenomenon. The formula is as follows:
[0098] Multihead(Q,K,V)=Concat(h1,h2,…,h h )
[0099] h i =Attention(QW i Q , KW i K , VW i V )
[0100] In S8, a fully connected feedforward network (FFN) is used for each position to capture the dependencies of nearby nodes. The formula is as follows:
[0101] FFN(x)=max(0,xW1+b1)W2+b2
[0102] Among them, FFN consists of two linear transformations, activated by a ReLU in the middle. The above operation can be described as: A =FFN(Multihead(Q i , K i , V i )).
[0103] In S9, similar to the spatial attention module, a similarity calculation process X is added to the temporal attention module. E And residual connection X R , the formula is as follows:
[0104] X T =X A ×sigmoid(X E )+X R
[0105] In S10, the historical time series X and the future time series Y are input through the embedding unit. Then, the attention mechanism is applied to calculate the importance coefficient between the time series. Define the prediction time step t i With the historical time step t j The similarity between (i, j∈T) is as follows:
[0106] e i,j =α(e ti , e tj )
[0107] Among them, e ti , e tj ∈R F Respectively represent t i and t j Information about step length, e i,j ∈R F ;
[0108] In S11, LeakyReLU is used to activate it, and the formula is as follows:
[0109] e i,j =LeakyReLU(α T [e ti ||e tj ]
[0110] In S12, the obtained similarity coefficient is normalized, and the formula is as follows:
[0111]
[0112] In S13, the normalized attention coefficient is used for weighted combination, and then the predicted time step t is obtained. j The expression is as follows:
[0113]
[0114] In S14, through linear transformation, the future traffic flow prediction value is finally obtained, and the formula is as follows:
[0115] Y′=wF O +b
[0116] Among them, Y′ is the output value, w is the parameter matrix of the fully connected layer, and b is the bias coefficient
[0117] In S15, the L2 loss function is used to measure the performance of the model. The formula is as follows:
[0118] L(y′,W θ )=||y′(x t-p+1 , ..., x t , W θ )-y t+1 ||
[0119] Among them, W θ are all trainable parameters, y′ is the predicted value, y t+1 is the true value.
[0120] Finally, the prediction results can be calculated again through the evaluation indicators, and the prediction results and the evaluation indicators can be output for analysis.
[0121] The method can optimize the original graph structure from the calculation of traffic flow data, re-explore the hidden spatial features therein, and further obtain the time features of different time lengths in combination with the graph attention mechanism. The embedding unit based on AFM is used to enhance the feature expression. While improving the prediction accuracy, it effectively reduces the generalization performance of the model, providing data support for the coordinated management of the intelligent transportation system. The present invention can obtain the real-time updated traffic graph structure, optimize the learning of the original road topology structure, enhance the traffic feature expression through the embedding unit, and finally effectively learn the spatiotemporal features through the self-attention mechanism. The method can effectively improve the accuracy of traffic flow prediction and has high practical application value.
[0122] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A traffic flow prediction method based on spatiotemporal graph attention neural network, characterized in that: The following steps are involved: Obtain traffic flow data, input the traffic flow data into the trained traffic flow prediction model, and obtain the prediction result. The traffic flow prediction model includes multiple encoders and a decoder. The traffic flow data enters the first encoder after passing through the embedding unit. The input of each encoder is the output of the previous encoder and the initial graph. The input of the first encoder is the traffic flow data and the initial graph after passing through the embedding unit. The encoder includes a spatial attention module and a temporal attention module. The training process of the traffic flow prediction model is as follows: Step S1, obtain historical traffic flow data X and the initial graph G, the historical traffic flow data X enters the first encoder after passing through the embedding unit; for any encoder, generate a hidden state H=[H t-p+1 , ...H t ], extract features in the data space domain through the graph attention mechanism input in the spatial attention module, calculate the relationship R between the nodes in the initial graph and the input of the encoder, and then execute S2; Step S2, convolve the relationship R between the nodes in the initial graph and the input of the encoder to obtain the output channel of the node i attribute of the encoder, and one encoder corresponds to multiple channels; Step S3, based on the output channel of S2, deriving the learning relationship A[i, j] between two nodes of the initial graph by learning the metric function represented by the dual node; Step S4: Through the multi-head attention mechanism of the spatial attention module, the results of the spatial attention modules of the first K encoders of the encoder are averaged, and the average value X of the spatial attention results of the encoder is output. g , where the result of the spatial attention module of the k-th encoder is: A(k)W(k)H(t), where A(k) is the relationship between nodes obtained in S3 of the spatial attention module of the k-th encoder, W(k) is the spatial trainable parameter of the k-th encoder, and H(t) is the hidden state generated by the k-th encoder; Step S5: Based on the embedding unit X E , add residual connection X R , combined with the mean value X g Get the final feature X output by the spatial attention module S ; Step S6: In the same encoder, the historical traffic flow data that has passed through the embedding unit is used as input, the query matrix Q, the key matrix K, and the value matrix V of each feature of the data are determined, and the weights between the various features of the historical traffic flow data that has passed through the embedding unit are calculated through the temporal self-attention mechanism; Step S7, calculating the temporal attention feature h of each feature according to the weights between the features, and concatenating the temporal attention features of the first K encoders including the encoder through the multi-head attention mechanism of the temporal attention module; Step S8: Input the concatenated result into the feedforward network, and the feedforward network outputs the temporal attention result X A ; Step S9: Based on the embedding unit X E , add residual connection X R , combined with the temporal attention result X A Get the final feature X output by the temporal attention module T , the final feature X that fuses the output of the spatial attention module of S5 and S9 S and the final feature X output by the temporal attention module T , the fused features are used as the input of the next encoder, and the fused features of the output of the last encoder are Hn; Step S10: Input the fused feature Hn output by the last encoder, as well as the historical time series X and future time series Y after the embedding unit into the decoder, and calculate the predicted time step t i With the historical time step t j similarities between; Step S11, activating the similarity of S10 to obtain a similarity coefficient; Step S12, normalizing the similarity coefficient; Step S13: Perform weighted combination based on the normalized similarity coefficient to obtain a prediction time step of t j The prediction results; Step S14, obtaining a future traffic flow prediction value based on a linear transformation of the prediction result; Step S15, calculate the loss function, determine whether the loss function meets the requirements or the number of iterations reaches the maximum value, if so, end the training and obtain the trained traffic flow prediction model, otherwise return to S1.
2. A traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 1, characterized in that: The learning relationship between two nodes is: Among them, M i is the output signal of node i, represents the metric function, and A[i, j] represents the learning relationship between node i and node j.
3. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 1 is characterized in that: The final feature X output by the spatial attention module S for: X S =X G ×sigmoid(X E )+X R Among them, X G is the average value of the spatial attention results, X E is the embedded unit, X R is the residual connection.
4. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 3 is characterized in that: The residual connection is: Among them, F is the feature dimension.
5. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 1 is characterized in that: The final feature X output by the temporal attention module T for X T =X A ×sigmoid(X E )+X R Among them, X A is the temporal attention result, X E is the embedded unit, X R is the residual connection.
6. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 5 is characterized in that: The temporal attention results are: X A =FFN(Multihead(Q i ,K i ,V i )) Among them, FFN represents the feedforward network and Multihead represents the concatenated result.
7. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 1 is characterized in that: The prediction time step is t j The prediction results are: Among them, σ is the activation function, α i,j is the normalized attention coefficient, e ti is the similarity coefficient.
8. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 7 is characterized in that: The future traffic flow forecast is: Y′=wF O +b Among them, w is the parameter matrix of the fully connected layer and b is the bias coefficient.
9. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 8 is characterized in that: The loss function is the L2 loss function.
10. The traffic flow prediction method based on spatiotemporal graph attention neural network according to claim 9 is characterized in that: The loss function is: L(Y′,W θ )=||Y′(x t-p+1 ,...,x t ,W θ )-y t+1 || Among them, W θ are all trainable parameters, Y′ is the future traffic flow prediction value, y t+1 is the true value, x t-p+1 , ..., x t Historical traffic flow data.