A method and apparatus for traffic state prediction based on area spatial semantics

By constructing a traffic state prediction method based on spatial semantics of the area domain, and combining physical proximity graphs and semantic adjacency graphs, the method dynamically balances spatial and temporal dependencies, solving the problems of excessively coarse spatial semantic granularity and difficulty in capturing long-distance coupling relationships in existing technologies, thereby improving the accuracy and adaptability of traffic state prediction.

CN121305864BActive Publication Date: 2026-04-03AEROSPACE INFORMATION RES INST CAS
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-11
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing traffic condition prediction methods have too coarse spatial semantic granularity, which makes it difficult to effectively capture traffic coupling between geographically distant but functionally similar areas, and the prediction accuracy is insufficient in sudden congestion and rapidly changing scenarios.

Method used

By integrating traffic flow, temporal embedding, and remote sensing semantic computation, a traffic state prediction method based on area spatial semantics is constructed. By combining physical proximity graphs and semantic adjacency graphs, a global static adjacency matrix is ​​generated. Furthermore, by utilizing gated recurrent units and self-attention mechanisms, spatial and temporal dependencies are dynamically balanced to achieve multi-order graph convolution and diffusion.

Benefits of technology

It enhances the ability to express the scale of traffic generation and diffusion paths, adapts to sudden congestion scenarios, dynamically adjusts propagation paths, and improves the accuracy and adaptability of traffic condition prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121305864B_ABST
    Figure CN121305864B_ABST
Patent Text Reader

Abstract

This invention discloses a traffic state prediction method and apparatus based on surface spatial semantics, belonging to the fields of intelligent transportation and spatiotemporal big data analysis. It includes: fusing traffic flow, temporal embedding, and remote sensing semantics to obtain unified node features; constructing a short-range road map based on actual distances between sensors and a long-range semantic map based on the similarity of functional area proportions, and weighted synthesizing a global static adjacency matrix; generating a time-updated dynamic adjacency matrix through a self-attention mechanism, combined with multi-order diffusion and temporal localization; using the static and dynamic adjacency matrices to perform multi-order graph convolution to capture spatial dependencies; extracting short-term changes, mining long-term cycles, and capturing temporal dependencies; and finally, dynamically balancing the contributions of spatial and temporal dependencies through a spatiotemporal decoupling module to output the prediction results. This invention improves the prediction accuracy and adaptability in non-stationary traffic scenarios by characterizing functional area differences through surface spatial semantics, combined with static and dynamic graph modeling and hierarchical temporal modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent transportation and spatiotemporal big data analysis technology, and particularly relates to a traffic state prediction method and device based on surface domain spatial semantics. Background Technology

[0002] Short-term traffic condition prediction is a key fundamental capability of Intelligent Transportation Systems (ITS). A typical approach uses historical observations from road network sensors as input, combining spatial adjacency relationships with temporal dependencies for modeling. Traffic prediction can be broadly categorized into three types based on the degree of spatial semantic integration: purely temporal modeling methods, distance / topology-based modeling methods, and methods that consider spatial semantic modeling.

[0003] The first category is pure time-series modeling methods. These methods were the mainstream approach in early traffic forecasting research, without considering the impact of spatial semantics on traffic behavior. They predict future traffic flow by analyzing historical traffic data and building time-series models.

[0004] The second category is distance / topology-based modeling methods. This method quantifies the spatial distance or network topology between sensor nodes and encodes it into an adjacency matrix A, representing the strength of spatial connections between sensor nodes, explicitly supplementing spatial information beyond temporal features. This type of method evolves in three progressive stages according to how the adjacency matrix is ​​obtained: The first stage assumes that geographically adjacent grids are adjacent in pixel space, dividing the city into equally spaced grids, with each grid center considered a "virtual sensor," mapping traffic flow to pixel values, and assuming that adjacent pixels are adjacent roads. Spatial proximity is measured by the distance between the centers of adjacent pixels and the size of the convolution kernel, which can essentially be considered a fixed adjacency matrix. This method is computationally efficient in scenarios with dense grid distribution, but for real road networks with varying shapes and sparse distributions, due to the fixed grid size and convolution kernel direction, it suffers from distance distortion, topological distortion, and wasted empty pixels, affecting traffic prediction accuracy. The second stage directly uses road sensors as nodes and explicitly constructs fixed adjacency matrices based on physical features, such as: (1) distance-based adjacency matrices; (2) K-nearest neighbor-based adjacency matrices; and (3) road connectivity-based adjacency matrices. The third stage is adaptive / attention graph convolution (trainable adjacency), which sets the adjacency weights as learnable parameters or dynamically adjusts them according to real-time traffic flow based on attention, in order to solve traffic surges under sudden events. Although distance / topology modeling methods can capture short-distance spatial dependencies between sensors well, they essentially still assume that spatial correlation depends only on physical proximity or network connectivity. However, traffic behavior is not random, but purposeful travel driven by "place function". If sensor association models are built based only on spatial proximity or topological connectivity, while ignoring the semantic features of the place functions around the sensors, it will be difficult to capture the traffic pattern similarity features caused by long-distance but semantically similar environments, leading to misjudgment of road network traffic patterns.

[0005] The third category is methods that integrate spatial semantic modeling, based on how spatial semantics are utilized. This can be summarized into two technical lines. One type focuses on "enhancing node attributes with spatial semantics": while maintaining physical topological adjacency, external semantics such as POI statistics, land use ratios, or weather are directly concatenated into node features. Convolution or attention mechanisms are used to improve the model's perception of functional differences in locations. This type of method primarily enhances the perception of local functional differences through spatial semantics; however, spatial semantics only affects the feature dimension, and the adjacency structure is still determined by road topology, unable to change the propagation path between nodes, thus limiting its ability to capture cross-regional and long-distance coupling relationships. The second type focuses on "enhancing adjacency matrices with spatial semantics": directly mapping functional similarity to a graph structure, adding semantic edges or meta-paths outside the physical graph to capture geographically distant but functionally coupled traffic connections.

[0006] While existing technologies have incorporated spatiotemporal graph modeling and some spatial semantics into traffic prediction, they still suffer from the following prominent drawbacks:

[0007] Spatial semantic granularity is too coarse. Most mainstream methods rely on point POI coordinates and category counts to represent spatial functions, lacking descriptions of functional area coverage, shape and scale, and spatial adjacency relationships. This makes it impossible to distinguish areas with the same number of POIs but different spatial scales and organizational patterns.

[0008] The propagation path has not been semantically modified. Existing methods often treat spatial semantics as additional features of nodes, while the adjacency structure is still based on physical distance or fixed topology, which cannot effectively capture the traffic coupling between geographically distant but functionally similar regions, making it difficult to accurately model long-distance diffusion relationships.

[0009] The non-stationary and long-term forecasting capabilities are insufficient. Static adjacency or single-time modeling frameworks have limited performance in the face of sudden congestion, rapid changes in traffic patterns, and the accumulation of multi-step prediction errors, and lack a mechanism that can dynamically and adaptively balance spatial diffusion and temporal dependence. Summary of the Invention

[0010] To address the above technical problems, this invention provides a traffic state prediction method and apparatus based on surface domain spatial semantics, the specific technical solution of which is as follows:

[0011] A traffic state prediction method based on area spatial semantics includes the following steps:

[0012] Step 1: Integrate traffic flow, temporal embedding, and remote sensing semantics to compute vectors including node distance, spatial semantics around the sensor, temporal embedding features, and traffic features;

[0013] Step 2: Construct a physical proximity graph based on node distances to obtain a short-range road graph, and further obtain a short-range dependency adjacency matrix; construct a semantic adjacency graph based on the spatial semantics around the sensor to obtain a long-range semantic graph, and further obtain a long-range dependency adjacency matrix; combine the short-range dependency adjacency matrix and the long-range dependency adjacency matrix according to weights to form a global static adjacency matrix.

[0014] Step 3: Generate a time-updated adjacency matrix by utilizing the spatial semantics, temporal embedding features, and traffic features around the sensor, and perform multi-order diffusion and temporal localization.

[0015] Step 4: Perform multi-order graph convolution using the global static adjacency matrix and the time-updated adjacency matrix to capture spatial dependencies;

[0016] Step 5: Use a gated recurrent unit (GRU) to capture short-term changes and a self-attention mechanism to mine long-term cycles, thereby capturing time dependence;

[0017] Step 6: Dynamically balance the contributions of spatial and temporal dependencies, and output the final prediction result.

[0018] A traffic state prediction device based on area spatial semantics includes the following modules:

[0019] The vector computation module integrates traffic flow, temporal embedding, and remote sensing semantic computation, including vectors containing node distance, spatial semantics around the sensor, temporal embedding features, and traffic features.

[0020] The global static adjacency matrix calculation module constructs a physical proximity graph based on node distances to obtain a road short-range graph, and further obtains a short-range dependency adjacency matrix; it constructs a semantic adjacency graph based on the spatial semantics around the sensor to obtain a semantic long-range graph, and further obtains a long-range dependency adjacency matrix. The short-range dependency adjacency matrix and the long-range dependency adjacency matrix are combined according to weights to form a global static adjacency matrix.

[0021] The time-updated adjacency matrix calculation module uses the spatial semantics, temporal embedding features, and traffic features around the sensor to generate a time-updated adjacency matrix that updates over time, and performs multi-order diffusion and temporal localization.

[0022] The spatial dependency capture module uses a global static adjacency matrix and a time-updated adjacency matrix to perform multi-order graph convolution to capture spatial dependencies.

[0023] The time dependency capture module uses a gated recurrent unit (GRU) to capture short-term changes and a self-attention mechanism to mine long-term cycles, thereby capturing time dependencies.

[0024] The results output module dynamically balances the contributions of spatial and temporal dependencies and outputs the final prediction results.

[0025] An electronic device includes: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method.

[0026] A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to implement the method described thereon.

[0027] The present invention has the following effects:

[0028] This invention constructs functional area ratio vectors and boundary contact adjacency matrices through semantic segmentation of remote sensing images, forming sensor-level area spatial semantic vectors. This can distinguish functional areas with the same number of POIs but different sizes and shapes, characterize the boundary relationships of mixed-use land, and improve the ability to express the scale of traffic generation and diffusion paths.

[0029] This invention weightedly fuses road proximity relationships and functional similarity relationships to obtain a semantic-physical coupled static adjacency matrix. Unlike graph structures that rely solely on physical topology or single semantic similarity, the propagation path is no longer limited to physical proximity, but also takes into account functionally similar nodes at a distance. At the same time, the dynamic graph can adjust edge weights over time to adapt to non-stationary scenarios such as sudden congestion and sensor anomalies.

[0030] This invention, under static prior constraints, generates a time-varying adjacency matrix through self-attention, supporting multi-order diffusion modeling of time-varying spatial dependencies. A gating mechanism is introduced to dynamically balance the relative contributions of spatial diffusion and temporal memory, improving the model's adaptability in non-stationary traffic scenarios. The surface semantics, static / dynamic graph modeling, hierarchical temporal modeling, and STDD decoupling modules are unified into a single graph neural network, forming the end-to-end traffic prediction framework SSEGNN. Through hierarchical temporal modeling (short-term + long-term) and STDD gating decoupling, spatial and temporal dependencies are dynamically balanced. Attached Figure Description

[0031] Figure 1 This is a flowchart of the method of the present invention;

[0032] Figure 2 Constructing spatial semantic features. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other. To achieve the above objectives, this invention adopts the following technical solution.

[0034] This invention proposes a traffic state prediction method based on area spatial semantics, the flowchart of which is shown below. Figure 1 As shown, it includes the following steps:

[0035] Step 1: Integrate traffic flow, temporal embedding, and remote sensing semantics to compute vectors including node distance, spatial semantics around the sensor, temporal embedding features, and traffic features;

[0036] Step 2: Construct a physical proximity graph based on node distances to obtain a road short-range graph, and further obtain a short-range dependency adjacency matrix; construct a semantic adjacency graph based on the spatial semantics around the sensor to obtain a semantic long-range graph, and further obtain a long-range dependency adjacency matrix; use a static graph fusion tool to synthesize the road short-range graph and the semantic long-range graph into a global static adjacency matrix according to weights.

[0037] Step 3: Generate a time-updated adjacency matrix by utilizing the spatial semantics, temporal embedding features, and traffic features around the sensor, and perform multi-order diffusion and temporal localization.

[0038] Step 4: Perform multi-order graph convolution using the global static adjacency matrix and the time-updated adjacency matrix to capture spatial dependencies;

[0039] Step 5: Use a gated recurrent unit (GRU) to capture short-term changes and a self-attention mechanism to mine long-term cycles, thereby capturing time dependence;

[0040] Step 6: Dynamically balance the contributions of spatial and temporal dependencies, and output the final prediction result.

[0041] Step 1 includes:

[0042] Time series data collected from road network sensors ; each sensor Perform z-score normalization on the historical sequence based on the training set statistics. The goal is to achieve z-score normalization on a given historical sequence. predict Where t represents the current time step, and T represents the size of the history window. Represents the prediction window size. Indicates the first Traffic signals at each time step This indicates the total number of sensors in the traffic network. This indicates the total number of types of signals collected by the sensor, such as speed and flow rate.

[0043] In this invention, the process for obtaining the distance between sensor nodes is as follows: Given Two-dimensional coordinates of each sample The latitude and longitude coordinates are in degrees; then the Haversine distance operator is called to first calculate the central angle matrix between any two points. (Diagonal is 0, matrix is ​​symmetric), then the angular distance is linearly enlarged to the actual spherical arc length based on the Earth's average radius R = 6371.0088 km: Thus obtain The pairwise distance matrix (unit: kilometers).

[0044] In this invention, the process for obtaining time-embedded features is as follows: First, the numerical feature of "time within a day" is calculated based on the time index. The timestamp is subtracted from the entire day portion of its date and divided by the length of a day to obtain the continuous proportion of the [0,1] interval (i.e., the relative position of the day). This sequence is then copied and rearranged along the node dimension to form a three-dimensional tensor (T,N,1) aligned with the data time length T and the number of nodes N, and added to the feature list. Similarly, "time within a week" is extracted... As numerical features, they are copied along the node dimension to form a (T,N,1) intra-week tensor. The above process provides two types of time context signals for the spatiotemporal model, namely continuous (intraday proportion) and discrete (time slot / week), without increasing too much computation and storage costs. This can effectively improve the recognizability of periodic patterns (commuting peaks and valleys, etc.).

[0045] In this invention, the process for acquiring geographic attribute features around the sensor is as follows: A panoramic sample of the urban spatial environment within a certain range around each sensor is taken using high-resolution remote sensing imagery (0.5m). Then, the geographic attributes around the sensor are obtained through semantic segmentation. The imagery is interpreted into multiple functional categories (such as residential, commercial, industrial, green space, water body, etc.), resulting in a pixel-level category annotation map. Where C represents the total category of the segmentation, and H and W represent the width and height of the adjacency graph, respectively.

[0046] like Figure 2 As shown, the actual area proportion of each functional area in the area surrounding the sensor is calculated from the geographic attributes around the sensor obtained in the data preprocessing section using a pixel-level statistical method. Specifically, for each category of the aforementioned pixel-level category annotation map around the sensor... Statistical Pixel Count The feature vector (1×C, where C is the number of categories) is formed by dividing the total area of ​​the window into the proportion of the total number of pixels. For example, if there are only three categories, green space accounts for 20%, roads account for 50%, and water bodies account for 30%, then this part of the sensor's feature vector is (0.2, 0.5, 0.3), which is 1×C.

[0047] Secondly, addressing the issue that POI data cannot explicitly describe the spatial adjacency relationships between functional areas, a functional area spatial interaction matrix was further constructed to quantify the degree of boundary adjacency between different functional area types at the pixel scale. Specifically, the spatial interaction degree of functional areas around the sensor is represented by statistically analyzing the categories and number of adjacent pixels for each category in the aforementioned pixel-level category annotation map. For example, if there are 5 adjacent pixels between Housing (Category 1) and Greenland (Category 3) in the image, then in the spatial interaction matrix, By traversing each sensor in the above manner, a spatial interaction matrix between all geographic attributes is obtained. The interaction strength between corresponding categories is represented by the value of each adjacency matrix, with a size of C×C. The spatial interaction matrix constructed in this way can characterize the spatial organization and composite pattern of each functional area around each sensor point. There are a total of c categories, and each category is statistically analyzed with another c-1 categories. The final matrix size is C×C.

[0048] Subsequently, the high-dimensional semantic feature vectors are fused with the spatial interaction matrix, and a 1×C multidimensional spatial semantic representation is obtained through dot product. This yields the spatial semantics around each sensor, comprehensively reflecting the land use structure and spatial combination around the sensor. This representation not only includes spatial coverage, proximity relationships, and structural complexity that are difficult to obtain using traditional POI methods, but also possesses the ability to adaptively express urban functional mixing and spatial pattern heterogeneity.

[0049] This method not only solves the problem of weak expressive power of POI spatial structure, but also provides a solid spatial semantic foundation for subsequent dynamic graph modeling and spatiotemporal dependency analysis.

[0050] Step 2 includes:

[0051] Spatial proximity is the basis for determining the correlation between objects. Spatial units with similar attributes or functions may exhibit highly similar behaviors even if they are physically far apart. Therefore, adjacency matrices that only consider geographical distance or road topology are insufficient, as sensors with similar spatial semantics tend to exhibit similar traffic behavior trends. To this end, after obtaining the spatiotemporal representations of each sensor, it is necessary to perform spatial dependency coupling modeling for both short and long distances. That is, based on the conventional short-distance dependency adjacency matrix that only considers geographical distance, a long-distance dependency adjacency matrix calculated from spatiotemporal distribution characteristics is added with weights. The degree of short-distance spatial dependency and long-distance spatial dependency between different nodes is calculated by formulas (1) and (2), respectively, and their combination is determined by an artificial threshold, as shown in formula (3).

[0052] (1)

[0053] (2)

[0054] (3)

[0055] in, Represents a node and nodes The short-range spatial dependence between them was calculated using a threshold Gaussian kernel function. Represents a node To the node Road network distance, It is a threshold. It is the standard deviation of distance, representing the perceptual range of short-distance spatial dependence; Represents a node and nodes The degree of long-distance spatial dependence between them and These are nodes and nodes Spatial semantic features; This represents an adjacency matrix that combines short-range and long-range dependencies. This is used to adjust the weights of short-distance and long-distance dependencies in the final composite graph; the static adjacency matrix for composite geo-neighbors and functional similarities is obtained by calculating using the above formula. .

[0056] Step 3 includes:

[0057] Real-world transportation networks often exhibit strong dynamic and non-stationary characteristics, making static adjacency matrices... While capable of representing steady-state spatial relationships between nodes, it struggles to adapt to real-world scenarios such as fluctuating traffic flow over time and frequent unforeseen events. Therefore, a dynamic graph structure is introduced, enabling the spatial relationships between nodes to adaptively adjust based on current features and time. Combined with multi-stage diffusion operations, it achieves time-varying modeling of spatial dependencies, thus allowing for more flexible modeling of complex traffic flow processes within the spatiotemporal graph neural network (STGNN).

[0058] As shown in formula (4), the core idea of ​​dynamic graph construction is: first, to concatenate the multi-source features (temporal embedding, flow features, spatial semantic features, etc.) of each sensor at the current moment into a matrix F. Then, using two sets of learnable projection parameters... , Calculate self-attention similarity and compare it with the static mask. Perform element-wise multiplication, then use the degree matrix. Normalize the order to obtain first-order adjacency;

[0059] Then multiply it together This allows for the acquisition of multi-order diffusing adjacencies, which are then replicated in the time dimension. Next, make the spatial graph and the temporal convolution kernel length consistent.

[0060] Combined with the aforementioned static adjacency matrix This allows for the simultaneous capture of both "steady-state global distance dependence" and "time-varying attribute similarity" within the same model framework, thus providing a more flexible representation of the complex dynamics of traffic flow. Finally, a time-updated adjacency matrix is ​​constructed. :

[0061] (4)

[0062] in, It is the scaling factor.

[0063] Step 4 includes:

[0064] First, the input static adjacency matrix Calculate the first-order adjacency matrix:

[0065] ;

[0066] in, This represents element-wise multiplication (Hadamard product). This is a mask matrix with zeros on the diagonal, used to eliminate the effects of self-connections; then, matrix multiplication is used to generate a matrix of 2 to... Higher-order adjacency relation matrix:

[0067] ;

[0068] Where · denotes matrix multiplication. Message passing is simulated by continuously multiplying by the original graph G. The influence between nodes after each step is determined, and then a mask matrix is ​​applied to eliminate the influence of self-connections. This will ultimately result in a sequence from order 1 to... The sequence of adjacency matrices of order 1; finally, the spatial graph structure is extended along the time dimension, and the intermediate time dimension and the final node dimension are merged to form a spatiotemporal node dimension.

[0069] The transformed result is then combined with the previously calculated time-update adjacency matrix to form a spatiotemporal localization graph. The meaning is the connection weight between the central node and all nodes within a time window at all time steps.

[0070] After obtaining the spatiotemporally localized graph used for subsequent graph convolution, the historical sequence is slid-unfolded to obtain a length of... Sliding time window Subsequently, a linear layer is used to increase the dimensionality of the features to obtain the features. :

[0071] ;

[0072] in, This represents the activation function. Represents the weights of the linear layer; in obtaining After determining the feature H, the mean value of the local time window features is calculated as the baseline feature. :

[0073] ;

[0074] in, This represents the size of the temporal convolution kernel, i.e., the length of the local sliding time window.

[0075] Then, through a reorganization operation, the node dimension and the time dimension are merged, and Reorganized into a format suitable for spatiotemporal graph convolution Subsequently, regarding Perform graph convolution operations on each graph structure in each previously computed spatiotemporal localization graph:

[0076] ;

[0077] in, It is the i-th spatiotemporal localization graph. , It is the i-th spatiotemporal localization graph and features The result after convolution; after obtaining the set of graph convolution results, concatenate all graph convolution results and fuse them through a linear layer to obtain the final result. , obtained It also encodes local temporal context and multi-graph spatial dependencies.

[0078] ;

[0079] in, This indicates concatenation along the feature dimension. Represents the weights of the linear layer. Ultimately, the output simultaneously encodes the local temporal context and the spatial dependencies of multiple graphs.

[0080] Step 5 includes:

[0081] To simultaneously capture both short-term changes and long-term periodic patterns in traffic flow, a two-stage time modeling framework of "Gated Recurrent Network (GRU) and Self-Attention Transformer" is constructed: First, the historical sequence is sequentially encoded using a GRU. By adaptively retaining or forgetting information through update and reset gates, fine-grained short-term evolutionary features are extracted. Subsequently, sine-cosine positional encoding is added to the obtained hidden state sequence, and a multi-head self-attention Transformer is introduced—each attention head independently learns (Q,K,V) projections and calculates weights, enabling the model to directly establish interactions between any two time points, thus capturing long-term dependencies. This two-stage framework retains the GRU's sensitivity to minute-level fluctuations while leveraging multi-head attention to focus on multi-scale temporal patterns in parallel, ultimately significantly improving the characterization and prediction accuracy of complex temporal dependencies.

[0082] Specifically, the short-term change modeling of the gated recurrent network (GRU) is as follows: Let the length of the historical time sequence be... The corresponding input is First, each moment Features The hidden states are gradually obtained by feeding them into the RNN module. The specific implementation process of the gated recurrent network GRU is shown in equations (5)-(8).

[0083] (5)

[0084] (6)

[0085] (7)

[0086] (8)

[0087] in, Decide How much of the hidden state needs to be preserved at any given moment? Information about the time; This represents the Sigmoid activation function, which compresses the gated signal to the range (0, 1); This represents the input feature vector at the current moment; The vector represents the hidden state vector of the previous time step, which contains historical information up to the previous time step; [ ] represents the vector concatenation operation; This represents the bias vector of the updated gate; Decision made To what extent are the hidden states ignored? and These represent the weight matrix and bias vector of the reset gate, respectively. Indicates time The candidate hidden state at each moment; This represents the hyperbolic tangent activation function, which normalizes the output value to the range (-1, 1). and Let represent the weight matrix and the bias vector of the candidate hidden state, respectively. This represents the Hadamard product (element-by-element multiplication). Indicates time The final hidden state at a given time step is the hidden state of the previous time step. and the current candidate hidden state The weighted sum is used as the output at this time step and passed to the next time step. Through the gating structure, RNN can effectively pass information between adjacent time steps and capture short-term time dependencies.

[0088] Self-attention Transformer for Long-Term Periodic Modeling: RNNs effectively characterize fine-grained dependencies between adjacent time steps through gating update mechanisms, but for correlations between much farther time steps, limitations in sequence length and gradient propagation make it difficult to fully capture them. Therefore, a multi-head self-attention layer of the Transformer is introduced on top of the hidden state sequence output by the RNN, allowing the model to establish direct interaction weights between any two time steps, thereby uncovering longer-range global temporal dependencies. The hidden state sequence generated by the RNN is positionally encoded and then input into the multi-head self-attention layer. The final sequence output of the attention layer represents the hidden temporal dependency result. This means it not only includes local information from adjacent time points but also incorporates long-distance interactions across time points. The time dependency modeling module employs an autoregressive strategy during prediction: the model generates the first... After the first step outputs, its hidden state is fed back to the GRU, and the "two-phase" module is executed repeatedly to gradually obtain... to Traffic flow estimates.

[0089] Step 6 includes:

[0090] Spatial dependence primarily reflects local abrupt changes or diffusion processes in traffic flow, while temporal dependence focuses on the potential correlations in traffic trends over long time spans. However, in real-world traffic scenarios, the demand for spatial or temporal dependence is not entirely consistent at different times. To address this, a module called ST-Dependency Decomposition (STDD) is introduced into the overall network structure to estimate the relative contributions of spatial and temporal dependence to prediction at the current moment.

[0091] Specifically, a gating mechanism is used to decompose the contributions of spatial and temporal dependencies at the input, which is then used to estimate the relative importance of spatial and temporal dependencies at the current time step. Its core operation is to concatenate node embeddings with temporal embeddings and other static features to represent the... Time Node The contribution of the corresponding spatial dependence can be represented by formula (9).

[0092] (9)

[0093] in, Indicates the degree of contribution from short-term dependence. This represents the sigmoid function. For learnable linear transformation parameters, This represents the result of splicing multi-source features. This is the activation function.

[0094] Finally, the model outputs... and As weights, spatially dependent results and time-dependent results The representations are weighted and fused to dynamically balance the relative contributions of the two types of dependencies in traffic flow prediction, thereby improving the model's adaptability and prediction accuracy in complex and ever-changing traffic scenarios.

[0095] The training strategy of this invention uses MAE as the main loss and Adam optimization, stopping early on the validation set MAE.

[0096] A traffic state prediction device based on area spatial semantics includes the following modules:

[0097] The vector computation module integrates traffic flow, temporal embedding, and remote sensing semantic computation, including vectors containing node distance, spatial semantics around the sensor, temporal embedding features, and traffic features.

[0098] The global static adjacency matrix calculation module constructs a physical proximity graph based on node distances to obtain a road short-range graph, and further obtains a short-range dependency adjacency matrix; it constructs a semantic adjacency graph based on the spatial semantics around the sensor to obtain a semantic long-range graph, and further obtains a long-range dependency adjacency matrix. The short-range dependency adjacency matrix and the long-range dependency adjacency matrix are combined according to weights to form a global static adjacency matrix.

[0099] The time-updated adjacency matrix calculation module uses the spatial semantics, temporal embedding features, and traffic features around the sensor to generate a time-updated adjacency matrix that updates over time, and performs multi-order diffusion and temporal localization.

[0100] The spatial dependency capture module uses a global static adjacency matrix and a time-updated adjacency matrix to perform multi-order graph convolution to capture spatial dependencies.

[0101] The time-dependency capture module uses a gated recurrent unit (GRU) to capture short-term changes and a self-attention mechanism to mine long-term cycles, thereby capturing time dependencies.

[0102] The results output module dynamically balances the contributions of spatial and temporal dependencies and outputs the final prediction results.

[0103] An electronic device includes: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method.

[0104] A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to implement the method described thereon.

[0105] 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. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0106] 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.

[0107] 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.

[0108] 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.

[0109] 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.

[0110] 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 traffic state prediction method based on area spatial semantics, characterized in that, Includes the following steps: Step 1: Integrate traffic flow, temporal embedding, and remote sensing semantics to compute vectors including node distance, spatial semantics around the sensor, temporal embedding features, and traffic features; Step 2: Construct a physical proximity graph based on node distances to obtain a short-range road graph, and further obtain a short-range dependency adjacency matrix; construct a semantic adjacency graph based on the spatial semantics around the sensor to obtain a long-range semantic graph, and further obtain a long-range dependency adjacency matrix; combine the short-range dependency adjacency matrix and the long-range dependency adjacency matrix according to weights to form a global static adjacency matrix. Step 3: Generate a time-updated adjacency matrix by utilizing the spatial semantics, temporal embedding features, and traffic features around the sensor, and perform multi-order diffusion and temporal localization. Step 4: Perform multi-order graph convolution using the global static adjacency matrix and the time-updated adjacency matrix to capture spatial dependencies; Step 5: Use a gated recurrent unit (GRU) to capture short-term changes and a self-attention mechanism to mine long-term cycles, thereby capturing time dependencies; Step 6: Dynamically balance the contributions of spatial and temporal dependencies, and output the final prediction result; Step 4 includes: Calculate the adjacency matrix from the input static adjacency matrix: then generate a matrix of 2 to 3 using the adjacency matrix multiplication. A higher-order adjacency relation matrix is ​​generated, and then combined with the previously calculated time-updated adjacency matrix to form a spatiotemporal localization graph; the historical sequence is then slide-unfolded to obtain a graph of length [missing information]. The sliding time window is then used, followed by feature upscaling using a linear layer. The upscaled features are then used to calculate the mean of the local time window features as the baseline features. Then, through a recombination operation, the node dimension and the time dimension are merged, and the upscaled features are recombined into features applicable to spatiotemporal graph convolution. Subsequently, graph convolution operations are performed on the spatiotemporal graph convolution applicable features in combination with each graph structure in each previously calculated spatiotemporal localization graph to obtain graph convolution results. All graph convolution results are concatenated and fused through a linear layer to obtain the spatial dependency result feature vector.

2. The traffic state prediction method based on area spatial semantics according to claim 1, characterized in that, In step 1, the semantic feature vector of the space around the sensor is obtained as follows: high-resolution remote sensing images are acquired, semantic segmentation is performed on the window around the sensor to obtain a pixel-level functional area category map; the number of pixels of each type of functional area in the window is counted, their area ratio is calculated, and a one-dimensional vector reflecting the land use structure is formed. Traverse the category map, count the number of adjacent pixels at the boundary of any two functional areas at the pixel scale, and construct a spatial interaction matrix; fuse the one-dimensional vector of area proportion with the dot product of the spatial interaction matrix to generate a spatial semantic vector around the sensor that simultaneously contains the area proportion and spatial adjacency relationship.

3. The traffic state prediction method based on area spatial semantics according to claim 2, characterized in that, Step 2 includes: calculating the short-distance spatial dependence of the road short-distance map using a threshold Gaussian kernel, calculating the long-distance spatial dependence of the semantic long-distance map using the cosine similarity of the functional area proportion vector, and then synthesizing a global static adjacency matrix according to the weights.

4. The traffic state prediction method based on area spatial semantics according to claim 2, characterized in that, Step 3 includes the following: The time-updated adjacency matrix construction method is as follows: First, the multi-source features of each sensor at the current time are concatenated into a matrix. Then, the self-attention similarity is calculated using two sets of learnable projection parameters, and multiplied element-wise with the static mask. Next, the degree matrix is ​​normalized to obtain a first-order adjacency matrix. Finally, these are multiplied together. This process yields multi-order diffusing adjacencies, and finally, replication occurs in the time dimension. This yields the time-updated adjacency matrix.

5. The traffic state prediction method based on area spatial semantics according to claim 2, characterized in that, Step 5 includes: The historical sequence is sequentially encoded using a gated recurrent network. With the help of update and reset gates, information is adaptively retained or forgotten to extract fine-grained short-term evolutionary features. Then, sine-cosine position encoding is added to the obtained hidden state sequence, and multi-head self-attention is introduced. Each attention head independently learns the projection and calculates the weight. The resulting attention layer outputs a time-dependent result feature vector.

6. The traffic state prediction method based on area spatial semantics according to claim 2, characterized in that, Step 6 includes: By concatenating node distance with temporal embedding features and multi-source features, the contribution of spatial dependence is represented. ,by and The representations of spatially dependent and temporally dependent feature vectors are weighted and fused.

7. A traffic state prediction device based on surface spatial semantics, which implements the method of claim 1, characterized in that, Includes the following modules: The vector computation module integrates traffic flow, temporal embedding, and remote sensing semantic computation, including vectors containing node distance, spatial semantics around the sensor, temporal embedding features, and traffic features. The global static adjacency matrix calculation module constructs a physical proximity graph based on node distances to obtain a road short-range graph, and further obtains a short-range dependency adjacency matrix; it constructs a semantic adjacency graph based on the spatial semantics around the sensor to obtain a semantic long-range graph, and further obtains a long-range dependency adjacency matrix. The short-range dependency adjacency matrix and the long-range dependency adjacency matrix are combined according to weights to form a global static adjacency matrix. The time-updated adjacency matrix calculation module uses the spatial semantics, temporal embedding features, and traffic features around the sensor to generate a time-updated adjacency matrix that updates over time, and performs multi-order diffusion and temporal localization. The spatial dependency capture module uses a global static adjacency matrix and a time-updated adjacency matrix to perform multi-order graph convolution to capture spatial dependencies. The time dependency capture module uses a gated recurrent unit (GRU) to capture short-term changes and a self-attention mechanism to mine long-term cycles, thereby capturing time dependencies. The results output module dynamically balances the contributions of spatial and temporal dependencies and outputs the final prediction results.

8. An electronic device, characterized in that, include: One or more processors; A memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Traffic prediction method based on multi-view fusion and diffusion diagram convolution

    CN120452195A

  • Gated multi-graph convolution perception modeling method for traffic flow prediction

    CN120706615A