A method and system for real-time prediction of highway traffic congestion
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-15
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]传统的高速公路交通拥堵预测方法主要依赖于通过高速公路监控摄像头(包括高速进出口门架上的摄像头、路中的测速摄像头以及ETC门架上的摄像头)得到的大数据,这对于靠近监控摄像头的路段交通拥堵预测是非常有效的,但是,因为监控摄像头相对于整个高速公路的长度来说永远不会充足,这就导致其无法对远离监控摄像头的高速公路路段的交通拥堵情况进行可靠预测;或者,传统的高速公路交通拥堵预测方法也有通过车载电子地图软件获取车流量信息并以此作为判断交通拥堵情况的,但也存在一种电子地图只有部分车辆使用以及并非所有车辆都使用和开启电子地图软件等因素而导致数据失真度较大、预测精度不高的问题
[0012] The beneficial effects are as follows: This invention processes the data from highway monitoring cameras and in-vehicle electronic map software separately, and makes traffic congestion predictions for the location of the highway monitoring cameras and the locations between them. Finally, the two prediction results are integrated to achieve the function of judging the traffic congestion trend of highways and completing the comprehensive real-time prediction of highway traffic congestion. This realizes the function of real-time prediction of traffic congestion for the entire highway section and makes up for the defects of large distortion and low prediction accuracy caused by prediction based solely on in-vehicle electronic map software data.
Smart Images

Figure CN122551547A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of high-speed traffic congestion prediction technology, specifically relating to a method and system for real-time prediction of highway traffic congestion. Background Technology
[0002] With the acceleration of urbanization and the continuous growth of car ownership, highways, as an important component of the modern transportation system, play an irreplaceable role in road transport. Their traffic efficiency directly affects the overall operational efficiency of cities and the quality of life of residents. However, highway congestion is becoming increasingly serious, becoming one of the key factors restricting traffic flow. Once highway congestion occurs, it will lead to reduced highway operating efficiency, or even road traffic paralysis, resulting in a series of problems such as economic losses, energy waste, and vehicle exhaust pollution. Therefore, how to quickly and accurately predict highway congestion areas is an urgent problem to be solved.
[0003] In recent years, with the rapid development of big data technology, its application in the field of traffic management has become increasingly widespread. By collecting and analyzing massive amounts of traffic monitoring data, the inherent laws of traffic flow changes can be revealed, providing a scientific basis for congestion prediction.
[0004] Traditional highway traffic congestion prediction methods primarily rely on big data obtained from highway surveillance cameras (including cameras on highway entrance and exit gantries, speed cameras in the road, and cameras on ETC gantries). This is very effective for predicting traffic congestion on sections close to surveillance cameras. However, because the number of surveillance cameras is never sufficient relative to the length of the entire highway, it is impossible to reliably predict traffic congestion on highway sections far from surveillance cameras. Alternatively, traditional highway traffic congestion prediction methods also use vehicle electronic map software to obtain traffic flow information and use it to judge traffic congestion. However, this also suffers from problems such as the fact that electronic maps are only used by some vehicles and not all vehicles use or activate electronic map software, leading to significant data distortion and low prediction accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for real-time prediction of highway traffic congestion that combines multiple factors for comprehensive judgment to improve prediction accuracy, in order to solve the above-mentioned problems.
[0006] The present invention achieves the above objectives through the following technical solutions: A method for real-time prediction of highway traffic congestion includes the following steps: Step 1: Obtain historical data from highway surveillance cameras and calculate the following historical features: traffic flow, average vehicle speed, and the ratio of traffic flow to capacity. Use spectral clustering algorithm to perform cluster analysis on the historical feature data of the cameras to determine the relative classification criteria for four traffic states: smooth traffic, light congestion, moderate congestion, and severe congestion. Finally, obtain a traffic state dataset composed of four clusters. Use the clustered traffic state dataset as input and use the random forest algorithm to build a classification decision model. Use the confusion matrix to quantitatively evaluate the classification effect of the classification decision model. If the classification effect does not meet the user requirements, readjust the model parameters and optimize the algorithm until the classification effect meets the discrimination requirements, and obtain the trained classification decision model. Step 2: Divide the road segments between each monitoring camera on the highway into a grid to obtain a road topology map. Obtain historical data from the in-vehicle electronic map software and extract the historical location feature data of vehicles in the road topology map. Based on the historical location feature data and the graph structure of the road topology map, determine the first-layer nodes, then determine the congestion index features and time feature codes of the first-layer nodes. Extract adjacency relationships from the graph structure of the road topology map and generate an adjacency relationship matrix based on the adjacency relationships. Embed the congestion index features of the first-layer nodes, the time feature codes of the nodes, and the adjacency relationship matrix into the input information to obtain input information including time features and spatial topological features. Based on the input information and the preset propagation layer calculation formula, model the traffic evolution feature sequence of each grid node in the time dimension to obtain a graph neural network model. This step can be performed simultaneously with Step 1 or the order can be interchanged. Step 3: Acquire the following two types of real-time data: real-time data from highway surveillance cameras and real-time data from in-vehicle electronic map software. Use the traffic flow, average vehicle speed, and traffic flow to capacity ratio calculated from the real-time data from highway surveillance cameras as inputs to the classification decision model to achieve real-time traffic congestion prediction at the location of the highway surveillance cameras. Use the real-time location feature data from the real-time data from the in-vehicle electronic map software as inputs to the graph neural network model to achieve real-time traffic congestion prediction at the location between cameras on the highway. Step 4: Based on the real-time traffic congestion prediction results at the locations of highway monitoring cameras and the real-time traffic congestion prediction results at locations between cameras on the highway, determine the traffic congestion trend of the highway and complete the comprehensive real-time prediction of highway traffic congestion.
[0007] Furthermore, in step 1, the method for quantitatively evaluating the classification performance of the classification decision model using the confusion matrix is as follows: Each column of the confusion matrix represents the traffic state for classification decisions. The total number in each column represents the number of data points predicted as that traffic state. Each row represents the actual traffic state. The total number of data points in each row represents the number of data instances for that traffic state. Traffic states are divided into four criteria: smooth traffic, light congestion, moderate congestion, and severe congestion. Four evaluation metrics—precision, accuracy, recall, and F-metric—are introduced into the confusion matrix to characterize classification accuracy from different perspectives, where n jj This represents the number of classification results when both the actual traffic state and the classified traffic state are j = {1, 2, 3, 4}; The formula describing the overall accuracy (Acc) of the traffic state classification decision model is: , Where P is the total number of samples in the test set; Prec describes the percentage of correctly classified results in the traffic condition classification decision model. j The formula is: , where P j The number of test set samples for classifying traffic state j; The accuracy and recall rates (Rec) of each traffic condition classification are described. j The formula is: , where P j The number of test set samples for actual traffic condition j; The formula for the stability F-measure of a classification decision model is: F j It refers to the harmonic mean of the number of test set samples for the actual traffic state j and the number of test set samples for the classified traffic state j.
[0008] Furthermore, in step 1, the method for adjusting model parameters and optimizing the algorithm is as follows: 70% of the data in the traffic state dataset is extracted as a training set and 30% as a test set using a random sampling method, and the training set is input into the constructed traffic state classification decision model.
[0009] Furthermore, in step 2, the graph neural network model is a time-series graph convolutional network, and the congestion index features include traffic flow and average traffic speed.
[0010] Furthermore, the highway monitoring cameras include all entrance and exit cameras of the highway, all speed measurement cameras on the highway, and all ETC gantry cameras on the highway; the in-vehicle electronic map software includes one or more of the following: Gaode Maps, Tencent Maps, Baidu Maps, Beidou Satellite Maps, He Maps, Aowei Interactive Maps, and Google Maps.
[0011] A real-time traffic congestion prediction system for highways includes: The highway surveillance camera data processing module is used to process and calculate the data from the highway surveillance cameras. The congestion prediction module for the location of highway surveillance cameras is used to predict the traffic congestion situation at the location of highway surveillance cameras. The vehicle-mounted electronic map software data processing module is used to process and calculate the data of the vehicle-mounted electronic map software. The highway surveillance camera-connected road congestion prediction module is used to predict traffic congestion in the road sections between highway surveillance cameras. The real-time comprehensive prediction module for highway traffic congestion is used to make real-time comprehensive predictions of highway traffic congestion. The signal output terminal of the highway monitoring camera data processing module is connected to the signal input terminal of the congestion prediction module at the location of the highway monitoring camera. The signal output terminal of the vehicle-mounted electronic map software data processing module is connected to the signal input terminal of the road segment congestion prediction module between the highway monitoring cameras. The signal output terminals of the highway monitoring camera location congestion prediction module and the road segment congestion prediction module between the highway monitoring cameras are respectively connected to the signal input terminal of the real-time comprehensive prediction module for highway traffic congestion.
[0012] The beneficial effects are as follows: This invention processes the data from highway monitoring cameras and in-vehicle electronic map software separately, and makes traffic congestion predictions for the location of the highway monitoring cameras and the locations between them. Finally, the two prediction results are integrated to achieve the function of judging the traffic congestion trend of highways and completing the comprehensive real-time prediction of highway traffic congestion. This realizes the function of real-time prediction of traffic congestion for the entire highway section and makes up for the defects of large distortion and low prediction accuracy caused by prediction based solely on in-vehicle electronic map software data. Attached Figure Description
[0013] Figure 1 This is a flowchart of a real-time prediction method for highway traffic congestion as described in this invention; Figure 2 This is a structural block diagram of a real-time traffic congestion prediction system for highways as described in this invention. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0015] Reference Figure 1 The present invention provides a method for real-time prediction of highway traffic congestion, comprising the following steps: Step 1: Obtain historical data from highway surveillance cameras and calculate the following historical features: traffic flow, average vehicle speed, and the ratio of traffic flow to capacity. Use spectral clustering algorithm to perform cluster analysis on the historical feature data of the cameras to determine the relative classification criteria for four traffic states: smooth traffic, light congestion, moderate congestion, and severe congestion. Finally, obtain a traffic state dataset composed of four clusters. Use the clustered traffic state dataset as input and use the random forest algorithm to build a classification decision model. Use the confusion matrix to quantitatively evaluate the classification effect of the classification decision model. If the classification effect does not meet the user requirements, readjust the model parameters and optimize the algorithm until the classification effect meets the discrimination requirements, and obtain the trained classification decision model. Step 2: Divide the road segments between each monitoring camera on the highway into a grid to obtain a road topology map. Obtain historical data from the in-vehicle electronic map software and extract the historical location feature data of vehicles in the road topology map. Based on the historical location feature data and the graph structure of the road topology map, determine the first-layer nodes, then determine the congestion index features and time feature codes of the first-layer nodes. Extract adjacency relationships from the graph structure of the road topology map and generate an adjacency relationship matrix based on the adjacency relationships. Embed the congestion index features of the first-layer nodes, the time feature codes of the nodes, and the adjacency relationship matrix into the input information to obtain input information including time features and spatial topological features. Based on the input information and the preset propagation layer calculation formula, model the traffic evolution feature sequence of each grid node in the time dimension to obtain a graph neural network model. This step can be performed simultaneously with Step 1 or the order can be interchanged. Step 3: Acquire the following two types of real-time data: real-time data from highway surveillance cameras and real-time data from in-vehicle electronic map software. Use the traffic flow, average vehicle speed, and traffic flow to capacity ratio calculated from the real-time data from highway surveillance cameras as inputs to the classification decision model to achieve real-time traffic congestion prediction at the location of the highway surveillance cameras. Use the real-time location feature data from the real-time data from the in-vehicle electronic map software as inputs to the graph neural network model to achieve real-time traffic congestion prediction at the location between cameras on the highway. Step 4: Based on the real-time traffic congestion prediction results at the locations of highway surveillance cameras and at locations between cameras on the highway, determine the traffic congestion trend of the highway to complete the comprehensive real-time prediction of highway traffic congestion. The specific method for this step can be completed using conventional methods based on the results of Step 3. For example, using the real-time traffic congestion prediction results at the locations of highway surveillance cameras as a benchmark, compare the real-time traffic congestion prediction results at locations between cameras with those at nearby highway surveillance cameras to obtain the traffic congestion trend prediction results for different sections of the highway, ultimately achieving the comprehensive real-time prediction function for traffic congestion across the entire highway.
[0016] Furthermore, in step 1, the method for quantitatively evaluating the classification performance of the classification decision model using the confusion matrix is as follows: Each column of the confusion matrix represents the traffic state for classification decisions. The total number in each column represents the number of data points predicted as that traffic state. Each row represents the actual traffic state. The total number of data points in each row represents the number of data instances for that traffic state. Traffic states are divided into four criteria: smooth traffic, light congestion, moderate congestion, and severe congestion. Four evaluation metrics—precision, accuracy, recall, and F-metric—are introduced into the confusion matrix to characterize classification accuracy from different perspectives, where n jj This represents the number of classification results when both the actual traffic state and the classified traffic state are j = {1, 2, 3, 4}; The formula describing the overall accuracy (Acc) of the traffic state classification decision model is: , Where P is the total number of samples in the test set; Prec describes the percentage of correctly classified results in the traffic condition classification decision model. j The formula is: , where P j The number of test set samples for classifying traffic state j; The accuracy and recall rates (Rec) of each traffic condition classification are described. j The formula is: , where P j The number of test set samples for actual traffic condition j; The formula for the stability F-measure of a classification decision model is: F j It refers to the harmonic mean of the number of test set samples for the actual traffic state j and the number of test set samples for the classified traffic state j.
[0017] Furthermore, in step 1, the method for adjusting model parameters and optimizing the algorithm is as follows: 70% of the data in the traffic state dataset is extracted as a training set and 30% as a test set using a random sampling method, and the training set is input into the constructed traffic state classification decision model.
[0018] Furthermore, in step 2, the graph neural network model is a time-series graph convolutional network, and the congestion index features include traffic flow and average traffic speed.
[0019] Furthermore, the highway monitoring cameras include all entrance and exit cameras of the highway, all speed measurement cameras on the highway, and all ETC gantry cameras on the highway; the in-vehicle electronic map software includes one or more of the following: Gaode Maps, Tencent Maps, Baidu Maps, Beidou Satellite Maps, He Maps, Aowei Interactive Maps, and Google Maps.
[0020] Reference Figure 2 The present invention provides a real-time traffic congestion prediction system for highways, comprising: The highway surveillance camera data processing module is used to process and calculate the data from the highway surveillance cameras. The congestion prediction module for the location of highway surveillance cameras is used to predict the traffic congestion situation at the location of highway surveillance cameras. The vehicle-mounted electronic map software data processing module is used to process and calculate the data of the vehicle-mounted electronic map software. The highway surveillance camera-connected road congestion prediction module is used to predict traffic congestion in the road sections between highway surveillance cameras. The real-time comprehensive prediction module for highway traffic congestion is used to make real-time comprehensive predictions of highway traffic congestion. The signal output terminal of the highway monitoring camera data processing module is connected to the signal input terminal of the congestion prediction module at the location of the highway monitoring camera. The signal output terminal of the vehicle-mounted electronic map software data processing module is connected to the signal input terminal of the road segment congestion prediction module between the highway monitoring cameras. The signal output terminals of the highway monitoring camera location congestion prediction module and the road segment congestion prediction module between the highway monitoring cameras are respectively connected to the signal input terminal of the real-time comprehensive prediction module for highway traffic congestion.
[0021] Note: Terms that exist but are not specifically described in the above content are all existing technologies and are not specifically described in this invention. For example, terms such as traffic flow, average vehicle travel speed, ratio of traffic flow to capacity, clustering method, random forest algorithm, classification decision model, confusion matrix, grid partitioning, road topology map, first-layer node, adjacency matrix, graph neural network model, etc. are all conventional terms in existing technologies.
[0022] Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the present invention. Various changes and modifications can be made to the present invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed.
Claims
1. A method for real-time prediction of highway traffic congestion, characterized in that: Includes the following steps: Step 1: Obtain historical data from highway surveillance cameras and calculate the following historical features: traffic flow, average vehicle speed, and the ratio of traffic flow to capacity. Use spectral clustering algorithm to perform cluster analysis on the historical feature data of the cameras to determine the relative classification criteria for four traffic states: smooth traffic, light congestion, moderate congestion, and severe congestion. Finally, obtain a traffic state dataset composed of four clusters. Use the clustered traffic state dataset as input and use the random forest algorithm to build a classification decision model. Use the confusion matrix to quantitatively evaluate the classification effect of the classification decision model. If the classification effect does not meet the user requirements, readjust the model parameters and optimize the algorithm until the classification effect meets the discrimination requirements, and obtain the trained classification decision model. Step 2: Divide the road segments between each monitoring camera on the highway into a grid to obtain a road topology map. Obtain historical data from the in-vehicle electronic map software and extract the historical location feature data of vehicles in the road topology map. Based on the historical location feature data and the graph structure of the road topology map, determine the first-layer nodes, then determine the congestion index features and time feature codes of the first-layer nodes. Extract adjacency relationships from the graph structure of the road topology map and generate an adjacency relationship matrix based on the adjacency relationships. Embed the congestion index features of the first-layer nodes, the time feature codes of the nodes, and the adjacency relationship matrix into the input information to obtain input information including time features and spatial topological features. Based on the input information and the preset propagation layer calculation formula, model the traffic evolution feature sequence of each grid node in the time dimension to obtain a graph neural network model. This step can be performed simultaneously with Step 1 or the order can be interchanged. Step 3: Acquire the following two types of real-time data: real-time data from highway surveillance cameras and real-time data from in-vehicle electronic map software. Use the traffic flow, average vehicle speed, and traffic flow to capacity ratio calculated from the real-time data from highway surveillance cameras as inputs to the classification decision model to achieve real-time traffic congestion prediction at the location of the highway surveillance cameras. Use the real-time location feature data from the real-time data from the in-vehicle electronic map software as inputs to the graph neural network model to achieve real-time traffic congestion prediction at the location between cameras on the highway. Step 4: Based on the real-time traffic congestion prediction results at the locations of highway monitoring cameras and the real-time traffic congestion prediction results at locations between cameras on the highway, determine the traffic congestion trend of the highway and complete the comprehensive real-time prediction of highway traffic congestion.
2. The method for real-time prediction of highway traffic congestion according to claim 1, characterized in that: In step 1, the method for quantitatively evaluating the classification performance of the classification decision model using the confusion matrix is as follows: Each column of the confusion matrix represents the traffic state for classification decisions. The total number in each column represents the number of data points predicted as that traffic state. Each row represents the actual traffic state. The total number of data points in each row represents the number of data instances for that traffic state. Traffic states are divided into four criteria: smooth traffic, light congestion, moderate congestion, and severe congestion. Four evaluation metrics—precision, accuracy, recall, and F-metric—are introduced into the confusion matrix to characterize classification accuracy from different perspectives, where n jj This represents the number of classification results when both the actual traffic state and the classified traffic state are j = {1, 2, 3, 4}; The formula describing the overall accuracy (Acc) of the traffic state classification decision model is: , Where P is the total number of samples in the test set; Prec describes the percentage of correctly classified results in the traffic condition classification decision model. j The formula is: , where P j The number of test set samples for classifying traffic state j; The accuracy and recall rates (Rec) of each traffic condition classification are described. j The formula is: , where P j The number of test set samples for actual traffic condition j; The formula for the stability F-measure of a classification decision model is: F j It refers to the harmonic mean of the number of test set samples for the actual traffic state j and the number of test set samples for the classified traffic state j.
3. The method for real-time prediction of highway traffic congestion according to claim 2, characterized in that: In step 1, the method for adjusting model parameters and optimizing the algorithm is as follows: 70% of the data in the traffic state dataset is extracted as the training set and 30% as the test set using a random sampling method, and the training set is input into the constructed traffic state classification decision model.
4. The method for real-time prediction of highway traffic congestion according to claim 1, characterized in that: In step 2, the graph neural network model is a time-series graph convolutional network, and the congestion index features include traffic flow and average traffic speed.
5. A method for real-time prediction of highway traffic congestion according to any one of claims 1-4, characterized in that: The highway surveillance cameras include all entrance and exit cameras of the highway, all speed measurement cameras on the highway, and all ETC gantry cameras on the highway; the vehicle-mounted electronic map software includes one or more of the following: Gaode Maps, Tencent Maps, Baidu Maps, Beidou Satellite Maps, He Maps, Aowei Interactive Maps, and Google Maps.
6. A real-time traffic congestion prediction system for highways, characterized in that: include: The highway surveillance camera data processing module is used to process and calculate the data from the highway surveillance cameras. The congestion prediction module for the location of highway surveillance cameras is used to predict the traffic congestion situation at the location of highway surveillance cameras. The vehicle-mounted electronic map software data processing module is used to process and calculate the data of the vehicle-mounted electronic map software. The highway surveillance camera-connected road congestion prediction module is used to predict traffic congestion in the road sections between highway surveillance cameras. The real-time comprehensive prediction module for highway traffic congestion is used to make real-time comprehensive predictions of highway traffic congestion. The signal output terminal of the highway monitoring camera data processing module is connected to the signal input terminal of the congestion prediction module at the location of the highway monitoring camera. The signal output terminal of the vehicle-mounted electronic map software data processing module is connected to the signal input terminal of the road segment congestion prediction module between the highway monitoring cameras. The signal output terminals of the highway monitoring camera location congestion prediction module and the road segment congestion prediction module between the highway monitoring cameras are respectively connected to the signal input terminal of the real-time comprehensive prediction module for highway traffic congestion.