Traffic flow prediction method, system, computer device and storage medium

By fusing the 0-1 graph, the distance graph and the DTW temporal similarity graph, and combining the GCN and 1D-CNN modules, ST-BLOCK is constructed for traffic flow prediction, which solves the problem of insufficient combination of spatial and temporal correlation in the existing technology and improves improve the accuracy and speed of traffic flow prediction.

CN117671960BActive Publication Date: 2024-10-25INNER MONGOLIA UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410043327.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-11
Publication Date
2024-10-25
Estimated Expiration
2044-01-11

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods are deficient in capturing complex nonlinear, spatial and temporal relationships, resulting in insufficient combination of spatial correlation and temporal correlation, resulting in large errors in traffic flow prediction.

Method used

The 0-1 graph, distance graph and DTW-based temporal similarity graph are fused to generate a multi-scale adjacency matrix. The spatial processing module of GCN and the temporal processing module of 1D-CNN are combined to predict traffic flow and extract nodes by constructing ST-BLOCK. spatial information characteristics and time series prediction results.

Benefits of technology

It improves the model's ability to combine spatial and temporal correlations, reduces hardware configuration requirements, and improves the accuracy and speed of traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117671960B_ABST
    Figure CN117671960B_ABST
Patent Text Reader

Abstract

The present invention discloses a traffic flow prediction method, system, computer equipment and storage medium, which relates to the technical field of traffic flow prediction, including the steps of: using traffic flow data to construct a 0-1 graph, a distance graph and a time similarity graph based on DTW of a road network, and fusing the three to obtain a multi-scale adjacency matrix, using a GCN-based spatial processing module to process the multi-scale adjacency matrix, obtaining spatial information features of nodes in the road network, inputting the spatial information features into a 1D-CNN-based time processing module, obtaining the time series prediction results of nodes in the road network, and the spatial processing module and the time processing module form an ST-BLOCK, and the final prediction result is obtained by stacking the time series prediction results of multiple ST-BLOCKs. The present invention is seamlessly integrated into various smart city systems, reduces the number of parameters, improves the speed of traffic flow prediction, can accurately obtain short-term traffic flow prediction results, and is suitable for various traffic flow prediction tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a traffic flow prediction method, system, computer equipment and storage medium. Background Art

[0002] Traffic flow forecasting uses historical traffic data and related features to predict future traffic conditions through techniques such as machine learning and deep learning.

[0003] This technology plays an important role in urban planning and intelligent transportation systems, helping to optimize road conditions, reduce congestion, and improve traffic efficiency and urban sustainability. Due to the rapid development of artificial intelligence technology, short-term traffic flow prediction methods based on deep learning have made new breakthroughs in the field of traffic flow prediction.

[0004] With the development of science and technology, the accuracy of short-term traffic flow prediction technology based on deep learning has been greatly improved. However, the existing methods still have a lot of room for improvement in capturing complex nonlinear, spatial and temporal relationships. The combination of spatial correlation and temporal correlation is obviously insufficient, resulting in large errors in traffic flow prediction. Summary of the invention

[0005] The purpose of the present invention is to provide a traffic flow prediction method, system, computer device and storage medium to address the deficiencies of the above-mentioned prior art, so as to solve the problem that the existing methods in the prior art still have a lot of room for improvement in capturing complex nonlinear, spatial and temporal relationships, and the combination of spatial correlation and temporal correlation is obviously insufficient.

[0006] The present invention specifically provides the following technical solution: a traffic flow prediction method, comprising the following steps:

[0007] Obtain the traffic flow data of the destination, and use the traffic flow data to construct the 0-1 graph, distance graph, and DTW-based time similarity graph of the road network;

[0008] The 0-1 graph, the distance graph and the DTW-based temporal similarity graph are fused to obtain a multi-scale adjacency matrix;

[0009] Processing the multi-scale adjacency matrix using a GCN-based spatial processing module to obtain spatial information features of nodes in the road network;

[0010] The spatial information features are sent to a time processing module based on 1D-CNN to obtain the time series prediction results of the nodes in the road network;

[0011] The ST-BLOCK is constructed by the spatial processing module and the temporal processing module, and the final prediction result of the traffic flow within a certain period of time is obtained by stacking the time series prediction results of multiple ST-BLOCKs.

[0012] Preferably, before using the traffic flow data to construct the 0-1 graph, the distance graph and the DTW-based time similarity graph of the road network, the traffic flow data needs to be preprocessed, including the following steps:

[0013] Preprocessing the traffic flow data including timestamps, node numbers, traffic flow data, average traffic speeds, and road occupancy rates, wherein the preprocessing includes eliminating useless data, filling missing values, and identifying and deleting outliers;

[0014] Among them, useless data refers to non-traffic flow data in traffic data; the majority method is used to fill missing values; when the Z-score method is used to identify and delete outliers, the mean μ and standard deviation σ of the time series of each traffic node are calculated according to Calculate the Z value, where X is the specific data value. .

[0015] Preferably, the method of using traffic flow data to construct a 0-1 graph, a distance graph, and a DTW-based time similarity graph of a road network comprises the following steps:

[0016] Definition 0-1 Figure A nb , the figure A nb The calculation expression of the internal elements is:

[0017]

[0018] Among them, the 0-1 matrix is ​​an adjacency matrix constructed based on topological relationships, which expresses the spatial structure information of the road network by reflecting the connectivity of nodes in the topological structure;

[0019] Define distance map A dis , its internal elements It is derived from the following formula:

[0020]

[0021] Where dist(i,j) represents the distance between node i and node j, θ is the distribution control parameter, and TD is the predefined threshold for controlling the sparsity of the matrix;

[0022] Constructing a DTW-based temporal similarity graph includes the following steps:

[0023] For each traffic network node, the DTW algorithm is used to calculate the DTW distance between each node. The DTW distance can be used to measure the similarity between two time series.

[0024] Use the calculated DTW distance to construct a similarity matrix. Each element of the matrix represents the similarity between two time series. Then perform MIN-MAX normalization on the matrix to normalize the matrix data to the set [0,1].

[0025] Preferably, fusing the 0-1 graph, the distance graph and the DTW-based temporal similarity graph to obtain a multi-scale adjacency matrix comprises the following steps:

[0026] Normalizing the adjacency matrices of the 0-1 graph, the distance graph, and the DTW-based temporal similarity graph;

[0027] The normalized adjacency matrix is ​​added element by element to obtain a new adjacency matrix, that is, a multi-scale adjacency matrix integrating neighbor information, distance information, and time similarity relationship is obtained;

[0028] The multi-scale adjacency matrix is ​​subjected to MIN-MAX normalization to normalize the matrix data to the set [0, 1].

[0029] Preferably, the processing of the multi-scale adjacency matrix using a GCN-based spatial processing module comprises the following steps:

[0030] The spatial processing module of the GCN is constructed through a graph convolution layer, an output layer, and a Relu activation function;

[0031] The multi-scale adjacency matrix is ​​processed by the spatial processing module of GCN, and the result obtained is the feature expression of the node in the multi-scale graph structure;

[0032] The feature expression is input into a single-layer fully connected layer using the Relu activation function, and nonlinear transformation is introduced to capture and process the spatial information of nodes in the road network.

[0033] Preferably, the spatial information features are fed into a time processing module based on 1D-CNN to obtain a time series prediction result of nodes in the road network, comprising the following steps:

[0034] The time processing module is constructed through 1D-CNN layer, pooling layer, and output layer;

[0035] Inputting the features into a 1D-CNN layer, the 1D-CNN layer captures local patterns and temporal relationships in the feature sequence;

[0036] The feature sequence output by the 1D-CNN layer is input into the flat pooling layer, and the average value is calculated from each window of the input sequence as the pooled value, thereby extracting smoother features;

[0037] The intermediate features output by the flat pooling layer are mapped to the prediction results of the module through the output layer.

[0038] Preferably, the final prediction result of the traffic flow within a certain period of time is obtained by stacking the time series prediction results of multiple ST-BLOCKs, including the steps of:

[0039] The final prediction result is output by performing a residual connection between the input and output of each ST-BLOCK and adjusting the number of ST-BLOCKs based on the task and dataset.

[0040] Preferably, a threshold k is set for the task and the data set, and all Z values ​​greater than k are identified. These data points are identified as outliers, deleted, and the majority method is used to fill the gaps.

[0041] Preferably, the present invention further provides a traffic flow prediction system, comprising:

[0042] The road network image construction module is used to obtain the traffic flow data of the target location and use the traffic flow data to construct the 0-1 graph, distance graph and DTW-based time similarity graph of the road network;

[0043] A multi-scale adjacency matrix acquisition module, used for fusing the 0-1 graph, the distance graph and the DTW-based temporal similarity graph to obtain a multi-scale adjacency matrix;

[0044] A spatial information acquisition module, used to process the multi-scale adjacency matrix using a GCN-based spatial processing module to obtain spatial information features of nodes in the road network;

[0045] A preliminary prediction module is used to send the spatial information features to a time processing module based on 1D-CNN to obtain a time series prediction result of nodes in the road network;

[0046] The final prediction module is used to construct the ST-BLOCK through the spatial processing module and the temporal processing module, and obtain the final prediction result of the traffic flow within a certain period of time by stacking the time series prediction results of multiple ST-BLOCKs.

[0047] Preferably, the present invention further provides a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the traffic flow prediction method.

[0048] Preferably, the present invention further provides a storage medium, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, it is used to implement the traffic flow prediction method.

[0049] Compared with the prior art, the present invention has the following significant advantages:

[0050] The present invention represents different aspects of spatiotemporal information of a traffic network through a 0-1 graph, a distance graph and a DTW-based temporal similarity graph. The three graphs are fused to obtain an adjacency matrix with multiple spatiotemporal scales, which can improve the model's ability to simultaneously combine spatial and temporal correlations. A GCN-based spatial processing module is used to extract the spatial correlation between nodes; a 1D-CNN-based temporal processing module is used to extract the temporal correlation between nodes. The spatial processing module and the temporal processing module together form an ST-BLOCK. By stacking multiple ST-BLOCKs, the number of parameters is reduced, the demand for hardware configuration is reduced, and the speed of traffic flow prediction is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of the process of the present invention;

[0052] Figure 2 It is a schematic diagram of ST-BLOCK of the present invention;

[0053] Figure 3 is a schematic diagram of a spatial processing module of the present invention;

[0054] Figure 4 It is a schematic diagram of the time processing module of the present invention. DETAILED DESCRIPTION

[0055] The following is a clear and complete description of the technical solutions of the embodiments of the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0056] The present invention discloses a traffic flow prediction method and system. A 0-1 graph, a distance graph, and a DTW-based temporal similarity graph are used to represent different aspects of spatiotemporal information; a spatial processing module based on GCN is used to extract the spatial correlation between nodes; a temporal processing module based on 1D-CNN is used to extract the temporal correlation between nodes, and the spatial processing module and the temporal processing module together form an ST-BLOCK, and the final prediction result is obtained by stacking multiple ST-BLOCKs.

[0057] The present invention uses a 0-1 graph, a distance graph and a DTW-based temporal similarity graph to represent different aspects of the spatiotemporal information of a traffic network. The three graphs are fused to obtain an adjacency matrix with multiple spatiotemporal scales. The result is input into an ST-BLOCK composed of a spatial processing module and a temporal processing module, and the final result is obtained by stacking multiple ST-BLOCKs.

[0058] The present invention can be seamlessly integrated into various smart city systems, reduces the number of parameters, lowers the demand for hardware configuration, improves the speed of traffic flow prediction, and can obtain short-term traffic flow prediction results more accurately, which is suitable for various traffic flow prediction tasks.

[0059] The present invention mainly includes five links: data preprocessing, multi-image generation and fusion, spatial information processing module and temporal information processing module. Figure 1 For ease of understanding and explanation, the present invention provides a traffic flow prediction method, comprising the following steps:

[0060] Step S1: Obtain the traffic flow data of the target location, and use the traffic flow data to construct a 0-1 graph, a distance graph, and a DTW-based time similarity graph of the road network.

[0061] The original traffic flow data is preprocessed, the majority method is used to fill missing values, and the Z-score method is used to identify and delete outliers; the original traffic flow data contains timestamps, node numbers, traffic flow data, average traffic speed, and road occupancy rate. For example, the data set PEMS04 is a 16992×307×3 tensor, 16992 means that the data set is collected from the California road network for 59 days, and the data is collected every 5 minutes (16992=59 days×24 hours×12), 307 means that there are 307 monitoring nodes in the road network, and 3 represents traffic data, which are traffic flow, average speed, and road occupancy rate. Each node has a time series traffic data consisting of 16992 data.

[0062] For example, in the present invention, only traffic flow data is used, so the average speed and road occupancy rate data are deleted during preprocessing; because the original traffic flow data may be incomplete, lacking information on certain time periods, locations or modes of transportation, the analysis results become inaccurate or incomplete; there are also outliers caused by measurement errors, so the data needs to be preprocessed. First, the mode method is used to fill in the missing values, check the missing values ​​in the data set, and determine which columns have missing data. For each column that needs to fill in missing values, calculate the mode of the column, that is, the value with the most occurrences, and select one from the calculated mode as the value to fill in the missing values. Then use the Z-score method to identify and delete outliers, calculate the mean μ and standard deviation σ of the time series for each traffic node, and calculate the value according to Calculate the Z value (X is the specific data value), set a threshold k for the specific task and data set, identify all Z values ​​greater than k, these data points are identified as outliers, deleted and the majority method is used to fill the gaps.

[0063] Step S11: Before using the traffic flow data to construct the 0-1 graph, distance graph, and DTW-based time similarity graph of the road network, the traffic flow data needs to be preprocessed, including the following steps:

[0064] Step S111: pre-processing the traffic flow data including timestamp, node number, traffic flow data, average traffic speed and road occupancy rate, wherein the pre-processing includes eliminating useless data, filling missing values, and identifying and deleting outliers.

[0065] Among them, useless data refers to non-traffic flow data in traffic data; the majority method is used to fill missing values; and the Z-score method is used to identify and delete outliers.

[0066] Step S112: wherein the Z-score method is used to identify and delete outliers, including the following steps:

[0067] Calculate the mean μ and standard deviation σ of each traffic node time series; according to Calculate the Z value; where X is the specific data value.

[0068] In this step, the 0-1 graph of the road network is constructed as follows:

[0069] Step S12: Define 0-1 graph A nb , Figure A nb The calculation expression of the internal elements is:

[0070]

[0071] Among them, the 0-1 graph is an adjacency matrix constructed based on topological relationships, which expresses the spatial structure information of the road network by reflecting the connectivity of nodes in the topological structure.

[0072] The distance map is constructed as:

[0073] Step S13: Define distance map A dis , its internal elements It is derived from the following formula:

[0074]

[0075] Where dist(i,j) represents the distance between node i and node j, θ is the distribution control parameter, and TD is the predefined threshold for controlling the sparsity of the matrix. The selection of distribution control parameters and sparsity thresholds requires experimentation and adjustment on specific tasks and datasets, and different parameter combinations need to be tried to find the best performance.

[0076] Define the time similarity graph A calculated by the DTW time dynamic programming algorithm time For each traffic network node, the DTW algorithm is used to calculate the DTW distance between the node time series data. The calculated DTW distance is used to construct a similarity matrix, the adjacency matrix A timeEach element of represents the similarity between two time series, and then the matrix is ​​normalized by MIN-MAX to normalize the matrix data to the set [0,1].

[0077] DTW distance can measure the similarity between two time series and overcome the problem of misaligned time axes.

[0078] For the obtained adjacency matrix A nb , A dis , A time Add element by element A F , for the adjacent matrix A F Use the MIN-MAX method to normalize the matrix data to [0, 1]. The normalized matrix A final That is the multi-graph fusion adjacency matrix.

[0079] Step S13: constructing a DTW-based temporal similarity graph, including the following steps:

[0080] Step S131: For each traffic network node, the DTW algorithm is used to calculate the DTW distance between each node. The DTW distance can be used to measure the similarity between two time series.

[0081] Step S132: Use the calculated DTW distance to construct a similarity matrix, where each element of the matrix represents the similarity between two time series, and then perform MIN-MAX normalization on the matrix to normalize the matrix data to the set [0,1].

[0082] Step S2: The 0-1 graph, the distance graph, and the DTW-based temporal similarity graph are fused to obtain a multi-scale adjacency matrix.

[0083] This step specifically includes the following steps:

[0084] Step S21: normalizing the adjacency matrices of the 0-1 graph, the distance graph, and the DTW-based temporal similarity graph.

[0085] Step S22: Add the normalized adjacency matrix element by element to obtain a new adjacency matrix, that is, obtain a multi-scale adjacency matrix that integrates neighbor information, distance information, and time similarity relationship.

[0086] Step S23: Perform MIN-MAX normalization on the multi-scale adjacency matrix to normalize the matrix data to the set [0,1].

[0087] Step S3: Use the GCN-based spatial processing module to process the multi-scale adjacency matrix to obtain the spatial information features of the nodes in the road network.

[0088] This step specifically includes the following steps:

[0089] Step S31: Construct the spatial processing module of GCN through graph convolution layer, output layer, and Relu activation function.

[0090] Step S32: Process the multi-scale adjacency matrix through the spatial processing module of GCN, and obtain the result as the feature expression of the node in the multi-scale graph structure.

[0091] Step S33: Input the feature expression into a single-layer fully connected layer using the Relu activation function, and introduce nonlinear transformation to capture spatial information.

[0092] The detailed description of this step is as follows: The multi-scale adjacency matrix obtained by fusion is processed using the GCN-based spatial processing module. The spatial information processing module consists of a graph convolution layer, an output layer, and a Relu activation function. final Enter the graph convolution layer, use spectral domain graph convolution to aggregate and extract spatial information, and then input the result into a single-layer fully connected layer using the Relu activation function to obtain the output of the spatial processing module.

[0093] First, the fused adjacency matrix is ​​provided as input to the spatial processing module. The input adjacency matrix passes through the graph convolution layer. In the graph convolution layer, the spectral domain graph convolution is used to aggregate and extract the spatial information of the road network. The goal of this step is to capture the topological structure of the road network and the relationship between nodes and neighboring nodes by considering the connection relationship between nodes. The spectral domain graph convolution in the graph convolution layer operates on the adjacency matrix. It uses the eigendecomposition of the Laplacian matrix of the adjacency matrix to convert the convolution operation of the graph into a filtering operation in the spectral domain to extract spatial information. The result of the spectral domain graph convolution operation is used as the input for the next step. These features capture the spatial information of the nodes in the road network. The output features of the spectral domain graph convolution layer are input to a single-layer fully connected layer. The fully connected layer is responsible for introducing linear transformations. After the linear transformation of the fully connected layer, the activation function is applied to the output. Relu (Rectified Linear Unit) is a commonly used nonlinear activation function that sets negative values ​​to zero and retains positive values. After the Relu activation function, the output of the spatial processing module is obtained. This output is a set of feature vectors that represent the spatial information expression after convolution transformation on the graph structure.

[0094] Step S4: Send the spatial information features to the time processing module based on 1D-CNN to obtain the time series prediction results of the nodes in the road network.

[0095] This step specifically includes the following steps:

[0096] Step S41: A time processing module is constructed through a 1D-CNN layer, a pooling layer, and an output layer.

[0097] Step S42: Input the features into the 1D-CNN layer, and capture the local patterns and temporal relationships in the feature sequence through the 1D-CNN layer.

[0098] Step S43: The feature sequence output by the 1D-CNN layer is input into the flat pooling layer, and the average value is calculated from each window of the input sequence as the pooled value, so as to extract smoother features.

[0099] Step S44: Map the intermediate features output by the flat pooling layer to the prediction results of the module through the output layer.

[0100] The detailed description of this step is as follows:

[0101] The features processed by the spatial processing module are extracted and sent to the time series prediction module based on 1D-CNN for prediction to obtain the final traffic flow prediction results. The time series prediction module consists of a 1D-CNN layer, a pooling layer, and an output layer. The pooling layer is Average-Pooling. Average pooling calculates the average value from each window of the input sequence as the pooled value to extract a smoother feature. The output layer is a single-layer fully connected layer that does not use an activation function.

[0102] The spatially processed feature sequence is extracted from the output of the spatial processing module. The feature representation of each time step captures the processed spatial information of the road network. The feature sequence is input to the 1D-CNN (one-dimensional convolutional neural network) layer. The 1D-CNN layer can capture local patterns and temporal relationships in the feature sequence. The convolution operation performs a sliding window operation on the feature sequence to extract features in different time windows. After the 1D-CNN layer, the output feature sequence is input to the average pooling layer. Average pooling is a pooling operation that calculates the average value from each window of the input sequence as the pooled value. This helps to extract smoother features and reduce noise and redundant information. The output feature sequence of the average pooling layer will be used as the input for the next step. These features contain more advanced temporal features after 1D-CNN and average pooling operations. The output feature sequence of the pooling layer is input to a single-layer fully connected layer. The fully connected layer linearly transforms and combines the features to generate prediction results. The output layer is the last layer of the fully connected layer and is a single-layer fully connected layer without an activation function.

[0103] The time series prediction module based on 1D-CNN takes the spatially processed feature sequence as input and generates the traffic flow prediction result under the current module through operations such as convolution, average pooling and linear transformation.

[0104] like Figure 2 As shown, in this step, the final prediction result of traffic flow within a certain period of time is obtained by stacking multiple ST-BLOCK operations, including the following steps:

[0105] Step S5: construct an ST-BLOCK through the spatial processing module and the temporal processing module, and obtain the final prediction result of the traffic flow within a certain period of time by stacking the time series prediction results of multiple ST-BLOCKs.

[0106] The detailed description of this step is as follows: by stacking multiple ST-BLOCKs (such as Figure 2 ) to achieve the best prediction performance. The input and output of each ST-BLOCK are residually connected. The number of ST-BLOCKs needs to be experimented and adjusted on specific tasks and datasets. Different parameter combinations need to be tried to find the best performance, which is generally 3.

[0107] A threshold k is set for the task and dataset, and all Z values ​​greater than k are identified. These data points are identified as outliers, deleted, and the majority method is used to fill in the gaps.

[0108] A certain time in the final prediction result of short-term traffic flow, that is, short-term means that the prediction time is less than 30 minutes, and the final prediction result represents the traffic flow data of each node on the graph within the next 30 minutes.

[0109] Based on the above methods and statements, the present invention also provides a traffic flow prediction system, including: a road network image construction module, a multi-scale adjacency matrix acquisition module, a spatial information acquisition module, a preliminary prediction module and a final prediction module.

[0110] Among them, the road network image construction module is used to obtain the traffic flow data of the target location, and use the traffic flow data to construct the 0-1 map, distance map and DTW-based temporal similarity map of the road network; the multi-scale adjacency matrix acquisition module is used to fuse the 0-1 map, distance map and DTW-based temporal similarity map to obtain a multi-scale adjacency matrix; the spatial information acquisition module is used to process the multi-scale adjacency matrix using the GCN-based spatial processing module to capture and process the spatial information of the nodes in the road network; the preliminary prediction module is used to extract the features of the spatial information processed by the spatial processing module, and send the features to the 1D-CNN-based temporal processing module to obtain the time series prediction results of the nodes; the final prediction module is used to construct an ST-BLOCK through the spatial processing module and the temporal processing module, and obtain the final prediction result of the traffic flow within a certain time by stacking the time series prediction results of multiple ST-BLOCKs.

[0111] The present invention also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the traffic flow prediction method.

[0112] The present invention also provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the traffic flow prediction method.

[0113] The above content is a further detailed description of the present invention in combination with a specific preferred embodiment. For technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.

Claims

1. A traffic flow prediction method, It is characterized in that The following steps are involved: Obtain the traffic flow data of the destination, and use the traffic flow data to construct the 0-1 graph, distance graph, and DTW-based time similarity graph of the road network; The 0-1 graph, the distance graph and the DTW-based temporal similarity graph are fused to obtain a multi-scale adjacency matrix; Processing the multi-scale adjacency matrix using a GCN-based spatial processing module to obtain spatial information features of nodes in the road network; The spatial information features are sent to a time processing module based on 1D-CNN to obtain the time series prediction results of the nodes in the road network; Constructing ST-BLOCK through the spatial processing module and the temporal processing module, and obtaining the final prediction result of the traffic flow within a certain period of time by stacking the time series prediction results of multiple ST-BLOCKs; The method of using traffic flow data to construct a 0-1 graph, a distance graph, and a DTW-based time similarity graph of a road network includes the following steps: Definition 0-1 Figure A nb , the figure A nb The calculation expression of the internal elements is: Among them, the 0-1 graph is an adjacency matrix constructed based on topological relationships, which expresses the spatial structure information of the road network by reflecting the connectivity of nodes in the topological structure; Define distance map A dis , its internal elements It is derived from the following formula: Where dist(i,j) represents the distance between node i and node j, θ is the distribution control parameter, and TD is the predefined threshold for controlling the sparsity of the matrix; Constructing a DTW-based temporal similarity graph includes the following steps: For each traffic network node, the DTW algorithm is used to calculate the DTW distance between each node. The DTW distance can be used to measure the similarity between two time series. Use the calculated DTW distance to construct a similarity matrix. Each element of the matrix represents the similarity between two time series. Then perform MIN-MAX normalization on the matrix to normalize the matrix data to the set [0,1].

2. A traffic flow prediction method as claimed in claim 1, It is characterized in that Before using the traffic flow data to construct the 0-1 graph, distance graph, and DTW-based time similarity graph of the road network, the traffic flow data needs to be preprocessed, including the following steps: Preprocessing the traffic flow data including timestamps, node numbers, traffic flow data, average traffic speeds, and road occupancy rates, wherein the preprocessing includes eliminating useless data, filling missing values, and identifying and deleting outliers; Among them, useless data refers to non-traffic flow data in traffic data; the majority method is used to fill missing values; when the Z-score method is used to identify and delete outliers, the mean of the time series of each traffic node is calculated μ With standard deviation σ, according to Calculate the Z value, where X is the specific data value.

3. A traffic flow prediction method as claimed in claim 1, It is characterized in that The 0-1 graph, the distance graph and the DTW-based temporal similarity graph are fused to obtain a multi-scale adjacency matrix, including the following steps: Normalizing the adjacency matrices of the 0-1 graph, the distance graph, and the DTW-based temporal similarity graph; The normalized adjacency matrix is ​​added element by element to obtain a new adjacency matrix, that is, a multi-scale adjacency matrix integrating neighbor information, distance information, and time similarity relationship is obtained; The multi-scale adjacency matrix is ​​subjected to MIN-MAX normalization to normalize the matrix data to the set [0, 1].

4. A traffic flow prediction method as claimed in claim 1, It is characterized in that The method of processing the multi-scale adjacency matrix using a GCN-based spatial processing module comprises the following steps: The spatial processing module of the GCN is constructed through a graph convolution layer, an output layer, and a Relu activation function; The multi-scale adjacency matrix is ​​processed by the spatial processing module of GCN, and the result obtained is the feature expression of the node in the multi-scale graph structure; The feature expression is input into a single-layer fully connected layer using the Relu activation function, and nonlinear transformation is introduced to capture and process the spatial information of nodes in the road network.

5. A traffic flow prediction method as claimed in claim 1, It is characterized in that The spatial information features are sent to the time processing module based on 1D-CNN to obtain the time series prediction results of the nodes in the road network, including the following steps: The time processing module is constructed through 1D-CNN layer, pooling layer, and output layer; Inputting the features into a 1D-CNN layer, the 1D-CNN layer captures local patterns and temporal relationships in the feature sequence; The feature sequence output by the 1D-CNN layer is input into the flat pooling layer, and the average value is calculated from each window of the input sequence as the pooled value, thereby extracting smoother features; The intermediate features output by the flat pooling layer are mapped to the prediction results of the module through the output layer.

6. A traffic flow prediction method as claimed in claim 1, It is characterized in that By stacking the time series prediction results of multiple ST-BLOCKs, the final prediction result of the traffic flow within a certain period of time is obtained, including the steps of: The final prediction result is output by performing a residual connection between the input and output of each ST-BLOCK and adjusting the number of ST-BLOCKs based on the task and dataset. A threshold k is set for the task and dataset, and all Z values ​​greater than k are identified. These data points are identified as outliers, deleted, and the majority method is used to fill in the gaps.

7. A traffic flow prediction system, It is characterized in that include: The road network image construction module is used to obtain the traffic flow data of the target location and use the traffic flow data to construct the 0-1 graph, distance graph and DTW-based time similarity graph of the road network; A multi-scale adjacency matrix acquisition module, used for fusing the 0-1 graph, the distance graph and the DTW-based temporal similarity graph to obtain a multi-scale adjacency matrix; A spatial information acquisition module, used to process the multi-scale adjacency matrix using a GCN-based spatial processing module to obtain spatial information features of nodes in the road network; A preliminary prediction module is used to send the spatial information features to a time processing module based on 1D-CNN to obtain a time series prediction result of nodes in the road network; A final prediction module, used to construct an ST-BLOCK through the spatial processing module and the temporal processing module, and obtain the final prediction result of the traffic flow within a certain period of time by stacking the time series prediction results of multiple ST-BLOCKs; The method of using traffic flow data to construct a 0-1 graph, a distance graph, and a DTW-based time similarity graph of a road network includes the following steps: Definition 0-1 Figure A nb , the figure A nb The calculation expression of the internal elements is: Among them, the 0-1 graph is an adjacency matrix constructed based on topological relationships, which expresses the spatial structure information of the road network by reflecting the connectivity of nodes in the topological structure; Define distance map A dis , its internal elements It is derived from the following formula: Where dist(i,j) represents the distance between node i and node j, θ is the distribution control parameter, and TD is the predefined threshold for controlling the sparsity of the matrix; Constructing a DTW-based temporal similarity graph includes the following steps: For each traffic network node, the DTW algorithm is used to calculate the DTW distance between each node. The DTW distance can be used to measure the similarity between two time series. Use the calculated DTW distance to construct a similarity matrix. Each element of the matrix represents the similarity between two time series. Then perform MIN-MAX normalization on the matrix to normalize the matrix data to the set [0,1].

8. A computer device, It is characterized in that The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the traffic flow prediction method according to any one of claims 1 to 6.

9. A storage medium, It is characterized in that The storage medium stores a computer program, which is used to implement the traffic flow prediction method according to any one of claims 1 to 6 when executed by a processor.

Citation Information

Patent Citations

  • Moving target detection method and device, flight equipment and storage medium

    CN115937259A

  • Space-time Transform traffic flow prediction method based on dynamic correlation

    CN116543554A

  • Multi-view fusion space-time dynamic graph convolutional network urban traffic flow prediction method

    CN116935649A

  • Saturation flow estimation for signalized intersections using vehicle trajectory data

    WO2020248197A1

  • Method for estimating and predicting short-term traffic circulation state of urban road network

    WO2021109318A1