Large-scale short-time traffic flow prediction method based on progressive spatio-temporal fusion

By employing a progressive spatiotemporal fusion method, which integrates the temporal and spatial characteristics of traffic flow data using self-attention and large-scale graph embedding techniques, the problem of insufficient spatiotemporal dependence in large-scale traffic flow prediction is solved, resulting in more efficient prediction and more accurate traffic management reference.

CN116386350BActive Publication Date: 2026-04-28ANHUI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI NORMAL UNIV
Filing Date
2023-03-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods fail to adequately integrate spatiotemporal dependent features in large-scale traffic data, incur significant computational overhead, and neglect the influence between distant sensors, resulting in poor prediction performance.

Method used

A progressive spatiotemporal fusion-based approach is adopted, which gradually integrates temporal and spatial features through self-attention and bi-branch cross-attention components. Large-scale graph embedding technology is used to capture the spatial dependence of traffic flow data. A multi-view time series coding module and a progressive spatiotemporal fusion module are constructed to reduce computational overhead and retain more spatiotemporal feature information.

Benefits of technology

It achieves more accurate traffic flow prediction, reduces computational overhead, fully integrates spatiotemporal characteristics, and provides a more accurate reference for urban traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116386350B_ABST
    Figure CN116386350B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on gradual large-scale short-time traffic flow prediction method, comprising: S1, the original data set collected by sensor is obtained, and the original data set is preprocessed;S2, construct based on gradual large-scale short-time traffic flow model, the processed multiple periodic time series data and driving distance adjacency matrix are used as the input of model, and the large-scale short-time traffic flow model is trained;S3, the current traffic data of input is predicted by the obtained model future traffic data.The method is based on the idea of gradual, time characteristics and spatial characteristics are fused by step-by-step fusion to more fully, more fully perform space-time fusion operation, effectively solve the problem of insufficient space-time fusion in existing method in large-scale traffic flow prediction, and greatly reduce the time overhead of calculation and space-dependent modeling;At the same time, the prediction effect is more accurate, can provide more accurate reference for urban traffic management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to traffic flow prediction in intelligent transportation systems, and more specifically, to a method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion. Background Technology

[0002] With rising economic levels, more and more people are using transportation for convenient travel. However, this presents serious challenges to traffic system management, such as frequent traffic congestion and an increasing number of traffic accidents. To enable more proactive and intelligent decision-making and management of traffic systems, various types of sensors have been deployed throughout roads. By collecting traffic data from these sensors, researchers can further compare, analyze, and mine the hidden patterns within the data to predict traffic flow in future timeframes. Large-scale traffic flow forecasting is a major challenge in the field of traffic flow prediction. An increasing number of technologies are designed to accomplish this task, and it is also widely used in navigation systems, traveler information systems, traffic anomaly detection, logistics optimization systems, supply chains, and urban management.

[0003] Traffic flow data exhibits two main characteristics: temporal correlation and spatial correlation. More specifically, traffic flow data varies across the same region at different times, showing a gradual changing trend; while at the same time, traffic flow data changes across different regions exhibit certain similarities, indicating mutual influence between regions. Therefore, the key to accurate traffic flow prediction lies in effectively modeling the spatiotemporal dependence of traffic flow. In fact, scholars have confirmed that traffic flow is highly predictable. Early on, some scholars used traditional statistical methods to model traffic data; however, these methods were only effective for linear data and performed poorly when dealing with complex, nonlinear traffic flow data. Subsequently, some scholars adopted shallow machine learning methods and some deep learning methods to model traffic flow data. While these methods could model the complex temporal dependence of traffic data well, they did not consider the spatial correlation of traffic flow data. After convolutional neural networks achieved remarkable performance in the image domain, some scholars began to treat the spatial topology of traffic networks as images and model the spatial dependence of traffic flow data by embedding convolutional neural networks into the model. However, convolutional neural networks (CNNs) are only suitable for modeling normalized grid networks, and perform poorly in feature extraction for non-Euclidean, high-dimensional, and complex traffic networks. In recent years, an increasing number of researchers have embedded graph convolutional networks (GCNNs) into their models to fit the spatial characteristics of traffic data. Although these GCNN-based models seem reasonable, they perform poorly and are inefficient when predicting traffic flow on large-scale sensor-based traffic networks. Preliminary studies on large-scale traffic flow datasets have revealed that some state-of-the-art methods are highly efficient but have poor performance; others have high performance but are inefficient. The main reasons for this phenomenon are:

[0004] 1) Existing graph convolution-based methods process the adjacency matrix by setting an artificial threshold, filtering out the values ​​between distant sensors and thus ignoring the influence between distant sensors. However, this influence is not negligible in large-scale traffic flow prediction.

[0005] 2) Due to the neglect of the influence between long-distance sensors, existing methods will result in insufficient and incomplete feature fusion when performing spatiotemporal dependencies on large-scale traffic data.

[0006] 3) Graph convolution technology has a lot of computational overhead and complex convolution operations when dealing with the structure of large-scale graphs. More specifically, graph convolutional networks need to traverse a large number of nodes and their neighboring nodes in the topology of large-scale graphs, and also need to perform multi-layer feature extraction and encoding operations, which will cause the time overhead to increase significantly with the increase of graph size. Summary of the Invention

[0007] The purpose of this invention is to provide a method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion. This method is based on the progressive idea, which integrates temporal and spatial features in a more comprehensive and sufficient way. It effectively solves the problem of insufficient spatiotemporal fusion in existing methods for large-scale traffic flow prediction, and significantly reduces the time cost of computation and spatial dependency modeling. At the same time, the prediction effect is more accurate, which can provide a more accurate reference for urban traffic management.

[0008] To achieve the above objectives, the present invention provides a method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion, which includes:

[0009] S1. Obtain the raw dataset collected by the sensors and preprocess the raw dataset to obtain historical traffic data of various periodic patterns and the adjacency matrix of real road driving distance between sensors.

[0010] S2. Construct a large-scale short-term traffic flow model based on progressive spatiotemporal fusion. Use the processed multi-period time series data and driving distance adjacency matrix as input to the model, train the large-scale short-term traffic flow model, and obtain a large-scale short-term traffic flow model with the ability to predict traffic flow in future time periods.

[0011] S3. Using the model obtained in S2, input the current traffic data to predict future traffic data.

[0012] Preferably, the multiple periodic patterns include monthly, weekly, and recent periods, respectively. The historical traffic data includes multiple records, each of which includes: traffic flow within a time period, the date of that time period, and the start and end times of that time period.

[0013] Preferably, for the three types of time series data, the self-attention idea is first used to model them separately to capture their own time dependence information; then, based on the pairwise fusion and serial method, the modeled monthly cycle pattern and weekly cycle pattern are first fused with time features, and the obtained time features are then fused with the recent pattern to extract the final time features of traffic flow data.

[0014] For the driving distance adjacency matrix, the second-order similarity calculation method in large-scale graph embedding technology is used to encode it, and the final spatial features of traffic flow data are calculated.

[0015] Based on the temporal and spatial characteristics of the constructed traffic flow data, a spatiotemporal fusion module based on the progressive approach is used to perform spatiotemporal fusion modeling, and finally, prediction results are generated.

[0016] Preferably, in S1, traffic data for the current time period is collected from the sensors included in the training, and the collected traffic flow data is input into the trained model to perform large-scale short-term traffic flow prediction in order to predict traffic flow information for a future period of time.

[0017] The original dataset contains the street where the sensor is located, its latitude and longitude, and several records. The records cover the data recorded by the sensor within one year, with each record spaced 15 minutes apart. Each traffic record includes the date, time, type of day, number of vehicles passing through the time period, and average speed of vehicles passing through the time period. In addition, the original dataset contains data from thousands of sensors, which constitutes large-scale traffic prediction.

[0018] The original dataset undergoes preprocessing operations, including: preprocessing the original dataset according to monthly, weekly, and recent historical traffic data as the current period, to generate three traffic flow time series data S: monthly, weekly, and current patterns. month S week and S current The dataset is divided into training, validation, and test sets in a 7:1:2 ratio. The latitude and longitude information of each sensor is extracted from the original dataset, and the driving distance between each sensor is calculated by mapping it to the road on the map. The driving distance adjacency matrix D between the sensors is constructed, and the driving distance adjacency matrix D is an asymmetric matrix.

[0019] Preferably, the preprocessing operation on the original dataset includes: extracting the spatial location coordinates of all sensor nodes from the original dataset, and defining the spatial road network topology information as graph G = (V, E, W); where V is the set of all sensor nodes, |V| = N indicates that the total number of sensor nodes is N, E is the set of directed edges of all sensor nodes, and W is the set of weights corresponding to the directed edges.

[0020] By mapping sensor nodes onto a map, the driving distance adjacency matrix D of graph G is calculated, and D is used as the directed edge weight of graph G, i.e., D = W;

[0021] Extract traffic flow data from all sensors in the original dataset, where the traffic flow data observed by sensor station i within time step t is denoted as . Then, within time step t, the traffic flow data observed by all sensor stations is denoted as... The time step t represents a time interval [t, t+Δt], and further constructs three periodic pattern time series within the time step t:

[0022]

[0023]

[0024]

[0025] Where w and m represent the time step of one week and the time step of one month, respectively; finally, the three periodic pattern time series with M time steps are concatenated to obtain and in, Let p represent the set of real numbers, and p represent the length of the time series.

[0026] Preferably, in S2, the input and output variables of the traffic flow prediction model are determined, wherein the input variables include: monthly, weekly and recent historical traffic flow data, and driving distance adjacency matrix D; the output variables include: traffic flow in the future time period corresponding to the sensor.

[0027] The large-scale short-term traffic flow model based on progressive spatiotemporal fusion includes: a multi-view time series encoding module, a spatial knowledge extraction module, and a progressive spatiotemporal fusion module. Three periodic pattern time series are used as inputs to the multi-view time series encoding module, and the driving distance adjacency matrix D is used as input to the spatial knowledge extraction module. The progressive spatiotemporal fusion module fuses the spatiotemporal features of the results from the multi-view time series encoding module and the spatial knowledge extraction module to generate the output.

[0028] The multi-view time series encoding module includes: an initialization operation and two dual-view time series encoding components. The initialization operation initializes a low-dimensional vector TF for each input periodic pattern and embeds it into the corresponding periodic pattern. The dual-view time series encoding components have two input branches and one output branch. Each input branch includes: a self-attention component, a dual-branch cross-attention component, and a feedforward neural network layer. The output branch adds the final results of the two input branches through the feedforward neural network layer as the output result.

[0029] In the multi-view time series encoding module, for input data S month S week and S currentFirst, the monthly and weekly cycle patterns are input into the first dual-view time series encoding component to fuse the time features, resulting in an intermediate variable S that integrates the monthly and weekly cycle time features. temp :

[0030] S temp =FFN(DBCA(SA(S) month ), SA(S week )))+FFN(DBCA(SA(S week ), SA(S month ))),

[0031] Then the intermediate variable S temp With S current The second dual-view time series encoding component is input to fuse time features, and finally the time features (TE) of the traffic flow data are constructed.

[0032] TE = FFN(DBCA(SA(S) temp ), SA(S current )))+FFN(DBCA(SA(S current ), SA(S temp )));

[0033] Where SA(·) represents the computational operation of the self-attention component, DBCA(A, B) represents the computational operation of the dual-branch cross attention component, A and B are its inputs and their positions are interchanged to affect the result, and FFN(·) represents the computational operation of the feedforward neural network layer.

[0034] The spatial knowledge extraction module includes a large-scale graph embedding coding component. This component takes the driving distance adjacency matrix D as input and uses a second-order similarity calculation method to capture the spatial features of traffic flow data. The second-order similarity calculation method first maps each node into two low-dimensional vector representations based on the number of sensor nodes. and And with O=-∑ (i,j)∈E w ij log p(v j |v i The function is used to optimize the data, ultimately extracting the spatial features (GE) of the traffic flow data; where, This represents the representation vector of node f itself. w represents the representation vector of node i when it is a neighbor of other nodes. ij Let E represent the weight from node i to node j, and let E represent the set of all nodes.

[0035] The progressive spatiotemporal fusion module comprises: L cascaded progressive cross-attention components and one feedforward neural network layer; the value of L is related to the dataset. Each progressive cross-attention component includes: one fully connected layer, two progressive cross-attention layers, and two feedforward neural network layers. The progressive spatiotemporal fusion module takes temporal features TE and spatial features GE as input, and after spatiotemporal fusion processing by the L progressive cross-attention components, obtains a fully fused spatiotemporal feature TE. L Without losing generality, we will use TE here. i TE represents the output of the i-th progressive cross-attention component. In particular, when i = 0, TE = TE0.

[0036] In the fully integrated spatiotemporal features TE L Then, it is used as the input to the final feedforward neural network layer based on the progressive spatiotemporal fusion module to produce the final prediction result.

[0037] Preferably, in the self-attention component, the input feature Z is first processed by the input layer regularization network layer to obtain the input Z of the self-attention layer. (1) The self-attention layer will... (1) Mapped into three matrices w q w k and w v , through w q The row vector of each row and w k The similarity is calculated by performing a vector dot product on the column vectors of each column. The results are then subjected to SoftMax calculation to obtain the input features Z. (1) The attention coefficient matrix A, and then through The result Z of the self-attention layer was obtained. (2) Then Z (2) Perform a residual join operation to obtain Z. (3) =Z (2) +Z, finally Z (3) The input is processed by the feedforward neural network layer. Similar to the self-attention layer, there is a regularization network layer before the feedforward neural network layer, followed by a residual connection layer. Similarly, the output Z of the feedforward neural network layer can be obtained. (4) Z (4) =SA(Z); where, without loss of generalization, Z is the input to the self-attention component, which can be S month S week S current or S temp , This represents the matrix cross product.

[0038] Preferably, in the dual-branch cross attention component, the calculation of the low-dimensional vector TF embedded in the initialization operation is the main focus. This vector is designed to store the temporal features of the current mode and participate in the fusion calculation with other periodic modes. Since it is represented by a low-dimensional vector, the time cost of feature fusion can be effectively reduced. After the self-attention component is calculated, the TF vector has learned the temporal features of the current periodic mode.

[0039] After inputting the A and B periodic patterns into the dual-branch attention component, a low-dimensional vector S is first initialized. pos Then embed it into a file that does not contain TF. B B-cycle pattern S B The above is used to capture local position information between sensors in B-cycle mode. A bias algorithm is used to apply this information to a low-dimensional vector S. pos Self-attention operation is performed on the B-cycle pattern to obtain intermediate variables of the B-cycle pattern containing local positional information. Where || represents the matrix concatenation operation, and then the low-dimensional vector TF of the A-periodic pattern is... A and To perform the calculation, first set TF A Mapped to w q matrix, Mapped to w k and w v The matrix, similar to the calculation principle of the self-attention layer in the self-attention component, is first calculated... At this time w q This represents the time characteristics of the A-cycle pattern, w k This represents the temporal characteristics of the B-cycle pattern. The cross-attention coefficient matrix A is obtained by calculating the cross-attention coefficients of the two patterns using the SoftMax function after matrix cross product calculation. AB Then A AB with w v Perform matrix cross product calculation to obtain the fused TF. AB The vector is then subjected to another residual join calculation to convert the TF to a vector. AB With TF A The results are added together and then embedded into the A-cycle pattern as a new TF. A Without loss of generalization, A and B represent the periodic patterns of the input, which can be S. month S week S current or S temp Furthermore, A and B are not equivalent in status.

[0040] Preferably, in the i-th progressive cross-attention component, for the input temporal feature TE i-1 First, it is input into a fully connected layer, its dimensions are aligned with the spatial features GE, and then the aligned temporal features TE are input into the fully connected layer.i-1 Spatiotemporal fusion is performed between the spatial feature GE input and the progressively cross-attention layer to obtain the intermediate variable TG that incorporates spatiotemporal features. i =FFN(PCA(FC(TE) i-1 Considering that progressive fusion may result in information loss, and that each progressive cross-attention component uses the original GE as spatial feature input without needing to compensate for spatial feature fusion loss, while the temporal feature input comes from the output of the previous progressive cross-attention component and may suffer temporal feature loss, in order to preserve more temporal feature information, the input temporal feature TE is... i-1 With the intermediate variable TG that incorporates spatiotemporal features i The input to the second progressive cross-attention layer is further fused to compensate for the fusion loss of temporal features. Each progressive cross-attention layer is followed by a feedforward neural network layer, and finally the calculation result of the i-th progressive cross-attention component is obtained:

[0041] TE i =FFN(PCA(TG) i ,TE i-1 ), i = 1, 2, 3, ...;

[0042] Wherein, FFN(·) represents the computational operation of the feedforward neural network layer, FC(·) represents the computational operation of the fully connected layer, and PCA(·) represents the computational operation of the progressive cross attention layer.

[0043] Preferably, in the progressive cross-attention layer, for input variables A and B, A is mapped to w q Matrix B mapped to w k and w v The matrix is ​​used for calculations similar to those performed in the self-attention layer. Then, a residual connection is performed as the final output, that is: PCA(A,B)=O AB +A; where, without loss of generality, A and B represent input variables, which can be TE. i-1 GE or TG i wait;

[0044] In the fully integrated spatiotemporal features TE L Then, it is used as the input to the last feedforward neural network layer of the progressive spatiotemporal fusion module to generate the final prediction result. The prediction result of the large-scale short-term traffic flow prediction model based on progressive spatiotemporal fusion is as follows:

[0045]

[0046] According to the above technical solution, the dataset is first acquired and preprocessed. The dataset is taken from the raw data collected by the sensors. The raw data includes: the street where the sensor is located, latitude and longitude, and several traffic records. Each traffic record includes the date, time, type of day (weekday, holiday, rainy day, sunny day, etc.), number of vehicles passing through the time period, average speed of vehicles passing through the time period, etc. After acquiring the dataset, it is preprocessed by extracting and expanding information. Periodic data is extracted from the dataset, including historical traffic data with a monthly (28-day) period, historical traffic data with a weekly (7-day) period, and recent data. The expansion operation calculates the driving distance adjacency matrix between each sensor by extracting the latitude and longitude information from the dataset and mapping it onto a map. A large-scale short-term traffic flow model based on progressive spatiotemporal fusion is constructed. The preprocessed periodic data and driving distance adjacency matrix are used as temporal and spatial features and input into the model for training. Traffic flow data at the current moment is collected and input into the trained model to predict traffic flow in the future time period.

[0047] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0048] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof. In the drawings:

[0049] Figure 1 This is a flowchart illustrating the large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion provided by the present invention.

[0050] Figure 2 This is a schematic diagram of the structure of the large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion provided by the present invention;

[0051] Figure 3 This is a schematic diagram of the structure of the dual-view time series encoding component in the large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion provided by the present invention.

[0052] Figure 4 This is a schematic diagram of the progressive cross-attention component in the large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion provided by the present invention. Detailed Implementation

[0053] The specific embodiments of the present invention 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 the present invention.

[0054] See Figure 1 This invention provides a method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion, the method comprising:

[0055] S1. Obtain the raw dataset collected by the sensors and preprocess the raw dataset to obtain historical traffic data of various periodic patterns and the adjacency matrix of real road driving distance between sensors.

[0056] S2. Construct a large-scale short-term traffic flow model based on progressive spatiotemporal fusion. Use the processed multi-period time series data and driving distance adjacency matrix as input to the model, train the large-scale short-term traffic flow model, and obtain traffic flow information for predicting future time periods.

[0057] The S1 includes various periodic patterns, including monthly (28-day), weekly (7-day), and recent periods. Historical traffic data includes multiple records, each containing: traffic flow within a time period, the date of that time period, and the start and end times of that time period.

[0058] S1 specifically includes the following steps:

[0059] S11, Obtain the raw dataset collected by the sensor. The raw dataset contains information such as the street where the sensor is located, latitude and longitude, and several records. The records cover the data recorded by the sensor within one year. Each record is spaced 15 minutes apart. Each traffic flow record includes the date and time of the record, the type of day (weekday, holiday, rainy day, sunny day, etc.), the number of vehicles passing through the time period, and the average speed of the vehicles passing through the time period. In addition, the raw dataset contains data recorded by thousands of sensors. In the field of traffic flow prediction under intelligent transportation systems, it belongs to large-scale traffic prediction.

[0060] S12, perform preprocessing on the original dataset. The preprocessing includes: preprocessing the original dataset according to a monthly (28-day) period, a weekly (7-day) period, and recent historical traffic data as the current period, to generate three traffic flow time series data S: monthly pattern, weekly pattern, and current pattern. month S week and S current The dataset is divided into training, validation, and test sets in a 7:1:2 ratio to train and validate the accuracy of the large-scale traffic flow prediction model. The latitude and longitude information of each sensor is extracted from the original dataset, and the driving distance between each sensor is calculated by mapping it to the roads on the map. The driving distance adjacency matrix D between the sensors is constructed. In order to better reflect objective reality, the driving distance adjacency matrix D is an asymmetric matrix.

[0061] S121. Extract traffic flow data from all sensors from the original dataset and normalize the collected traffic flow data using the max-min normalization method to eliminate the influence of units.

[0062] S122, the normalized traffic flow data is divided into periodic patterns. Within time step t, the traffic flow data observed by sensor station i is denoted as... Then, within time step t, the traffic flow data observed by all sensor stations is denoted as... The time step t represents a time interval [t, t+Δt], and further constructs three periodic pattern time series within the time step t:

[0063]

[0064]

[0065]

[0066] Where w and m represent the time step of a week (7 days) and a month (28 days), respectively. Assuming a time step is 15 minutes, then w = 7 × 24 × (60 / 15), m = 28 × 24 × (60 / 15); finally, the three periodic pattern time series of M time steps are concatenated to obtain and in, Let p represent the set of real numbers, and p represent the length of the time series.

[0067] S123. Extract the spatial location coordinates of all sensor nodes from the original dataset and define the spatial road network topology information as graph G = (V, E, W); where V is the set of all sensor nodes, |V| = N indicates that the total number of sensor nodes is N, E is the set of directed edges of all sensor nodes, and W is the set of weights corresponding to the directed edges; by mapping the sensor nodes onto the map, the driving distance adjacency matrix D of graph G is calculated, and D is used as the weight of the directed edges of graph G, i.e., D = W.

[0068] S13, determine the input and output variables of the traffic flow prediction model. The input variables include: monthly, weekly, and recent historical traffic flow data, as well as the driving distance adjacency matrix D. The output variables include: traffic flow for the corresponding sensor in the future time period.

[0069] In this embodiment, the goal of the large-scale traffic flow prediction method is to construct a function f that, given three periodic patterns at the current time t: monthly, weekly, and recent, can predict traffic flow information at the locations of each sensor over the next q time steps. in, This refers to the traffic flow prediction value of the i-th sensor in the next q time steps.

[0070]

[0071] S2, construct a large-scale short-term traffic flow model based on progressive spatiotemporal fusion, and process the three types of periodic time series data S month ,S week ,S current The driving distance adjacency matrix D is used as input to train the large-scale short-term traffic flow model, aiming to predict traffic flow information in future time periods. Specifically, for three time series data periods, self-attention is first used to model them separately to capture their own time dependence information. Then, based on a pairwise fusion and sequential approach, the modeled monthly and weekly time series patterns are first fused in terms of time features. The resulting time features are then fused with the recent time series pattern to extract the final time features of the traffic flow data. For the driving distance adjacency matrix, second-order similarity calculation is used in large-scale graph embedding technology to encode it, calculating the final spatial features of the traffic flow data. Based on the constructed time and spatial features of the traffic flow data, a spatiotemporal fusion module based on a progressive approach is used to perform spatiotemporal fusion modeling, finally generating prediction results.

[0072] In this embodiment, as Figure 2 As shown, the large-scale short-term traffic flow model based on progressive spatiotemporal fusion includes: a multi-view time series encoding module, a spatial knowledge extraction module, and a progressive spatiotemporal fusion module. Three periodic pattern time series are used as inputs to the multi-view time series encoding module, and the driving distance adjacency matrix D is used as input to the spatial knowledge extraction module. The progressive spatiotemporal fusion module fuses the spatiotemporal features of the results from the multi-view time series encoding module and the spatial knowledge extraction module to generate the output.

[0073] In this embodiment, as Figure 2As shown, the multi-view time series encoding module includes: an initialization operation and two dual-view time series encoding components. The initialization operation initializes a low-dimensional vector TF for each input periodic pattern and embeds it into the corresponding periodic pattern. This vector is used to compress the temporal feature information of the periodic pattern from high dimension to low dimension and participate in subsequent fusion calculations to reduce the computational cost of fusion. The spatial knowledge extraction module includes: a large-scale graph embedding encoding component; the large-scale graph embedding encoding component takes the driving distance adjacency matrix D as input. The progressive spatiotemporal fusion module includes: L cascaded progressive cross-attention components and a feedforward neural network layer; the value of L is related to the dataset.

[0074] In this embodiment, as Figure 3 As shown, the dual-view time series encoding component has two input branches and one output branch. Each input branch includes: a self-attention component, a dual-branch cross-attention component, and a feedforward neural network layer. The output branch adds the final results of the two input branches through the feedforward neural network layer as the output result.

[0075] In this embodiment, as Figure 4 As shown, the progressive cross-attention component includes: a fully connected layer, two progressive cross-attention layers, and two feedforward neural network layers;

[0076] In this embodiment, the calculation steps of the model mainly include the following:

[0077] S211, in the multi-view time series encoding module, for the input data S month S week and S current First, the monthly and weekly cycle patterns are input into the first dual-view time series encoding component to fuse the time features, resulting in an intermediate variable S that integrates the monthly and weekly cycle time features. temp :

[0078] S temp =FFN(DBCA(SA(S) month ), SA(S week )))+FFN(DBCA(SA(S week ), SA(S month ))),

[0079] Then the intermediate variable S temp With S curren The second dual-view time series encoding component is used to fuse time features, and finally the time features TE of the traffic flow data are constructed.

[0080] TE =

[0081] FFN(DBCA(SA(S temp ), SA(S current )))+FFN(DBCA(SA(S current ), SA(S temp )));

[0082] Where SA(·) represents the computational operation of the self-attention component, DBCA(A, B) represents the computational operation of the dual-branch cross attention component, A and B are its inputs and their positions are interchanged to affect the result, and FFN(·) represents the computational operation of the feedforward neural network layer.

[0083] In this embodiment, the monthly and weekly cycles are chosen to be fused first because, compared to the recent cycle, the monthly and weekly cycles have a smaller impact on traffic flow in future time steps (impact level: recent > weekly cycle > monthly cycle). If the recent cycle is fused first, some important time-dependent information may be lost, resulting in insufficient spatiotemporal fusion. Experimental results show that the fusion strategy produces the best final performance.

[0084] In the self-attention component, the input feature Z is first processed by the input layer regularization network layer to obtain the input Z of the self-attention layer. (1) =LayerNormalization(Z), the self-attention layer uses a multi-head attention mechanism to normalize Z. (1) Mapped into three matrices and Using H as the head number in w q w k and w v The last dimension of the matrix is ​​partitioned; this improves the efficiency of parallel computation and allows for better feature fusion. The row vector of each row and The similarity is calculated by performing a vector dot product on the column vectors of each column. The results are then subjected to SoftMax calculation to obtain the input features Z. (1) Attention coefficient matrix A of the i-th head (i) Then through The calculation result of the i-th head is obtained. (i) Then, the results of the H heads are concatenated on the last dimension to obtain the result Z of the self-attention layer. (2) :

[0085] Z (2) =Concat(head) (1) ,head (2) ,...,head (H) )

[0086] Then Z (2) Perform a residual join operation to obtain Z. (3) =Z (2) +Z, finally Z (3) The input is processed by the feedforward neural network layer. Similar to the self-attention layer, there is a regularization network layer before the feedforward neural network layer, followed by a residual connection layer. Similarly, the output Z of the feedforward neural network layer can be obtained. (4) :

[0087] Z (4) =SA(Z)=Z (3) +FFN(LayerNormalization(Z (3) ))

[0088] Without loss of generality, Z is the input to the self-attention component, which can be S. month S week S current or S temp , Represents the matrix cross product;

[0089] In the dual-branch cross-attention component, the calculation of the low-dimensional vector TF embedded in the initialization operation is the main focus. This vector is designed to store the temporal features of the current mode and participate in the fusion calculation with other periodic modes. Since it is represented by a low-dimensional vector, the time cost of feature fusion can be effectively reduced. After the self-attention component is calculated, the TF vector has learned the temporal features of the current periodic mode.

[0090] After inputting the A and B periodic patterns into the dual-branch attention component, a low-dimensional vector S is first initialized. pos Then embed it into a file that does not contain TF. B B-cycle pattern S B The above is used to capture local position information between sensors in B-cycle mode. A bias algorithm is used to apply this information to a low-dimensional vector S. pos Self-attention operation is performed on the B-cycle pattern to obtain intermediate variables of the B-cycle pattern containing local positional information.

[0091]

[0092] Where || represents the matrix concatenation operation, the purpose of using the bias algorithm is because such calculations may extract potential local position information between sensors without producing performance worse than no processing method. An extreme case is SA([S pos ||S B The result of ]) is 0;

[0093] Then, the low-dimensional vector TF of the A-periodic mode... A and To perform the calculation, first set TF A Mapped to w q matrix, Mapped to w k and w v The matrix, similar to the calculation principle of the self-attention layer in the self-attention component, is first calculated... At this time w q This represents the time characteristics of the A-cycle pattern, w k This represents the temporal characteristics of the B-cycle pattern. The cross-attention coefficient matrix A is obtained by calculating the cross-attention coefficients of the two patterns using the SoftMax function after matrix cross product calculation. AB Then A AB with w v Perform matrix cross product calculation to obtain the fused TF. AB The vector is then subjected to another residual join calculation to convert the TF to a vector. AB With TF A The results are added together and then embedded into the A-cycle pattern as a new TF. A Without loss of generalization, A and B represent the periodic patterns of the input, which can be S. month S week S current or S temp Furthermore, A and B are not equivalent in status.

[0094] In S212, within the spatial knowledge extraction module, for the input data driving distance adjacency matrix D, the large-scale graph embedding coding component utilizes a second-order similarity calculation method to capture the spatial features of traffic flow data. This second-order similarity calculation method first maps each node into two low-dimensional vector representations based on the number of sensor nodes. and and with

[0095]

[0096] To optimize the function, the spatial features (GE) of the traffic flow data were finally extracted.

[0097] in,

[0098]

[0099] This represents the representation vector of node i itself. w represents the representation vector of node i when it is a neighbor of other nodes. ij Let E represent the weight from node i to node j, and let E represent the set of all nodes.

[0100] S22, in the progressive spatiotemporal fusion module, the output TE of the multi-view time series encoding module and the output GE of the spatial knowledge extraction module are progressively spatiotemporally fused through L progressive cross-attention components, and the final prediction target is obtained through the computation of a one-layer feedforward neural network.

[0101]

[0102] Among them, TE i , i = 1, 2, 3, ... represents the output of the i-th progressive cross attention component. In particular, when i = 0, TE = TE0.

[0103] In the i-th progressive cross-attention component, the temporal feature TE i-1 Using spatial features GE as input, first process the temporal features TE... i-1 The input is fed into a fully connected layer, its dimensions are aligned with the spatial feature GE, and then the aligned temporal feature TE is... i-1 Spatiotemporal fusion is performed between the spatial feature GE input and the progressively cross-attention layer to obtain the intermediate variable TG that incorporates spatiotemporal features. i :

[0104] TG i =FFN(PCA(FC(TE) i-1 ),GE))

[0105] Considering that progressive fusion may result in information loss, and since the spatial feature input is GE each time, there is no spatial feature loss, the input temporal feature TE is used instead. i-1 With the intermediate variable TG that incorporates spatiotemporal features i The input to the second progressive cross-attention layer is further fused to compensate for the potential loss of temporal features during the progressive fusion process. Each progressive cross-attention layer is followed by a feedforward neural network layer, and finally the calculation result of the i-th progressive cross-attention component is obtained:

[0106] TE i =FFN(PCA(TG) i ,TE i-1 ), i = 1, 2, 3, ...

[0107] Where FFN(·) represents the computational operation of the feedforward neural network layer, FC(·) represents the computational operation of the fully connected layer, and PCA(·) represents the computational operation of the progressive cross attention layer.

[0108] In the progressive cross-attention layer, for input variables A and B, A is mapped to w. q Matrix B mapped to wk and w v The matrix is ​​used for calculations similar to those performed in the self-attention layer, i.e.:

[0109]

[0110] Then, to retain more feature information from input A, a residual connection operation is performed again as the final output:

[0111] PCA(A,B)=O AB +A

[0112] Without loss of generality, A and B represent input variables, which can be TE. i-1 GE or TG i wait;

[0113] In the fully integrated spatiotemporal features TE L Then, it is used as the input to the last feedforward neural network layer of the progressive spatiotemporal fusion module to generate the final prediction result. The prediction result of the large-scale short-term traffic flow prediction model based on progressive spatiotemporal fusion is as follows:

[0114]

[0115] In this embodiment, monthly historical traffic flow data, weekly historical traffic flow data, recent historical traffic flow data, and driving distance adjacency matrix are used as inputs to train a large-scale short-term traffic flow prediction model based on progressive spatiotemporal fusion. The length of the input time series is p=6, the length of the output prediction window is q=1, and the time step span is Δt=15, 30, 45, 60. That is, the model can predict the traffic flow information passing through each sensor node within the next hour. The batch size is set to 16, the Adam (Adaptive Moment Estimate) optimization algorithm is used, the initial learning rate is set to 0.002, the decay rate is 0.5 every 20 epochs, and the model is trained for 100 epochs.

[0116] In this embodiment, the mean absolute error (MAE) is used as the loss function, and the mean absolute error (RMSE), root mean square error (RMSE), and symmetric mean absolute percentage error (SMAPE) are used as evaluation criteria to evaluate the performance of the model. The lower the value of the three error criteria and the closer it is to 0, the better, with 0 representing a perfect model.

[0117]

[0118]

[0119]

[0120] S3: Collect traffic flow data of the sensor nodes included in the training at the current time step and in the historical time step, and organize them into three periodic patterns according to the preprocessing steps described in S1. Then, input the time series data of the three periodic patterns into the trained traffic flow prediction model to predict the traffic flow information of the corresponding sensor nodes in the next 15, 30, 45 and 60 minutes.

[0121] In summary, the method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion provided by this invention can bring at least the following beneficial effects:

[0122] 1) To address the problem that existing graph convolutional neural network-based methods are limited by manually set thresholds, thus ignoring the spatial similarity between long-distance sensors and resulting in insufficient spatiotemporal fusion for large-scale traffic flow prediction at multiple time steps, this invention utilizes large-scale graph embedding technology to model large-scale traffic networks, which can effectively take into account the spatial dependence between long-distance sensors. In addition, this invention designs a novel progressive spatiotemporal fusion module, which gradually fuses the spatiotemporal features of traffic data based on the progressive idea, and embeds residual connection technology from the field of image recognition to retain more spatiotemporal feature information during the fusion process and reduce feature loss during fusion.

[0123] 2) Considering the impact of traffic data periodicity on prediction targets, this invention proposes a novel multi-view time series encoding module. Based on the degree of influence of periodicity on prediction targets (recent > weekly > monthly) and experimental results, this module first inputs historical traffic flow data from the monthly and weekly periods into a dual-view time series encoding component for separate modeling and fusion. Then, the results are combined with recent historical traffic flow data in the dual-view time series encoding component for separate modeling and fusion, thus fully capturing the time dependence of large-scale traffic flow data. Furthermore, experiments conducted in scenarios with missing data show that this module can effectively reduce the impact of missing data on large-scale traffic flow prediction.

[0124] 3) To address the issue of high time overhead in existing graph convolutional neural network-based methods for large-scale traffic prediction tasks, this invention designs a low-dimensional vector TF in the multi-view time series encoding module. By using TF to fuse the temporal correlations between periodic patterns, the computational time overhead can be significantly reduced. In addition, this invention adopts large-scale graph embedding encoding technology, which incorporates Alias ​​sampling and negative sampling techniques, effectively reducing the time overhead of spatial dependency modeling.

[0125] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical solution of the present invention, and these simple modifications all fall within the protection scope of the present invention.

[0126] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.

[0127] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed by the present invention.

Claims

1. A method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion, characterized in that, The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion includes: S1. Obtain the raw dataset collected by the sensors and preprocess the raw dataset to obtain historical traffic data of various periodic patterns and the adjacency matrix of real road driving distance between sensors. S2. Construct a large-scale short-term traffic flow model based on progressive spatiotemporal fusion. Use the processed multi-period time series data and driving distance adjacency matrix as input to the model, train the large-scale short-term traffic flow model, and obtain a large-scale short-term traffic flow model with the ability to predict traffic flow in future time periods. S3. Using the model obtained in S2 and the current traffic data as input, predict future traffic data; where, In S2, the input and output variables of the traffic flow prediction model are determined. The input variables include: monthly, weekly, and recent historical traffic flow data, as well as a driving distance adjacency matrix. The output variables include: traffic flow within the corresponding sensor's future time period; The large-scale short-term traffic flow model based on progressive spatiotemporal fusion includes: a multi-view time series encoding module, a spatial knowledge extraction module, and a progressive spatiotemporal fusion module; three periodic pattern time series are used as inputs to the multi-view time series encoding module, and the driving distance adjacency matrix is ​​used. As input to the spatial knowledge extraction module, the progressive spatiotemporal fusion module fuses the spatiotemporal features of the results from the multi-view time series encoding module and the spatial knowledge extraction module to generate the output. ; The multi-view time series encoding module includes: an initialization operation and two dual-view time series encoding components. The initialization operation initializes a low-dimensional vector for each input periodic pattern. And embed it into the corresponding periodic pattern; the dual-view time series encoding component has two input branches and one output branch. Each input branch includes: a self-attention component, a dual-branch cross-attention component and a feedforward neural network layer. The output branch adds the final results of the two input branches through the feedforward neural network layer as the output result. In the multi-view time series encoding module, for the input data and First, the monthly and weekly cycle patterns are input into the first dual-view time series encoding component to fuse the time features, resulting in an intermediate variable that integrates the monthly and weekly cycle time features. : Then the intermediate variables and The second dual-view time series encoding component is used to fuse time features, ultimately constructing the time features of the traffic flow data. : in, This represents the computational operations of the self-attention component. This represents the computational operation of the bi-branch cross-attention component. and The input and its position are changed, which affects the result. This represents the computational operations of a feedforward neural network layer; The spatial knowledge extraction module includes: a large-scale graph embedding encoding component; the large-scale graph embedding encoding component will convert the driving distance adjacency matrix... As input, the spatial features of traffic flow data are captured using a second-order similarity calculation method. This method first maps each sensor node into two low-dimensional vectors based on the number of sensor nodes. and and with To optimize the function, the spatial features of the traffic flow data were ultimately extracted. ;in, express The representation vector of the node itself. express The representation vector of a node when it is a neighbor of other nodes. Indicates from node To the node The weights, Represents the set of all nodes. ; The progressive spatiotemporal fusion module includes: A series of progressively cross-attention components and a feedforward neural network layer; The value of is related to the dataset. The progressive cross-attention component includes: a fully connected layer, two progressive cross-attention layers, and two feedforward neural network layers; wherein, the progressive spatiotemporal fusion module incorporates temporal features. and spatial features As input, after After spatiotemporal fusion processing of the progressively cross-attention components, fully fused spatiotemporal features are obtained. Without losing generality, here we use Representing the The output of a progressive cross-attention component, in particular, when When =0, ; In fully integrated spatiotemporal features Then, it is used as the input to the final feedforward neural network layer based on the progressive spatiotemporal fusion module to produce the final prediction result. .

2. The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion according to claim 1, characterized in that, The various periodic patterns mentioned in S1 include monthly, weekly, and recent periods. The historical traffic data includes multiple records, each of which includes: traffic flow within a time period, the date of that time period, and the start and end times of that time period.

3. The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion according to claim 2, characterized in that, For time series data of three periods, we first use the concept of self-attention to model them separately to capture their own time dependence information; then, based on the pairwise fusion and serial approach, we first fuse the time features of the modeled monthly periodic pattern and weekly periodic pattern, and then fuse the time features obtained with the recent pattern to extract the final time features of traffic flow data. For the driving distance adjacency matrix, the second-order similarity calculation method in large-scale graph embedding technology is used to encode it, and the final spatial features of traffic flow data are calculated. Based on the temporal and spatial characteristics of the constructed traffic flow data, a spatiotemporal fusion module based on the progressive approach is used to perform spatiotemporal fusion modeling, and finally, prediction results are generated.

4. The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion according to claim 1, characterized in that, In S1, traffic data for the current time period is collected from the sensors included in the training. The collected traffic flow data is then input into the trained model to perform large-scale short-term traffic flow prediction in order to predict traffic flow information for a future period of time. The original dataset contains the street where the sensor is located, its latitude and longitude, and several records. The records cover the data recorded by the sensor within one year, with each record spaced 15 minutes apart. Each traffic record includes the date, time, type of day, number of vehicles passing through the time period, and average speed of vehicles passing through the time period. In addition, the original dataset contains data from thousands of sensors, which constitutes large-scale traffic prediction. The original dataset undergoes preprocessing operations, which include: preprocessing the original dataset according to monthly, weekly, and recent historical traffic data as the current period, to generate three traffic flow time series data: monthly, weekly, and current patterns. and The dataset was divided into training, validation, and test sets in a 7:1:2 ratio. The latitude and longitude information of each sensor was extracted from the original dataset, and the driving distances between each sensor were calculated by mapping them to roads on a map. A driving distance adjacency matrix was then constructed between the sensors. The driving distance adjacency matrix It is an asymmetric matrix.

5. The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion according to claim 4, characterized in that, Preprocessing of the raw dataset includes: extracting the spatial coordinates of all sensor nodes from the raw dataset, and defining the spatial road network topology information as a graph. ;in, It is the collection of all sensor nodes. The total number of sensor nodes is , It is the set of directed edges for all sensor nodes. It is the set of weights corresponding to directed edges; The map is calculated by mapping sensor nodes onto the map. Adjacency matrix of driving distance and will As a diagram The directed edge weights, i.e. ; Traffic flow data from all sensors was extracted from the original dataset, where, Sensor sites within time steps The observed traffic flow data is denoted as ,but Within a time step, the traffic flow data observed by all sensor stations are recorded as follows: , A time step represents a The time interval, and further construction Three periodic pattern time series within a time step: , , , in, and These represent time steps of one week and one month, respectively; finally, The three periodic patterns of time series at each time step are concatenated to obtain... and ;in, Represents the set of real numbers. Indicates the length of the time series.

6. The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion according to claim 1, characterized in that, In the self-attention component, the input features It will first be processed by the input layer regularization network layer to obtain the input of the self-attention layer. The self-attention layer will Mapped into three matrices , and ,pass The row vector of each row and The similarity is calculated by performing a vector dot product on the column vectors of each column. Then, SoftMax calculation is performed on the results to obtain the input features. Attention coefficient matrix Then through Results of obtaining the self-attention layer After that Perform a residual join operation to obtain Finally The input is processed by the feedforward neural network layer. Similar to the self-attention layer, the feedforward neural network layer is preceded by a regularization network layer and followed by a residual connection layer. The output of the feedforward neural network layer can be obtained in the same way. ,Right now ; however, it does not lose its generality. For the input of the self-attention component, such as or , This represents the matrix cross product.

7. The large-scale short-term traffic flow prediction method based on progressive spatiotemporal fusion according to claim 1, characterized in that, In the bi-branch cross-attention component, the low-dimensional vector embedded in the initialization operation is used. The computation is primarily based on this vector, which is designed to store the temporal features of its current mode and participate in the fusion computation with other periodic modes. Representing it as a low-dimensional vector effectively reduces the time overhead of feature fusion. After the self-attention component is computed, The vector has learned the temporal characteristics of its current periodic pattern; Input into the dual-branch attention component and After the periodic pattern is established, a low-dimensional vector is initialized first. Then embed it into a program that does not contain B-cycle pattern The above is used to capture local position information between sensors in B-cycle mode. A bias algorithm is used to process the low-dimensional vector... Self-attention operation is performed on the B-cycle pattern to obtain intermediate variables of the B-cycle pattern containing local positional information. , ;in This represents the matrix concatenation operation, and then the low-dimensional vector of the A-period pattern. and To perform the calculation, first... Mapped to matrix, Mapped to and The matrix, similar to the calculation principle of the self-attention layer in the self-attention component, is first calculated... ,at this time This represents the time characteristics of the A-cycle pattern. This represents the temporal characteristics of the B-cycle pattern. The cross-attention coefficient matrix is ​​obtained by calculating the matrix cross product followed by the SoftMax function. Then and Perform matrix cross product calculation to obtain the fused result. The vector is then subjected to another residual join calculation. and Add them together, and then embed the result into the A-cycle pattern as a new... Without loss of generalization, A and B represent the periodic patterns of the input, such as... or Furthermore, A and B are not equivalent in status.

8. The method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion according to claim 1, characterized in that, In the In each progressive cross-attention component, the temporal features of the input are... First, it is input into a fully connected layer, and its dimensions and spatial features are then analyzed. Align, and then combine the aligned time features Spatial features The input is progressively cross-attention layer for spatiotemporal fusion, resulting in an intermediate variable that incorporates spatiotemporal features. Considering that progressive fusion may result in information loss, and that each progressive cross-attention component uses the original... As spatial feature input, there is no need to compensate for the spatial feature fusion loss. However, the temporal feature input comes from the output of the previous progressive cross-attention component, which may result in temporal feature loss. Therefore, in order to preserve more temporal feature information, the input temporal features... With intermediate variables that incorporate spatiotemporal features The input to the second progressive cross-attention layer is used for further fusion to compensate for the fusion loss of temporal features. Each progressive cross-attention layer is followed by a feedforward neural network layer, finally yielding the... The calculation results of the progressive cross-attention component are as follows: ; in, This represents the computational operations of a feedforward neural network layer. This represents the computational operations of the fully connected layer. This represents the computational operation of the progressive cross-attention layer.

9. The method for large-scale short-term traffic flow prediction based on progressive spatiotemporal fusion according to claim 8, characterized in that, In the progressive cross-attention layer, for input variables A and B, A is mapped to... Matrix, B mapped to and The matrix is ​​used for calculations similar to those performed in the self-attention layer. Then, a residual connection is performed as the final output, that is: A; where, without loss of generality, A and B represent the input variables, such as or ; In fully integrated spatiotemporal features Then, it is used as the input to the last feedforward neural network layer of the progressive spatiotemporal fusion module to generate the final prediction result. The prediction result of the large-scale short-term traffic flow prediction model based on progressive spatiotemporal fusion is as follows: 。