Road network traffic state generation method based on graph embedded coding

By constructing a road network embedding representation learning model using GraphSAGE and a self-attention mechanism, and combining it with Transformer and GCN decoders, the problems of spatiotemporal feature extraction and multi-task processing of road network traffic states are solved, achieving more efficient traffic flow prediction and data completion.

CN121505854APending Publication Date: 2026-02-10BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511636906.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies are insufficient in extracting spatiotemporal features of road network traffic conditions under complex spatial structures and in handling multiple tasks. Traditional models lack a unified encoder-decoder framework, making it difficult to effectively mine long-distance node dependencies in graph structures.

Method used

The GraphSAGE model is used to capture the spatial information features of the road network, and the self-attention mechanism is combined to obtain the time series features. A road network embedding representation learning model based on spatiotemporal information aggregation is constructed, and the decoders of Transformer and GCN are used to perform traffic flow prediction and data completion tasks.

Benefits of technology

It improves the ability to fit the spatiotemporal features of road network traffic conditions, supports various traffic tasks, reduces training costs, provides support for establishing a unified traffic flow coding-decoding model, and enhances the model's adaptability and accuracy in different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505854A_ABST
    Figure CN121505854A_ABST
Patent Text Reader

Abstract

The invention discloses a road network traffic state generation method based on graph embedded coding, and belongs to the technical field of traffic road network traffic flow analysis and processing. Comprising the following steps: capturing road network spatial information features by using GraphSAGE, obtaining time sequence features through a self-attention mechanism, and constructing a road network embedded representation learning model based on spatio-temporal information aggregation; and constructing a road network traffic state generation model of graph embedded coding, obtaining a decoder based on Transform and GCN based on a road network embedded representation learning model of spatial-temporal information aggregation, and restoring to target output according to feature representation generated by STGE to complete a traffic flow prediction task and a data completion task. According to the method, fitting can be better carried out for the spatial-temporal characteristics of the road network, and a certain support is provided for establishing a unified traffic flow coding-decoding model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic flow analysis and processing technology for road networks, and in particular to a method for generating road network traffic states based on graph embedding coding. Background Technology

[0002] With the continuous advancement of my country's modernization process, people's quality of life and the level of public services have significantly improved. However, the rapid growth of the urban population and the continuous expansion of urban areas have also given rise to a series of challenges that urgently need to be addressed. Among these issues, improving urban traffic conditions has become an important topic, and traffic planners and managers need to take proactive and effective measures. Scientifically and rationally guiding and allocating traffic flow on the road network is one of the key paths to alleviating urban traffic congestion.

[0003] In recent years, with the gradual improvement of urban infrastructure, the rapid development of Internet communication technology, and the widespread use of positioning devices, a large number of traffic sensors have been deployed in road facilities and personal terminals, and the data generated by these sensors has accumulated to a massive scale. Against this backdrop of the era of traffic big data, the processing and analysis technology of traffic big data, as a core component of intelligent transportation systems, has undoubtedly become a current research focus.

[0004] With the continuous development of deep learning and generative models, more options have been provided for traffic flow state generation. The ongoing development of graph neural networks, traffic flow spatial feature extraction models, and sequence representation models has enabled deep learning models to demonstrate significant application effectiveness and enormous development potential in key areas such as non-Euclidean space task processing, traffic flow spatiotemporal feature extraction, and sequence deep representation. However, at the same time, this field still has certain shortcomings and research gaps: on the one hand, traditional time-series prediction models and graph neural networks lack sufficient coupling ability to road network traffic states under complex spatial structures, and fail to fully explore the dependencies of graph structures on distant nodes; on the other hand, the decoder design of most traffic state generation models is biased towards single tasks (such as traffic flow prediction or congestion generation), lacking a unified traffic state encoder-decoder framework to adapt to multi-task requirements. How to construct an encoder to embed representation learning of the spatiotemporal features of road network traffic states and form feature encodings, extract the hidden features, and design a decoder to decode and enable it to solve multiple traffic tasks remains a problem to be solved. Summary of the Invention

[0005] The purpose of this invention is to propose a method for generating road network traffic states based on graph embedding coding, comprising the following steps:

[0006] Step 1: Use GraphSAGE to capture spatial information features of the road network, obtain time series features through self-attention mechanism, and construct a road network embedding representation learning model based on spatiotemporal information aggregation;

[0007] Step 2: Construct a road network traffic state generation model based on graph embedding encoding. Obtain a decoder based on Transformer and GCN by a road network embedding representation learning model based on spatiotemporal information aggregation. Restore the target output based on the feature representation generated by STGE to complete the traffic flow prediction task and data completion task.

[0008] Furthermore, step 1 specifically includes the following sub-steps:

[0009] Step S11: Use the average speed of traffic flow as the feature value input to the road network embedding representation learning model, and input the adjacency matrix of the road network to represent the spatial structure of the road network.

[0010] Step S12: Based on the input GraphSage sampling method in the road network embedding representation learning model, aggregate the multi-level spatial features of the neighboring nodes of layer k into the current node, perform representation calculation on the input traffic flow feature matrix, and obtain a node feature matrix with the same dimension as the input and containing road network spatial information.

[0011] Furthermore, in step S11, the input dimension of the road network embedding representation learning model is the same as the dimension of the feature matrix.

[0012] Furthermore, the road network embedding representation learning model includes a spatial feature aggregation layer, a temporal feature aggregation layer, and a spatiotemporal information fusion layer.

[0013] Furthermore, the spatial attention module in the road network embedding representation learning model utilizes a multi-layer GraphSAGE model to sample nodes and their neighbors to generate node embeddings. At each time step ,exist The formula for calculating the embedding of a layer is:

[0014] ;

[0015] in It is a node exist Time Steps Layer embedding, It is a node The neighborhood group, It is an aggregate function. The weight matrix learned at each time step. It is a non-linear activation function, ReLU.

[0016] The aggregation function based on spatiotemporal attention is shown in the following equation:

[0017] ;

[0018] ;

[0019] ;

[0020] in and These are learnable parameters. This represents vector concatenation. It is an activation function. Representative node with his neighbors In time Attention weights;

[0021] For the time attention module, an attention mechanism is used to aggregate historical information in the time dimension within a time window. For each past point in time The time attention weights are calculated using the following formula. :

[0022] ;

[0023] in , , It is a learnable parameter matrix; where the time aggregation is represented as:

[0024] ;

[0025] The spatial aggregation results are combined with the temporal aggregation results using an activation function:

[0026] ;

[0027] in and It is a learnable parameter matrix. Finally, it is combined with the node's own features to generate the node embedding representation using the following formula. :

[0028] .

[0029] Furthermore, each decoder submodule in step 2 includes a multi-head attention unit, a GCN module, and a feedforward fully connected layer.

[0030] Furthermore, step 2 specifically includes the following sub-steps:

[0031] Step S21: Input the decoder part with the node embedding encoding matrix generated by the STGE encoder. ;

[0032] Step S22: Embedding the encoding matrix respectively with , , Multiplying the three random weight matrices yields the input matrix suitable for multi-head attention mechanisms. , , The attention weight calculation process is shown in the following formula:

[0033] ;

[0034] ;

[0035] ;

[0036] ;

[0037] in , , , It is the vector dimension of the K matrix. This represents the dimension of the input tensor of the attention mechanism module;

[0038] The original input vector is split into multiple heads, each of which independently learns different attention weights in a subspace. Then, the multi-view information is fused through linear projection. The calculation formula is as follows:

[0039] ;

[0040] ;

[0041] in To output the projection matrix;

[0042] The results after the multi-head self-attention mechanism are processed through residual connections and layer normalization to obtain intermediate variables. The road network adjacency matrix is ​​then fed into the GCN layer for further spatial feature extraction, calculated as shown in the following formula:

[0043] ;

[0044] in In the adjacency matrix A diagonal matrix was added to the base matrix. The degree matrix represents the road network structure, that is, the number of nodes that each node has connections with. Adding a diagonal matrix to the degree matrix takes into account not only the influence of neighboring nodes but also the influence of its own eigenvectors. It is a learnable parameter matrix. The activation function is ReLU. The output of the GCN layer is processed through residual connections and layer normalization before being input into the feedforward fully connected layer. The feedforward fully connected layer consists of two layers: the first layer uses the ReLU activation function, and the second layer does not use an activation function. The weight matrix is ​​a learnable matrix. The bias is calculated as shown in the following formula:

[0045] ;

[0046] Finally, the output of the Decoder is obtained. Multiple Decoder modules are stacked to form a decoder, and the output of the decoder is transformed linearly to obtain the final generated result.

[0047] Step S23: Perform a random masking operation on the input, setting 15% of the feature values ​​to 0 or null. Perform forward propagation on the input data that has undergone the masking operation and obtain an output with the same dimension. Use the loss function to calculate the error loss between the true value of the masked region and the model output value, solve the gradient, and backpropagate the error until the model converges.

[0048] The beneficial effects of this invention are as follows:

[0049] The decoder section of this invention combines a Transformer decoder with a Graph Convolutional Network (GCN), enabling better fitting of the spatiotemporal features of road networks. Training through data completion and traffic flow prediction tasks allows the model to support different traffic tasks and reduces training costs across various application scenarios, providing support for establishing a unified traffic flow encoding-decoding model. Attached Figure Description

[0050] Figure 1 This is a flowchart of the road network traffic state generation method based on graph embedding coding according to the present invention.

[0051] Figure 2 This is a schematic diagram of the STGE model structure of the present invention.

[0052] Figure 3 This is a schematic diagram of the GraphSAGE model calculation process of the present invention.

[0053] Figure 4 This is a schematic diagram of the GETG model structure of the present invention.

[0054] Figure 5 This is a schematic diagram of the mask training process of the present invention.

[0055] Figure 6 This is a heat map showing the actual traffic conditions of the road network in this invention.

[0056] Figure 7 This is a heatmap showing the completion results of the road network traffic status masking rate under the condition of 20% according to the present invention. Detailed Implementation

[0057] This invention proposes a method for generating road network traffic states based on graph embedding coding. The invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0058] Figure 1 This is a flowchart of the road network traffic state generation method based on graph embedding coding according to the present invention. Specifically:

[0059] Step 1: Use GraphSAGE to capture spatial information features of the road network, obtain time series features through self-attention mechanism, and construct a road network embedding representation learning model based on spatiotemporal information aggregation.

[0060] The embedded representation learning model includes spatial feature aggregation, temporal feature aggregation, and spatiotemporal information fusion layers. Its input GraphSage sampling method aggregates the multi-order spatial features of the neighboring nodes of layer k into the current node. It performs representation calculation on the input traffic flow feature matrix to obtain a node feature matrix with the same dimension as the input and containing road network spatial information. This node feature matrix refers to the data matrix composed of traffic flow indicators of all road segments in the road network at a certain time. Nodes refer to road segments in the road network, and node feature values ​​refer to traffic flow data on the road segments. The road network adjacency matrix is ​​a 0-1 matrix, representing the connection relationship between nodes of different road segments. Two road segments with a connection relationship are assigned a value of 1 at the corresponding position in the matrix.

[0061] The spatial attention module primarily utilizes a multi-layer GraphSAGE model to sample nodes and their neighbors to generate node embeddings. At each time step ,exist The layer embedding calculation is shown in formula (1):

[0062] ; (1)

[0063] in It is a node exist Time Steps Layer embedding, It is a node The neighborhood group, It is an aggregate function. The weight matrix learned at each time step. It is the non-linear activation function ReLU.

[0064] The aggregation functions based on spatiotemporal attention are shown in equations (2) to (4):

[0065] ; (2)

[0066] ; (3)

[0067] ; (4)

[0068] in and These are learnable parameters. This represents vector concatenation. It is an activation function. Representative node with his neighbors In time Attention weights.

[0069] For the time attention module, an attention mechanism is used to aggregate historical information along the time dimension. Within the time window... For each past point in time The time attention weights are calculated using formula (5). :

[0070] ; (5)

[0071] in , , It is a learnable parameter matrix. Therefore, the time aggregation is represented as:

[0072] ; (6)

[0073] The spatial aggregation results are combined with the temporal aggregation results using an activation function:

[0074] ; (7)

[0075] in and It is a learnable parameter matrix. Finally, it is combined with the node's own features to generate the node embedding representation through formula (8). :

[0076] ; (8)

[0077] Step 2: Construct a road network traffic state generation model based on graph embedding encoding. Obtain a decoder based on Transformer and GCN by a road network embedding representation learning model based on spatiotemporal information aggregation. Restore the target output based on the feature representation generated by STGE to complete the traffic flow prediction task and data completion task.

[0078] The decoder architecture mainly consists of a Graph Convolutional Network (GCN) and decoder modules from the Transformer model. Each decoder submodule (Decoder) comprises a multi-head attention unit, a GCN module, and a feedforward fully connected layer.

[0079] Figure 2 This is a schematic diagram of the STGE model structure of the present invention. The input to the decoder is the node embedding encoding matrix generated by the STGE encoder. The embedding encoding matrix is ​​respectively compared with... , , Multiplying the three random weight matrices yields the input matrix suitable for multi-head attention mechanisms. , , The calculation of attention weights follows the scaling dot product rule, and the calculation process is shown in formulas (9) to (12).

[0080] ; (9)

[0081] ; (10)

[0082] ; (11)

[0083] ;(12)

[0084] in , , , It is the vector dimension of the K matrix. This represents the dimension of the input tensor of the attention mechanism module.

[0085] Multi-head attention mechanisms allow models to simultaneously focus on information from different locations. By splitting the original input vector into multiple heads, each head can independently learn different attention weights in a subspace. Then, multi-view information is fused through linear projection, thereby enhancing the ability to focus on different parts of the input sequence. The calculation process is shown in formulas (13) and (14):

[0086] ; (13)

[0087] ;(14)

[0088] in This is for outputting the projection matrix.

[0089] The results after the multi-head self-attention mechanism are processed through residual connections and layer normalization to obtain intermediate variables. The road network adjacency matrix is ​​fed into the GCN layer for further spatial feature extraction. The calculation process is shown in formula (15):

[0090] ; (15)

[0091] in In the adjacency matrix A diagonal matrix was added to the base matrix. The degree matrix represents the road network structure, which is the number of nodes that each node has connections with. Adding a diagonal matrix to the degree matrix takes into account not only the influence of neighboring nodes but also the influence of its own eigenvectors. It is a learnable parameter matrix. The activation function is ReLU. The output of the GCN layer is processed through residual connections and layer normalization before being input into the feedforward fully connected layer. The feedforward fully connected layer consists of two layers: the first layer uses the ReLU activation function, and the second layer does not use an activation function. The weight matrix is ​​a learnable matrix. The bias is calculated as shown in formula (16):

[0092] ; (16)

[0093] Finally, the output of the Decoder is obtained. Multiple Decoder modules are stacked to form a decoder, and the output of the decoder is transformed linearly to obtain the final generated result.

[0094] The overall forward computation process of the model is as follows: The observable road network traffic conditions are... Adjacency matrix of road network The input is fed into a graph embedding encoder (STGE), where GraphSAGE units capture the spatial features of the road network. Figure 3 This is a schematic diagram illustrating the computation process of the GraphSAGE model in this invention. It primarily focuses on the influence of neighboring nodes and two-hop neighboring nodes on the current node, while simultaneously utilizing an attention mechanism to capture the temporal characteristics of traffic flow, forming a fusion feature embedding encoding that aggregates spatiotemporal information. The main calculation formula is shown in (17).

[0095] ; (17)

[0096] Encoding traffic state features The input is fed into the decoder, which uses a Transformer and graph convolutional network to obtain the decoded traffic state results. Finally, the model's output is obtained through linear calculation. The calculation process is shown in formulas (18) and (19).

[0097] ; (18)

[0098] ; (19)

[0099] Figure 5 This is a schematic diagram of the mask training process of the present invention. The mask training process involves randomly masking the road network traffic flow features according to a given ratio on the input data. To prevent the masked locations from being confused with nodes where the traffic flow speed is 0, causing inaccurate prediction results, the masked node features are filled with null values. The masked data is then input into the model for forward propagation. The model is trained to predict the original content of the masked parts based on the unmasked context information, ultimately obtaining output results of the same dimension. The generated values ​​at the masked locations are compared with the true values, the error loss and gradient are calculated, and backpropagation is performed to optimize the parameters until the model gradually converges.

[0100] In masked training, the selection of the feature matrix mask position and mask ratio is crucial. It was found that after removing key road segments, the feature encoding of many road segments changed significantly, indicating that these key road segments are crucial locations in the entire road network. To ensure the model fully captures the spatiotemporal relationship of the road network, the features of several key road segments will not be globally masked, but features at certain time steps may be masked. When adjusting the mask ratio, if the mask rate is set too low, random selection of mask nodes may lead to uneven node distribution, making it difficult to cover the entire road network space. Furthermore, missing traffic states are more likely to exhibit completely random patterns. This problem can usually be solved using simple methods such as data smoothing, without needing to employ deep learning techniques for data completion. However, training the model on a low mask rate dataset may cause the model to focus too much on the reconstruction and completion of local nodes, neglecting the extraction of the overall spatial topology of the road network. This can lead to the spatial information generated by the model being overly skewed towards a few nodes during spatial information aggregation, making it unsuitable for completing other nodes. However, when the masking rate is set too high, the information loss of the dataset will increase, causing the input data after the mask to fail to truly fit the original spatiotemporal features. This makes it impossible for the model to extract enough feature patterns from the feature matrix after the mask, resulting in underfitting and making it impossible to accurately predict the mask position.

[0101] To ensure model convergence, the training loss function uses mean square error (MSE), and the specific calculation method is shown in formula (20):

[0102] ; (20)

[0103] in, The total number of samples; and These are the model output and the actual sample value at the corresponding positions.

[0104] Figure 6 This invention presents a heatmap of the actual traffic conditions of the road network. The vertical axis represents the code of the road segment, and the horizontal axis represents time. This allows for a more macroscopic view of the changing trends of the road network traffic conditions. The color represents the traffic flow speed value of the road network. Figure 7 This is a heatmap showing the completion results of the road network traffic state masking rate under the present invention (20%). It can be seen that the model can generate good data completion results. It can be observed that weekday road segments generally exhibit a bimodal pattern, while weekends show a generally lower daytime traffic flow speed, both of which are consistent with the actual situation of the road network. This demonstrates that the GETG model has good learning and generation capabilities for complex road network traffic states. Figure 4 This is a schematic diagram of the GETG model structure of the present invention.

[0105] The GETG model, trained using masks, learns the spatiotemporal features of the road network and achieves good experimental results in traffic data completion tasks, maintaining good generation performance across experiments with varying missing data rates. As the missing data rate increases, the model's test loss consistently outperforms other models, demonstrating good robustness; even with a 60% missing data rate, it can still generate road network traffic states.

[0106] In this embodiment, masking rates of 5%, 10%, 20%, 30%, 40%, 50%, and 60% were used to randomly mask the test set data. The masking rate can also be expressed as the missing rate of the road network state, which simulates the data missing phenomenon of several real data images as much as possible. The experimental results show that as the data missing rate increases, the prediction error of each model increases continuously.

[0107] Table 1. Masking error indices for multiple models at different masking rates.

[0108]

[0109] When the missing traffic flow status rate is below 20%, the error value of the model evaluation results is small and the fluctuation range is small, indicating that within this range, the model can fit the traffic flow status distribution of the road network well and generate results that match the real data. When the missing traffic status rate of the road network is between 5% and 10%, the missing status of the road network is more consistent with the state of completely random missing data. Therefore, a simple statistical learning model can fit the data results well. Usually, in this case, there is real data for the time before and after the missing data and for the surrounding adjacent road segments. Therefore, the HA model also has good experimental results. The proposed GETG model can also fit the real road network traffic status, but it has higher computational complexity than the HA model. When the missing rate of the road network reaches 20%, the advantages of deep learning models gradually become apparent. The RNERT model mainly considers the spatial features of the road network to fill in missing values. When the missing values ​​are evenly distributed in the road network map and the road network structure is not damaged, the model can show good prediction results.

[0110] When the missing traffic data rate of the road network is between 30% and 50%, the prediction accuracy and precision of the model decrease significantly. This is mainly because as the missing traffic data rate gradually increases, the road network structure is gradually disrupted, and there is insufficient data from adjacent road segments or adjacent time periods to be added as feature information to complete the model's generation. The proposed GETG model, through embedding and encoding the spatiotemporal feature information of the road network during training, can develop a certain memory of the road network's topology. The model's masking training process only hides the node features of the road network; however, the adjacency matrix does not mask any node adjacency relationships. Therefore, the embedding and encoding can, to some extent, compensate for the problem of missing neighbor data, achieving good prediction results even with a high data missing rate.

[0111] When the missing rate of road network traffic data reaches more than 50%, it can be seen that the task of completing the road network traffic status becomes more difficult. Traffic flow feature information of most road segments is missing, and algorithms based on context and simple adjacency relationships gradually become ineffective. However, the GETG model embeds and encodes the road network traffic data during training. The encoding result can preserve the spatiotemporal feature information of the road network traffic status at historical moments. Compared with other deep learning models, it can retain more spatiotemporal information of the road network. Therefore, it can also decode the corresponding road network traffic status well through the decoder and a small amount of neighbor node information. Experimental results show that embedding and encoding can better gather historical information and spatiotemporal features of the road network in the task of generating road network status.

[0112] In summary, this invention proposes a road network traffic state generation method based on graph embedding coding. Utilizing the sampling and aggregation concepts of GraphSAGE, it captures the spatial feature relationships of the road network by aggregating neighboring nodes and two-hop nodes. A self-attention mechanism captures the temporal feature information of nodes, and an aggregator aggregates the spatiotemporal feature information, ultimately obtaining a latent, highly representative feature vector containing the contextual information of nodes and the implicit deep feature relationships. The decoder uses a combination of a Transformer decoder and a Graph Convolutional Network (GCN), which can better fit the spatiotemporal features of the road network. Training is conducted through data completion and traffic flow prediction tasks, enabling the model to support different traffic tasks and reducing training costs in different application scenarios. This provides support for establishing a unified traffic flow coding-decoding model.

Claims

1. A method for generating road network traffic states based on graph embedding coding, characterized in that, Includes the following steps: Step 1: Use GraphSAGE to capture spatial information features of the road network, obtain time series features through self-attention mechanism, and construct a road network embedding representation learning model based on spatiotemporal information aggregation; Step 2: Construct a road network traffic state generation model based on graph embedding encoding. Obtain a decoder based on Transformer and GCN by a road network embedding representation learning model based on spatiotemporal information aggregation. Restore the target output based on the feature representation generated by STGE to complete the traffic flow prediction task and data completion task.

2. The road network traffic state generation method based on graph embedding coding according to claim 1, characterized in that, Step 1 specifically includes the following sub-steps: Step S11: Use the average speed of traffic flow as the feature value input to the road network embedding representation learning model, and input the adjacency matrix of the road network to represent the spatial structure of the road network. Step S12: Based on the input GraphSage sampling method in the road network embedding representation learning model, aggregate the multi-level spatial features of the neighboring nodes of layer k into the current node, perform representation calculation on the input traffic flow feature matrix, and obtain a node feature matrix with the same dimension as the input and containing road network spatial information.

3. The method for generating road network traffic state based on graph embedding coding according to claim 2, characterized in that, The input dimension of the road network embedding representation learning model in step S11 is the same as the dimension of the feature matrix.

4. The road network traffic state generation method based on graph embedding coding according to claim 3, characterized in that, The road network embedding representation learning model includes a spatial feature aggregation layer, a temporal feature aggregation layer, and a spatiotemporal information fusion layer.

5. The road network traffic state generation method based on graph embedding coding according to claim 4, characterized in that, The spatial attention module in the road network embedding representation learning model uses a multi-layer GraphSAGE model to sample nodes and their neighbors to generate node embeddings. At each time step ,exist The formula for calculating the embedding of a layer is: ; in It is a node exist Time Steps Layer embedding, It is a node The neighborhood group, It is an aggregate function. The weight matrix learned at each time step. It is a non-linear activation function, ReLU. The aggregation function based on spatiotemporal attention is shown in the following equation: ; ; ; in and These are learnable parameters. This represents vector concatenation. It is an activation function. Representative node with his neighbors In time Attention weights; For the time-attention module, an attention mechanism is used to aggregate historical information in the time dimension within a time window. For each past point in time The time attention weights are calculated using the following formula. : ; in , , It is a learnable parameter matrix; where the time aggregation is represented as: ; The spatial aggregation results are combined with the temporal aggregation results using an activation function: ; in and It is a learnable parameter matrix. Finally, it is combined with the node's own features to generate the node embedding representation using the following formula. : 。 6. The method for generating road network traffic state based on graph embedding coding according to claim 1, characterized in that, Each decoder submodule in step 2 includes a multi-head attention unit, a GCN module, and a feedforward fully connected layer.

7. The road network traffic state generation method based on graph embedding coding according to claim 6, characterized in that, Step 2 specifically includes the following sub-steps: Step S21: Input the decoder part with the node embedding encoding matrix generated by the STGE encoder. ; Step S22: Embedding the encoding matrix respectively with , , Multiplying the three random weight matrices yields the input matrix suitable for multi-head attention mechanisms. , , The attention weight calculation process is shown in the following formula: ; ; ; ; in , , , It is the vector dimension of the K matrix. This represents the dimension of the input tensor of the attention mechanism module; The original input vector is split into multiple heads, each of which independently learns different attention weights in a subspace. Then, the multi-view information is fused through linear projection. The calculation formula is as follows: ; ; in To output the projection matrix; The results after the multi-head self-attention mechanism are processed through residual connections and layer normalization to obtain intermediate variables. The road network adjacency matrix is ​​then fed into the GCN layer for further spatial feature extraction, calculated as shown in the following formula: ; in In the adjacency matrix A diagonal matrix was added to the base matrix. The degree matrix represents the road network structure, that is, the number of nodes that each node has connections with. Adding a diagonal matrix to the degree matrix takes into account not only the influence of neighboring nodes but also the influence of its own eigenvectors. It is a learnable parameter matrix. The activation function is ReLU. The output of the GCN layer is processed through residual connections and layer normalization before being input into the feedforward fully connected layer. The feedforward fully connected layer consists of two layers: the first layer uses the ReLU activation function, and the second layer does not use an activation function. The weight matrix is ​​a learnable matrix. The bias is calculated as shown in the following formula: ; Finally, the output of the Decoder is obtained. Multiple Decoder modules are stacked to form a decoder, and the output of the decoder is transformed linearly to obtain the final generated result. Step S23: Perform a random masking operation on the input, setting 15% of the feature values ​​to 0 or null. Perform forward propagation on the input data that has undergone the masking operation and obtain an output with the same dimension. Use the loss function to calculate the error loss between the true value of the masked region and the model output value, solve the gradient, and backpropagate the error until the model converges.