Road network traffic state prediction method based on large language model spatio-temporal feature embedding

By combining a large language model with a dynamic spatiotemporal graph convolutional network, the spatial and temporal semantic embeddings of the traffic system are extracted, which solves the problem of insufficient modeling of spatiotemporal heterogeneity in traffic prediction models and realizes high-precision traffic state prediction and control strategy support.

CN121838449APending Publication Date: 2026-04-10SOUTHEAST UNIV
View PDF 0 Cites 1 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing traffic prediction models struggle to dynamically capture changes in the topology of traffic networks and lack explicit modeling of node semantic features and temporal semantic features, leading to delayed or biased prediction results. Furthermore, large language models have limitations in spatiotemporal data encoding and are difficult to apply directly to dynamic traffic prediction.

Method used

By integrating a large language model with a dynamic spatiotemporal graph convolutional network, spatial and temporal semantic embeddings of the traffic system are extracted, generating an adjacency matrix of the dynamic spatiotemporal graph. Combining Tucker decomposition and dynamic graph convolutional network, traffic state prediction is performed, achieving multi-dimensional dynamic modeling of the traffic network.

Benefits of technology

It significantly improves the prediction accuracy of urban traffic flow, public transportation passenger flow and electric vehicle charging demand, adapts to the dynamic changes of traffic networks, reduces the complexity of model development, enhances adaptability to long-tail scenarios, and provides high-precision prediction results for traffic control strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121838449A_ABST
    Figure CN121838449A_ABST
Patent Text Reader

Abstract

The invention discloses a road network traffic state prediction method based on large language model spatial-temporal feature embedding, and belongs to the technical field of calculation, reckoning or counting. According to the method, semantic embedding of space and time is extracted by pre-training a large language model, and the space-time heterogeneity of a traffic system is quantified; a dynamic adjacent matrix is constructed by using Tucker decomposition, and combined modeling is performed on historical traffic data in combination with a dynamic space-time diagram convolutional network, so that high-precision prediction of a future traffic state is realized. The method does not need manual feature design, has good generalization ability and multi-mode adaptability, can be widely applied to scenes of road traffic, rail traffic demand prediction and the like, and significantly improves prediction accuracy and control response ability in a complex traffic environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to intelligent transportation technology, and more particularly to a traffic prediction method that combines a large language model with a dynamic spatiotemporal graph convolutional network. Specifically, it discloses a road network traffic state prediction method based on the spatiotemporal feature embedding of a large language model, which is used to improve the prediction accuracy of scenarios such as urban traffic flow and public transportation passenger flow, and belongs to the technical field of calculation, estimation or counting. Background Technology

[0002] The complexity of urban transportation systems stems from their spatiotemporal heterogeneity: the topological relationships between road nodes change dynamically over time, such as differences in travel patterns during holidays and road network reconstruction caused by unforeseen events, and the flow characteristics of different nodes vary significantly. Traditional traffic prediction models, such as Spatial-Temporal Graph Convolutional Network (STGCN) and Diffusion Convolutional Recurrent Neural Network (DCRNN), rely on predefined static adjacency matrices and cannot dynamically capture the topological changes of the traffic network, leading to lagging or biased prediction results. Furthermore, existing dynamic graph generation methods, such as Dynamic Graph Convolutional Recurrent Network (DGCRN) and the graph neural network architecture GraphWaveNet, rely on recurrent neural networks or Markov assumptions, resulting in the accumulation of temporal dynamic estimation errors and a lack of explicit modeling of node semantic features and temporal semantic features.

[0003] While Large Language Models (LLMs) have demonstrated powerful semantic understanding and knowledge reasoning capabilities in natural language processing, they still have significant limitations in encoding spatiotemporal data. Existing research often treats LLMs as general knowledge bases, introducing spatiotemporal information through fine-tuning or cueing engineering. However, LLMs' understanding of the essential nature of continuous spatiotemporal structures is still insufficient—their inherent discrete symbol processing mechanism struggles to directly model the complex spatiotemporal dynamics of traffic systems, and their explicit ability to express structured spatiotemporal dependencies such as road network topology constraints and traffic flow propagation delays is limited. Furthermore, LLMs lack interpretable reasoning mechanisms when dealing with real-time spatiotemporal heterogeneity, making it difficult to fine-grainedly align knowledge in the textual semantic space with the actual spatiotemporal evolution process, thus limiting their direct application in dynamic traffic prediction. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of the aforementioned background technology by providing a road network traffic state prediction method based on a large language model and a dynamic spatiotemporal graph convolutional network. By integrating spatial and temporal semantic embedding, this invention aims to dynamically characterize the spatiotemporal heterogeneity of traffic system features, thereby improving prediction accuracy and solving the technical problem of insufficient modeling of spatiotemporal heterogeneity in traditional traffic prediction models.

[0005] To achieve the above-mentioned objectives, the present invention employs the following technical solution:

[0006] A road network traffic state prediction method based on spatiotemporal feature embedding of large language models includes:

[0007] Step 1: Obtain historical observation data of the target city's transportation system and collect the identification names and corresponding timestamp information of each transportation station. The historical observation data is a three-dimensional tensor describing the traffic status of the transportation station at a continuous time step.

[0008] Step 2: Extract spatial and temporal heterogeneity knowledge of the target city's transportation system using a pre-trained large language model:

[0009] The names of traffic station identifiers described in natural language are text-encoded to construct a natural language query for traffic stations. The spatial embedding vector of the last output token in the last hidden state of the large language model is extracted. The spatial embedding vector is coupled with the spatial observations of historical observation data to obtain an initial spatial semantic embedding matrix. The initial spatial semantic embedding matrix is ​​then dimensionality-reduced. The dimensionality-reduced initial spatial semantic embedding matrix is ​​mapped to obtain a static spatial embedding matrix representing spatial knowledge.

[0010] Text encoding is performed on the timestamp information corresponding to the traffic station identification name described in natural language. Natural language queries for query time periods are constructed. The time embedding vector of the last output token in the last hidden state after the large language model is extracted. The time embedding vector is coupled with the time observation value of historical observation data to obtain the initial time semantic embedding matrix. The initial time semantic embedding matrix is ​​dimensionality reduced. The dimensionality-reduced initial time semantic embedding matrix is ​​mapped to obtain the static time embedding matrix representing time knowledge.

[0011] Step 3: Combining the initial spatial semantic embedding matrix after dimensionality reduction, the initial temporal semantic embedding matrix after dimensionality reduction, and historical observation data, the adjacency matrix of the dynamic spatiotemporal graph is generated through Tucker tensor decomposition.

[0012] Step 4: Based on the adjacency matrix of the dynamic spatiotemporal graph and historical observation data, a dynamic graph convolutional network model is jointly established. The dynamic graph convolutional network model is used to predict the future traffic status of the target city's transportation system.

[0013] As a further optimization of the road network traffic state prediction method based on spatiotemporal feature embedding of large language models, step 3 specifically includes:

[0014] Step 3.1: Integrate historical observation data in the spatial dimension. and the initial spatial semantic embedding matrix after dimensionality reduction A graph neural network is used to aggregate information from the fused data, generating dynamic spatial embedding matrices for the source and target nodes. and Historical observation data The mean value is obtained by taking the spatial dimension. ,Will With the dimensionality-reduced initial temporal semantic embedding matrix After concatenation, the data is input into a one-dimensional causal convolutional network to extract the dynamic temporal embedding matrix. ;

[0015] Step 3.2, Define the core tensor Through the three-module product operation Spatial and temporal knowledge are embedded and fused, and a dynamic spatial embedding matrix is ​​formed along the source node. The first dimension normalizes the result of the three-modulus product operation using the softmax function to obtain the adjacency matrix of the dynamic spatiotemporal graph. ,in, The dimension of the initial spatial semantic embedding matrix after dimensionality reduction. The dimension of the initial temporal semantic embedding matrix after dimensionality reduction. This indicates the use of the source node dynamic space embedding matrix. Perform modular product operation on the first dimension. Indicates the use of the target node dynamic space embedding matrix The second dimension is used for modular product operation. Indicates the use of dynamic temporal embedding matrix The third dimension performs a modular product operation, resulting in a dynamic temporal embedding matrix. The third dimension represents the context state at the current time step, the source node dynamic space embedding matrix. The vector obtained by projection in the first dimension and the dynamic space embedding matrix of the target node The vector obtained by projection in the second dimension and the dynamic temporal embedding matrix The vectors obtained by projecting in the third dimension are orthogonal.

[0016] As a further optimization of the road network traffic state prediction method based on spatiotemporal feature embedding of large language models, step 4 specifically includes:

[0017] Step 4.1: Construct a dynamic graph convolutional network. The dynamic graph convolutional network includes at least two spatiotemporal graph convolutional blocks and a decoder. Each spatiotemporal graph convolutional block includes a spatial convolutional module and a temporal convolutional module. The spatial convolutional module utilizes the dynamic adjacency matrix of the current time step. The input feature data is subjected to spatial graph convolution, and the temporal convolution module extracts temporal features from the feature data output by the spatial convolution module. The hidden state output by the final spatiotemporal graph convolution module is decoded to obtain the future... Traffic condition prediction results at each time step;

[0018] Step 4.2: Train and optimize the dynamic graph convolutional network.

[0019] As a further optimization of the road network traffic state prediction method based on spatiotemporal feature embedding of large language models, the calculation formula for the spatial convolution module in step 4.1 is as follows: ,in, For the first Spatial characteristics of layers For the first The spatiotemporal convolutional features output by the layer, For activation function, For the first The spatial convolution kernel parameters of the layer, , The weights of the dynamic spatial embedding matrix participating in spatial convolution operations in each layer iteration are shared by all traffic stations within the same layer when participating in spatial convolution operations at all time steps. .

[0020] As a further optimization of the road network traffic state prediction method based on spatiotemporal feature embedding of large language models, the calculation formula for the temporal convolution module in step 4.1 is as follows: ,in, For the first The temporal characteristics of the current time step of the layer. For the first The temporal convolution kernel parameters at the current time step of the layer. This is for average pooling operations.

[0021] As a further optimization of the road network traffic state prediction method based on spatiotemporal feature embedding of large language models, step 4.2 uses the Adam optimizer to train and optimize the dynamic graph convolutional network.

[0022] As a further optimization of the road network traffic state prediction method based on spatiotemporal feature embedding of large language models, step 4.2 uses the mean absolute error as the loss function to train and optimize the dynamic graph convolutional network.

[0023] In the method for predicting road network traffic status based on spatiotemporal feature embedding of large language models, step 2 involves using principal component analysis to reduce the dimensionality of the initial spatial semantic embedding matrix and the initial temporal semantic embedding matrix, and then using a multilayer perceptron to map the dimensionality-reduced initial spatial semantic embedding matrix and the dimensionality-reduced initial temporal semantic embedding matrix.

[0024] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described road network traffic state prediction method.

[0025] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described road network traffic state prediction method.

[0026] The present invention, by adopting the above technical solution, has the following beneficial effects:

[0027] 1. Traditional traffic prediction models rely on predefined static graph structures, which are difficult to adapt to dynamic changes in road network topology, such as differences in travel patterns during holidays and traffic restructuring caused by emergencies. This invention constructs an adjacency matrix in real time through a dynamic graph generation module, and combines spatial and temporal semantic information extracted by a large language model to effectively capture the temporal evolution characteristics of the traffic network. This improves the prediction accuracy of scenarios such as urban traffic flow, public transportation passenger flow, and electric vehicle charging demand, adapts to the dynamic changes and complex coupling relationships of the traffic network, and significantly enhances the adaptability to complex traffic scenarios such as traffic accidents and special weather.

[0028] 2. Traditional methods rely on manual design of node attributes and time features such as road length and number of lanes, resulting in high modeling costs and weak generalization ability. This invention automatically extracts the semantic embeddings of road nodes and time through a pre-trained large language model, which can quantify the heterogeneity features of the traffic system without manual intervention, reducing the complexity of model development and enhancing the prediction stability for long-tail scenarios.

[0029] 3. Existing traffic prediction technologies are usually designed for single scenarios and have poor cross-modal adaptability. This invention uses a unified dynamic spatiotemporal graph convolution framework to be compatible with multi-source data such as road traffic flow, public transportation passenger flow and electric vehicle charging demand, so as to achieve collaborative prediction of multi-modal traffic systems, avoid the repeated development of models for different scenarios, and significantly reduce deployment costs.

[0030] 4. Traditional models often present prediction results in the form of statistical indicators, which lack direct correlation with traffic control strategies. The high-precision prediction results generated by the present invention through dynamic spatiotemporal graph convolutional network can be directly used as the basis for decision-making on traffic light control, public transportation schedule optimization and charging station load allocation, thereby improving urban traffic operation efficiency and emergency response capabilities. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of a dynamic graph convolutional network based on Tucker decomposition for predicting traffic conditions, provided in an embodiment of the present invention.

[0032] Figure 2 This is an overall flowchart of the road network traffic state prediction method proposed in this invention.

[0033] Figure 3 This is a schematic diagram of large language model query and embedding extraction provided in one embodiment of the present invention.

[0034] Figure 4 This is a schematic diagram of the spatiotemporal convolution process of a dynamic graph provided in an embodiment of the present invention. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this 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 only some, not all, of the embodiments of this invention.

[0036] To address the problems of existing traffic prediction technologies, this invention proposes a spatiotemporal heterogeneity modeling method driven by LLM (Liquidity Management Model). Combining Tucker decomposition and graph neural networks, a Tucker-Decomposed Dynamic Graph Convolutional Network (TD-DGCN) model is proposed to achieve multi-dimensional dynamic modeling of the traffic system. Spatial and temporal semantic embeddings are extracted using a pre-trained large language model to quantify the heterogeneity features of the traffic system. Based on this, a core tensor is constructed using Tucker decomposition. Combining spatial and temporal embeddings extracted by LLM with historical observation data Generate a time-variable dynamic spatiotemporal graph adjacency matrix. Furthermore, a dynamic graph convolutional network is used to jointly model the adjacency matrix of the dynamic spatiotemporal graph with historical observation data to predict future traffic conditions. This method adapts to real-time changes in the traffic network through dynamic modeling capabilities, enhances adaptability to long-tail scenarios such as special holidays by utilizing LLM embedding, and is applicable to multimodal transportation systems.

[0037] In one embodiment of the present invention, Figure 1 The paper fully demonstrates the prediction of traffic conditions using a dynamic graph convolutional network based on Tucker decomposition. The left side shows the LLM-driven spatiotemporal heterogeneity representation module, while the right side shows the dynamic graph convolutional network based on Tucker decomposition. It clearly presents the entire process from LLM knowledge extraction and dynamic spatiotemporal graph generation to multi-step traffic prediction.

[0038] like Figure 2 As shown, the road network traffic state prediction method based on spatiotemporal feature embedding of a large language model proposed in this invention includes steps 1 to 4.

[0039] Step 1: Obtain historical observation data of the target city's transportation system and construct a structured input: The historical observation data includes the operational status of multiple transportation stations over continuous time steps, formalized as a three-dimensional tensor. , For the number of transportation stations, For traffic status characteristics of transportation stations, The time window length is defined; simultaneously, the identifier name and corresponding timestamp information of each transportation station are collected for subsequent queries to the large language model.

[0040] Step 2, as follows Figure 3 As shown, a pre-trained large language model is used to extract spatial and temporal heterogeneity knowledge of the target city's transportation system.

[0041] To address spatial heterogeneity, a large language model is used to text-encode the names of traffic station identifiers in the natural language description. A natural language query is constructed for each traffic station included in the natural language description to obtain descriptions of the station's function, surrounding environment, and traffic characteristics. The spatial embedding vector of the last output token in the last hidden state of the large language model is extracted. This spatial embedding vector is then coupled with the spatial observations from historical observation data to obtain an initial spatial semantic embedding matrix. , This represents the number of traffic state features in the initial spatial embedding matrix; the obtained initial spatial semantic embedding matrix... Principal component analysis is performed to reduce dimensionality, resulting in the initial spatial semantic embedding matrix. , The dimension of the initial spatial semantic embedding matrix is ​​reduced; and the compressed initial spatial semantic embedding matrix is ​​mapped through a learnable multilayer perceptron. Generate a static spatial embedding matrix representing spatial knowledge. , The feature dimension representing the embedded spatial semantic information.

[0042] To address temporal heterogeneity, LLM is used to text-encode the timestamps corresponding to traffic stations described in natural language. Natural language queries are constructed for typical intraday time segments and query periods such as days of the week. The time embedding vector of the last output token in the last hidden state of the large language model is extracted. This time embedding vector is coupled with the time observation values ​​of historical observation data obtained from actual observations to obtain the initial temporal semantic embedding matrix. , This represents the number of traffic state features in the initial temporal semantic embedding matrix. For query time period duration; initial time semantic embedding matrix Principal component analysis was used to reduce the dimensionality, resulting in the initial temporal semantic embedding matrix. , The dimension of the initial temporal semantic embedding matrix after dimensionality reduction; The static temporal embedding matrix representing temporal knowledge is obtained through multilayer perceptron mapping. , The feature dimension representing embedded temporal semantic information.

[0043] In one embodiment of the present invention, for a station named "Downtown Berkeley", the constructed query could be: "Please describe in detail the passenger flow characteristics, passenger composition and the impact of the surrounding environment on the operation of the BART station located in downtown Berkeley during weekday morning rush hour."

[0044] Step 3, as follows Figure 4 As shown, combined with the initial spatial semantic embedding matrix after dimensionality reduction The initial temporal semantic embedding matrix after dimensionality reduction and historical observation data Adjacency matrices of dynamic spatiotemporal graphs containing information about the relationships between transportation stations are generated through Tucker tensor decomposition. Specifically, it includes the following steps:

[0045] Step 3.1: Integrate historical observation data in the spatial dimension. and the initial spatial semantic embedding matrix after dimensionality reduction A graph neural network STGCN is used to aggregate information from the fused data, generating dynamic spatial embedding matrices for the source and target nodes. and Source node dynamic space embedding matrix This matrix represents the information matrix showing the impact of the traffic status of the currently queried transportation station on the traffic status of other transportation stations; the target node dynamic spatial embedding matrix. This is an information matrix representing the impact of traffic conditions at other transportation stations on the traffic conditions at the currently queried transportation station; simultaneously, it includes historical observation data. The mean value is obtained by taking the spatial dimension. ,Will With the dimensionality-reduced initial temporal semantic embedding matrix After concatenation, the data is input into a one-dimensional causal convolutional network to extract the dynamic temporal embedding matrix. .

[0046] Step 3.2, constructing a dynamic adjacency matrix using the Tucker decomposition mechanism: Define a learnable core tensor Through the three-module product operation Spatial and temporal knowledge are embedded and fused, and a dynamic spatial embedding matrix is ​​formed along the source node. The first dimension normalizes the result of the three-modulus product operation using the softmax function, yielding the adjacency matrix of the time-variable dynamic spatiotemporal graph. To depict the dynamic evolution of traffic connectivity; among them, This indicates the use of the source node dynamic space embedding matrix. The first dimension is used for modular product operation, and the source node dynamic space embedding matrix is ​​used. The first dimension represents the spatial dynamic characteristics of the source node. Indicates the use of the target node dynamic space embedding matrix The second dimension performs a modular product operation, and the target node's dynamic space embedding matrix is ​​used. The second dimension represents the spatial dynamic characteristics of the target node. Indicates the use of dynamic temporal embedding matrix The third dimension performs a modular product operation, resulting in a dynamic temporal embedding matrix. The third dimension represents the context state at the current time step, the source node dynamic space embedding matrix. The vector obtained by projection in the first dimension and the dynamic space embedding matrix of the target node The vector obtained by projection in the second dimension and the dynamic temporal embedding matrix The vectors obtained by projection in the third dimension are orthogonal. The three-dimensional product operation reflects the calculation process from information transmission to information reception and then to obtaining the dynamic information matrix by combining the context state of the time step.

[0047] Step 4, based on the adjacency matrix of the generated dynamic spatiotemporal graph and historical observation data Perform joint modeling and output future traffic state prediction results. ,in, To predict the time step, and It can be adjusted according to the actual application scenario, but it must be ensured that To satisfy the temporal causality constraint, the specific steps include the following:

[0048] Step 4.1: Constructing a Dynamic Graph Convolutional Network: The dynamic graph convolutional network consists of at least two spatiotemporal graph convolutional blocks and a decoder. In each spatiotemporal graph convolutional block, the dynamic adjacency matrix of the current time step is first utilized. Spatial graph convolution is performed on the input feature data, and the kernel parameters incorporate dynamic spatial embedding to achieve spatial aggregation of traffic station features. The calculation formula for the spatial convolution module is as follows: , For the first Spatial characteristics of layers For the first The spatiotemporal convolutional features output by the layer, For activation function, For the first The spatial convolution kernel parameters of the layer, , The weights of the dynamic spatial embedding matrix participating in spatial convolution operations in each layer iteration are shared by all traffic stations within the same layer when participating in spatial convolution operations at all time steps. To ensure parameter efficiency and generalization ability, the spatial convolution module in the spatiotemporal graph convolution module of layer 1 takes historical observation data as input feature data. In the second layer and subsequent layers, the spatial convolution module of the spatiotemporal graph convolution module receives feature data from the output of the previous layer's spatiotemporal graph convolution module as input. Subsequently, the temporal convolution module applies one-dimensional causal convolution to the feature sequence spatially aggregated by the spatial convolution module to extract features along the temporal dimension. To maintain consistency between the graph structure and the temporal scale of the features, average pooling is performed on the dynamic adjacency matrix along the temporal dimension. The calculation formula for the temporal convolution module is as follows: , For the first The temporal characteristics of the current time step of the layer. For the first The temporal convolution kernel parameters at the current time step of the layer. For average pooling operations; by performing spatiotemporal convolution of the adjacency matrix and spatiotemporal observation results of the dynamic spatiotemporal graph layer by layer in multiple spatiotemporal graph convolutional blocks, high-level spatiotemporal patterns are gradually extracted. The spatiotemporal result matrix is ​​obtained by re-spatiotemporal convolution: and hidden tensors ,in, Refers to time step, Refers to the number of spatiotemporal convolutions. A number greater than 0 represents the kernel size. The feature dimensions of the final iteration result are used; finally, the hidden state output from the last spatiotemporal graph convolutional block is input into a two-layer multilayer perceptron decoder to generate a prediction of the future. Traffic condition prediction results at each time step ;

[0049] Step 4.2, train and optimize the model: use the mean absolute error as the loss function, i.e. Where N is the total number of transportation stops, and Q is the total number of time steps. For the i-th transportation station in the future... The actual value of traffic status at each time step. For the i-th transportation station in the future... The predicted traffic states at each time step are trained end-to-end using the Adam optimizer. In experiments, the number of spatiotemporal convolutional blocks is set to 2, the number of output channels for spatial and temporal convolutions are 32 and 64 respectively, and the kernel size is 2. This method is validated on multiple real-world traffic datasets, including BART, METR-LA, and UrbanEV, and significantly improves prediction accuracy across different traffic modes, urban areas, and prediction durations, demonstrating the effectiveness and versatility of this invention.

[0050] This invention proposes a dynamic spatiotemporal graph-based traffic prediction method based on a large language model. It automatically extracts spatial and temporal heterogeneity knowledge of the traffic system through LLM, combines this with Tucker decomposition to generate a dynamic graph structure, and performs spatiotemporal graph convolution on the dynamic graph to achieve high-precision prediction. This method requires no manual feature design, possesses good scalability, is applicable to various urban traffic scenarios, and effectively improves the accuracy and robustness of traffic state prediction in complex environments.

[0051] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any transformations or substitutions that can be conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for road network traffic state prediction based on spatiotemporal feature embedding of large language models, characterized in that, The method comprises the following steps: Step 1, obtaining historical observation data of a target urban traffic system, and collecting identification names of traffic sites and corresponding timestamp information, wherein the historical observation data is a three-dimensional tensor describing traffic states of the traffic sites at continuous time steps; Step 2, extracting spatial and temporal heterogeneity knowledge of the target urban traffic system by using a pre-trained large language model: text encoding is performed on the natural language description of the identification name of the traffic site, a natural language query of the traffic site is constructed, a spatial embedding vector of a last output token in a last layer of hidden states of the large language model is extracted, the spatial embedding vector is coupled with a spatial observation value of the historical observation data, an initial spatial semantic embedding matrix is obtained, dimensionality reduction is performed on the initial spatial semantic embedding matrix, and the initial spatial semantic embedding matrix after the dimensionality reduction is mapped to obtain a static spatial embedding matrix representing spatial knowledge, text encoding is performed on the timestamp information corresponding to the natural language description of the identification name of the traffic site, a natural language query of a query period is constructed, a temporal embedding vector of a last output token in a last layer of hidden states of the large language model is extracted, the temporal embedding vector is coupled with a temporal observation value of the historical observation data, an initial temporal semantic embedding matrix is obtained, dimensionality reduction is performed on the initial temporal semantic embedding matrix, and the initial temporal semantic embedding matrix after the dimensionality reduction is mapped to obtain a static temporal embedding matrix representing temporal knowledge; Step 3, combining the initial spatial semantic embedding matrix after the dimensionality reduction, the initial temporal semantic embedding matrix after the dimensionality reduction, and the historical observation data, and generating an adjacency matrix of a dynamic spatio-temporal graph by using Tucker tensor decomposition; Step 4, jointly establishing a dynamic graph convolution network model based on the adjacency matrix of the dynamic spatio-temporal graph and the historical observation data, wherein the dynamic graph convolution network model is used for predicting a future traffic state of the target urban traffic system.

2. The method of claim 1, wherein, The step 3 specifically comprises: Step 3.1, fuse historical observation data in spatial dimension and the initial spatial semantic embedding matrix after dimension reduction , aggregate information of the fused data by a graph neural network to generate a dynamic spatial embedding matrix of the source node and the target node and , the historical observation data take the mean in the spatial dimension to obtain , concatenate and the initial temporal semantic embedding matrix after dimension reduction input a one-dimensional causal convolution network to extract a dynamic temporal embedding matrix ; Step 3.2, Define the core tensor Through the three-module product operation Spatial and temporal knowledge are embedded and fused, and a dynamic spatial embedding matrix is ​​formed along the source node. The first dimension normalizes the result of the three-modulus product operation using the softmax function to obtain the adjacency matrix of the dynamic spatiotemporal graph. ,in, The dimension of the initial spatial semantic embedding matrix after dimensionality reduction. The dimension of the initial temporal semantic embedding matrix after dimensionality reduction. This indicates the use of the source node dynamic space embedding matrix. Perform modular product operation on the first dimension. Indicates the use of the target node dynamic space embedding matrix The second dimension is used for modular product operation. Indicates the use of dynamic temporal embedding matrix The third dimension performs a modular product operation, resulting in a dynamic temporal embedding matrix. The third dimension represents the context state at the current time step, the source node dynamic space embedding matrix. The vector obtained by projection in the first dimension and the dynamic space embedding matrix of the target node The vector obtained by projection in the second dimension and the dynamic temporal embedding matrix The vectors obtained by projecting in the third dimension are orthogonal.

3. The method of claim 2, wherein, The step 4 specifically comprises: Step 4.1, constructing a dynamic graph convolution network, the dynamic graph convolution network comprising at least two layers of spatio-temporal graph convolution blocks and a decoder, each layer of spatio-temporal graph convolution block comprising a spatial convolution module and a temporal convolution module, the spatial convolution module utilizing a dynamic adjacency matrix of a current time step performing spatial graph convolution on input feature data, the temporal convolution module performing feature extraction in a time dimension on feature data output by the spatial convolution module, and the hidden state output by the last layer of spatio-temporal graph convolution module being subjected to decoding processing to obtain a traffic state prediction result of future time steps; Step 4.2, training and optimizing the dynamic graph convolution network.

4. The method of claim 3, wherein, In step 4.1, the calculation formula of the spatial convolution module is: wherein, is the spatial feature of the i-th layer, is the spatial feature of the i-th layer, is the feature after spatial convolution of the i-th layer output, is the activation function, is the spatial convolution kernel parameter of the i-th layer, , , , is the weight of the dynamic spatial embedding matrix participating in the spatial convolution operation in each layer iteration, and all traffic stations in the same layer share the same when participating in the spatial convolution operation at all time steps.

5. The method of claim 4, wherein, In the step 4.1, the calculation formula of the time convolution module is: wherein, is the time feature of the current time step of the i-th layer, is the time feature of the current time step of the i-th layer, is the time kernel parameter of the current time step of the i-th layer, is the time kernel parameter of the current time step of the i-th layer, is the average pooling operation.

6. The method of claim 4, wherein, The step 4.2 uses an Adam optimizer to train and optimize the dynamic graph convolution network.

7. The method of claim 4, wherein, The step 4.2 uses a mean absolute error as a loss function to train and optimize the dynamic graph convolution network.

8. The method of claim 1, wherein, In the step 2, principal component analysis is used to perform dimensionality reduction on the initial spatial semantic embedding matrix and the initial temporal semantic embedding matrix, and a multilayer perceptron is used to map the initial spatial semantic embedding matrix after the dimensionality reduction and the initial temporal semantic embedding matrix after the dimensionality reduction.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to realize the steps of the road network traffic state prediction method in claim 1.

10. A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to realize the steps of the road network traffic state prediction method in claim 1.

Citation Information

Cited By

  • A traffic flow prediction method and device based on large language model semantic enhancement

    CN122153844A