Search

CN-122024489-A - Method and device for predicting traffic flow, electronic equipment and storage medium

CN122024489ACN 122024489 ACN122024489 ACN 122024489ACN-122024489-A

Abstract

The invention is applied to the technical field of intelligent traffic and discloses a method and a device for predicting traffic flow, electronic equipment and a storage medium. The method comprises the steps of obtaining historical traffic flow data corresponding to a road network to be predicted, inputting the historical traffic flow data into a preset traffic flow prediction model to obtain a predicted flow sequence corresponding to the road network to be predicted, wherein the traffic flow prediction model is used for extracting multi-source initial characteristics of the historical traffic flow data, enhancing the multi-source initial characteristics by using a backbone network, obtaining space-time dependent characteristics, further determining a plurality of target time scales, compressing the space-time dependent characteristics respectively based on the target time scales, compressing the characteristics corresponding to the target time scales respectively, extracting the time scale time sequence characteristics corresponding to the target time scales based on the time scale compression characteristics, and obtaining the predicted flow sequence corresponding to the road network to be predicted based on the time scale time sequence characteristics corresponding to the target time scales. Thus, flow prediction with multiple time scales is realized, and the accuracy of prediction is improved.

Inventors

  • ZHOU YAN
  • LIU ZIYUAN
  • HE JING
  • HAN PENGCHENG

Assignees

  • 电子科技大学

Dates

Publication Date
20260512
Application Date
20260325

Claims (10)

  1. 1. A method for predicting traffic flow, comprising: the method comprises the steps of obtaining historical traffic flow data corresponding to a road network to be predicted, wherein the historical traffic flow data comprises traffic state data corresponding to each traffic node and time stamp information corresponding to the traffic state data; The method comprises the steps of inputting historical traffic flow data into a preset traffic flow prediction model to obtain a predicted flow sequence corresponding to a road network to be predicted, extracting multi-source initial characteristics of the historical traffic flow data based on node dimensions, time dimensions and state dimensions, enhancing the multi-source initial characteristics by using a preset backbone network to obtain space-time dependent characteristics, determining a plurality of target time scales according to the space-time dependent characteristics, respectively compressing the space-time dependent characteristics based on the target time scales, respectively compressing scale compression characteristics corresponding to the target time scales, extracting scale time sequence characteristics corresponding to the target time scales based on the scale compression characteristics, and then obtaining the predicted flow sequence corresponding to the road network to be predicted based on the scale time sequence characteristics corresponding to the target time scales.
  2. 2. The method of claim 1, wherein the traffic flow prediction model extracts and enhances feature data of the historical traffic flow data based on node dimensions, time dimensions, and state dimensions by obtaining spatio-temporal dependent features, comprising: Extracting node index vectors, the timestamp information and the traffic state data corresponding to the traffic nodes from the historical traffic flow data; Acquiring a time index and a date single-hot code based on the time stamp information; acquiring a node embedded vector based on the node index vector, acquiring a time embedded vector based on the time index, acquiring a date embedded vector based on the date single-hot code, and acquiring a traffic state embedded vector based on the traffic state data; And determining the sum of the node embedded vector, the time embedded vector, the date embedded vector and the traffic state embedded vector as a multi-source initial characteristic.
  3. 3. The method of claim 2, wherein the backbone network comprises a first graph neural network and a second graph neural network in parallel, and wherein the traffic flow prediction model enhances the multi-source initial feature by utilizing a preset backbone network to obtain the spatio-temporal dependent feature by: Constructing a first undirected graph and a second undirected graph corresponding to the road network to be predicted, wherein nodes of the first undirected graph and the second undirected graph are traffic nodes, edges of the first undirected graph and the second undirected graph represent roads of the road network to be predicted, a first adjacency matrix of the first undirected graph represents the connection relation of the traffic nodes, and a second adjacency matrix of the second undirected graph represents the data similarity of the traffic nodes; inputting the multi-source initial feature, the first adjacency matrix and the second adjacency matrix into the backbone network; Extracting a plurality of space-time feature blocks from the multi-source initial features by using a preset first sliding time window, wherein the space-time feature blocks comprise feature data of three continuous moments; remolding each space-time feature block into a two-dimensional form to obtain space-time two-dimensional features; Performing graph convolution operation on the space-time two-dimensional feature and the first adjacent matrix by using the first graph neural network to obtain a first feature tensor; performing graph convolution operation on the space-time two-dimensional feature and the second adjacent matrix by using the second graph neural network to obtain a second feature tensor; and fusing the first characteristic tensor and the second characteristic tensor to obtain the space-time dependent characteristic.
  4. 4. The method of claim 1, wherein the traffic flow prediction model determines a number of target time scales from the spatio-temporal dependent features by: Global average pooling and flattening are carried out on the space-time dependent features to obtain global context feature vectors; inputting the global context characteristics into a preset scale attention selector to obtain a selection weight vector; And determining each target time scale in a preset scale candidate set based on the selection weight vector.
  5. 5. The method of claim 1, wherein the traffic flow prediction model extracts scale timing features corresponding to each of the target time scales based on each of the scale compression features by: inputting each scale compression feature into a preset interactive graph convolution network and a preset hypergraph convolution network respectively to obtain an interactive feature corresponding to each target time scale and a hypergraph feature corresponding to each target time scale; And respectively fusing the interaction features and the hypergraph features based on the target time scales to obtain scale time sequence features corresponding to the target time scales.
  6. 6. The method of claim 1, wherein the traffic flow prediction model obtains the predicted traffic sequence corresponding to the road network to be predicted based on the scale timing characteristics corresponding to the target time scales by: feature fusion is carried out on the scale time sequence features corresponding to each target time scale, and joint space-time feature representation is obtained; and acquiring a predicted flow sequence in a preset target time range based on the joint space-time characteristic representation.
  7. 7. The method of claim 1, wherein the traffic flow prediction model is obtained by: Acquiring historical traffic flow data to be trained and a subsequent real flow sequence corresponding to the historical traffic flow data to be trained; Inputting the historical traffic flow data to be trained into a preset initial traffic flow prediction model to obtain a predicted traffic flow sequence to be trained; calculating an average absolute error corresponding to the initial traffic flow prediction model based on the subsequent real traffic flow sequence and the predicted traffic flow sequence to be trained; and carrying out iterative training on the initial traffic flow prediction model by taking the average absolute error as a loss function to obtain the traffic flow prediction model.
  8. 8. An apparatus for predicting traffic flow, comprising: The system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is configured to acquire historical traffic flow data corresponding to a road network to be predicted, and the historical traffic flow data comprises traffic state data corresponding to each traffic node and time stamp information corresponding to the traffic state data; The prediction module is configured to input the historical traffic flow data into a preset traffic flow prediction model to obtain a predicted flow sequence corresponding to the road network to be predicted, the traffic flow prediction model is used for extracting multi-source initial characteristics of the historical traffic flow data based on node dimensions, time dimensions and state dimensions, the multi-source initial characteristics are enhanced by a preset backbone network to obtain space-time dependent characteristics, a plurality of target time scales are determined according to the space-time dependent characteristics, then the space-time dependent characteristics are compressed respectively based on the target time scales, scale compression characteristics corresponding to the target time scales are extracted based on the scale compression characteristics, and then the predicted flow sequence corresponding to the road network to be predicted is obtained based on the scale time sequence characteristics corresponding to the target time scales.
  9. 9. An electronic device comprising a processor and a memory storing program instructions, wherein the processor is configured to perform the method for predicting traffic flow of any one of claims 1 to 7 when executing the program instructions.
  10. 10. A storage medium storing program instructions which, when executed, perform the method for predicting traffic flow of any one of claims 1 to 7.

Description

Method and device for predicting traffic flow, electronic equipment and storage medium Technical Field The invention relates to the technical field of intelligent traffic, in particular to a method and a device for predicting traffic flow, electronic equipment and a storage medium. Background At present, with the continuous expansion of the global city scale and the continuous increase of individual travel demands, the pressure faced by traffic systems is increasingly increased, and traffic flow prediction has become a core issue of modern intelligent traffic management. Traffic flow is a key index for measuring the running state of a road network to be predicted, and dynamic change of the traffic flow directly affects road traffic capacity and has a profound effect on the stability and reliability of an urban traffic system. The traffic flow is accurately predicted, and key basis can be provided for traffic signal control, path induction, road network scheduling to be predicted and other management decisions, so that the traffic resource allocation efficiency is optimized in the space-time dimension. In addition, accurate flow estimation is beneficial to identifying potential bottleneck road sections and peak periods, and prospective support is provided for congestion prevention and road network performance improvement to be predicted. Therefore, constructing a traffic flow prediction model with high precision and strong adaptability has become an important research direction in the crossing field of traffic engineering and intelligent science. In recent years, deep learning models have made significant progress in traffic congestion prediction, particularly for graph roll-up networks (Graph convolutional neural networks, GCN). The GCN can effectively capture the spatial dependency relationship between nodes (such as intersections and road sections) in the road network to be predicted by modeling the traffic network as a graph structure, so that the development of a traffic prediction model is greatly promoted. In the prior art, a fixed time window is generally adopted for flow prediction, however, traffic flows have obvious time-space coupling characteristics and the fixed time window of a multi-scale time mode often have difficulty in synchronously capturing evolution rules of different time scales, so that the prediction accuracy is lower. Accordingly, in order to overcome the technical problems described above, the present invention provides a method, an apparatus, an electronic device, and a storage medium for predicting traffic flow. Disclosure of Invention The invention aims to provide a method and a device for predicting traffic flow, electronic equipment and a storage medium, so as to improve the accuracy of traffic flow prediction. The invention is realized by the following technical scheme: A method for predicting traffic flow includes obtaining historical traffic flow data corresponding to a road network to be predicted, wherein the historical traffic flow data comprise traffic state data corresponding to traffic nodes and time stamp information corresponding to the traffic state data, inputting the historical traffic flow data into a preset traffic flow prediction model to obtain a predicted flow sequence corresponding to the road network to be predicted, extracting multi-source initial features of the historical traffic flow data based on node dimensions, time dimensions and state dimensions, reinforcing the multi-source initial features through a preset backbone network to obtain space-time dependent features, determining a plurality of target time scales according to the space-time dependent features, then compressing the space-time dependent features based on the target time scales respectively, compressing features based on the target time scales, extracting scale time sequence features corresponding to the target time scales based on the scale compressing features, and then obtaining the predicted flow sequence corresponding to the road network to be predicted based on the scale time sequence features corresponding to the target time scales. In some embodiments, the traffic flow prediction model extracts and enhances feature data of the historical traffic flow data based on node dimensions, time dimensions and state dimensions by extracting node index vectors, the timestamp information and the traffic state data corresponding to each traffic node from the historical traffic flow data, obtaining a time index and date independent heat code based on the timestamp information, obtaining a node embedding vector based on the node index vectors, obtaining a time embedding vector based on the time index, obtaining a date embedding vector based on the date independent heat code, obtaining a traffic state embedding vector based on the traffic state data, and determining the sum of the node embedding vector, the time embedding vector, the date embedding vector and the traffic state embedding vector