Traffic flow prediction method and system based on spatio-temporal hierarchical mixing

By adopting a spatiotemporal hierarchical hybrid approach, and employing gated MLP and hierarchical feature propagation mechanism, the problems of high computational complexity and insufficient accuracy of traffic flow prediction models for large-scale urban road networks are solved, achieving efficient and accurate traffic flow prediction.

CN120954218APending Publication Date: 2025-11-14BEIHANG UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511055141.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing traffic flow prediction models suffer from high computational complexity and difficulty in online deployment when dealing with large-scale urban road networks and long historical data. They also fail to accurately capture local or regional patterns and lack multi-scale feature extraction capabilities, resulting in insufficient prediction accuracy.

Method used

We adopt a spatiotemporal hierarchical hybrid approach, which compresses the temporal dimension through gated MLP, aggregates local nodes and regional features from bottom to top, and fuses them from top to bottom through a hierarchical feature propagation mechanism to generate multi-scale spatiotemporal features. We also reduce computational complexity by using a full MLP architecture.

Benefits of technology

It improves the accuracy and efficiency of traffic flow prediction, can more finely characterize spatiotemporal dependencies, enhances the ability to extract key features and the expressive power of the model, reduces computational complexity, and is suitable for large-scale urban traffic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120954218A_ABST
    Figure CN120954218A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method and system based on spatio-temporal hierarchical mixing, and relates to the technical field of traffic prediction, and the specific steps are as follows: obtaining an original traffic flow spatio-temporal sequence, mapping the original traffic flow spatio-temporal sequence, fusing spatial embedding and time period embedding, and generating an input feature; extracting time sequence features and multi-scale region features based on the input features, performing parallel extraction of node-level features and region-level features on the region features of each scale, and outputting the node-level features and a plurality of region-level features; fusing the region-level features step by step based on a hierarchical feature propagation mechanism, downloading the region-level features to the node-level features, generating space fusion features, and fusing the space fusion features layer by layer to generate time sequence fusion features; and fusing the highest-layer feature of the spatial fusion feature and the time sequence fusion feature to generate a fused spatial-temporal feature, and performing traffic prediction by using the fused spatial-temporal feature. According to the method, the efficiency and the prediction precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic forecasting technology, and more specifically to a traffic flow forecasting method and system based on spatiotemporal hierarchical hybridization. Background Technology

[0002] Currently, traffic flow prediction in the field of intelligent transportation mainly relies on graph neural networks (such as D2STGNN and GWNET) and Transformer models based on self-attention mechanisms (such as PDFormer and STAEformer) to model complex spatiotemporal correlations. These methods capture spatial dependencies between road network nodes through graph convolution operations and learn dynamic patterns of time series using recurrent structures or attention mechanisms. Meanwhile, to reduce model complexity, some studies have also introduced full MLP architectures (such as TSMixer and TimeMixer), hoping to achieve efficient prediction through a simpler structure. These techniques have demonstrated certain predictive capabilities on small- to medium-sized road networks and datasets.

[0003] However, the aforementioned mainstream methods have significant and insurmountable limitations when dealing with large-scale urban road networks (tens of thousands of sensor nodes) and long historical data sequences:

[0004] First, the computational complexity of graph neural networks and Transformer models is generally quadratic (O(N)). 2 First, as network size and prediction duration increase, training and inference costs rise explosively, making it difficult to meet the needs of city-level online deployment. Second, these models often apply a "one-size-fits-all" approach to all nodes or moments when constructing global associations, causing key features to be easily overwhelmed by a large amount of irrelevant noise, making it impossible to accurately capture local or regional patterns. Third, while existing lightweight MLP-Mixer models have a certain degree of linear scalability, they lack the ability to model the inherent hierarchical structure of data and cannot extract multi-level features such as neighborhood similarity, regional semantics, and macro trends at multiple scales. Therefore, it is still difficult to balance efficiency and accuracy in large-scale scenarios.

[0005] Therefore, how to design a traffic flow prediction model that can effectively model the multi-scale spatiotemporal characteristics of traffic flow and significantly reduce computational complexity while ensuring high prediction accuracy is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of this, the present invention provides a traffic flow prediction method and system based on spatiotemporal hierarchical hybridization, which overcomes the above-mentioned defects.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A traffic flow prediction method based on spatiotemporal hierarchical hybrid approach, comprising the following steps:

[0009] Obtain the original traffic flow spatiotemporal sequence, map the original traffic flow spatiotemporal sequence, and fuse spatial embedding and temporal periodic embedding to generate input features;

[0010] The input features are divided into multiple windows, and the temporal dimension is compressed by a gated MLP to output temporal features. The temporal features are aggregated into multi-scale regional features through a spatial aggregation path. Node-level features and regional features are extracted in parallel for each scale of regional features to output node-level features and multiple regional features.

[0011] Based on the hierarchical feature propagation mechanism, regional features are fused step by step and then passed down to node-level features to generate spatial fusion features. The spatial fusion features are then fused layer by layer to generate temporal fusion features.

[0012] The highest-level feature of the spatial fusion feature and the temporal fusion feature are fused to generate a fused spatiotemporal feature, and the fused spatiotemporal feature is used to predict traffic results.

[0013] Optionally, the spatial embedding includes static spatial embedding and dynamic spatial embedding. The static spatial embedding learns the topological features of the traffic network through the Node2Vec algorithm; the dynamic spatial embedding is a learnable parameter matrix.

[0014] Optionally, the time period embedding is composed of the intraday period embedding and the intraweek period embedding.

[0015] Optionally, the step of obtaining the time-series features is as follows:

[0016] The input features are divided into several subsequences according to a preset window length;

[0017] Each of the subsequences is input into two sets of window-mixed MLPs with independent parameters for mapping, to obtain the first mapping feature and the second mapping feature.

[0018] Based on the gating mechanism, the first mapping feature and the second mapping feature are fused and calculated element by element to generate time-series features.

[0019] Optionally, the steps for obtaining the node-level features and multiple region-level features are as follows:

[0020] The temporal features are aggregated along the node dimension to generate multi-scale regional features;

[0021] The original node-level features are input into a node-mixed MLP to capture fine-grained correlations at the node level and output node-level features.

[0022] The multi-scale regional features are input into the region adaptive hybrid MLP, a similarity matrix is ​​calculated based on a pre-established parameter pool, and linear transformation weights are adaptively generated. Regional features are then generated based on these linear transformation weights.

[0023] Optionally, the steps of the spatial fusion feature are as follows:

[0024] For the highest region-level features in layer l, a mapping layer is used to transform them into feature shapes that match the next level region scale.

[0025] Based on the highest-level regional features, each level of regional features is iteratively fused downwards to generate multi-scale fused features.

[0026] The multi-scale fusion features are merged with the node-level features, and the fused features are then input into the (l+1)th layer.

[0027] Optionally, the step of obtaining the temporal fusion features is as follows:

[0028] The features of the last layer of the spatial fusion features are transformed into feature shapes that match the time length of the features of the next layer through a mapping layer;

[0029] The process propagates downwards layer by layer, adding features from the next layer and transforming them through the FC layer to obtain the temporal fusion features.

[0030] Optionally, the expression for the loss function is:

[0031]

[0032] The expression for the orthogonal loss of the l-th layer is:

[0033]

[0034] In the formula, α and β are both weighting coefficients; This is the average absolute error loss; For parameter orthogonal loss; All are linear transformation weights.

[0035] A traffic flow prediction system based on spatiotemporal hierarchical hybrid system includes:

[0036] The data embedding module is used to acquire the original traffic flow spatiotemporal sequence, map the original traffic flow spatiotemporal sequence, and fuse spatial embedding and time period embedding to generate input features;

[0037] The spatiotemporal hybrid module is used to divide the input features into multiple windows, compress the temporal dimension through gated MLP, and output temporal features; the temporal features are aggregated into multi-scale regional features through spatial aggregation path, and node-level features and regional features are extracted in parallel for each scale of regional features, outputting node-level features and multiple regional features;

[0038] The feature fusion module is used to fuse regional features step by step based on a hierarchical feature propagation mechanism and then transmit them down to node-level features to generate spatial fusion features. The spatial fusion features are then fused layer by layer to generate temporal fusion features.

[0039] The prediction module is used to fuse the highest-level feature of the spatial fusion feature and the temporal fusion feature to generate a fused spatiotemporal feature, and to use the fused spatiotemporal feature to predict traffic results.

[0040] Optionally, the data embedding module includes:

[0041] The feature mapping unit is used to map the original traffic flow spatiotemporal sequence to generate traffic flow mapping data;

[0042] Spatial embedding unit, used to construct spatially embedded data by adding static spatial embedding and dynamic spatial embedding;

[0043] The time-period embedding unit is formed by adding intraday period embedding and intraweek period embedding to form time-period embedded data;

[0044] The feature fusion unit is used to fuse the traffic flow mapping data, the spatial embedding unit, and the time period embedding data element-wise to generate input features.

[0045] As can be seen from the above technical solution, the present invention discloses a traffic flow prediction method and system based on spatiotemporal hierarchical hybridization, which has the following advantages compared with the prior art:

[0046] 1. This invention integrates node-level, regional-level, and global-level features by aggregating local nodes and regional features from the bottom up and by propagating features from the top down. It makes full use of the dominant patterns contained in traffic data at different spatial and temporal resolutions, and can more finely depict the spatiotemporal dependencies from local to global, improve the ability to extract key features and the expressive power of the model, and thus improve the prediction accuracy.

[0047] 2. In each regional mixer, the present invention adopts a parameter pooling mechanism to adaptively generate a transformation matrix based on the input features, thereby realizing differentiated modeling of each functional area or road segment. It also maintains the mutual distinction of regional semantics through orthogonalization loss, completely solving the defect that predefined partitions cannot track the dynamic evolution of spatiotemporal correlations and improving the interpretability of regional features.

[0048] 3. This invention is built using a full MLP architecture, with the core operation being a linear transformation. The overall computational complexity is linear O(N), which improves the prediction accuracy while maintaining training efficiency comparable to linear models such as TSMixer. Attached Figure Description

[0049] 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 embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0050] Figure 1 This is a schematic diagram of the method flow provided by the present invention. Detailed Implementation

[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] This invention discloses a traffic flow prediction method based on spatiotemporal hierarchical hybridization. Through techniques such as hierarchical feature extraction, dynamic regional mixing, and multi-scale feature propagation, it achieves efficient and accurate prediction. Figure 1 As shown, the specific steps are as follows:

[0053] Step 1: Obtain the original traffic flow spatiotemporal sequence, map the original traffic flow spatiotemporal sequence, and fuse spatial embedding and temporal periodic embedding to generate input features;

[0054] Step 2: Divide the input features into multiple windows, compress the temporal dimension through gated MLP, and output temporal features; aggregate the temporal features into multi-scale regional features through spatial aggregation path, and extract node-level features and regional features in parallel for each scale of regional features, and output node-level features and multiple regional features.

[0055] Step 3: Based on the hierarchical feature propagation mechanism, the regional features are fused step by step and then passed down to the node-level features to generate spatial fused features. The spatial fused features are then fused layer by layer to generate temporal fused features.

[0056] Step 4: After fusing the highest-level features of the spatial fusion features and the temporal fusion features, generate fused spatiotemporal features, and use the fused spatiotemporal features to predict traffic results.

[0057] In one embodiment, spatial embedding includes static spatial embedding and dynamic spatial embedding. Static spatial embedding learns the topological features of the traffic network using the Node2Vec algorithm; dynamic spatial embedding is a learnable parameter matrix.

[0058] In one embodiment, the time period embedding is composed of the sum of intraday period embedding and intraweek period embedding.

[0059] Furthermore, step 1 involves mapping the original traffic flow spatiotemporal sequence to a high-dimensional feature space, and then fusing spatial structure priors and temporal periodic priors to lay the foundation for subsequent multi-scale spatiotemporal feature extraction. Specifically:

[0060] Step 11, the specific steps for mapping the original data are as follows:

[0061] Let the urban transportation network be graph G = (V, A), where V represents the set of sensing nodes, |V| = N, and N is the number of sensing nodes; A ∈ {0, 1} N×N Given an adjacency matrix; and a sequence of traffic data from the past T time points:

[0062]

[0063] In the formula, t represents the current time.

[0064] Project it onto a d-dimensional embedding using a fully connected layer (FC):

[0065]

[0066] Step 12, the specific steps of spatial embedding are as follows:

[0067] To incorporate topological information and dynamic features between nodes, this embodiment constructs parallel learning of static spatial embedding and dynamic spatial embedding, wherein:

[0068] Static space embedding The topological features of each row of nodes are obtained by random walk sampling and Skip-Gram learning of the traffic network G using Node2Vec.

[0069] Dynamic spatial embedding Learnable parameters represent the dynamic changes of nodes over time.

[0070] Adding the two together yields the final spatial embedding:

[0071]

[0072] And broadcast at each time step to match the time series dimension:

[0073]

[0074] Step 13, the specific steps of time embedding are as follows:

[0075] To supplement the periodicity of traffic flow, this embodiment designs two types of time prior vectors:

[0076] Intraday Cycle Embedding The location code representing each minute (or time period) of the day;

[0077] Weekly cycle embedding This represents the location code for each day of the week.

[0078] Adding the two together gives the total time embedding:

[0079]

[0080] And broadcast at the node level as:

[0081]

[0082] Step 14, the specific steps for constructing the input embedding are as follows:

[0083] The three embeddings are fused element-wise to obtain the input embedding of the first layer in this invention:

[0084]

[0085] In this embodiment, the input embedding simultaneously carries the original traffic characteristics, node topological semantics, and temporal periodic patterns, providing a rich and complementary source of information for the subsequent hierarchical spatiotemporal feature extraction module.

[0086] In one embodiment, the step of obtaining the temporal features is as follows:

[0087] The input features are divided into several subsequences according to a preset window length;

[0088] Any subsequence is input into two sets of parameter-independent window hybrid MLPs for mapping to obtain the first mapping feature and the second mapping feature.

[0089] Based on the gating mechanism, the first mapping feature and the second mapping feature are fused and calculated element by element to generate time series features.

[0090] In one embodiment, the steps for obtaining node-level features and multiple region-level features are as follows:

[0091] The temporal features are aggregated along the node dimension to generate multi-scale regional features;

[0092] The original node-level features are input into the node-mixed MLP to capture fine-grained correlations at the node level and output node-level features.

[0093] Multi-scale regional features are input into the region adaptive hybrid MLP, a similarity matrix is ​​calculated based on a pre-established parameter pool, and linear transformation weights are adaptively generated. Regional features are then generated based on these linear transformation weights.

[0094] Furthermore, in step 2, feature extraction is performed using a spatiotemporal mixing module. In the first-level spatiotemporal mixing module, this embodiment will input features... First, the data is fed into a "temporal aggregation mixer" for local temporal compression within a fixed window, gradually reducing the temporal resolution and extracting temporal features H at different scales. l Then, compress the... The data is fed into a "spatial cascade mixer" that generates a series of spatial scale representations through a multi-level node-to-region aggregation path. Node blending and adaptive region blending are applied in parallel at each scale to obtain multi-scale outputs at both the node and region levels.

[0095] Overall, the output of layer l includes:

[0096]

[0097] In the formula, This represents the node-level features in the l-th layer spatiotemporal hybrid module; This represents the features of K different regional scales in the l-th spatiotemporal mixing module. Subsequently, through the mechanisms of "spatial top-down propagation" and "temporal top-down propagation", the multi-scale outputs of each layer are successively fused to construct a complete spatiotemporal feature pyramid, providing comprehensive and multi-resolution information support for the final prediction layer.

[0098] Step 21: Generate time-series features using a time-series aggregation mixer, specifically:

[0099] Input feature E l The window is divided into several subsequences of length p, and the time length of each subsequence is denoted as:

[0100]

[0101] For the i-th window subsequence of each node n Map the "Window Hybrid MLP" with two separate sets of parameters:

[0102]

[0103] In the formula, φ(·) is the activation function; Encode the window position. Then, using a gating mechanism, calculate the output element by element:

[0104]

[0105] The aggregated features are obtained as follows:

[0106]

[0107] This process utilizes local similarity to extract macroeconomic trends and cyclical information layer by layer while reducing the temporal dimension.

[0108] Step 22, the specific steps for obtaining node features and multiple region features using a spatial cascade mixer are as follows:

[0109] To construct spatial hierarchical features, this embodiment first aggregates K fully connected layers sequentially along the node dimensions to generate a multi-scale region representation:

[0110]

[0111] in, T represents the region feature vector generated by the k-th fully connected layer in the l-th spatiotemporal hybridization module; l S represents the length of the time series; k This indicates the number of feature regions. Subsequently, the original node-level features... and each Parallel application of "node-based hybrid MLP" and K "region-adaptive hybrid MLP":

[0112] The working principle of the node-based hybrid MLP is as follows:

[0113] right Applying two fully connected layers along the spatiotemporal dimension captures fine-grained correlations at the node level, the output is:

[0114]

[0115] The working principle of region-adaptive hybrid MLP is as follows:

[0116] Regional features at each scale k Establish a parameter pool {K l V l},in M represents the parameter pool size; h is the dimension of the hidden state;

[0117] By calculating the similarity matrix:

[0118]

[0119] Adaptive generation of linear transformation weights:

[0120]

[0121] Then, by applying this method to two learnable linear mappings, we obtain the hidden representations:

[0122]

[0123] And continue using fully connected layers to complete the spatiotemporal and feature blending, output:

[0124]

[0125] This embodiment introduces a parameter pool and adopts an adaptive approach to generate linear transformation weights, enabling the model to provide independent weights for each region with an acceptable number of parameters.

[0126] To enhance the semantic discriminativeness of regions, this embodiment incorporates orthogonal parameter loss during training:

[0127]

[0128] The total orthogonal loss of the entire model is

[0129] Finally, the spatiotemporal hybridization module at this layer outputs node-level and region-level feature sets:

[0130]

[0131] This provides source features for the subsequent multi-layered "spatiotemporal pyramid" feature propagation and fusion.

[0132] In one embodiment, the steps of spatial fusion feature formation are as follows:

[0133] For the highest region-level features in layer l, a mapping layer is used to transform them into feature shapes that match the next level region scale.

[0134] Based on the highest-level regional features, the features of each level of regional features are iteratively fused downwards to generate multi-scale fused features.

[0135] The multi-scale fusion features are merged with the node-level features, and the fused features are then input into the (l+1)th layer.

[0136] In one embodiment, the step of obtaining temporal fusion features is as follows:

[0137] The features of the last layer of spatial fusion features are transformed into feature shapes that match the time length of the features in the next layer through a mapping layer.

[0138] The feature is propagated downwards layer by layer, added to the feature of the next layer, and transformed through the FC layer to obtain the temporal fusion feature.

[0139] Furthermore, in step 3, to fully utilize the multi-scale spatiotemporal features extracted at different levels and resolutions, a "hierarchical feature propagation mechanism" was designed, including two paths: spatial top-down propagation and temporal top-down propagation. This mechanism enables top-down information fusion among multiple spatiotemporal hybrid modules. This mechanism allows the model to not only extract features from local to global layers but also to progressively pass high-level global semantics to lower layers, improving the coordination and representation consistency among multi-scale features, thereby enhancing overall prediction performance.

[0140] The goal of top-down spatial propagation is to gradually integrate high-level regional features into low-level node representations, achieving information downlinking and complementarity between different spatial scales. The specific steps are as follows:

[0141] Step 311: For the output set of the spatial cascaded mixer of layer l... Output from the highest level region To begin, a fully connected layer is used to project it onto the shape of the next-level region scale:

[0142]

[0143] Step 312: Iterate and fuse the features of each level of region downwards sequentially:

[0144]

[0145] Step 313: Merge the lowest-level region features and node-level features and integrate them into the input of the next layer:

[0146]

[0147] Finally, the input features of the (l+1)th layer are obtained. This feature integrates contextual information from all spatial scales in the upper layer, enabling recursive injection of spatial semantics from regions to nodes.

[0148] Top-down temporal propagation is used to establish connections between the temporal resolution levels of multiple hybrid modules. By injecting high-level temporal abstractions into low-resolution temporal features layer by layer from top to bottom, it compensates for the trend information that may be lost during time reduction.

[0149] Step 321: Suppose that the spatiotemporal mixing module of layer L generates the time pyramid feature sequence {E}. 1 E 2 , ..., E L+1}, where E L+1 It is the last layer output, and it has the fewest time steps;

[0150] Step 322: Transfer the top-level feature E L+1 Projecting the time length onto the next layer's time feature representation, aligning it with the time feature representation of the next layer:

[0151]

[0152] Step 323: Iterative propagation from top to bottom, adding the propagation result from the previous layer to the current feature before linear transformation at each layer:

[0153]

[0154] In the formula, P l This is the result of propagation at layer l; E l Features of layer l; P l+1 This represents the propagation result of the (l+1)th layer, i.e., the propagation result of the upper layer.

[0155] Step 324: Finally, the propagation result of the lowest layer is used as the integrated timing output:

[0156]

[0157] This feature represents spatiotemporal multi-scale information from micro-nodes to macro-regions, and from local time periods to global trends, serving as the input for the final prediction layer.

[0158] In one embodiment, after completing the multi-scale spatiotemporal feature extraction and fusion, a prediction layer is used to perform regression prediction of future traffic conditions, specifically:

[0159] The fused features output by the prediction layer along the time propagation path With the highest layer output features To integrate, first, E L+1 After a linear transformation, the result is added to P and then sequentially input into a multi-layer fully connected network to output traffic predictions for the next T′ time steps.

[0160] The model training process uses the mean absolute error (MAE) as the main loss function. Furthermore, a parametric orthogonality loss is introduced to constrain semantic separation of the region, and the final loss function takes the following form:

[0161]

[0162] Through this prediction layer design, the present invention achieves effective integration and accurate prediction of multi-scale spatiotemporal information, taking into account both model performance and expressive power.

[0163] In one embodiment, prediction experiments were conducted using traffic flow datasets from four different regions in California in 2019, and the performance was compared with 19 existing mainstream models, including GNN, Transformer, and various MLP-Mixers. The results show that the present invention achieves the best performance in prediction accuracy (MAE, RMSE, MAPE), with average improvements of 2.09%, 3.93%, and 2.61%, respectively. Furthermore, in terms of training efficiency, the present invention significantly outperforms complex graph neural networks and self-attention models, demonstrating good scalability and robustness, making it particularly suitable for practical deployment in large-scale urban traffic scenarios.

[0164] This embodiment also discloses a traffic flow prediction system based on spatiotemporal hierarchical hybridization, including:

[0165] The data embedding module is used to acquire the original traffic flow spatiotemporal sequence, map the original traffic flow spatiotemporal sequence, and fuse spatial embedding and time period embedding to generate input features;

[0166] The spatiotemporal hybrid module is used to divide the input features into multiple windows, compress the temporal dimension through a gated MLP, and output temporal features; the temporal features are aggregated into multi-scale regional features through a spatial aggregation path, and node-level features and regional features are extracted in parallel at each scale, outputting node-level features and multiple regional features.

[0167] The feature fusion module is used to fuse regional features step by step based on a hierarchical feature propagation mechanism and then transmit them down to node-level features to generate spatial fusion features. The spatial fusion features are then fused layer by layer to generate temporal fusion features.

[0168] The prediction module is used to fuse the highest-level features of spatial fusion features and temporal fusion features to generate fused spatiotemporal features, and then use the fused spatiotemporal features to predict traffic results.

[0169] In one embodiment, the data embedding module includes:

[0170] The feature mapping unit is used to map the original traffic flow spatiotemporal sequence to generate traffic flow mapping data;

[0171] Spatial embedding unit, used to construct spatially embedded data by adding static spatial embedding and dynamic spatial embedding;

[0172] The time-period embedding unit is formed by adding intraday period embedding and intraweek period embedding to form time-period embedded data;

[0173] The feature fusion unit is used to fuse traffic flow mapping data, spatial embedding units, and time period embedding data element-wise to generate input features.

[0174] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0175] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A traffic flow prediction method based on spatiotemporal hierarchical hybrid model, characterized in that, The specific steps are as follows: Obtain the original traffic flow spatiotemporal sequence, map the original traffic flow spatiotemporal sequence, and fuse spatial embedding and temporal periodic embedding to generate input features; The input features are divided into multiple windows, and the temporal dimension is compressed using a gated MLP to output the temporal features. The temporal features are aggregated into multi-scale regional features through a spatial aggregation path. Node-level and regional-level features are extracted in parallel for each scale of regional features, and node-level features and multiple regional-level features are output. Based on the hierarchical feature propagation mechanism, regional features are fused step by step and then passed down to node-level features to generate spatial fusion features. The spatial fusion features are then fused layer by layer to generate temporal fusion features. The highest-level feature of the spatial fusion feature and the temporal fusion feature are fused to generate a fused spatiotemporal feature, and the fused spatiotemporal feature is used to predict traffic results.

2. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The spatial embedding includes static spatial embedding and dynamic spatial embedding. The static spatial embedding learns the topological features of the traffic network through the Node2Vec algorithm. The dynamic space embedding is a learnable parameter matrix.

3. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The time period embedding is composed of the intraday period embedding and the intraweek period embedding.

4. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The steps for obtaining the temporal features are as follows: The input features are divided into several subsequences according to a preset window length; Each of the subsequences is input into two sets of window-mixed MLPs with independent parameters for mapping, to obtain the first mapping feature and the second mapping feature. Based on the gating mechanism, the first mapping feature and the second mapping feature are fused and calculated element by element to generate time-series features.

5. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The steps for obtaining the node-level features and multiple region-level features are as follows: The temporal features are aggregated along the node dimension to generate multi-scale regional features; The original node-level features are input into a node-mixed MLP to capture fine-grained correlations at the node level and output node-level features. The multi-scale regional features are input into the region adaptive hybrid MLP, a similarity matrix is ​​calculated based on a pre-established parameter pool, and linear transformation weights are adaptively generated. Regional features are then generated based on these linear transformation weights.

6. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The steps of the spatial fusion feature are as follows: For the highest region-level features in layer l, a mapping layer is used to transform them into feature shapes that match the next level region scale. Based on the highest-level regional features, each level of regional features is iteratively fused downwards to generate multi-scale fused features. The multi-scale fusion features are merged with the node-level features, and the fused features are then input into the (l+1)th layer.

7. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The steps for obtaining the temporal fusion features are as follows: The features of the last layer of the spatial fusion features are transformed into feature shapes that match the time length of the features of the next layer through a mapping layer; The process propagates downwards layer by layer, adding features from the next layer and transforming them through the FC layer to obtain the temporal fusion features.

8. The traffic flow prediction method based on spatiotemporal hierarchical hybridization according to claim 1, characterized in that, The expression for the loss function is: The expression for the orthogonal loss of the l-th layer is: In the formula, α and β are both weighting coefficients; This is the average absolute error loss; For parameter orthogonal loss; All are linear transformation weights.

9. A traffic flow prediction system based on spatiotemporal hierarchical hybrid model, characterized in that, include: The data embedding module is used to acquire the original traffic flow spatiotemporal sequence, map the original traffic flow spatiotemporal sequence, and fuse spatial embedding and time period embedding to generate input features; The spatiotemporal hybrid module is used to divide the input features into multiple windows, compress the temporal dimension through gated MLP, and output temporal features; the temporal features are aggregated into multi-scale regional features through spatial aggregation path, and node-level features and regional features are extracted in parallel for each scale of regional features, outputting node-level features and multiple regional features; The feature fusion module is used to fuse regional features step by step based on a hierarchical feature propagation mechanism and then transmit them down to node-level features to generate spatial fusion features. The spatial fusion features are then fused layer by layer to generate temporal fusion features. The prediction module is used to fuse the highest-level feature of the spatial fusion feature and the temporal fusion feature to generate a fused spatiotemporal feature, and to use the fused spatiotemporal feature to predict traffic results.

10. A traffic flow prediction system based on spatiotemporal hierarchical hybridization according to claim 9, characterized in that, The data embedding module includes: The feature mapping unit is used to map the original traffic flow spatiotemporal sequence to generate traffic flow mapping data; Spatial embedding unit, used to construct spatially embedded data by adding static spatial embedding and dynamic spatial embedding; The time-period embedding unit is formed by adding intraday period embedding and intraweek period embedding to form time-period embedded data; The feature fusion unit is used to fuse the traffic flow mapping data, the spatial embedding unit, and the time period embedding data element-wise to generate input features.

Citation Information

Cited By

  • Traffic flow prediction method, system and equipment based on hierarchical semantic prompt large language model

    CN121260014A

  • Traffic flow prediction method, system and device based on hierarchical semantic prompt large language model

    CN121260014B

  • Urban traffic flow periodic change mode identification and analysis prediction method

    CN121354356A

  • Long-term traffic flow prediction method and system based on frequency domain decomposition and time sequence modeling

    CN121354357A