Traffic flow prediction method based on high-order traffic map
By constructing high-order traffic maps and using high-order cross-attention technology, the problem of information transmission complexity in urban traffic networks is solved, enabling more accurate and faster traffic flow prediction.
Patent Information
- Application Number
- CN202510899196.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-11-07
AI Technical Summary
Existing traffic flow forecasting methods are unable to effectively describe the complex information transmission relationships in urban traffic networks, resulting in insufficient forecast accuracy, especially in the case of emergencies where rapid response is difficult.
We employ a time series-simplex network model based on a high-order traffic graph. By embedding the traffic graph into a graph convolutional network, we utilize high-order cross-attention techniques to describe the interactions between nodes, thereby increasing information utilization efficiency and improving prediction accuracy.
By constructing high-order traffic maps, we can aggregate road condition information from different roads, enhance the model's generalization ability, and respond sensitively to changes in road conditions, thereby improving the accuracy and speed of traffic flow prediction.
Smart Images

Figure CN120913385A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of urban traffic demand prediction, and particularly relates to a traffic flow prediction method based on a high-order traffic graph. BACKGROUND
[0002] The rapid development of intelligent transportation industry has brought great convenience to people's travel. Among them, whether in the field of driverless cars or various travel software, the function of "traffic flow prediction" can provide users with information about road congestion in the future. Time helps users choose a better travel route. However, with the development of urban traffic, the road conditions are becoming more and more complex, and the number of vehicles is also growing rapidly. Under this condition, the prediction of traffic flow (i.e. traffic demand) has become a more important and difficult challenge. Under the joint influence of weather, road conditions and other information, its prediction becomes difficult. Inaccurate road congestion information can cause a large error in the total travel time of users, resulting in economic losses. In the context of the complexity of the transportation network and the increasing number of vehicles, a more accurate and robust traffic demand prediction method has become an urgent need.
[0003] Domestic and foreign researchers have conducted systematic research on urban traffic demand prediction. Early research mainly relied on Kalman filtering and ARIMA algorithm, relying on a large amount of historical data for time series prediction. With the popularity of road sensors and vehicle-mounted Bluetooth, Emami et al. proposed an improved Kalman filtering algorithm that can predict based on more data, with an accuracy improvement of 11% compared to other models. In 2019, Shen et al. proposed a multi-bifurcation road traffic demand prediction method based on chaos optimization algorithm and related vector machine (RVM), which well described the local complex traffic network. With the development of machine learning technology, the powerful feature extraction capability of deep learning has gradually emerged. Wu et al. tried to establish a traffic graph and use convolutional neural network (CNN) and attention mechanism for prediction. The results show that this method is suitable for simple traffic network structure. In Wang's method, weather factors are also considered in the prediction problem. They applied long short-term memory neural network (LSTM) and proved that the prediction accuracy is higher than other models when including weather information. In 2018, Yu et al. designed a spatio-temporal graph convolutional network (STGCN) that alternately convolves the time and spatial features of the nodes, enabling the model to rely on spatio-temporal fusion information for prediction, and has a certain improvement in the accuracy of traffic demand prediction. In 2024, Du et al. invented a spatio-temporal graph learning method with an additional time series prediction auxiliary learning task, which can more sensitively capture the trend of changes in time-varying features and perform well in the face of traffic emergencies.
[0004] Researchers have made many attempts on the problem of traffic demand prediction, but there are still deficiencies. The existing methods generally only establish the corresponding general graph of the traffic network, however, the public traffic network of the city is complex, and the information transmission between the traffic nodes and roads cannot be effectively described. For example, the traffic of two roads connected by a traffic area is related, and the traffic of two traffic areas that are not adjacent but have similar structural information in the traffic network is related. SUMMARY
[0005] In view of the above problems, the present application provides a traffic flow prediction method based on a high-order traffic graph, which models the high-order neighbor relationship between each traffic node in the traffic network through a time series-simplicial network model, and describes the interaction between the nodes in the traffic graph through a high-order cross attention technology, thereby increasing the utilization efficiency of information in the traffic network and improving the accuracy of traffic flow prediction.
[0006] The present application provides a traffic flow prediction method based on a high-order traffic graph, and the specific steps are as follows:
[0007] Step 1: Construct a high-order traffic graph at time t according to the road relationship between all traffic nodes of the traffic graph; embed the high-order traffic graph through a graph convolution network to obtain a graph embedding vector matrix at time t;
[0008] Step 2: Based on the graph embedding vector matrix, extract the initial traffic demand time series features of each high-order edge;
[0009] Step 3: Through the linear layer of each order edge, the mapping of the traffic flow demand time series features of the corresponding edge is completed, and the initial edge feature vector of each order edge at time t is obtained;
[0010] Step 4: Based on the initial edge feature vector of each order edge at time t, the information transmission between different order edges is completed through a high-order cross attention layer, the similarity between the same order neighbors is obtained through a similarity module, and the final similarity edge feature is obtained;
[0011] Step 5: Based on the final similarity edge feature, the traffic demand prediction value is obtained through a multilayer perceptron;
[0012] Step 6: Based on the loss function, the prediction error of the prediction value of each order edge is obtained;
[0013] Step 7: Repeat steps 1 to 5, and train and update the traffic flow prediction model parameters through the loss function in step 6 until the final traffic flow prediction model is obtained after the traffic flow prediction model converges;
[0014] Step 8: Use the final traffic flow prediction model to predict the traffic flow demand.
[0015] Optionally, the high-order traffic graph comprises a set of traffic nodes in a traffic network of the traffic graph; and there is a high-order edge between two or more traffic nodes in the set of traffic nodes that are connected by a traffic trunk road.
[0016] Optionally, the initial traffic flow information is embedded by the graph convolution network to obtain a graph embedding vector matrix, expressed as:
[0017]
[0018] wherein, represents an embedding vector of an i-order edge at time t; Θ i represents a to-be-trained parameter of the i-order edge graph convolution layer; represents historical traffic flow demand data of the i-order edge at time t.
[0019] Optionally, the specific steps of step 4 are as follows:
[0020] The initial edge feature vector of all edges of each order edge at time t is used as the input of the high-order cross-attention layer, the cross-attention mechanism is used to realize the information transmission between neighbor high-order edges according to the connection relationship of the adjacency matrix of the i-order edge and the neighbor j-order edge, and the aggregated edge feature of all edges of each order edge at time t is obtained.
[0021] Based on the initial edge feature vector and the aggregated edge feature vector of all edges of the i-order edge at time t, the feature information of the edge is updated, and the normalized edge feature of all edges of each order edge at time t is obtained.
[0022] The information transmission between the same-order neighbor high-order edges is realized by the similarity module, and the assigned normalized edge feature of the lth cycle is obtained.
[0023] The information is updated by the normalization function to obtain the similarity edge feature.
[0024] It is judged whether the cycle reaches a cycle threshold value, if yes, the similarity edge feature is used as the final similarity edge feature; if not, the next cycle is entered.
[0025] Optionally, the traffic flow demand time series feature of the next cycle is constructed by using the traffic flow demand time series feature obtained in step 3 and the similarity edge feature; and the next cycle of step 4 is entered based on the traffic flow demand time series feature of the next cycle.
[0026] Optionally, the loss function is the mean absolute percentage error.
[0027] Compared with the prior art, the present application has at least the following beneficial effects:
[0028] 1. The traffic flow prediction method of the present application realizes the aggregation of road condition information on different roads by constructing a high-order graph of a traffic network, and can utilize high-order information of interaction between different roads.
[0029] 2. The traffic flow prediction method of the present application can analyze the road relationship in a large-scale traffic network by increasing the information transmission of the high-order structure between different subgraphs, so that the generalization ability of the model is strong.
[0030] 3. The traffic flow prediction method of the present application considers the demand information in time and space at the same time through the proposed attention mechanism, is sensitive to road condition changes, and quickly reflects the influence of the situation on other nodes when a sudden situation occurs. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 The flowchart of the traffic flow prediction method based on the high-order traffic graph of the present application;
[0032] Figure 2 The schematic diagram of the high-order edge definition method of the present application;
[0033] Figure 3 The schematic diagram of the neighbor relationship definition method of a traffic node of the present application;
[0034] Figure 4 The schematic diagram of the traffic flow prediction method based on the high-order traffic graph of the present application. DETAILED DESCRIPTION
[0035] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict. In addition, the present application can also be implemented in other ways different from those described herein, therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below.
[0036] One specific embodiment of the present application, as Figures 1-4 , discloses a traffic flow prediction method based on a high-order traffic graph, and the specific steps are as follows:
[0037] Step 1: Construct a high-order traffic graph at time t according to the road relationship between all traffic nodes of the traffic graph; embed the high-order traffic graph through a graph convolution network to obtain an embedding vector matrix at time t.
[0038] Further, the expression of the high-order traffic graph at time t is;
[0039] H t =(V,E t ,X t)
[0040] wherein H t denotes the high-order traffic graph at time t; V = {V1, …, V N} denotes the set of traffic nodes in the traffic network of the traffic graph, V N denotes the Nth traffic node, and N denotes the total number of traffic nodes; denotes the set of edge relations of the traffic graph at time t, denotes all i-order edges of the traffic graph at time t; X t denotes the set of historical traffic flow demands at time t, denotes the historical traffic flow demand data of the i-order edge at time t.
[0041] Further, denotes the kth edge of the i-order edge at time t; defined as the average value of the historical traffic flow demand data of the traffic nodes contained in the kth edge of the i-order edge at time t.
[0042] Exemplarily, the traffic nodes are road intersections, a region, a trunk road, etc.; the edge relation of the traffic graph is that if there is a trunk road between two regions in a city, there is an edge between the two nodes.
[0043] It can be understood that the zero-order edge corresponds to the elements of the traffic nodes V one by one; for a set composed of traffic nodes, if the nodes in the set can be connected by a traffic trunk road two by two, it is called that the set forms a high-order edge, and the order of such a high-order edge is the number of elements of the set of all traffic nodes generating the high-order edge minus one. For any high-order edge in the high-order traffic graph, it is assumed that the high-order edge corresponding to the subset of the set also exists. Figure 2 It is shown that in a certain city taxi data set, three adjacent regions of Nos. 48, 100 and 230 form a two-order edge. According to the definition, there are three one-order edges, respectively, {48, 100}, {48, 230} and {100, 230}. In the present application, the high-order neighbor relation defined by the adjacency matrix of the high-order traffic graph is adopted: for two different order edges, such as the uth edge E i,u of the i-order edge at time t and the vth edge E j,v of the j-order edge at time t, if If there exists a high-order neighbor relationship between two edges, it is worth noting that the high-order neighbor relationship here is different from the physical neighbor, which only represents the information transmission path on the high-order network, and it is more similar to the physical inclusion relationship. For example: the regions numbered 48, 163, and 230 form another second-order edge, but there is no high-order neighbor relationship between the edge (48, 163) and the edge (48, 100, 230). Table 1 shows whether there is a high-order neighbor relationship between some high-order edges.
[0044] Table 1 Whether there is a high-order neighbor relationship between some high-order edges
[0045] First order edge\Second order edge (48,100,230) (48,163,230) (48,100) Yes No (48,230) Yes Yes (100,230) Yes No (48,160) No Yes
[0046] In the present application, in order to simplify the model, only high-order edges with an order less than or equal to five are considered. Since the edges with an order greater than six contain all the fifth-order edges, one sixth-order edge can be regarded as being composed of six fifth-order edges, and in combination with all the fifth-order edges, most of the information of higher-order edges can be described. At the same time, there can be different definitions of high-order neighbor relationships in other methods. In order to avoid the number of high-order edge neighbors being too large, resulting in the model extracting redundant information, the present application selects the high-order neighbor relationship defined in terms of the inclusion relationship between different order edges. In step 4, an additional neighbor relationship of the same order defined by the similarity of traffic demand is proposed, so that the model can calculate the similarity of the features of traffic nodes that are physically farther apart.
[0047] Then, the Laplacian matrix L of the high-order traffic graph is obtained i , and the expression is:
[0048] L i =A i,i+1 ·A i+1,i
[0049] A i,i+1 ∈R N(i)×N(i+1)
[0050]
[0051] wherein A i,i+1 represents the association matrix of the i-order edge and the i+1-order edge; A i+1,i represents the association matrix of the i+1-order edge and the i-order edge; R N(i)×N(i+1) represents a set of real matrices with a size of N(i)×N(i+1); N(i) represents the number of i-order edges in the high-order traffic graph, and N(i+1) represents the number of i+1-order edges; represents the element at the (k, m) position in the association matrix of the i-order edge and the i+1-order edge.
[0052] Further, denotes that there exists a high-order neighbor relationship between the kth edge of the i-order edge and the mth edge of the i+1-order edge; denotes that there exists a high-order neighbor relationship between the kth edge of the i-order edge and the mth edge of the i+1-order edge.
[0053] Further, the Laplacian matrix of the high-order traffic graph is embedded by the graph convolution network to obtain a graph embedding vector, and an expression is as follows:
[0054]
[0055] wherein, denotes the embedding vector of the i-order edge at time t; Θ i denotes the to-be-trained parameter of the i-order edge graph convolution layer; denotes the historical traffic flow demand data of the i-order edge at time t.
[0056] It can be understood that, is a set of graph embedding vectors of all edges of the i-order edge at time t, and the traffic flow demand size of the i-order edge is an average value of traffic flow demands of all actual stations corresponding to the edge.
[0057] Step 2: Based on the graph embedding vector matrix, initial traffic demand time series features of each high-order edge are extracted.
[0058] Specifically, the graph embedding vector matrix of each high-order edge at time t is input into a recurrent neural network (RNN) to obtain initial traffic flow demand time series features of the corresponding high-order edge with equal length, and an expression is as follows:
[0059]
[0060] wherein, denotes the initial traffic flow demand time series feature of the kth edge of the i-order edge at time t; denotes the traffic flow demand time series feature of the kth edge of the i-order edge at time t-1; U RNN,i ,W RNN,i are to-be-trained parameters, and respectively denote a parameter matrix of the recurrent neural network for processing the i-order edge traffic demand data; denotes the embedding vector of the kth edge of the i-order edge at time t.
[0061] Step 3: An i-order edge linear layer f 1,i is responsible for completing mapping of the traffic flow demand time series feature of the lth cycle of the i-order edge to obtain an initial edge feature vector of the lth cycle of the i-order edge at time t an expression is as follows:
[0062]
[0063] wherein, traffic flow demand time sequence feature of the i-th order edge of the k-th edge of the l-th cycle at time t; W 1,i denotes the i-th order edge linear mapping f 1,i (·) is a parameter matrix of the to-be-trained parameters.
[0064] Step 4: based on the initial edge feature vector of each order edge of the l-th cycle at time t, information transmission between different order edges is completed through a high-order cross attention layer, similarity of the same order neighbor is obtained through a similarity module, and a final similarity edge feature is obtained.
[0065] The method of the application adopts a structure of two continuous high-order cross attention layers, which not only ensures that any edge can receive information in a two-hop high-order neighbor range, but also avoids the problem of diluting important information due to too large a range.
[0066] The specific steps are as follows:
[0067] First, the initial edge feature vector of the k-th edge of the l-th cycle of the u-th order edge at time t is obtained. As the input of the high-order cross attention layer, the initial edge feature vector of the k-th edge of the l-th cycle of the u-th order edge at time t is obtained. i,j The cross attention mechanism is used to realize information transmission between neighbor high-order edges according to the connection relationship of the adjacency matrix A of the u-th order edge and the neighbor j-th order edge, and the aggregated edge feature of the k-th edge of the l-th cycle of the i-th order edge at time t is obtained.
[0068]
[0069] wherein, Γ i,k,j denotes a set composed of j-th order high-order neighbors of the k-th edge of the i-th order edge. is a to-be-trained parameter, and respectively denotes a query matrix, a key matrix and a value matrix of the i-th order edge and the j-th order edge in the l-th cycle of the high-order attention layer. denotes an initial edge feature vector of the k'-th edge of the l-th cycle of the j-th order edge at time t.
[0070] Then, based on the initial edge feature vector of the k-th edge of the l-th cycle of the i-th order edge at time t and the aggregated edge feature vector the edge feature information is updated, and the normalized edge feature of the k-th edge of the l-th cycle of the i-th order edge at time t is obtained.
[0071]
[0072] wherein, LN(·) denotes a layer normalization function, and γ i denotes the adoption degree of the information of the i-th order edge.
[0073] Next, the information transmission of the high-order edges of the same order neighbors is realized by the similarity module, and the assignment normalized edge features of the lth cycle are obtained Subsequently, the information is updated by a normalization function, and the similarity edge features of the lth cycle are obtained The expression is:
[0074]
[0075] Wherein, Γ i,k,i represents a set of high-order neighbors of the same order (i-order) of the kth edge of the i-order edge; k 0 represents the same order (i-order) neighbor of the kth edge of the i-order edge, is the kth edge of the i-order edge, and the kth 0 normalized edge feature of the lth cycle of the edge; is a to-be-trained parameter, which respectively represents the query matrix, the key matrix and the value matrix of the high-order attention layer of the same order (i-order) in the lth cycle of the i-order edge.
[0076] In order to enable the model to learn the correlation between different traffic network subgraphs, the attention mechanism of the similarity calculation module extracts the similarity of the nodes approximating the traffic demand. In addition, if two high-order edges belong to a higher-order edge at the same time, it is defined that there is a same-order neighbor relationship between the two edges, and the Laplacian matrix of the high-order graph can partially show the same-order neighbor relationship. The same-order neighbor relationship is also a kind of high-order neighbor relationship, which participates in the similarity calculation. Figure 3 It is shown that two zero-order edges with similar traffic demand are mutual same-order neighbors, that is, two similar regions of No. 152 in A district and No. 225 in B district of a city, and the blue numbers represent the traffic demand. In the similarity module, the 152 and 225 regions will calculate the similarity with each other. Table 2 shows whether there is a same-order neighbor relationship between some first-order edges because they belong to the same high-order edge.
[0077] Table 2 whether there is a same-order neighbor relationship between some first-order edges because they belong to the same high-order edge
[0078]
[0079]
[0080] Next, in order to ensure that the model can apply the time sequence information of the edge to make prediction, the traffic flow demand time sequence features obtained in step 3 are used again and the similarity edge features of the kth edge of the i-order edge at time t in the lth cycle to construct the traffic demand time sequence features of the l+1th cycle The expression is:
[0081]
[0082] Then, it is determined whether i is greater than or equal to the cycle threshold L, if greater than or equal to L, the similarity edge feature of the kth edge of the ith order edge at time t is obtained by the lth cycle of the edge As the final similarity edge feature, step 5 is entered, if less than L, let l = l + 1, and the traffic demand time series information of the (l + 1)th cycle is obtained As the input of step 3, return to step 3.
[0083] Preferably, L = 3.
[0084] Step 5: based on the final similarity edge feature, the traffic flow demand prediction value of all edges at t + Δt is obtained by a multi-layer perception (MLP), and the expression is:
[0085]
[0086] Wherein, represents the traffic flow demand prediction value of the kth edge of the ith order edge at t + Δt; W mlp,1 , W mlp,2 represents two trainable parameter matrices of the multi-layer perception; and σ represents the ReLU activation function.
[0087] Step 6: the prediction error of the prediction value of any order edge is calculated by taking the mean absolute percentage error (Mape) as the loss function, and the total error loss of the prediction model is the average of the MAPE of all order edges, which represents the percentage error of the traffic flow predicted by the prediction model at the next moment of all traffic nodes (0 order edge) and node forming area (edge order number > 1), and the expression is
[0088]
[0089] Wherein, n represents the maximum order number of high-order edges in the traffic graph; represents the traffic demand prediction value set of all edges of the ith order edge at t + Δt; represents the traffic demand actual value of all edges of the ith order edge at t + Δt;
[0090] Further,
[0091] Step 7: repeat steps 1 to 5, and update the traffic flow prediction model parameters by the loss function in step 6
[0092]
[0093] until the final traffic flow prediction model is obtained after the traffic flow prediction model converges.
[0094] It can be understood that returning to step 1, the next time graph embedding vector matrix is obtained.
[0095] Step 8: using the final traffic flow prediction model obtained in step 7 to predict traffic flow demand.
[0096] Exemplarily, the traffic flow demand is road vehicle flow and congestion degree.
[0097] The high-order graph learning model proposed by the method of the present application is as shown in Figure 3 Table 3 compares the results of predicting the number of taxis departing from each traffic station on the NYC-Taxi dataset by the method of the present application and other baseline methods. It can be seen that the MAPE value of the prediction result of the method (HGA) proposed in the present patent has a greater improvement compared with other methods, such as the traditional ARIMA method, and the deep learning-based methods ConvLSTM and STDN.
[0098] Table 3 results of predicting the number of taxis departing from each traffic station on the NYC-Taxi dataset by the method of the present application and other baseline methods
[0099] Method ARIMA ConvLSTM STDN HGA Start (MAPE) 22.21% 20.50% 16.30% 13.97%
[0100] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
Claims
1. A traffic flow prediction method based on high-order traffic graph, characterized in that, The specific steps are as follows: Step 1: Construct a high-order traffic graph at time t according to the road relationship between all traffic nodes of the traffic graph; embed the high-order traffic graph through a graph convolution network to obtain a graph embedding vector matrix at time t; Step 2: Based on the graph embedding vector matrix, extract the initial traffic demand time series features of each high-order edge; Step 3: Through the linear layer of each order edge, the traffic flow demand time series features of the corresponding order edge are mapped to obtain the initial edge feature vector of each order edge at time t; Step 4: Based on the initial edge feature vector of each order edge at time t, the information transmission between different order edges is completed through the high-order cross-attention layer, and the similarity between the neighbors of the same order is obtained through the similarity module to obtain the final similarity edge feature; Step 5: Based on the final similarity edge feature, the traffic demand prediction value is obtained through the multilayer perception; Step 6: Based on the loss function, the prediction error of the prediction value of each order edge is obtained; Step 7: Repeat steps 1 to 5, and update the traffic flow prediction model parameters through the loss function in step 6 until the traffic flow prediction model converges to obtain the final traffic flow prediction model; Step 8: Use the final traffic flow prediction model to predict the traffic flow demand.
2. The traffic flow prediction method according to claim 1, characterized in that, The high-order traffic graph includes a set of traffic nodes in the traffic network of the traffic graph; there is a high-order edge between two or more traffic nodes connected by a traffic trunk in the set of traffic nodes.
3. The traffic flow prediction method according to claim 1, characterized in that, Embed the initial traffic flow information through a graph convolution network to obtain a graph embedding vector matrix, the expression is: wherein, represents the embedding vector of the i-order edge at time t; Θ i represents the to-be-trained parameters of the i-order edge graph convolution layer; represents the historical traffic flow demand data of the i-order edge at time t.
4. The traffic flow prediction method according to claim 3, characterized in that, The specific steps of step 4 are: Use the initial edge feature vector of all edges of each order edge at time t as the input of the high-order cross-attention layer, and realize the information transmission between the neighbor high-order edges according to the edge relationship of the correlation matrix of the i-order edge and the neighbor j-order edge using the cross-attention mechanism to obtain the aggregated edge feature of all edges of each order edge at time t; Based on the initial edge feature vector and the aggregated edge feature vector of all edges of the i-order edge at time t, update the edge feature information to obtain the normalized edge feature of all edges of each order edge at time t; Realize the information transmission between the neighbor high-order edges through the similarity module to obtain the assigned normalized edge feature of the lth cycle; Update the information through the normalization function to obtain the similarity edge feature; Determine whether the cycle reaches the cycle threshold, if it does, use the similarity edge feature as the final similarity edge feature; If not, go to the next cycle. 5.The traffic flow prediction method of claim 4, wherein, Use the traffic flow demand time series features obtained in step 3 and the similarity edge feature to construct the traffic demand time series features of the next cycle; Enter the next cycle of step 4 based on the traffic demand time series features of the next cycle.
6. The traffic flow prediction method according to claim 1, characterized in that, The loss function is the mean absolute percentage error.