Online space-time traffic flow prediction method
By building a cloud-edge collaborative network, using self-supervised learning and Transformer mechanism traffic flow prediction model, the accuracy and real-time problems of traditional methods when dealing with complex traffic conditions are solved, and high-precision and high-real-time traffic flow prediction are achieved , supports the effective management of intelligent transportation systems.
Patent Information
- Application Number
- CN202411190266.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional traffic flow prediction methods are difficult to accurately capture complex and changeable traffic conditions. A single computing center lacks computing resources and high network delays when processing massive real-time data, making it difficult to meet the requirements of intelligent transportation systems for high real-time and high reliability.
Build a cloud-edge collaborative network, use the central cloud to build a traffic flow prediction model based on self-supervised learning and Transformer mechanism, and the edge cloud collects data in real time and transmits it to the central cloud for processing and analysis, improves prediction accuracy through data cleaning and standardized processing, and Update the model according to the set period.
It realizes accurate time-space traffic flow prediction, improves the prediction accuracy and real-time nature of traffic flow, provides strong decision-making support for traffic management, alleviates urban traffic congestion problems, and improves citizens' travel experience.
Smart Images

Figure CN119169811A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of traffic technology, and in particular to an online spatiotemporal traffic flow prediction method. Background Art
[0002] In the context of the development of intelligent transportation systems, with the acceleration of urbanization and the continuous increase in the number of vehicles, problems such as traffic congestion, frequent accidents and environmental pollution are becoming increasingly serious. In order to effectively respond to these challenges and improve the operating efficiency and safety of the transportation system, it is imperative to build an efficient and intelligent traffic management system. Among them, traffic flow prediction, as a core component of the intelligent transportation system, is of vital importance for realizing intelligent control of traffic signals, path planning and navigation, and emergency response.
[0003] Traditional traffic flow prediction methods mainly rely on time series analysis of historical traffic data or simple statistical models. These methods are incapable of coping with complex and changeable traffic conditions and it is difficult to accurately capture the dynamic characteristics of traffic flow. In recent years, with the rapid development of artificial intelligence technology, especially the rise of deep learning technology, new ideas and methods have been provided for traffic flow prediction. In particular, the application of self-supervised learning and Transformer mechanism provides a powerful tool for processing large-scale, high-dimensional traffic data. It can automatically learn complex spatiotemporal dependencies from data and significantly improve the accuracy and real-time performance of traffic flow prediction.
[0004] However, a single computing center (such as a traditional data center) often faces problems such as insufficient computing resources and high network latency when processing massive, real-time traffic data, making it difficult to meet the requirements of intelligent transportation systems for high real-time performance and high reliability. Summary of the invention
[0005] The purpose of the present invention is to provide an online spatiotemporal traffic flow prediction method which can achieve accurate prediction.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] An online spatiotemporal traffic flow prediction method, comprising:
[0008] Constructing a cloud-edge collaborative network; the cloud-edge collaborative network includes a central cloud and multiple edge clouds connected to the central cloud; the central cloud is used to construct a traffic flow prediction model based on self-supervised learning and Transformer mechanism; each edge cloud is used to collect traffic data in real time;
[0009] After the current traffic data collected by each edge cloud is input into the traffic flow prediction model, the traffic flow prediction model performs spatiotemporal prediction to obtain the traffic flow prediction result at the current moment, and updates the traffic flow prediction model according to the set period.
[0010] Optionally, the construction process of the traffic flow prediction model includes:
[0011] Acquire initial training data; the initial training data includes traffic training data and corresponding labels;
[0012] Build a pre-trained model based on self-supervised learning and Transformer mechanism;
[0013] The initial training data is input into the pre-training model, and the loss between the model output result and the label is minimized. The training is performed according to the gradient descent strategy, and the trained model is determined as the traffic flow prediction model.
[0014] Optionally, the traffic flow prediction model adopts Huber loss during training.
[0015] Optionally, the traffic flow prediction model includes an encoder, and the output of the encoder is used as the input of a non-adaptive decoder and an adaptive decoder respectively; the non-adaptive decoder and the adaptive decoder respectively calculate the prediction loss and the adaptive loss, and back-propagate the prediction loss and the adaptive loss to the encoder to update the parameters of the encoder.
[0016] Optionally, it also includes: displaying the traffic flow prediction result in the form of a seaweed ball; wherein the seaweed ball includes multiple colors, and each color is used to display the traffic flow prediction result in a corresponding interval according to a set threshold interval.
[0017] Optionally, before inputting the current traffic data collected by each edge cloud into the traffic flow prediction model, it also includes: performing data cleaning and data standardization processing on the traffic-related data in sequence.
[0018] Optionally, the data cleaning includes: removing outliers and missing values, smoothing the data, and eliminating noise interference.
[0019] Optionally, the data standardization processing includes: standardizing the data to eliminate the influence of different dimensions on the model.
[0020] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0021] The present invention discloses an online spatiotemporal traffic flow prediction method, the method comprising constructing a cloud-edge collaborative network; the cloud-edge collaborative network comprises a central cloud and a plurality of edge clouds connected to the central cloud; the central cloud is used to construct a traffic flow prediction model based on self-supervised learning and a Transformer mechanism; each edge cloud is used to collect traffic data in real time; after the traffic data at the current moment collected by each edge cloud is input into the traffic flow prediction model, the traffic flow prediction model performs spatiotemporal prediction to obtain the traffic flow prediction result at the current moment, and updates the traffic flow prediction model according to a set period. The present invention can achieve accurate prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0023] Figure 1 It is a schematic diagram of the process of the online spatiotemporal traffic flow prediction method of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The purpose of the present invention is to provide an online spatiotemporal traffic flow prediction method which can achieve accurate prediction.
[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] like Figure 1 As shown, the present invention provides an online spatiotemporal traffic flow prediction method, comprising:
[0028] Step 100: construct a cloud-edge collaborative network; the cloud-edge collaborative network includes a central cloud and multiple edge clouds connected to the central cloud; the central cloud is used to construct a traffic flow prediction model based on self-supervised learning and Transformer mechanism; each edge cloud is used to collect traffic data in real time;
[0029] Step 200: After the current traffic data collected by each edge cloud is input into the traffic flow prediction model, the traffic flow prediction model performs spatiotemporal prediction to obtain the traffic flow prediction result at the current moment, and updates the traffic flow prediction model according to the set period.
[0030] As a specific implementation, the construction process of the traffic flow prediction model includes:
[0031] Acquire initial training data; the initial training data includes traffic training data and corresponding labels;
[0032] Build a pre-trained model based on self-supervised learning and Transformer mechanism;
[0033] The initial training data is input into the pre-training model, and the loss between the model output result and the label is minimized. The training is performed according to the gradient descent strategy, and the trained model is determined as the traffic flow prediction model.
[0034] The traffic flow prediction model adopts Huber loss during training.
[0035] As a specific implementation, the traffic flow prediction model includes an encoder, and the output of the encoder is used as the input of a non-adaptive decoder and an adaptive decoder respectively; the non-adaptive decoder and the adaptive decoder respectively calculate the prediction loss and the adaptive loss, and back-propagate the prediction loss and the adaptive loss to the encoder to update the parameters of the encoder.
[0036] After obtaining the traffic flow prediction result at the current moment, it also includes: displaying the traffic flow prediction result in the form of a seaweed ball; wherein the seaweed ball includes multiple colors, each of the colors is used to display the traffic flow prediction result in a corresponding interval according to a set threshold interval.
[0037] As a specific implementation method, before the current traffic data collected by each edge cloud is input into the traffic flow prediction model, it also includes: performing data cleaning and data standardization processing on the traffic-related data in sequence.
[0038] The data cleaning includes: removing outliers and missing values, smoothing the data, and eliminating noise interference; the data standardization includes: standardizing the data to eliminate the influence of different dimensions on the model.
[0039] Based on the above technical solution, the following embodiments are provided.
[0040] 1. Build a cloud-edge collaborative network
[0041] Central Cloud: Deployed in the city’s central data center, it is responsible for building and maintaining a traffic flow prediction model based on self-supervised learning and the Transformer mechanism. The model is trained and optimized using the city’s historical traffic data and real-time collected data.
[0042] As the core of data processing and model calculation, the central cloud uses powerful computing power and abundant storage resources to build and maintain a traffic flow prediction model based on self-supervised learning and Transformer mechanism. It can process massive real-time traffic data from the edge cloud and perform complex calculations and analysis.
[0043] Edge cloud: Multiple edge cloud nodes are deployed at the main traffic nodes in the city (such as highway entrances, major intersections, transportation hubs, etc.), responsible for collecting real-time traffic data in the area, including traffic volume, vehicle speed, road occupancy rate, etc.
[0044] Edge cloud is deployed at key nodes of the traffic network, responsible for real-time collection and preliminary processing of traffic data. These edge cloud nodes can quickly respond to changes in traffic conditions and transmit data to the central cloud in real time to provide the latest input for the model.
[0045] Through high-speed network connection, low-latency, high-bandwidth data transmission can be achieved between the edge cloud and the central cloud, ensuring that real-time traffic data can reach the central cloud in time for processing. The central cloud further processes and analyzes the received data, including data cleaning, standardization, and feature extraction, to improve the accuracy and efficiency of model prediction.
[0046] 2. Construction of traffic flow prediction model
[0047] Data preparation: Obtain initial training data from the historical traffic database, including traffic flow data of different time periods and road sections and their corresponding actual traffic labels.
[0048] Model pre-training: Based on self-supervised learning and the Transformer mechanism, a pre-trained model is built on the central cloud. This model can automatically learn the spatiotemporal dependencies in traffic data.
[0049] Among them, self-supervised learning is a method of learning by using the characteristics of the data itself, which does not require additional label information. In traffic flow prediction, self-supervised learning can help the model automatically learn the spatiotemporal dependencies and potential patterns of traffic flow from massive traffic data. Through self-supervised learning, the model can better understand the changing patterns of traffic flow, thereby improving the accuracy of prediction.
[0050] Moreover, Transformer is a deep learning model based on the self-attention mechanism, which has excellent performance in processing sequence data. In traffic flow prediction, Transformer can capture the long-term temporal dependencies and complex spatial correlations of traffic flow. By introducing the Transformer mechanism into the traffic flow prediction model, the system can more accurately predict the changing trend and distribution of future traffic flow.
[0051] Model training: The initial training data is input into the pre-trained model, the Huber loss function is used to evaluate the difference between the model output and the actual label, and the gradient descent strategy is used for iterative optimization until the model converges.
[0052] The model is trained using cleaned and standardized data, and model parameters are adjusted through optimization algorithms such as gradient descent to minimize the difference between the model output and the actual label. During the training process, appropriate loss functions such as the Huber loss function are used to evaluate the model performance, and the model is iteratively optimized based on the training results.
[0053] 3. Real-time traffic data collection and prediction
[0054] Data collection: Each edge cloud node collects the current traffic data in real time and performs preliminary data cleaning and standardization, including removing outliers and missing values, smoothing data to reduce noise interference, and standardizing data to eliminate the impact of different dimensions.
[0055] Data upload: The cleaned and standardized traffic data is transmitted to the central cloud via a high-speed network.
[0056] Model prediction: The traffic flow prediction model of the central cloud receives data from the edge cloud, performs spatiotemporal prediction, and generates traffic flow prediction results at the current moment.
[0057] Model update: According to the set period (such as daily or weekly), the central cloud uses the newly collected data to update the traffic flow prediction model to maintain the accuracy and timeliness of the model. Through strategies such as online learning and adaptive learning, the model can continuously adapt to changes in traffic conditions and improve the real-time and accuracy of the prediction.
[0058] 4. Visualization of prediction results
[0059] Seaweed ball display: In order to intuitively display the traffic flow prediction results, the system uses seaweed balls for visualization. The seaweed ball consists of multiple color areas, each of which corresponds to a traffic flow threshold interval. The system maps the traffic flow of the corresponding road section to the corresponding color area based on the prediction results, allowing traffic managers to understand the current and future traffic conditions at a glance.
[0060] Therefore, the method in this embodiment has the following effects: significantly improves the prediction accuracy and real-time performance of urban traffic flow, and provides strong decision-making support for traffic management departments. By timely adjusting traffic signal control, optimizing route planning, issuing traffic warnings and other measures, it effectively alleviates urban traffic congestion and improves the travel experience of citizens. At the same time, the system is also highly scalable and flexible, and can adapt to the needs of different cities and different traffic scenarios, providing strong support for the construction of intelligent transportation systems.
[0061] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0062] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. An online spatiotemporal traffic flow prediction method, characterized in that: include: Build a cloud-edge collaborative network; The cloud-edge collaborative network includes a central cloud and multiple edge clouds connected to the central cloud; the central cloud is used to build a traffic flow prediction model based on self-supervised learning and Transformer mechanism; each edge cloud is used to collect traffic data in real time; After the current traffic data collected by each edge cloud is input into the traffic flow prediction model, the traffic flow prediction model performs spatiotemporal prediction to obtain the traffic flow prediction result at the current moment, and updates the traffic flow prediction model according to the set period.
2. The online spatiotemporal traffic flow prediction method according to claim 1, characterized in that: The construction process of the traffic flow prediction model includes: Acquire initial training data; the initial training data includes traffic training data and corresponding labels; Build a pre-trained model based on self-supervised learning and Transformer mechanism; The initial training data is input into the pre-training model, and the loss between the model output result and the label is minimized. The training is performed according to the gradient descent strategy, and the trained model is determined as the traffic flow prediction model.
3. The online spatiotemporal traffic flow prediction method according to claim 2, characterized in that: The traffic flow prediction model adopts Huber loss during training.
4. The online spatiotemporal traffic flow prediction method according to claim 1, characterized in that: The traffic flow prediction model includes an encoder, the output of the encoder is used as the input of a non-adaptive decoder and an adaptive decoder respectively; the non-adaptive decoder and the adaptive decoder respectively calculate the prediction loss and the adaptive loss, and back-propagate the prediction loss and the adaptive loss to the encoder to update the parameters of the encoder.
5. The online spatiotemporal traffic flow prediction method according to claim 1, characterized in that: Also includes: The traffic flow prediction result is displayed in the form of a seaweed ball; wherein the seaweed ball includes a plurality of colors, each of the colors is used to display the traffic flow prediction result in a corresponding interval according to a set threshold interval.
6. The online spatiotemporal traffic flow prediction method according to claim 1, characterized in that: Before inputting the current traffic data collected by each edge cloud into the traffic flow prediction model, it also includes: performing data cleaning and data standardization processing on the traffic-related data in sequence.
7. The online spatiotemporal traffic flow prediction method according to claim 6, characterized in that: The data cleaning includes: removing outliers and missing values, smoothing the data, and eliminating noise interference.
8. The online spatiotemporal traffic flow prediction method according to claim 6, characterized in that: The data standardization process includes: performing standardization on the data to eliminate the influence of different dimensions on the model.
Citation Information
Cited By
Urban traffic prediction method and device and electronic equipment
CN121483037A
Method of processing road traffic data using a generative pre-trained transformer (GPT)
WO2026188583A1
