A traffic flow prediction method based on a discrete-continuous mixed space-time network
By constructing a traffic flow prediction model based on a discrete-continuous hybrid spatiotemporal network, and utilizing fully connected layers, time-varying graph convolutional networks, time-space-time modules, and bidirectional gated recurrent units, the shortcomings of existing methods in capturing the spatiotemporal dependencies of traffic data are addressed, achieving efficient and accurate traffic flow prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-01-23
- Publication Date
- 2026-06-02
AI Technical Summary
Existing traffic flow prediction methods struggle to simultaneously capture the static structural features and dynamic spatiotemporal changes of traffic data, fail to effectively capture joint spatiotemporal dependencies, lack residual and gating mechanisms, thus affecting long-term modeling performance, and do not adequately characterize bidirectional time dependencies.
A traffic flow prediction model is constructed by combining a fully connected layer, a time-varying graph convolutional network, a time-space-time module, a bidirectional gated recurrent unit, and a two-stage time bottleneck attention module. This model extracts and fuses the static and dynamic features of traffic data to achieve bidirectional time series modeling.
It significantly improves the accuracy of traffic flow prediction, reduces computational overhead, can simultaneously capture the static structure and dynamic changes of traffic data, enhances the ability to capture long-term dependencies, and improves the computational efficiency and prediction accuracy of the model.
Smart Images

Figure CN122135557A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network, belonging to the field of traffic flow prediction technology. Background Technology
[0002] As a crucial component of Intelligent Transportation Systems (ITS), traffic forecasting is essential for the efficiency and accuracy of intelligent traffic scheduling and management. Its predictive accuracy is vital not only for improving road safety and alleviating traffic congestion, but also for providing significant support for key application scenarios such as urban traffic scheduling, dynamic route planning, and personalized travel services. The challenge of traffic flow forecasting stems from the high complexity of its data, which is tightly coupled in both spatiotemporal dimensions and exhibits complex dependencies. Spatially, the traffic network is a topological structure; a change in the state of one node rapidly affects connected nodes, and this graph-like relationship is difficult to capture using traditional sequence models. Temporally, traffic flow exhibits multi-scale mixed patterns, including continuity between adjacent times, daily periodicity represented by morning and evening peak hours, and periodicity of differences between weekdays and weekends. These patterns overlap, requiring models to simultaneously identify and model them.
[0003] Existing technologies have conducted extensive research on the challenges of traffic forecasting. Initially, traffic forecasting was treated directly as a time series problem, leading to the widespread application of classic statistical methods such as Autoregressive Integrated Moving Average (ARIMA). Subsequently, more and more research has adopted Support Vector Regression (SVR) to develop data-driven methods to handle more complex traffic data structures. However, traditional machine learning methods have limitations in effectively modeling the spatiotemporal dependencies of traffic data and in capturing and analyzing complex spatiotemporal patterns. In recent years, deep learning techniques have demonstrated outstanding effectiveness in modeling high-dimensional spatiotemporal data for traffic forecasting, outperforming traditional time series statistical methods and shallow machine learning methods. The core principle of deep learning-based traffic forecasting methods lies in utilizing diverse deep learning techniques to extract the inherent spatiotemporal features of traffic data.
[0004] In spatial modeling, convolutional neural networks (CNNs) have successfully simulated spatial dependencies, outperforming traditional methods. However, they are generally well-suited for Euclidean data but perform poorly on non-Euclidean data, such as irregular graph structures in traffic networks. Graph neural networks (GNNs) transmit information along edges, embedding nodes with their features and local topology, thus effectively capturing the spatial dependencies of traffic data. Many GNN-based traffic prediction methods have been actively developed and explored; however, the prediction accuracy of manually predefined graph structures is inherently limited by their quality. To address this issue, existing technologies have developed adaptive graph structure generation methods. Neuronormal differential equations (NDEs) are parameterized into neural networks by differentiating the hidden states, thereby modeling continuous dynamical systems instead of relying on predefined discrete layer sequences.
[0005] In temporal modeling, recurrent neural networks (RNNs) are widely used for traffic prediction because they can capture temporal dependencies in continuous data. Compared to traditional RNNs, Long Short-Term Memory (LSTM) networks employ a gating mechanism that allows for selective storage and discarding of information, thus handling long-term dependencies more effectively. Gated Recurrent Units (GRUs) are a simplified variant of RNNs that also address the problems of long-term dependencies and vanishing gradients.
[0006] Although deep learning-based traffic prediction methods have made significant breakthroughs, existing techniques still have some significant limitations when dealing with complex traffic flow prediction tasks, particularly in the following aspects:
[0007] (1) The static topology of road networks and their dynamic spatiotemporal processes are often difficult to capture and model together.
[0008] Traffic forecasting methods primarily rely on topological graph structures or dynamic adjacency matrices. Road network topology graphs play an indispensable role in traffic forecasting by capturing relatively stable information within the traffic network. Their main function is to model elements that remain largely unchanged over long periods. Conversely, dynamic modeling techniques focus on rapidly changing dynamic information within the traffic network, capable of tracking instantaneous fluctuations in traffic conditions in real time. In practical traffic forecasting, relying on only one method often fails to simultaneously capture both the static structural characteristics and dynamic spatiotemporal changes of traffic data, thus limiting the accuracy and practicality of the forecasts.
[0009] (2) The characteristics of traffic data changing over time are often overlooked, which restricts the modeling of dynamic relationships.
[0010] Graph neural networks, as a class of deep learning models specifically designed for graph-structured data, have demonstrated significant advantages in traffic flow prediction tasks. They can effectively model the complex spatial relationships and dynamic interactions between nodes in road networks and capture the nonlinear features inherent in the data. In recent years, research in this field has made significant progress in learning adaptive graph structures from data, enabling models to automatically infer potential dependencies between nodes from the data, rather than simply relying on predefined spatial adjacency matrices, thereby improving the flexibility of spatial modeling. However, most current methods still have a key limitation in their architectural design: they typically adopt a separate processing paradigm, that is, first capturing spatial dependencies through graph neural network modules and then learning temporal dynamics through time series models, thus failing to capture joint spatiotemporal dependencies.
[0011] (3) The lack of residual and gating mechanisms affects the performance of the neural constant differential equation framework in long-term modeling.
[0012] The neural network's constant differential equation framework provides a paradigm for continuous dynamics modeling. It utilizes neural networks to parameterize the derivatives of hidden states, thus breaking away from the traditional architecture defined by discrete layer sequences. While existing methods transcend the limitations of discrete layers and can directly simulate system dynamics, they are prone to vanishing feature gradients or information decay during long-term evolution or deep modeling due to the lack of residual connections and gating mechanisms.
[0013] (4) Bidirectional time dependency has not yet been adequately and effectively represented in the existing framework.
[0014] Gated Recurrent Units (GRUs) use update and reset gates to control the flow and forgetting of historical information, thus alleviating the gradient vanishing problem of traditional RNNs and excelling at modeling the temporal dynamics of sequences. However, their standard unidirectional sequential processing mechanism inherently limits the model's ability to utilize information from future moments, affecting the performance of tasks that require global context for prediction. Summary of the Invention
[0015] The technical problem to be solved by this invention is to provide a traffic flow prediction method based on discrete-continuous hybrid spatiotemporal networks, which can significantly improve the accuracy of traffic flow prediction without a large amount of computational overhead, highlighting its practicality and efficiency as a core component of intelligent transportation systems.
[0016] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention designs a traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network, constructs the network to be trained corresponding to the following steps A to E, and trains a traffic flow prediction model with traffic flow data of each time slice in the time period to be analyzed corresponding to each target traffic monitoring point as input and traffic flow data of each time slice in the prediction time period corresponding to each target traffic monitoring point as output, for use in traffic flow prediction;
[0017] Step A. Construct tensors for the traffic flow data of each target traffic monitoring point for each time slice within the period to be analyzed. Feature extraction is performed using a fully connected layer to obtain the tensors constructed from the feature data of each target traffic monitoring point for each time slice within the period to be analyzed. Then proceed to step B;
[0018] Step B. Apply time-varying graph convolutional networks and time-space-time modules respectively, targeting tensors. The process involves processing the traffic features extracted from discrete channels at each time slice within the time period to be analyzed by a time-varying graph convolutional network for each target traffic monitoring point. The tensor is constructed from the traffic features extracted from the continuous channels of each target traffic monitoring point within the time slice of the period to be analyzed, as output by the time-space-time module. Then proceed to step C;
[0019] Step C. The application information fusion module adjusts the tensor through a gating mechanism. tensor The corresponding contributions, and the tensor tensor By performing fusion, the tensors constructed from the fused traffic features of each target traffic monitoring point for each time slice within the period to be analyzed are obtained. Then proceed to step D;
[0020] Step D. First, use an encoder with a bidirectional gated cyclic unit structure to fully learn the tensor. Sequential context dependencies are established and output. Then, the decoder, composed of each two-stage time bottleneck attention module, combined with spatiotemporal awareness embedding, performs multi-layer information extraction on the encoder output, generates corresponding spatiotemporal features and outputs them, and then proceeds to step E.
[0021] Step E. Apply a fully connected network to process the spatiotemporal features output by the decoder to obtain traffic flow data for each time slot within the predicted time period for each target traffic monitoring point. .
[0022] As a preferred technical solution of the present invention: In step A, tensors are constructed for the traffic flow data of each target traffic monitoring point corresponding to each time slice within the period to be analyzed. According to the following formula:
[0023] ;
[0024] The process involves applying a fully connected layer, first using a first convolutional layer for convolution, then using a ReLU activation layer for activation, and finally using a second convolutional layer for convolution. This yields tensors constructed from the feature data of each target traffic monitoring point for each time slice within the time period to be analyzed. ,in, , This indicates the number of time slices within the period to be analyzed. Indicates the number of target traffic monitoring points. Representation matrix Data dimensions , Tensor Data dimensions , These represent the weight matrices of the first and second convolutional layers, respectively. , These represent the bias vectors of the first and second convolutional layers, respectively. This represents the ReLU activation function.
[0025] As a preferred technical solution of the present invention: in step B, a time-varying graph convolutional network is applied to the tensor. Perform steps B1-1 to B1-2 as follows: the time-varying graph convolutional network outputs a matrix of traffic features extracted from discrete channels for each target traffic monitoring point within the time slice of the analysis period. ;
[0026] Step B1-1. Based on the number of target traffic monitoring points The number of time slices within the period to be analyzed tensor Feature Dimensions and the constructed ingress node embedding matrix Node embedding matrix Time slice embedding matrix and the interaction weight tensor matrix Execute the following formulas in sequence:
[0027] ;
[0028] ;
[0029] ;
[0030] By each Constituting a tensor ,in, Represents the interaction weight tensor matrix The Middle The weight tensor of the dimension position, Represents the time slice embedding matrix The Middle The time slice in the first Temporal embedding across each feature dimension Represents the embedding matrix of the ingress node The Middle The target traffic monitoring points are at the following locations. In-node embedding in each dimension Represent the node embedding matrix The Middle The target traffic monitoring points are at the following locations. Out-node embedding in each dimension Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first The original adjacency scores of each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first The non-negative adjacency score of each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first Indexed adjacency weights of target traffic monitoring points Indicates the first In the next time slice, by the first The target traffic monitoring point to the The normalized adjacency weights of each target traffic monitoring point are then calculated, and then proceed to step B1-2.
[0031] Step B1-2. From tensors Extract the adjacency matrix corresponding to each time slice. Then, according to the following formula:
[0032] ;
[0033] ;
[0034] Obtain the tensor constructed from the discrete channel traffic features extracted from each target traffic monitoring point for each time slice within the period to be analyzed. ,in, Tensor The corresponding period to be analyzed is the first The adjacency matrix of each time slice. This indicates the number of layers in a time-varying graph convolutional network. In a time-varying graph convolutional network, the first... Layer about the first layer within the period to be analyzed The hidden state output in each time slice, In a time-varying graph convolutional network, the first... Layer weights, Indicates the first The convolutional output features on the image at each time slice This indicates a splicing operation.
[0035] As a preferred technical solution of the present invention: In step B, the time-space-time module is applied to the tensor. Perform steps B2-1 to B2-6 as follows: the time-space-time module outputs the matrix of traffic features extracted from the continuous channels for each target traffic monitoring point within each time slice of the time period to be analyzed. ;
[0036] Step B2-1. Apply a front-end dilated temporal convolutional network to receive tensors. And according to the following formula:
[0037] ;
[0038] Obtain the tensor output of the front-end dilated temporal convolutional network ,in, This indicates the front-end dilated temporal convolutional network function; then proceed to step B2-2;
[0039] Step B2-2. According to the preset adjacency matrix ,as well as degree matrix According to the following formula:
[0040] ;
[0041] Obtain the corresponding regularized adjacency matrix ,in, Represents the identity matrix. Indicates hyperparameters, and , Indicate the scaling factor, then proceed to step B2-3;
[0042] Step B2-3. Apply a continuous graph convolutional network to receive tensors. According to the following formula:
[0043] ;
[0044] Obtain the output of a continuous graph convolutional network ,in, This represents a continuous graph convolutional network function, targeting the i-th time interval within the time period to be analyzed. Each time slice is calculated using the following formula:
[0045] ;
[0046] ;
[0047] Obtain the outputs of the continuous graph convolutional network corresponding to each time slice within the period to be analyzed. ,in, express Regarding the time slice difference operation, express The corresponding period to be analyzed is the first Data from each time slice, , , This represents tensor-matrix multiplication in three preset modes. Represents the time transformation matrix. Represent the characteristic transformation matrix, and then proceed to step B2-4;
[0048] Step B2-4. Apply a backend dilated temporal convolutional network to receive tensors. And according to the following formula:
[0049] ;
[0050] Obtain the tensor output of the back-end dilated temporal convolutional network , This indicates the back-end dilated temporal convolutional network function; then proceed to steps B2-5.
[0051] Step B2-5. Apply the channel-gated linear unit (GLU) to the tensor according to the following formula. Process it;
[0052] ;
[0053] Obtain the output of the channel-gated linear unit (GLU) ,in, This indicates element-wise multiplication. It is the sigmoid activation function. This represents a two-dimensional convolution with a kernel size of (1,1). , This represents the learnable parameters in a channel-gated linear unit (GLU). , This represents the bias vector in the channel-gated linear unit (GLU); then proceed to step B2-6.
[0054] Step B2-6. For the output of the channel-gated linear unit (GLU) , and tensor Perform residual connections to obtain the tensors constructed from the traffic features extracted from the continuous channels for each target traffic monitoring point within each time slice of the period to be analyzed. .
[0055] As a preferred technical solution of the present invention: step C includes the following steps C1 to C2;
[0056] Step C1. Use the following formula:
[0057] ;
[0058] Obtain control signals ,in, , , They represent the learnable parameters, This indicates the sigmoid activation function, and then proceeds to step C2;
[0059] Step C2. Use the following formula:
[0060] ;
[0061] Obtain the tensor constructed from the fused traffic features of each target traffic monitoring point for each time slice within the period to be analyzed. ,in, , These represent the learnable parameters, , These represent the bias vectors, respectively.
[0062] As a preferred technical solution of the present invention: in step D, the tensor is fully learned by an encoder with a bidirectional gated loop unit structure according to steps D1-1 to D1-3 as follows. Sequential context dependencies and output them;
[0063] Step D1-1. Receive tensors using the forward branch in the encoder. According to the initialization For a zero vector, use the following formula:
[0064] ;
[0065] Obtain the forward hidden state of the fused traffic features of each target traffic monitoring point in each time slice within the period to be analyzed, where, Indicates the first [number]th ... The forward hidden state of traffic characteristics of each target traffic monitoring point in each time slice. This represents the forward branch function in the encoder. Indicates the first [number]th ... The traffic characteristics of each target traffic monitoring point in each time slice are fused and the forward hidden state is then processed, and then the process proceeds to step D1-2.
[0066] Step D1-2. Receive tensors using the reverse branch in the encoder. According to the initialization For a zero vector, use the following formula:
[0067] ;
[0068] The inverse hidden state of the fused traffic features of each target traffic monitoring point in each time slice within the period to be analyzed is obtained, where, Indicates the first [number]th ... The traffic characteristics of each target traffic monitoring point in each time slice are integrated to hide the status in reverse. This represents the reverse branch function in the encoder. Indicates the first [number]th ... The traffic monitoring points of each target in each time slice are fused with traffic characteristics and their reverse hidden states are then processed, and then steps D1-3 are performed.
[0069] Steps D1-3. For each time slice within the period to be analyzed, apply the following formula:
[0070] ;
[0071] Forward hidden state of fused traffic features of each target traffic monitoring point under time slice Reverse hidden state with integrated traffic features The data is stitched together and then subjected to linear projection transformation to obtain the encoder output. ,in, Represents the projection weight matrix. Indicates the bias term. This indicates a splicing operation.
[0072] As a preferred technical solution of the present invention: in step D, according to steps D2-1 to D2-5, a decoder composed of multiple two-stage time bottleneck attention modules is combined with spatiotemporal awareness embedding to perform multi-layer information extraction on the encoder output, generate corresponding spatiotemporal features and output them.
[0073] Step D2-1. For each time slice within the prediction period, determine the time slice within the prediction period. And the day of the week in which the time slice is located. According to the following formula:
[0074] ;
[0075] Obtain the initial perceptual temporal embedding for each time slice within the prediction period. ,in, This indicates the number of time slices within the predicted period. , , They represent the learnable parameters, This represents the one-hot encoding function. This indicates a splicing operation. Represents the ReLU activation function. This indicates the initial time-aware embedding within the prediction period, and then proceeds to step D2-2;
[0076] Step D2-2. For each time slice within the prediction period, apply the following formula:
[0077] ;
[0078] Obtain the time-aware embedding corresponding to the prediction period ,in, This represents the multilayer perceptron function with no bias term, and then proceeds to step D2-3;
[0079] Step D2-3. First, follow the formula below:
[0080] ;
[0081] Obtain the symmetric normalized graph Laplace matrix ,in, Represents the identity matrix. This represents a predefined adjacency matrix, and , express The degree matrix;
[0082] Then press Eigenvalue decomposition is performed to obtain the eigenvalue matrix Λ and the associated eigenvector matrix. and projection Extract preset The smallest nontrivial feature vectors together form a spatially aware node representation, constituting the initial spatial embedding. Then proceed to steps D2-4;
[0083] Step D2-4. For the initial spatial embedding According to the following formula:
[0084] ;
[0085] Obtaining spatial embedding Embedding space In the prediction period dimension Broadcasting is performed to obtain spatial information about the space in the time dimension. and embed time awareness In spatial dimension Broadcast on, generate Then proceed to steps D2-5;
[0086] Step D2-5. Based on multiple two-stage time bottleneck attention modules in the decoder, first determine the input of each two-stage time bottleneck attention module according to the following formula;
[0087] ;
[0088] in, Indicates the first in the decoder The output of the two-stage time bottleneck attention module Indicates the first in the decoder The input to each two-stage time bottleneck attention module is then processed according to the following formula:
[0089]
[0090]
[0091] The outputs of each target traffic monitoring point regarding each two-stage time bottleneck attention module across all time slices of the prediction period are obtained. Furthermore, the outputs of each target traffic monitoring point regarding the last two-stage time bottleneck attention module across all time slices of the prediction period are obtained, forming the spatiotemporal features of the decoder output. Indicates the first The target traffic monitoring point regarding the first The output of the two-stage time bottleneck attention module across all time slices of the prediction period. , Indicates trainable parameters, , This represents a trainable temporal memory unit used to compress and represent global temporal patterns in long temporal inputs. Indicates the first The target traffic monitoring point regarding the first The output of the two-stage time bottleneck attention module across all time slices of the prediction period. This represents the function for the multi-head self-attention mechanism.
[0092] As a preferred technical solution of the present invention: the network to be trained is trained based on the evaluation indicators of the loss function mean square error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE).
[0093] The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network described in this invention has the following technical advantages compared with existing technologies:
[0094] (1) This invention designs a traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network. First, it extracts the tensor of the feature data of traffic flow data in the period to be analyzed. Next, a time-varying graph convolutional network with a time-space-time module is applied to target tensors. The process is performed to obtain the tensor constructed from the traffic features after discrete channel extraction. and the tensor constructed from traffic features after continuous channel extraction. And obtain the tensor constructed by integrating traffic features. Then, the encoder with a bidirectional gated loop unit structure and the decoder composed of two-stage time bottleneck attention modules are processed sequentially to generate corresponding spatiotemporal features and output them. Finally, a fully connected network is applied to process the spatiotemporal features output by the decoder to realize the prediction of traffic flow data for the prediction period. The design can significantly improve the accuracy of traffic flow prediction without a large amount of computational overhead, highlighting its practicality and efficiency as a core component of intelligent transportation systems.
[0095] (2) The traffic flow prediction method based on discrete continuous hybrid spatiotemporal network designed in this invention solves the limitations of existing methods, such as the inability to simultaneously capture the static structural features and dynamic spatiotemporal changes of traffic data, the failure to capture joint spatiotemporal dependencies, and the failure to effectively utilize future time information. It combines static road network topology coding with dynamic traffic state perception by using dual-channel spatiotemporal feature distillation (DSTFD); introduces time-varying graph convolutional network (TVGCN) to dynamically capture the instantaneous correlation between nodes driven by traffic; designs time-space-time module (TST) to extract the inherent topological characteristics of traffic road network that do not change with time; and uses bidirectional gated cyclic unit (Bi-GRU) to accurately capture the long-distance forward and backward dependencies of traffic data.
[0096] (3) The traffic flow prediction method based on discrete-continuous hybrid spatiotemporal networks designed in this invention has significant advantages in spatiotemporal dependency modeling, computational efficiency, long-term time-series data processing, and adaptability to complex traffic flow prediction tasks. Existing traffic flow prediction methods often perform spatial modeling from static road network topology or adaptive adjacency matrices, failing to fully integrate the deep interaction and synergistic influence of the two under a unified modeling framework. This invention balances the stability and sensitivity of the model by proposing dual-channel spatiotemporal feature distillation (DSTFD), and can simultaneously capture the long-term stable patterns and short-term transient patterns of traffic data; the time-varying graph convolutional network (TVGCN) constructs a time-varying adjacency matrix, thereby realizing... This invention employs refined modeling of the spatiotemporal dynamics of traffic systems, enabling real-time perception and adaptation to the dynamic evolution of interactions between nodes. This provides a more flexible and practical computational framework for traffic flow prediction. The Time-Space-Time (TST) module transforms the discrete graph convolution process into a continuous dynamic system controlled by neural network differential equations, naturally resolving the inherent topological skeleton and persistent spatial dependencies in traffic data. Furthermore, by performing bidirectional temporal modeling on the input sequence, the Bidirectional Gated Recurrent Unit (Bi-GRU) encoder can simultaneously extract features from both forward and backward dimensions, thus more comprehensively and robustly capturing the complex long-term dependencies and temporal dynamic patterns in traffic flow data. This invention also achieves significant improvements in computational efficiency. Traditional deep learning methods suffer from high computational complexity and slow training and inference speeds when processing large-scale traffic data. This invention, through optimization of two-stage temporal bottleneck attention, reduces computational load and effectively mitigates interference from redundant information, improving model computational efficiency without sacrificing prediction accuracy. This allows the invention to provide more efficient predictions with fewer computational resources. Attached Figure Description
[0097] Figure 1 This is a flowchart illustrating the traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network designed in this invention. Detailed Implementation
[0098] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0099] This invention designs a traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network. In practical applications, it is based on... Figure 1 As shown, the network to be trained corresponding to the following steps A to E is constructed, and a traffic flow prediction model is trained to obtain a model that takes the traffic flow data of each time slice in the time period to be analyzed corresponding to each target traffic monitoring point as input and the traffic flow data of each time slice in the prediction time period corresponding to each target traffic monitoring point as output, which is used for traffic flow prediction.
[0100] Step A. Construct tensors for the traffic flow data of each target traffic monitoring point for each time slice within the period to be analyzed. According to the following formula:
[0101] ;
[0102] The process involves applying a fully connected layer, first using a first convolutional layer for convolution, then using a ReLU activation layer for activation, and finally using a second convolutional layer for convolution. This yields tensors constructed from the feature data of each target traffic monitoring point for each time slice within the time period to be analyzed. ,in, , This indicates the number of time slices within the period to be analyzed. Indicates the number of target traffic monitoring points. Representation matrix Data dimensions , Tensor Data dimensions , These represent the weight matrices of the first and second convolutional layers, respectively. , These represent the bias vectors of the first and second convolutional layers, respectively. This indicates the ReLU activation function, and then proceeds to step B.
[0103] Step B. Apply time-varying graph convolutional networks and time-space-time modules respectively, targeting tensors. The process involves processing the traffic features extracted from discrete channels at each time slice within the time period to be analyzed by a time-varying graph convolutional network for each target traffic monitoring point. The tensor is constructed from the traffic features extracted from the continuous channels of each target traffic monitoring point within the time slice of the period to be analyzed, as output by the time-space-time module. Then proceed to step C.
[0104] Among them, regarding the Time-Varying Graph Convolutional Network (TVGCN) and the Time-Space-Time Module (TST), the TVGCN focuses on the evolution pattern of the dynamic adjacency matrix, captures the time-varying topological dependencies between nodes, and extracts spatial location features, neighborhood distribution patterns, and global spatial information; the Time-Space-Time Module (TST) analyzes the inherent physical structure and long-term stable spatial dependencies of traffic data, ensuring the stability and universality of static features.
[0105] In actual implementation, step B above specifically designs and applies time-varying graph convolutional networks for tensors. Perform steps B1-1 to B1-2 as follows: the time-varying graph convolutional network outputs a matrix of traffic features extracted from discrete channels for each target traffic monitoring point within the time slice of the analysis period. .
[0106] Step B1-1. Based on the number of target traffic monitoring points The number of time slices within the period to be analyzed tensor Feature Dimensions and the constructed ingress node embedding matrix Node embedding matrix Time slice embedding matrix and the interaction weight tensor matrix Execute the following formulas in sequence:
[0107] ;
[0108] ;
[0109] ;
[0110] By each Constituting a tensor This system systematically captures the complex, multi-layered interactions of all nodes across multiple time slices. This approach explicitly models the complex, time-varying dependencies between nodes, providing rich structural features for traffic flow prediction tasks. In real-world traffic networks, nodes typically have bidirectional roles; an intersection can serve as both the starting point and the endpoint of one traffic data point.
[0111] in, Represents the interaction weight tensor matrix The Middle The weight tensor of the dimension position, Represents the time slice embedding matrix The Middle The time slice in the first Temporal embedding across each feature dimension Represents the embedding matrix of the ingress node The Middle The target traffic monitoring points are at the following locations. In-node embedding in each dimension Represent the node embedding matrix The Middle The target traffic monitoring points are at the following locations. Out-node embedding in each dimension Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first The original adjacency scores of each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first The non-negative adjacency score of each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first Indexed adjacency weights of target traffic monitoring points Indicates the first In the next time slice, by the first The target traffic monitoring point to the The normalized adjacency weights of each target traffic monitoring point are calculated, and then the process proceeds to step B1-2.
[0112] To represent the dynamic relationships between various target traffic monitoring points in the traffic network, a graph convolution mechanism based on a dynamic evolution graph structure was implemented. This design enables the mechanism to effectively capture the spatiotemporal dependencies that evolve with time and network topology. The design and execution are as follows.
[0113] Step B1-2. From tensors Extract the adjacency matrix corresponding to each time slice. Then, according to the following formula:
[0114] ;
[0115] ;
[0116] Obtain the tensor constructed from the discrete channel traffic features extracted from each target traffic monitoring point for each time slice within the period to be analyzed. ,in, Tensor The corresponding period to be analyzed is the first The adjacency matrix of each time slice. This indicates the number of layers in a time-varying graph convolutional network. In a time-varying graph convolutional network, the first... Layer about the first layer within the period to be analyzed The hidden state output in each time slice, In a time-varying graph convolutional network, the first... Layer weights, Indicates the first The convolutional output features on the image at each time slice This indicates a splicing operation.
[0117] Meanwhile, the specific design application of the time-space-time module is aimed at tensors. Perform steps B2-1 to B2-6 as follows: the time-space-time module outputs the matrix of traffic features extracted from the continuous channels for each target traffic monitoring point within each time slice of the time period to be analyzed. .
[0118] Step B2-1. Apply a front-end dilated temporal convolutional network to receive tensors. And according to the following formula:
[0119] ;
[0120] Obtain the tensor output of the front-end dilated temporal convolutional network That is, by stacking residual layers with dilated convolutions, long-range temporal dependencies are modeled. This design significantly expands the receptive field, where... This indicates the front-end dilated temporal convolutional network function, and then proceeds to step B2-2. Furthermore, to maintain consistency in sequence length across the temporal dimension, zero-padding is employed, and residual connections are introduced to enhance the representational power of convolutional features.
[0121] Step B2-2. According to the preset adjacency matrix ,as well as degree matrix According to the following formula:
[0122] ;
[0123] Obtain the corresponding regularized adjacency matrix ,in, Represents the identity matrix. Indicates hyperparameters, and , This indicates the scaling factor, then proceed to step B2-3.
[0124] Step B2-3. Apply a continuous graph convolutional network to receive tensors. According to the following formula:
[0125] ;
[0126] Obtain the output of a continuous graph convolutional network ,in, This represents a continuous graph convolutional network function, targeting the i-th time interval within the time period to be analyzed. Each time slice is calculated using the following formula:
[0127] ;
[0128] ;
[0129] Obtain the outputs of the continuous graph convolutional network corresponding to each time slice within the period to be analyzed. ,in, express Regarding the time slice difference operation, express The corresponding period to be analyzed is the first Data from each time slice, , , This represents tensor-matrix multiplication in three preset modes. Represents the time transformation matrix. The characteristic transformation matrix is then represented, and then proceed to step B2-4.
[0130] Step B2-4. Apply a backend dilated temporal convolutional network to receive tensors. Further extract more complex long-term sequence patterns and dependencies, specifically using the following formula:
[0131] ;
[0132] Obtain the tensor output of the back-end dilated temporal convolutional network , This indicates the backend dilation time convolutional network function; then proceed to step B2-5.
[0133] Step B2-5. Apply the channel-gated linear unit (GLU) to adaptively adjust the feature propagation according to the following formula for the tensor. Process it;
[0134] ;
[0135] Obtain the output of the channel-gated linear unit (GLU) ,in, This indicates element-wise multiplication. It is the sigmoid activation function. This represents a two-dimensional convolution with a kernel size of (1,1). , This represents the learnable parameters in a channel-gated linear unit (GLU). , This represents the bias vector in the channel-gated linear unit (GLU); then proceed to step B2-6.
[0136] Step B2-6. For the output of the channel-gated linear unit (GLU) , and tensor Perform residual connections to obtain the tensors constructed from the traffic features extracted from the continuous channels for each target traffic monitoring point within each time slice of the period to be analyzed. .
[0137] Continuous Graph Convolutional Networks (TVGCNs) and Temporal-Spatial-Temporal Modules (TSTs) possess inherent complementary advantages at the feature representation level. TVGCNs excel at capturing implicit spatial correlations arising from instantaneous traffic conditions but may overlook the inherent physical constraints imposed by the underlying road network. Conversely, TSTs effectively encode static connectivity relationships but struggle to adapt to dynamic changes in traffic conditions. Given these representational differences, traditional fusion methods, including feature concatenation or weighted averaging, fail to achieve effective integration. Therefore, it is necessary to design an adaptive fusion mechanism capable of intelligently coordinating the contributions of the two feature streams, i.e., proceeding with the following steps.
[0138] Step C. The application information fusion module adjusts the tensor through a gating mechanism. tensor The corresponding contributions, and the tensor tensor By performing fusion, the tensors constructed from the fused traffic features of each target traffic monitoring point for each time slice within the period to be analyzed are obtained. Then proceed to step D.
[0139] In practical applications, step C above is specifically designed to be executed as follows: steps C1 to C2.
[0140] Step C1. Use the following formula:
[0141] ;
[0142] Obtain control signals ,in, , , They represent the learnable parameters, This indicates the sigmoid activation function, and then proceeds to step C2.
[0143] Step C2. Use the following formula:
[0144] ;
[0145] Obtain the tensor constructed from the fused traffic features of each target traffic monitoring point for each time slice within the period to be analyzed. ,in, , These represent the learnable parameters, , These represent the bias vectors, respectively.
[0146] Step D. First, use an encoder with a bidirectional gated cyclic unit (Bi-GRU) structure to fully learn the tensor. The sequential context dependency is determined and output. Then, the decoder, composed of each two-stage time bottleneck attention module, combined with spatiotemporal awareness embedding, performs multi-layer information extraction on the encoder output to generate corresponding spatiotemporal features and output them. Then, the process proceeds to step E.
[0147] The encoder employs a Bi-Gated Recurrent Unit (Bi-GRU) architecture, processing both forward and backward data simultaneously. This design enables the model to capture complex temporal patterns by integrating historical trends and future contextual information, which is particularly important for traffic flow prediction tasks, as past patterns and emerging trends jointly influence the current state. The Bi-GRU consists of two independent branches: one processes data in forward temporal order, and the other in reverse temporal order. Each GRU unit includes an input gate, a forget gate, and an output gate, along with corresponding hidden states and outputs. The encoder's forward propagation processes the input data chronologically. At each time step, the GRU unit receives the features of the current time step and the hidden state of the previous time step, progressively building a representation that incorporates forward contextual information. Simultaneously, backward propagation processes the data in reverse order, independently learning dependency patterns from the end of the sequence to the beginning. In the feature fusion stage, the forward and backward hidden state sequences are concatenated while maintaining temporal alignment, forming an intermediate representation containing complete bi-directional contextual information.
[0148] In practical implementation, for encoders with a bidirectional gated cyclic unit (Bi-GRU) structure, the specific design follows steps D1-1 to D1-3, comprehensively learning the tensor. Sequential context dependencies and output them.
[0149] Step D1-1. Receive tensors using the forward branch in the encoder. According to the initialization For a zero vector, use the following formula:
[0150] ;
[0151] Obtain the forward hidden state of the fused traffic features of each target traffic monitoring point in each time slice within the period to be analyzed, where, Indicates the first [number]th ... The forward hidden state of traffic characteristics of each target traffic monitoring point in each time slice. This represents the forward branch function in the encoder. Indicates the first [number]th ... The traffic characteristics of each target traffic monitoring point in each time slice are fused and the forward hidden state is then entered into step D1-2.
[0152] Step D1-2. Receive tensors using the reverse branch in the encoder. According to the initialization For a zero vector, use the following formula:
[0153] ;
[0154] The inverse hidden state of the fused traffic features of each target traffic monitoring point in each time slice within the period to be analyzed is obtained, where, Indicates the first [number]th ... The traffic characteristics of each target traffic monitoring point in each time slice are integrated to hide the status in reverse. This represents the reverse branch function in the encoder. Indicates the first [number]th ... The traffic monitoring points of each target in each time slice are integrated with traffic features and their reverse hidden states are then processed, and then the process proceeds to steps D1-3.
[0155] Steps D1-3. For each time slice within the period to be analyzed, apply the following formula:
[0156] ;
[0157] Forward hidden state of fused traffic features of each target traffic monitoring point under time slice Reverse hidden state with integrated traffic features The data is stitched together and then subjected to linear projection transformation to obtain the encoder output. ,in, Represents the projection weight matrix. Indicates the bias term. This indicates a splicing operation.
[0158] Meanwhile, regarding the decoder composed of multiple two-stage time-bottleneck attention modules, in practical applications, the Transformer architecture is specifically adopted as the core decoder. Its main advantage lies in the multi-head self-attention mechanism, which can simultaneously model the dependencies of multiple temporal subspaces, thereby significantly enhancing the ability to capture long-range patterns. Compared with traditional recurrent architectures, the parallelizable design greatly improves computational efficiency while achieving higher prediction accuracy and robustness.
[0159] In practical applications, the decoder is specifically designed to perform the following steps D2-1 to D2-5: combining spatiotemporal awareness embedding, multi-layer information is extracted from the encoder output to generate corresponding spatiotemporal features and output them.
[0160] Step D2-1. For each time slice within the prediction period, determine the time slice within the prediction period. And the day of the week in which the time slice is located. According to the following formula:
[0161] ;
[0162] Obtain the initial perceptual temporal embedding for each time slice within the prediction period. ,in, This indicates the number of time slices within the predicted period. , , They represent the learnable parameters, This represents the one-hot encoding function. This indicates a splicing operation. Represents the ReLU activation function. This indicates the initial time-aware embedding within the prediction period, and then proceeds to step D2-2.
[0163] Step D2-2. For each time slice within the prediction period, apply the following formula:
[0164] ;
[0165] Obtain the time-aware embedding corresponding to the prediction period ,in, This represents the multilayer perceptron function with no bias term, and then proceeds to step D2-3;
[0166] Step D2-3. First, follow the formula below:
[0167] ;
[0168] Obtain the symmetric normalized graph Laplace matrix This constitutes the spectrum describing the global structure of the graph, where... Represents the identity matrix. This represents a predefined adjacency matrix, and , express The degree matrix.
[0169] Then press Eigenvalue decomposition is performed to obtain the eigenvalue matrix Λ and the associated eigenvector matrix. and projection Extract preset The smallest nontrivial feature vectors together form a spatially aware node representation, constituting the initial spatial embedding. Then proceed to steps D2-4.
[0170] Step D2-4. For the initial spatial embedding According to the following formula:
[0171] ;
[0172] Obtaining spatial embedding Embedding space In the prediction period dimension Broadcasting is performed to obtain spatial information about the space in the time dimension. and embed time awareness In spatial dimension Broadcast on, generate Then proceed to steps D2-5.
[0173] Step D2-5. Based on multiple two-stage time bottleneck attention modules in the decoder, first determine the input of each two-stage time bottleneck attention module according to the following formula;
[0174] ;
[0175] in, Indicates the first in the decoder The output of the two-stage time bottleneck attention module Indicates the first in the decoder The input to each two-stage time bottleneck attention module is then processed according to the following formula:
[0176]
[0177]
[0178] The outputs of each target traffic monitoring point regarding each two-stage time bottleneck attention module across all time slices of the prediction period are obtained. Furthermore, the outputs of each target traffic monitoring point regarding the last two-stage time bottleneck attention module across all time slices of the prediction period are obtained, forming the spatiotemporal features of the decoder output. Indicates the first The target traffic monitoring point regarding the first The output of the two-stage time bottleneck attention module across all time slices of the prediction period. , Indicates trainable parameters, , This represents a trainable temporal memory unit used to compress and represent global temporal patterns in long temporal inputs. Indicates the first The target traffic monitoring point regarding the first The output of the two-stage time bottleneck attention module across all time slices of the prediction period. This represents the function for the multi-head self-attention mechanism.
[0179] Step E. Apply a fully connected network to process the spatiotemporal features output by the decoder to obtain traffic flow data for each time slot within the predicted time period for each target traffic monitoring point. .
[0180] The above design scheme is based on Figure 1 As shown, traffic data first undergoes feature dimension transformation through a fully connected layer, then is input into a dual-channel feature distillation module. This module employs a parallel architecture, with embedded data fed into two independent branches, each focusing on a different computational task to capture different types of features. Specifically, in the time-varying graph convolutional network, a time-varying adjacency matrix is constructed through node embeddings and used to perform graph convolution on the input traffic data. This process captures both the topological structure of the local neighborhood of nodes and the higher-order interaction patterns formed through multi-hop connections. The time-space-time "sandwich" structure allows the input data to sequentially undergo three core stages: temporal convolution, spatial diffusion, and temporal feature refinement, thereby extracting deep spatiotemporal feature representations. Furthermore, an information fusion module is introduced as a dynamic control unit to adaptively adjust cross-channel information in real time, which enhances key features while suppressing redundant information interference. The encoder uses a bidirectional gated recurrent unit to deeply encode the traffic data through dual processing paths in both forward and backward directions. The outputs of the two branches are concatenated at each time slice, and then the merged features are fused and dimensionally normalized through a linear projection layer. In the decoding stage, a two-stage temporal bottleneck attention mechanism is employed to capture complex temporal dependencies. This mechanism effectively captures long-term temporal dynamics while maintaining low computational complexity. Finally, the multilayer perceptron utilizes the output features of the decoder to generate the final prediction.
[0181] Regarding the network to be trained corresponding to steps A to E above, in practical applications, it is specifically trained using traffic flow data of each time slice within the time period to be analyzed for each target traffic monitoring point as input and traffic flow data of each time slice within the prediction time period for each target traffic monitoring point as output, to obtain a traffic flow prediction model for traffic flow prediction. During the training process, the network to be trained is trained based on the loss function mean square error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) as evaluation indicators.
[0182] The traffic flow prediction method designed in this invention is applied to a specific embodiment, and the proposed method is evaluated on four real-world datasets from the California Department of Transportation Performance Measurement System (PeMS): PeMSD3, PeMSD4, PeMSD7, and PeMSD8. These datasets are collected in real time at 5-minute intervals. Traffic data from the first 12 time slices is used to predict the next 12 time slices. The data is divided chronologically, with 60% used for training, 20% for validation, and 20% for testing. The experiments in this embodiment are performed on a server equipped with an NVIDIA Tesla P100 GPU and using CUDA version 10.2. This embodiment is implemented using PyTorch 1.12.1 on Python 3.8.
[0183] To prevent overfitting, an early stopping strategy with patience=10 was employed. All methods were optimized using Adam with an initial learning rate of 0.001. The standard batch size for all experiments was 64. Given limited GPU memory, the batch size was gradually reduced to 32 or 16 as needed to ensure computational stability and efficiency. The proposed method incorporates three key hyperparameters: the number of layers in the temporal-spatial-temporal module L=2, the number of attention heads h, and the dimension d of each head, i.e., the total number of features D=h×d. On the PeMSD3, PeMSD4, and PeMSD8 datasets, the optimal settings in this embodiment are h=8, d=16, and D=128. For the PeMSD7 dataset, the highest performance was achieved with h=8, d=12, and D=96.
[0184] This embodiment selected 14 methods for comparison to evaluate the effectiveness of the present invention in traffic flow prediction. The mean square error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE) were used as quantitative indicators to evaluate various models. The quantitative evaluation results are shown in Table 1, which compares the performance of all models on four real datasets.
[0185] Table 1
[0186]
[0187] The experimental results in Table 1 demonstrate that this invention achieves leading performance, particularly on the PeMSD4 and PeMSD8 datasets. In contrast, traditional methods such as ARIMA perform significantly worse due to their inability to model complex nonlinear relationships in spatiotemporal traffic data. Traditional methods and machine learning methods primarily capture temporal correlations but struggle to model nonlinear dependencies. Furthermore, their strong dependence on data stationarity makes them unsuitable for real-world traffic data. Therefore, ARIMA and SVR exhibit significant disadvantages compared to deep learning-based methods. Non-graph structured methods (such as LSTM) effectively capture temporal patterns in traffic data using deep learning, but their performance remains inferior to graph structured methods due to neglecting spatial dependencies. AGCRN and STGNCDE achieve good results by generating adaptive matrices to model spatial relationships. Although STGODE extends the spatial receptive field through graph ordinary differential equations (GODE), it fails to capture global spatial dependencies, resulting in performance still lower than AGCRN. However, these methods still rely on static graph structures and fail to consider the dynamic changes in traffic data. Unlike methods that rely on static graphs, GWNet and STDN employ dynamic adjacency matrices to capture continuously evolving spatial dependencies, achieving significant breakthroughs in prediction performance. SSBTAN introduces a self-supervised learning module that automatically learns and extracts deep, robust representations from the data, demonstrating strong adaptability and stable, reliable prediction performance. MHGNet, on the other hand, decouples single-modal traffic data into multi-modal traffic data for analysis through feature mapping between timestamps and node embedding matrices.
[0188] Specifically, the present invention significantly reduced the MAE, RMSE, and MAPE evaluation metrics on the PeMSD4 dataset by 0.97%, 0.52%, and 2.88%, respectively, compared to the suboptimal method. Overall, the superior performance of the present invention can be attributed to the following factors: (1) A dual-path spatiotemporal architecture is proposed, which can jointly characterize the transient state and intrinsic topological structure of the traffic system. This architecture is achieved through the collaborative interaction of dynamically perceived paths and static analysis branches, effectively capturing the real-time changes and structural characteristics of the traffic network. (2) A gating module is proposed to dynamically balance the real-time sensitivity and structural stability between discrete graph convolution and continuous graph convolution. (3) A bidirectional long-range dependency capture mechanism is developed to address the inherent limitations of traditional methods in modeling spatiotemporal relationships. By combining a bidirectional gated recurrent unit with a bottleneck attention module, this method effectively captures the forward and backward dependencies of traffic data.
[0189] The traffic flow prediction method based on discrete-continuous hybrid spatiotemporal networks designed in this invention addresses the limitations of existing methods, such as their inability to simultaneously capture the static structural features and dynamic spatiotemporal changes of traffic data, their failure to capture joint spatiotemporal dependencies, and their inability to effectively utilize future time information. It combines static road network topology coding with dynamic traffic state perception using dual-channel spatiotemporal feature distillation (DSTFD); introduces a time-varying graph convolutional network (TVGCN) to dynamically capture the instantaneous correlations between nodes driven by traffic; designs a time-space-time module (TST) to extract the inherent and time-invariant topological characteristics of the traffic network; and utilizes bidirectional gated cyclic units (Bi-GRU) to accurately capture the long-distance forward and backward dependencies of traffic data.
[0190] The traffic flow prediction method based on discrete-continuous hybrid spatiotemporal networks designed in this invention has significant advantages in spatiotemporal dependency modeling, computational efficiency, long-term time-series data processing, and adaptability to complex traffic flow prediction tasks. Existing traffic flow prediction methods often perform spatial modeling from static road network topology or adaptive adjacency matrices, failing to fully integrate the deep interaction and synergistic influence of the two within a unified modeling framework. This invention balances the stability and sensitivity of the model by proposing Dual-Channel Spatiotemporal Feature Distillation (DSTFD), and can simultaneously capture long-term stable patterns and short-term transient patterns of traffic data; Time-Varying Graph Convolutional Network (TVGCN) achieves this by constructing a time-varying adjacency matrix. This invention provides a more flexible and realistic computational framework for traffic flow prediction by refining the spatiotemporal dynamics of the traffic system and sensing and adapting to the dynamic evolution of interactions between nodes in real time. The Time-Space-Time (TST) module transforms the discrete graph convolution process into a continuous dynamic system controlled by neural network differential equations, naturally resolving the inherent topological skeleton and persistent spatial dependencies in traffic data. Furthermore, by performing bidirectional temporal modeling on the input sequence, the Bidirectional Gated Recurrent Unit (Bi-GRU) encoder can extract features from both forward and backward dimensions simultaneously, thus capturing the complex long-term dependencies and temporal dynamic patterns in traffic flow data more comprehensively and robustly. This invention also achieves significant improvements in computational efficiency. Traditional deep learning methods suffer from high computational complexity and slow training and inference speeds when processing large-scale traffic data. This invention, through optimization of two-stage temporal bottleneck attention, reduces computational load and effectively reduces interference from redundant information, improving model computational efficiency without sacrificing prediction accuracy. This allows the invention to provide more efficient predictions with fewer computational resources.
[0191] The 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 above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network, characterized in that: Construct the network to be trained corresponding to the following steps A to E, and train it to obtain a traffic flow prediction model with traffic flow data of each time slice in the time period to be analyzed corresponding to each target traffic monitoring point as input and traffic flow data of each time slice in the prediction time period corresponding to each target traffic monitoring point as output, for use in traffic flow prediction. Step A. Construct tensors for the traffic flow data of each target traffic monitoring point for each time slice within the period to be analyzed. Feature extraction is performed using a fully connected layer to obtain the tensors constructed from the feature data of each target traffic monitoring point for each time slice within the period to be analyzed. Then proceed to step B; Step B. Apply time-varying graph convolutional networks and time-space-time modules respectively, targeting tensors. The process involves processing the traffic features extracted from discrete channels at each time slice within the time period to be analyzed by a time-varying graph convolutional network for each target traffic monitoring point. The tensor is constructed from the traffic features extracted from the continuous channels of each target traffic monitoring point within the time slice of the period to be analyzed, as output by the time-space-time module. Then proceed to step C; Step C. The application information fusion module adjusts the tensor through a gating mechanism. tensor The corresponding contributions, and the tensor tensor By performing fusion, the tensors constructed from the fused traffic features of each target traffic monitoring point for each time slice within the period to be analyzed are obtained. Then proceed to step D; Step D. First, use an encoder with a bidirectional gated cyclic unit structure to fully learn the tensor. Sequential context dependencies are established and output. Then, the decoder, composed of each two-stage time bottleneck attention module, combined with spatiotemporal awareness embedding, performs multi-layer information extraction on the encoder output, generates corresponding spatiotemporal features and outputs them, and then proceeds to step E. Step E. Apply a fully connected network to process the spatiotemporal features output by the decoder to obtain traffic flow data for each time slot within the predicted time period for each target traffic monitoring point. .
2. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: In step A, tensors are constructed for the traffic flow data of each target traffic monitoring point corresponding to each time slice within the period to be analyzed. According to the following formula: ; The process involves applying a fully connected layer, first using a first convolutional layer for convolution, then using a ReLU activation layer for activation, and finally using a second convolutional layer for convolution. This yields tensors constructed from the feature data of each target traffic monitoring point for each time slice within the time period to be analyzed. ,in, , This indicates the number of time slices within the period to be analyzed. Indicates the number of target traffic monitoring points. Representation matrix Data dimensions , Tensor Data dimensions , These represent the weight matrices of the first and second convolutional layers, respectively. , These represent the bias vectors of the first and second convolutional layers, respectively. This represents the ReLU activation function.
3. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: In step B, a time-varying graph convolutional network is applied to the tensor. Perform steps B1-1 to B1-2 as follows: the time-varying graph convolutional network outputs a matrix of traffic features extracted from discrete channels for each target traffic monitoring point within the time slice of the analysis period. ; Step B1-1. Based on the number of target traffic monitoring points The number of time slices within the period to be analyzed tensor Feature Dimensions and the constructed ingress node embedding matrix Node embedding matrix Time slice embedding matrix and the interaction weight tensor matrix Execute the following formulas in sequence: ; ; ; By each Constituting a tensor ,in, Represents the interaction weight tensor matrix The Middle The weight tensor of the dimension position, Represents the time slice embedding matrix The Middle The time slice in the first Temporal embedding across each feature dimension Represents the embedding matrix of the ingress node The Middle The target traffic monitoring points are at the following locations. In-node embedding in each dimension Represent the node embedding matrix The Middle The target traffic monitoring points are at the following locations. Out-node embedding in each dimension Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first The original adjacency scores of each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first The non-negative adjacency score of each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point flows to the first Indexed adjacency weights for each target traffic monitoring point Indicates the first In the next time slice, by the first The target traffic monitoring point to the The normalized adjacency weights of each target traffic monitoring point are then determined, and the process proceeds to step B1-2. Step B1-2. From tensors Extract the adjacency matrix corresponding to each time slice. Then, according to the following formula: ; ; Obtain the tensor constructed from the discrete channel traffic features extracted from each target traffic monitoring point for each time slice within the period to be analyzed. ,in, Tensor The corresponding period to be analyzed is the first The adjacency matrix of each time slice. This indicates the number of layers in a time-varying graph convolutional network. In a time-varying graph convolutional network, the first... Layer about the first layer within the period to be analyzed The hidden state output in each time slice, In a time-varying graph convolutional network, the first... Layer weights Indicates the first The convolutional output features on the image at each time slice This indicates a splicing operation.
4. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: In step B, the time-space-time module is applied to the tensor. Perform steps B2-1 to B2-6 as follows: the time-space-time module outputs the matrix of traffic features extracted from the continuous channels for each target traffic monitoring point within each time slice of the time period to be analyzed. ; Step B2-1. Apply a front-end dilated temporal convolutional network to receive tensors. And according to the following formula: ; Obtain the tensor output of the front-end dilated temporal convolutional network ,in, This indicates the front-end dilated temporal convolutional network function; then proceed to step B2-2; Step B2-2. According to the preset adjacency matrix ,as well as degree matrix According to the following formula: ; Obtain the corresponding regularized adjacency matrix ,in, Represents the identity matrix. Indicates hyperparameters, and , Indicate the scaling factor, then proceed to step B2-3; Step B2-3. Apply a continuous graph convolutional network to receive tensors. According to the following formula: ; Obtain the output of a continuous graph convolutional network ,in, This represents a continuous graph convolutional network function, targeting the i-th time interval within the time period to be analyzed. Each time slice is calculated using the following formula: ; ; Obtain the outputs of the continuous graph convolutional network corresponding to each time slice within the period to be analyzed. ,in, express Regarding the time slice difference operation, express The corresponding period to be analyzed is the first Data from each time slice, , , This represents tensor-matrix multiplication in three preset modes. Represents the time transformation matrix. Represent the characteristic transformation matrix, and then proceed to step B2-4; Step B2-4. Apply a backend dilated temporal convolutional network to receive tensors. And according to the following formula: ; Obtain the tensor output of the back-end dilated temporal convolutional network , This indicates the back-end dilated temporal convolutional network function; then proceed to steps B2-5. Step B2-5. Apply the channel-gated linear unit (GLU) to the tensor according to the following formula. Process it; ; Obtain the output of the channel-gated linear unit (GLU) ,in, This indicates element-wise multiplication. It is the sigmoid activation function. This represents a two-dimensional convolution with a kernel size of (1,1). , This represents the learnable parameters in a channel-gated linear unit (GLU). , This represents the bias vector in the channel-gated linear unit (GLU); then proceed to step B2-6. Step B2-6. For the output of the channel-gated linear unit (GLU) , and tensor Perform residual connections to obtain the tensors constructed from the traffic features extracted from the continuous channels for each target traffic monitoring point within each time slice of the period to be analyzed. .
5. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: Step C includes the following steps C1 to C2; Step C1. Use the following formula: ; Obtain control signals ,in, , , They represent the learnable parameters, This indicates the sigmoid activation function, and then proceeds to step C2; Step C2. Use the following formula: ; Obtain the tensor constructed from the fused traffic features of each target traffic monitoring point for each time slice within the period to be analyzed. ,in, , These represent the learnable parameters, , These represent the bias vectors, respectively.
6. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: In step D, the tensor is fully learned by the encoder with a bidirectional gated cyclic unit structure according to steps D1-1 to D1-3 as follows: Sequential context dependencies and output them; Step D1-1. Receive tensors using the forward branch in the encoder. According to the initialization For a zero vector, use the following formula: ; Obtain the forward hidden state of the fused traffic features of each target traffic monitoring point in each time slice within the period to be analyzed, where, Indicates the first [number]th ... The forward hidden state of traffic characteristics of each target traffic monitoring point in each time slice. This represents the forward branch function in the encoder. Indicates the first [number]th ... The traffic characteristics of each target traffic monitoring point in each time slice are fused and the forward hidden state is then processed, and then the process proceeds to step D1-2. Step D1-2. Receive tensors using the reverse branch in the encoder. According to the initialization For a zero vector, use the following formula: ; The inverse hidden state of the fused traffic features of each target traffic monitoring point in each time slice within the period to be analyzed is obtained, where, Indicates the first [number]th ... The traffic characteristics of each target traffic monitoring point in each time slice are integrated to hide the status in reverse. This represents the reverse branch function in the encoder. Indicates the first [number]th ... The traffic monitoring points of each target in each time slice are fused with traffic characteristics and their reverse hidden states are then processed, and then steps D1-3 are performed. Steps D1-3. For each time slice within the period to be analyzed, apply the following formula: ; Forward hidden state of fused traffic features of each target traffic monitoring point under time slice Reverse hidden state with integrated traffic features The data is stitched together and then subjected to linear projection transformation to obtain the encoder output. ,in, Represents the projection weight matrix. Indicates the bias term. This indicates a splicing operation.
7. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: In step D, steps D2-1 to D2-5 are performed as follows: a decoder composed of multiple two-stage time bottleneck attention modules is combined with spatiotemporal awareness embedding to perform multi-layer information extraction on the encoder output, generate corresponding spatiotemporal features and output them. Step D2-1. For each time slice within the prediction period, determine the time slice within the prediction period. And the day of the week in which the time slice is located. According to the following formula: ; Obtain the initial perceptual temporal embedding for each time slice within the prediction period. ,in, This indicates the number of time slices within the predicted period. , , They represent the learnable parameters, This represents the one-hot encoding function. This indicates a splicing operation. Represents the ReLU activation function. This indicates the initial time-aware embedding within the prediction period, and then proceeds to step D2-2; Step D2-2. For each time slice within the prediction period, apply the following formula: ; Obtain the time-aware embedding corresponding to the prediction period ,in, This represents the multilayer perceptron function with no bias term, and then proceeds to step D2-3; Step D2-3. First, follow the formula below: ; Obtain the symmetric normalized graph Laplace matrix ,in, Represents the identity matrix. This represents a predefined adjacency matrix, and , express The degree matrix; Then press Eigenvalue decomposition is performed to obtain the eigenvalue matrix Λ and the associated eigenvector matrix. and projection Extract preset The smallest nontrivial feature vectors together form a spatially aware node representation, constituting the initial spatial embedding. Then proceed to steps D2-4; Step D2-4. For the initial spatial embedding According to the following formula: ; Obtaining spatial embedding Embedding space In the prediction period dimension Broadcasting is performed to obtain spatial information about the space in the time dimension. and embed time awareness In spatial dimension Broadcast on, generate Then proceed to steps D2-5; Step D2-5. Based on multiple two-stage time bottleneck attention modules in the decoder, first determine the input of each two-stage time bottleneck attention module according to the following formula; ; in, Indicates the first in the decoder The output of the two-stage time bottleneck attention module Indicates the first in the decoder The input to each two-stage time bottleneck attention module is then processed according to the following formula: ; ; The outputs of each target traffic monitoring point regarding each two-stage time bottleneck attention module across all time slices of the prediction period are obtained. Furthermore, the outputs of each target traffic monitoring point regarding the last two-stage time bottleneck attention module across all time slices of the prediction period are obtained, forming the spatiotemporal features of the decoder output. Indicates the first The target traffic monitoring point regarding the first The output of the two-stage time bottleneck attention module across all time slices of the prediction period. , Indicates trainable parameters, , This represents a trainable temporal memory unit used to compress and represent global temporal patterns in long temporal inputs. Indicates the first The target traffic monitoring point regarding the first The output of the two-stage time bottleneck attention module across all time slices of the prediction period. This represents the function for the multi-head self-attention mechanism.
8. The traffic flow prediction method based on a discrete-continuous hybrid spatiotemporal network according to claim 1, characterized in that: The network to be trained is trained based on the loss function's mean square error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE).