Traffic data prediction method based on spatiotemporal graph network of sustainable learning
By constructing a spatiotemporal graph network based on representative pattern clustering and matching theory, the adaptability problem of traffic flow prediction models in dynamic traffic networks is solved, improving prediction accuracy and robustness while reducing computational costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 北京市通州区大数据中心
- Filing Date
- 2025-03-24
- Publication Date
- 2026-04-21
AI Technical Summary
Existing traffic flow prediction models are ill-suited to adapting to the dynamic structure and spatiotemporal characteristics of traffic networks, leading to decreased prediction accuracy and wasted computational resources. Furthermore, existing continuous learning methods fail to effectively address the dynamic changes in traffic patterns, resulting in catastrophic forgetting problems.
By employing a sustainable learning approach based on representative pattern clustering and matching theory, a spatiotemporal graph network is constructed to extract representative patterns from traffic data and establish a knowledge base. Combined with pattern expansion, consolidation, and traceability mechanisms, the traffic data prediction model is updated to adapt to the dynamic changes in traffic patterns.
It improves the accuracy, robustness, and generalization ability of traffic data prediction models, reduces computational and time costs, and maintains sensitivity to historical data, avoiding catastrophic amnesia.
Smart Images

Figure CN120236399B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spatiotemporal data mining technology, specifically to a traffic data prediction method based on spatiotemporal graph networks with sustainable learning. Background Technology
[0002] Traffic data not only reflects the dynamic changes in urban operations but also reveals the underlying patterns of the transportation system. Extracting valuable information from traffic data and exploring its implicit spatiotemporal dependencies helps in a deeper understanding and prediction of various urban phenomena. These research findings can not only optimize residents' travel experience but also have wide applications in fields such as intelligent transportation, urban planning, public safety, and environmental monitoring, providing crucial support for building a smarter urban ecosystem.
[0003] Current research shows that most traffic flow prediction methods model the spatiotemporal correlations between traffic nodes using graph neural networks (GNNs), achieving relatively good prediction results to some extent. These models typically rely on stable and uniformly distributed datasets, thus tending to capture homogeneous spatiotemporal dependencies in static networks. However, with the continuous expansion of urban road scale and the iterative upgrading of traffic infrastructure, the topology of traffic networks is constantly changing. The addition of new nodes and the removal of old nodes cause the underlying structure of the graph to continuously evolve. Furthermore, the distribution of traffic flow also exhibits time-dependent characteristics, meaning that the patterns and intensities of traffic flow differ across different time periods. This spatiotemporal correlation is crucial for understanding and predicting traffic flow. Although GNNs perform well on static graph structures, their ability to handle dynamic graph structures and capture spatiotemporal correlations is limited. This is because once the parameters of a GNN model are set, it is difficult to adapt and update to new graph structures, leading to a decline in model performance. Existing models generally fail to adequately consider the spatiotemporal dynamics of traffic data, which limits the accuracy of models in practical applications and results in significant computational resource consumption during model updates. Therefore, the research field urgently needs to develop a new model that can adapt to dynamic changes in traffic patterns and support continuous learning in order to improve the accuracy of predictions and the practicality of the model.
[0004] Continuous learning is an emerging technology that enables models to effectively adapt to newly acquired knowledge without forgetting previously learned knowledge. As an advanced machine learning strategy, continuous learning allows models to retain historical data while continuously absorbing new information, thus overcoming the catastrophic forgetting problem common in traditional learning paradigms. This approach strikes a balance between model plasticity and stability, enabling models to flexibly adapt to new data distributions while maintaining mastery of old knowledge. In the field of graph learning, ER-GNN and Feature-Graph have developed a continuous GNN model based on an experience replay strategy. This model can access historical graph data from previous tasks to review previous experiences. To reduce the computational and storage pressure of storing historical data, SGNN-GR uses a generator to learn the distribution of historical graph data, generating synthetic historical nodes with the same distribution characteristics. These node distribution characteristics are then replayed in the next task. However, when the traffic patterns of nodes and road network structures evolve and change simultaneously, the above models cannot effectively update traffic flow prediction models to cope with such changes. To achieve continuous traffic flow prediction, researchers have proposed TrafficStream, a deep learning framework based on a historical data replay strategy, which can largely accomplish this goal. Although it employs evolutionary pattern detection, which helps identify the shift of points of interest (POIs) so that the model can selectively learn nodes with significant changes, it fails to delve into the role of pattern matching in the stability of continuous learning. It merely uses it as a tool to reduce time complexity and does not significantly improve prediction accuracy.
[0005] Combining pattern clustering with continuous learning to solve traffic flow prediction problems can effectively address the challenges of dynamic traffic environments. Due to the complex and variable spatiotemporal characteristics of traffic flow data, applying pattern clustering and continuous learning to traffic flow prediction faces the following two challenges: (1) Extracting representative patterns. Traffic patterns contain potential data patterns, and how to mine and utilize these patterns to assist model prediction is crucial. Extracting representative patterns from traffic data can improve computational efficiency and reduce noise impact. (2) Avoiding catastrophic forgetting. Streaming data causes traffic patterns and topology to change dynamically, making it crucial to improve the updating effect of representative patterns and avoid catastrophic forgetting. However, existing methods cannot adapt to dynamically changing traffic networks, cannot learn new traffic patterns, and have poor prediction results. When updating the model, catastrophic forgetting occurs, meaning the prediction effect on the original task deteriorates. Therefore, an algorithm for quickly updating the model is needed to avoid catastrophic forgetting. Summary of the Invention
[0006] In view of the above problems, this invention proposes a traffic data prediction method based on a spatiotemporal graph network with sustainable learning. It models the generation process of spatiotemporal data based on representative traffic pattern clustering and matching theory, which effectively improves the accuracy, robustness and generalization of traffic data prediction models.
[0007] This invention provides a traffic data prediction method based on spatiotemporal graph networks with sustainable learning, comprising:
[0008] Step S1: Collect historical vehicle traffic data for each node in the road network;
[0009] Step S2: Construct an initial spatiotemporal graph network based on continuous learning based on the road network; determine the representative pattern set of each node in the spatiotemporal graph network based on continuous learning based on the historical vehicle flow data of each node, and obtain the spatiotemporal graph network based on continuous learning, which is represented as a knowledge base.
[0010] Establish a spatiotemporal learning model;
[0011] Step S3: Build a traffic data prediction model using a spatiotemporal learning model and a knowledge base;
[0012] Step S4: Let i = 1. When i = 1, it represents the first node in the τth historical year of the road network.
[0013] Step S5: Let τ = 1. When τ = 1, it means that node i is in the first historical year.
[0014] Step S6: Let t = 1. When t = 1, it represents the traffic pattern of node i in the initial historical time period of the historical year τ.
[0015] Step S7: Obtain the vehicle traffic data of node i in the t-th historical time period of year τ. Input traffic data prediction model
[0016] Step S8: Based on the spatiotemporal learning model Obtain the spatiotemporal characteristics of traffic flow data of node i in the historical time period t of year τ.
[0017] Step S9: Obtain the knowledge base M τ The representative traffic pattern set P in the τth year τ ;
[0018] Based on the representative traffic pattern set P of year τ τ Vehicle traffic data for node i in the historical time period t of year τ Perform traffic pattern matching to obtain the matching traffic pattern of node i in the historical time period t of year τ;
[0019] Step S10: Obtain the spatiotemporal characteristics of vehicle traffic data for node i in the historical time period t of year τ. Compared with the representative traffic pattern set P in year τ τ Cosine similarity P of various representative traffic modes in China τ,i,t Based on cosine similarity P τ,i,t and the representative traffic pattern set P in year τ τ Obtain the corresponding feature matrix
[0020] Step S11: Convert the feature matrix Spatiotemporal characteristics Perform residual connections, input the fully connected layer, and output the traffic prediction data of node i in the t-th historical time period of year τ;
[0021] Step S12: Traverse T historical time periods to obtain the matching traffic patterns of node i in each historical time period of year τ and the traffic prediction data of node i in each historical time period of year τ.
[0022] Based on the traffic prediction data and loss function of node i in each historical time period of year τ, the spatiotemporal learning model is updated to obtain the updated spatiotemporal learning model B′. τ,i ;
[0023] Step S13: Input the matching traffic patterns of node i in each historical time period of year τ into the knowledge base C. τ,i The updated knowledge base C′ is obtained by updating the knowledge base based on the knowledge preservation mechanism and the pattern traceability mechanism. τ,i ;
[0024] Step S14: Based on the updated spatiotemporal learning model B′ τ,i and updating the knowledge base C′ τ,i The updated traffic data prediction model A′ is obtained. τ,i ;
[0025] Step S15: Traverse Z historical years to obtain the updated traffic data prediction model A′. i ;
[0026] Step S16: Traverse I nodes to obtain the final traffic data prediction model;
[0027] Step S17: Use the final traffic data prediction model to predict vehicle flow.
[0028] Optionally, step S2, which involves determining the representative pattern set of each node in the continuous learning-based spatiotemporal graph network, includes the following specific steps:
[0029] Obtain nodes in the road network; collect historical vehicle traffic data for each node in the historical year τ.
[0030] Obtain the average daily vehicle traffic data for each node in the historical year τ;
[0031] Set the time interval;
[0032] According to the time interval, the average daily vehicle traffic data of each node in the historical year τ is statistically analyzed;
[0033] Set the slicing interval, slice the daily average vehicle flow data of each node in the historical year τ according to the slicing time interval, and obtain multiple slice data of each node in the historical year τ. Aggregate the vehicle flow data corresponding to the multiple slice data of each node in the historical year τ to obtain each aggregated vehicle flow data of each node in the historical year τ, which are represented as multiple traffic modes of each node in the historical year τ, and establish the original traffic mode set of each node in the historical year τ.
[0034] Cluster-based downsampling is used to extract representative traffic patterns from the original traffic pattern set of each node in the historical year τ, resulting in multiple representative traffic patterns of each node in the historical year τ, and establishing a representative traffic pattern set of each node in the historical year τ; τ = 1, 2, 3... Z, where Z represents the total number of historical years;
[0035] By iterating through Z historical years, we obtain the representative traffic pattern set of each node in each historical year.
[0036] Optionally, the spatiotemporal learning model includes a spatiotemporal learning module one and a spatiotemporal learning module two;
[0037] Both the Spatiotemporal Learning Module 1 and the Spatiotemporal Learning Module 2 include a Spatial Processing Module GCN and a Temporal Processing Module TCN.
[0038] Optionally, the expression for the spatiotemporal learning model is:
[0039]
[0040] in, This is the input to the (l-1)th layer spatial processing module GCN in year τ-1. This is the input for the GCN (Geometric Center of Space) module at layer l in year τ. A is the learnable parameter of the Lth layer spatial processing module GCN in year τ. τ It is the critical matrix for year τ, I τ is the identity matrix for year τ, and D is the degree matrix.
[0041] Optionally, the specific steps for obtaining the matching traffic pattern of node i in the t-th historical time period of year τ in step S9 include:
[0042] Based on the vehicle traffic data of node i in the t-th historical time period of year τ. Compared with the representative traffic pattern set P in year τ τ The cosine similarity of each representative traffic mode is calculated, and redundancy filtering is performed to obtain the corresponding similarity matrix. The representative traffic mode with the highest similarity is selected as the corresponding matching traffic mode.
[0043] Optionally, the corresponding feature matrix The expression is:
[0044]
[0045] Among them, P τ,i,t (k) represents the cosine similarity between the spatiotemporal characteristics of traffic flow data of node i in the historical time period t of year τ and the k-th representative traffic pattern in year τ, M τ (k) represents the k-th representative traffic mode in year τ, and K represents the total number of representative traffic modes.
[0046] Optionally, step 13 describes obtaining the updated knowledge base C′. τ,i The specific steps include:
[0047] Step S131: Determine whether node i has historical vehicle traffic data in year τ-1. If not, node i is a newly added node and proceed to step S133; if so, proceed to the next step.
[0048] Step S132: Determine whether the matching traffic pattern of node i has changed significantly in each historical time period of year τ. If yes, proceed to the next step; otherwise, let τ = τ + 1 and return to step S6.
[0049] Step S133: Use the matching traffic patterns of node i in each historical time period of year τ to update the knowledge base and obtain the updated knowledge base.
[0050] Optionally, the specific steps to determine whether the traffic pattern of node i has changed significantly in year τ include:
[0051] The probability distributions of vehicle traffic flow at node i in each historical time period of year τ-1 and year τ are obtained respectively. and probability distribution
[0052] Obtain probability distribution and probability distribution The Wasserstein distance is such that if the Wasserstein distance is small, the distribution difference is small, indicating that the traffic pattern of node i in year τ has not changed significantly.
[0053] If the Wasserstein distance is large, the distribution difference is large, indicating that the traffic pattern of node i changes significantly in year τ, and node i is considered a conflict node.
[0054] Optionally, the probability distribution of vehicle traffic flow at node i in each historical time period of year τ-1 and year τ can be obtained. and probability distribution The specific steps include:
[0055] Collect the average daily vehicle traffic data of node i in year τ-1 and year τ, respectively;
[0056] Obtain the total daily vehicle traffic data for node i in year τ-1 and year τ, respectively;
[0057] Obtain the probability distribution of the vehicle traffic data of node i in the historical time period τ-1 and t in the corresponding total vehicle traffic data for the whole day.
[0058] Obtain vehicle traffic data for node i in the historical time period t of year τ. Probability distribution of the corresponding total daily vehicle traffic data
[0059] Optionally, the expression for the knowledge preservation mechanism is:
[0060] L s =λvec(θ) τ-1 -θ τ ) Τ Ωvec(θ τ-1 -θ τ )
[0061] Where λ is the balance factor, a hyperparameter, and θ τ-1 Traffic prediction model F τ-1 All parameters; vec(.) represents the operation function, Ω represents Fisher information, θ τ Traffic prediction model F τ All parameters.
[0062] Compared with the prior art, the present invention has at least the following beneficial effects:
[0063] (1) This invention captures the spatiotemporal characteristics of vehicle flow data while extracting representative patterns of vehicle flow data and forming a knowledge base to better adapt to the dynamic changes in traffic patterns.
[0064] (2) This invention designs a continuous learning algorithm based on a pattern expansion mechanism, a pattern consolidation mechanism, and a pattern traceability mechanism. The pattern expansion mechanism selects newly added nodes and nodes with large differences in traffic patterns to update the knowledge base. The pattern consolidation mechanism consolidates the learned knowledge by specifying the initial weight of the model and restricting the updating ability of important parameters. The pattern traceability mechanism trains the knowledge base by selecting relatively stable traffic pattern nodes to form a subgraph and consolidates the learned traffic patterns.
[0065] (3) In this invention, the nodes representing new traffic patterns and historically stable nodes are fine-tuned, and constraint smoothing is introduced in the parameter update. This reduces the computational and time costs of updating the traffic data prediction model while maintaining the sensitivity of the traffic data prediction model to historical data. Attached Figure Description
[0066] The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of the invention.
[0067] Figure 1 This is a schematic diagram of the flowchart of the traffic data prediction model in an embodiment of the present invention;
[0068] Figure 2 This is a schematic diagram of a spatiotemporal graph network based on continuous learning in an embodiment of the present invention;
[0069] Figure 3 This is a schematic diagram illustrating an example of a traffic pattern in an embodiment of the present invention;
[0070] Figure 4 This is a schematic diagram of the operation of the gated timing layer in an embodiment of the present invention. Detailed Implementation
[0071] To better understand the above-described objectives, features, and advantages of the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other. Furthermore, the present invention can be implemented in other ways different from those described herein; therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0072] A specific embodiment of the present invention, such as Figure 1-4 A traffic data prediction method based on spatiotemporal graph networks with sustainable learning is disclosed. The specific implementation steps are as follows:
[0073] Step S1: Collect historical vehicle traffic data for each node in the road network;
[0074] For example, the node is an intersection or connection point in a road network;
[0075] The nodes are intersections, crossroads, overpasses, or roundabouts;
[0076] Step S2: Construct an initial spatiotemporal graph network based on continuous learning based on the road network; determine the representative pattern set of each node in the spatiotemporal graph network based on continuous learning based on the historical vehicle flow data of each node, and obtain the spatiotemporal graph network based on continuous learning, which is represented as a knowledge base.
[0077] Establish a spatiotemporal learning model;
[0078] Optionally, step S2, which involves determining the representative pattern set of each node in the continuous learning-based spatiotemporal graph network, includes the following specific steps:
[0079] Obtain nodes in the road network; collect historical vehicle traffic data for each node in the historical year τ.
[0080] Obtain the average daily vehicle flow data of each node in the τth historical year; the input format is a three-dimensional array of B*T*N, where B represents the data batch, T represents the time series length, N represents the node number, and each data point represents the traffic flow of the node at this time step within the data batch.
[0081] Set the time interval;
[0082] According to the time interval, the average daily vehicle traffic data of each node in the historical year τ is statistically analyzed;
[0083] Set the slicing interval, slice the daily average vehicle flow data of each node in the historical year τ according to the slicing time interval, and obtain multiple slice data of each node in the historical year τ. Aggregate the vehicle flow data corresponding to the multiple slice data of each node in the historical year τ to obtain each aggregated vehicle flow data of each node in the historical year τ, which are represented as multiple traffic modes of each node in the historical year τ, and establish the original traffic mode set of each node in the historical year τ.
[0084] Cluster-based downsampling is used to extract representative traffic patterns from the original traffic pattern set of each node in the historical year τ, resulting in multiple representative traffic patterns of each node in the historical year τ, and establishing a representative traffic pattern set of each node in the historical year τ; τ = 1, 2, 3... Z, where Z represents the total number of historical years;
[0085] By iterating through Z historical years, we obtain the representative traffic pattern set of each node in each historical year.
[0086] Preferably, the specific steps for extracting representative traffic patterns of each node in the original traffic pattern set in year τ using cluster-based downsampling include:
[0087] The K-means algorithm is used to operate on the original traffic pattern set of each node in year τ, with each cluster center regarded as a representative pattern, to obtain the representative traffic pattern set of each node in year τ.
[0088] Step S3: Build a traffic data prediction model using a spatiotemporal learning model and a knowledge base;
[0089] Optionally, the spatiotemporal learning model includes a spatiotemporal learning module one and a spatiotemporal learning module two;
[0090] Both the first and second spatiotemporal learning modules include a spatial processing module GCN and a temporal processing module TCN.
[0091] Step S4: Let i = 1. When i = 1, it represents the first node in the τth historical year of the road network.
[0092] Step S5: Let τ = 1. When τ = 1, it means that node i is in the first historical year.
[0093] Step S6: Let t = 1. When t = 1, it represents the traffic pattern of node i in the initial historical time period of the historical year τ.
[0094] Step S7: Obtain the vehicle traffic data of node i in the t-th historical time period of year τ. Input traffic data prediction model
[0095] Step S8: Based on the spatiotemporal learning model Obtain the spatiotemporal characteristics of traffic flow data of node i in the historical time period t of year τ.
[0096] Optionally, the expression for the spatiotemporal learning model is:
[0097]
[0098] in, This is the input to the (l-1)th layer spatial processing module GCN in year τ-1. This is the input for the GCN (Geometric Center of Space) module at layer l in year τ. A is the learnable parameter of the Lth layer spatial processing module GCN in year τ. τ It is the critical matrix for year τ, I τ is the corresponding identity matrix, and D is the degree matrix.
[0099] Furthermore, As the output of the spatial processing module GCN, it is used as the input of the gated time series layer to capture temporal correlations. In this invention, the gated time series layer can dynamically process the temporal dependencies in the sequence data, that is, the data of the later time point will be affected by the data of the earlier time point, ensuring that the spatiotemporal learning model will not use future information when processing the current data, thereby partially avoiding the problem of disordered causal relationships in time series analysis.
[0100] Step S9: Obtain the knowledge base M τ The representative traffic pattern set P in the τth year τ ;
[0101] Based on the representative traffic pattern set P of year τ τ Vehicle traffic data for node i in the historical time period t of year τ Perform traffic pattern matching to obtain the matching traffic pattern of node i in the historical time period t of year τ;
[0102] Optionally, the specific steps for obtaining the matching traffic pattern of node i in the t-th historical time period of year τ in step S9 include:
[0103] Based on the vehicle traffic data of node i in the t-th historical time period of year τ. Compared with the representative traffic pattern set P in year τ τ The cosine similarity of each representative traffic mode is calculated, and redundancy filtering is performed to obtain the corresponding similarity matrix. The representative traffic mode with the highest similarity is selected as the corresponding matching traffic mode.
[0104] Step S10: Obtain the spatiotemporal characteristics of vehicle traffic data for node i in the historical time period t of year τ. Compared with the representative traffic pattern set P in year τ τ Cosine similarity P of various representative traffic modes in China τ,i,t The corresponding cosine similarity attention score matrix P′ is obtained. τ,i,t ;
[0105] Based on cosine similarity P τ,i,t and the representative traffic pattern set P in year τ τ Obtain the corresponding feature matrix The expression is:
[0106]
[0107] Among them, P τ,i,t (k) represents the cosine similarity between the spatiotemporal characteristics of traffic flow data of node i in the historical time period t of year τ and the k-th representative traffic pattern in year τ, M τ(k) represents the k-th representative traffic mode in year τ, and K represents the total number of representative traffic modes.
[0108] Optionally, step S10 involves obtaining the probability distribution of vehicle traffic data for each historical time period of node i in the (τ-1)th year. The specific steps include:
[0109] Obtain the total vehicle traffic data for node i for each day in year τ-1;
[0110] Calculate the proportion of vehicle traffic data for node i in each historical time period of each day in year τ-1 to the total vehicle traffic data for that day, and obtain the probability distribution.
[0111] Optionally, the cosine similarity expression for each representative traffic mode is:
[0112]
[0113] Among them, M τ (k) represents the k-th representative traffic pattern in year τ, P τ,i,t (k) represents the k-th representative traffic pattern of node i in the t-th historical time period of year τ. Let represent the spatiotemporal characteristics of node i in the t-th historical time period of year τ, and D represent the dimension of the representative traffic mode.
[0114] Step S11: Convert the feature matrix Spatiotemporal characteristics Perform residual connections, input the fully connected layer, and output the traffic prediction data of node i in the t-th historical time period of year τ;
[0115] Step S12: Traverse T historical time periods to obtain the matching traffic patterns of node i in each historical time period of year τ and the traffic prediction data of node i in each historical time period of year τ.
[0116] Based on the traffic prediction data and loss function of node i in each historical time period of year τ, the spatiotemporal learning model is updated to obtain the updated spatiotemporal learning model B′. τ,i ;
[0117] Step S13: Input the matching traffic patterns of node i in each historical time period of year τ into the knowledge base C. τ,i The updated knowledge base C′ is obtained by updating the knowledge base based on the knowledge preservation mechanism and the pattern traceability mechanism. τ,i ;
[0118] Optionally, the nodes with the lowest Wasserstein distance in the bottom 5% are selected as stable nodes, which reduces computational complexity, saves time and space resources, and reduces interference from anomalous data.
[0119] Optionally, step 13 describes obtaining the updated knowledge base C′. τ,i The specific steps include:
[0120] Step S131: Determine whether node i has historical vehicle traffic data in year τ-1. If not, node i is a newly added node and proceed to step S133; if so, proceed to the next step.
[0121] Step S132: Determine whether the matching traffic pattern of node i has changed significantly in each historical time period of year τ. If yes, proceed to the next step; otherwise, let τ = τ + 1 and return to step S6.
[0122] Step S133: Use the matching traffic patterns of node i in each historical time period of year τ to update the knowledge base and obtain the updated knowledge base.
[0123] Furthermore, the specific steps to determine whether the traffic pattern of node i has changed significantly in year τ include:
[0124] The probability distributions of vehicle traffic flow at node i in each historical time period of year τ-1 and year τ are obtained respectively. and probability distribution
[0125] Obtain probability distribution and probability distribution The Wasserstein distance is such that if the Wasserstein distance is small, the distribution difference is small, indicating that the traffic pattern of node i in year τ has not changed significantly.
[0126] If the Wasserstein distance is large, the distribution difference is large, indicating that the traffic pattern of node i changes significantly in year τ, and node i is regarded as a conflict node.
[0127] probability distribution and probability distribution The nodes are sorted from smallest to largest by Wasserstein distance, and the top 5% of nodes with the lowest Wasserstein distance are selected as stable nodes. The knowledge base is then trained using these stable nodes to reduce computational complexity, save time and space resources, and reduce interference from anomalous data.
[0128] Furthermore, the probability distribution of vehicle traffic flow at node i in each historical time period of year τ-1 and year τ is obtained. and probability distribution The specific steps include:
[0129] Collect the average daily vehicle traffic data of node i in year τ-1 and year τ, respectively;
[0130] Obtain the total daily vehicle traffic data for node i in year τ-1 and year τ, respectively;
[0131] Obtain the probability distribution of the vehicle traffic data of node i in the historical time period τ-1 and t in the corresponding total vehicle traffic data for the whole day.
[0132] Obtain vehicle traffic data for node i in the historical time period t of year τ. Probability distribution of the corresponding total daily vehicle traffic data The expression is:
[0133]
[0134] in, This represents the vehicle traffic data of node i during the historical time period t in the (τ-1)th year.
[0135] It is understood that the daily average vehicle traffic data is collected by node i at 5-minute intervals every day in year τ, for a total of 288 time periods.
[0136] Step S14: Based on the updated spatiotemporal learning model B′ τ,i and updating the knowledge base C′τ ,i The updated traffic data prediction model A′ is obtained. τ,i ;
[0137] Step S15: Traverse Z historical years to obtain the updated traffic data prediction model A′. i ;
[0138] Step S16: Traverse I nodes to obtain the final traffic data prediction model;
[0139] Step S17: Use the final traffic data prediction model to predict vehicle flow.
[0140] Optionally, the loss function expression of the traffic prediction model is:
[0141]
[0142] Among them, L τ Let τ be the total loss in year τ. Y represents the predicted vehicle traffic data for each node in each historical time period of year τ. τThis represents the actual vehicle traffic data for each node in each historical time period of year τ; μ is a hyperparameter used to balance the two losses; P τ Let Q be the attention score matrix for year τ. τ Let be the matching degree matrix for year τ, ensuring that the traffic prediction model only accesses representative patterns matched in the knowledge base.
[0143] Optionally, the expression for the knowledge preservation mechanism is:
[0144] L s =λvec(θ) τ-1 -θ τ ) Τ Ωvec(θ τ-1 -θ τ )
[0145] Where λ is the balance factor, a hyperparameter, and θ τ-1 Traffic prediction model F τ-1 All parameters; vec(.) represents the operation function, Ω represents Fisher information, θ τ Traffic prediction model F τ All parameters;
[0146] Furthermore,
[0147]
[0148] Among them, Ω i Traffic prediction model F τ-1 The Fisher information matrix of node i, used to measure parameter importance, |D t | represents the training data for historical time period t, x represents a sample of the training data for historical time period t, L pr For the prediction loss function, θ i For the parameters of node i.
[0149] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included in the scope of protection of the present invention.
Claims
1. A traffic data prediction method based on spatiotemporal graph networks with sustainable learning, characterized in that, include: Step S1: Collect historical vehicle traffic data for each node in the road network; Step S2: Construct an initial spatiotemporal graph network based on continuous learning, using the road network as a foundation; Based on the historical vehicle traffic data of each node, the representative pattern set of each node in the spatiotemporal graph network based on continuous learning is determined, and the spatiotemporal graph network based on continuous learning is obtained and represented as a knowledge base. Establish a spatiotemporal learning model; Step S3: Build a traffic data prediction model using a spatiotemporal learning model and a knowledge base; Step S4, let i =1, when i When =1, it indicates that the in the road network is the _ . The first milestone in history; Step S5, let τ =1, when τ When =1, it represents a node. i In the first historical year; Step S6, let t =1, when t =1 indicates a node i In the Traffic patterns during the initial historical period of a historical year; Step S7: Obtain Nodes i In the The year's first t Historical traffic flow data Input traffic data to predict the model ; Step S8: Based on the spatiotemporal learning model Obtain node i In the Year t Spatiotemporal characteristics of traffic flow data over historical time periods ; Step S9: Obtain the knowledge base The Middle Representative traffic patterns of the year ; Based on the Representative traffic patterns of the year For nodes i In the Year t Historical traffic flow data Perform traffic pattern matching to obtain nodes i In the Year t Matching traffic patterns over historical time periods; Step S10: Obtain Nodes i In the Year t Spatiotemporal characteristics of historical vehicle traffic data With the Representative traffic patterns of the year Cosine similarity of various representative transportation modes in China Based on cosine similarity and the Representative traffic patterns of the year Obtain the corresponding feature matrix The expression is: in, Indicates that node i is at the 1st rank. Spatiotemporal characteristics of traffic flow data for historical period t in year t and the Cosine similarity of the k-th representative traffic mode in the year Indicates the first The k-th representative traffic mode of the year, where K represents the total number of representative traffic modes; Step S11: Convert the feature matrix Spatiotemporal characteristics Residual connection, input fully connected layer, output node i In the Year t Traffic forecast data for historical time periods; Step S12, Traversal T A historical time period is used to obtain nodes. i In the Matching traffic patterns and nodes for different historical periods of the year i In the Traffic forecast data for various historical periods throughout the year; Based on nodes i In the The spatiotemporal learning model is updated using traffic prediction data and loss functions from various historical time periods throughout the year, resulting in an updated spatiotemporal learning model. ; The expression for the spatiotemporal learning model is: in, For the first The input of the spatial processing module GCN in the (l-1)th layer of the year, For the first Input of the first-level space processing module GCN in 2000 It is the first Learnable parameters of the first-level spatial processing module GCN in the year It is the first The critical matrix for each year is the corresponding identity matrix, and D is the degree matrix; Step S13: Transfer the node i In the Traffic pattern matching input to knowledge base for various historical periods of the year The updated knowledge base is obtained by updating it based on knowledge preservation and pattern traceability mechanisms. ; The expression for the knowledge preservation mechanism is: in, For balance factors, hyperparameters, Traffic prediction model All parameters; Represents an operation function. This indicates Fisher information. Traffic prediction model All parameters; Step S14: Based on the updated spatiotemporal learning model and updating the knowledge base The updated traffic data prediction model is obtained. ; Step S15, Traversal In a historical year, updated traffic data prediction models were obtained. ; Step S16, Traversal I By analyzing the data from each node, we can obtain the final traffic data prediction model. Step S17: Use the final traffic data prediction model to predict vehicle flow.
2. The traffic data prediction method based on spatiotemporal graph networks with sustainable learning according to claim 1, characterized in that, Step S2, which involves determining the representative pattern set of each node in the continuous learning-based spatiotemporal graph network, includes the following specific steps: Obtain the nodes in the road network; count the nodes at the 1st rank. Historical vehicle traffic data from multiple historical years; Obtain each node at the 1st Historical average daily vehicle traffic data; the input format is a three-dimensional array of B*T*N, where B represents the data batch, T represents the time series length, N represents the node number, and each data point represents the traffic flow of the node at this time step within the data batch. Set the time interval; According to the time interval, the statistics of each node at the [number]th [time] are [statistics]. Historical daily average vehicle traffic data; Set the slice interval, and perform slice interval analysis on each node at the specified time. Historical daily average vehicle traffic data is sliced to obtain the data for each node in the [missing data]. Multiple slices of historical year data, placing each node in the 1st... The vehicle traffic data corresponding to multiple slices of historical data are aggregated to obtain the traffic flow data of each node in the first year. Historical aggregated vehicle traffic data for each year, represented as the traffic flow of each node in the [missing information]. Multiple modes of transportation in historical years Each node at the A collection of primitive transportation patterns from historical years; Cluster-based downsampling is used to extract the values of each node at the 1st... The original transportation patterns of historical years are representative of the transportation patterns, and the nodes at each point in the 19th century are obtained. Several representative transportation modes from that year were established, and each node was identified in the [year]. A representative collection of transportation modes from that year; =1,2,3...Z, where Z represents the total number of historical years; Traverse Z historical years to obtain the nodes at each point. A representative collection of transportation modes from that year.
3. The traffic data prediction method based on spatiotemporal graph networks with sustainable learning according to claim 1, characterized in that, The spatiotemporal learning model includes spatiotemporal learning module one and spatiotemporal learning module two; Both the Spatiotemporal Learning Module 1 and the Spatiotemporal Learning Module 2 include a Spatial Processing Module GCN and a Temporal Processing Module TCN.
4. The traffic data prediction method based on spatiotemporal graph networks with sustainable learning according to claim 1, characterized in that, Step S9 describes obtaining node i in the first... The specific steps for matching traffic patterns in the historical time period t of year t include: Based on the node acquisition i In the The year's first t Historical traffic flow data With the Representative traffic patterns of the year The cosine similarity of each representative traffic mode is calculated, and redundancy filtering is performed to obtain the corresponding similarity matrix. The representative traffic mode with the highest similarity is selected as the corresponding matching traffic mode.
5. The traffic data prediction method based on spatiotemporal graph networks with sustainable learning according to claim 1, characterized in that, Step 13 describes obtaining an updated knowledge base. The specific steps include: Step S131: Determine the node i In the Does the node have historical vehicle traffic data for the year? If not, then... i To add a new node, proceed to step S133; if there is already a node, proceed to the next step. Step S132: Determine the node i In the If the matching traffic patterns have changed significantly across different historical time periods, proceed to the next step if yes; otherwise, let... = +1, return to step S6; Step S133: Utilize nodes i In the Matching traffic patterns across different historical periods throughout the year and updating the knowledge base to obtain an updated knowledge base.
6. The traffic data prediction method based on spatiotemporal graph networks with sustainable learning according to claim 5, characterized in that, Determine the node i In the The specific steps to determine whether traffic patterns have changed significantly in a given year include: Obtain nodes respectively i In the Year and the Probability distribution of vehicle traffic flow in different historical periods of the year probability distribution ; Obtain probability distribution probability distribution The Wasserstein distance is considered; a smaller Wasserstein distance indicates smaller distribution differences among nodes. i In the The transportation pattern did not change significantly over the years; If the Wasserstein distance is large, the distribution difference is large, indicating that node i is at the . The traffic pattern changed significantly in that year, so node i was identified as the conflict node.
7. The traffic data prediction method based on spatiotemporal graph networks with sustainable learning according to claim 6, characterized in that, Get Node i In the Year and the Probability distribution of vehicle traffic flow in different historical periods of the year probability distribution The specific steps include: Collection Nodes i respectively in the Year and the Annual average daily vehicle traffic data; Get Nodes i respectively in the Year and the Total daily vehicle traffic data for the year; Get Nodes i In the No. t Probability distribution of historical time period vehicle traffic data in the corresponding total daily vehicle traffic data ; Get Nodes i In the Year t Historical traffic flow data Probability distribution of the corresponding total daily vehicle traffic data .
Citation Information
Patent Citations
Traffic flow prediction method based on space-time embedded attention network
CN117688453A
Improved traffic flow prediction method based on aggregated space-time multi-graph convolutional network
CN118097948A