A multi-graph spatio-temporal fusion traffic flow prediction method and system based on semantic perception and a medium
By constructing a multi-graph spatiotemporal fusion model and combining semantic perception and dynamic fusion of temporal context, the problem of insufficient identification of functional association and periodic disturbance in existing traffic flow prediction methods is solved, and high-precision and robust traffic flow prediction for complex road networks is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV OF TECH
- Filing Date
- 2026-06-11
- Publication Date
- 2026-07-14
AI Technical Summary
Existing traffic flow prediction methods struggle to effectively capture the relationships between physically distant but functionally similar nodes in complex urban road networks. They also have difficulty distinguishing between periodic inherent patterns and sudden disturbances, leading to slow model response to emergencies or over-reliance on historical patterns, resulting in lagging predictions.
A semantically aware multi-graph spatiotemporal fusion method is adopted. By constructing a physical topology graph, a dynamic traffic interaction graph, and a semantic function graph, and combining the dynamic fusion features of the temporal context, inherent patterns and sudden features are separated. A pre-trained language model is used to extract the semantic representation of nodes, reduce literal similarity noise, and enhance the model's recognition of traffic dynamics associations.
It improves the accuracy and robustness of traffic flow prediction in complex road networks, can identify synchronous changes in functionally similar areas, adapt to changes in spatial dependencies under different traffic conditions, enhances the ability to respond to abnormal fluctuations, and reduces dependence on external environmental sensor data.
Smart Images

Figure CN122392316A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of traffic control systems, and in particular to a multi-graph spatiotemporal fusion traffic flow prediction method, system, and medium based on semantic perception. Background Technology
[0002] Traffic flow prediction is a crucial foundation for intelligent transportation systems to perform congestion warnings, signal control, route guidance, and traffic resource scheduling. Accurate and reliable traffic flow prediction can significantly improve road network operating efficiency and alleviate urban traffic congestion.
[0003] Existing traffic flow prediction methods typically use historical traffic volume, speed, and occupancy sequences as input, and combine them with road topology to establish spatiotemporal dependencies. These methods struggle to fully capture the complex spatial correlations within road networks. With the development of graph neural networks and temporal modeling techniques, prediction models based on graph convolution, attention mechanisms, and diffusion networks are now able to characterize, to some extent, the spatial propagation patterns between road network nodes and the temporal evolution of traffic states.
[0004] However, existing methods still have the following shortcomings in complex urban road network scenarios.
[0005] First, many methods rely primarily on physical adjacency or geometric distance to construct graph structures. This type of mapping is insufficient to represent the potential connections between nodes that are physically far apart but have similar urban functions. For example, large commercial districts, transportation hubs, or commuter corridors in different areas may exhibit similar travel demands or traffic patterns at specific times. Relying solely on physical topology will miss such long-range functional connections, preventing the model from obtaining this information, which should be helpful for prediction, from functionally similar distant nodes.
[0006] Secondly, in recent years, some studies have attempted to use pre-trained language models to extract textual semantic information (such as point of interest descriptions and regional function labels) of traffic nodes and construct semantic graph structures based on this. Although this can provide rich general textual semantic representations, the general text space is not completely consistent with the traffic dynamics space. Directly constructing traffic graph structures based on textual similarity can easily introduce literal similarity noise that is unrelated to the evolution of traffic states.
[0007] More importantly, traffic flow observation sequences are typically formed by the superposition of periodic inherent patterns and aperiodic sudden disturbances. Periodic inherent patterns are mainly influenced by factors such as differences between weekdays and weekends, time-of-day variations, and road functional attributes, exhibiting relatively stable daily and weekly cycles. Sudden disturbances, on the other hand, can be triggered by traffic accidents, temporary construction, severe weather, large-scale events, or special incidents, causing traffic conditions to deviate drastically from historical patterns within a short period. Existing end-to-end hybrid modeling methods often encode both of these components together. This results in abnormal fluctuations being smoothed out by historical periodic patterns, leading to slow model responses to sudden events, or, in sudden scenarios, the model over-relying on historical patterns, producing significant lag predictions. Summary of the Invention
[0008] This invention addresses the problems existing in the prior art and provides a semantically aware multi-graph spatiotemporal fusion traffic flow prediction method, system, and medium. It integrates node functional semantics, multi-dimensional spatial graph structure, and traffic flow decoupling representation, improving the prediction accuracy and robustness of non-stationary traffic states in complex road networks without overly relying on complete external environmental monitoring data.
[0009] The technical solution adopted in this invention is a multi-graph spatiotemporal fusion traffic flow prediction method based on semantic awareness, comprising the following steps:
[0010] Acquire traffic observation data and corresponding static metadata of traffic nodes, process the traffic observation data, and generate basic spatiotemporal representations;
[0011] A physical topology map is constructed based on the physical connection relationship of roads, a dynamic traffic interaction map is constructed based on traffic observation data, a semantic representation of each traffic node and the semantic association between related traffic nodes are generated based on static metadata, and a semantic function map is established based on the semantic representation and semantic association.
[0012] The semantic representation is fused with the basic spatiotemporal representation to obtain the initial node representation; graph convolution is performed on the initial node representation based on the physical topology graph, dynamic traffic interaction graph, and semantic function graph respectively to obtain the corresponding three types of spatial features; the three types of spatial features are dynamically fused according to the temporal context to obtain multi-graph fusion features;
[0013] The multi-graph fusion features are spatiotemporally decoupled to separate the inherent pattern features that characterize periodic regularities and the burst features that characterize aperiodic disturbances.
[0014] After fusing inherent pattern features with sudden features, the traffic flow prediction results are obtained.
[0015] Preferably, a pre-trained language model is used to extract the general semantic embedding of static metadata of traffic nodes, and a learnable mapping network is used to convert it into a semantic representation for traffic prediction tasks, which serves as the semantic representation of each traffic node; semantic association is obtained based on the similarity between semantic representations.
[0016] Preferably, the backbone parameters of the pre-trained language model are kept frozen during training, and the parameters of the learnable mapping network participate in the joint optimization (of the prediction model).
[0017] Preferably, a similarity matrix is established based on the similarity between semantic representations, and the similarity matrix is truncated or sparsified to obtain a sparse semantic function graph for graph convolution.
[0018] Preferably, the dynamic traffic interaction graph is generated based on the correlation between node traffic sequences within an adaptive sliding time window and is updated according to a preset period.
[0019] Preferably, the three types of spatial features include physical spatial features, traffic interaction features, and semantic association features. Corresponding gating fusion weights are generated based on temporal context encoding, and the three types of spatial features are weighted and fused based on the gating fusion weights to obtain multi-graph fusion features.
[0020] The time context encoding includes time period encoding for characterizing intraday cycles and date encoding for characterizing intraweek cycles; the gating fusion weights are generated by a learnable mapping network based on the time context encoding.
[0021] Preferably, when the three spatial features are weighted and summed according to the gated fusion weights, the time-aware multi-graph fusion features are obtained by combining residual connectivity and root mean square normalization.
[0022] Preferably, during the training phase, soft orthogonal constraints are applied to the inherent pattern features and burst features;
[0023] The total loss function used for training is related to the prediction error loss, the auxiliary reconstruction loss used to maintain the integrity of decoupled feature information, and the regularization loss corresponding to the soft orthogonal constraint.
[0024] A semantically aware multi-graph spatiotemporal fusion traffic flow prediction system includes:
[0025] At least one processor;
[0026] A memory, coupled to the at least one processor, stores a computer program that, when executed by the at least one processor, enables the system to implement the semantically aware multi-graph spatiotemporal fusion traffic flow prediction method.
[0027] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the semantically aware multi-graph spatiotemporal fusion traffic flow prediction method.
[0028] This invention relates to a semantically aware multi-graph spatiotemporal fusion traffic flow prediction method, system, and medium. The method involves acquiring traffic observation data and static metadata of nodes, spatiotemporally embedding the observation data to generate a basic spatiotemporal representation; constructing a physical topology graph based on road physical connections, and a dynamic flow interaction graph based on the observation data; generating semantic representations of each node and semantic associations between nodes based on the static metadata, thus constructing a semantic function graph; fusing the semantic representations with the basic spatiotemporal representations to obtain initial node representations; convolving the initial node representation graphs based on three different graph structures to obtain three types of spatial features; dynamically fusing these features according to the temporal context to obtain multi-graph fusion features; decoupling them spatiotemporally to separate inherent pattern features and sudden features; fusing and decoding these features to obtain the traffic flow prediction result; and implementing the system and medium based on the method.
[0029] The beneficial effects of this invention are as follows:
[0030] (1) By using static metadata such as node geographic location, surrounding points of interest, road grade and regional functional attributes to construct a semantic function graph, it can supplement the long-range functional associations that are difficult to express by physical topology, so that the model can not only focus on the propagation relationship between adjacent roads, but also identify synchronous traffic changes between functionally similar areas.
[0031] (2) By using a learnable domain mapping layer to perform task-adaptive calibration on the general semantic embedding output by the pre-trained language model, the interference of literal similarity on traffic prediction is reduced, and the semantic adjacency matrix is made closer to the traffic dynamics association.
[0032] (3) Construct a parallel multi-graph convolutional structure of physical topology graph, dynamic traffic interaction graph and semantic function graph, and use the time context gating mechanism to dynamically adjust the contribution of each graph structure, so as to adapt to the changes in spatial dependency relationship under different time periods, different dates and different traffic conditions;
[0033] (4) This invention reduces the redundant expression between periodic inherent patterns and sudden disturbance features by using a spatiotemporal decoupling refinement module based on soft orthogonal constraints. While preserving the nonlinear coupling elasticity of traffic conditions, it enhances the response capability to abnormal fluctuations and reduces the dependence on complete external environmental sensor data. Attached Figure Description
[0034] Figure 1 This is a flowchart of the method of the present invention;
[0035] Figure 2 This is a diagram illustrating the overall architecture of the method implemented in this invention.
[0036] Figure 3 This is a comparison chart of traffic flow prediction results of the method of the present invention under the time window of sudden congestion;
[0037] Figure 4 This is a schematic diagram illustrating the change of inherent pattern features extracted by the method of the present invention over time.
[0038] Figure 5 This is a schematic diagram illustrating the change of sudden interference features extracted by the method of the present invention over time.
[0039] Figure 6 This is a schematic diagram of the weight distribution of the semantic adjacency matrix generated by the method of the present invention. Detailed Implementation
[0040] The present invention will be further described in detail below with reference to embodiments, but the scope of protection of the present invention is not limited thereto.
[0041] like Figure 1 As shown, this invention relates to a semantically aware multi-graph spatiotemporal fusion traffic flow prediction method, comprising the following steps:
[0042] (1) Obtain traffic observation data and corresponding static metadata of traffic nodes, process the traffic observation data, and generate basic spatiotemporal representations;
[0043] (2) Construct a physical topology map based on the physical connection relationship of the road, construct a dynamic traffic interaction map based on traffic observation data, generate semantic representations of each traffic node and semantic associations between related traffic nodes based on static metadata, and establish a semantic function map based on the semantic representations and semantic associations.
[0044] (3) The semantic representation is fused with the basic spatiotemporal representation to obtain the initial node representation; graph convolution is performed on the initial node representation based on the physical topology graph, dynamic traffic interaction graph and semantic function graph respectively to obtain the corresponding three types of spatial features; the three types of spatial features are dynamically fused according to the temporal context to obtain multi-graph fusion features;
[0045] (4) Decouple the multi-graph fusion features in time and space to separate the inherent pattern features that represent periodicity and the burst features that represent aperiodic disturbances.
[0046] (5) After fusing the inherent pattern features and the sudden features, the traffic flow prediction results are obtained.
[0047] like Figure 1 , Figure 2 As shown, the method will be described below with reference to specific embodiments. Traffic nodes are defined as sensor nodes in the dataset that contain traffic state observations.
[0048] (1) Obtain traffic observation data and corresponding static metadata of traffic nodes, process the traffic observation data, and generate basic spatiotemporal representations;
[0049] In this invention, traffic observation data can be obtained from fixed detectors deployed in urban roads or highway networks, and the data items include at least one of traffic flow, average speed, and road occupancy. Continuous traffic observation data is divided into training set, validation set, and test set according to time order, and missing values, outliers, and data with inconsistent timestamps are cleaned.
[0050] Static metadata for traffic nodes includes sensor number, latitude and longitude, region, road name, number of lanes, road type, and direction of travel. These basic fields can be provided by the node metadata file of the traffic dataset. The road grade, point of interest (POI) type (such as gas station, restaurant, parking entrance, school, etc., used to describe the functional environment around the node), and land use or regional function information of the surrounding area can be supplemented by searching open map interfaces such as OpenStreetMap based on the sensor's latitude and longitude. The upstream and downstream connectivity of roads can be determined by road topology files, sensor adjacency matrices, or road network connection files.
[0051] In one specific implementation, PeMS series traffic data can be used as the source of traffic observation data. Its node metadata file provides sensor coordinates and basic road attributes, and the road network adjacency file provides the physical connection relationship between nodes. For nodes that lack explicit points of interest or regional function descriptions, supplementary descriptions can be generated using templates such as "road type, road grade, and upstream and downstream connectivity" to ensure that each node has coded semantic text.
[0052] For historical traffic observation data, instance normalization is first performed to alleviate the dimensional differences between different nodes and time periods. Then, time blocks are formed according to a preset length, and the blocks are mapped to the basic spatiotemporal embedding through linear projection. Then, location encoding is added to generate a basic spatiotemporal representation. In specific implementation, instance normalization can adopt z-score normalization, that is, subtract the mean from the time series of each node and divide by the standard deviation, and retain the mean and standard deviation of each node for subsequent inverse normalization.
[0053] (2) Construct a physical topology map based on the physical connection relationship of the road, construct a dynamic traffic interaction map based on traffic observation data, generate semantic representations of each traffic node and semantic associations between related traffic nodes based on static metadata, and establish a semantic function map based on the semantic representations and semantic associations.
[0054] The core of this step lies in semantic enhancement and graph construction.
[0055] (2-1) Physical Topology Diagram
[0056] In this invention, the physical topology graph is determined based on road connection relationships or sensor adjacency relationships. If two nodes are located upstream or downstream of the same road segment or have a direct road connection, an edge is established in the physical topology graph; the graph reflects the direct physical connection relationships of the road network.
[0057] (2-2) Dynamic Traffic Interaction Graph
[0058] In this invention, the dynamic traffic flow interaction graph is generated based on the correlation between traffic sequences of nodes within an adaptive sliding time window. The edge weights can be determined using Pearson correlation coefficient, cosine similarity, or other sequence similarity measures. The main interaction relationships are retained through Top-K selection or threshold truncation, which is easily understood by those skilled in the art. Taking Top-K selection as an example, the traffic sequences of each traffic node are extracted from the input historical time window, the node sequences are standardized, the correlation between each pair of nodes is calculated to form a correlation matrix, and the Top-K nodes with the highest correlation for each node are retained as the main interaction relationships. The retained correlation scores are used as edge weights to obtain the dynamic traffic flow interaction graph. This graph can be updated according to a preset period to reflect the time-varying characteristics of traffic flow interaction relationships.
[0059] In one implementation example, to ensure that the dynamic traffic interaction graph can simultaneously consider the stability of correlation estimation under stable traffic conditions and the response speed under sudden traffic conditions, the length of the sliding time window can be adaptively adjusted according to the fluctuation of the node traffic sequence. Let the number of traffic nodes be N, and the node traffic sequence of the i-th traffic node at time t be represented as follows: At each dynamic graph update time t, the degree of fluctuation in the node traffic sequence is first calculated based on a reference window. Specifically, the average absolute change of the first-order difference of the node sequence can be used as a measure of fluctuation.
[0060]
[0061] in, This indicates the length of the reference window used to calculate the degree of fluctuation. This represents the fluctuation level of the i-th traffic node at the current moment. Furthermore, by averaging the fluctuation levels of all traffic nodes, we obtain the overall fluctuation level of the current road network.
[0062]
[0063] Based on the overall degree of volatility With preset fluctuation threshold Based on the comparison results, the sliding time window length used to generate the dynamic traffic interaction graph is adaptively determined.
[0064]
[0065] in, Indicates a longer sliding time window. This indicates a shorter sliding time window, and When the traffic sequence fluctuates at a low level, a longer sliding time window is used to improve the stability of node correlation estimation; when the traffic sequence fluctuates at a high level, a shorter sliding time window is used to enhance the responsiveness of the dynamic traffic interaction map to sudden changes.
[0066] Determine the current sliding time window length Next, the traffic sequences of each traffic node within the window are extracted, and the correlation between any two traffic nodes is calculated. Taking the Pearson correlation coefficient as an example, the correlation score between the i-th node and the j-th node can be expressed as:
[0067]
[0068] in, and Let represent the sequence mean of node i and node j within the current sliding time window, respectively. To prevent extremely small constants with a denominator of zero.
[0069] Furthermore, an adjacency matrix of the dynamic traffic interaction graph is constructed based on the relevance scores. For each traffic node, the K most relevant nodes with the highest relevance scores can be retained, or node pairs with relevance scores above a preset threshold can be retained; taking Top-K filtering as an example:
[0070]
[0071] in, This represents the edge weight between node i and node j in the dynamic traffic interaction graph at time t. Let K represent the set of K nodes with the highest relevance scores to node i. The resulting dynamic traffic interaction graph can adaptively update with changes in traffic conditions, maintaining a relatively stable correlation structure under stable conditions and improving sensitivity to short-term changes under volatile or sudden conditions.
[0072] (2-3) Semantic Function Map
[0073] In this invention, a pre-trained language model is used to extract the general semantic embedding of static metadata of traffic nodes, and a learnable mapping network is used to convert it into a semantic representation for traffic prediction tasks, which serves as the semantic representation of each traffic node; semantic association is obtained based on the similarity between semantic representations.
[0074] Specifically, for each traffic node, its static metadata is organized into a natural language description, such as the road level where the node is located, the categories of nearby major points of interest, road functional attributes, and connection directions; the above text is then input into a lightweight pre-trained language model. This yields the general semantic embedding of the nodes.
[0075] In practical implementation, the learnable mapping network (learnable domain mapping layer) is a learnable feature transformation network, which includes at least one linear transformation layer and a nonlinear activation layer. The linear transformation layer projects the general semantic embedding from the general text semantic space to the feature space relevant to the traffic prediction task. The nonlinear activation layer enhances the expressive power of the semantic features. After task adaptation, it outputs traffic domain semantic features. Its mapping matrix can be parameterized using orthogonal initialization or orthogonal constraints to reduce redundant expressions between different semantic dimensions and enhance the discriminativeness and stability of the traffic domain semantic representation. During model training, the backbone parameters of the pre-trained language model are frozen, and the parameters of the traffic domain mapping layer and the traffic flow prediction model participate in optimization together. Through backpropagation of traffic flow prediction errors, the general semantic embedding is adaptively calibrated for the task, gradually calibrating the general text semantics into a functional semantic representation more suitable for the traffic flow prediction task, making the mapped traffic domain semantic representation more suitable for reflecting the functional relationships between traffic nodes.
[0076] Node General Semantic Embedding Semantic features in the transportation field The calculations can be performed as follows:
[0077]
[0078]
[0079] in, This represents the natural language description text of the i-th node. and These represent the weight matrix and bias of the learnable domain mapping layer, respectively;
[0080] Furthermore, by calculating the semantic similarity between traffic nodes based on the semantic representation of the traffic domain, and constructing a semantic function graph based on the semantic similarity, the literal similarity noise introduced when relying solely on general text similarity for graph construction can be reduced, making the semantic function graph closer to the node functional associations required for traffic flow prediction tasks. The similarity matrix is truncated or sparsified by a threshold; that is, when the similarity is not higher than a preset threshold, the corresponding edge weights are set to zero to obtain a sparse semantic function graph for graph convolution. The cosine similarity between the i-th node and the j-th node... and the semantic adjacency matrix of the th The node and the first Semantic association weights between nodes Represented as,
[0081]
[0082]
[0083] in, This represents the semantic similarity truncation threshold.
[0084] The physical topology graph obtained through the above method reflects the direct connections of the road network, the dynamic traffic interaction graph reflects the synchronous changes in traffic conditions within a historical window, and the semantic function graph reflects the relatively stable urban functional relationships between nodes. These three types of graphs describe the spatial dependencies of the traffic network from different perspectives, avoiding the inadequacy of a single graph structure in representing complex road networks.
[0085] (3) The semantic representation is fused with the basic spatiotemporal representation to obtain the initial node representation; graph convolution is performed on the initial node representation based on the physical topology graph, dynamic traffic interaction graph and semantic function graph respectively to obtain the corresponding three types of spatial features; the three types of spatial features are dynamically fused according to the temporal context to obtain multi-graph fusion features;
[0086] Specifically, semantic features in the transportation domain are projected through a linear layer to the same dimension as the basic spatiotemporal embedding, and broadcast along the time dimension. They are then added or fused element-by-element with the basic spatiotemporal embedding to obtain the initial node representation. , is represented as ,
[0087]
[0088] Represents the basic spatiotemporal embedding, This represents a matrix composed of semantic features of traffic domains from each node. This represents the semantic feature dimension alignment projection matrix. Indicates broadcast expansion along the time dimension;
[0089] The initial node representations are input into parallel multi-head graph attention convolution branches based on the physical topology graph, dynamic traffic interaction graph, and semantic function graph, respectively, to perform physical graph convolution, traffic graph convolution, and semantic graph convolution. For any graph structure, each attention head calculates attention coefficients based on the features of the current node and its neighboring nodes, and aggregates neighboring features using these coefficients as weights. The outputs of multiple attention heads are concatenated or summed to form the spatial features under the corresponding graph structure. The three types of spatial features include physical spatial features, traffic interaction features, and semantic association features. Indicates the first The node at the th Spatial features of class diagram structure It can correspond to physical topology diagrams, dynamic traffic interaction diagrams, or semantic function diagrams.
[0090]
[0091] in, Indicates the total number of attention heads. Indicates the first One point of attention, Indicates the first Nodes in class graph structure The neighborhood group, Indicates the first Nodes in each attention head For nodes Attention weights Indicates the first Class diagram structure The linear transformation matrix of each attention head. Indicates the first Layer nodes Input features, This represents a non-linear activation function.
[0092] The corresponding gated fusion weights are generated based on the temporal context encoding, and the three types of spatial features are weighted and fused based on the gated fusion weights to obtain multi-image fusion features;
[0093] The time context encoding includes a time period encoding for characterizing intraday cycles and a date encoding for characterizing intraweek cycles; the gated fusion weights are generated by a learnable mapping network based on the time context encoding.
[0094] When the three spatial features are summed by weighted summation according to the gated fusion weights, time-aware multi-graph fusion features are obtained by combining residual connectivity and root mean square normalization.
[0095] Specifically, to adapt to the changing characteristics of traffic spatial relationships over time, a time-aware gating network is constructed, using time period codes of the day and date codes of the week as inputs, and passing through a two-layer feedforward network and... The function outputs three non-negative weights, corresponding to the physical topology graph, dynamic traffic interaction graph, and semantic function graph, respectively.
[0096]
[0097]
[0098] in, Indicates time context encoding, , , and These are the learnable parameters of the gated network. The intermediate hidden states of the gated network are represented; the three spatial features are weighted and summed according to the above weights, and combined with residual connectivity and root mean square normalization to obtain the time-aware multi-graph fusion features. ,
[0099]
[0100] in, , and These represent the fusion weights of the physical topology graph, dynamic traffic interaction graph, and semantic function graph, respectively, and the sum of the three is 1. , and These represent the spatial characteristics of the output of the three types of graph structures.
[0101] (4) Decouple the multi-graph fusion features in time and space to separate the inherent pattern features that represent periodicity and the burst features that represent aperiodic disturbances.
[0102] In this invention, the intrinsic pattern encoder explicitly introduces temporal context encoding, making it more focused on learning stable traffic change patterns related to intraday cycles, intraweek cycles, and road functional attributes; the sudden disturbance encoder does not introduce additional temporal context encoding, but directly extracts it from the final multi-graph fusion features. The system extracts variable components that are difficult to explain by periodic time context, thereby obtaining a non-periodic disturbance characterization. Specifically, time-aware multi-map fusion features are input into two independent encoders. The input to the intrinsic pattern encoder is the concatenation result of multi-map fusion features and time context encoding. Its goal is to extract the periodic baseline traffic state determined by weekday patterns, time period patterns, and road functional attributes. The input to the sudden disturbance encoder is multi-map fusion features. Its goal is to extract non-periodic disturbances caused by accidents, temporary construction, severe weather, or occasional demand changes.
[0103]
[0104]
[0105] in, Indicates the process The final fusion feature after layer-time-aware multi-graph fusion, as described above. , Indicates the number of layers in time-aware multi-graph fusion; Indicates an intrinsic mode encoder. Indicates a sudden interference encoder. Indicates inherent pattern features, ⊕ indicates sudden interference features, and ⊕ indicates feature splicing operation.
[0106] It should be noted that time-aware multi-graph fusion features can be obtained by stacking one or more time-aware multi-graph fusion modules. Here, the number of layers refers to the number of times the time-aware multi-graph fusion modules are stacked, not the number of hidden layers within a single linear network or encoder. Each time-aware multi-graph fusion module takes the node representation output from the previous layer as input, extracts three types of spatial features based on the physical topology graph, dynamic traffic interaction graph, and semantic function graph, respectively, and generates gated fusion weights based on temporal context encoding. The three types of spatial features are then weighted and fused to obtain the multi-graph fusion features output by that layer. The next time-aware multi-graph fusion module takes the multi-graph fusion features output by the previous layer as input and continues to extract three-graph features and perform time-gated fusion to extract deeper spatiotemporal relational expressions layer by layer. After L layers of time-aware multi-graph fusion modules, the final fusion feature is obtained. .
[0107] (5) After fusing the inherent pattern features and the sudden features, the traffic flow prediction results are obtained;
[0108] After concatenating or weighting the inherent pattern features and sudden disturbance features, high-quality spatiotemporal features are obtained. These features are then input into the prediction decoding module, where prediction decoding and inverse normalization are performed to obtain normalized prediction results for one or more future time steps. Subsequently, the prediction results are restored to true physical dimensions through an inverse normalization bypass, and predicted values for traffic flow, speed, or road occupancy are output.
[0109]
[0110] in, Indicates the future Normalized prediction results at each time step Indicates the prediction step size. This indicates a lightweight prediction decoding module.
[0111] During the training phase of the prediction model, in order to avoid the inherent pattern features and sudden interference features learning highly repetitive mixed information, soft orthogonal constraints are applied to the inherent pattern features and sudden interference features, so that the two types of features maintain low redundancy correlation in the deep representation space, while avoiding forcibly splitting the real traffic flow state into completely independent physical processes.
[0112] In this invention, soft orthogonal constraints It can be represented as the squared Frobenius norm of two types of normalized feature correlation matrices.
[0113]
[0114] in, Indicates the first Each time block or sample slice This represents the total number of blocks or sample slices that participated in the soft orthogonal constraint calculation. and They represent the first The inherent pattern features and sudden interference features corresponding to each block or sample slice Denotes the Frobenius norm;
[0115] Soft orthogonal constraints are used to suppress the learning of highly repetitive mixed representations by the two types of encoders. This constraint does not require that periodic patterns and sudden disturbances be completely independent in a physical sense. Instead, it reduces the redundancy of deep features through small-weight regularization, thus preserving the fitting space for coupled scenarios such as morning and evening rush hours and sudden accidents.
[0116] Total loss function for training prediction models The loss is related to the prediction error loss, the auxiliary reconstruction loss used to maintain the integrity of decoupled feature information, and the regularization loss corresponding to the soft orthogonality constraint, and is expressed as follows:
[0117]
[0118] in, This represents the auxiliary reconstruction loss, used to constrain the preservation of the original fused features after decoupling. The valid information in it This represents the loss due to prediction error. and To balance the weighting coefficients of various losses, and These represent the actual traffic conditions and the predicted traffic conditions, respectively.
[0119] The auxiliary reconstruction loss here preserves the information integrity of the decoupled features. ,in, This represents the fused features obtained by reconstructing the decoupled features. , This indicates the auxiliary reconstruction mapping module.
[0120] In one specific embodiment, both the input historical time step and the prediction time step are set to 12, corresponding to 60 minutes of historical observation and 60 minutes of future prediction with a sampling interval of 5 minutes; the hidden layer dimension is set to 64, the number of heads in the multi-head graph attention mechanism is set to 4, the semantic graph similarity threshold is set to 0.6, the soft orthogonal constraint loss weight is set to 0.1, and the auxiliary reconstruction loss weight is set to 0.05. These parameters can be adjusted according to the data scale, sampling interval, and computing power of the deployed equipment.
[0121] By training with the loss function described above, the model can reduce redundant representations between periodic baseline changes and sudden disturbance changes while preserving overall traffic condition prediction information.
[0122] To further illustrate the prediction and feature decoupling effects of the method of this invention under non-periodic sudden traffic conditions, a specific experimental verification was conducted. A time window containing sudden congestion changes in the PeMS08 test set was selected as the analysis object. This time window corresponds to the Friday evening peak from 17:00 to 20:00. The traffic flow prediction results, intermediate layer inherent pattern features, sudden interference features, and semantic adjacency matrix were visualized. The results are as follows: Figures 3 to 6 As shown.
[0123] like Figure 3 As shown, around 18:30, the actual traffic flow showed a significant decrease, indicating that there was a sudden traffic fluctuation within this time window. The prediction curve of the method of the present invention can change in a timely manner with the downward trend of the actual traffic flow, and maintain a trend of change that is close to the actual traffic flow after the sudden change, indicating that the method of the present invention can improve the prediction response capability in the case of sudden congestion.
[0124] like Figure 4 As shown, inherent pattern features The pattern exhibits a smooth trend throughout the entire time window, primarily reflecting the periodic baseline traffic state determined by intraday cycles, evening peak travel patterns, and road functional attributes. Even when a sudden drop in traffic occurs around 18:30, this inherent pattern characteristic still maintains a relatively smooth change shape, indicating that the inherent pattern branch is mainly used to characterize stable periodic patterns.
[0125] like Figure 5 As shown, sudden interference characteristics It maintains a low response during stable periods, but exhibits a significant response peak when traffic flow changes abruptly around 18:30; this change is related to... Figure 3 The sudden drop in traffic flow corresponds to the time of the sudden disturbance, indicating that the sudden disturbance branch can characterize non-periodic traffic disturbances, thus helping to reduce the problem of sudden events being smoothed by historical periodic patterns.
[0126] like Figure 6 As shown, most node pairs in the semantic adjacency matrix have low weights, indicating that after semantic similarity calculation and sparsification, the semantic function graph can suppress weak associations between unrelated nodes. Meanwhile, there is a high weight between node 2 and node 8, indicating that these two nodes have a strong semantic association in traffic function. This invention supplements long-range functional associations that are difficult to express in physical topology through this semantic function graph, thereby providing additional spatial dependency information for multi-graph fusion prediction.
[0127] The method of this invention can be applied to urban roads, highway networks, regional traffic management platforms, and traffic operation monitoring systems. By combining node functional semantics, multidimensional spatial relationships, and spatiotemporal decoupling mechanisms, this method can improve the stability and accuracy of traffic flow prediction in complex road networks even in the absence of complete external environmental monitoring data.
[0128] This invention also relates to a semantically aware multi-graph spatiotemporal fusion traffic flow prediction system, comprising:
[0129] At least one processor;
[0130] A memory, coupled to the at least one processor, stores a computer program that, when executed by the at least one processor, enables the system to implement the semantically aware multi-graph spatiotemporal fusion traffic flow prediction method.
[0131] The present invention also relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the semantically aware multi-graph spatiotemporal fusion traffic flow prediction method described above.
[0132] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects.
[0133] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0134] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0136] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0137] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A multi-graph spatiotemporal fusion traffic flow prediction method based on semantic awareness, characterized in that: Includes the following steps: Acquire traffic observation data and corresponding static metadata of traffic nodes, process the traffic observation data, and generate basic spatiotemporal representations; A physical topology map is constructed based on the physical connection relationship of roads, a dynamic traffic interaction map is constructed based on traffic observation data, a semantic representation of each traffic node and the semantic association between related traffic nodes are generated based on static metadata, and a semantic function map is established based on the semantic representation and semantic association. The semantic representation is fused with the basic spatiotemporal representation to obtain the initial node representation; The initial node representation is subjected to graph convolution based on the physical topology graph, dynamic traffic interaction graph, and semantic function graph respectively to obtain the corresponding three types of spatial features; The three types of spatial features are dynamically fused based on the temporal context to obtain multi-graph fusion features; The multi-graph fusion features are spatiotemporally decoupled to separate the inherent pattern features that characterize periodic regularities and the burst features that characterize aperiodic disturbances. After fusing inherent pattern features with sudden features, the traffic flow prediction results are obtained.
2. The traffic flow prediction method based on semantic awareness and multi-graph spatiotemporal fusion according to claim 1, characterized in that: A pre-trained language model is used to extract general semantic embeddings of static metadata of traffic nodes, which are then converted into semantic representations for traffic prediction tasks using a learnable mapping network. These representations serve as the semantic representations of each traffic node. Semantic associations are obtained based on the similarity between semantic representations.
3. The traffic flow prediction method based on semantic awareness and multi-graph spatiotemporal fusion according to claim 2, characterized in that: The backbone parameters of the pre-trained language model are kept frozen during training, and the parameters of the learnable mapping network participate in joint optimization.
4. The traffic flow prediction method based on semantic awareness and multi-graph spatiotemporal fusion according to claim 2, characterized in that: A similarity matrix is established based on the similarity between semantic representations. The similarity matrix is then truncated or sparsified to obtain a sparse semantic function graph for graph convolution.
5. The multi-graph spatiotemporal fusion traffic flow prediction method based on semantic awareness according to claim 1, characterized in that: The dynamic traffic interaction graph is generated based on the correlation between node traffic sequences within an adaptive sliding time window and is updated according to a preset period.
6. The traffic flow prediction method based on semantic awareness and multi-graph spatiotemporal fusion according to claim 1, characterized in that: The three types of spatial features include physical spatial features, traffic interaction features, and semantic association features. Corresponding gating fusion weights are generated based on temporal context encoding, and the three types of spatial features are weighted and fused based on the gating fusion weights to obtain multi-graph fusion features. The time context encoding includes time period encoding for characterizing intraday cycles and date encoding for characterizing intraweek cycles; The gated fusion weights are generated by a learnable mapping network based on temporal context encoding.
7. The traffic flow prediction method based on semantic awareness and multi-graph spatiotemporal fusion according to claim 6, characterized in that: When the three spatial features are summed by weighted summation according to the gated fusion weights, time-aware multi-graph fusion features are obtained by combining residual connectivity and root mean square normalization.
8. The traffic flow prediction method based on semantic awareness and multi-graph spatiotemporal fusion according to claim 1, characterized in that: During the training phase, soft orthogonal constraints are applied to the inherent pattern features and burst features; The total loss function used for training is related to the prediction error loss, the auxiliary reconstruction loss used to maintain the integrity of decoupled feature information, and the regularization loss corresponding to the soft orthogonal constraint.
9. A multi-graph spatiotemporal fusion traffic flow prediction system based on semantic awareness, characterized in that: include: At least one processor; A memory, coupled to the at least one processor, stores a computer program that, when executed by the at least one processor, causes the system to implement the semantically aware multi-graph spatiotemporal fusion traffic flow prediction method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the semantically aware multi-graph spatiotemporal fusion traffic flow prediction method according to any one of claims 1 to 8.