Traffic flow prediction method, device, equipment, medium and product
By using dynamic graph relationship learning and graph convolution operations, the connection weights between lanes are adaptively adjusted, solving the problem of low traffic flow prediction efficiency and achieving efficient traffic flow prediction and real-time decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING ZHILU YUNXING TECHNOLOGY CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies have low efficiency in traffic flow prediction. Traditional time series models have a heavy computational burden and high response latency when processing large-scale, high-dimensional lane-level spatiotemporal data, making it difficult to achieve efficient inference in real-time decision-making scenarios such as signal control.
A dynamic graph relation learning mechanism driven by random embedding is adopted to generate a dynamic adjacency matrix. Graph convolution operations are used for feature propagation and aggregation to generate historical and future lane feature representations. By adaptively adjusting the connection weights between lanes, computational overhead and redundant storage requirements are reduced.
It improves the computational efficiency and real-time response of traffic flow forecasting, enhances forecast accuracy, and supports real-time decision-making for dynamic traffic light timing, intelligent route planning, and urban traffic management.
Smart Images

Figure CN121838474A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent transportation, and more particularly to a traffic flow prediction method, apparatus, equipment, medium, and product. Background Technology
[0002] Traffic flow prediction is a technology that uses historical traffic data and road network topology to predict future traffic conditions. With the acceleration of urbanization and the development of intelligent transportation systems, accurate traffic flow information has become a core support for traffic management and travel services, and is crucial for ensuring smooth road networks and improving urban traffic efficiency.
[0003] In existing technologies, urban road networks are abstracted into a graph structure with lanes or road segments as nodes and road network topology connections as edges. Historical traffic flow data and road network topology information are input, and spatial correlation features between lanes are extracted layer by layer through graph convolutional neural networks. At the same time, the temporal evolution pattern of traffic flow is captured, and the traffic state prediction results for a specific future time period are output.
[0004] However, existing technologies suffer from low traffic flow prediction efficiency. Traditional time-series models are computationally burdensome and have high response latency when processing large-scale, high-dimensional lane-level spatiotemporal data, making it difficult to achieve efficient inference in real-time decision-making scenarios such as signal control, thus limiting overall prediction efficiency. Summary of the Invention
[0005] This application provides a traffic flow prediction method, apparatus, equipment, medium, and product to solve the problem of low efficiency in traffic flow prediction in the prior art.
[0006] In a first aspect, embodiments of this application provide a traffic flow prediction method, including:
[0007] Obtain traffic flow data and lane topology within a preset historical time period; wherein the end time of the historical time period is earlier than the current time, the traffic flow data includes the lane flow, speed and queue length of each of the preset multiple lanes, and the lane topology includes the connection relationship between the multiple lanes;
[0008] Using the lane topology as a static constraint, a dynamic adjacency matrix is obtained through parameter mapping adaptive learning based on a stochastic embedding-driven dynamic graph relation learning mechanism. The dynamic adjacency matrix represents the connection weight between the first lane and the second lane at a historical time, and the connection weight represents the influence strength of the traffic state of the first lane on the traffic state of the second lane. The historical time refers to any moment within the historical time period, the first lane refers to any one of the multiple lanes, and the second lane refers to any one of the multiple lanes other than the first lane.
[0009] Using graph convolution operations, with the dynamic adjacency matrix as the relationship between nodes, feature propagation and aggregation are performed on the traffic flow data to generate historical lane feature representations; wherein, the historical lane feature representations are used to represent the traffic status of the multiple lanes at the historical time.
[0010] Predictive lane feature representations are obtained by performing predictions based on multiple historical lane feature representations; wherein, the predicted lane feature representations are used to represent the traffic state of the multiple lanes at a future time, where the future time refers to any time in a future time period, and the start time of the future time period is later than the current time.
[0011] Secondly, embodiments of this application provide a traffic flow prediction device, comprising:
[0012] The first acquisition module is used to acquire traffic flow data and lane topology within a preset historical time period; wherein the end time of the historical time period is earlier than the current time, the traffic flow data includes the lane flow, speed and queue length of each of the preset multiple lanes, and the lane topology includes the connection relationship between the multiple lanes.
[0013] The learning module is used to perform adaptive parameter mapping learning based on a dynamic graph relation learning mechanism driven by random embedding, using the lane topology as a static constraint, to obtain a dynamic adjacency matrix. The dynamic adjacency matrix represents the connection weight between the first lane and the second lane at a historical time, and the connection weight represents the influence strength of the traffic state of the first lane on the traffic state of the second lane. The historical time refers to any time within the historical time period, the first lane refers to any one of the multiple lanes, and the second lane refers to any one of the multiple lanes other than the first lane.
[0014] An aggregation module is used to perform feature propagation and aggregation on the traffic flow data using graph convolution operations and the dynamic adjacency matrix as the relationship between nodes, to generate a historical lane feature representation; wherein, the historical lane feature representation is used to represent the traffic status of the multiple lanes at the historical time.
[0015] The prediction module is used to make predictions based on multiple historical lane feature representations to obtain predicted lane feature representations; wherein, the predicted lane feature representations are used to represent the traffic state of the multiple lanes at a future time, where the future time refers to any time in a future time period, and the start time of the future time period is later than the current time.
[0016] Thirdly, embodiments of this application provide an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0017] The memory stores computer-executed instructions;
[0018] When the processor executes the computer execution instructions stored in the memory, it is used to implement the traffic flow prediction method as described in any of the first aspects.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the traffic flow prediction method as described in any of the first aspects.
[0020] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, is used to implement the traffic flow prediction method as described in any of the first aspects.
[0021] This application provides a traffic flow prediction method, apparatus, device, medium, and product. By generating an adjacency matrix, the connection weights between lanes can be adaptively adjusted according to traffic conditions. This compresses the original multi-stage iterative spatial relationship modeling process into an efficient single-step generation operation, reducing the computational overhead caused by frequent reconstruction of static topology or iterative updates of connection weights. At the same time, through graph convolution operations, the propagation and aggregation of multi-lane spatiotemporal features are completed in one go within a unified framework. This compresses the traditional multi-stage, high-complexity spatial dependency modeling into an efficient single-step feature extraction, reducing the need for repeated calculations and intermediate state storage. While ensuring prediction accuracy, this improves computational efficiency and real-time response, thereby enhancing traffic flow prediction efficiency. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0023] Figure 1 This is a schematic diagram illustrating an application scenario of the traffic flow prediction method provided in the embodiments of this application;
[0024] Figure 2 A flowchart illustrating the traffic flow prediction method provided in the embodiments of this application. Figure 1 ;
[0025] Figure 3 A flowchart illustrating the traffic flow prediction method provided in the embodiments of this application. Figure 2 ;
[0026] Figure 4 A block diagram of a lane-level traffic flow prediction structure provided in an embodiment of this application;
[0027] Figure 5A flowchart for lane-level traffic flow prediction provided in the embodiments of this application;
[0028] Figure 6 This is a schematic diagram of the traffic flow prediction device provided in the embodiments of this application;
[0029] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application.
[0030] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0032] In the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply difference. It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner. In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more.
[0033] It should be noted that the phrase "at...time" in the embodiments of this application can refer to the instant at which a certain situation occurs, or to a period of time after the occurrence of a certain situation. The embodiments of this application do not specifically limit this. In addition, the traffic flow prediction method, device, equipment, medium and product provided in the embodiments of this application are only examples. A traffic flow prediction method, device, equipment, medium and product may also include more or fewer elements.
[0034] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0035] Lane-level node: refers to a single entrance lane as the smallest modeling unit in the traffic network. Each node represents an entrance / exit direction or turning (straight / left / right turn) lane.
[0036] Dynamic graph relation learning refers to the mechanism of automatically generating adjacency matrices at different time steps through learnable embeddings to characterize the spatial dependence changes of traffic flow in the time dimension.
[0037] Spatiotemporal feature embedding refers to encoding time periods (such as hours, days of the week) and spatial topology (such as lane connections) into a unified high-dimensional vector representation, providing spatiotemporal semantic priors for the model.
[0038] Laplacian eigenvectors: Eigenvectors obtained by decomposing the graph Laplacian matrix, reflecting the spatial positional relationships of nodes in the graph structure, and used to construct stable spatial embedding basis.
[0039] Dual-scale feature decomposition refers to a technical method that decomposes traffic flow features into long-term trend components and short-term fluctuation components through convolutional structures with different receptive fields.
[0040] Bottleneck Transformer: This refers to introducing a bottleneck attention mechanism into the Transformer framework, which achieves global dependency modeling by compressing and expanding the time dimension, while reducing computational complexity.
[0041] Future temporal embedding and spatial embedding: refers to the use of time vectors generated by future time labels and stable spatial vectors generated based on Laplacian feature vectors, which are used in the prediction stage to guide the model towards future spatiotemporal features.
[0042] Trend component and fluctuation component: The trend component represents the long-term trend of traffic flow; the fluctuation component represents short-term fluctuations and periodic disturbances. Together, they determine the temporal pattern of traffic flow.
[0043] Prediction step size: refers to the length of time the model predicts forward, that is, the number of time steps for continuous future predictions.
[0044] Signal timing decision: refers to the control process of dynamically adjusting the phase duration of traffic lights and the green light ratio based on lane flow prediction results, so as to achieve adaptive scheduling at intersections.
[0045] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0046] The following describes the application scenarios of the traffic flow prediction method provided in the embodiments of the present invention. Figure 1 This is a schematic diagram illustrating an application scenario of the traffic flow prediction method provided in the embodiments of this application. For example... Figure 1 As shown, this application scenario includes a mobile terminal 101 and a server 102. The mobile terminal 101 collects traffic flow data and lane topology, and sends the traffic flow data and lane topology to the server 102. The server 102 uses the lane topology as a static constraint and performs parameter mapping adaptive learning based on a dynamic graph relationship learning mechanism driven by random embedding to obtain a dynamic adjacency matrix. The server 102 uses graph convolution operations to perform feature propagation and aggregation on the traffic flow data, using the dynamic adjacency matrix as the relationship between nodes, to generate historical lane feature representations. The server 102 makes predictions based on multiple historical lane feature representations to obtain predicted lane feature representations.
[0047] The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0048] Figure 2 A flowchart illustrating the traffic flow prediction method provided in the embodiments of this application. Figure 1 .like Figure 2 As shown, in this embodiment, the execution entity of this invention is a server. The traffic flow prediction method provided in this embodiment includes:
[0049] S201. Obtain traffic flow data and lane topology within a preset historical time period; wherein, the end time of the historical time period is earlier than the current time, the traffic flow data includes the lane flow, speed and queue length of each lane in the preset multiple lanes, and the lane topology includes the connection relationship between multiple lanes.
[0050] Specifically, traffic flow data, such as lane flow, speed, and queue length, can be collected from multiple lanes within a preset historical time period using traffic sensing devices deployed on urban roads, including loop detectors, video surveillance equipment, and floating car GPS data acquisition terminals. Simultaneously, the connection relationships between these lanes are retrieved from the urban traffic geographic information system and road network topology database to form a lane topology structure. This step clarifies the historical traffic state information of multiple lanes and the topological relationships between them, providing a data prerequisite for subsequent graph convolution operations, lane feature representation generation, and future traffic state prediction, ensuring that subsequent steps are based on real traffic scenario data.
[0051] S202. Using the lane topology as a static constraint, a dynamic graph relation learning mechanism driven by random embedding is used to perform adaptive parameter mapping learning to obtain a dynamic adjacency matrix. The dynamic adjacency matrix is used to represent the connection weight between the first lane and the second lane at a historical time. The connection weight is used to represent the influence strength of the traffic state of the first lane on the traffic state of the second lane. The historical time refers to any time in the historical time period. The first lane refers to any one of the multiple lanes. The second lane refers to any one of the multiple lanes except the first lane.
[0052] Specifically, multiple lanes can be randomly embedded first to obtain initial embedding vectors for each lane. Then, using the lane topology-defined inter-lane connectivity as a static constraint, a dynamic graph relationship learning mechanism driven by random embedding is used. Through a learnable parameter mapping network, the initial embedding vectors of each lane are adaptively transformed and interactively learned, making the parameter mapping process fit the traffic flow data characteristics at different historical times. This generates a dynamic adjacency matrix that changes dynamically with historical times. This step is used to enable the connection weights between lanes to be adaptively adjusted according to traffic conditions, accurately representing the influence of the traffic state of the first lane on the traffic state of the second lane at different historical times. This provides a basis for the feature propagation and aggregation of traffic flow data in subsequent graph convolution operations, based on the inter-node relationships that conform to the real-time traffic association rules.
[0053] S203. Using graph convolution operations, with the dynamic adjacency matrix as the relationship between nodes, feature propagation and aggregation are performed on traffic flow data to generate historical lane feature representations; where the historical lane feature representations are used to represent the traffic status of multiple lanes at historical moments.
[0054] Specifically, traffic flow data can first be converted into an initial feature matrix with lanes as nodes. For each historical time point, the corresponding dynamic adjacency matrix and the initial feature matrix are input into a graph convolutional layer. Through the message passing mechanism of graph convolution operations, each lane node receives feature information from other lane nodes based on the connection weights in the dynamic adjacency matrix to complete feature propagation. Then, weighted summation and nonlinear transformation operations are performed on the propagated feature information to achieve feature aggregation. After completing the graph convolution calculation of a single level, the output feature is used as the input of the next level to repeat the above propagation and aggregation operations until all graph convolutional levels are calculated. The lane features processed by graph convolution operations at each historical time point are integrated to generate historical lane feature representations. This step is used to extract and fuse features from traffic flow data based on the inter-lane connection weights that are dynamically adjusted according to traffic conditions, forming a feature set that can characterize the traffic conditions of multiple lanes at each historical time point, providing a feature foundation for subsequent prediction based on multiple historical lane feature representations.
[0055] S204. Based on multiple historical lane feature representations, a prediction lane feature representation is obtained; wherein, the prediction lane feature representation is used to represent the traffic state of multiple lanes at a future time, where a future time refers to any time in a future time period, and the start time of the future time period is later than the current time.
[0056] Specifically, the temporal feature sequence can be input into a preset temporal prediction network. The network's internal gating units or attention mechanisms capture and model the temporal dimension correlation information in the temporal feature sequence. Differentiated feature weights are assigned to the lane feature representations corresponding to different historical moments. Then, the modeled temporal features are dimensionally mapped and feature transformed through the network's fully connected layers and nonlinear transformation operations. The output is the feature result corresponding to the future moment, i.e., the predicted lane feature representation. This step is used to capture the temporal evolution pattern of traffic flow based on the lane traffic state features at historical moments, generate feature representations that can characterize the traffic state of multiple lanes at future moments, and provide the core feature output of the lane traffic state in the future time period.
[0057] The predicted lane feature representation is based on historical lane feature representations from multiple moments within a preset historical time period. It is obtained through graph convolution operations to propagate and aggregate spatiotemporal features, combined with the temporal evolution of traffic flow, and is a comprehensive representation of the traffic state of multiple lanes at a preset future time. Its core includes key traffic parameters such as lane flow, speed, and queue length, providing a quantitative representation of the future lane-level traffic operation status. It is used to accurately depict the specific traffic operation status of each lane at a future time and the traffic flow correlation characteristics between multiple lanes, intuitively reflecting the congestion level, traffic efficiency, and flow distribution of each lane in the future road network. The core specific uses and problems addressed by this feature representation include:
[0058] In the field of traffic signal control, predicted lane feature representation can serve as the basis for dynamic timing of traffic lights, supporting the adjustment of red and green light phase durations and green light ratios. This solves the problems of uneven congestion, low traffic efficiency, and long vehicle waiting times caused by the inability of traditional fixed timing to adapt to dynamic changes in traffic flow, and enables adaptive control of intersections.
[0059] In the field of intelligent route planning and navigation, predictive lane feature representation can provide navigation software and intelligent vehicle systems with future lane-level traffic data, assisting in planning the optimal route and avoiding predicted congested sections, thus solving the problems of traditional route planning lacking foresight, route failure, and uncontrollable travel time.
[0060] In the field of urban traffic management, predictive lane characteristics can support emergency response and congestion management decisions, enabling advance deployment of traffic diversion resources and the development of temporary control plans, thereby addressing issues such as passive response, untimely traffic diversion, and delayed emergency response in traffic management.
[0061] This embodiment provides a traffic flow prediction method that generates an adjacency matrix, enabling the connection weights between lanes to adaptively adjust according to traffic conditions. This compresses the original multi-stage iterative spatial relationship modeling process into an efficient single-step generation operation, reducing the computational overhead caused by frequent reconstruction of static topology or iterative updates of connection weights. At the same time, through graph convolution operations, the propagation and aggregation of multi-lane spatiotemporal features are completed in one go within a unified framework. This compresses the traditional multi-stage, highly complex spatial dependency modeling into an efficient single-step feature extraction, reducing the need for repeated calculations and intermediate state storage. While ensuring prediction accuracy, this method improves computational efficiency and real-time response, thereby enhancing traffic flow prediction efficiency.
[0062] In one possible design, S202 uses a dynamic graph relation learning mechanism driven by random embedding to perform adaptive parameter mapping learning, resulting in a dynamic adjacency matrix, including:
[0063] S2021. Obtain the time embedding matrix, the starting node embedding matrix, the ending node embedding matrix, and the tensor; wherein, the starting node embedding matrix is used to represent the attributes of the first lane when the first lane is the starting point of multiple lanes, and the ending node embedding matrix is used to represent the attributes of the first lane when the first lane is the ending point of multiple lanes.
[0064] Specifically, the dimensions of the time embedding matrix can be determined based on the number of historical moments, and the dimensions of the start-point and end-point embedding matrices can be determined based on the number of lanes. The preset dimensions of the tensor can be determined based on the fusion operation dimension requirements of these three types of matrices. Then, learnable parameters are initialized for the time embedding matrix based on historical moments, the start-point embedding matrix based on the first lane as the start point, and the end-point embedding matrix based on the first lane as the end point, respectively. Learnable parameters are also initialized for the tensor based on the preset dimensions. Finally, the initialized time embedding matrix, start-point embedding matrix, end-point embedding matrix, and tensor are all incorporated into a random embedding matrix. The parameter optimization range of the dynamic graph relation learning mechanism driven by the model is to iteratively adjust and update the parameter values of various matrices and tensors through the backpropagation algorithm during model training until the model's loss function reaches a convergent state. This yields a time embedding matrix, a start node embedding matrix, an end node embedding matrix, and tensors that are adapted to the lane topology and traffic flow data features. This step provides a multi-dimensional learnable parameter foundation for subsequent matrix and tensor fusion operations, representing the time attributes of historical moments, the node attributes when lanes are the start and end points, and the core parameters required for fusion operations, providing multi-dimensional parameter inputs for the generation of the initial adjacency weight matrix.
[0065] S2022. The time embedding matrix, the starting node embedding matrix, the ending node embedding matrix and the tensor are fused to obtain the initial adjacency weight matrix.
[0066] Specifically, the time embedding matrix, the starting node embedding matrix, and the ending node embedding matrix can be first transformed to match the dimensions of each matrix with the requirements of tensor fusion operations. Then, tensor product operations are performed sequentially on the tensors and the transformed starting node embedding matrix and ending node embedding matrix to generate an intermediate feature tensor that fuses node attributes. Subsequently, the time embedding matrix and the intermediate feature tensor are multiplied element-wise to achieve the fusion of time attributes and node association features. Finally, the fused feature tensor is flattened and reconstructed to generate an initial adjacency weight matrix whose dimensions match the number of historical time points and the number of lanes. This step is used to integrate the time attributes of historical time points, the node attributes of lanes as starting and ending points, and the core parameters of fusion operations, transforming multi-dimensional learnable embedding features and tensor parameters into a matrix that can represent the initial association weights between lanes under different historical time points. This provides a direct computational basis for subsequent nonlinear constraints and normalization processing of the initial adjacency weight matrix.
[0067] S2023. Apply a nonlinear constraint to the initial adjacency weight matrix using a preset activation function to obtain the constrained adjacency matrix; wherein, the activation function is used to suppress negative correlation noise in the initial adjacency weight matrix.
[0068] Specifically, a preset activation function for nonlinear constraints can be determined first. Each matrix in the initial adjacency weight matrix is treated as an independent computational unit. All elements in each matrix are input into the activation function for element-wise operation. The nonlinear mapping characteristics of the activation function filter out negatively correlated values in the elements. At the same time, a nonlinear transformation is performed on the positively correlated weight values to make the value range of all matrix elements match the representation requirements of the lane connection weights. After the activation operation of all matrix elements is completed, the matrices are integrated in the order of historical time to obtain the constrained adjacency matrix. This step is used to suppress negatively correlated noise in the initial adjacency weight matrix, perform nonlinear transformation and numerical range constraints on the initial association weights, optimize the numerical characteristics of the initial lane connection weights, improve the rationality of the representation of the actual traffic association between lanes by the connection weights, and provide an adjacency matrix that meets the computational requirements for subsequent normalization processing.
[0069] S2024. Normalize the constrained adjacency matrix to obtain the dynamic adjacency matrix.
[0070] Specifically, normalization can be performed on each adjacency matrix in the constrained adjacency matrix. First, the sum of all elements in the row corresponding to each lane node in a single adjacency matrix is calculated. A minimum bias term is introduced and added to the sum of each row and column to avoid the problem of zero denominator. Then, each element in the adjacency matrix is divided by the sum of the elements in its corresponding row and the sum of the bias term to complete the normalization of the single matrix. All normalized adjacency matrices are integrated in the order of historical time to obtain the dynamic adjacency matrix. This step is used to unify the numerical scale of the connection weights of each lane node in the constrained adjacency matrix, eliminate the interference of numerical differences between different rows on subsequent feature propagation, and ensure that the feature aggregation process of each lane node has a consistent weight calculation benchmark, generating a dynamic adjacency matrix that meets the numerical requirements of the adaptation graph convolution operation.
[0071] The technical effect of this scheme in this embodiment is as follows: by introducing learnable time, start point, and end point node embedding matrices and tensors, and designing a processing flow of activation and normalization after the fusion of the four, dynamic and adaptive generation of lane connection relationships is realized. This enables the adjacency matrix to accurately characterize the directional influence intensity between lane nodes at different times, enhances the interpretability of spatial relationship modeling and the physical consistency of traffic state evolution, and provides an accurate and stable topological structure foundation for subsequent graph convolution operations.
[0072] In one possible design, S203 utilizes graph convolution operations, with a dynamic adjacency matrix representing the relationships between nodes, to perform feature propagation and aggregation on traffic flow data, generating historical lane feature representations, including:
[0073] S2031. Using traffic flow data as node features, and performing graph convolution operations with the dynamic adjacency matrix as the relationship between nodes, dynamic spatiotemporal features are obtained.
[0074] Specifically, traffic flow data can first be reconstructed according to lane and historical time dimensions to form a sequence of node feature matrices with lanes as nodes, lane flow, speed, and queue length as feature dimensions, and historical time as sequence dimension. For each historical time, the node feature matrix corresponding to that time and the dynamic adjacency matrix at the same moment in the dynamic adjacency matrix are input into a graph convolutional layer. Through the message passing mechanism of graph convolution operation, each lane node aggregates feature information from other lane nodes according to the connection weights in the dynamic adjacency matrix. Then, the aggregated feature information and the node's own features are linearly transformed and processed by a nonlinear activation function to obtain the output feature of the layer. The above graph convolution operation process is repeated to complete multi-level feature extraction. Finally, the features output from all levels are integrated in the order of historical time to obtain dynamic spatiotemporal features. This step is used to initially extract and fuse the spatial correlation features and temporal dimension features of traffic flow data based on the inter-lane connectivity that dynamically adjusts with traffic conditions, generating basic features that can characterize the spatiotemporal correlation of lane traffic conditions at different historical times, providing feature input for subsequent fusion of spatiotemporal embedded features.
[0075] S2032. Generate a temporal embedding based on the time label of the traffic flow data, and generate a spatial embedding based on the lane topology. Fuse the temporal embedding and the spatial embedding to obtain the spatiotemporal embedding feature.
[0076] Specifically, the time labels of traffic flow data can be numerically encoded first, and a learnable temporal embedding layer matching the encoding dimension can be initialized. The encoded time labels are input into this embedding layer, and the temporal embedding representing the time attribute of historical moments is obtained through parameter mapping. Then, spatial attributes such as the degree of nodality and connection direction of lanes in the lane topology are extracted and encoded. A learnable spatial embedding layer matching the encoding dimension is initialized, and the encoded spatial attributes are input into this embedding layer. The spatial embedding representing the spatial association attribute of lanes is obtained through parameter mapping. Subsequently, the temporal embedding and spatial embedding are subjected to dimension adaptation transformation to make the feature dimensions of the two consistent. Element-wise addition is performed to complete the initial fusion. Then, the features after the initial fusion are subjected to dimension mapping and feature optimization through a linear transformation layer to obtain spatiotemporal embedding features. This step is used to extract and fuse the temporal prior features of traffic flow data and the spatial prior features of lane topology to generate a feature representation that has both temporal attributes and lane spatial association attributes, providing supplementary feature input for subsequent fusion of dynamic spatiotemporal features and spatiotemporal embedding features.
[0077] S2033. The dynamic spatiotemporal features are fused with the spatiotemporal embedding features to obtain the comprehensive feature representation of lane flow.
[0078] Specifically, linear transformations can be performed on the dynamic spatiotemporal features and spatiotemporal embedded features respectively to adjust their feature dimensions to a perfect match. Then, the dimension-matched dynamic spatiotemporal features and spatiotemporal embedded features are multiplied element-wise to achieve information interaction between features. The result is then input into a preset attention layer, where a differentiated weight coefficient is assigned to different feature dimensions through an attention mechanism to strengthen the representation of key feature information. The weighted features are then transformed by a nonlinear activation function. Finally, the transformed features are integrated and compressed to obtain a comprehensive feature representation of lane flow. This step is used to integrate the dynamic spatiotemporal correlation features extracted from traffic flow data with the prior features of traffic flow time and lane space, deeply fusing the information of the two types of features to generate a comprehensive representation that combines dynamic spatiotemporal features and prior features, providing a complete feature foundation for the subsequent extraction of trend components and fluctuation components.
[0079] S2034. The trend component is obtained by extracting the comprehensive feature representation of lane flow through the preset first receptive field convolution.
[0080] Specifically, the kernel size, stride, and padding parameters of the first receptive field convolution can be determined first to ensure that the receptive field range of the convolution kernel matches the feature extraction requirements of traffic conditions over a large time scale. Then, the comprehensive lane flow feature representation is reconstructed into a three-dimensional input feature format adapted to the first receptive field convolution operation according to the time and feature dimensions. The reconstructed features are then input into the first receptive field convolution layer. By sliding the convolution kernel over a large range in the time dimension, a weighted summation operation is performed on the continuous multi-time features in the comprehensive lane flow feature representation to extract information with long-term change patterns. After transforming the convolution output result through a nonlinear activation function, the transformed features are then simplified in dimension and aggregated through global average pooling to obtain trend components. This step is used to extract feature components that represent the large-scale change patterns of traffic conditions from the comprehensive lane flow feature representation and capture the long-term development trend of traffic flow.
[0081] S2035. Component extraction is performed on the comprehensive feature representation of lane flow using a pre-defined second receptive field convolution to obtain the fluctuation component. The receptive field range of the first receptive field convolution is larger than that of the second receptive field convolution, and the time scale of the traffic state represented by the trend component is larger than that represented by the fluctuation component.
[0082] Specifically, the kernel size, stride, and padding parameters of the second receptive field convolution can be determined first to match the receptive field range of the convolution kernel with the feature extraction requirements of traffic state at small time scales. Then, the comprehensive feature representation of lane flow is reconstructed into a three-dimensional input feature format adapted to the second receptive field convolution operation according to the time dimension and feature dimension. The reconstructed features are input into the second receptive field convolution layer. By sliding the convolution kernel within a small range in the time dimension, a weighted summation operation is performed on the adjacent few-time-time features in the comprehensive feature representation of lane flow to extract information with short-term change patterns in the features. After transforming the convolution output result through a nonlinear activation function, the transformed features are then simplified in dimension and aggregated through local average pooling to obtain the fluctuation component. This step is used to extract the feature component representing the small-time-scale change pattern of traffic state from the comprehensive feature representation of lane flow and capture the short-term fluctuation changes of traffic flow.
[0083] S2036. Encode and fuse the trend component and fluctuation component to obtain the historical lane feature representation.
[0084] Specifically, the trend component and fluctuation component can be adapted to match the input requirements of two independent pre-defined gated recurrent unit (GRU) networks. The trend component is input into the first GRU network and the fluctuation component into the second GRU network. The gating mechanism of the GRU network captures the long-term evolution features in the trend component and the short-term dynamic features in the fluctuation component, respectively, and the two types of encoded features are obtained. Then, the two types of encoded features are concatenated according to the feature dimensions, and the dimensions are unified and information is exchanged through a pre-defined linear transformation layer. Then, the key feature representation is strengthened through a non-linear activation function, and finally the historical lane feature representation is obtained. This step is used to integrate the trend features that represent the long-term evolution of traffic flow and the fluctuation features that represent the short-term dynamic changes, forming a comprehensive feature that can fully and accurately reflect the traffic status of multiple lanes at various historical moments. This provides a complete feature foundation that fits the actual traffic evolution law for subsequent prediction of future traffic conditions based on multiple historical lane feature representations.
[0085] The first GRU network is used to encode the trend components extracted from the comprehensive feature representation of lane flow in terms of time features, capturing the long-term and stable evolution of traffic flow. The second GRU network is used to encode the fluctuation components extracted from the comprehensive feature representation of lane flow in terms of time features, capturing the short-term and non-stationary dynamic disturbances of traffic flow. The difference between the two lies in the different input feature components they process and the different feature characterization scales they correspond to. The first GRU network focuses on the trend features at a large time scale, while the second GRU network focuses on the fluctuation features at a small time scale. Moreover, their network parameters are optimized independently to adapt to the temporal evolution characteristics of different feature components.
[0086] The technical effect of this scheme in this embodiment is as follows: By using traffic flow data as node features and performing graph convolution with a dynamic adjacency matrix as the relationship between nodes, dynamic spatiotemporal features that capture the time-varying spatial dependence between lanes are generated. At the same time, temporal embeddings are generated based on traffic flow time labels, and spatial embeddings are generated based on lane topology and fused into spatiotemporal embedding features. This integrates periodic temporal semantics and static topological priors. After the two types of features are fused, a unified comprehensive feature representation of lane flow is formed, avoiding redundant modeling and feature loss caused by the separation of dynamic propagation information and static spatiotemporal priors. Then, the comprehensive features are extracted by convolution with different receptive fields to extract dual-scale components, explicitly separating the trend component and fluctuation component that represent traffic states at different time scales. This solves the problem of trend and noise aliasing in single-scale modeling and improves the ability to characterize the multi-scale evolution of traffic flow. Finally, the two types of components are fused to obtain historical lane feature representations, reducing repeated iterative calculations on long sequence data. While ensuring accurate representation of complex traffic scenarios, the accuracy and real-time response capability of lane-level traffic flow prediction are optimized, providing reliable feature support for real-time decision-making such as signal timing.
[0087] In one possible design, S204, prediction is performed based on multiple historical lane feature representations to obtain a predicted lane feature representation, including:
[0088] S2041. Obtain the time tag of the future moment, and generate the future time embedding based on the time tag of the future moment.
[0089] Specifically, the system can read the specific time, date, day of the week, and time period attributes of future moments from preset traffic flow prediction task parameters, integrating them to form time labels for future moments. Alternatively, it can calculate the time information of future moments based on the current moment and the preset prediction duration, extract the corresponding time dimension features as time labels, and input the generated time labels into a preset time embedding layer. A learnable embedding matrix transforms the discrete time labels into low-dimensional dense vectors. Simultaneously, time periodic encoding can be introduced, using sine and cosine encoding for periodic time features such as hours and days of the week, and fusing this with the learnable embedding vectors to generate future time embeddings that represent the time attributes of future moments. This step transforms the time information of future moments into vector representations that can participate in model calculations, providing clear time dimension guidance for the subsequent decoding process. It integrates the time attributes of future moments into the feature decoding process, ensuring that the decoded spatiotemporal feature representation accurately reflects the time characteristics of future moments.
[0090] S2042. Generate a stable spatial embedding based on the lane topology.
[0091] Specifically, static attribute features can be extracted from the lane topology, including topological association indices such as in-degree, out-degree, betweenness centrality, and proximity centrality for each lane, as well as inherent attributes such as lane physical attributes, functional levels, and connection types. These attributes are then structured and encoded into standardized feature vectors, which are input into a pre-defined spatial embedding layer. A learnable linear transformation maps the high-dimensional topological attributes to low-dimensional dense vectors. Alternatively, graph embedding algorithms such as Node2Vec can be used to perform random walk sampling on the lane topology graph, learning the low-dimensional embedding representations of lane nodes and capturing global topological association patterns between lanes. The generated stable spatial embeddings maintain a fixed dimension and do not dynamically change over time, ensuring the stability and consistency of spatial features. This step transforms the static spatial association attributes of the lane topology into low-dimensional vector representations that can participate in model computation, providing a fixed spatial dimension for the subsequent decoding process. It captures the fundamental topological association patterns between lanes that do not change over time, ensuring that the decoded spatiotemporal feature representation fits the spatial structure of the road network and provides spatial dimension feature support for generating predictive lane feature representations that conform to the road network topological constraints.
[0092] S2043. Based on future time embedding and stable spatial embedding, the historical lane feature representation is decoded to obtain the decoded spatiotemporal feature representation; wherein, future time embedding is used to provide temporal dimension guidance for decoding, and stable spatial embedding is used to provide spatial dimension guidance for decoding.
[0093] Specifically, the future time embedding, stable spatial embedding, and historical lane feature representation can be dimensionally aligned to ensure that their feature dimensions match the number of channels. The future time embedding and stable spatial embedding are then multiplied element-wise to generate a spatiotemporal guidance vector. This vector carries both the temporal attributes of the future moment and the static spatial topology attributes of the road network. The spatiotemporal guidance vector and the historical lane feature representation are then concatenated along the channel dimension to obtain the decoding input features. These features are then input into a pre-defined decoder module, which can employ a gated recurrent unit with spatiotemporal attention, a Transformer decoder, or a multilayer perceptron structure. Through the nonlinear transformation of the decoder, and utilizing the constraints of the spatiotemporal guidance vector, feature information matching the future temporal characteristics and road network spatial structure is extracted from the historical lane feature representation. During the decoding process, a learnable parameter matrix can be introduced to dynamically adjust the weight ratio of time guidance and spatial guidance, adapting to the feature decoding requirements of different traffic scenarios. Finally, the decoded spatiotemporal feature representation, which integrates future time attributes and stable spatial attributes, is output. This step is used to represent the historical lane features within a historical time period, and combine them with the temporal attributes of future moments and the static spatial attributes of the road network to reconstruct the features. This provides a spatiotemporal feature basis that fits the future moment scenario for subsequent regression processing, ensuring that the decoded features not only contain the evolutionary patterns of historical traffic flow, but also conform to the temporal characteristics and road network topology constraints of future moments.
[0094] S2044. Perform regression processing on the decoded spatiotemporal feature representation to obtain the predicted lane feature representation.
[0095] Specifically, the decoded spatiotemporal feature representation can be input into a pre-defined regression module. This module consists of multiple stacked fully connected layers, each configured with a learnable weight matrix and bias term. Through linear transformation, the high-dimensional spatiotemporal features are mapped to a low-dimensional space matching the traffic state parameters. Non-linear activation functions, such as ReLU and GELU, are introduced between the fully connected layers to enhance the model's ability to fit complex features. Dropout layers or layer normalization operations can also be added to improve the model's generalization performance. The final fully connected layer outputs a vector whose dimension matches the number of lanes and the dimensions of the traffic state parameters. Through linear transformation, this vector directly generates the traffic state prediction value for the corresponding future time. During the regression process, loss functions such as smoothed L1 loss and mean squared error loss can be used to constrain the deviation between the predicted and true values, optimizing the accuracy of the regression results. Finally, the output is a predicted lane feature representation containing traffic state information for all lanes at future time. This step transforms the decoded high-dimensional spatiotemporal feature representation into quantifiable specific traffic state parameters, generating traffic state representations for multiple lanes at future time, and directly outputting traffic flow prediction results for a specific future time period.
[0096] The technical effect of this scheme in this embodiment is that by introducing time-series guidance information based on future moments and structural constraint information based on road network topology in the decoding and prediction stage, the model can simultaneously integrate historical state features, target time patterns and spatial connectivity when generating future traffic flow representations, thereby enhancing the periodic consistency of prediction results in the time dimension and the topological rationality in the spatial dimension, and improving the accuracy of lane-level traffic state prediction.
[0097] Figure 3 A flowchart illustrating the traffic flow prediction method provided in the embodiments of this application. Figure 2 In this embodiment, in Figure 2 Based on the provided embodiments, the traffic flow prediction method is further explained. The traffic flow prediction method includes:
[0098] S301. Obtain traffic flow data and lane topology within a preset historical time period; wherein, the end time of the historical time period is earlier than the current time, the traffic flow data includes the lane flow, speed and queue length of each lane in the preset multiple lanes, and the lane topology includes the connection relationship between multiple lanes.
[0099] S302. Using the lane topology as a static constraint, a dynamic graph relation learning mechanism driven by random embedding is used to perform parameter mapping adaptive learning to obtain a dynamic adjacency matrix. The dynamic adjacency matrix is used to represent the connection weight between the first lane and the second lane at a historical time. The connection weight is used to represent the influence strength of the traffic state of the first lane on the traffic state of the second lane. The historical time refers to any time in the historical time period. The first lane refers to any one of the multiple lanes. The second lane refers to any one of the multiple lanes except the first lane.
[0100] S303. Using graph convolution operations, with the dynamic adjacency matrix as the relationship between nodes, feature propagation and aggregation are performed on traffic flow data to generate historical lane feature representations; whereby the historical lane feature representations are used to represent the traffic status of multiple lanes at historical moments.
[0101] S304. Based on multiple historical lane feature representations, a prediction lane feature representation is obtained; wherein, the prediction lane feature representation is used to represent the traffic state of multiple lanes at a future time, where a future time refers to any time in a future time period, and the start time of the future time period is later than the current time.
[0102] S301-S304 are similar to S201-S204, and will not be described again in this embodiment.
[0103] S305. In response to the arrival of a future time from the current time, obtain the real lane feature representation; wherein, the real lane feature representation is used to represent the real traffic state of multiple lanes at the future time.
[0104] Specifically, a time-based monitoring module can be set up in the system to compare the current time with a preset future time in real time. When a perfect match is detected, traffic sensing devices deployed on urban roads, such as loop detectors, video surveillance equipment, and floating car GPS data acquisition terminals, are triggered to collect real traffic flow data for multiple lanes at the future time, including lane flow, speed, and queue length. The collected real traffic flow data is preprocessed, including outlier removal, missing value imputation, and data standardization, to ensure data validity and consistency. Using the same feature mapping rules as those used to generate historical lane feature representations, the preprocessed real traffic flow data is transformed into a feature vector of a unified dimension, forming a real lane feature representation. This step is used to obtain the real traffic state representation of multiple lanes at the future time, providing a standard reference for subsequent calculation of the difference between the predicted lane feature representation and the real traffic state, and providing a real traffic state basis for updating the dynamic adjacency matrix.
[0105] S306. Calculate the difference between the predicted lane feature representation and the true lane feature representation, and optimize the parameters of the random embedding-driven dynamic graph relation learning mechanism based on the difference.
[0106] Specifically, the predicted lane feature representation and the real lane feature representation can be dimensionally verified first to ensure that the lane dimension and feature dimension of the two are completely matched. Then, element-wise subtraction is performed on the predicted lane feature representation and the real lane feature representation according to the lane dimension and feature dimension to obtain the element-wise difference matrix. Subsequently, the element-wise difference matrix is numerically aggregated using a preset loss function to calculate the loss value representing the overall deviation. This loss value is then passed to the learnable parameters of each layer of the stochastic embedding-driven dynamic graph relation learning mechanism through the backpropagation algorithm. The gradient values of each parameter are solved according to the gradient calculation rules. A preset optimizer is used to iteratively adjust the parameters of the time embedding matrix, the starting node embedding matrix, the ending node embedding matrix, the tensor, and the parameter mapping network in the mechanism according to the gradient values until the loss value tends to stabilize. This step is used to quantify the degree of deviation between the predicted lane feature representation and the real lane feature representation. Through backpropagation and parameter iterative adjustment, the parameter values of the stochastic embedding-driven dynamic graph relation learning mechanism are corrected, so that the dynamic adjacency matrix generated by the mechanism is more in line with the actual traffic association rules between lanes, and the accuracy of the dynamic adjacency matrix in representing the connection weights between lanes is improved.
[0107] The technical effect of this scheme in this embodiment is as follows: by constructing a closed loop of prediction-verification-parameter optimization, the temporal adaptability and prediction reliability of the model are improved. After obtaining the predicted lane feature representation at future time, the difference between the actual lane feature representation at future time and the prediction result is used as a feedback signal to accurately optimize the parameters of the dynamic graph relation learning mechanism driven by random embedding. This enables the dynamic adjacency matrix generated by the mechanism to continuously conform to the time-varying correlation pattern of real traffic flow and continuously correct the deviation of spatial dependency modeling. This targeted iterative parameter optimization avoids redundant calculations in full model reconstruction. While ensuring optimization efficiency, it strengthens the model's generalization ability to different traffic scenarios, making subsequent prediction results closer to the actual traffic conditions and providing accurate data support for real-time decisions such as signal timing.
[0108] The traffic flow prediction method proposed in this application accurately depicts the spatiotemporal evolution of traffic flow at the lane level, providing data support for intersection signal control. This method takes multi-source traffic detection data and lane-level topology as input, and sequentially completes the modeling of traffic flow and the prediction output for future times through spatiotemporal feature embedding, dynamic relationship learning, dual-scale feature deconstruction of lane flow, and bottleneck-based Transformer prediction. The overall approach is as follows: a stable spatiotemporal representation framework is established through temporal embedding and spatial topology priors; a dynamic graph structure learning mechanism is driven by random learnable embedding to obtain the dynamic coupling relationship between lanes at different time steps; then, multi-scale convolution decomposes the long-term trend and short-term fluctuations of traffic flow, thereby achieving the identification and reconstruction of traffic patterns at different time levels; finally, decoding and prediction are completed by a bottleneck-based Transformer module combining future time and spatial embedding, achieving high-precision inference across spatiotemporal dimensions while reducing computational complexity.
[0109] The known quantities in this application include: traffic detection data, lane-level topology information, temporal semantic labels, signal control parameters, graph Laplacian operators, and spatial embedding basis. These known quantities are provided by external sensors, traffic control centers, or prior graph structures during system operation and do not participate in learning model training parameters; they serve only as model inputs and physical constraints. Specific details are as follows:
[0110] (1) Traffic detection data:
[0111] The smallest modeling unit is each entrance / exit lane at an intersection and within the road network. Known traffic detection data comes from terminals such as lane loop detectors, video detection equipment, or millimeter-wave radar, and is uploaded in real-time via communication networks.
[0112] At time step With lane node Below, traffic state vector It can be represented as:
[0113]
[0114] in, Traffic flow (vehicles / cycle) within a unit sampling period. The average vehicle speed (m / s) The average queue length is (m). Here, t represents lane occupancy (%), t represents time steps, T represents the total number of time steps, n represents a single lane node, and N represents the total number of lane nodes. Let be the feature space of traffic state vectors.
[0115] All lanes stacked in the time dimension form a spacetime tensor as follows:
[0116]
[0117] in, The time window length, The total number of lane nodes. Let R be the input feature dimension, R be the real number field, and X be the spatiotemporal tensor of traffic data for all lanes over the entire time window. This is the set of traffic state vectors for all time steps and all lane nodes. This tensor serves as the fundamental input to the model in this application and is used for subsequent dynamic graph relationship learning and spatiotemporal feature embedding modules.
[0118] (2) Lane-level topology information: At the road network level, the spatial accessibility between lanes is determined by the urban road geometry. The Euclidean or path distance matrix between lanes is known: , of which elements This represents the distance from lane i to lane j.
[0119] An initial adjacency matrix is constructed based on this distance matrix. The Gaussian kernel function with a threshold is defined as follows:
[0120]
[0121] in, For kernel bandwidth parameters, To truncate the threshold, This represents the initial association weights between lane i and lane j. If there are disallowed turns or phase conflicts (such as prohibited left turns or restricted U-turns), the corresponding weights are set to zero. Further calculation of the degree matrix follows:
[0122]
[0123] And construct the graph Laplacian matrix: This is for use in subsequent spatial embedding calculations and graph convolution operations.
[0124] (3) Temporal semantic tags and periodic features:
[0125] Urban traffic exhibits distinct diurnal and periodic characteristics. To characterize this pattern, this application introduces a set of time labels:
[0126]
[0127] in, This represents a time period (hour or minute index) within a day. This represents the date of the week (Monday to Sunday).
[0128] Time tags are periodically encoded using sine and cosine functions to generate a time embedding matrix:
[0129]
[0130] in, Let T be the time embedding matrix, where T is the time window length, N is the total number of lane nodes, D is the dimension of the time encoding, and R is the real number field. This matrix is used to characterize the global periodic features in the time dimension, providing a temporal prior for the spatiotemporal feature embedding module.
[0131] (4) Signal control and sampling parameters: In order to achieve synchronization with the traffic signal control system, this application assumes that the following system parameters are known quantities: signal timing cycle length (Unit: seconds), data sampling interval (Unit: seconds), Model prediction step size That is, the number of time steps that need to be predicted in the future, and the sampling window length. This refers to the length of the historical time series used for modeling. These parameters are set by the traffic control center during the system deployment phase to ensure that the prediction results are aligned with the time domain of the traffic light cycle.
[0132] (5) Graph Laplacian Operator and Spatial Embedded Basis: In order to provide structural stability in the spatial dimension, this application in Calculate the graph Laplacian matrix based on And extract its minimum eigenvectors:
[0133]
[0134] Where U is the spatial embedding basis matrix, Let L be the first k smallest non-zero eigenvectors of the graph Laplacian matrix, and N be the total number of lane nodes. This matrix serves as a spatial embedding basis, providing structural priors for the bottleneck Transformer in the decoding stage, enabling the model to maintain its adherence to the real road topology when learning the dynamic graph.
[0135] The lane-level traffic flow prediction method for signal timing decision-making consists of four modules. Figure 4 The lane-level traffic flow prediction structure block diagram provided in the embodiments of this application is as follows: Figure 4 As shown, the structure is as follows:
[0136] 1. Spatiotemporal Feature Embedding Module: First, historical traffic data is preprocessed and temporally semantically encoded. Periodic temporal embeddings are generated using time tags (hours, days of the week, etc.), and combined with the spatial reachability matrix between lanes (constructed from a Gaussian kernel function and a distance threshold) to form a basic graph structure. By embedding and mapping both temporal and spatial features, a unified-dimensional spatiotemporal feature representation is obtained, providing prior input for subsequent dynamic relationship learning.
[0137] 2. Dynamic Relationship Graph Learning Module: Building upon the static topology, a random, learnable embedding is introduced to generate time-varying adjacency tensors, enabling lane relationship modeling at different time steps. The embedding parameters are automatically optimized through backpropagation, dynamically adjusting the connection weights between lanes to capture the spatial dependencies of traffic conditions over time. Subsequently, dynamic graph convolution is used to aggregate adjacent node features at each time step, generating a temporal feature output with dynamic spatial constraints.
[0138] 3. Lane Flow Dual-Scale Feature Deconstruction Module: To address the issue of overlapping trends and fluctuations in traffic flow, this application employs a dual-scale convolutional structure for deconstruction after fusing dynamic graph features with spatiotemporal embedding. A large receptive field convolution is used to extract long-term trend components, reflecting steady evolution and macroscopic changes, while a small receptive field convolution is used to enhance short-term fluctuation components, reflecting high-frequency disturbances such as signal switching and congestion dissipation. This dual-component design enables the model to balance global stability and local sensitivity, achieving a fine-grained representation of traffic state changes.
[0139] 4. Prediction Output Module: The long-term trend component and short-term fluctuation component are fused into a unified temporal feature after being encoded using a lightweight GRU. This feature is then combined with the temporal embedding of future time steps and a stable spatial embedding based on Laplacian eigenvectors, and input into a bottleneck-type Transformer. This structure achieves low-complexity global dependency modeling through temporal attention compression and backdiffusion, significantly reducing the number of parameters while maintaining the ability to characterize the spatiotemporal dependencies of long sequences. Finally, the model outputs lane flow prediction results for multiple future steps, providing a basis for the dynamic adjustment of signal timing strategies.
[0140] This application reduces model complexity while maintaining prediction accuracy, enabling efficient and scalable modeling of lane-level traffic flow. Its output can be directly used for intersection signal timing optimization, such as green light ratio allocation, phase duration prediction, and dynamic decision-making, providing fundamental support for building intelligent, real-time urban traffic control systems.
[0141] Figure 5 The lane-level traffic flow prediction flowchart provided in the embodiments of this application is as follows: Figure 5 As shown, the process is as follows:
[0142] Spatiotemporal Feature Embedding: In lane-level traffic flow prediction, relying solely on historical traffic flow sequences is insufficient to reflect the spatiotemporal patterns of traffic operation. To inject prior information on temporal semantics and spatial topology into the input layer, this application proposes a spatiotemporal feature embedding method. The core idea of this module is: for each time step... The observations are encoded using time tags to generate time embeddings for each lane node. The spatial embeddings are generated by connecting the lanes, and then the two types of embeddings are fused through a nonlinear function to obtain a refined spatiotemporal representation of each lane at different times. The resulting embeddings are not only uniform in numerical scale, but also have the ability to represent periodic patterns and topological structures.
[0143] First, for each time step Based on the original time label (Including "day of the week", "time period index", "whether it is a holiday", etc.) Generate basic time features. To facilitate neural network processing, one-hot encoding is used to convert discrete labels into sparse vector form.
[0144]
[0145]
[0146] in, This is the original time label corresponding to time step t. From The day of the week extracted from it. From The "intraday time period" extracted from it. This is the one-hot encoded vector of the "day of the week" at time step t. This is the one-hot encoded vector for the "intraday period" at time step t. The total number of weekday categories, This represents the total number of categories during the intraday period. Discrete features are transformed into continuous low-dimensional embeddings using a learnable mapping matrix:
[0147]
[0148] in, For time step t, the "week" continuous embedding vector, For each time step t, a continuous embedding vector is created for the "intraday period". These are learnable parameters.
[0149] To further describe the periodic characteristics of traffic operations, a periodic embedding based on sine and cosine functions is introduced into the time coding. A continuous phase variable is defined. This indicates the current position within a daily cycle, encoded using multi-frequency sine and cosine functions:
[0150]
[0151] in, For continuous phase variables, Let be the periodic embedding vector at time step t. This represents the dimension of the periodic embedding. After concatenating the above time features, a unified time embedding is obtained through linear mapping and nonlinear activation:
[0152]
[0153] in, This is the vector concatenation operator. For time step t, the "week" continuous embedding vector, For each time step t, a continuous embedding vector is created for the "intraday period". The concatenation of the three time feature vectors results in a single vector. For a learnable linear mapping matrix of unified temporal embedding, It is a non-linear activation function. Let be the unified temporal embedding vector at time step t. Since the temporal embedding is only related to time step t... Related to, and related to nodes It is irrelevant, therefore Broadcasting along the node dimension yields a temporal embedding tensor:
[0154]
[0155] in, For time embedding tensors, To unify the dimensions of time embedding, This is the temporal embedding vector corresponding to "time step t, lane node n" in the temporal embedding tensor. This tensor represents the temporal pattern of each time step, providing temporal semantic support for the subsequent dynamic graph relationship learning and decomposition module.
[0156] In the spatial dimension, a static topology graph is established based on the connection relationships of lanes at intersections. The adjacency matrix is defined as follows: Therefore, the Laplace matrix can be calculated as follows:
[0157]
[0158] Where L is the static graph Laplacian matrix and D is the static degree matrix. It is an adjacency matrix.
[0159] The front is obtained through eigenvalue decomposition. The smallest non-zero eigenvectors form the spectral basis matrix: .
[0160] These feature vectors represent the structural relationships between lane nodes in the topological space, capturing the relative similarity in geometric location and traffic connectivity among lanes within an intersection. This is achieved using learnable matrices. Mapping spectral features to the target space dimension:
[0161]
[0162] in, Let U be the spatial embedding vector, and U be the spectral basis matrix. is a learnable mapping matrix for spatial features.
[0163] And the spatial embedding tensor is obtained by copying it in the time dimension:
[0164]
[0165] in, Embed tensors in space, This is the spatial embedding vector corresponding to "time step t, lane node n" in the tensor. This spatial embedding provides the model with structural priors, enabling it to have position-aware capabilities when processing lane-level data, and providing a reference topological foundation for subsequent dynamic graph relationship learning. After constructing the temporal and spatial features, to achieve scale unification and information fusion between the two types of embeddings, a combination of nonlinear activation functions is used for element-wise additive fusion (final dimension alignment):
[0166]
[0167]
[0168] Where M is the final spatiotemporal feature embedding matrix, It is a sinusoidal activation function. It is the ReLU activation function. For time embedding tensors, Embedding tensors in space. Sine function. The time features can be normalized to Interval enhancement and periodic and nonlinear representation, ReLU activation function This ensures that the spatial embedding remains non-negative, sparse, and stable. The additive fusion maintains the physical independence of temporal and spatial features while achieving coupling through nonlinear superposition, ensuring that the fused embedding reflects both the topological structure and the periodic trend of the temporal dimension. Through this process, the final spatiotemporal feature embedding matrix can be obtained:
[0169]
[0170] in, Indicates the number of time steps. Indicates the number of lane nodes. This matrix serves as the embedding dimension. It acts as the fundamental input to the system, providing a unified feature space for subsequent dynamic graph relationship learning and dual-scale feature deconstruction of lane flow. To ensure the feasibility and interpretability of this step, the variables in the spatiotemporal feature embedding process are categorized and explained as follows:
[0171] Known quantities include: the number of historical time steps. , representing the number of nodes (Number of lanes at the intersection), static lane connection matrix Time-labeled sequences and hyperparameters .
[0172] Learnable parameters include: , , and .
[0173] Output includes: temporal embedding tensor Spatial embedding tensor and the final fusion embedding matrix .
[0174] Dynamic Relationship Graph Learning: In lane-level traffic flow prediction at intersections, the flow changes between different lanes exhibit significant dynamic correlations. For example, the traffic intensity of left-turn lanes and straight-ahead lanes varies with factors such as signal timing and traffic flow fluctuations. Traditional graph convolutional models typically rely on fixed adjacency matrices, making it difficult to reflect these time-varying relationships. Therefore, this application proposes a dynamic relationship graph learning module that automatically generates adjacency matrices that change with time steps using learnable tensors, thereby modeling the time-varying dependencies between lane nodes.
[0175] To achieve the above objectives, this application introduces three sets of learnable embedding matrices and a core tensor, representing temporal semantics, the starting lane, the ending lane, and their interaction relationships, respectively. Let:
[0176]
[0177] in, A learnable embedding matrix representing temporal semantics. The learnable embedding matrix represents the starting lane. The learnable embedding matrix representing the termination lane. It is the core tensor.
[0178] Using these four sets of learnable parameters, the model can adaptively adjust the time-space coupling weights through backpropagation during training. The formula for generating the dynamic graph adjacency matrix is:
[0179]
[0180] in, Indicates time step Exit lane node and The initial connection strength is determined by this formula, which integrates time and node dimension information through a triple tensor product, achieving high-order nonlinear interaction between time and nodes. To ensure that the generated adjacency weights are non-negative and sparse, this application introduces the Rectified Linear Activation Function (ReLU) for nonlinear constraints:
[0181]
[0182] in, Let be the final adjacency weights of lane nodes i and j at time step t. This operation effectively suppresses negative correlation noise, ensuring that the elements of the adjacency matrix only represent the strength of positive correlations, thus maintaining the interpretability of traffic flow nodes in a physical sense. Next, to make the weight distribution of each row probabilistically normalized, Softmax normalization is further applied to the activated adjacency matrix:
[0183]
[0184] in, The final normalized adjacency weights of lane nodes i and j at time step t. The normalized dynamic adjacency matrix. It can reflect the relative influence between lanes at time t. When the traffic flow change in one lane has a significant impact on other lanes, its corresponding weight... The value will be higher. Ultimately, over the entire time series, the dynamic graph adjacency tensor can be obtained:
[0185]
[0186] Where A is the dynamic graph adjacency tensor for the entire time window. After generating the dynamic graph adjacency, this module uses graph convolution operations to perform time-varying propagation and aggregation of node features. Let the... Layered graph convolution input features are The updated formula is:
[0187]
[0188] in, Representing a dynamic graph Order adjacency propagation (i.e., aggregation) - Jump to neighbor information). The weight matrix is a learnable matrix. For the maximum propagation order, the initial features This refers to the normalized real traffic sequence data (e.g., observations of traffic flow / queue length / average speed for each lane). For the first +1 layer of graph convolution outputs features at time step t. Through multi-layer convolution propagation, the model can aggregate dynamic information from upstream and downstream lanes in space and explicitly learn the mechanism by which time-varying traffic states influence neighboring lanes. At each time step... The above yields the convolution output:
[0189]
[0190] in, This represents the final output feature of the Lth layer graph convolution at time step t. Stacking these features along the time dimension yields the dynamic graph convolution output tensor:
[0191]
[0192] in, The output tensor of the dynamic graph convolution of the Lth layer, Let T be the output feature of the Lth layer graph convolution at time step T.
[0193] Through this dynamic graph relationship learning mechanism, the model can adaptively adjust the connection weights between nodes at each time step, thereby accurately modeling the time-varying dependency structure between different lanes within an intersection. For example, when traffic lights change or congestion occurs in a specific lane, the model automatically strengthens the connections between relevant lanes and weakens the propagation effects of irrelevant nodes, achieving a high-precision description of the dynamic traffic topology. The module's output... The output of the spatiotemporal feature embedding module will be combined with the spatiotemporal feature embedding module. They are then input into the subsequent "lane flow dual-scale feature deconstruction module" to complete the separation of trend and fluctuation features.
[0194] To ensure the feasibility and interpretability of this step, the variables in the dynamic relationship graph learning process are categorized and explained as follows:
[0195] Known quantities include: number of time steps Number of lane nodes and the original lane-level observation sequence .
[0196] Learnable parameters include: temporal embedding matrix Starting point node embedding matrix Endpoint node embedding matrix Core Tensor Convolution weights ( ).
[0197] Output includes: dynamic graph adjacency tensor Convolutional output features .
[0198] Dual-Scale Feature Decomposition: In lane-level traffic flow prediction tasks, vehicle operating states are influenced by factors at multiple time scales: on the one hand, there is a slow-changing trend determined by factors such as traffic light timing and upstream and downstream traffic organization; on the other hand, there are rapid fluctuations affected by short-term random disturbances or sudden congestion. To simultaneously characterize the changes of these two types of features at different time scales, this application proposes a dual-scale feature decomposition mechanism for lane flow. This mechanism uses a multi-scale temporal convolution structure to achieve dual-channel decomposition of lane flow signals at the time scale, thereby simultaneously extracting long-term trend components and short-term fluctuation components, thus balancing the stability of the global trend with the sensitivity of local dynamics.
[0199] The module input includes dynamic graph convolution output. Spatiotemporal embedding features The former includes time-varying topological dependencies and spatial propagation information obtained during the dynamic graph relation learning stage, while the latter provides periodic temporal semantics and static topological priors. The two types of features are linearly concatenated and mapped during the fusion stage to form a unified comprehensive feature representation of lane flow.
[0200]
[0201] in, This represents a concatenation operation along the feature dimension. This is a learnable weight matrix used to concatenate the weights. 3D feature mapping back to original 3D space For spatiotemporal embedding features, This mapping outputs a tensor for dynamic graph convolution. This mapping not only ensures dimensionality consistency with subsequent modules but also achieves a joint representation of dynamic graph dependencies and spatiotemporal priors, resulting in a more fused output feature set. It possesses both structural information and temporal semantics.
[0202] Based on the fused features, a dual-scale temporal convolutional structure is used to deconstruct the traffic flow signal in the time dimension. First, a temporal convolutional network with a large receptive field is used to extract smooth long-term trend features:
[0203]
[0204] in, For long-term temporal convolution operations, This is a long-term trend characteristic. This represents the integrated characteristics of the lane flow after fusion. With a larger convolutional kernel and a longer receptive field, it can capture the stationary evolution patterns over multiple signal periods, reflecting the stable traffic trends and saturation flow changes of lanes across multiple periods. Subsequently, to enhance the model's ability to perceive short-term fluctuations, temporal convolution with a smaller receptive field is used to extract local high-frequency features, and long-term components are fused using a residual approach.
[0205]
[0206] in, Characterized by short-term fluctuations These are the weighting coefficients. This represents the short-term fluctuation residual term. Shorter convolutional kernels are used to enhance the response to rapid changes such as traffic light switching, traffic flow release, and temporary congestion. These are learnable fusion coefficients used to balance the proportion of short-term convolution results to residual signals; the residual term... The high-frequency components of the original features are preserved, ensuring overall reconstructibility and making the decomposition satisfy... .
[0207] After the above dual-channel decomposition process, the two output components obtained are: (1) Long-term trend component : Characterizes the stable and periodic flow evolution characteristics, reflecting the macroscopic changes in signal timing and road capacity; (2) Short-term fluctuation components Characterizes high-frequency, non-stationary dynamic disturbances, reflecting the local effects of signal phase switching, lane competition, and sudden stalling.
[0208] To ensure the feasibility and interpretability of this step, the variables in the dual-scale feature deconstruction process are categorized and explained as follows:
[0209] Known quantities include: dynamic graph convolution output Spatiotemporal embedding features Time steps Number of lane nodes and feature dimensions .
[0210] Learnable parameters include: fusion weight matrix Large receptive field convolution parameters Small receptive field convolution parameters and fusion coefficient .
[0211] The output includes: long-term trend components and short-term fluctuation components .
[0212] Prediction Output Module: This module is based on the long-term trend component output by the lane flow dual-scale feature deconstruction module. With short-term fluctuation components By employing dual-path GRU encoding and bottleneck-based Transformer decoding, multi-step prediction of lane traffic flow at future time points is achieved. The module incorporates future time embedding and spatial embedding in its design to guide the model to focus on future spatiotemporal dynamics during the decoding phase, thereby effectively combining trend changes and spatial topological stability.
[0213] In lane-level traffic flow prediction scenarios, each approach lane at each intersection is treated as an independent node. As road networks expand, a typical urban area often contains hundreds of nodes with multiple layers of topological connections (such as coupling relationships like left turn, straight ahead, and right turn). This causes traditional Transformers to face a surge in parameters and excessive computational complexity in spatiotemporal modeling, making them difficult to apply directly to large-scale road networks. Therefore, this application introduces a bottleneck attention structure, which significantly reduces the parameter size and computational burden while ensuring global modeling dependencies, enabling the model to run efficiently in large-scale lane-level traffic networks.
[0214] Trend Components With fluctuation components The time features are encoded by inputting them into separate GRU networks to obtain long-term and short-term time series representations:
[0215]
[0216] in, As a component of long-term trends, This is a component of short-term fluctuations. This represents a time series representation of a long-term trend. This represents the time series of short-term fluctuations. For gated recurrent unit (GRU) networks that correspond to long-term trends, A gated recurrent unit (GRU) network designed to handle short-term fluctuations.
[0217] The two outputs are added element-wise to form the fused time-coded features:
[0218]
[0219] Here, E represents the fused time-coded feature. This feature simultaneously reflects the smooth evolution trend and local changes of lane traffic flow, providing a historical time-series basis for future predictions. The goal of the prediction stage is to generate a feature of length [length missing]. The future sequence. Generate future time embeddings based on the date and time information of the predicted time:
[0220]
[0221] in, Embedded for future time, For the predicted length, D is the embedding dimension.
[0222] And expand along the node dimension as follows:
[0223]
[0224] in, Embedded for the extended future time.
[0225] Simultaneously, a stable spatial embedding is constructed using the minimum eigenvector of the graph Laplacian matrix:
[0226]
[0227] in, This is a stable spatial embedding constructed based on the minimum eigenvector of the graph Laplacian matrix. This spatial embedding structure is stable and does not change over time, providing long-term spatial constraint priors for the decoder.
[0228] To guide the model to focus on future spatiotemporal relationships, initial conditions are first set during the decoding phase:
[0229]
[0230] in, is the initial input of layer 0 of the decoder, and E is the fused historical time-encoded feature.
[0231] The historical time-encoded features are used as the initial input to the decoder. In the... In the layer, the output of the previous layer is... Embedded Future Time With spatial embedding Concatenate along the feature dimension to obtain the joint input:
[0232]
[0233] in, For decoder number The combined input of the layers, For the decoder Output features of layer -1.
[0234] This operation implements historical time-series coding. The effective integration with future spatiotemporal guidance features provides rich contextual information for bottleneck Transformers.
[0235] The bottleneck Transformer architecture defines a learnable time bottleneck sequence in each layer. :
[0236]
[0237] And achieves bidirectional temporal-spatial information interaction through a two-stage multi-head self-attention mechanism:
[0238]
[0239]
[0240] in, This is the output of the first stage MHSA. For the first The learnable time bottleneck sequence of the layer For the first The feature submatrix corresponding to the v-th lane node at all time steps in the joint input of layer -1. For the first The output features of the layer and the v-th lane node. The definition of multi-head self-attention is:
[0241]
[0242] in, For the number of attention heads, For single-head dimension, The learnable projection matrix is used, where Q is the "query" input for attention, K is the "key" input for attention, and V is the "value" input for attention. The bottleneck structure effectively reduces the number of parameters and memory usage through intermediate channel compression and residual connections. While maintaining prediction accuracy, the computational complexity is reduced from traditional... This reduces the model to an approximately linear level, thus enabling the modeling of larger-scale road network nodes. After... After stacking the layers, the final spatiotemporal feature representation is obtained:
[0243]
[0244] Where Z represents the final spatiotemporal feature. For the process The output of layered bottleneck Transformer stacking.
[0245] Then, multi-step predictions for future moments are generated through regression using a fully connected layer:
[0246]
[0247] FC stands for fully connected layer. The results are predictions of future traffic conditions. To predict the target dimension (such as lane flow, queue length, or average speed), the model is optimized using the L1 loss function during training.
[0248]
[0249] in, Here, t is the L1 loss value, t is the time step index, and n is the lane node index. The predicted values for time step t and lane n are given. Let t be the actual target value for time step t and lane n.
[0250] Through the above structural design, the model maintains high prediction accuracy while improving scalability and real-time performance in lane-level scenarios. This module can simultaneously capture long-term trends and short-term fluctuations in large-scale intersection networks and complete efficient multi-step lane flow prediction under limited computing power.
[0251] To ensure the feasibility and interpretability of this step, the variables in the dual-scale feature deconstruction process are categorized and explained as follows:
[0252] Known quantities include: historical lane flow characteristic sequences Embedded Future Time Spatial embedding Time step parameters and number of lane nodes and feature dimensions .
[0253] Learnable parameters include: GRU encoding parameters Bottleneck Time Embedding Matrix Multi-head attention projection matrix and fully connected layer parameters .
[0254] The output includes: multi-step prediction results for future times. .
[0255] This application improves the refinement and scalability of spatial structure modeling: It establishes a spatial graph structure at the lane-level granularity, treating each intersection's entry and exit lanes as independent nodes. An initial adjacency matrix is constructed based on a Gaussian kernel function and a distance threshold, combined with Laplacian eigenvectors to form a stable spatial embedding basis. This design can accurately characterize the directional dependencies, steering constraints, and phase relationships between lanes, significantly improving spatial resolution. Compared to traditional methods that only model at the road or detector level, this application maintains structural consistency and parameter scalability in large-scale road networks, making spatial relationship modeling more refined and reliable.
[0256] This application enhances the ability to characterize time-varying relationships through dynamic topology learning: It introduces stochastic learnable embeddings to generate time-varying adjacency tensors, and adaptively adjusts the connection weights between nodes during training via backpropagation, thereby achieving time-varying topology modeling of traffic conditions. Compared to traditional methods relying on static adjacency matrices, this mechanism can reflect dynamic changes such as signal switching, traffic flow turning, and local congestion in real time, effectively capturing non-stationary dependencies between lanes. Through continuous learning of dynamic graph relationships, the model maintains prediction accuracy and response sensitivity under complex traffic conditions, significantly improving its ability to express spatiotemporal relationships.
[0257] This application employs a dual-scale feature deconstruction mechanism to separate trends from fluctuations: After fusing spatiotemporal features, this application proposes a dual-scale feature deconstruction mechanism for lane flow. It utilizes large receptive field convolution to extract long-term trend features and capture the overall flow evolution pattern; simultaneously, it introduces small receptive field convolution to enhance short-term fluctuation response and identify periodic oscillations and sudden disturbances. This dual-pathway structure achieves explicit separation of trends and fluctuations, avoiding the aliasing of smooth and high-frequency information in a single time-series model. Through multi-scale representation of traffic flow, the model exhibits stronger robustness and generalization ability when facing complex traffic conditions such as morning and evening rush hours and signal switching.
[0258] This application employs a bottleneck-based Transformer to reduce computational complexity while maintaining global dependencies: In the decoding stage, a bottleneck-based Transformer structure is introduced. Through temporal attention compression and back-diffusion mechanisms, global dependencies are maintained, significantly reducing computational complexity. Compared to the traditional Transformer's all-time-space self-attention mechanism, this structure can achieve long-sequence modeling with approximately linear computational cost, effectively reducing the number of parameters and memory usage. This design enables the model to run efficiently in complex road networks containing hundreds of lane nodes, ensuring real-time prediction performance and providing feasibility for online deployment of signal control systems.
[0259] The prediction results of this application are naturally integrated with the signal timing logic: The model design incorporates future time embedding and stable spatial embedding based on Laplace eigenvectors, ensuring that the prediction output aligns with the signal cycle in the time domain and corresponds to the lane topology in the spatial domain. This structural design allows the prediction results to be directly mapped to signal timing decision parameters, such as green ratio adjustment, phase optimization, and dynamic coordination control. The model output not only provides a quantitative prediction of future traffic conditions but also offers an interpretable decision basis for the signal control logic, achieving a natural integration and closed-loop optimization between lane flow prediction and signal timing control.
[0260] The technical solution of this application has made systematic improvements in spatiotemporal feature modeling, dynamic topology learning, multi-scale decomposition, and efficient decoding, and specifically solves the following problems:
[0261] (1) The spatial resolution and topological expression accuracy are improved by using lane-level graph structure modeling.
[0262] (2) The time-varying correlation modeling of traffic status was realized through the dynamic graph relationship learning mechanism.
[0263] (3) The long-term trend and short-term fluctuation of traffic flow were distinguished by the dual-scale feature deconstruction.
[0264] (4) The bottleneck-type Transformer reduces computational complexity and enhances global dependency modeling capabilities.
[0265] (5) Through the spatiotemporal embedding alignment mechanism, the prediction results can directly support the signal timing decision.
[0266] An alternative to the animated graph generation module is:
[0267] Technical Solution Overview: In addition to generating dynamic graph relationships for the entire time period at once through random embedding, a dynamic graph can also be generated by using a static prior graph + dynamic correction method while retaining the idea of global optimization.
[0268] Implementation: The model first generates a basic static graph based on the physical topology of the roads, and then fine-tunes the node relationships for each time period using a learnable correction matrix to obtain a time-varying adjacency matrix. This approach can also achieve dynamic graph updates without relying on input features.
[0269] Technical advantages: This scheme can adapt to dynamic changes in traffic conditions while maintaining model stability, avoiding the instability problems caused by completely random initialization. It is consistent with the core idea of the dynamic graph learning mechanism in this application and thus falls within the scope of protection of this application.
[0270] An alternative to the trend and volatility decomposition module is:
[0271] Technical Solution Overview: This application employs a dual convolutional structure to separate long-term trends from short-term fluctuations. Alternative solutions could replace this part with time-based filtering decomposition or signal smoothing and residual enhancement.
[0272] Implementation: The trend component can be extracted using methods such as moving average, exponential smoothing, or wavelet decomposition, and the fluctuation component can be represented by the residual signal. The two components still need to be encoded separately and then fused.
[0273] Technical advantages: This scheme can achieve multi-scale feature extraction in different mathematical forms without changing the overall model structure, with equivalent results. It maintains the core idea of "trend-fluctuation separation" and does not change the logical path of the prediction results.
[0274] An alternative to the predictive output module is:
[0275] Technical Solution Overview: This application employs a bottleneck-based Transformer for future time series prediction. Alternative solutions could utilize lightweight attention structures or a hybrid gated loop and attention structure to achieve the same functionality.
[0276] Implementation methods: For example, linear attention or Informer structures can be used instead of bottleneck attention mechanisms; GRU can also be combined with local attention to form a decoder, thereby reducing computational cost while maintaining global dependencies.
[0277] Technical advantages: This solution still follows the compression-expansion-fusion approach, improving operational efficiency without changing the overall prediction process and ensuring that the model can be deployed in real time on low-computing-power platforms.
[0278] Figure 6 This is a schematic diagram of the traffic flow prediction device provided in an embodiment of this application. Figure 6 As shown, the traffic flow prediction device includes:
[0279] The first acquisition module 601 is used to acquire traffic flow data and lane topology within a preset historical time period; wherein, the end time of the historical time period is earlier than the current time, the traffic flow data includes the lane flow, speed and queue length of each lane in the preset multiple lanes, and the lane topology includes the connection relationship between the multiple lanes.
[0280] Learning module 602 is used to perform adaptive parameter mapping learning based on a dynamic graph relation learning mechanism driven by random embedding, with lane topology as static constraint, to obtain a dynamic adjacency matrix. The dynamic adjacency matrix is used to represent the connection weight between the first lane and the second lane at a historical time. The connection weight is used to represent the influence strength of the traffic state of the first lane on the traffic state of the second lane. The historical time refers to any time in the historical time period. The first lane refers to any one of the multiple lanes. The second lane refers to any one of the multiple lanes other than the first lane.
[0281] The aggregation module 603 is used to perform feature propagation and aggregation on traffic flow data using graph convolution operations and a dynamic adjacency matrix as the relationship between nodes, to generate historical lane feature representations; wherein, the historical lane feature representations are used to represent the traffic status of multiple lanes at historical time points.
[0282] The prediction module 604 is used to make predictions based on multiple historical lane feature representations to obtain predicted lane feature representations. The predicted lane feature representations are used to represent the traffic status of multiple lanes at future times. Future times refer to any time in a future time period, and the start time of the future time period is later than the current time.
[0283] In one possible design, learning module 602 includes:
[0284] The first acquisition unit is used to acquire the time embedding matrix, the start node embedding matrix, the end node embedding matrix, and the tensor; wherein, the start node embedding matrix is used to represent the attributes of the first lane when the first lane is the start of multiple lanes, and the end node embedding matrix is used to represent the attributes of the first lane when the first lane is the end of multiple lanes.
[0285] The first fusion unit is used to fuse the time embedding matrix, the starting node embedding matrix, the ending node embedding matrix, and the tensor to obtain the initial adjacency weight matrix.
[0286] The constraint unit is used to apply nonlinear constraints to the initial adjacency weight matrix using a preset activation function to obtain the constrained adjacency matrix; wherein, the activation function is used to suppress negative correlation noise in the initial adjacency weight matrix.
[0287] The normalization unit is used to normalize the constrained adjacency matrix to obtain the dynamic adjacency matrix.
[0288] In one possible design, aggregation module 603 includes:
[0289] The convolutional unit is used to perform graph convolution operations on traffic flow data as node features and dynamic adjacency matrix as the relationship between nodes to obtain dynamic spatiotemporal features.
[0290] The second fusion unit is used to generate a temporal embedding based on the time label of traffic flow data and a spatial embedding based on the lane topology. The temporal embedding and the spatial embedding are then fused to obtain spatiotemporal embedding features.
[0291] The third fusion unit is used to fuse dynamic spatiotemporal features with spatiotemporal embedding features to obtain a comprehensive feature representation of lane flow.
[0292] The first extraction unit is used to extract the trend components from the comprehensive feature representation of lane flow through a pre-defined first receptive field convolution.
[0293] The second extraction unit is used to extract components from the comprehensive feature representation of lane flow through a preset second receptive field convolution to obtain the fluctuation component; wherein, the receptive field range of the first receptive field convolution is larger than that of the second receptive field convolution, and the time scale of the traffic state represented by the trend component is larger than that of the traffic state represented by the fluctuation component.
[0294] The fourth fusion unit is used to encode and fuse the trend component and the fluctuation component to obtain the historical lane feature representation.
[0295] In one possible design, the prediction module 604 includes:
[0296] The second acquisition unit is used to acquire the time tag of the future time and generate the future time embedding based on the time tag of the future time.
[0297] The generation unit is used to generate a stable spatial embedding based on the lane topology.
[0298] The decoding unit is used to decode the historical lane feature representation based on future time embedding and stable spatial embedding to obtain the decoded spatiotemporal feature representation; wherein, future time embedding is used to provide temporal dimension guidance for decoding, and stable spatial embedding is used to provide spatial dimension guidance for decoding.
[0299] The regression unit is used to perform regression processing on the decoded spatiotemporal feature representation to obtain the predicted lane feature representation.
[0300] In one possible design, the traffic flow prediction device also includes:
[0301] The second acquisition module is used to acquire real lane feature representations in response to the arrival of a future time from the current time; wherein, the real lane feature representations are used to represent the real traffic state of multiple lanes at the future time.
[0302] The optimization module is used to calculate the difference between the predicted lane feature representation and the real lane feature representation, and optimize the parameters of the random embedding-driven dynamic graph relation learning mechanism based on the difference.
[0303] The traffic flow prediction device provided in this embodiment can perform... Figures 2 to 3 The technical solution of the traffic flow prediction method embodiment shown herein, its implementation principle and technical effect are similar to Figures 2 to 3 The implementation of the traffic flow prediction method shown is similar and will not be described in detail here.
[0304] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 70 includes at least one processor 710 and a memory 720. The electronic device also includes a communication component 730. The processor 710, memory 720, and communication component 730 are connected via a bus 740.
[0305] In a specific implementation, at least one processor 710 executes computer execution instructions stored in memory 720, causing at least one processor 710 to implement a traffic flow prediction method of the above embodiment.
[0306] The specific implementation process of processor 710 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0307] In the above embodiments, it should be understood that the processor 710 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0308] The memory 720 may include high-speed RAM memory, and may also include non-volatile memory NVM, such as at least one disk storage.
[0309] Bus 740 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 740 can be divided into address bus, data bus, control bus, etc. For ease of illustration, the bus 740 in the accompanying drawings of this application is not limited to only one bus or one type of bus.
[0310] The above description of the functions implemented by electronic devices and main control devices has introduced the solutions provided by the embodiments of the present invention. It is understood that, in order to implement the above functions, the electronic device or main control device includes hardware structures and / or software modules corresponding to the execution of each function. By combining the units and algorithm steps of the various examples described in the embodiments of the present invention, the embodiments of the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of the embodiments of the present invention.
[0311] This application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these instructions are used to implement a traffic flow prediction method according to the above embodiments. In the specific implementation of the aforementioned traffic flow prediction method, each module can be implemented as a processor.
[0312] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0313] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in application-specific integrated circuits (ASICs). Alternatively, the processor and the readable storage medium can exist as discrete components in an electronic device or a host device.
[0314] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement a traffic flow prediction method according to the above embodiments.
[0315] The computer program is stored in a readable storage medium, and at least one processor can read the computer program from the readable storage medium and execute the computer program to perform the scheme provided in any of the above embodiments.
[0316] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.
[0317] The technical solutions of this application have been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A traffic flow prediction method characterized by, The method comprises: acquiring traffic flow data and lane topology structure in a preset historical time period; wherein, the historical time period is earlier than the current time, the traffic flow data comprises lane flow, speed and queue length of each lane in a plurality of preset lanes, and the lane topology structure comprises connection relationship between the plurality of lanes; performing parameter mapping adaptive learning based on a dynamic graph relationship learning mechanism driven by random embedding, to obtain a dynamic adjacency matrix, taking the lane topology structure as a static constraint; wherein, the dynamic adjacency matrix is used to represent connection weight between a first lane and a second lane at a historical time, the connection weight is used to represent influence intensity of traffic state of the first lane on traffic state of the second lane, the historical time refers to any time in the historical time period, and the first lane refers to any one of the plurality of lanes, and the second lane refers to any one of the plurality of lanes except the first lane; performing feature propagation and aggregation on the traffic flow data by using graph convolution operation, taking the dynamic adjacency matrix as node relationship, to generate historical lane feature representation; wherein, the historical lane feature representation is used to represent traffic state of the plurality of lanes at the historical time. performing prediction according to a plurality of historical lane feature representations, to obtain predicted lane feature representation; wherein, the predicted lane feature representation is used to represent traffic state of the plurality of lanes at a future time, and the future time refers to any time in a future time period, and the start time of the future time period is later than the current time.
2. The traffic flow prediction method according to claim 1, characterized in that, The parameter mapping adaptive learning based on the dynamic graph relationship learning mechanism driven by random embedding, to obtain the dynamic adjacency matrix, comprises: acquiring a time embedding matrix, a start node embedding matrix, an end node embedding matrix and a tensor; wherein, the start node embedding matrix is used to represent attributes of the first lane as a start point of the plurality of lanes, and the end node embedding matrix is used to represent attributes of the first lane as an end point of the plurality of lanes; fusing the time embedding matrix, the start node embedding matrix, the end node embedding matrix and the tensor, to obtain an initial adjacency weight matrix; performing nonlinear constraint on the initial adjacency weight matrix by using a preset activation function, to obtain a constrained adjacency matrix; wherein, the activation function is used to suppress negative correlation noise in the initial adjacency weight matrix; performing normalization on the constrained adjacency matrix, to obtain the dynamic adjacency matrix.
3. The traffic flow prediction method according to claim 1, characterized in that, The feature propagation and aggregation on the traffic flow data by using graph convolution operation, taking the dynamic adjacency matrix as node relationship, to generate the historical lane feature representation, comprises: taking the traffic flow data as node features, and performing graph convolution operation on the dynamic adjacency matrix as node relationship, to obtain dynamic spatio-temporal features; generating time embedding according to time label of the traffic flow data, and generating space embedding according to the lane topology structure, and fusing the time embedding and the space embedding, to obtain spatio-temporal embedding features; Fusing the dynamic spatio-temporal feature with the spatio-temporal embedding feature to obtain a lane flow comprehensive feature representation; Extracting components of the lane flow comprehensive feature representation through a preset first receptive field convolution to obtain a trend component; Extracting components of the lane flow comprehensive feature representation through a preset second receptive field convolution to obtain a fluctuation component; wherein a receptive field range of the first receptive field convolution is greater than a receptive field range of the second receptive field convolution, and a time scale of a traffic state represented by the trend component is greater than a time scale of a traffic state represented by the fluctuation component; Encoding and feature fusing the trend component and the fluctuation component to obtain the historical lane feature representation.
4. The traffic flow prediction method according to claim 1, characterized in that, The prediction according to the plurality of historical lane feature representations to obtain a predicted lane feature representation comprises: obtaining a time label of the future moment, and generating a future time embedding according to the time label of the future moment; generating a stable space embedding according to the lane topology structure; decoding the historical lane feature representation based on the future time embedding and the stable space embedding to obtain a decoded spatio-temporal feature representation; wherein the future time embedding is used to provide time dimension guidance for the decoding, and the stable space embedding is used to provide space dimension guidance for the decoding; performing regression processing on the decoded spatio-temporal feature representation to obtain the predicted lane feature representation.
5. The traffic flow prediction method according to claim 1, characterized in that, After the prediction according to the plurality of historical lane feature representations to obtain a predicted lane feature representation, the method further comprises: in response to the current moment reaching the future moment, obtaining a real lane feature representation; wherein the real lane feature representation is used to represent a real traffic state of the plurality of lanes at the future moment; calculating a difference value between the predicted lane feature representation and the real lane feature representation, and optimizing parameters of the random embedding driven dynamic graph relationship learning mechanism according to the difference value.
6. A traffic flow prediction device characterized by comprising: comprises: a first obtaining module, configured to obtain traffic flow data in a preset historical time period and a lane topology structure; wherein a cutoff moment of the historical time period is earlier than a current moment, the traffic flow data comprises lane flow, speed and queue length of each lane in a preset plurality of lanes, and the lane topology structure comprises a connection relationship between the plurality of lanes; a learning module, configured to perform parameter mapping adaptive learning based on a random embedding driven dynamic graph relationship learning mechanism with the lane topology structure as a static constraint to obtain a dynamic adjacency matrix; wherein the dynamic adjacency matrix is used to represent a connection weight between a first lane and a second lane at a historical moment, the connection weight is used to represent an influence intensity of a traffic state of the first lane on a traffic state of the second lane, the historical moment refers to any moment in the historical time period, and the first lane refers to any one of the plurality of lanes, and the second lane refers to any one of the plurality of lanes except the first lane. The aggregation module is configured to perform feature propagation and aggregation on the traffic flow data by using a graph convolution operation with the dynamic adjacency matrix as the relationship between nodes, to generate a historical lane feature representation, wherein the historical lane feature representation is used to represent the traffic states of the plurality of lanes at the historical time. The prediction module is configured to perform prediction according to a plurality of historical lane feature representations to obtain a predicted lane feature representation, wherein the predicted lane feature representation is used to represent the traffic states of the plurality of lanes at a future time, and the future time refers to any time in a future time period, and the start time of the future time period is later than the current time.
7. An electronic device, comprising: The method comprises: a processor, and a memory connected to the processor in communication; the memory stores computer-executable instructions; when the processor executes the computer-executable instructions stored in the memory, the processor is configured to implement the traffic flow prediction method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the processor is configured to implement the traffic flow prediction method according to any one of claims 1 to 5.
9. A computer program product, characterised in that, The computer program is executed by the processor to implement the traffic flow prediction method according to any one of claims 1 to 5.