Traffic Flow Prediction Method and System Based on Spatio-Temporal Graph Convolutional Neural Network

By building a traffic flow prediction system based on spatiotemporal graph convolutional neural network, using graph self-learning and time attention mechanisms, the shortcomings of price factors in traffic flow prediction in the existing technology are solved, and higher precision traffic flow prediction is achieved, and the implementation of differentiated charging schemes is supported.

CN116486624BActive Publication Date: 2025-07-29SHANDONG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310474667.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2025-07-29
Estimated Expiration
2043-04-24

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively predict the distribution of highway traffic flows based on price factors, and the lack of suitable databases and models leads to insufficient accuracy of differentiated charging solutions.

Method used

Using a method based on spatiotemporal graph convolution neural network, an optimal graph adjacency matrix is constructed through a graph self-learning module, and a spatiotemporal graph convolution neural network model combined with a temporal attention mechanism to predict traffic flow.

Benefits of technology

It improves the accuracy of traffic flow prediction, can effectively model the relationship between price and traffic flow distribution, and provides data support for differentiated charging solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116486624B_ABST
    Figure CN116486624B_ABST
Patent Text Reader

Abstract

The present invention provides a traffic flow prediction method and system based on a spatio-temporal graph convolutional neural network, including: obtaining relevant information of a highway and performing corresponding preprocessing; wherein, the relevant information includes road toll information, road attribute information, and road traffic information; based on the road toll information and road attribute information, using a pre-constructed graph self-learning module to encode the road toll information into a graph adjacency matrix and obtaining an optimal graph adjacency matrix; based on the road toll information and road traffic information as node information, and in combination with the optimal graph adjacency matrix, using a pre-trained spatio-temporal graph convolutional neural network model based on a time attention mechanism to obtain a traffic flow prediction result of the highway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of traffic engineering, and in particular, relates to a traffic flow prediction method and system based on a spatio-temporal graph convolutional neural network. Background Technique

[0002] The statements in this part only provide background technical information related to the present invention and do not necessarily constitute prior art.

[0003] Currently, due to the increasingly serious problem of traffic congestion caused by the uneven distribution of traffic flow on the road network, building new roads requires a large amount of investment, and at the same time, new traffic demands may also be generated. Relatively speaking, charging different road tolls at different times, in different directions, and on different road sections to guide the spatio-temporal redistribution of traffic flow and traffic density on the road network, relieve the traffic pressure on congested sections, and balance the traffic flow distribution on the road network is a relatively inexpensive solution. This method is called dynamic congestion pricing by scholars. It affects user behavior through the price lever, pushing the system from user equilibrium (that is, people act selfishly when choosing routes and try to maximize their own interests) to a more efficient system optimum (that is, some network users need to act in a non-selfish way and choose alternative routes that may lead to, for example, longer travel times).

[0004] The pricing derivation of the highway differential toll plan requires predicting the distribution status of traffic flow on the road network in the future for a period of time and understanding the influence law of price changes on the traffic flow distribution on the road network. In the past, when scholars studied the differential toll problem, they mostly used knowledge-driven methods, such as Wardrop's first and second principles and queuing theory to predict the traffic flow on the road network. A small number of scholars used data-driven time series methods to predict the road traffic flow. Similarly, when analyzing the influence of price changes on the traffic flow distribution on the road network, more knowledge-driven methods were also applied, such as using normative theories such as expected utility theory or random utility theory, or using descriptive theories such as prospect theory to predict the travel behavior of road users, and then predicting what kind of state the traffic flow distribution on the road network should be after price changes.

[0005] In recent years, artificial intelligence technology has developed rapidly. In particular, graph neural network technology (a detailed introduction to spatio-temporal graph neural networks, based on graph-based spatio-temporal neural networks) has made significant progress in recent years. A series of more accurate traffic flow prediction methods based on graph neural networks have been proposed, but they have not been applied to solve the problem of differential tolls. More critically, although graph neural networks can model the relationship between various data and the traffic flow distribution of road networks, a large number of scholars have done a lot of work in this direction to improve the accuracy of traffic flow prediction using graph neural networks. They have modeled the relationship between weather conditions, the distribution of surrounding points of interest (POI), traffic accidents, and other factors and the traffic flow distribution. However, few scholars have paid attention to the key factor of price, which can affect the traffic flow distribution state on the road network by influencing the travel behavior of road users.

[0006] At the same time, the lack of a suitable database is a key problem for the late application of graph neural network technology to the problem of differential tolls. There are a large number of datasets available on the Internet for road traffic flow prediction, but some of these datasets are from regions where there is no road network toll policy, and others are difficult to obtain road network toll information for the corresponding regions. In short, they all have a common defect, which is that they cannot provide both the toll situation of the road network and the traffic flow distribution on the road network. Summary of the Invention

[0007] To solve the above problems, the present invention provides a traffic flow prediction method and system based on a spatio-temporal graph convolutional neural network. When performing traffic flow prediction, the proposed solution introduces price factors based on a pre-constructed graph self-learning model to obtain an optimal graph adjacency matrix from both macro and micro perspectives. At the same time, a spatio-temporal graph convolutional neural network model based on a time attention mechanism is used to predict traffic flow, effectively improving the prediction accuracy of traffic flow.

[0008] According to the first aspect of the embodiments of the present invention, a traffic flow prediction method based on a spatio-temporal graph convolutional neural network is provided, including:

[0009] Obtain relevant information of the highway and perform corresponding preprocessing; wherein, the relevant information includes road toll information, road attribute information, and road traffic information;

[0010] Based on the road toll information and road attribute information, use a pre-constructed graph self-learning module to encode the road toll information into the graph adjacency matrix and obtain an optimal graph adjacency matrix; wherein, the graph self-learning module includes a macro graph adjacency matrix acquisition unit for integrating the node distance graph adjacency matrix, the node actual connection graph adjacency matrix, and the road toll graph adjacency matrix, and a micro graph adjacency matrix acquisition unit for capturing short-term fluctuations between nodes based on several convolutional operations.

[0011] Based on the road toll information and road traffic information as node information, and in combination with the optimal graph adjacency matrix, a traffic flow prediction result of the highway is obtained by using a pre-trained spatio-temporal graph convolutional neural network model based on a time attention mechanism.

[0012] Further, the obtaining of the macroscopic graph adjacency matrix is specifically as follows: Based on the distance between traffic flow detector nodes, the connection relationship between traffic flow detector nodes, and the road toll information, a node distance graph adjacency matrix, a node actual connection graph adjacency matrix, and a road toll graph adjacency matrix are respectively constructed; the initial graph adjacency matrix is obtained by integrating each graph adjacency matrix based on a pre-designed calculation method; the spatial relationship between nodes is mined based on graph self-learning to generate a new graph adjacency matrix, and the initial graph adjacency matrix is fused with the new graph adjacency matrix, and after sparse processing, the macroscopic graph adjacency matrix is obtained.

[0013] Further, the integration of each graph adjacency matrix is specifically carried out using the following formula:

[0014]

[0015]

[0016] Among them, A k represents the graph adjacency matrix reflecting the k-th relationship, I N represents the identity matrix, and Γ is the index function.

[0017] Further, the obtaining of the microscopic graph adjacency matrix is specifically carried out using the following formula:

[0018]

[0019] Among them, ω2, ω3, ω4 are learnable convolution kernel parameters, ReLU is the activation function, is the preset node attribute information, is the information related to the temporary factor in the node.

[0020] Further, the obtaining of the optimal graph adjacency matrix is specifically as follows: Based on the ReLU activation function and the normalization method, the obtained macroscopic graph adjacency matrix and microscopic graph adjacency matrix are fused to obtain the optimal graph adjacency matrix.

[0021] Further, the spatio-temporal graph convolutional neural network model based on the time attention mechanism specifically includes the following processing procedures: adaptively assign different importance weights at different times to the input data through the time attention mechanism; input the data with assigned weights into the spatio-temporal convolutional neural network, and after extracting features in the spatial and temporal dimensions, obtain the final traffic flow prediction result.

[0022] Further, the road attribute features include the distance between traffic flow detector nodes, road width, and the number of ramps; the road traffic characteristic information includes traffic flow, vehicle speed, and occupancy rate.

[0023] According to the second aspect of the embodiments of the present invention, a traffic flow prediction system based on a spatio-temporal graph convolutional neural network is provided, including:

[0024] A data acquisition unit, which is used to acquire relevant information of the highway and perform corresponding preprocessing; wherein, the relevant information includes road toll information, road attribute information, and road traffic information;

[0025] A graph adjacency matrix acquisition unit, which is used to encode the road toll information into the graph adjacency matrix based on the road toll information and road attribute information by using a pre-constructed graph self-learning module, and obtain the optimal graph adjacency matrix; wherein, the graph self-learning module includes a macro graph adjacency matrix acquisition unit for integrating the node distance graph adjacency matrix, the node actual connection graph adjacency matrix, and the road toll graph adjacency matrix, and a micro graph adjacency matrix acquisition unit for capturing short-term fluctuations between nodes based on several convolutional operations;

[0026] A traffic flow prediction unit, which is used to obtain the traffic flow prediction result of the highway based on the road toll information and road traffic information as node information, and in combination with the optimal graph adjacency matrix, by using a pre-trained spatio-temporal graph convolutional neural network model based on the time attention mechanism.

[0027] According to the third aspect of the embodiments of the present invention, an electronic device is provided, including a memory, a processor, and a computer program running on the memory, and when the processor executes the program, it implements the traffic flow prediction method based on a spatio-temporal graph convolutional neural network as described above.

[0028] According to the fourth aspect of the embodiments of the present invention, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, it implements the traffic flow prediction method based on a spatio-temporal graph convolutional neural network as described above.

[0029] The above one or more technical solutions have the following beneficial effects:

[0030] (1) The present invention provides a traffic flow prediction method and system based on a spatio-temporal graph convolutional neural network. When performing traffic flow prediction, the proposed solution introduces price factors based on a pre-constructed graph self-learning model to obtain an optimal graph adjacency matrix from both macroscopic and microscopic perspectives. Meanwhile, a spatio-temporal graph convolutional neural network model based on a time attention mechanism is used to predict traffic flow, effectively improving the prediction accuracy of traffic flow.

[0031] (2) The present invention models the relationship between price and road traffic flow distribution, providing technical support for the derivation of a differential toll pricing scheme using a data-driven method.

[0032] (3) The proposed solution of the present invention presents a database construction method suitable for solving the differential toll problem and validates the quality of the constructed database using multiple models, effectively solving the problem that existing data sets cannot provide both price information and road traffic information simultaneously, providing data support for the proposed solution of the present invention.

[0033] Advantages of additional aspects of the present invention will be partially given in the following description, partially become apparent from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The specification drawings forming a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0035] Figure 1 It is a schematic diagram of the road geographical location and the distribution of detectors at intersections in the specific experiment described in the embodiments of the present invention;

[0036] Figure 2 It is the toll information of roads and the distribution positions of toll stations in the selected area in the specific experiment described in the embodiments of the present invention;

[0037] Figure 3 It is a schematic diagram of the structure of a spatio-temporal graph convolutional neural network model with graph self-learning and attention mechanism described in the embodiments of the present invention;

[0038] Figures 4(a) to 4(c) It is a line graph showing the change of traffic flow prediction performance of multiple models with the increase of the prediction interval in the embodiments of the present invention;

[0039] Figures 5(a) to 5(b) It is a schematic diagram of the traffic flow prediction performance analysis of multiple models under different conditions in the embodiments of the present invention;

[0040] Figures 6(a) to 6(b)Schematic diagram of traffic flow prediction curves of multiple models described in the embodiments of the present invention at different nodes and different time periods;

[0041] Figure 7 Schematic diagram for constructing the predefined graph adjacency matrix described in the embodiments of the present invention. Detailed implementation manners

[0042] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.

[0043] It should be noted that the terms used herein are only for describing the specific implementation manners and are not intended to limit the exemplary embodiments according to the present invention.

[0044] Without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0045] Embodiment 1:

[0046] The purpose of this embodiment is to provide a traffic flow prediction method based on a spatio-temporal graph convolutional neural network.

[0047] A traffic flow prediction method based on a spatio-temporal graph convolutional neural network includes:

[0048] Obtain relevant information of the highway and perform corresponding preprocessing; wherein, the relevant information includes road toll information, road attribute information, and road traffic information;

[0049] Based on the road toll information and road attribute information, use the pre-constructed graph self-learning module to encode the road toll information into the graph adjacency matrix and obtain the optimal graph adjacency matrix; wherein, the graph self-learning module includes a macro graph adjacency matrix acquisition unit for integrating the node distance graph adjacency matrix, the node actual connection graph adjacency matrix, and the road toll graph adjacency matrix, and a micro graph adjacency matrix acquisition unit for capturing short-term fluctuations between nodes based on several convolutional operations;

[0050] Based on the road toll information and road traffic information as node information, and in combination with the optimal graph adjacency matrix, use the pre-trained spatio-temporal graph convolutional neural network model based on the time attention mechanism to obtain the traffic flow prediction result of the highway.

[0051] In a specific implementation, the acquisition of the macroscopic graph adjacency matrix is specifically as follows: Based on the distances between traffic flow detector nodes, the connection relationships between traffic flow detector nodes, and road toll information, a node distance graph adjacency matrix, a node actual connection graph adjacency matrix, and a road toll graph adjacency matrix are respectively constructed; based on a pre-designed calculation method, each graph adjacency matrix is integrated to obtain an initial graph adjacency matrix; based on graph self-learning to mine the spatial relationships between nodes, a new graph adjacency matrix is generated, and the initial graph adjacency matrix is fused with the new graph adjacency matrix, and after sparse processing, the macroscopic graph adjacency matrix is obtained.

[0052] Specifically, for the convenience of understanding, the following details the solution of this embodiment with reference to the accompanying drawings:

[0053] A traffic flow prediction method based on a spatio-temporal graph convolutional neural network specifically includes the following steps:

[0054] Step 1: Based on web crawler technology, obtain the open-source road toll information, section attribute features (such as the distances between traffic flow detector nodes, road widths, ramp numbers, etc.), and road traffic information (such as traffic flow, vehicle speed, occupancy rate, etc.) on the Internet, and convert them into a format that can be used for training the graph neural network model through a pre-set program, that is, obtain a database for training the graph neural network model.

[0055] Among them, the construction of the database in Step 1 specifically includes the following steps:

[0056] (1) Query the open-source resources on the Internet, find the road toll information and section attribute information of the highway, and find the website that organizes, stores, and manages the road traffic information detected by highway sensors (i.e., traffic flow detectors);

[0057] (2) Based on web crawler technology, access the website that organizes the road traffic information found, and crawl the required road traffic information;

[0058] (3) Preprocess the crawled road traffic information and convert it into a format that can be used for training the neural network model, such as [[traffic volume 1, vehicle speed 1], [traffic volume 2, vehicle speed 2], …… [traffic volume n, vehicle speed n]], and convert the relationship between the road toll information and the sensor nodes reflected by the section attribute information into a matrix form, generating predefined graph adjacency matrices corresponding to specific relationships between nodes, including a predefined distance graph adjacency matrix, a predefined actual connection graph adjacency matrix, and a predefined road toll graph adjacency matrix.

[0059] As Figure 7 shown, taking the actual connection graph adjacency matrix as an example, the matrix form is as follows:

[0060] If there is a connection between node v1 and node v2, the corresponding position in the matrix is 1, otherwise it is zero. The distance relationship (after normalization) is to replace 1 with the distance between the two nodes. The toll matrix means that if there is a toll station between the two nodes, then the corresponding position is set to the current toll price (after normalization).

[0061] Build steps:

[0062] The crawled data is cleaned to obtain the distance between nodes, whether the nodes are connected to each other, and whether there are toll booths between the nodes. This information is constructed into the format of an adjacency matrix.

[0063] Step 2: Input the road toll information and road attribute features obtained in step 1 into the graph self-learning module constructed in this embodiment, encode the road toll information into the graph adjacency matrix from both macro and micro perspectives, and use the graph self-learning method to mine the potential spatial relationship between nodes to obtain the optimal graph adjacency matrix.

[0064] Wherein, the step 2 specifically includes the following steps:

[0065] (1) Construct a graph adjacency matrix from a macro perspective (corresponding to the macro graph adjacency matrix acquisition unit). In the long run, the graph structure is relatively stable. We believe that price information, the connection relationship between nodes, and the distance between nodes have an important impact on the connection relationship between nodes. Based on the predefined distance graph adjacency matrix, the actual connection graph adjacency matrix, and the road toll graph adjacency matrix, we guide the construction of the macro graph adjacency matrix and explore the potential relationship between nodes through graph self-learning. The specific calculation method is as follows:

[0066] First, under the premise of ensuring the sparsity of the macrograph adjacency matrix, multiple graph adjacency matrices are integrated to construct the initial graph structure. The process can be expressed mathematically as follows:

[0067]

[0068]

[0069] Where: A k represents the graph adjacency matrix reflecting the kth relationship (including the distance graph adjacency matrix, the actual connection graph adjacency matrix and the road toll graph adjacency matrix), I N represents the identity matrix. Γ is the indicator function, which is as follows:

[0070]

[0071] Secondly, potential spatial relationships between nodes are mined through graph self-learning. On highways, vehicles have a clear driving direction, and the traffic flow can only move in one direction. Moreover, in some cases, toll stations charge different fees for vehicles in different directions at the same time. Therefore, the relationships between nodes should be one-way. Thus, the purpose of the graph self-learning module we use is to extract one-way relationships between nodes, and its process can be expressed in mathematical formulas as follows:

[0072]

[0073] In the formula: are learnable parameters and are skew-symmetric matrices. Diag(Λ) generates weights at diagonal positions based on the diagonal matrix Λ. ReLU represents a non-linear activation function, which we use to enhance the sparsity of the newly generated graph adjacency matrix.

[0074] Thirdly, in this embodiment, a method similar to the attention mechanism is used to fuse the newly generated graph adjacency matrix with the old graph adjacency matrix, and its process can be expressed in mathematical formulas as follows:

[0075] S = Sigmoid(w1([A1, A old )) (5)

[0076] A2 = S ⊙ A1 + (1 - S) ⊙ A old (6)

[0077] In the formula: Sigmoid represents a non-linear activation function, w1 is a 1×1 convolutional kernel, ⊙ represents element-wise multiplication, and A old is the graph adjacency matrix obtained from the previous iteration, and its initial value is the initial graph structure mentioned above.

[0078] Finally, to further ensure the sparsity of the matrix, we performed the following operations:

[0079]

[0080]

[0081] In the formula: D2, D3 are diagonal matrices, Set ε1 ∈ (0, 1) to filter out some weak relationships in the graph adjacency matrix A2.

[0082] (2) Construct the graph adjacency matrix from a microscopic perspective (corresponding to the microscopic graph adjacency matrix acquisition unit). Microscopically, due to sudden changes in some traffic conditions (such as sudden changes in road toll prices, traffic accidents, weather conditions, etc.), the relationships between nodes may change drastically in a short period of time, which will be affected by many factors. Since the traffic information recorded by sensor nodes themselves (traffic flow, vehicle speed, occupancy rate, etc.) is closely related to the traffic conditions on the road, and we encode the time-varying price information together with the node traffic information. Therefore, this module generates a microscopic-level graph adjacency matrix by mining node data to capture the drastic fluctuations between nodes in a short time.

[0083] This part details the construction method of the micrograph adjacency matrix, mainly using multiple convolution operations to achieve the goal.

[0084]

[0085] In the formula: ω2, ω3, ω4 represent learnable convolution kernel parameters, and ReLU is the activation function. is the given node attribute information, contains information related to temporary factors in the node, and these temporary factors may affect the spatial relationship of the node.

[0086] Specifically, the node attributes include three items, namely [traffic flow, price, road toll situation]. The corresponding temporary factor is the unexpected event on the corresponding road. For example, if there is a car accident between two nodes, the traffic flow on this section of the road will decrease. The temporary factor refers to unexpected situations such as car accidents. Such information is difficult to predict, but we believe that traffic information will be affected by unexpected situations and change accordingly. Since the node attribute information corresponds to traffic information, it is possible to judge whether an unexpected situation has occurred on the road by analyzing the node information. This is a microscopic dynamic-changing graph adjacency matrix used to guide real-time road traffic flow prediction. It can be understood that other factors can be added to the temporary factor according to the actual situation.

[0087] Secondly, the solution in this embodiment dot-products M and M T to obtain the microscopic graph adjacency matrix and processes the matrix to ensure its sparsity. The function can be expressed as:

[0088] A Mi = ReLU(Norm(MM T )) - ε2) (10)

[0089] In the formula: ε2 ∈ (0, 1) is a threshold used to filter out some weak relationships in MM T .

[0090] (3)Fuse the macro-micro graph adjacency matrix. In this part, we use the ReLU activation function and normalization method to fuse the macro graph adjacency matrix A Ma and the micro graph adjacency matrix A Mi together to obtain the optimal graph adjacency matrix. The specific calculation method is expressed as

[0091] A * = Norm(ReLU(A Ma + A Mi )) (11)

[0092] Step 3: Construct a spatio-temporal graph convolutional neural network with a temporal attention mechanism for traffic flow prediction. Input the road cost information and road traffic information as node information together with the optimal graph adjacency matrix in Step 2 into the model. On the basis of considering price factors, model the relationship between price and road traffic flow to achieve the goal of predicting road traffic flow in the future for a period of time.

[0093] Among them, the specific steps of Step 3 are as follows:

[0094] (1) Use the temporal attention mechanism to adaptively assign different importance to data at different times. The specific calculation formula is as follows:

[0095]

[0096]

[0097] In the formula: V e , are learnable parameters, and the time-related matrix E is determined by different inputs. The value of the element E i,j in E represents the strength of the dependence relationship between time dimensions i and j. After calculating E, use the softmax function for normalization to obtain E'. Finally, we use the dot product method to obtain is the input information processed by the temporal attention mechanism, and τ is. τ is the length of the time series. For traffic prediction, it may not be the data at a certain past moment that is needed, but the traffic conditions in a past period. For example: if road traffic information is extracted every five minutes, then the road traffic conditions for one hour can be converted into 12 data points, and τ is equal to 12. Here, it represents the length of the input time series.

[0098] (2) Spatio-temporal convolution module to extract the relationship between data in the spatial and temporal dimensions.

[0099] Use the graph convolutional neural network module with Chebyshev polynomials to extract the information of data in the spatial dimension. The specific expression is as follows:

[0100]

[0101] Wherein: represents the graph convolution operation, represents the input information processed by the temporal attention mechanism, and gθ is the signal on the graph on for filtering the kernel, and the parameter is a polynomial coefficient vector. λ max is the largest eigenvalue of the Laplacian matrix. The recursive definition of the Chebyshev polynomial is:

[0102] Its initial conditions are

[0103] Since the graph structure is defined as a directed graph, the adjacency matrix considering directionality no longer has symmetry. We have adopted the following method to handle this problem:

[0104]

[0105] Wherein: θ P , θ Q are learnable parameters, is transpose of. Concat is an operation to aggregate different data. represents the input data after graph convolution processing.

[0106] After the graph convolution operation captures the adjacent information of each node on the graph in the spatial dimension, we use one-dimensional temporal convolution to aggregate the information of surrounding time points. The specific process is expressed as:

[0107]

[0108] Wherein, * represents the standard convolution operation, w5 is the parameter of the temporal dimension convolution kernel, and the activation function is ReLU.

[0109] Step 4: The model was evaluated on the actual traffic dataset and compared with other traffic flow prediction methods. Analyze the experimental results, verify the accuracy of the model, verify whether the model has successfully modeled the relationship between price information and road traffic flow distribution, and verify the quality of the dataset.

[0110] Specifically, the solution in this embodiment uses a crawler software to crawl the road traffic information of three toll roads, namely SR261, SR241, and SR133, in a specific area provided by a PEMS (Performance Measurement System) road traffic data website in a certain region. The information mainly includes traffic flow information and coil sensor occupancy information aggregated by 211 sensor nodes every five minutes. In the example, we crawled the road traffic information in this area from July 4, 2022 to September 4, 2022. And the road traffic data is divided into a training set, a validation set, and a test set in the format of 6:2:2.

[0111] As Figure 1 shows the spatial geographical location of the toll roads in this area. Figure 2 shows the distribution of toll nodes on the toll roads, as well as the changes in road toll rates in different directions, sections, and times of the highway.

[0112] The overall architecture of the spatio-temporal graph convolutional neural network model with a graph self-learning module and an attention mechanism proposed in this embodiment is as Figure 3 shown. For the convenience of understanding, the method described in this embodiment is named DCP-AASTGNet and compared with several other models. The following is a brief introduction to several models for comparison:

[0113] (1) Historical Average (HA). This method believes that the change of traffic flow is a periodic process and uses the historical average value of each previous period to predict the data of the next period.

[0114] (2) Vector Auto-regressive model (VAR). It and the Auto-Regressive Integrated Moving Average Model with Kalman filter (ARIMA) are different variants based on the same basis and are typical methods for predicting subsequent data based on its previous data.

[0115] (3) Long Short-Term Memory Network with fully connected LSTM hidden units (FC-LSTM). This method mainly uses a recurrent neural network to extract the relationship information of nodes in the time dimension.

[0116] (4) Diffusion Convolutional Recurrent Neural Network (DCRNN). This algorithm uses diffusion convolution and recurrent neural networks (i.e., GRU and LSTM) to model traffic relationships on directed graphs.

[0117] (5) Attention Based Spatial–Temporal Graph Convolutional Networks (ASTGCN). It combines graph convolution with spatial attention to extract spatial features and combines standard convolution with temporal attention to extract temporal features.

[0118] (6) An adaptive graph learning algorithm for traffic prediction based on spatiotemporal neural networks (AdapGL). It proposes a graph self-learning module that can be applied to most graph convolutional traffic prediction neural networks. We use AdapGLA based on ASTGCN as a representative of the algorithm.

[0119] To evaluate the performance of several models running on the dataset we created, we use the following formula for evaluation.

[0120] Suppose \(y = y_1,...,y\) n represents the actual results in the real world, represents the predicted values given by the model, and \(\Omega\) represents the metrics of the observed samples. The evaluation metrics are defined as follows:

[0121] Root Mean Square Error (RMSE)

[0122]

[0123] Mean Absolute Error (MAE)

[0124]

[0125] Mean Absolute Percentage Error (MAPE)

[0126]

[0127] We set unified experimental parameters for all experiments and used the experimental data of the past hour to predict the road traffic information of the next hour. For the optimizer, we chose Adam with a learning rate of 0.001. At the same time, we used an early stopping strategy to determine whether the model needed to stop early. The sizes of M1 and M2 were set to 64×64, and ε1 and ε2 were set to N represents the number of sensor nodes. The number of Chebyshev polynomials was uniformly set to 3. The Chebyshev convolution kernel and the temporal convolution kernel were set to 128. θ P and θ q were set to 64. The convolution kernels of w2 and w3 were set to 1×1, the convolution kernel of w4 was set to 1×12, and the number of spatio-temporal convolution blocks was set to 3. The batch size was set to 64. The epochs of all deep learning models were set to 100.

[0128] As shown in Table 1, it shows the performance of various models on the dataset created in the solution described in this embodiment. It can be seen that our solution shows the best performance in all metrics. At the same time, multiple models run normally on the dataset we created, demonstrating the quality of our dataset.

[0129] As Figures 4(a) to 4(c) shown, it shows the performance of multiple models at different prediction time steps; as shown in Fig. 5(a), it shows the performance of multiple models on nodes greatly affected by toll stations. As shown in Fig. 5(b), it compares the performance of DCP-AASTGNet and AdapGLA when setting different numbers of spatio-temporal convolution blocks.

[0130] As Figures 6(a) to 6(b) shown, it is the prediction curves of different models for the traffic volume of the next hour at different nodes and different time periods. As can be seen from Fig. 6(a), generally speaking, AdapGLA and DCP-AASTGNet can fit the real situation better than other models, and the fitting curves are similar in many cases. As can be seen from Fig. 6(b), when the traffic flow changes violently, the fitting effect of DCP-AASTGNet is better than that of AdapGLA.

[0131] Table 1. Performance comparison of different traffic flow prediction methods.

[0132]

[0133] Embodiment 2

[0134] The purpose of this embodiment is to provide a traffic flow prediction system based on a spatio-temporal graph convolutional neural network.

[0135] A traffic flow prediction system based on a spatio-temporal graph convolutional neural network, comprising:

[0136] A data acquisition unit, which is used to acquire relevant information of the highway and perform corresponding preprocessing; wherein, the relevant information includes road toll information, road attribute information, and road traffic information;

[0137] A graph adjacency matrix acquisition unit, which is used to encode the road toll information into the graph adjacency matrix based on the road toll information and road attribute information by using a pre-constructed graph self-learning module, and obtain an optimal graph adjacency matrix; wherein, the graph self-learning module includes a macroscopic graph adjacency matrix acquisition unit for integrating the node distance graph adjacency matrix, the node actual connection graph adjacency matrix, and the road toll graph adjacency matrix, and a microscopic graph adjacency matrix acquisition unit for capturing short-term fluctuations between nodes based on a number of convolutional operations;

[0138] A traffic flow prediction unit, which is used to obtain the traffic flow prediction result of the highway based on the road toll information and road traffic information as node information, and in combination with the optimal graph adjacency matrix, by using a pre-trained spatio-temporal graph convolutional neural network model based on a time attention mechanism.

[0139] Further, the system in this embodiment corresponds to the method in Embodiment 1, and its technical details have been described in detail in Embodiment 1, so they will not be repeated here.

[0140] Those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computer device. Optionally, they can be implemented by program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. The present invention is not limited to any specific combination of hardware and software.

[0141] Although the specific implementation manners of the present invention are described above in conjunction with the accompanying drawings, it is not a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications or deformations that can be made without creative efforts on the basis of the technical solutions of the present invention are still within the protection scope of the present invention.

Claims

1. A traffic flow prediction method based on a spatio-temporal graph convolutional neural network, characterized in that include: Obtaining relevant information about the expressway and performing corresponding preprocessing; wherein the relevant information includes road toll information, road attribute information, and road traffic information; Based on the road toll information and road attribute information, a pre-built graph self-learning module is used to encode the road toll information into a graph adjacency matrix and obtain an optimal graph adjacency matrix. The graph self-learning module includes a macro graph adjacency matrix acquisition unit for integrating the node distance graph adjacency matrix, the node actual connection graph adjacency matrix, and the road toll graph adjacency matrix, and a micro graph adjacency matrix acquisition unit for capturing short-term fluctuations between nodes based on several convolution operations. The acquisition of the macrograph adjacency matrix is specifically as follows: based on the distances between traffic flow detector nodes, the connection relationships between traffic flow detector nodes, and road toll information, respectively constructing a node distance graph adjacency matrix, a node actual connection graph adjacency matrix, and a road toll graph adjacency matrix; integrating the graph adjacency matrices based on a preset calculation method to obtain an initial graph adjacency matrix; mining the spatial relationships between nodes based on graph self-learning to generate a new graph adjacency matrix, and fusing the initial graph adjacency matrix with the new graph adjacency matrix to obtain a macrograph adjacency matrix after sparse processing; The road attribute features include the distance between traffic flow detector nodes, road width and number of ramps; the road traffic feature information includes traffic flow, vehicle speed and occupancy rate; The adjacency matrices of each graph are integrated using the following formula: Among them, , , represents the graph adjacency matrix reflecting the th relationship, represents the identity matrix, is the indicator function; Based on the road toll information and road traffic information as node information, and combined with the optimal graph adjacency matrix, a pre-trained spatiotemporal graph convolutional neural network model based on a temporal attention mechanism is used to obtain traffic flow prediction results for highways.

2. The traffic flow prediction method based on the spatio-temporal graph convolutional neural network according to claim 1, wherein, The obtaining of the optimal graph adjacency matrix is specifically as follows: based on the ReLU activation function and the normalization method, the obtained macro graph adjacency matrix and the micro graph adjacency matrix are fused to obtain the optimal graph adjacency matrix; The micrograph adjacency matrix is obtained using the following formula: ) Among them, are learnable convolution kernel parameters, is an activation function, is preset node attribute information, is information related to the temporary factor in the node.

3. A traffic flow prediction method based on a spatio-temporal graph convolutional neural network according to claim 1, characterized in that, The spatiotemporal graph convolutional neural network model based on the temporal attention mechanism specifically includes the following processing steps: adaptively assigning different importance weights at different times to the input data through the temporal attention mechanism; inputting the weighted data into the spatiotemporal convolutional neural network, and obtaining the final traffic flow prediction result after extracting spatial and temporal dimension features.

4. A traffic flow prediction system based on a spatio-temporal graph convolutional neural network, characterized in that, include: A data acquisition unit, which is used to acquire relevant information of the expressway and perform corresponding preprocessing; wherein the relevant information includes road toll information, road attribute information and road traffic information; a graph adjacency matrix acquisition unit configured to encode the road toll information into a graph adjacency matrix based on the road toll information and road attribute information using a pre-built graph self-learning module, and to obtain an optimal graph adjacency matrix; wherein the graph self-learning module includes a macrograph adjacency matrix acquisition unit for integrating the node distance graph adjacency matrix, the node actual connection graph adjacency matrix, and the road toll graph adjacency matrix, and a micrograph adjacency matrix acquisition unit for capturing short-term fluctuations between nodes based on a number of convolution operations; The acquisition of the macro graph adjacency matrix is specifically as follows: Based on the distances between traffic flow detector nodes, the connection relationships between traffic flow detector nodes, and road toll information, a node distance graph adjacency matrix, a node actual connection graph adjacency matrix, and a road toll graph adjacency matrix are respectively constructed; Based on a pre-designed calculation method, each graph adjacency matrix is integrated to obtain an initial graph adjacency matrix; Based on graph self-learning to mine the spatial relationships between nodes, a new graph adjacency matrix is generated, and the initial graph adjacency matrix is fused with the new graph adjacency matrix, and after sparse processing, the macro graph adjacency matrix is obtained; The road attribute features include the distances between traffic flow detector nodes, road width, and the number of ramps; The road traffic characteristic information includes traffic flow, vehicle speed, and occupancy rate; The integration of each graph adjacency matrix is specifically carried out using the following formula: Among them, , , represents the graph adjacency matrix reflecting the th relationship, represents the identity matrix, is the index function; A traffic flow prediction unit, which is used to obtain the traffic flow prediction result of the highway based on the road toll information and road traffic information as node information, and in combination with the optimal graph adjacency matrix, using a pre-trained spatio-temporal graph convolutional neural network model based on a time attention mechanism.

5. An electronic device, comprising a memory, a processor, and a computer program running on the memory, characterized in that, When the processor executes the program, it implements a traffic flow prediction method based on a spatio-temporal graph convolutional neural network according to any one of claims 1-3.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a traffic flow prediction method based on a spatio-temporal graph convolutional neural network according to any one of claims 1-3.