Traffic flow prediction method based on space-time diagram neural network and related equipment

The spatiotemporal graph neural network method, which uses dynamic graph structure and multi-scale time modeling, solves the problems of spatial dynamism and single temporal features in holiday traffic flow prediction, improves prediction accuracy and system adaptability, and is suitable for holiday traffic flow prediction.

CN120998027APending Publication Date: 2025-11-21GUANGXI TRANSPORTATION SCI & TECH GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511167378.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies for predicting traffic flow during holidays suffer from limitations due to static graph structures, insufficient modeling at a single time scale, and inadequate adaptability to small samples, leading to prediction bias and decreased accuracy.

Method used

A spatiotemporal graph neural network-based approach is adopted. Through dynamic graph structure adjustment and multi-scale time modeling, dynamic time warping and graph attention networks are used to capture the dynamic spatial relationships of traffic stations. Multi-scale time features are extracted through long short-term memory networks, and data augmentation techniques are combined to improve the adaptability and accuracy of the model.

Benefits of technology

It enables more accurate prediction of traffic flow during holidays, improves the resource utilization and real-time management capabilities of the transportation system, and is better able to adapt to small sample scenarios and complex time patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120998027A_ABST
    Figure CN120998027A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method based on a space-time diagram neural network and related equipment, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining a traffic network diagram; wherein nodes of the traffic network diagram represent traffic stations, and edges between the nodes represent roads between the corresponding traffic stations; dynamically acquiring time sequence data of each traffic station and carrying out normalization preprocessing on the time sequence data; wherein the time sequence data comprises the traffic flow and the vehicle speed of the corresponding traffic station; dynamically updating the traffic network map by using the time sequence data after the normalization preprocessing to obtain a dynamic update map; extracting spatial features of the dynamically updated graph by using a graph attention network; extracting time features of corresponding scales from the spatial features by using three long and short time memory networks with different time scales; and predicting the traffic flow of the next time step according to the time characteristics of the three scales. The traffic flow can be predicted more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a traffic flow prediction method based on a spatio-temporal graph neural network and related equipment. BACKGROUND

[0002] The prior art has the following main problems in holiday traffic flow prediction:

[0003] (1) Limitations of static graph structure: Existing GNN-based prediction methods (such as CN202010987654) usually assume that the road network relationship is fixed, such as constructing a graph structure based on geographic distance or static road network connections. However, during holidays, traffic patterns may change dynamically due to concentrated travel (such as popular tourist routes) or traffic controls, and static graphs are difficult to adapt to such real-time relationship adjustments, leading to prediction bias.(2) Insufficient modeling of a single time scale: Existing methods (such as CN202010987654 and DeepTransport) usually only focus on features within a fixed time window (such as hourly), ignoring the joint influence of short-term fluctuations (such as the morning rush hour) and long-term trends (such as the distribution before and after the holiday) in holiday traffic flow. This single-scale modeling reduces the model's ability to capture complex temporal patterns.(3) Insufficient adaptability to small samples: The amount of holiday traffic flow data is limited, and existing methods do not design optimization strategies for small sample scenarios, which can easily lead to overfitting or decreased prediction performance due to insufficient training data. SUMMARY

[0004] Therefore, the embodiments of the present application provide a traffic flow prediction method based on a spatio-temporal graph neural network and related equipment to improve the accuracy of predicted traffic flow.

[0005] An aspect of an embodiment of the present application provides a traffic flow prediction method based on a spatio-temporal graph neural network, the traffic flow prediction method comprising the following steps:

[0006] Obtaining a traffic network graph; wherein the nodes of the traffic network graph represent various traffic sites, and the edges between the nodes represent roads between the corresponding traffic sites;

[0007] Dynamically obtaining time series data of each traffic site and performing normalization preprocessing on the time series data; wherein the time series data includes traffic flow and speed of the corresponding traffic site;

[0008] Dynamically updating the traffic network graph using the normalized preprocessed time series data to obtain a dynamically updated graph;

[0009] Extracting spatial features of the dynamically updated graph using a graph attention network;

[0010] extracting time features of corresponding scales from the spatial features by using long short-term memory networks with three different time scales;

[0011] predicting the traffic flow of the next time step according to the time features of the three scales.

[0012] In some embodiments, the dynamic updating of the traffic network map using the normalized and preprocessed time series data to obtain a dynamically updated map comprises the following steps:

[0013] adopting a dynamic time warping method to dynamically compare the differences between any two traffic stations in a set time period with respect to the time series data after normalization and preprocessing to find the minimum cumulative distance between any two traffic stations;

[0014] If the minimum cumulative distance is less than a preset threshold, an edge is added between the two traffic stations to obtain the dynamically updated map.

[0015] In some embodiments, the extraction of the spatial features of the dynamically updated map using the graph attention network comprises the following steps:

[0016] aggregating the neighbor information of each node using the attention weights of the neighbor nodes of each node and generating the spatial features of each node by using the graph attention network.

[0017] In some embodiments, the traffic flow prediction method further comprises the following steps:

[0018] assigning the corresponding attention weights to the neighbor nodes of each node according to the dynamically updated map.

[0019] In some embodiments, the extraction of the time features of corresponding scales from the spatial features by using long short-term memory networks with three different time scales comprises the following steps:

[0020] extracting first time features of a first time scale by using a short-term branch of the long short-term memory network;

[0021] extracting second time features of a second time scale by using a medium-term branch of the long short-term memory network;

[0022] extracting third time features of a third time scale by using a long-term branch of the long short-term memory network;

[0023] wherein the first time scale, the second time scale and the third time scale increase in turn.

[0024] In some embodiments, the predicting the traffic volume of the next time step according to the time features of the three scales comprises the following steps:

[0025] calculating a corresponding score weight for the time feature of each scale;

[0026] performing weighted summation on the time features of the three scales according to the score weights to obtain a fusion feature;

[0027] performing linear transformation on the fusion feature by using a fully connected layer, and then predicting the traffic volume of the next time step.

[0028] In some embodiments, the calculating a corresponding score weight for the time feature of each scale comprises the following steps:

[0029] determining an activity level according to the traffic volume variation degree of the time feature of each scale in the corresponding time scale;

[0030] calculating the corresponding score weight according to the activity level; wherein the greater the traffic volume variation degree, the greater the activity level, and then the greater the score weight.

[0031] Another aspect of the embodiments of the present application also provides a traffic flow prediction device based on a spatio-temporal graph neural network, which comprises:

[0032] a graph acquisition unit configured to acquire a traffic road network graph; wherein a node of the traffic road network graph represents each traffic site, and an edge between the nodes represents a road between the corresponding traffic sites;

[0033] a data acquisition unit configured to dynamically acquire time series data of each traffic site and perform normalization preprocessing on the time series data; wherein the time series data comprises traffic volume and speed of the corresponding traffic site;

[0034] a graph updating unit configured to dynamically update the traffic road network graph by using the time series data after normalization preprocessing to obtain a dynamically updated graph;

[0035] a spatial feature extraction unit configured to extract a spatial feature of the dynamically updated graph by using a graph attention network;

[0036] a time feature extraction unit configured to extract a time feature of a corresponding scale for the spatial feature by using long short-term memory networks of three different time scales;

[0037] a traffic volume prediction unit configured to predict the traffic volume of the next time step according to the time features of the three scales.

[0038] Another aspect of the embodiment of the present application also provides an electronic device, comprising a processor and a memory;

[0039] The memory is configured to store a program.

[0040] The processor executes the program to implement the method according to any one of the preceding aspects.

[0041] Another aspect of the embodiment of the present application also provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the method according to any one of the preceding aspects.

[0042] The present application has at least the following beneficial effects:

[0043] The present application can obtain a traffic road network map; wherein the nodes of the traffic road network map represent various traffic stations, and the edges between the nodes represent the roads between the corresponding traffic stations; time series data of each traffic station is dynamically obtained and normalized pretreated; wherein the time series data includes the traffic flow and speed of the corresponding traffic station; the traffic road network map is dynamically updated using the normalized pretreated time series data to obtain a dynamically updated map; the spatial features of the dynamically updated map are extracted using a graph attention network; the time features of the corresponding scales are extracted from the spatial features using three long short-term memory networks with different time scales; and the traffic flow of the next time step is predicted according to the time features of the three scales. The present application can capture the dynamic spatial relationship of each traffic station by dynamically updating the traffic road network map, can more accurately reflect the traffic flow of each traffic station, and can more accurately predict the traffic flow compared with a single time scale feature by predicting the traffic flow of the next time step according to the time features of the three scales. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0045] Figure 1 A flowchart of a traffic flow prediction method based on a spatio-temporal graph neural network provided by an embodiment of the present application;

[0046] Figure 2 An example flowchart of a traffic flow prediction method based on a spatio-temporal graph neural network provided by an embodiment of the present application;

[0047] Figure 3 An example structure diagram of a traffic flow prediction system based on a spatio-temporal graph neural network provided by an embodiment of the present application;

[0048] Figure 4 A structural block diagram of a vehicle flow prediction device based on a space-time graph neural network is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0050] Before the detailed description of the embodiments of the present application, first, some related technologies involved in the embodiments of the present application are described as follows:

[0051] Traffic Flow Prediction: Traffic flow prediction is a core technology in intelligent transportation systems (ITS), which refers to predicting the number of vehicles on a road or station in a future period of time (such as the number of vehicles per hour) using historical and real-time traffic data. The goal is to analyze the temporal variation and spatial distribution of traffic flow to optimize traffic resource allocation, alleviate congestion, and improve travel efficiency. This technology is widely used in urban traffic management, highway monitoring, and navigation systems, especially in high volatility scenarios such as holidays.

[0052] Dynamic Graph Modeling: Dynamic graph modeling refers to the process of dynamically constructing and updating graph structures based on time-varying data. In the field of transportation, nodes in the graph usually represent traffic stations (such as toll stations or intersections), and edges represent the connection between stations (such as roads or traffic transferability). Unlike static graphs, the edges and weights of dynamic graphs are adjusted according to real-time data (such as traffic similarity), aiming to capture dynamic dependencies in the transportation network, often used to improve the adaptability of spatial feature extraction.

[0053] Multi-scale Temporal Modeling: Multi-scale temporal modeling is a technique for analyzing and predicting time series by considering features at different time scales (such as hourly and daily) to capture short-term fluctuations and long-term trends in data. In vehicle flow prediction, this method can handle short-term changes such as morning rush hours and long-term patterns such as holiday distributions, and by integrating multi-scale features, it can improve the comprehensiveness and accuracy of prediction, often implemented in combination with neural networks.

[0054] Graph Attention Network (GAT): Graph Attention Network is a variant of Graph Neural Network (GNN) that dynamically assigns weights to neighboring nodes through attention mechanisms, enhancing the ability to model important relationships. In traffic prediction, GAT is used to aggregate spatial features between stations, such as adjusting neighbor contributions based on traffic correlation strength, to generate more accurate station representations. Its characteristics are adaptability and flexibility, suitable for processing dynamic traffic networks.

[0055] Long Short-Term Memory (LSTM): Long Short-Term Memory is an improved form of Recurrent Neural Network (RNN) that effectively captures long-term dependencies in time series by introducing memory cells and gating mechanisms (input gate, forget gate, output gate). In traffic flow prediction, LSTM is often used to model the time dynamics of traffic flow, such as predicting future traffic volume or analyzing holiday trends, especially suitable for non-stationary data scenarios.

[0056] With the acceleration of urbanization and rapid growth of traffic demand, traffic flow prediction has become crucial in Intelligent Transportation Systems (ITS), urban planning, and holiday traffic management. During holidays (such as National Day, Spring Festival, etc.), due to factors such as concentrated travel, tourist hotspot effects, and return waves, the traffic volume on highways and urban roads presents significant non-stationarity and complexity. For example, holiday traffic may have significant peaks at the beginning and end of the holiday, accompanied by hourly short-term fluctuations (such as morning and evening peaks). Accurate traffic flow prediction not only helps traffic management departments optimize resource allocation and alleviate congestion, but also provides real-time navigation suggestions for travelers, improving the efficiency of the transportation system. Traditional traffic flow prediction methods mainly rely on statistical models, such as Autoregressive Integrated Moving Average (ARIMA) and its variants (such as SARIMA), which can predict traffic changes to some extent by fitting the trends and seasonality of historical data. However, ARIMA models assume data stationarity and cannot utilize the spatial topology of the road network (such as the connection between stations), so their prediction accuracy is low in complex holiday traffic scenarios.

[0057] In recent years, with the development of deep learning technology, neural network-based traffic flow prediction methods have been widely applied. In particular, the combination of graph neural networks (GNN) and sequence processing neural networks (such as long short-term memory networks LSTM, gated recurrent units GRU) provides a powerful tool for modeling the spatial dependence and temporal dynamics of traffic flow. In the field of traffic prediction, road networks are usually abstracted as graph structures, where nodes represent road sites or intersections, and directed edges represent road connection relationships. The weights on the edges may reflect distance, flow transferability, or traffic capacity. GNN can effectively capture the spatial dependence between nodes by aggregating the information of neighboring nodes, while sequence models are good at extracting long-term trends and short-term fluctuations in time series. This spatio-temporal joint modeling method has shown strong prediction ability in conventional traffic scenarios. However, holiday traffic prediction faces unique challenges: first, the data sample is limited, for example, there are usually less than ten days of data before and after the National Day holiday, and traditional models have difficulty in accurately modeling with small sample data; second, traffic fluctuations have multiple time scales, and a single model is difficult to capture both short-term hourly changes and long-term trends.

[0058] Currently, existing technical solutions for holiday traffic prediction mainly focus on time series analysis and spatio-temporal joint modeling. In terms of time series analysis, ARIMA models and their variants are widely used for traffic flow prediction. For example, the literature "Research on short-term traffic flow prediction based on ARFIMA hybrid model" proposes a prediction method based on ARIMA, which analyzes the periodicity of historical traffic data to predict future traffic. This method has low computational complexity and is suitable for stationary data, but it performs poorly in the non-stationary and spatial dependence scenarios of holiday traffic. To overcome these limitations, spatio-temporal prediction methods based on deep learning have gradually become a research hotspot. For example, the literature "DeepTransport: Prediction and Simulation of Human Mobility and Transportation Mode with Deep Learning" proposes a model that combines convolutional neural networks (CNN) and LSTM, which extracts spatial features using CNN and models temporal dependence using LSTM. This method has achieved good results in urban traffic prediction, but it does not consider the dynamic changes in holiday traffic patterns.

[0059] In terms of space-time joint modeling, graph neural networks have become one of the mainstream methods. Patent publication number CN114495492A "Traffic flow prediction method based on graph neural network" proposes a GNN prediction scheme based on static road network structure. This method models the road network as a fixed graph structure, uses graph convolution network (GCN) to extract the spatial dependence between stations, and then combines LSTM to predict future traffic flow. Its advantage is that it can achieve high prediction accuracy with low computational complexity, especially suitable for conventional traffic scenarios. However, this method does not directly solve the modeling problem of spatial dynamics and multi-scale time characteristics in the field of traffic, and has high computational complexity, which is limited in real-time traffic flow prediction.

[0060] In view of the above shortcomings of the prior art, the present application proposes a dynamic graph and multi-scale time modeling method for holiday traffic flow prediction, aiming to provide a complete prediction framework and improve prediction accuracy and system adaptability. The present application has the following technical solutions:

[0061] Dynamic graph structure adjustment: dynamically calculate the similarity or causality between stations through real-time traffic flow data (such as traffic volume, speed change), update the graph structure of GNN, so as to adapt to the dynamic mode of holiday traffic flow and reduce the prediction error caused by static assumption.

[0062] Multi-scale time feature fusion: design a multi-scale time modeling module, use parallel LSTM branches to process different time scale inputs (such as 1 hour, 6 hours, 24 hours), and integrate short-term fluctuations and long-term trend features through a fusion layer, so as to fully capture the complex time characteristics of holiday traffic flow and improve the accuracy of prediction.

[0063] Small sample scene optimization: combine dynamic graph and multi-scale modeling, fully utilize limited holiday data, enhance model generalization ability through space-time joint feature extraction, reduce overfitting risk, and improve adaptability to small sample scenes.

[0064] The purpose of the present application is to solve the problems of insufficient spatial dynamics, single time characteristics and poor small sample adaptability in holiday traffic flow prediction through dynamic graph structure and multi-scale time modeling, so as to reduce prediction error and improve resource utilization and real-time management capability of traffic system.

[0065] Reference Figure 1 The embodiment of the present application provides a traffic flow prediction method based on spatio-temporal graph neural network, which specifically includes the following steps S100-S150:

[0066] S100: Obtain a traffic road network graph; wherein the nodes of the traffic road network graph represent various traffic stations, and the edges between the nodes represent the roads between the corresponding traffic stations;

[0067] S110: dynamically acquiring time series data of each traffic site and performing normalization preprocessing on the time series data; wherein the time series data includes traffic flow and vehicle speed corresponding to the traffic site;

[0068] S120: dynamically updating the traffic road network map using the time series data after normalization preprocessing to obtain a dynamically updated map;

[0069] S130: extracting spatial features of the dynamically updated map using a graph attention network;

[0070] S140: extracting time features of corresponding scales using three long short-term memory networks with different time scales for the spatial features;

[0071] S150: predicting traffic flow at the next time step according to the time features of the three scales.

[0072] Optionally, the step of dynamically updating the traffic road network map using the time series data after normalization preprocessing to obtain a dynamically updated map comprises the following steps:

[0073] Using a dynamic time warping method, the differences between any two traffic sites in the past set time regarding the time series data are dynamically compared based on the time series data after normalization preprocessing to find the smallest cumulative distance between any two traffic sites;

[0074] If the smallest cumulative distance is less than a preset threshold, an edge is added between the two traffic sites to obtain the dynamically updated map.

[0075] Optionally, the step of extracting spatial features of the dynamically updated map using a graph attention network comprises the following steps:

[0076] Using the graph attention network, neighbor information of each node is aggregated according to attention weights of neighbor nodes of each node, and the spatial features of each node are generated.

[0077] Optionally, the traffic flow prediction method further comprises the following steps:

[0078] According to the dynamically updated map, the neighbor nodes of each node are assigned corresponding attention weights.

[0079] Optionally, the step of extracting time features of corresponding scales using three long short-term memory networks with different time scales for the spatial features comprises the following steps:

[0080] The long short-term memory network of the short-term branch extracts first time features of a first time scale;

[0081] extracting, by the long short-term memory network with the medium branch, second time features of a second time scale;

[0082] extracting, by the long short-term memory network with the long branch, third time features of a third time scale;

[0083] wherein the first time scale, the second time scale and the third time scale increase sequentially.

[0084] Optionally, the predicting the traffic volume of the next time step according to the time features of the three scales comprises the following steps:

[0085] calculating corresponding score weights for the time features of the three scales respectively;

[0086] performing weighted summation on the time features of the three scales according to the score weights to obtain fused features;

[0087] performing linear transformation on the fused features by using a fully connected layer, and then predicting and generating the traffic volume of the next time step.

[0088] Optionally, the calculating corresponding score weights for the time features of the three scales respectively comprises the following steps:

[0089] determining an activity degree according to the traffic volume variation degree of the time features of the three scales in the corresponding time scale;

[0090] calculating the corresponding score weights according to the activity degree; wherein the greater the traffic volume variation degree, the greater the activity degree, and the greater the score weight.

[0091] Next, the scheme of the embodiments of the present application will be described in detail with reference to specific application examples.

[0092] The working of the embodiments is based on a traffic network system model, which is composed of a group of stations (traffic nodes) and roads (edges) connecting these stations, and is modeled in combination with the space-time characteristics of holiday traffic. Each station in the system represents a traffic monitoring point, such as a highway toll station or a city intersection, and the traffic data thereof is recorded in the form of a multivariate time series. The road network is modeled as a dynamic graph, represented as a structure containing a station set and an edge set, wherein the station set includes all traffic monitoring points, and the edge set reflects the dynamic connection relationship between the stations, such as traffic transferability or similarity, and these connection relationships change over time.

[0093] The traffic flow data of each traffic station is represented by a time series, including characteristics such as traffic volume (number of vehicles per hour) and average speed (kilometers per hour). The goal of the system is to predict the traffic flow in the future time period, such as the traffic volume in the next hour or the next day. Unlike conventional traffic prediction, the significant feature of holiday traffic flow is that its spatial relationship and time pattern will dynamically change, for example, popular tourist routes may cause the traffic correlation between certain stations to increase, and the traffic fluctuation has both short-term hourly changes (such as the morning peak) and long-period trends (such as the distribution before and after the holiday). Therefore, the ideal prediction method needs to consider both the spatial dynamics and multi-scale time characteristics of the road network.

[0094] The embodiment also includes a computing module for performing dynamic graph construction, multi-scale feature extraction, and prediction tasks. The processing capacity of each computing node may be different, such as using CPU or GPU, and needs to be allocated through optimization algorithms to ensure real-time performance.

[0095] The technical solution is described in detail:

[0096] The embodiment proposes a dynamic graph and multi-scale time modeling method for holiday traffic flow prediction, which includes two core modules: a dynamic graph construction module (DGCM) and a multi-scale temporal fusion module (MTFM). The implementation scheme of each function is described in detail below, and the flowchart and system device diagram are used for illustration.

[0097] Figure 2 The method flowchart of the embodiment is as follows:

[0098] 1. Data input: input the traffic time series data of each station.

[0099] 2. Data preprocessing: normalize the data to eliminate dimensional differences.

[0100] 3. Dynamic graph construction: calculate the similarity between stations, update the graph structure, and generate station features through GAT.

[0101] 4. Multi-scale feature extraction: input the station features into three LSTM branches to generate short-term, medium-term, and long-term features.

[0102] 5. Feature fusion: fuse multi-scale features through attention mechanism to generate comprehensive features.

[0103] 6. Traffic flow prediction: output the predicted traffic volume at the next time step through the fully connected layer.

[0104] 7. Model optimization: calculate loss, update model parameters.

[0105] Figure 3 The system structure diagram of the present embodiment is as follows:

[0106] 1. Data collection module: responsible for collecting traffic data from each site, such as through sensors or cameras, outputting raw time series.

[0107] 2. Preprocessing module: normalizing the raw data, outputting standardized data.

[0108] 3. Dynamic graph construction module (DGCM): contains similarity calculation unit and GAT unit, generates dynamic graph features based on real-time data.

[0109] 4. Multi-scale time fusion module (MTFM): contains three LSTM branches (short-term, medium-term, long-term) and attention fusion layer, outputs fused time features.

[0110] 5. Prediction module: generates predicted traffic flow through fully connected layers.

[0111] Next, the present embodiment will be described in detail.

[0112] 1. Technical implementation of dynamic graph construction module (DGCM).

[0113] Function: dynamically adjust the graph structure of the road network according to real-time traffic data, capture the dynamic spatial relationship of holiday traffic.

[0114] Technical implementation:

[0115] Step 1: Data preprocessing.

[0116] The input is the time series data of each site, including traffic flow and speed information. First, normalize the data, i.e. linearly convert the original data of each site to the range of 0 to 1, to eliminate the influence of different dimensions and ensure the stability of subsequent calculations.

[0117] Step 2: Similarity calculation between sites.

[0118] At each time step, based on the traffic data, use the dynamic time warping (DTW) method to calculate the similarity between any two sites. Specifically, DTW compares the traffic sequence differences of two sites over a period of time (such as 1 hour) in the past, and finds the smallest cumulative distance. If the distance is less than a preset threshold (empirically set to 0.2), it is considered that there is a strong correlation between the two sites, and a connection edge is added in the graph.

[0119] Step 3: Graph structure update.

[0120] After updating the graph structure according to the similarity calculation result, it is input into the graph neural network. Specifically, a graph attention network (GAT) is used for processing, the neighbor attention weight of each station is assigned (the attention weight is determined by the graph structure learned in step 2), the neighbor information is aggregated (the influence of other stations on the station is aggregated), and the feature representation of the station is generated (the feature representation fused with the influence information of other stations, i.e. the feature representation fused with the spatial information). The attention weight is automatically learned by the model, which ensures that important neighbors have greater contribution to the feature.

[0121] 2. Technical implementation of the multi-scale time fusion module (MTFM).

[0122] Function: fuse features of different time scales, capture short-term fluctuations and long-term trends of holiday traffic.

[0123] Technical implementation:

[0124] Step 1: Multi-scale feature extraction.

[0125] The feature of each station output by the dynamic graph construction module is input into three parallel long short-term memory (LSTM) branches, which process different time scales:

[0126] Short-term branch: use a 1-hour time window to capture hour-level fluctuations, such as traffic surge during the morning rush hour;

[0127] Medium-term branch: use a 6-hour time window to capture half-day changes, such as traffic distribution in the morning;

[0128] Long-term branch: use a 24-hour time window to capture day-level trends, such as the peak at the beginning and end of the holiday.

[0129] Each branch analyzes the input feature sequence through the LSTM network and outputs a corresponding feature representation with unified dimensions (i.e. a feature representation fused with time information).

[0130] Step 2: Feature fusion.

[0131] Use attention mechanism to fuse features of three scales. Specifically, calculate a score weight for the features of each scale, which is determined by a scoring function and represents the importance of the scale to the final prediction. Then, the three feature representations with unified dimensions obtained after LSTM are weighted and summed according to the weight, to obtain a feature representation fused with information of three scales.

[0132] The scoring function calculates the weight by measuring the "activity" of each scale's original feature (i.e., original traffic volume, traffic speed, traffic density, etc.). The activity refers to the degree of change in traffic volume over a period of time. The greater the change, the higher the activity, and the greater the weight. This function automatically adjusts based on actual traffic data to ensure that important features (such as sudden changes in short-term traffic) receive more attention, while the weight of stable features is lower.

[0133] Step 3: Traffic Prediction.

[0134] The fused features are input into a fully connected layer to generate the predicted traffic volume at the next time step through linear transformation. The parameters of the fully connected layer are obtained through model training.

[0135] 3. Model Training and Optimization.

[0136] Function: Optimize model parameters to ensure prediction accuracy and small sample adaptability.

[0137] Technical Implementation:

[0138] Use Mean Squared Error (MSE) as the loss function, which calculates the average squared difference between the predicted traffic volume and the actual traffic volume.

[0139] Use the Adam optimizer to train the model by iteratively updating the parameters to minimize the loss.

[0140] To address the issue of limited data during holidays, introduce data augmentation techniques, such as generating more training samples from limited data through sliding windows, to improve the model's generalization ability.

[0141] In summary, the embodiment includes the following technical solutions:

[0142] 1. Dynamic graph modeling method for holiday traffic.

[0143] Adjust the road network graph structure dynamically through real-time traffic data, consider the traffic transferability and similarity between stations, and establish a prediction framework that better fits the holiday traffic mode, which is more adaptable than traditional static graph methods.

[0144] 2. Multi-scale time feature fusion technology.

[0145] Use parallel processing to extract features of different time scales, combine attention mechanisms to fuse short-term fluctuations and long-term trends, provide comprehensive time characteristic modeling, and significantly improve the accuracy of holiday traffic prediction.

[0146] 3. Optimization strategy in small sample scenarios.

[0147] In the limited data holiday scene, through the joint modeling of dynamic graph and multi-scale features, and data enhancement technology, the adaptability and generalization ability of the model to small sample data are improved.

[0148] 4. Dynamic time warping based graph structure updating algorithm.

[0149] The algorithm calculates the similarity between stations by dynamic time warping (DTW) method, updates the graph structure according to real-time traffic data, and generates station features in graph attention network (GAT), which realizes the accurate capture of holiday traffic dynamic spatial relationship. This method is different from the traditional static graph assumption, which can adaptively reflect the change of traffic mode.

[0150] 5. Multi-scale time fusion attention mechanism framework.

[0151] The framework extracts short-term (1 hour), medium-term (6 hours) and long-term (24 hours) time features through three parallel LSTM branches, and uses attention mechanism to dynamically allocate the weights of each scale feature, and fuse them into a comprehensive time representation. This technology can fully model the complex time characteristics of holiday traffic, which is the key to improving the robustness of prediction.

[0152] Advantages:

[0153] Compared with the prior art, the embodiment has significant advantages in holiday traffic prediction. The prior art uses a static road network structure combined with graph convolution network (GCN) and long short-term memory network (LSTM) for prediction, which performs well in regular traffic scenarios, but its assumption of fixed road network relationship cannot adapt to the dynamic changes formed by concentrated travel or hot routes during holidays, and only focuses on a single time scale, making it difficult to capture the short-term fluctuations and long-term trends of holiday traffic. The embodiment uses a dynamic graph construction module (DGCM) to adjust the graph structure based on real-time traffic data, and uses dynamic time warping (DTW) and graph attention network (GAT) to capture the dynamic spatial relationship between stations, which can more accurately reflect the holiday traffic mode and provide more reliable spatial feature support compared to the static graph method.

[0154] In addition, the embodiment introduces a multi-scale time fusion module (MTFM) to extract features of different time scales (such as 1 hour, 6 hours, and 24 hours) through parallel LSTM branches, and uses attention mechanism to fuse short-term and long-term characteristics, breaking the limitations of single time modeling in the prior art. This method not only improves the modeling ability of complex time patterns of holiday traffic, but also enhances the prediction accuracy in small sample scenarios through data enhancement and joint optimization strategies, thereby significantly improving the resource utilization and real-time management capability of the traffic system.

[0155] Reference Figure 4The embodiment of the application provides a vehicle flow prediction device based on a space-time graph neural network, comprising:

[0156] An image acquisition unit is configured to acquire a traffic road network image, wherein nodes of the traffic road network image represent respective traffic sites, and edges between the nodes represent roads between the respective traffic sites;

[0157] A data acquisition unit is configured to dynamically acquire time series data of the respective traffic sites and perform normalization preprocessing on the time series data, wherein the time series data comprises vehicle flow and vehicle speed of the respective traffic sites;

[0158] An image updating unit is configured to dynamically update the traffic road network image by using the time series data after normalization preprocessing, to obtain a dynamically updated image;

[0159] A spatial feature extraction unit is configured to extract spatial features of the dynamically updated image by using a graph attention network;

[0160] A time feature extraction unit is configured to extract time features of respective scales from the spatial features by using three long short-term memory networks with different time scales;

[0161] A vehicle flow prediction unit is configured to predict vehicle flow of a next time step according to the time features of the three scales.

[0162] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically realize the functions of the above method embodiments, and the device embodiments achieve the same beneficial effects as the above method embodiments.

[0163] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two blocks shown in succession can actually be performed substantially simultaneously or the blocks can sometimes be performed in reverse order. In addition, the embodiments presented and described in the flowcharts of the present application are provided by way of example, and the purpose is to provide a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently performed.

[0164] Furthermore, although the present application is described in the context of functional modules, it is understood that one or more of the functions and / or features described can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary to an understanding of the present application. Rather, the actual implementation is within the routine of an engineer in the art, given the property, function and internal relationships of the various functional modules disclosed herein. Accordingly, the present application is not limited to the specific details of the functional modules described herein. It is also understood that the particular concepts disclosed are illustrative only and not intended to limit the scope of the present application, which is defined in the appended claims and their equivalents.

[0165] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0166] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered a list of executable instructions for implementing logical functions, and can be specifically embodied in any computer-readable medium for use by an instruction execution system, device or apparatus, such as a computer-based system, a system including a processor, or other system that can fetch the instructions from the instruction execution system, device or apparatus and execute the instructions, or in conjunction with these instructions execution system, device or apparatus. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transport programs for use by an instruction execution system, device or apparatus, or in conjunction with these instruction execution system, device or apparatus.

[0167] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0168] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, or combinations thereof, can be used: a discrete logic circuit having logic gates for implementing logic functions upon data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0169] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or more embodiments or examples.

[0170] Although the embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions, and alterations can be made hereto without departing from the principles and spirit of the application, and the scope of the present application is defined by the claims and their equivalents.

[0171] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the described embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A traffic flow prediction method based on a spatiotemporal graph neural network, characterized in that, The traffic flow prediction method includes the following steps: Obtain a traffic network map; wherein, the nodes of the traffic network map represent various traffic stations, and the edges between the nodes represent the roads between the corresponding traffic stations; The system dynamically acquires time-series data for each of the traffic stations and performs normalization preprocessing on the time-series data; wherein, the time-series data includes the traffic flow and vehicle speed corresponding to the traffic station. The traffic network map is dynamically updated using the normalized preprocessed time series data to obtain a dynamically updated map; The spatial features of the dynamically updated graph are extracted using a graph attention network; The spatial features are extracted using three long short-term memory networks with different time scales to extract the temporal features corresponding to the scales. The traffic flow for the next time step is predicted based on the time characteristics described at the three scales.

2. The traffic flow prediction method based on spatiotemporal graph neural network according to claim 1, characterized in that, The process of dynamically updating the traffic network map using the normalized preprocessed time series data to obtain a dynamically updated map includes the following steps: The dynamic time warping method is used to dynamically compare the differences between any two traffic stations over a set period of time based on the normalized preprocessed time series data, in order to find the minimum cumulative distance between any two traffic stations. If the minimum cumulative distance is less than a preset threshold, an edge is added between the two corresponding transportation stations to obtain the dynamically updated graph.

3. The traffic flow prediction method based on spatiotemporal graph neural network according to claim 1, characterized in that, The process of extracting spatial features of the dynamically updated graph using a graph attention network includes the following steps: The graph attention network is used to aggregate the neighbor information of each node according to the attention weights of the neighbor nodes of each node and generate the spatial features of each node.

4. The traffic flow prediction method based on spatiotemporal graph neural network according to claim 3, characterized in that, The traffic flow prediction method further includes the following steps: The attention weights are assigned to the neighboring nodes of each node according to the dynamically updated graph.

5. The traffic flow prediction method based on a spatiotemporal graph neural network according to claim 1, characterized in that, The method of extracting temporal features of corresponding scales from spatial features using three long short-term memory networks with different time scales includes the following steps: The first time features at the first time scale are extracted using the long short-term memory network with short-term branches; The second time-scale features are extracted using the Long Short-Term Memory network in the intermediate branch; The third time feature at the third time scale is extracted using the long short-term memory network with long-term branches; The first time scale, the second time scale, and the third time scale increase sequentially.

6. The traffic flow prediction method based on spatiotemporal graph neural network according to claim 1, characterized in that, The method of predicting the traffic flow for the next time step based on the time features at three scales includes the following steps: Calculate the corresponding scoring weights for the time features at the three scales respectively; The time features of the three scales are weighted and summed according to the scoring weights to obtain the fused features; The fused features are linearly transformed using a fully connected layer to predict and generate the traffic flow for the next time step.

7. The traffic flow prediction method based on a spatiotemporal graph neural network according to claim 6, characterized in that, The calculation of the corresponding scoring weights for the time features at the three scales includes the following steps: Activity level is determined based on the degree of change in traffic flow at the three time scales within the corresponding time scale; The corresponding scoring weight is calculated based on the activity level; wherein, the greater the change in traffic flow, the greater the activity level, and consequently the greater the scoring weight.

8. A traffic flow prediction device based on a spatiotemporal graph neural network, characterized in that, The device includes: The graph acquisition unit is used to acquire a traffic network map; wherein, the nodes of the traffic network map represent various traffic stations, and the edges between the nodes represent the roads between the corresponding traffic stations; A data acquisition unit is used to dynamically acquire time-series data of each of the traffic stations and perform normalization preprocessing on the time-series data; wherein, the time-series data includes traffic flow and vehicle speed corresponding to the traffic station; The graph update unit is used to dynamically update the traffic network map using the normalized preprocessed time series data to obtain a dynamically updated map. A spatial feature extraction unit is used to extract the spatial features of the dynamically updated graph using a graph attention network. The temporal feature extraction unit is used to extract temporal features of the corresponding scale from the spatial features using three long short-term memory networks with different time scales. The traffic flow prediction unit is used to predict the traffic flow for the next time step based on the time characteristics at three scales.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Preparation method and application of acid-resistant brick material

    CN112110714A

  • Traffic flow prediction method based on graph neural network

    CN114495492A