Traffic flow prediction method and system based on CT-SSM and double-path dynamic graph convolution
By combining CT-SSM with dual-path dynamic graph convolution, the problems of high computational complexity and topology fixation in traffic flow prediction are solved. This approach effectively captures long-range temporal dependencies and dynamic spatial relationships, thereby improving the robustness and generalization performance of traffic flow prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-09
AI Technical Summary
Existing traffic flow prediction methods suffer from high computational complexity, topological fixation, and insufficient fusion of spatiotemporal features, making it difficult to effectively capture long-range temporal dependencies and dynamic spatial correlations.
A method based on CT-SSM and dual-path dynamic graph convolution is adopted. By constructing a topology map of the urban traffic physical road network, the historical traffic flow sequence tensor is obtained. Multi-period fusion features and spatiotemporal attention mechanism are used to generate a global implicit semantic map and a local physical evolution map. Spatial depth features are aggregated by dual-path collaborative dynamic graph convolution, and weighted fusion is performed through dynamic gating units. Finally, the traffic flow prediction results are output.
While maintaining linear computational complexity, it effectively captures the long-term temporal dependencies of traffic flow, overcomes the lack of dynamics in static graph structures, and improves the model's prediction robustness and generalization performance in complex scenarios.
Smart Images

Figure CN121938203B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of intelligent transportation systems, and in particular to a traffic flow prediction method and system based on CT-SSM and dual-path dynamic graph convolution. Background Technology
[0002] Traffic flow prediction is a core task of intelligent transportation systems, aiming to predict the traffic conditions (flow, speed, occupancy) of future road networks using historical data, and to provide decision support for signal control, route planning and congestion mitigation.
[0003] The existing technology has the following main drawbacks:
[0004] 1. Computational complexity limitations of time series modeling;
[0005] Traditional RNN-like models (LSTM, GRU) suffer from the vanishing gradient problem when processing long sequences, and their sequential computation is inefficient. While the Transformer architecture can capture long-range dependencies, the computational complexity of its self-attention mechanism increases with the sequence length. Quadratic growth makes it difficult to meet the real-time forecasting needs of extremely long historical observation windows (such as multi-period fusion data).
[0006] 2. Lack of dynamics in spatial topology;
[0007] Existing graph neural networks (GCNs) generally employ predefined static adjacency matrices, which solidify the spatial influence weights between nodes. However, traffic connections in real road networks exhibit significant time-varying characteristics: the correlation of commuter links increases sharply during morning and evening rush hours, and nodes that are geographically distant but have similar functional attributes (such as CBDs in different areas) show similar tidal patterns. Static graph structures cannot characterize this dynamic evolution.
[0008] 3. Insufficient fusion of spatiotemporal features;
[0009] Existing methods mostly adopt a simple temporal-spatial module stacking architecture, lacking collaborative modeling of multi-scale periodic characteristics (short-term proximity, daily periodicity, weekly periodicity), and have not established an adaptive spatial feature aggregation mechanism driven by both physical connectivity and semantic similarity. Summary of the Invention
[0010] This invention aims to solve the problems of high computational complexity, topology rigidity, and insufficient fusion in the existing technology, and provides a traffic flow prediction method and system based on CT-SSM and dual-path dynamic graph convolution.
[0011] To achieve the above objectives, the technical solution provided by this invention is as follows:
[0012] Traffic flow prediction methods based on CT-SSM and dual-path dynamic graph convolution include:
[0013] S1. Construct the urban traffic physical road network topology map and obtain the historical traffic flow sequence tensor. ;
[0014] S2, Based on historical traffic flow sequence tensors The multi-period fusion feature tensor is obtained. ;
[0015] S3, Fusing multi-period feature tensors The input is fed into the temporal feature extraction module based on a continuous-time state-space model. Based on data-driven selectivity parameters, the module performs state recursion after discretization via a zero-order hold to extract historical traffic flow temporal features, and finally outputs a temporal feature tensor. ;
[0016] S4, Combining Temporal Feature Tensors After spatiotemporal embedding, based on spatiotemporal attention mechanism and static mask constraint, global implicit semantic graph and local physical evolution graph are generated in parallel.
[0017] S5. Based on the global implicit semantic graph and the local physical evolution graph, spatial depth features are aggregated through dual-path collaborative dynamic graph convolution to obtain the global semantic feature tensor. and local physical feature tensor ;
[0018] S6. The global semantic feature tensor is processed by a dynamic gating unit based on the current spatiotemporal context. and local physical feature tensor Weighted fusion is performed to obtain the final comprehensive spatiotemporal feature tensor. ;
[0019] S7. Integrating the spatiotemporal feature tensor The fully connected output layer of the prediction result output module transforms the feature dimension into the target prediction dimension through nonlinear mapping, thereby outputting the future prediction dimensions of all road network nodes. The predicted value at each time step.
[0020] Furthermore, based on the historical traffic flow sequence tensor Multi-period fusion characteristics were obtained. ,include:
[0021] Based on historical traffic flow sequence tensors Extract the most recent time window data immediately preceding the current prediction time to construct a short-time series tensor. ;
[0022] Based on historical traffic flow sequence tensors Extract data from multiple historical days that fall within the same intraday timeframe as the current prediction time, and construct a daily periodic sequence tensor. ;
[0023] Based on historical traffic flow sequence tensors Extract data from historical weeks that are in the same phase as the current prediction time of the same week, and construct a weekly cycle sequence tensor. ;
[0024] short time series tensor Daily periodic sequence tensor Periodic sequence tensor Cascading and fusion splicing operations are performed along the feature channel dimension to obtain multi-period fusion features. .
[0025] Furthermore, the temporal feature tensor is obtained. The process is as follows:
[0026] Multi-period fusion feature tensors are fused using a linear projection layer. Mapped to continuous time domain characteristic signals ;
[0027] The input data at the current time is projected through a linear projection layer. Real-time mapping to continuous-time state transition matrix With input matrix , as a data-driven selective control parameter;
[0028] Establish the continuous-time state evolution equation: ,in, This represents the model's hidden state vector. Its derivative with respect to time;
[0029] Introducing a time step scale parameter Δ generated from input feature mapping, a zero-order hold is used to transform the continuous-time system matrix into a discrete system matrix. and ;
[0030] Perform discretized state recursion: ,in, For discrete time step index, and The first The hidden state vector of each step is fused with the input features;
[0031] Collect the hidden state sequence at each time step The global temporal feature tensor is obtained through output mapping. .
[0032] Furthermore, generating the global implicit semantic graph includes:
[0033] Introducing a learnable temporal location embedding matrix The spatial location embedding matrix obtained by performing Laplace eigenvalue decomposition on the initial static adjacency matrix. ;
[0034] Embed time position into matrix Spatial location embedding matrix With global temporal feature tensor Element-wise addition is performed to obtain the spatiotemporal location-aware tensor. ;
[0035] ;
[0036] Perform multi-head self-attention computation along the time axis dimension of the spatiotemporal location-aware tensor to obtain the temporal attention aggregation tensor. ;
[0037] Temporal attention aggregation tensor Mapped to a spatial query matrix and space bond matrix : ;
[0038] ;
[0039] and This is the corresponding spatial projection weight matrix;
[0040] Calculate the dynamic space correlation matrix , which serves as the adjacency matrix of the global implicit semantic graph, thus yielding the global implicit semantic graph;
[0041] Generating a local physics evolution graph includes:
[0042] Temporal attention aggregation tensor Each is projected as a local source node feature representation matrix. and local target node feature representation matrix :
[0043] ;
[0044] ;
[0045] and This is the corresponding learnable space mapping weight matrix;
[0046] Calculate the initial local feature evolution matrix :
[0047] ;
[0048] This is the transpose of the feature representation matrix of the local target nodes;
[0049] Set the main diagonal of the initial local feature evolution matrix to 1, and connect it to the predefined static binary physically connected mask matrix. Perform the Hadamard product operation:
[0050] ;
[0051] in, This is the adjacency matrix of the local spatiotemporal graph after physical constraints. It is the identity matrix. This is a predefined static binary physical connectivity mask matrix, whose internal elements are set to 1 or 0 based on the actual road network connectivity. This represents the Hadamard product operation between matrix elements;
[0052] Feature remapping is performed using a lightweight 2D convolutional neural network, followed by activation function normalization to generate a locally adaptive dynamic adjacency matrix. Thus, a local physical evolution diagram is obtained;
[0053] ;
[0054] Represents a lightweight two-dimensional convolution mapping operation It is a non-linear activation function.
[0055] Furthermore, spatial depth feature aggregation is performed through dual-path collaborative dynamic graph convolution, including:
[0056] correlation matrix of dynamic space Calculate the normalized Laplacian matrix The dynamic semantically scaled Laplacian matrix is obtained by scaling using the largest eigenvalue. :
[0057] ;
[0058] in, for The largest eigenvalue, It is the identity matrix;
[0059] Based on dynamic semantic scaling of Laplacian matrix Using Chebyshev polynomials to aggregate temporal attention tensors implement The convolutional space of the order graph is aggregated to obtain the global semantic feature tensor. :
[0060] ;
[0061] in, Let be the Chebyshev polynomial order of the graph convolution, and let be the neighbor hop count representing the aggregation of spatial features. For the corresponding branch, the first Learnable Chebyshev combination coefficients; This is a Chebyshev polynomial of the first kind, which strictly follows the following recursive definition:
[0062] ;
[0063] ;
[0064] ;
[0065] Local adaptive dynamic adjacency matrix Calculate the dynamic physical scaling Laplace matrix By performing graph convolution aggregation using Chebyshev polynomials, local physical feature tensors are obtained. :
[0066] ;
[0067] in, For the corresponding branch, the first Learnable Chebyshev combination coefficients.
[0068] Furthermore, for the global semantic feature tensor and local physical feature tensor Weighted fusion includes:
[0069] global semantic feature tensor and local physical feature tensor Perform cascading;
[0070] Through linear transformation and Activation function calculates dynamic gating weights ; This represents the concatenation operation of feature tensors. The weight matrix is a learnable matrix. For bias terms, For activation functions;
[0071] Using dynamic gating weights Element-wise weighted fusion of the two-path features is performed to generate a comprehensive spatiotemporal feature tensor. :
[0072] ;
[0073] in, This represents the Hadamard product operation between matrix elements;
[0074] Integrating the spatiotemporal feature tensor The data is fed into the output transformation layer, and the output of all network nodes in the future... The predicted value at each time step.
[0075] Furthermore, it also includes selecting Huber Loss as the loss function and completing the model training, i.e., parameter optimization, through backpropagation;
[0076] The constructed Huber Loss function is as follows:
[0077] ;
[0078] The predicted tensor output by the model. For the corresponding real traffic flow observation tensor, The preset hyperparameter threshold;
[0079] The loss value is backpropagated along the model network architecture to calculate the gradients of all learnable parameters;
[0080] use The optimizer iteratively updates the parameters based on gradient information:
[0081] ;
[0082] in, This represents the parameters to be optimized. The initial learning rate, and These are the correction values for the first and second moments of the gradient, respectively. To prevent small constants from being divided by zero;
[0083] Finally, when the model training reaches the preset iteration limit or the validation set loss function tends to stabilize, the iteration stops and the current optimal model weights are stored. At this point, the model training is complete. In the practical application stage, the historical traffic flow sequence of the period to be predicted is input into the trained model in real time, and the prediction results of future traffic flow are output.
[0084] Furthermore, to achieve the above objectives, the present invention also provides a traffic flow prediction system based on CT-SSM and dual-path dynamic graph convolution, used to implement the above-mentioned traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution, comprising:
[0085] The multi-scale periodic feature embedding module is used to construct the topology map of the urban traffic physical road network, extract and fuse multi-scale periodic historical traffic flow sequences, and obtain multi-period fused feature tensors.
[0086] The temporal feature extraction module based on the continuous-time state-space model extracts historical traffic flow temporal features by performing state recursion after discretization via a zero-order hold based on data-driven selective parameters and multi-period fused feature tensors, and outputs the temporal feature tensor.
[0087] The dynamic spatiotemporal topology adaptive generation module is used to generate global implicit semantic graphs and local physical evolution graphs in parallel based on spatiotemporal attention mechanisms and static mask constraints.
[0088] The dual-path dynamic graph convolution and gating fusion module is used to perform spatial depth feature aggregation based on the global implicit semantic graph and the local physical evolution graph through dual-path collaborative dynamic graph convolution to obtain a global semantic feature tensor and a local physical feature tensor; and to use a dynamic gating unit to perform weighted fusion of the global semantic feature tensor and the local physical feature tensor to obtain a comprehensive spatiotemporal feature tensor.
[0089] The prediction result output module is used to feed the comprehensive spatiotemporal feature tensor into the final fully connected output layer, and convert the feature dimension into the target prediction dimension through nonlinear mapping, thereby outputting the future prediction results of all road network nodes. The predicted value at each time step.
[0090] Furthermore, to achieve the above objectives, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the above-described traffic flow prediction method.
[0091] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the traffic flow prediction method described above.
[0092] Compared with existing technologies, the principles and advantages of this technical solution are as follows:
[0093] 1. CT-SSM discretizes selective control parameters with a zero-order hold, while maintaining... While achieving linear computational complexity, it can effectively capture the long-term temporal dependencies of traffic flow, solving the computational bottleneck problem caused by the quadratic complexity of Transformer.
[0094] 2. Parallel generation of global implicit semantic graphs (based on feature similarity) and local physical evolution graphs (based on mask constraints) not only follows the connectivity rules of real road networks, but also discovers the implicit associations between functionally similar nodes, overcoming the problem of lack of dynamism in static graph structures.
[0095] 3. Based on Chebyshev polynomial dual-path dynamic graph convolution combined with spatiotemporal gating mechanism, the model can adaptively adjust the fusion weights of global semantic and local physical feature tensors according to real-time traffic conditions, thereby improving the prediction robustness in complex scenarios.
[0096] 4. By cascading short-term, daily, and weekly features, the system enhances the ability to represent the periodicity and tidal nature of the input data from the source, thereby improving the model's generalization performance for non-stationary traffic flows. Attached Figure Description
[0097] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0098] Figure 1 This is a flowchart illustrating the principle of the traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution of the present invention.
[0099] Figure 2 This is a connection block diagram of the traffic flow prediction system based on CT-SSM and dual-path dynamic graph convolution of the present invention. Detailed Implementation
[0100] The present invention will be further described below with reference to specific embodiments:
[0101] like Figure 1 As shown in this embodiment, the traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution includes the following steps:
[0102] S1. Construct the urban traffic physical road network topology map and obtain the historical traffic flow sequence tensor. ;
[0103] To enable the predictive model to accurately capture complex spatiotemporal dependencies, the physical urban traffic network is first abstracted into a structured directed graph. The specific definitions are as follows:
[0104] Represents the distribution in the transportation network A set of monitoring nodes, each node corresponding to a real physical sensor on the road network.
[0105] The set of edges representing the physical road connections reflects the topological connectivity of the roads.
[0106] It is an initial static adjacency matrix constructed based on the physical connectivity of roads.
[0107] Defined at time step The signal characteristics of the road network map at time t are matrix ,in Traffic feature dimensions (including but not limited to key indicators such as road traffic volume, average driving speed, and road occupancy) are collected independently for each node. The time window length for historical observations is set to [value missing]. The historical traffic flow sequence tensor is then represented as The ultimate goal of this step is to provide the model with basic inputs to learn a feedforward prediction mapping. , through the front Observational data at each time step to predict the future Traffic flow trends at each time step .
[0108] S2, Based on historical traffic flow sequence tensors Multi-period fusion characteristics were obtained. ;
[0109] Urban traffic flow is strongly driven by daily human commuting behavior, exhibiting significant periodicity and tidal characteristics. To overcome the information limitations of a single time observation window and enhance the feature representation capability of the input data, this step introduces a multi-scale periodic data sampling mechanism to reconstruct the features of the input data:
[0110] Based on historical traffic flow sequence tensors Extract the most recent time window data immediately preceding the current prediction time to construct a short-time series tensor. ;
[0111] Based on historical traffic flow sequence tensors Extract data from multiple historical days that fall within the same intraday timeframe as the current prediction time, and construct a daily periodic sequence tensor. ;
[0112] Based on historical traffic flow sequence tensors Extract data from historical weeks that are in the same phase as the current prediction time of the same week, and construct a weekly cycle sequence tensor. ;
[0113] short time series tensor Daily periodic sequence tensor Periodic sequence tensor Cascading and fusion splicing operations are performed along the feature channel dimension to obtain multi-period fusion features. :
[0114] .
[0115] S3, Multi-period fusion feature The input is fed into a temporal feature extraction module built on a continuous-time state-space model. Based on data-driven selectivity parameters, the module performs state recursion after discretization via a zero-order hold to extract historical traffic flow temporal features, ultimately outputting a temporal feature tensor. ;
[0116] When dealing with long traffic sequences, existing technologies such as RNNs are prone to gradient vanishing, while Transformers have quadratic computational complexity. To address the computational bottleneck caused by the explosion of computing power, this step introduces concepts based on the Continuous Time State-Space Model (CT-SSM). The aim is to leverage the memory advantage of state-space equations for complex time-varying signals to process the multi-period fused feature tensor output from step S2. Perform deep state evolution analysis to maintain linear computational complexity. Under the premise of [specific conditions], this method efficiently and losslessly captures the long-range temporal dependencies of traffic flow. The specific execution process is as follows:
[0117] S3-1. Continuous-time mapping and selective control of multi-period signals
[0118] Multi-period fusion features are achieved through a linear projection layer. Mapped to continuous time domain characteristic signals ;
[0119] To overcome the shortcomings of traditional models that indiscriminately absorb all information, this step further introduces selective control parameters; specifically, the input data at the current time step is projected through a linear projection layer. Real-time mapping to continuous-time state transition matrix With input matrix This makes the system matrix no longer a static parameter, but a data-driven "selective control parameter"; its continuous-time state evolution equation is defined as follows:
[0120] ;
[0121] in, This represents the model's hidden state vector. Its derivative with respect to time; and This refers to the selective control parameter, the value of which is determined by... Dynamic generation is used to indicate that the model selectively remembers key evolutionary trends or forgets redundant noise at the current moment.
[0122] S3-2, Discretization State Recursion Introduced with Scale Parameter
[0123] To perform efficient computation on discrete computer hardware, this step introduces a time step scale parameter Δ generated from input feature mapping, and utilizes a zero-order hold (ZOH) to combine this time step scale parameter. , the continuous-time system matrix and Convert to discrete system matrix and Subsequently, the discretized state recursive calculation is performed, as shown in the following formula:
[0124] ;
[0125] in, For discrete time step index, and The first The hidden state vector of each step is fused with the input features; and The system transition matrix is the result of discretization, derived from a continuous matrix and the time scale parameter. The mathematical transformation; this step realizes deep traffic state iteration with linear time complexity.
[0126] S3-3, Output of the Global Temporal Feature Tensor
[0127] Finally, the hidden state sequences of all time steps obtained from the discretization recursion in step S3-2 are collected. By aligning the feature dimensions through output mapping weights, these state sequences have been highly compressed and the long-range temporal dependencies of historical traffic flows have been fully extracted. Concatenating and outputting these sequences yields a global temporal feature tensor representing the long-range evolution trend of all road network nodes. This tensor is directly used as the basic input for the subsequent step S4 to construct the dynamic spatiotemporal topology.
[0128] S4, Combining Temporal Feature Tensors Based on the spatiotemporal attention mechanism and static mask constraints, a global implicit semantic graph and a local physical evolution graph are generated in parallel. The specific process of this step is as follows:
[0129] S4-1, Spatiotemporal Location Embedding Enhancement
[0130] To enable the model to accurately perceive the periodic changes in traffic flow sequences and the spatial location attributes of nodes, this sub-step performs feature enhancement on the long-term feature tensor extracted from the state-space model. Specifically, a learnable temporal location embedding matrix is introduced to assign a unique timestamp identifier to each time step in the historical sequence. At the same time, by performing Laplace eigenvalue decomposition on the initial static adjacency matrix representing the physical connectivity of roads, a spatial location embedding matrix reflecting the topological location of each node in the global road network is extracted.
[0131] After dimensional alignment, the temporal location embedding matrix, spatial location embedding matrix, and global temporal feature tensor are subjected to element-wise broadcast addition to obtain the spatiotemporal location-aware tensor, as follows:
[0132] ;
[0133] in, For spatiotemporal location sensing tensors For global temporal feature tensors, Embed the matrix for time location. Embed the matrix for spatial location.
[0134] S4-2, Multi-head Time Attention Allocation Across Time Steps
[0135] To accurately capture the long-range temporal dependence of traffic flow sequences and suppress random instantaneous noise, this sub-step senses the tensor at the spatiotemporal location. Multi-head self-attention computation is performed along the time axis, and high-order extraction of temporal dependencies is achieved through global feature aggregation.
[0136] Regarding the first A single attention point is used to transform the spatiotemporal location perception tensor using a projection weight matrix. The linear mapping consists of a query matrix, a key matrix, and a value matrix, and the calculation formula is as follows:
[0137] ;
[0138] ;
[0139] ;
[0140] in, , , Representing the first The query matrix, key matrix, and value matrix of each attention head. , , This is the corresponding projection weight matrix;
[0141] Subsequently, the temporal correlation matrix is calculated to quantify the dependency weights between different historical moments at the same spatial node, as shown in the following formula:
[0142] ;
[0143] in, For the first The temporal correlation matrix of each attention head, whose internal elements represent the contribution of features at each time step to the current predicted state; in this process, instantaneous anomalous noise that does not conform to the main trend of traffic evolution is excluded due to its low semantic relevance. They are assigned extremely low weights in the normalization assignment, thus being effectively filtered out during the weighted aggregation process;
[0144] Finally, the outputs of all attention heads are concatenated and concatenated, and then dimensionality is reduced using the output projection matrix to finally calculate the noise-filtered temporal attention aggregation tensor:
[0145] ;
[0146] in, Aggregate tensors for temporal attention. The preset total number of attention heads, to This is the value matrix for each attention head. To output the projection matrix.
[0147] S4-3, Generation of Global Implicit Semantic Graph
[0148] To overcome the physical distance limitation and form a positive interaction with the subsequent local physical topology, this sub-step does not directly use the original input data, but instead uses the temporal attention aggregation tensor after filtering out temporal noise as described above. Based on this, the deep semantic relationships between nodes in the entire road network are further explored along the spatial axis dimension. This serial cascaded design effectively prevents the interference of instantaneous traffic anomalies on spatial similarity calculation, ensuring that the generated dynamic spatial relationships are more stable and pure. Specifically, the spatial projection weight matrix is used to... The query matrix and key matrix are mapped to a spatial dimension, and the calculation formula is as follows:
[0149] ;
[0150] ;
[0151] in, and These represent the spatial query matrix and the spatial key matrix, respectively. and This is the corresponding spatial projection weight matrix;
[0152] By calculating the feature similarity between nodes in the entire road network, a dynamic spatial correlation matrix representing the synchronicity of traffic evolution between any two nodes is generated, as shown in the following formula:
[0153] ;
[0154] in, This is a dynamic spatial correlation matrix. This is the transpose of the space bond matrix. The scaling factor is used for the spatial dimension; this matrix is purely based on the comparison of nodes using data features refined over time, thereby accurately identifying functionally related nodes that are not geographically adjacent but have similar traffic tidal patterns. In the architecture of this invention, this dynamic spatial correlation matrix... That is, the adjacency matrix of the constructed "global implicit semantic graph" directly serves the subsequent global semantic graph convolutional branch.
[0155] S4-4, Generation of Local Physical Evolution Diagram
[0156] To complement the global implicit semantic graph in sub-step S4-3, this sub-step independently constructs a local adaptive dynamic adjacency matrix representing the congestion spread of the real road network based on physical topology knowledge.
[0157] First, the temporal attention aggregation tensor is used. Construct the initial local feature evolution matrix between nodes Specifically, two independent learnable space mapping weight matrices are introduced, which will... The features are projected as local source node feature representations and local target node feature representations, respectively, and their calculation formulas are as follows:
[0158] ;
[0159] ;
[0160] in, and These are the local source node feature representation matrix and the local target node feature representation matrix, respectively. and This is the corresponding learnable space mapping weight matrix;
[0161] Subsequently, by calculating the inner product of the source node feature representation and the target node feature representation, an initial local feature evolution matrix characterizing the dynamic local connectivity tendency between nodes is generated, as shown in the following formula:
[0162] ;
[0163] in, This is the initial local feature evolution matrix. This is the transpose of the feature representation matrix of the local target nodes;
[0164] To ensure that the generated topology conforms to real urban road connectivity rules, all the main diagonals of the initial local feature evolution matrix are set to 1, and a Hadamard product is performed with a predefined static binary mask matrix to filter out edge weights that are physically impossible to have connectivity. The constraint calculation formula is as follows:
[0165] ;
[0166] in, This is the adjacency matrix of the local spatiotemporal graph after physical constraints. It is the identity matrix. This is a predefined static binary physical connectivity mask matrix, whose internal elements are set to 1 or 0 based on the actual road network connectivity. This represents the Hadamard product operation between matrix elements;
[0167] Furthermore, the locally spatiotemporal graph adjacency matrix after physical constraints is fed into a lightweight two-dimensional convolutional neural network for feature remapping, and normalized by an activation function to generate a locally adaptive dynamic adjacency matrix. The formula is as follows:
[0168] ;
[0169] in, This is the final output local adaptive dynamic adjacency matrix. Represents a lightweight two-dimensional convolution mapping operation It is a non-linear activation function; this is the locally adaptive dynamic adjacency matrix. It strictly adheres to the underlying physical constraints of the transportation network and directly serves the subsequent local physical dynamic graph convolutional branches.
[0170] S5. Based on the global implicit semantic graph and the local physical evolution graph, spatial depth features are aggregated through dual-path collaborative dynamic graph convolution to obtain the global semantic feature tensor. and local physical feature tensor ;
[0171] The core of this step lies in using a data-driven dynamic graph structure to achieve adaptive spatial aggregation of features. Specifically, it involves constructing a mutually orthogonal dual-path parallel graph convolution architecture, using Chebyshev multinomials as convolution kernels, enabling the model to dynamically adjust the feature capture path and weights according to real-time traffic flow changes. The specific execution is as follows:
[0172] S5-1, Global Semantic Graph Convolutional Branch
[0173] This branch aims to break the spatial constraints of physical road networks by leveraging dynamically evolving semantic associations; firstly, it obtains the dynamic spatial correlation matrix generated in step S4-3. Calculate its corresponding normalized Laplace matrix. ;
[0174] To satisfy the mathematical requirements of Chebyshev polynomials regarding the input eigenvalue range, the Laplacian matrix is scaled using the largest eigenvalue to obtain a dynamically semantically scaled Laplacian matrix. :
[0175] ;
[0176] in, for The largest eigenvalue, It is the identity matrix;
[0177] Subsequently, based on this scaled Laplacian matrix, the temporal attention aggregation tensor is applied using Chebyshev polynomials. implement Graph convolution spatial aggregation:
[0178] ;
[0179] in, This is the first spatial aggregation feature tensor output by this branch; Let be the Chebyshev polynomial order of the graph convolution, and let be the neighbor hop count representing the aggregation of spatial features. For the first Learnable Chebyshev combination coefficients; This is a Chebyshev polynomial of the first kind, which strictly follows the following recursive definition:
[0180] ;
[0181] ;
[0182] ;
[0183] because With real-time dynamic attributes, this branch enables efficient modeling of dynamic implicit dependencies between geographically non-adjacent nodes, allowing feature aggregation weights to adaptively adjust as the overall road network pattern evolves.
[0184] S5-2, Local Physical Dynamics Graph Convolution Branch
[0185] Simultaneously, a local physical dynamic graph convolution branch is executed in parallel to capture the physical spread of congestion along the real road network; this branch receives the local adaptive dynamic adjacency matrix generated in step S4-4. And similarly calculate its corresponding dynamic physical scaling Laplacian matrix. ;
[0186] Graph convolution aggregation computation is performed using the same Chebyshev approximation principle:
[0187] ;
[0188] in, This is the second spatial aggregation feature tensor output by this branch; For the first branch Learnable Chebyshev combination coefficients; The recursive calculation method is consistent with step S5-1;
[0189] This branch passes Its dynamic evolution gives the model the ability to adaptively adjust its receptive field based on real-time traffic saturation on real physical links, thereby enabling it to accurately characterize the dynamic reconstruction of local spatial dependencies caused by sudden events with extremely low graph signal processing overhead.
[0190] S6. Construct a dynamic gating unit based on the current spatiotemporal context, and use this dynamic gating unit to process the global semantic feature tensor. and local physical feature tensor Perform weighted fusion and output the prediction results;
[0191] This step aims to adaptively weight and integrate the global semantic feature tensor and the local physical feature tensor output from step S5 to achieve multimodal feature complementarity under different traffic conditions. The specific process is as follows:
[0192] Step S6-1: Generation of dynamic gating weights
[0193] To achieve an automatic balance between the model's global dependencies and the importance of local evolution, a dynamic gating unit based on the current spatiotemporal context is constructed; the global semantic feature tensor is then... With local physical feature tensor The system is cascaded, and the dynamic gating weights are calculated using linear transformations and activation functions. :
[0194] ;
[0195] in, This is the gating weight coefficient. This represents the concatenation operation of feature tensors. The weight matrix is a learnable matrix. For bias terms, This is the activation function; the weights It can adaptively adjust the model's focus ratio on global correlation information and local physical information according to the complexity of real-time traffic flow;
[0196] Step S6-2: Weighted fusion of spatiotemporal features
[0197] The dynamic gating weights are used to perform element-wise weighted fusion of the dual-path features to generate the final comprehensive spatiotemporal feature tensor. The calculation formula is as follows:
[0198] ;
[0199] in, This represents the Hadamard product operation between matrix elements; this fusion mechanism ensures that the model can automatically extract the most distinctive spatial dependency features under different traffic periods (such as off-peak and peak hours);
[0200] S7. Integrating the spatiotemporal feature tensor The fully connected output layer of the prediction result output module transforms the feature dimension into the target prediction dimension through nonlinear mapping, thereby outputting the future prediction dimensions of all road network nodes. Predicted values at each time step:
[0201] in, This is a traffic flow prediction vector for the entire road network at multiple consecutive future moments. This represents the mapping operation of a multilayer perceptron network.
[0202] S8. Select Huber Loss as the loss function and optimize the model parameters.
[0203] This step aims to define the evaluation metrics for model training and to iteratively update all learnable parameters in the model using the backpropagation algorithm. The specific process is as follows:
[0204] S8-1, Loss Function Construction
[0205] To balance model convergence speed and improve robustness to abnormal traffic flow fluctuations, this sub-step constructs HuberLoss as the loss function; this function can assess the future performance of all network nodes. Predicted values at each time step Compared with the actual observed value The differences between them are quantified using multiple scales, and the calculation formula is as follows:
[0206] ;
[0207] in, The value of the loss function. The predicted tensor output by the model. For the corresponding real traffic flow observation tensor, The preset hyperparameter threshold is used; this loss function is effective when the prediction error is small (less than or equal to) This manifests as mean squared error, ensuring gradient stability and convergence speed; when the error is large (greater than...), it is considered a mean squared error. This manifests as a linear error, thereby reducing the severe interference of outlier noise on model parameter updates and improving the robustness of the prediction system.
[0208] S8-2, Backpropagation and Update of Model Parameters
[0209] The calculated total loss value is backpropagated along the model network architecture, and calculations are performed on the state-space model parameters, the multi-head attention weight matrix, and the Chebyshev polynomial combination coefficients. and and gating fusion weights The gradient of all learnable parameters, including those in the range;
[0210] Subsequently, the Adam optimizer is used to iteratively update the parameters based on the gradient information. During training, the learning rate of each parameter is dynamically adjusted using first-order moment estimation and second-order moment estimation, and the update mechanism is as follows:
[0211] ;
[0212] in, This represents the parameters to be optimized. The initial learning rate, and These are the correction values for the first and second moments of the gradient, respectively. To prevent small constants from being divided by zero;
[0213] S8-3. Optimal Model Storage and Result Export
[0214] When the model training reaches the preset iteration limit or the validation set loss function tends to stabilize, the iteration stops and the current optimal model weights are stored. In the practical application stage, the historical traffic flow sequence of the period to be predicted is input into the trained model in real time, and the traffic situation prediction results of the entire road network at each future time are directly derived through the end-to-end calculation of the previous steps.
[0215] Specifically, such as Figure 2 As shown, this embodiment also includes a traffic flow prediction system based on CT-SSM and dual-path dynamic graph convolution, used to implement the above-mentioned traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution, characterized in that it includes:
[0216] Multi-scale periodic feature embedding module: used to construct the topology map of urban traffic physical road network and obtain historical traffic flow sequences. Through the multi-scale periodic data sampling mechanism, it extracts short-time neighbor sequence tensors, daily periodic sequence tensors and weekly periodic sequence tensors respectively, and concatenates them in the feature channel dimension to generate multi-period fusion feature tensors.
[0217] The temporal feature extraction module based on the continuous-time state-space model extracts historical traffic flow temporal features by performing state recursion after discretization via a zero-order hold based on data-driven selective parameters and multi-period fused feature tensors, and outputs the temporal feature tensor.
[0218] The dynamic spatiotemporal topology adaptive generation module is used to receive the global temporal feature tensor and introduce spatiotemporal position embedding. After temporal denoising and purification through a multi-head temporal attention mechanism, it generates two topology graphs in parallel: one path mines deep associations to generate a global implicit semantic graph (i.e., a dynamic spatial correlation matrix), and the other path combines static binary mask constraints to generate a local physical evolution graph representing the real congestion spread (i.e., a local adaptive dynamic adjacency matrix).
[0219] Dual-path dynamic graph convolution and gating fusion module: Based on the dynamic spatial correlation matrix and the local adaptive dynamic adjacency matrix, spatial depth feature aggregation is performed in parallel through two branches: "global semantic graph convolution" and "local physical dynamic graph convolution". Then, the dual-path features are integrated by element-level adaptive weighting using dynamic gating units to obtain a comprehensive spatiotemporal feature tensor.
[0220] The prediction result output module is used to feed the comprehensive spatiotemporal feature tensor into the final fully connected output layer, and convert the feature dimension into the target prediction dimension through nonlinear mapping, thereby outputting the future prediction results of all road network nodes. The predicted value at each time step.
[0221] This embodiment also includes an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the traffic flow prediction method described above.
[0222] This embodiment also includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the traffic flow prediction method described above.
[0223] The above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Therefore, any changes made in accordance with the shape and principle of the present invention should be covered within the protection scope of the present invention.
Claims
1. A traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution, characterized in that, include: S1. Construct the urban traffic physical road network topology map and obtain the historical traffic flow sequence tensor. ; S2, Based on historical traffic flow sequence tensors The multi-period fusion feature tensor is obtained. ; S3, Fusing multi-period feature tensors The input is fed into the temporal feature extraction module based on a continuous-time state-space model. Based on data-driven selectivity parameters, the module performs state recursion after discretization via a zero-order hold to extract historical traffic flow temporal features, and finally outputs a temporal feature tensor. ; S4, Combining Temporal Feature Tensors After spatiotemporal embedding, based on spatiotemporal attention mechanism and static mask constraint, global implicit semantic graph and local physical evolution graph are generated in parallel. S5. Based on the global implicit semantic graph and the local physical evolution graph, spatial depth features are aggregated through dual-path collaborative dynamic graph convolution to obtain the global semantic feature tensor. and local physical feature tensor ; S6. The global semantic feature tensor is processed by a dynamic gating unit based on the current spatiotemporal context. and local physical feature tensor Weighted fusion is performed to obtain the final comprehensive spatiotemporal feature tensor. ; S7. Integrating the spatiotemporal feature tensor The fully connected output layer of the prediction result output module transforms the feature dimension into the target prediction dimension through nonlinear mapping, thereby outputting the future prediction dimensions of all road network nodes. The predicted value at each time step; Obtain temporal feature tensor The process is as follows: Multi-period fusion feature tensors are fused using a linear projection layer. Mapped to continuous time domain characteristic signals ; The input data at the current time is projected through a linear projection layer. Real-time mapping to continuous-time state transition matrix With input matrix , as a data-driven selective control parameter; Establish the continuous-time state evolution equation: ,in, This represents the model's hidden state vector. Its derivative with respect to time; Introducing a time step scale parameter Δ generated from input feature mapping, a zero-order hold is used to transform the continuous-time system matrix into a discrete system matrix. and ; Perform discretized state recursion: ,in, For discrete time step index, and The first The hidden state vector of each step is fused with the input features; Collect the hidden state sequence at each time step Temporal feature tensors are obtained through output mapping. ; Spatial depth feature aggregation is performed through dual-path collaborative dynamic graph convolution, including: correlation matrix of dynamic space Calculate the normalized Laplacian matrix The dynamic semantically scaled Laplacian matrix is obtained by scaling using the largest eigenvalue: : ; in, for The largest eigenvalue, It is the identity matrix; Based on dynamic semantic scaling of Laplacian matrix Using Chebyshev polynomials to aggregate temporal attention tensors implement The convolutional space of the order graph is aggregated to obtain the global semantic feature tensor. : ; in, Let be the Chebyshev polynomial order of the graph convolution, and let be the neighbor hop count representing the aggregation of spatial features. For the corresponding branch, the first Learnable Chebyshev combination coefficients; This is a Chebyshev polynomial of the first kind, which strictly follows the following recursive definition: ; ; ; Local adaptive dynamic adjacency matrix Calculate the dynamic physical scaling Laplace matrix By performing graph convolution aggregation using Chebyshev polynomials, local physical feature tensors are obtained. : ; in, For the corresponding branch, the first Learnable Chebyshev combination coefficients.
2. The traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution as described in claim 1, characterized in that, Based on historical traffic flow sequence tensors Multi-period fusion characteristics were obtained. ,include: Based on historical traffic flow sequence tensors Extract the most recent time window data immediately preceding the current prediction time to construct a short-time series tensor. ; Based on historical traffic flow sequence tensors Extract data from multiple historical days that fall within the same intraday timeframe as the current prediction time, and construct a daily periodic sequence tensor. ; Based on historical traffic flow sequence tensors Extract data from historical weeks that are in the same phase as the current prediction time of the same week, and construct a weekly cycle sequence tensor. ; short time series tensor Daily periodic sequence tensor Periodic sequence tensor Cascading and fusion splicing operations are performed along the feature channel dimension to obtain multi-period fusion features. .
3. The traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution as described in claim 1, characterized in that, Generating a global implicit semantic graph includes: Introducing a learnable temporal location embedding matrix The spatial location embedding matrix obtained by performing Laplace eigenvalue decomposition on the initial static adjacency matrix. ; Embed time position into matrix Spatial location embedding matrix With global temporal feature tensor Element-wise addition is performed to obtain the spatiotemporal location-aware tensor. ; ; Perform multi-head self-attention computation along the time axis dimension of the spatiotemporal location-aware tensor to obtain the temporal attention aggregation tensor. ; Temporal attention aggregation tensor Mapped to a spatial query matrix and space bond matrix : ; ; and This is the corresponding spatial projection weight matrix; Calculate the dynamic space correlation matrix , which serves as the adjacency matrix of the global implicit semantic graph, thus yielding the global implicit semantic graph; Generating a local physics evolution graph includes: Temporal attention aggregation tensor Projected into local source node feature representation matrices respectively and local target node feature representation matrix : ; ; and This is the corresponding learnable space mapping weight matrix; Calculate the initial local feature evolution matrix : ; This is the transpose of the feature representation matrix of the local target nodes; Set the main diagonal of the initial local feature evolution matrix to 1, and connect it to the predefined static binary physically connected mask matrix. Perform the Hadamard product operation: ; in, This is the adjacency matrix of the local spatiotemporal graph after physical constraints. It is the identity matrix. This is a predefined static binary physical connectivity mask matrix, whose internal elements are set to 1 or 0 based on the actual road network connectivity. This represents the Hadamard product operation between matrix elements; Feature remapping is performed using a lightweight 2D convolutional neural network, followed by activation function normalization to generate a locally adaptive dynamic adjacency matrix. Thus, a local physical evolution diagram is obtained; ; Represents a lightweight two-dimensional convolution mapping operation It is a non-linear activation function.
4. The traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution as described in claim 1, characterized in that, The global semantic feature tensor is processed by a dynamic gating unit. and local physical feature tensor By performing weighted fusion, a comprehensive spatiotemporal feature tensor is obtained. include: Construct a dynamic gating unit based on the current spatiotemporal context to encode the global semantic feature tensor. and local physical feature tensor Perform cascading; Through linear transformation and Activation function calculates dynamic gating weights ; This represents the concatenation operation of feature tensors. The weight matrix is a learnable matrix. For bias terms, For activation functions; Using dynamic gating weights Element-wise weighted fusion of the two-path features is performed to generate a comprehensive spatiotemporal feature tensor. : ; in, This represents the Hadamard product operation between matrix elements; Integrating the spatiotemporal feature tensor Send to the fully connected output layer, outputting all network nodes in the future The predicted value at each time step.
5. The traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution as described in claim 1, characterized in that, The module for constructing prediction results outputs the predicted values and also includes selecting Huber Loss as the loss function and completing the prediction model training process, i.e., parameter optimization, through backpropagation. The Huber Loss function is as follows: ; The predicted tensor output by the model. For the corresponding real traffic flow observation tensor, The preset hyperparameter threshold; The loss value is backpropagated along the model network architecture to calculate the gradients of all learnable parameters; use The optimizer iteratively updates the parameters based on gradient information: ; in, This represents the parameters to be optimized. The initial learning rate, and These are the correction values for the first and second moments of the gradient, respectively. To prevent constants from being divided by zero; Finally, when the model training reaches the preset iteration limit or the validation set loss function tends to stabilize, the iteration stops and the current optimal model weights are stored. At this point, the model training is complete. In the practical application stage, the historical traffic flow sequence of the period to be predicted is input into the trained model in real time, and the prediction results of future traffic flow are output.
6. A traffic flow prediction system based on CT-SSM and dual-path dynamic graph convolution, used to implement the traffic flow prediction method based on CT-SSM and dual-path dynamic graph convolution as described in any one of claims 1-5, characterized in that, include: The multi-scale periodic feature embedding module is used to construct the topology map of the urban traffic physical road network, extract and fuse multi-scale periodic historical traffic flow sequences, and obtain multi-period fused feature tensors. The temporal feature extraction module based on the continuous-time state-space model extracts historical traffic flow temporal features by performing state recursion after discretization via a zero-order hold based on data-driven selective parameters and multi-period fused feature tensors, and outputs the temporal feature tensor. The dynamic spatiotemporal topology adaptive generation module is used to generate global implicit semantic graphs and local physical evolution graphs in parallel based on spatiotemporal attention mechanisms and static mask constraints. The dual-path dynamic graph convolution and gating fusion module is used to perform spatial depth feature aggregation based on the global implicit semantic graph and the local physical evolution graph through dual-path collaborative dynamic graph convolution to obtain a global semantic feature tensor and a local physical feature tensor; and to use a dynamic gating unit to perform weighted fusion of the global semantic feature tensor and the local physical feature tensor to obtain a comprehensive spatiotemporal feature tensor. The prediction result output module is used to feed the comprehensive spatiotemporal feature tensor into the final fully connected output layer, and convert the feature dimension into the target prediction dimension through nonlinear mapping, thereby outputting the future prediction results of all road network nodes. The predicted value at each time step.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the traffic flow prediction method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the traffic flow prediction method as described in any one of claims 1 to 5.