A Traffic Prediction Method and System Based on Spatiotemporal Hierarchical Networks

By constructing a spatiotemporally hierarchical network and utilizing multi-layer graph attention networks and multi-layer gated recurrent units, the problem of neglecting spatial correlation in existing traffic prediction is solved, achieving higher prediction accuracy.

CN114254214BActive Publication Date: 2026-03-10SUN YAT SEN UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing traffic forecasting methods fail to effectively utilize the spatial correlations in traffic data, resulting in insufficient forecast accuracy.

Method used

A traffic prediction method based on a spatiotemporal hierarchical network is constructed. By combining a hierarchical region enhancement network and a traffic feature matrix with a multi-layer graph attention network and a multi-layer gated recurrent unit, spatial and temporal correlations are learned to improve prediction accuracy.

Benefits of technology

Effectively capturing the spatiotemporal correlations in traffic data improves the accuracy of traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254214B_ABST
    Figure CN114254214B_ABST
Patent Text Reader

Abstract

This invention discloses a traffic prediction method and system based on a spatiotemporal hierarchical network. The method includes: acquiring traffic data and preprocessing the data to construct a hierarchical regional augmentation network and a traffic feature matrix; using the hierarchical regional augmentation network and the traffic feature matrix as input to a prediction model, learning spatial and temporal correlations, and outputting prediction results; the prediction model includes a region-aware spatial correlation model and a region-aware temporal correlation model. The system includes a preprocessing module and a prediction module. By using this invention, the spatiotemporal correlations in traffic data are effectively captured, improving the accuracy of traffic flow prediction. This invention, as a traffic prediction method and system based on a spatiotemporal hierarchical network, can be widely applied in the field of traffic prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of traffic prediction, and particularly relates to a traffic prediction method and system based on a spatio-temporal hierarchical network. BACKGROUND

[0002] The traffic prediction task is a key task for realizing traffic management, traffic planning and traffic control in an intelligent traffic system. The traffic prediction task aims to realize prediction of traffic information such as traffic flow, traffic speed and traffic density at a future time by analyzing traffic information at a current and historical time and traffic-related external conditions.

[0003] Current prediction methods mainly model traffic prediction as a time series mining problem, but only consider time correlation, while spatial correlation in traffic data is largely ignored (for example, spatial correlation between different roads or traffic monitoring points), thus greatly limiting the improvement of traffic prediction accuracy. SUMMARY

[0004] To solve the above technical problems, the purpose of the present application is to provide a traffic prediction method and system based on a spatio-temporal hierarchical network, a spatio-temporal data mining algorithm for hierarchical regional structures, and deep learning means to improve the accuracy of traffic prediction results.

[0005] The first technical solution adopted by the present application is: a traffic prediction method based on a spatio-temporal hierarchical network, comprising the following steps:

[0006] Obtaining traffic data and preprocessing the traffic data to construct a hierarchical regional enhancement network and a traffic feature matrix;

[0007] Taking the hierarchical regional enhancement network and the traffic feature matrix as inputs of a prediction model, learning spatial correlation and time correlation, and outputting a prediction result;

[0008] The prediction model comprises a region-aware spatial correlation model and a region-aware time correlation model.

[0009] Further, the step of obtaining traffic data and preprocessing the traffic data to construct a hierarchical regional enhancement network and a traffic feature matrix specifically comprises:

[0010] Obtaining original traffic data;

[0011] According to the original road network and the hierarchical regional structure Adding regions as virtual nodes to the network, and extracting the connection relationship between nodes and regions and between regions to establish a hierarchical regional enhancement network

[0012] The traffic time series information in the original traffic data is modeled as a node attribute, and a traffic feature matrix is constructed

[0013] Further, the region-aware spatial correlation model adopts a multi-layer graph attention network, the region-aware temporal correlation model adopts a multi-layer gated recurrent unit neural network, the hierarchical region enhancement network and the traffic feature matrix are taken as inputs of the prediction model, spatial correlation and temporal correlation are learned, and the step of outputting a prediction result specifically includes:

[0014] The graph attention network converts the input traffic feature matrix into a new feature matrix X t according to the spatial topology of the hierarchical region enhancement network ;

[0015] The gated recurrent unit calculates the corresponding hidden state matrix H t according to the new feature matrix X t ;

[0016] After learning the hidden state by alternately passing through the graph attention network and the gated recurrent unit and recursively multiple times, based on the hidden state matrix H t of the last step, a fully connected layer is passed through to perform dimension transformation to obtain the final prediction result

[0017] Further, the graph attention network converts the input traffic feature matrix into a new feature matrix X t according to the spatial topology of the hierarchical region enhancement network This step specifically includes:

[0018] For the input traffic feature matrix , at each time step, the spatial dependence relationship of region awareness among nodes, between nodes and regions, and between regions is modeled based on an attention mechanism to obtain the corresponding new feature matrix X t .

[0019] Further, the gated recurrent unit calculates the corresponding hidden state matrix H t according to the new feature matrix X t This step specifically includes:

[0020] The gated recurrent unit simultaneously models the temporal dependence relationship of region awareness among nodes, between nodes and regions, and between regions;

[0021] Based on the new feature matrix X t and the hidden state matrix H t-1, to obtain the hidden state matrix H of the current time step t .

[0022] Further, the gating cycle unit comprises a reset gate and an update gate, the reset gate determines the degree of forgetting information of past time steps, and the update gate determines the degree of passing information of past time steps to the next hidden state.

[0023] The second technical scheme adopted by the present application is: a traffic prediction system based on a space-time hierarchical network, comprising:

[0024] A preprocessing module is configured to acquire traffic data and preprocess the traffic data, and construct a hierarchical region enhancement network and a traffic feature matrix;

[0025] A prediction module is configured to take the hierarchical region enhancement network and the traffic feature matrix as inputs of a prediction model, learn spatial correlation and temporal correlation, and output a prediction result.

[0026] The method and system have the following advantages: the original road network is expanded into a hierarchical region enhancement network, which contains hierarchical regional structure information, and based on the network, a region-aware spatial correlation model and a temporal correlation model are further constructed, so that the space-time correlation in the traffic data is effectively captured, and the accuracy of traffic flow prediction is improved. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 is a step flow chart of the traffic prediction method based on the space-time hierarchical network of the present application;

[0028] Figure 2 is a data processing process schematic diagram of the prediction method of the specific embodiment of the present application;

[0029] Figure 3 is a schematic diagram of the hierarchical region enhancement network established by the specific embodiment of the present application;

[0030] Figure 4 is a data processing schematic diagram of the attention network of the specific embodiment of the present application;

[0031] Figure 5 is a schematic diagram of the gating unit of the specific embodiment of the present application;

[0032] Figure 6 is a structural block diagram of the traffic prediction system based on the space-time hierarchical network of the present application. DETAILED DESCRIPTION

[0033] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.

[0034] Traffic spatiotemporal data involves encoding spatial information in the road network and temporal information of traffic data at different times, represented by the traffic road network and attribute feature matrix, respectively: traffic roads are modeled as an undirected, unweighted graph. in A node set consisting of n nodes, v i For the i-th traffic monitoring point, ε represents the set of edges. Besides modeling the topological structure between traffic monitoring points as a road network, it is also necessary to model the temporal traffic information as node attributes, i.e., the feature matrix of the road network, as shown below:

[0035] Traffic information at time step t is modeled as node attribute features of the road network, represented as... Where the column vector f t The i-th element represents the traffic information at the i-th monitoring point within time step t. Traffic Feature Matrix This represents traffic information at p historical time steps and the current time step t, where each column represents the traffic information of all traffic monitoring points within the corresponding single time step.

[0036] The traffic prediction problem is defined as follows: at time t, given traffic topology information... Traffic flow information at past p time steps and current time step Predict traffic information within a future time step of length q. Right now:

[0037]

[0038] Reference Figure 1 and Figure 2 This invention provides a traffic prediction method based on a spatiotemporal hierarchical network, which includes the following steps:

[0039] S1. Acquire traffic data and preprocess the traffic data to construct a hierarchical regional enhancement network and a traffic feature matrix;

[0040] Specifically, this invention considers the hierarchical regional structure existing in the traffic network. After obtaining the traffic spatiotemporal data, it is necessary to construct a hierarchical regional augmentation network through data preprocessing. The network data obtained from the preprocessing will be further used as the input of the traffic flow prediction model in this invention.

[0041] S2, inputting the hierarchical region-enhanced network and the traffic feature matrix into a prediction model to learn spatial correlation and temporal correlation and outputting a prediction result;

[0042] The prediction model comprises a region-aware spatial correlation model and a region-aware temporal correlation model.

[0043] Further as a preferred embodiment of the method, the step of obtaining traffic data and pre-processing the traffic data to construct the hierarchical region-enhanced network and the traffic feature matrix specifically comprises:

[0044] obtaining original traffic data;

[0045] modeling traffic time series information in the original traffic data as node attributes to construct a traffic feature matrix

[0046] According to the original road network and the hierarchical region structure extracting nodes and regions and the connection relationship between regions to establish a hierarchical region-enhanced network

[0047] Specifically, the establishment process is as shown in Figure 3 . Figure 2 The left side shows an original traffic road network with 15 nodes. The 15 nodes in the original network are divided into 5 regions , and the 5 regions are further divided into 2 higher-level regions and . Figure 3 The right side shows the process of constructing the hierarchical region-enhanced network: adding 7 virtual nodes v 16 ,v 17 ,v 18 ,v 19 ,v 20 ,v 21 and v 22 representing regions and According to the hierarchical node-region, region-region membership relationship, and the adjacent relationship between regions, new edges are added to the network. In the obtained region-enhanced network, the newly established node edges are represented by dashed lines, which include three types of edges: node-region membership relationship (for example, edges 10-19, 11-19, 12-19, 13-19), region-region membership relationship (for example, edges 16-21, 17-21, 18-22, 19-22, 20-22), and region-region adjacent relationship (for example, edges 16-17, 16-18, 17-19, 18-19, 19-20, 21-22).

[0048] Specifically, after obtaining the original road network, it needs to be extended to a hierarchical regional augmented network. Meanwhile, considering the spatial / temporal correlations between 1) nodes, 2) nodes and regions, and 3) regions (including the same and different levels), the connections between nodes and regions and regions are extracted. The regions are regarded as virtual nodes added to the network, and the edges between nodes are updated.

[0049] Using to represent a hierarchical regional structure of L levels, where represents the set of regions in the l-th level (including k l regions in total). It is assumed that each node in the original road network belongs to and only belongs to one of the first-level regions. Similarly, for each region in the l-th level belongs to and only belongs to one of the (l+1)-th level regions. Finally, using to represent the total number of regions contained in all L levels.

[0050] Based on the original network structure and the region set , a hierarchical regional augmented network can be constructed, denoted as where the node set is defined as the union of the original node set and the virtual node set of the region, that is:

[0051]

[0052] where represents the virtual node related to the k-th region. Using to represent the number of nodes in the hierarchical regional augmented network, then

[0053] Subsequently, the augmented edge set is defined. In order to model the spatial / temporal correlations between nodes and regions and different regions (including the same and different levels), in addition to the original node-node edges, the hierarchical regional augmented edge set must also include node-region edges and region-region edges. There are three different cases:

[0054] a) Node-region membership relationship: if node v i directly belongs to region (i.e. is the smallest region containing node v i ), then a node-region edge is established between v i and ;

[0055] ​b) Region-region membership: if region is a child region of region (i.e. is the smallest region containing region ), a region-region edge is established between and ;

[0056] c) Region-region adjacency: if region and region belong to the same level and have adjacency in region division, a region-region edge is established between and ;

[0057] The enhanced edge set is the union of the original network edge set ε and the newly added edges through the above steps.

[0058] After the virtual node addition is completed, the traffic feature matrix is reconstructed to reflect the region-aware traffic information of the nodes at the historical and current time steps. For the original nodes, the traffic feature vectors remain unchanged. The feature vector of each newly added region virtual node is the average of the feature vectors of the original nodes directly or indirectly belonging to the region. That is, for the first n rows of the feature matrix, the feature values are consistent with the original feature matrix, and for other rows, the feature values are defined as the average of the feature vectors of the original nodes directly or indirectly belonging to the corresponding region, i.e.

[0059] Further as a preferred embodiment of the method, the region-aware spatial correlation model adopts a multi-layer graph attention network, the region-aware temporal correlation model adopts a multi-layer gated recurrent unit, and the step of taking the hierarchical region enhancement network and the traffic feature matrix as inputs of the prediction model, learning spatial correlation and temporal correlation, and outputting a prediction result specifically includes:

[0060] The graph attention network converts the input traffic feature matrix into a new feature matrix X t according to the spatial topology of the hierarchical region enhancement network ;

[0061] The gated recurrent unit calculates the corresponding hidden state matrix H t according to the new feature matrix X t ;

[0062] After learning the hidden state matrix H t through the graph attention network, the gate recurrent unit and recursively multiple times, the final prediction result is obtained through a fully connected layer

[0063] Further as a preferred embodiment of the method, the graph attention network converts the input traffic feature matrix X into a new feature matrix X according to the spatial topology of the hierarchical region enhancement network t This step specifically includes:

[0064] For the input traffic feature matrix X , at each time step, the spatial dependence relationship of the region perception between nodes, nodes and regions and regions is modeled based on the attention mechanism to obtain the corresponding new feature matrix X t .

[0065] Specifically, Figure 4 The schematic diagram of the graph attention network (GAT) used in the present application is shown, which performs aggregation operation on neighbor nodes through attention mechanism to realize adaptive allocation of different neighbor weights. For node v1, it first calculates the attention coefficients a 11 , a 12 , a 13 , a 14 , a 15 , and a 16 for each neighbor node {v1, v2, v3, v4, v5, v6} respectively, and then aggregates the features of the neighbor nodes according to the attention coefficients to learn a new feature vector [X t ] 1,: , which is used as the input of the gate recurrent unit (GRU). Since the input network data is enhanced based on the hierarchical regional structure, the use of GAT can establish adaptive allocation of node weights with region perception, thereby capturing the spatial correlation of region perception.

[0066] The graph attention network (GAT, Graph Attention Networks) is used to model the complex spatial dependence relationship between nodes, nodes and regions, and regions, and to automatically capture the importance (attention coefficient) of one node to another node, one node to a region, a region to a node, and a region to another region.

[0067] Specifically, the graph attention layer is used to convert the traffic features of the nodes into higher-level feature vectors to encode the complex spatial correlation between nodes, nodes and regions, and regions. The input of the graph attention layer is the traffic feature vector of each node in the hierarchical region enhancement network, that is wherein The output is a set of new feature vectors, i.e. wherein

[0068] The specific calculation steps are as follows:

[0069] First, the self-attention mechanism is used for the nodes in the network The attention value between each other is calculated:

[0070]

[0071] wherein, is a weight matrix for linear transformation of node features. Specifically, the self-attention mechanism used by the present application is a single-layer feedforward neural network, which includes a linear transformation vector and a LeakyReLU function (parameter a = 0.2) as an activation function, i.e.

[0072]

[0073] wherein, T denotes the transpose operation, and || denotes the connection operation. The softmax function is used for the neighborhood nodes to obtain the normalized attention coefficient:

[0074]

[0075] wherein, denotes the neighborhood nodes of node i in the hierarchical regional enhancement network.

[0076] Finally, for each node, the neighborhood node features are linearly combined using the obtained normalized attention coefficient to update the node feature vector:

[0077]

[0078] Thus, the output feature matrix of all nodes is constructed as follows:

[0079]

[0080] Further as a preferred embodiment of the method, the gating recurrent unit calculates the corresponding hidden state matrix H t based on the new feature matrix X t This step specifically includes:

[0081] The gating unit simultaneously models the time-dependent relationship of the node, the node and the region, and the region between the regions;

[0082] based on the new feature matrix X tand the hidden state matrix H at the previous time step t-1 , to obtain the hidden state matrix H at the current time step t .

[0083] Specifically, the schematic diagram of the gating unit principle is referred to Figure 5 The time-dependent relationship between nodes, between nodes and regions, and between regions is modeled using a gated recurrent unit (GRU) to construct a time neural network.

[0084] Assuming the number of units in the hidden layer is h, the hidden state matrix H at time step t-1 is represented by For each layer of the neural network, given the input at time t and the hidden state at time t-1 The reset gate R of the gated recurrent unit and the update gate Z can be calculated by the following formulas, respectively:

[0085]

[0086]

[0087] wherein, and are weight matrices, is a bias vector. Then, the candidate hidden state matrix H

[0088]

[0089] wherein, and are weight matrices, is a bias vector. The reset gate R t is used to control the extent to which the candidate hidden state of the current time step contains the hidden state of the previous time step.

[0090] Based on the hidden state H t-1 at the previous time step and the current candidate hidden state H The hidden state matrix H at time step t can be calculated by a weighted linear combination controlled by the update gate Z t , that is:

[0091]

[0092] Finally, according to the hidden state matrix H t , the final output, i.e., the prediction result at time step t is calculated using a fully connected layer, that is:

[0093]

[0094] wherein, is a weight matrix, is a bias vector.

[0095] Finally, the GAT and GRU are used in a loop to update the node features and learn the time-based hidden state, and finally the final output hidden state is used for traffic flow prediction to obtain the prediction result.

[0096] In the model training process, the training sample is used to represent the true result, that is, the true value of the traffic information in all nodes in the enhanced network for q time steps in the future.

[0097] Based on the model prediction value and the true value The training loss function of the model is defined as follows:

[0098]

[0099] wherein, Φ represents all parameters of the model, λ is a hyperparameter, L reg (Φ) is a regularization term, which is used to prevent the model from overfitting.

[0100] Further, as a preferred embodiment of the method, the gated recurrent unit includes a reset gate and an update gate, the reset gate determines the degree of forgetting information of past time steps, and the update gate determines the degree of passing information of past time steps to the next hidden state.

[0101] As shown in Figure 6 , a traffic prediction system based on a space-time hierarchical network includes:

[0102] A preprocessing module is configured to obtain traffic data, preprocess the traffic data, and construct a hierarchical regional enhanced network and a traffic feature matrix.

[0103] A prediction module is configured to input the hierarchical regional enhanced network and the traffic feature matrix into a prediction model, learn spatial correlation and temporal correlation, and output a prediction result.

[0104] The contents in the above method embodiments are all applicable to the system embodiments, the system embodiments specifically implement the same functions as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0105] The above is a specific description of the preferred embodiment of the application, but the 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 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 prediction method based on a spatio-temporal hierarchical network, characterized in that, The method comprises the following steps: acquiring traffic data and preprocessing the traffic data to construct a hierarchical region enhanced network and a traffic feature matrix; inputting the hierarchical region enhanced network and the traffic feature matrix into a prediction model to learn spatial correlation and temporal correlation and output a prediction result; the prediction model comprises a region-aware spatial correlation model and a region-aware temporal correlation model; the step of acquiring traffic data and preprocessing the traffic data to construct a hierarchical region enhanced network and a traffic feature matrix specifically comprises: acquiring original traffic data; According to the original road network and hierarchical regional structure , represent all layers contain region, represent the number of regions of the layer, add the region to the network as a virtual node, and extract the connection relationship between the nodes and regions and between the regions to establish a hierarchical regional enhanced network ; Modeling traffic time series information in original traffic data as node attributes to construct a traffic feature matrix ; the hierarchical region enhanced edge set additionally contains node-region edges and region-region edges, and there are three different cases: Node-region membership: If a node is directly affiliated with a region , is the smallest region containing node , then a node-region edge is established between and ; where denotes the virtual node associated with the kth region. Region-Region membership: If region is a sub-region of region , is the smallest region containing region , then a region-region edge is established between and . Region-Region Adjacency: If region and region belong to the same hierarchy and have an adjacency in region partition, a region-region edge is established between and ; the region-aware spatial correlation model adopts a graph attention network, the region-aware temporal correlation model adopts a gated recurrent unit, and the step of inputting the hierarchical region enhanced network and the traffic feature matrix into the prediction model to learn spatial correlation and temporal correlation and output a prediction result specifically comprises: The graph attention network enhances the network according to the hierarchical region , converts the input traffic feature matrix into a new feature matrix according to the spatial topology The gated recurrent unit calculates a corresponding hidden state matrix t from the new feature matrix X ; After learning the hidden state matrix recursively through the graph attention network, the gating recurrent unit and multiple times, the final prediction result is obtained through a fully connected layer based on the hidden state matrix of the last step . . 2.The traffic prediction method based on the space-time hierarchical network according to claim 1, characterized in that, The graph attention network enhances the network according to a hierarchical region The spatial topology of the network converts the input traffic feature matrix Into a new feature matrix This step specifically includes: For the input traffic feature matrix At each time step, the spatial dependence relationship of the region perception between nodes, nodes and regions, and regions is modeled based on the attention mechanism to obtain the corresponding new feature matrix . 3.The traffic prediction method based on the space-time hierarchical network according to claim 2, characterized in that, The gating recurrent unit calculates a corresponding hidden state matrix H according to a new feature matrix X t The gating recurrent unit calculates a corresponding hidden state matrix H according to a new feature matrix X This step specifically includes: the gated unit simultaneously models region-aware temporal dependency relationships among nodes, between nodes and regions, and between regions; based on a new feature matrix and a hidden state matrix of a previous time step to obtain a hidden state matrix of a current time step .

4. The traffic prediction method based on the space-time hierarchical network according to claim 3, characterized in that, the gated recurrent unit comprises a reset gate and an update gate, the reset gate determines the degree of forgetting information of past time steps, and the update gate determines the degree of passing information of past time steps to the next hidden state.

5. A traffic prediction system based on spatio-temporal hierarchical network, characterized in that, A traffic prediction method based on a spatio-temporal hierarchical network as claimed in claim 1 comprises: a preprocessing module for acquiring traffic data and preprocessing the traffic data to construct a hierarchical region enhanced network and a traffic feature matrix; a prediction module for inputting the hierarchical region enhanced network and the traffic feature matrix into a prediction model to learn spatial correlation and temporal correlation and output a prediction result.

Citation Information

Patent Citations

  • Traffic prediction method of spatio-temporal diagram convolution model based on attribute enhancement

    CN112216108A