An improved space-time network traffic flow prediction method based on impedance matrix

By constructing an impedance matrix and an STTN deep learning network, the problem of unclear spatial relationships between nodes was solved, achieving high-precision long-term prediction of traffic flow and meeting the precise needs of traffic management.

CN116884207BActive Publication Date: 2026-04-24BEIJING UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF TECH
Filing Date
2023-03-26
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods fail to effectively characterize the spatial relationships between nodes, resulting in a large discrepancy between prediction results and actual conditions. Furthermore, long-term traffic flow predictions are inaccurate, making it difficult to meet the precise needs of traffic management.

Method used

An impedance matrix is ​​constructed using ETC data. By combining this with the STTN deep learning network to learn temporal correlations, the spatiotemporal relationships between nodes are extracted, and the impedance-STTN model is used for traffic prediction.

Benefits of technology

It achieves high-precision prediction of traffic flow at traffic network nodes, maintaining high accuracy, especially in long-term prediction tasks, thus improving the precision and efficiency of traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116884207B_ABST
    Figure CN116884207B_ABST
Patent Text Reader

Abstract

The application relates to an improved impedance matrix-based space-time network traffic flow prediction method, belonging to the field of traffic evaluation and control. Accurate flow prediction in advance can provide basic data for decision-making of traffic management and control, and is beneficial to improving the management and control ability and efficiency. On the one hand, the existing method mainly trains a prediction model through historical data of a traffic node detector, ignores the spatial relationship between nodes, and leads to a certain gap between the prediction results of different nodes and the actual situation. On the other hand, the existing prediction is insufficient in mining the correlation of long-time flow data, and often cannot complete the prediction task of a long-time granularity, so that the long-time flow prediction is inaccurate. The patent constructs the basic spatial relationship of historical data, combines the traffic impedance matrix to describe the spatial relationship between nodes in a road network in real time, and describes the time correlation of a longer time through the STTN network deep learning model, so that the accuracy of long-time flow prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of transportation planning and management research, and proposes an improved spatiotemporal network traffic flow prediction method based on impedance matrix. Background Technology

[0002] my country's transportation industry is developing rapidly, and accurate traffic forecasting and proactive guidance and intervention are crucial for improving traffic efficiency. Traffic flow forecasting primarily uses traffic data to predict traffic conditions several minutes in the future. The forecast results can be directly sent to traffic management and information systems, allowing transportation departments to understand future traffic conditions, proactively manage traffic flow, avoid congestion, and alleviate traffic pressure. While existing traffic forecasting methods have achieved some success, there is still room for improvement. On the one hand, current methods mainly train prediction models using historical data from traffic node detectors, neglecting the spatial relationships between nodes, leading to discrepancies between predicted and actual results for different nodes. On the other hand, existing forecasts rarely mine correlations in long-term flow data, often failing to complete long-term granular forecasting tasks, resulting in inaccurate long-term flow predictions.

[0003] Therefore, it is of great significance to conduct transportation planning and management to find a more convenient and clear way to depict the spatial relationships between nodes in real time, while ensuring the accuracy of predictions in long-term prediction tasks, so that management departments can carry out more precise management. Summary of the Invention

[0004] To address the aforementioned problems, the purpose of this invention is to propose an improved spatiotemporal network traffic flow prediction method based on impedance matrices. This method constructs basic spatial relationships using historical data, combines the traffic impedance matrix with real-time mapping of spatial relationships between road network nodes, and employs a proposed STTN deep learning network to learn longer-term temporal correlations. This invention provides theoretical support for predicting node traffic flow in traffic networks. To achieve the above objective, this invention adopts the following technical solution:

[0005] Step 1: Introduction to ETC Data and Determination of Road Network Nodes

[0006] This paper uses data obtained from ETC gantries at toll stations on the highway network for research. Therefore, each toll station is equivalent to a network node.

[0007] Since the distances and traffic infrastructure between nodes generally vary, characterizing the spatial and temporal relationships between nodes and incorporating them into traffic flow prediction can effectively improve the model's practicality and prediction accuracy. To extract the spatiotemporal relationships between nodes, the data must at least provide the entry and exit times of vehicles and basic vehicle information. The required data fields are shown in the table below:

[0008] Table 1 Requirements Fields

[0009] Field Name meaning EXSTATIONID The node number corresponding to when the vehicle leaves the node. PASSTIME Vehicle departure time RSTATIONID The node number corresponding to the vehicle entering the node. RPASSTIME Vehicle entry node time VEHICLECLASS Vehicle type

[0010] EXSTATIONID is the node number corresponding to when the vehicle leaves the node, and PASSTIME is the time the vehicle leaves the node; these reflect the relevant attributes of the vehicle leaving. RSTATIONID is the node number corresponding to when the vehicle enters the node, and RPASSTIME is the time the vehicle enters the node; these reflect the relevant attributes of the vehicle entering. VEHICLECLASS is the vehicle type, which reflects the vehicle's own attributes. These attributes are necessary for completing subsequent tasks. To facilitate the extraction and use of subsequent information, we need to sequentially number each node.

[0011] Step 2: Information Extraction Based on Historical Data

[0012] 1. Trip Time Calculation

[0013] Step two mainly extracts the spatial relationships between nodes from historical ETC data. First, relevant calculations are performed on each data point to obtain the travel time between the corresponding nodes.

[0014] t ij =T E -T R ∈TRV ij

[0015] Among them, t ij T is the travel time from toll station i to toll station j. E It's time to leave the tollbooth, T R It's the moment of entering the tollbooth, several t ij Constitutes the set TRV ij .

[0016] 2. Trip Time Clustering

[0017] The trip time data contains some interfering data, such as data from accidents or rest stops by some drivers. This data should not be included in subsequent free-flow trip time calculations and needs to be cleaned. Data cleaning is achieved by clustering the trip time (TRV) sets between each node using k-clusters. First, the optimal number of clusters is determined.

[0018] This paper simultaneously observes the sum of squared errors (SSE) and Davies-Bouldin (DB) to determine the number of clusters. The SSE test ensures the scientific validity of the clustering; SSE is the sum of the squares of all residuals. This paper uses the sum of squared errors to test whether the target number of clusters k can effectively perform the clustering task.

[0019]

[0020] Where k is the number of clusters, C i It is the i-th cluster, and X is the number of clusters assigned to C. i The sample, d(X,C) i Let be the Euclidean distance from the sample to its corresponding cluster center. SSE decreases as the number of clusters increases. In this paper, clustering is considered feasible when the rate of SSE decrease begins to slow. Correspondingly, at this point:

[0021] SSE(k)-SSE(k-1)=ΔSSE(k)≤ΔSSE(k-1)=SSE(k-1)-SSE(k-2)

[0022] Wherein, ΔSSE(k) is the change in SSE at the number of clusters k compared to the number of clusters k-1.

[0023] The rigor of clustering can be ensured by performing the Davies-Bouldin test. The Davies-Bouldin test describes the intra-cluster divergence of samples and the distance between each cluster center. The optimal number of clusters can be determined by the Davies-Bouldin index.

[0024]

[0025] Among them, W i Represents class C i All samples to class C i Average distance from the center; W j C represents j All samples to class C j The average distance from the center, d(C) i C j ) represents class C i Center and Class C j The Euclidean distance between them.

[0026] Calculate and generate plots showing the changes in SSE and DB as a function of the number of categories. After the rate of decrease in SSE begins to slow down, select the number of clusters that minimizes DB.

[0027] After determining the number of clusters, remove clusters that account for less than 5%.

[0028] 3. Calculation of free-flow travel time

[0029] The average of the first α1 segments with the shortest travel times after cleaning is taken as the free-flow travel time. The "Urban Traffic Operation Status Evaluation Standard" stipulates that α1 is 1 / 9. Using α1 as 1 / 9, the free-flow travel time between each node is calculated.

[0030]

[0031]

[0032] Among them, Tval ij It is the set of the first α1 parts from node i to node j. This is the α1 percentile of the travel time after cleaning. t 0ij It is the free-flow travel time from node i to node j.

[0033] Step 3: Constructing a Traffic Database. Traffic data is obtained through processing various devices such as radar data and video data; or by processing existing data to obtain traffic-related data. This article processes the historical data from Step 1 to generate node traffic data.

[0034] The relevant data is processed and summarized by each node and 5-minute interval to form a historical traffic volume database within the research scope.

[0035] Step 4: Establish a traffic forecasting model

[0036] 1. Determination of impedance function

[0037] To characterize the real-time spatial relationships between nodes, this invention employs an impedance function for quantization. The impedance function is defined as follows.

[0038]

[0039] Among them, tt ij It is the impedance value between node i and node j, V i For the hourly traffic flow of node i; C ij The throughput from node i to node j is 2200 pcu / h / ln for high speed; α2 and β are system parameters, where α2 = 0.15 and β = 4.

[0040] 2. Impedance matrix generation

[0041] The impedance values ​​between each node in the road network are calculated, and the impedance values ​​between the nodes are integrated to generate an impedance matrix. The impedance matrix describes the real-time spatial relationship between each node in the overall road network, and is structured as follows.

[0042]

[0043] Where: M = {1,2,...,m} is the set of nodes; z ij Let be the impedance value between node i and node j; A is the traffic impedance matrix containing m nodes. This paper will use the impedance matrix as the input to the graph adjacency matrix in the STTNS network.

[0044] 3. Establish the impedance-STTN model

[0045] The number of output sequences is related to the usage requirements. The number of output sequences is equal to the time interval of the maximum predicted demand in the future. Once determined, the impedance-STTN prediction model is trained and generated.

[0046] Overall, STTN can be divided into three parts: a feature aggregation layer, spatial-temporal blocks, and a prediction layer. The feature aggregation layer is used for basic feature extraction. Each spatial-temporal block contains several spatial-temporal sub-blocks, and each sub-block jointly models spatiotemporal dependencies through a spatial transformer and a temporal transformer, connecting spatiotemporal features at different levels via skip connections. The number of spatial-temporal blocks affects prediction accuracy and is determined through training. The prediction layer uses two 1x1 convolutional layers to aggregate these spatial-temporal features for traffic prediction.

[0047] The feature aggregation layer extracts dG-dimensional features from M consecutive time series from N nodes and aggregates them into a three-dimensional tensor of size . This three-dimensional tensor is then input into a spatiotemporal block. In each spatiotemporal block, a three-dimensional output tensor is generated by superimposing a spatial transformer S and a temporal transformer τ, and passed to the next spatiotemporal block. In the i-th spatiotemporal block, the spatial transformer S receives the incoming node features. Spatial features are extracted by combining the graph adjacency matrix A.

[0048]

[0049] Where A is the impedance matrix generated in the previous part. will with Combined generation Used as input for subsequent time-varying converters.

[0050]

[0051] Generated by time-varying transformer τ

[0052]

[0053] will with Combined generation Enter the l+1 space-time block.

[0054]

[0055] X is obtained in the last space-time block. S It is a size of N×d sτ A two-dimensional tensor, referred to as X SτThe prediction layer will perform a second convolution to generate a prediction result Y for N nodes in the future time period T. Each convolutional layer is a 1*1 convolutional layer.

[0056] Y = Conv(Conv(X) Sτ ))

[0057] The spatial transformer S is composed of a spatiotemporal location embedding layer, a fixed graph convolutional layer, a dynamic graph convolutional layer, and an information fusion gate. The spatiotemporal location embedding layer merges spatiotemporal location information into each node. Then, a fixed graph convolutional layer and a dynamic graph convolutional layer are used to study the stationary and directional dynamic components of spatial dependence, respectively. Finally, the information fusion gate completes the fusion of the dynamic and static features of the space.

[0058] The spatial transformer consists of a spatiotemporal location embedding layer, a fixed graph convolutional layer, a dynamic graph convolutional layer, and an information fusion gate. The spatiotemporal location embedding layer merges spatiotemporal location information into each node. Then, a fixed graph convolutional layer and a dynamic graph convolutional layer are used to study the stationary and directional dynamic components of spatial dependence, respectively. Finally, the information fusion gate completes the fusion of the dynamic and static features of the space.

[0059] The spatiotemporal location embedding layer learns the spatiotemporal features of each node, where the spatial embedding matrix is... The size is N×N. The time embedding matrix is... Its size is M×M. and D is generated by tiling along the space. S With D τ D S With D τ With X S Forming X' S .

[0060] X' S =F t ([X S D S D τ ])

[0061] Among them, F t It is a 1*1 convolutional layer that transforms the cascaded features into a dG-dimensional vector for each node at each time step.

[0062] X' S Spatial feature learning is achieved through fixed-graph convolutional layers and dynamic-graph convolutional layers. In the fixed-graph convolutional layers, Chebyshev polynomial approximation of graph convolution is used to learn node features.

[0063]

[0064] in, Let L be the characteristic of the corresponding structure-aware node, θ be the normalized Laplacian matrix of the graph, θ be the corresponding weight component, k be the order of the corresponding time step, and j be the j-th channel.

[0065] In the dynamic graph convolutional layer, multiple linear mappings are used to model the dynamic spatial dependencies of various factors influencing different potential subspaces. Based on Each node trains three latent subspaces Q. S K S V S Among them, Q S It is a query subspace that is spanned, K S It is the key subspace, V S It is a value subspace.

[0066]

[0067]

[0068]

[0069] in, They are Q S K S V S The weight matrix is ​​used. During training, the model automatically learns the optimal weight parameters to minimize the loss function, and these parameters also change over time.

[0070] Dynamic spatial correlation S S Through Q S K S Perform the calculation.

[0071]

[0072] Node characteristics M S It is calculated by the following formula:

[0073] M S =S S V S

[0074] A shared three-layer feedforward neural network with non-linear activation is applied to each node to further improve the learning-based node feature M. S Prediction. Exploring the interactions between feature channels, using U... S Update M S At the same time, they combine to form

[0075]

[0076]

[0077]

[0078] in, Corresponding to The values ​​are sorted from largest to smallest. After passing through a fixed graph convolutional layer and a dynamic graph convolutional layer, gate g receives... and X G Export

[0079]

[0080] Among them, f S and f G yes and X G A one-dimensional linear projection. Weighted by gate g and X G Received

[0081]

[0082] Ultimately, it consists of M time steps. Merge into Y S Y S With X S Combine to form X τ Input time transformer.

[0083] The time transformer τ is composed of a spatiotemporal location embedding layer and a dynamic graph convolutional layer. The spatiotemporal location embedding layer incorporates spatiotemporal location information into each node, and then a dynamic graph convolutional layer is used to study the stationary and directional dynamics of time dependence, thereby completing the extraction of dynamic features of time.

[0084] The spatiotemporal location embedding layer learns the spatiotemporal features of each node, where the temporal embedding matrix is... Its size is M×M. D is generated by tiling along the space. τ D τ With X τ Forming X' τ .

[0085] X' τ =G t ([X τ D τ ])

[0086] Among them, G t It is a 1x1 convolutional layer. In the dynamic graph convolutional layer, multiple linear mappings are used to model the dynamic orientation and temporal dependencies of various factors in various latent subspaces. Based on... Each node trains three latent subspaces Q. τ K τ V τ Among them, Q τ It is a query subspace that is spanned, K τ It is the key subspace, V τ It is a value subspace.

[0087]

[0088]

[0089]

[0090] in, They are Q τ K τ V τ The weight matrix is ​​used. During training, the model automatically learns the optimal weight parameters to minimize the loss function, and these parameters also change over time.

[0091] Dynamic spatial correlation S τ Through Q τ K τ Perform the calculation.

[0092]

[0093] Node characteristics M τ It is calculated by the following formula:

[0094] M τ =S τ V τ

[0095] A shared three-layer feedforward neural network with non-linear activation is applied to each node to further improve the learning-based node feature M. S Prediction. Exploring the interactions between feature channels, using U... τ Update M τ At the same time, they combine to form

[0096]

[0097]

[0098]

[0099] in, Corresponding to The values ​​are then sorted from largest to smallest. Finally, the results are from N nodes. Merge into Yτ Y τ With X τ Combine to form X S Pass it to the next space-time block.

[0100] Step 5: Real-time Data Acquisition and Processing

[0101] 1. Traffic data generation

[0102] The number of sequences used for prediction is the same as that used for training, so a certain amount of relevant continuous data needs to be saved for later use during actual prediction. The maximum number of sequences to be saved is determined based on the model parameters in step four. Real-time traffic data can be obtained through processing of various devices such as radar data and video data; or traffic data can be generated by processing ETC data. The number of traffic data to be saved is equal to the number of continuous sequences.

[0103] 2. Real-time impedance matrix generation

[0104] The saved flow data is used to generate a real-time impedance matrix according to steps 1 and 2 in step four.

[0105] 3. Generation of forecast demand data

[0106] The saved flow data and the generated impedance matrix are used as input data for prediction.

[0107] Step Six: Perform flow prediction for the corresponding time period. Using the data obtained in Step Five as input, apply it to the trained impedance-STTN model. The output result is the flow prediction for the future continuous time series. Summate the future results according to the prediction requirements.

[0108]

[0109] Where Flow Dre This is the predicted flow over the future duration of Dre, where mint is the time interval and flow is the predicted flow. i It is the i-th value in the predicted result sequence. Attached Figure Description

[0110] Figure 1 Invention Flowchart

[0111] Figure 2 SSE variation with number of clusters

[0112] Figure 3 DB variation with number of clusters

[0113] Figure 4 STTN Overall Structure Diagram

[0114] Figure 5 S-structure diagram of space transformer

[0115] Figure 6 Time transformer τ structure diagram Detailed Implementation

[0116] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0117] The flowchart of this invention is as follows Figure 1 As shown, this method mainly consists of six steps: 1. ETC data introduction and road network node determination; 2. Information extraction based on historical data; 3. Construction of a traffic flow database; 4. Establishment of a traffic flow prediction model; 5. Real-time data collection and processing; 6. Traffic flow prediction for corresponding time periods. Step 1 defines the research boundaries and ensures the smooth operation of subsequent steps. Step 2 extracts attributes related to spatial correlation between nodes from historical data. Step 3 constructs a traffic flow database for temporal correlation extraction. Step 4 generates an impedance matrix based on the results of steps 2 and 3 and trains the model by combining the impedance matrix with traffic flow. Step 5 extracts data in real time. Step 6 makes predictions based on the real-time data from step 5 and the model from step 4, predicting the traffic flow at each node of the road network for corresponding time periods.

[0118] The specific calculation process of this invention is described below.

[0119] The specific execution steps are as follows:

[0120] Step 1: Introduction to ETC Data and Determination of Road Network Nodes

[0121] This article uses data obtained from ETC gantries at toll stations on the highway network for demonstration. Here, the toll station is abstracted as a network node.

[0122] To extract the spatiotemporal relationships between nodes, the data must at least provide the vehicle's entry and exit times and basic vehicle information. In the ETC gantry data used in this paper, each ETC data entry corresponds to all relevant data for a vehicle passing through the highway. The corresponding fields of the data obtained from the ETC gantry are as follows:

[0123] Table 2 Example of ETC gantry data fields

[0124] Field Name meaning ID Data ID, a unique ID corresponding to each data entry. STADATE Start time of the day EXROADID Exit toll station corresponding road section number EXSTATIONID Exit toll station corresponding number VEHICLECLASS Vehicle type detection at exit toll station DEALTYPE Exit toll station inspection transaction type PASSTIME Time for vehicles to pass through the exit toll station VEHICLELICENSE License plate number inspection at exit toll station RVEHICLECLASS Vehicle type detection at entrance toll station RDEALTYPE Entrance toll station detects transaction type RROADID Road segment number corresponding to the entrance toll station RSTATIONID Entrance toll station corresponding number RPASSTIME Time for vehicles to pass through the entrance toll station RVEHICLELICENSE Vehicle license plate detection at entrance toll station SPECIALLICENSE Special License TOTALWEIGHT gross weight OVERRATE Overweight percentage OVERTYPE Overweight type VEHICLEAXIS Vehicle axle

[0125] As can be seen, the ETC gantry data meets the data quality requirements. Each toll station is sequentially numbered using "1", "2", "3", etc. With a total of N toll stations in this road network, there are N nodes, facilitating subsequent use.

[0126] Step 2: Information Extraction Based on Historical Data

[0127] 1. Trip Time Calculation

[0128] Step two mainly extracts the spatial relationships between nodes from historical data. First, relevant calculations are performed on each data point to obtain the travel time between the corresponding nodes.

[0129] t ij =T E -T R ∈TRV ij

[0130] Among them, t ij T is the travel time from toll station i to toll station j. E It's time to leave the tollbooth, T R It's the moment of entering the tollbooth, several t ij Constitutes the set TRV ij .

[0131] For example, a vehicle's entry node number is 1, RPASSTIME: 2018 / 8 / 2023:29:42, and its corresponding exit node number is 2, PASSTIME: 2018 / 8 / 210:01:58. The calculated travel time is 3376 seconds.

[0132] 2. Trip Time Clustering

[0133] The trip time data contains some interfering data, such as data from accidents or rest stops by some drivers. This data should not be included in subsequent free-flow trip time calculations and needs to be cleaned. Data cleaning is achieved by clustering the trip time (TRV) sets between each node using k-clusters. First, the optimal number of clusters is determined.

[0134] The k-means clustering algorithm is an iterative clustering analysis algorithm. Its steps are as follows: First, the data is pre-divided into K groups. Then, K objects are randomly selected as initial cluster centers. Next, the distance between each object and each seed cluster center is calculated, and each object is assigned to the nearest cluster center. The cluster centers and the objects assigned to them represent a cluster. Each time a sample is assigned, the cluster centers are recalculated based on the existing objects in the cluster. This process is repeated until a certain termination condition is met.

[0135] The steps of the K-means algorithm:

[0136] 1. Select k initial samples as initial cluster centers;

[0137] μ1,μ2,μ 3,..., μk ∈R n

[0138] 2. For each sample x in the dataset i Calculate its distance to the k cluster centers and assign it to the class corresponding to the cluster center with the smallest distance;

[0139] c (i) =argmin||x (i) -μ j || 2

[0140] 3. For each category, recalculate its cluster center, which is the centroid of all samples belonging to that category;

[0141]

[0142] 4. Repeat steps 2 and 3 above until the number of clusters reaches 20.

[0143] This paper simultaneously observes the sum of squared errors (SSE) and Davies-Bouldin (DB) to determine the number of clusters. The SSE test ensures the scientific validity of the clustering; SSE is the sum of the squares of all residuals. This paper uses the sum of squared errors to test whether the target number of clusters k can effectively perform the clustering task.

[0144]

[0145] Where k is the number of clusters, C i It is the i-th cluster, and X is the number of clusters assigned to C. i The sample, d(X,C) i Let be the Euclidean distance from the sample to its corresponding cluster center. SSE decreases as the number of clusters increases. In this paper, clustering is considered feasible when the rate of SSE decrease begins to slow. Correspondingly, at this point:

[0146] SSE(k)-SSE(k-1)=ΔSSE(k)≤ΔSSE(k-1)=SSE(k-1)-SSE(k-2)

[0147] Wherein, ΔSSE(k) is the change in SSE at the number of clusters k compared to the number of clusters k-1.

[0148] The rigor of clustering can be ensured by performing the Davies-Bouldin test. The Davies-Bouldin test describes the intra-cluster divergence of samples and the distance between each cluster center. The optimal number of clusters can be determined by the Davies-Bouldin index.

[0149]

[0150] Among them, Wi Represents class C i All samples to class C i Average distance from the center; W j C represents j All samples to class C j The average distance from the center, d(C) i C j ) represents class C i Center and Class C j The Euclidean distance between them.

[0151] Calculate and generate plots showing the changes in SSE and DB as a function of the number of categories. After the rate of decrease in SSE begins to slow down, select the number of clusters that minimizes DB.

[0152] After determining the number of clusters, remove clusters that account for less than 5%.

[0153] Assuming the clustering results between two nodes are shown in Table 3, it can be seen from the table that the proportion of categories 3, 4, 5 and 6 is extremely small, so this part of the data is removed.

[0154] Table 3 shows the clustering results.

[0155]

[0156] 3. Calculation of free-flow travel time

[0157] The average of the first α1 segments with the shortest travel times after cleaning is taken as the free-flow travel time. The "Urban Traffic Operation Status Evaluation Standard" stipulates that α1 is 1 / 9. Using α1 as 1 / 9, the free-flow travel time between each node is calculated.

[0158]

[0159]

[0160] Among them, Tval ij It is the set of the first α1 parts from node i to node j. This is the α1 percentile of the travel time after cleaning. t 0ij It is the free-flow travel time from node i to node j.

[0161] If the travel time after cleaning is: 1740, 1750, 1760, 1770, 1780, 1790, 1800, 1810, 1820, 1830, 1840, 1850, 1860, 1870, 1880, 1890, 1900, 1910 (seconds), then the calculated free-flow travel time is 1745 seconds.

[0162] Step 3: Build a traffic database to process ETC data and obtain traffic-related data. This article processes the historical data from Step 1 to generate node traffic data.

[0163] The relevant data were processed, and the vehicle entry time was summarized and statistically analyzed according to each node and 5-minute intervals to form a historical traffic volume database within the research scope. Table 4 shows the traffic volume database with 5-minute intervals.

[0164] Table 45-minute interval database

[0165]

[0166]

[0167] In this database, `flow_id` is an automatically generated sequential sequence, `STATIONID` is the vehicle entry node, `id` is the data source file reflecting the record time of that row of data, `time_nodate_index` is the time sequence number (a day has 1440 minutes; when statistics are calculated at 5-minute intervals, the sequence number starts from 0:00 to 0:05 and is sequentially arranged as 1, and from 23:55 to 24:00 it is 288). `time_nodate_index` reflects the time interval of this row of data, and `flow` is the number of vehicles counted in the corresponding time interval. After each update, the traffic database is reorganized according to `id` and `time_nodate_index` for easy subsequent use.

[0168] Step 4: Establish a traffic forecasting model

[0169] 1. Determination of impedance function

[0170] To characterize the real-time spatial relationships between nodes, this invention uses an impedance function for quantification. The impedance matrix reflects the difficulty of passage between nodes and can reflect the spatial correlation within the road network. The impedance function is defined as follows.

[0171]

[0172] Among them, tt ij It is the impedance value between node i and node j, V i For the hourly traffic flow of node i; C ij The throughput from node i to node j is 2200 pcu / h / ln for high speed; α2 and β are system parameters, where α2 = 0.15 and β = 4.

[0173] Substitute the t obtained in step three 0ij By analyzing the flow rate at the corresponding time, the impedance value between nodes at that time can be calculated.

[0174] 2. Impedance matrix generation

[0175] The impedance values ​​between each node in the road network are calculated, and the impedance values ​​between the nodes are integrated to generate an impedance matrix. The impedance matrix describes the real-time spatial relationship between each node in the overall road network, and is structured as follows.

[0176]

[0177] Where: M = {1,2,...,m} is the set of nodes; z ij Let be the impedance value between node i and node j; A is the traffic impedance matrix containing m nodes. This paper will use the impedance matrix as the input to the graph adjacency matrix in the STTNS network.

[0178] 3. Establish the impedance-STTN model

[0179] The impedance matrix is ​​input into the spatial transformer of the STTN model. Traffic flow data is input into the feature aggregation layer of the STTN model according to time series, and the model is trained to predict traffic flow within the time period of the greatest future predicted demand. The hyperparameter with the smallest training error is selected for use. The number of output sequences is related to the demand; it equals the time period of the greatest future predicted demand divided by the time interval. Once determined, the impedance-STTN prediction model is generated. Overall, STTN can be divided into three parts: the feature aggregation layer, the spatial-temporal blocks, and the prediction layer. The feature aggregation layer is used for basic feature extraction. The spatial-temporal blocks contain several spatial-temporal blocks. Each spatial-temporal block jointly models the spatiotemporal dependencies through a spatial transformer and a temporal transformer, connecting the spatiotemporal features at each level through skip connections. The number of spatial-temporal blocks affects the prediction accuracy and is determined through training. The prediction layer uses two 1*1 convolutional layers to aggregate these spatial-temporal features for traffic prediction.

[0180] The feature aggregation layer extracts dG-dimensional features from M consecutive time series from N nodes and aggregates them into a three-dimensional tensor of size . This three-dimensional tensor is then input into a spatiotemporal block. In each spatiotemporal block, a three-dimensional output tensor is generated by superimposing a spatial transformer S and a time transformer τ, and passed to the next spatiotemporal block. In the i-th spatiotemporal block, the spatial transformer S receives the transmitted node features and combines them with the real-time impedance matrix to extract the spatial features.

[0181]

[0182] Where A is the impedance matrix generated in the previous part. will with Combined generation Used as input for subsequent time-varying converters.

[0183]

[0184] Generated by time-varying transformer τ

[0185]

[0186] will with Combined generation Enter the l+1 space-time block.

[0187]

[0188] X is obtained in the last space-time block. S It is a size of N×d sτ A two-dimensional tensor, referred to as X Sτ The prediction layer will perform a second convolution to generate a prediction result Y for N nodes in the future time period T. Each convolutional layer is a 1*1 convolutional layer.

[0189] Y = Conv(Conv(X) Sτ ))

[0190] The spatial transformer S is composed of a spatiotemporal location embedding layer, a fixed graph convolutional layer, a dynamic graph convolutional layer, and an information fusion gate. The spatiotemporal location embedding layer merges spatiotemporal location information into each node. Then, a fixed graph convolutional layer and a dynamic graph convolutional layer are used to study the stationary and directional dynamic components of spatial dependence, respectively. Finally, the information fusion gate completes the fusion of the dynamic and static features of the space.

[0191] The spatial transformer consists of a spatiotemporal location embedding layer, a fixed graph convolutional layer, a dynamic graph convolutional layer, and an information fusion gate. The spatiotemporal location embedding layer merges spatiotemporal location information into each node. Then, a fixed graph convolutional layer and a dynamic graph convolutional layer are used to study the stationary and directional dynamic components of spatial dependence, respectively. Finally, the information fusion gate completes the fusion of the dynamic and static features of the space.

[0192] The spatiotemporal location embedding layer learns the spatiotemporal features of each node, where the spatial embedding matrix is... The size is N×N. The time embedding matrix is... Its size is M×M. and D is generated by tiling along the space. S With D τ D S With D τ With X S Forming X' S .

[0193] X' S =F t ([X S D S D τ ])

[0194] Among them, F t It is a 1*1 convolutional layer that transforms the cascaded features into a dG-dimensional vector for each node at each time step.

[0195] X' S Spatial feature learning is achieved through fixed-graph convolutional layers and dynamic-graph convolutional layers. In the fixed-graph convolutional layers, Chebyshev polynomial approximation of graph convolution is used to learn node features.

[0196]

[0197] in, Let L be the characteristic of the corresponding structure-aware node, θ be the normalized Laplacian matrix of the graph, θ be the corresponding weight component, k be the order of the corresponding time step, and j be the j-th channel.

[0198] In the dynamic graph convolutional layer, multiple linear mappings are used to model the dynamic spatial dependencies of various factors influencing different potential subspaces. Based on Each node trains three latent subspaces Q. S K S V S Among them, Q S It is a query subspace that is spanned, K S It is the key subspace, V S It is a value subspace.

[0199]

[0200]

[0201]

[0202] in, They are Q S K S V S The weight matrix.

[0203] Dynamic spatial correlation S S Through Q S K S Perform the calculation.

[0204]

[0205] Node characteristics M SIt is calculated by the following formula:

[0206] M S =S S V S

[0207] A shared three-layer feedforward neural network with non-linear activation is applied to each node to further improve the learning-based node feature M. S Prediction. Exploring the interactions between feature channels, using U... S Update M S At the same time, they combine to form

[0208]

[0209]

[0210]

[0211] After passing through a fixed graph convolutional layer and a dynamic graph convolutional layer, gate g receives... and X G Export

[0212]

[0213] Among them, f S and f G yes and X G A one-dimensional linear projection. Weighted by gate g and X G Received

[0214]

[0215] Ultimately, it consists of M time steps. Merge into Y S Y S With X S Combine to form X τ Input time transformer.

[0216] The time transformer τ is composed of a spatiotemporal location embedding layer and a dynamic graph convolutional layer. The spatiotemporal location embedding layer incorporates spatiotemporal location information into each node, and then a dynamic graph convolutional layer is used to study the stationary and directional dynamics of time dependence, thereby completing the extraction of dynamic features of time.

[0217] The spatiotemporal location embedding layer learns the spatiotemporal features of each node, where the temporal embedding matrix is... Its size is M×M. D is generated by tiling along the space.τ D τ With X τ Forming X' τ .

[0218] X' τ =G t ([X τ D τ ])

[0219] In the dynamic graph convolutional layer, multiple linear mappings are used to model the dynamic orientation and temporal dependence of the influence of various factors in various potential subspaces. Based on Each node trains three latent subspaces Q. τ K τ V τ .

[0220] Among them, Q τ It is a query subspace that is spanned, K τ It is the key subspace, V τ It is a value subspace.

[0221]

[0222]

[0223]

[0224] in, They are Q τ K τ V τ The weight matrix.

[0225] Dynamic spatial correlation S τ Through Q τ K τ Perform the calculation.

[0226]

[0227] Node characteristics M τ It is calculated by the following formula:

[0228] M τ =S τ V τ

[0229] A shared three-layer feedforward neural network with non-linear activation is applied to each node to further improve the learning-based node feature M. S Prediction. Exploring the interactions between feature channels, using U... τ Update M τ At the same time, they combine to form

[0230]

[0231]

[0232]

[0233] Ultimately, it consists of N nodes. Merge into Y τ Y τ With X τ Combine to form X S Pass it to the next space-time block.

[0234] The STTN model has many hyperparameters, and different parameter settings have a certain impact on the model's performance. Therefore, it is necessary to optimize the model's hyperparameters to improve its predictive ability. Adjusting the model parameters and testing them, then selecting the parameters with the smallest mean absolute error (MAE) is recommended.

[0235]

[0236] Where measured i This is the estimated traffic volume measured in the i-th measurement. i This is the i-th estimated traffic volume. N is the total count. The main parameter fields and their values ​​are listed in Table 5.

[0237] Table 5 Model Parameter Settings

[0238] Parameter name Parameter meaning Value in_channels Number of input channels 1,2,3 embed_size Transformer channel count 32,64,128 num_layers Spatial-temporalblock stacking layers 2,3,4 T_dim Input time dimension 7,8,...,14 output_T_dim Output time dimension 6

[0239] The maximum prediction time required in this paper is 30 minutes, with a time interval of 5 minutes, resulting in an output time dimension of 6.

[0240] Step 5: Real-time Data Acquisition and Processing

[0241] 1. Traffic data generation

[0242] The number of sequences used for prediction is the same as that used for training, so a certain amount of relevant continuous data needs to be saved for later use during actual prediction. The maximum number of sequences to be saved is determined based on the model parameters in step four. Real-time traffic data can be obtained through processing of various devices such as radar data and video data; or traffic data can be generated by processing ETC data. The number of traffic data to be saved is equal to the number of continuous sequences.

[0243] The amount of data to be saved is based on the parameters determined in step four. For example, if the input time dimension is 12, then 12 consecutive time series data should be saved during processing.

[0244] 2. Real-time impedance matrix generation

[0245] The saved flow data is used to generate a real-time impedance matrix according to steps 1 and 2 in step four.

[0246] 3. Generation of forecast demand data

[0247] The saved flow data and the generated impedance matrix are used as input data for prediction.

[0248] Step 6: Perform traffic prediction for the corresponding duration.

[0249] The data obtained in step five is used as input to the trained impedance-STTN model, and the output is the future continuous time series flow forecast. The future results are then summed according to the forecast requirements.

[0250]

[0251] Where Flow Dre This is the predicted flow over the future duration of Dre, where mint is the time interval and flow is the predicted flow. i It is the i-th value in the predicted result sequence.

[0252] For example, if the time interval in this article is 5 minutes, to predict 15 minutes of data, the first three predicted values ​​of the future in the prediction sequence are summed; to predict 30 minutes of data, the first six predicted values ​​of the future in the prediction sequence are summed.

[0253] This paper uses historical data for testing. Ten days of data were used for model training, and two days of data were used for testing. The test data was not used for model training. Accuracy was assessed at 5 minutes, 15 minutes, and 30 minutes. The test results are shown in Table 6.

[0254] Table 6. Flow prediction accuracy of the model at different durations

[0255] Predicted duration MSE RMSE MAE MAPE (%) R2 5 minutes 27.652 5.258 3.889 4.380 0.990 15 minutes 366.412 19.141 13.857 6.051 0.985 30 minutes 1512.169 38.886 28.967 6.270 0.985

[0256] The overall prediction accuracy of the model presented in this paper remains at a good level. As can be seen from the table, the model not only exhibits good prediction accuracy for short durations but also demonstrates relatively good prediction accuracy for long-term forecasts, thus fulfilling the task of traffic flow prediction. The method of this invention proposes a way to extract free-flow travel time from data, while fully utilizing the spatial characteristics between nodes obtained from the data by leveraging the impedance matrix. Furthermore, it employs a high-precision STTN model to extract the temporal characteristics of traffic flow over long periods, thereby completing the traffic flow prediction task more conveniently and clearly. Experimental data demonstrates that, in tests using two days of data, the method achieves 95.62%, 93.95%, and 93.73% accuracy in predicting the next 5 minutes, 15 minutes, and 30 minutes, respectively.

[0257] Compared with previous methods, the beneficial effects of this invention are: First, this invention extracts real-time spatial information related to nodes in the road network from historical data, solving the problems of high difficulty, high cost, and inaccuracy in obtaining information between nodes in the past, while better reflecting the real-time changes in the spatial relationship between nodes; Second, this invention can ensure sufficient accuracy in long-term prediction, and solves the problem of traffic flow prediction for nodes in the road network by using a pre-established model and real-time traffic data.

[0258] Based on the above characteristics, the method of the present invention provides theoretical support for the prediction of node traffic flow in traffic networks, and the prediction results have high accuracy.

Claims

1. An improved spatiotemporal network traffic flow prediction method based on impedance matrix, characterized in that, The process includes the following steps: Step 1: Introduction to ETC Data and Determination of Road Network Nodes The research will be conducted using data obtained from ETC gantries at toll stations on the highway network; each toll station is equivalent to a node in the road network. To extract the spatiotemporal relationships between nodes, the data must at least provide the vehicle's entry and exit times and basic vehicle information. The required data fields are: EXSTATIONID is the node number corresponding to when the vehicle leaves the node, and PASSTIME is the time when the vehicle leaves the node; they reflect the relevant attributes of the vehicle leaving. RSTATIONID is the node number corresponding to when the vehicle enters the node, and RPASSTIME is the time when the vehicle enters the node; they reflect the relevant attributes of the vehicle entering. VEHICLECLASS is the vehicle type, which reflects the attributes of the vehicle itself. Each node is sequentially numbered. Step 2: Information Extraction Based on Historical Data 1) Trip Time Calculation Step 2: Extract the spatial relationships between nodes from historical ETC data; first, perform relevant calculations on each data point to obtain the travel time between the corresponding nodes; in, This refers to the travel time from toll station i to toll station j. It's time to leave the tollbooth. It's the moment of entering the tollbooth, several Form a set ; 2) Trip Time Clustering The travel time data contains some interfering data, which will not be included in the subsequent free-flow travel time calculation. This data is cleaned by clustering the travel time set TRV between each node using k-clustering. First, the optimal number of clusters is determined. Simultaneously observe the sum of squared errors (SSE) of the clusters and the Davies-Bouldin (DB) error to determine the number of clusters. The scientific validity of the clustering can be ensured by testing the SSE, which is the sum of the squares of all residuals. The sum of squared errors is used to test whether the target number of clusters k can complete the clustering work. Where k is the number of clusters, It is the i-th cluster, and X is the number of clusters to which it is assigned. The sample, The SSE is the Euclidean distance from the sample to its corresponding cluster center; the SSE decreases as the number of clusters increases, and clustering is performed when the rate of decrease in SSE begins to slow down; correspondingly, at this time: in, This represents the change in SSE at the number of clusters k compared to the number of clusters k-1; The rigor of clustering is ensured by the DB test. The Davies-Bouldin test describes the intra-cluster divergence of samples and the distance between each cluster center. The optimal number of clusters is determined by the DB index. in, Representation Class All samples to class Average distance from the center; express All samples to class Average distance from the center Representation Class Center and Class The Euclidean distance between them; Calculate and generate plots showing the changes in SSE and DB as a function of the number of categories; after the rate of decrease in SSE begins to decrease, select the number of clusters that minimizes DB. After determining the number of clusters, remove clusters that account for less than 5% of the total. 3) Calculation of free-flow travel time Take the data with the shortest travel time after cleaning. The average value of the portion is used as the free-flow travel time; regulations stipulate Take 1 / 9; Take 1 / 9 of the free-flow travel time between each node; in, It starts from node i and goes to the previous node j. Partial set, This is the first step in the journey after cleaning. percentile; It is the free-flow travel time from node i to node j; Step 3: Build a traffic database Traffic data is obtained through radar data and video data processing; historical data from step one is processed to generate node traffic data; The relevant data were processed and summarized and statistically analyzed according to each node and 5-minute intervals to form a historical traffic volume database within the research scope; Step 4: Establish a traffic forecasting model 4.1 Determination of Impedance Function To characterize the real-time spatial relationships between nodes, an impedance function is used for quantization; the impedance function is defined as follows; in, It is the impedance value between node i and node j. This represents the hourly traffic flow from node i. The throughput from node i to node j is 2200 pcu / h / ln for high speed. , Here are the system parameters, where, ; 4.2 Impedance Matrix Generation Calculate the impedance values ​​between each node in the road network, integrate the impedance values ​​between the nodes to generate an impedance matrix, which describes the real-time spatial relationship between each node in the overall road network, and is structured as follows; Where M = {1, 2, ..., m} is the set of nodes; It is the impedance value between node i and node j; It is a traffic impedance matrix containing m nodes; the impedance matrix will be used as the input to the graph adjacency matrix in the STTNS network; 4.3 Establishing the Impedance-STTN Model The number of output sequences is related to the usage requirements. The number of output sequences is equal to the maximum predicted demand time / time interval in the future. Once determined, the impedance-STTN prediction model is trained and generated. Overall, STTN is divided into three parts: a feature aggregation layer, spatial-temporal blocks, and a prediction layer. The feature aggregation layer is used for basic feature extraction. The spatial-temporal blocks contain several spatial-temporal blocks, and each spatial-temporal block jointly models spatiotemporal dependencies through a spatial transformer and a temporal transformer, connecting spatiotemporal features at each level through skip connections. The number of spatial-temporal blocks affects the prediction accuracy, and the specific number is determined through training. The prediction layer uses two 1*1 convolutional layers to aggregate these spatial-temporal features for traffic prediction. The feature aggregation layer extracts dG-dimensional features from M consecutive time series from N nodes and aggregates them into a three-dimensional tensor of size . This three-dimensional tensor is then input into a spatiotemporal block. In each spatiotemporal block, a three-dimensional output tensor is generated by superimposing a spatial transformer S and a temporal transformer τ, and passed to the next spatiotemporal block. In the i-th spatiotemporal block, the spatial transformer S receives the incoming node features. Spatial features are extracted by combining the graph adjacency matrix A. ; Where A is the impedance matrix generated in the previous part; will with Combined generation Used as input for subsequent time transformers; After time changer generate ; will with Combined generation Enter Space-time blocks; Obtained in the last space-time block It is a size of Two-dimensional tensor, which is called The prediction layer will perform a second convolution to generate a prediction result Y for N nodes in the future time T; where each convolutional layer is a 1*1 convolutional layer. Among them, space transformer It consists of a spatiotemporal location embedding layer, a fixed graph convolutional layer, a dynamic graph convolutional layer, and an information fusion gate. The spatiotemporal location embedding layer merges spatiotemporal location information into each node. Then, a fixed graph convolutional layer and a dynamic graph convolutional layer are used to study the stationary and directional dynamic components of spatial dependence, respectively. Finally, the information fusion gate is used to complete the fusion of dynamic and static features of space. The spatial transformer is composed of a spatiotemporal location embedding layer, a fixed graph convolutional layer, a dynamic graph convolutional layer, and an information fusion gate. The spatiotemporal location embedding layer merges spatiotemporal location information into each node. Then, a fixed graph convolutional layer and a dynamic graph convolutional layer are used to study the stationary and directional dynamic components of spatial dependence, respectively. Finally, the information fusion gate is used to complete the fusion of the dynamic and static features of the space. The spatiotemporal location embedding layer learns the spatiotemporal features of each node, where the spatial embedding matrix is... Size is The time embedding matrix is Size is and Generated by tiling along space and , and and form ; in, It is a 1*1 convolutional layer that transforms the cascaded features into a dG-dimensional vector for each node at each time step; Spatial features are learned in both fixed-graph convolutional layers and dynamic-graph convolutional layers; in the fixed-graph convolutional layer, Chebyshev polynomial approximation graph convolution is used to learn node features. in, The corresponding structure-aware node characteristics; L is the normalized Laplacian matrix of the graph. For the corresponding weight part, k is the order of the corresponding time step, and j is the j-th channel; In the dynamic graph convolutional layer, multiple linear mappings are used to model the dynamic spatial dependencies of various factors in different potential subspaces; based on Each node trains three potential subspaces. , , ;in, It is a query subspace that is spanned. It is the key subspace. It is a value subspace; in, , , They are , , The weight matrix; during training, the model automatically learns the optimal weight parameters to minimize the loss function, and these parameters also change over time. Dynamic spatial correlation pass , Perform calculations; Node characteristics It is calculated by the following formula: A shared three-layer feedforward neural network with non-linear activation is applied to each node to further improve the learning-based node feature approach. Prediction; exploring the interactions between feature channels, using renew At the same time, they combine to form ; in, Corresponding to , , The corresponding values ​​are sorted from largest to smallest; after passing through a fixed graph convolutional layer and a dynamic graph convolutional layer, gate g receives... and Export ; in, and yes and A one-dimensional linear projection; Weighted by gate g and Received Ultimately, it consists of M time steps. merged into , and Combined to form Input time transformer; Time Transformer It consists of a spatiotemporal location embedding layer and a dynamic graph convolutional layer. The spatiotemporal location embedding layer merges spatiotemporal location information into each node, and then a dynamic graph convolutional layer is used to study the stationary and directional dynamics of time dependence respectively, thus completing the extraction of dynamic features of time. The spatiotemporal location embedding layer learns the spatiotemporal features of each node, where the temporal embedding matrix is... Size is Generated by tiling along space , and form ; in, It is a 1*1 convolutional layer; in the dynamic graph convolutional layer, multiple linear mappings are used to model the dynamic orientation time dependency of various factors in various potential subspaces; based on Each node trains three potential subspaces. , , ;in, It is a query subspace that is spanned. It is the key subspace. It is a value subspace; in, , , They are , , The weight matrix; during training, the model automatically learns the optimal weight parameters to minimize the loss function, and these parameters also change over time. Dynamic spatial correlation pass , Perform calculations; Node characteristics It is calculated by the following formula: A shared three-layer feedforward neural network with non-linear activation is applied to each node to further improve the learning-based node feature approach. Prediction; exploring the interactions between feature channels, using renew At the same time, they combine to form ; in, Corresponding to , , The values ​​are then sorted from largest to smallest; ultimately, the results are from N nodes. merged into , and Combined to form Pass it to the next space-time block; Step 5: Real-time Data Acquisition and Processing 5.1 Traffic Data Generation The number of sequences used in prediction is the same as that used in training, so a certain amount of relevant continuous data needs to be saved for subsequent use when performing actual prediction operations; determine the maximum number of sequences to be saved based on the model parameters in step four; obtain real-time traffic data through radar data and video data processing; or generate traffic data through ETC data processing, and the number of traffic data to be saved is equal to the number of continuous sequences; 5.2 Real-time Impedance Matrix Generation Generate a real-time impedance matrix from the saved flow data according to steps 4.1 and 4.2 in step four; 5.3 Generation of Forecasted Demand Data The saved flow data and the generated impedance matrix are used as the input data for prediction; Step 6: Perform traffic prediction for the corresponding duration. The data obtained in step five is used as input to the trained impedance-STTN model, and the output is the future continuous time series flow prediction result; the future results are summed according to the prediction needs. in This is the predicted traffic over the future duration of Dre. It is a time interval. It is the i-th value in the predicted result sequence.

Citation Information

Patent Citations

  • High-speed rail passenger flow demand forecasting method based on highway network passenger flow OD estimation technology

    CN108269399A

  • Road segment impedance function determination method, computing device and storage medium

    CN113554878A