Real-time early warning and dynamic dredging method and system for traffic flow congestion of expressway
Through real -time acquisition and analysis of the monitoring video and network data of highways, using machine vision and predictive models, real -time early warning and dynamic dredging of highway congestion have been achieved, and the problems of high -speed highway congestion are solved. The efficiency and safety of traffic circulation.
Patent Information
- Application Number
- CN202411497549.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The problem of highway congestion is difficult to effectively solve under existing conditions. The existing technology lacks scientific basis and evaluation mechanism, which makes it difficult to evaluate the effect of temporary opening of emergency lanes.
Through real -time acquisition of road monitoring videos and networking data, use machine vision technology to extract traffic flow parameters, combine the traffic flow prediction model and emergency lanes to enable decision -making models to achieve real -time early warning and dynamic dredging.
It improves the timeliness and accuracy of the prediction of traffic flow, and the emergency lanes are scientifically and reasonably enabled, which significantly improves the efficiency and safety of traffic circulation and reduce the continuous congestion time of the road.
Smart Images

Figure CN119380539A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method and system for real-time early warning and dynamic unblocking of traffic congestion on expressways. Background Art
[0002] Highway congestion is an urgent problem to be solved in traffic management. In addition to traffic accidents, the main reason is the bottleneck phenomenon in specific sections, which leads to the gathering of vehicles. Traffic congestion is easy to spread. Some sections of highways, such as ramp entrances and exits or bridge entrances, are prone to congestion due to design and flow problems. In addition, some highways are affected by various factors, with fewer lanes and limited traffic capacity, which is also one of the main factors. The difficulty in solving this problem lies in: not considering the expansion of the road width in the later stage of construction, but only maximizing resource utilization under existing conditions to solve the road congestion problem.
[0003] At present, the solution to the problem of highway congestion mainly focuses on the temporary opening and activation of emergency lanes. In response to emergencies, highways usually set up emergency lanes on the right side for use by vehicles such as engineering rescue, fire rescue and medical rescue. Emergency lanes are prohibited from being occupied under normal circumstances, but under certain conditions, the reasonable temporary activation of emergency lanes can reduce traffic density and prevent congestion. At present, highway management departments mainly rely on video surveillance and managers' experience to decide whether to temporarily open emergency lanes. On the one hand, such an approach is prone to controversy due to the lack of theoretical basis, and on the other hand, it is difficult to evaluate the effect of alleviating congestion.
[0004] Therefore, it is of great theoretical and practical significance to discover the conditions under which congestion is about to occur on specific sections of highways and to evaluate the role of temporarily borrowing emergency lanes in alleviating road congestion. Summary of the invention
[0005] The purpose of the present invention is to prevent large-scale continuous congestion on expressways, relieve the road management pressure of traffic management departments and improve road traffic efficiency, thereby further reducing the incidence of traffic accidents. A real-time early warning and dynamic clearing method and system for expressway traffic congestion are provided. The method extracts and analyzes the traffic flow parameters of the current section in real time based on video data, uses a congestion prediction model to judge the future state of traffic flow, issues a real-time early warning before continuous congestion occurs, and outputs the section location and opening time of the enabled emergency lane through a decision model, so as to conduct a quantitative evaluation and analysis of the road clearing effect.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A method for real-time early warning and dynamic unblocking of highway traffic congestion, comprising the following steps:
[0008] Step 1) Obtain road monitoring video and network data in real time;
[0009] Step 2) extracting and analyzing the current road section traffic flow parameters in real time based on road monitoring video and network data;
[0010] Step 3) Based on the traffic flow parameters, the traffic flow prediction model is used to predict the future state of the traffic flow, and a real-time warning is issued before persistent congestion occurs;
[0011] Step 4) Based on the predicted traffic flow, the emergency lane activation decision model is used to output the road section location and opening time for activating the emergency lane to achieve dynamic unblocking.
[0012] The traffic flow parameters include flow, average speed and density, wherein the flow is the number of vehicles passing a point per unit time at a certain moment, the average speed is the average speed of vehicles passing a point at a certain moment, and the density is the number of vehicles per unit length at a certain place at a certain moment.
[0013] For each observation point, in each time interval Δt, count the number of vehicles passing through the observation point N(t,Δt) to obtain the vehicle flow q(t) in this time period:
[0014]
[0015] Where N(t,Δt) is the total number of vehicles passing the observation point in the time interval [t,t+Δt], and Δt is the time interval;
[0016] For all vehicles passing through the observation point within the time interval Δt, calculate the average speed of the vehicles, that is, the average speed v(t) in this time period:
[0017]
[0018] Among them, v i (t) is the speed of the i-th vehicle when it passes the observation point at time t;
[0019] Using the flow-speed-density relationship in basic traffic flow theory, that is:
[0020] q(t)=k(t)·v(t)
[0021] Derive the density k(t):
[0022]
[0023] Among them, n(t,L) is the total number of vehicles in the road section of length L at time t.
[0024] The step 2) is specifically as follows: extracting traffic flow parameters based on machine vision technology of Yolov8+SORT algorithm, wherein vehicle target detection and recognition are realized by YOLOv8 algorithm, and vehicle tracking is realized by SORT algorithm based on the target detection result. After obtaining the visual positioning information of the vehicle, the position of the detection target in the earth coordinate system is calculated according to the camera principle and the coordinate system conversion relationship, and the object movement speed is further obtained according to the video frame rate; the number of vehicles and speed information are counted in real time at each observation point to generate time series data, the vehicle detection results of the video are aligned with the time axis, and the vehicle flow, density and speed data per minute are generated.
[0025] In the step 3), the traffic flow historical parameter sequences at different observation points are used as input and transmitted to the long short-term memory network and the Transformer network of the traffic flow prediction model for prediction, so as to obtain the traffic flow state information of the monitoring point in the future, which specifically includes the following steps:
[0026] Step 31) Obtain historical traffic flow data set and identify traffic flow information as spatiotemporal sequence
[0027]
[0028] in, They represent the road flow, density and average vehicle speed monitored by the monitoring point at position p at time t respectively;
[0029] Step 32) The traffic flow information at different locations is input into the long short-term memory network, and the internal gated recurrent unit models the long short-term memory mechanism of the information to learn the time dependency of the historical traffic flow data at the current waypoint;
[0030] Step 33) Input the output of the LSTM network at different road points into the Transformer network, and capture the dependencies in different spatial and temporal dimensions through the cross-attention mechanism. By calculating the attention weights of each time and spatial position, the most important time period and road section for the current prediction are identified. Among them, the traffic flow information at the m road point i time Traffic flow information at time j and n road points The attention weight between is expressed as:
[0031]
[0032] in, yes The query vector in Transformer, K j n and V j n They are The key and value vectors in Transformer, d k is the dimension of the implicit feature.
[0033] In the step 3), the traffic flow prediction model parameters are optimized by minimizing the mean square error between the predicted value and the actual value of the traffic flow parameter.
[0034] In step 3), by setting the risk threshold rule, a real-time warning of traffic congestion is achieved:
[0035] Based on historical data analysis and expert experience, risk thresholds for traffic flow are set, including density thresholds and speed thresholds;
[0036] Compare the traffic flow prediction value output by the traffic flow prediction model with the preset risk threshold to determine whether the warning condition is triggered;
[0037] When the warning condition is triggered, detailed warning information is generated, including the warning level and warning content. The warning level is different levels set according to the severity of the congestion risk, and the warning content includes the predicted congestion time, affected road sections and recommended unblocking measures.
[0038] If the predicted traffic density is greater than the preset density threshold or the predicted average speed is less than the preset speed threshold, it is considered that congestion may occur in the future and the warning condition is triggered.
[0039] In step 4), the emergency lane activation decision model continuously optimizes the emergency lane activation decision through reinforcement learning based on the information given by the simulation environment, wherein the simulation environment uses the IDM model and the MOBIL model to configure the traffic behavior, and the IDM model configures the update rule of the vehicle longitudinal speed v(t):
[0040]
[0041] Where a is the acceleration, v is the max is the road speed limit, d i-1 (t) is the distance to the vehicle ahead, T is the safety time interval;
[0042] The MOBIL model is used to handle the behavior when changing lanes:
[0043]
[0044] Among them, P i is the probability of car i changing lanes, F(v i ) is based on the speed v i the effectiveness of calculated lane changes;
[0045] The observation space S set by reinforcement learning is the set of current traffic states, expressed as:
[0046] S={f1,f2,…,f n}
[0047] The action space A is defined as the road section and time of opening the emergency lane, expressed as:
[0048] A={(l1,t1),(l2,t2),…,(l m ,t m )}
[0049] Among them, l j Indicates the section of the emergency lane, t j Indicates the specific time point of activation;
[0050] The reward function R is used to guide the decision network to learn more reasonable and efficient decision-making effects, which is expressed as:
[0051] R=α·E efficiency -β·C cost -γ·C risk
[0052] Among them, E efficiency is an indicator of traffic flow efficiency, C cost is the equipment cost caused by activating the emergency lane, C risk is the potential risk caused by congestion or activation of the emergency lane, and α, β, and γ are weight parameters used to balance the importance of various indicators.
[0053] A real-time early warning and dynamic clearing system for highway traffic congestion, used to implement the above method, the system comprises:
[0054] Data acquisition module: real-time acquisition of road monitoring videos and network data;
[0055] Traffic flow parameter extraction module: extracts and analyzes the current road section traffic flow parameters in real time based on road monitoring videos and network data;
[0056] Traffic flow prediction module: Based on traffic flow parameters, the traffic flow prediction model is used to predict the future state of traffic flow and issue real-time warnings before persistent congestion occurs;
[0057] Traffic unblocking decision module: Based on the predicted traffic flow, the emergency lane activation decision model is used to output the road section location and opening time for activating the emergency lane to achieve dynamic unblocking.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] (1) The present invention improves the precision of real-time statistics of traffic flow parameters (such as flow, density and speed) by integrating advanced machine vision technology.
[0060] (2) A traffic flow prediction model based on the spatiotemporal attention mechanism was developed, which can capture the dynamic changes and temporal characteristics of traffic flow, improve the timeliness and accuracy of traffic status prediction, and thus provide a more scientific basis for traffic management.
[0061] (3) The present invention adopts an emergency lane activation decision model based on reinforcement learning, and realizes dynamic adaptation to traffic flow status through simulation feedback optimization decision-making process. Compared with traditional experience-based decision-making, it has obvious improvements in indicators such as traffic flow efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 is a flow chart of the method of the present invention;
[0063] Figure 2 is a flow chart of the machine vision technology used in the present invention;
[0064] Figure 3 Schematic diagram of traffic flow prediction model based on spatiotemporal attention mechanism;
[0065] Figure 4 Schematic diagram of the reinforcement learning training process for emergency lane activation decision;
[0066] Figure 5 This is a machine vision detection effect diagram in an embodiment of the present invention;
[0067] Figure 6 This is a traffic flow parameter statistical result diagram of an embodiment of the present invention;
[0068] Figure 7 A schematic diagram of the prediction accuracy of the traffic flow prediction model according to an embodiment of the present invention;
[0069] Figure 8 It is a schematic diagram comparing the emergency lane activation decision model according to an embodiment of the present invention and the traditional experience decision model. DETAILED DESCRIPTION
[0070] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0071] The present invention discloses a method and system for real-time early warning and dynamic dredging of traffic congestion on a highway. Using advanced visual processing technology, the video surveillance data of a specific section of the highway is processed in real time, and key traffic parameters such as traffic density, flow, and speed are extracted to form basic data support; a traffic flow prediction model is constructed, and the temporal variation law of traffic parameters is analyzed by using a spatiotemporal attention mechanism to achieve efficient prediction of future congestion status; based on statistical analysis and prediction results, a reasonable risk threshold is set, the traffic flow status is monitored in real time, and an early warning is issued when continuous congestion is about to occur, providing a decision-making basis for the traffic management department; a simulation environment is built, and the decision-making ability of the emergency lane activation of the system is trained by a reinforcement learning algorithm, and the opening strategy of the emergency lane is adjusted dynamically in real time, which improves the traffic efficiency and reduces the duration of congestion compared to traditional human experience decisions. The implementation of the present invention can not only effectively predict and warn of traffic congestion on highways, but also scientifically and rationally activate the emergency lane, provide all-round support for traffic management, and thus significantly improve traffic circulation efficiency and safety.
[0072] Specifically, this embodiment provides a method for real-time warning and dynamic unblocking of highway traffic congestion, such as Figure 1 As shown, the following steps are included:
[0073] Step 1) Obtain road monitoring video and network data in real time.
[0074] Step 2) Extract and analyze the current road section traffic flow parameters in real time based on road monitoring video and network data.
[0075] According to relevant laws and regulations, cameras are installed at certain intervals on highways to monitor traffic conditions. In order to predict possible congestion in advance, it is necessary to conduct in-depth and detailed statistical analysis of the video data observed by the surveillance camera to understand the change pattern of traffic flow parameters over time. In this embodiment, the traffic flow parameters mainly include flow (the number of vehicles passing a point per unit time at a certain moment), density (the number of vehicles per unit length at a certain place at a certain moment) and average speed (the average speed of vehicles passing a point at a certain moment). The specific parameter definitions are as follows:
[0076] (1) Flow rate q(t) expression
[0077] For each observation point, select a time interval Δt (for example, one second) to obtain the vehicle flow in this time period, in units of vehicles per second (veh / s). In each time interval, count the number of vehicles passing through the observation point N(t,Δt), and the flow q(t) is:
[0078]
[0079] Where N(t,Δt) is the total number of vehicles passing the observation point in the time interval [t,t+Δt], and Δt is the time interval.
[0080] (2) Expression of average velocity v(t)
[0081] For all vehicles passing through the observation point within the time interval Δt, calculate the average speed of the vehicles, that is, the average speed during the time period. Unit: kilometers per hour (km / h) or meters per second (n / s). Through video data, the speed v of each vehicle passing through the observation point can be measured. i (t). The expression of average velocity v(t) is:
[0082]
[0083] Among them, v i (t) is the speed of the i-th vehicle when it passes the observation point at time t.
[0084] (3) Density k(t) expression
[0085] Density refers to the number of vehicles per unit length of road at a certain time t, and the unit is vehicle / kilometer (veh / km). Since the observation point can only capture the information of vehicles passing through a certain point, it is difficult to directly calculate the number of vehicles n(t,L) in the road section. Therefore, the flow-speed-density relationship in the basic traffic flow theory is used in the implementation of the present invention, that is:
[0086] q(t)=k(t)·v(t) (3)
[0087] Derive the density k(t):
[0088]
[0089] Among them, n(t,L) is the total number of vehicles in the road section of length L at time t.
[0090] like Figure 2As shown, the above traffic flow parameters are extracted using surveillance cameras based on the machine vision technology of Yolov8+SORT algorithm. Vehicle target detection and recognition are achieved through the YOLOv8 algorithm, and tracking is based on the detection results and achieved through the SORT algorithm. Yolov8 has s\m\l\x versions, among which the Yolov5s version has the smallest model and the fastest speed. Since the present invention is mainly used to detect large targets such as trucks and cars, and requires a faster detection speed, it is chosen to call the open source Yolov8s to achieve target detection. The core of the SORT algorithm, a classic algorithm for multi-target tracking, is Kalman filtering and Hungarian matching. The Kalman filtering algorithm is used to predict the state of the detection frame in the next frame, and the state is matched with the detection result of the next frame to achieve vehicle tracking, and an object will not be detected repeatedly. After obtaining the visual positioning information of the vehicle, according to the camera principle and the coordinate system conversion relationship:
[0091]
[0092] Calculate the position of the detected target in the geodetic coordinate system, and further obtain the object's motion speed based on the video frame rate. c ,Y c ,Z c ] is the position in the camera coordinate system, [f x ,f y ] is the horizontal and vertical focal length of the camera, [c x ,c y ] is the position in the pixel coordinate system, and [u,v] is the horizontal and vertical resolution of the image.
[0093] The detection system at each observation point counts the number of vehicles and speed information in real time, generates time series data, aligns the vehicle detection results of the video with the time axis, and generates vehicle flow, density and speed data every minute.
[0094] Step 3) Based on the traffic flow parameters, the traffic flow prediction model is used to predict the future state of traffic flow and issue a real-time warning before persistent congestion occurs.
[0095] In traffic flow state prediction, traditional fitting models often fail to effectively capture complex spatiotemporal relationships and dynamic changes. Figure 3 As shown, the present invention proposes a method for predicting the future traffic flow state sequence by integrating time and space information. The historical traffic flow parameter sequence at different monitoring points extracted in step 2) is used as input and transmitted to the Long Short-Term Memory (LSTM) network and Transformer network of the traffic flow prediction model for prediction, so as to obtain the traffic flow state information of the monitoring point in the future. Specifically, the following steps are included:
[0096] Step 31) First, obtain the historical traffic flow data set from the national open highway monitoring system and identify the traffic flow information as a spatiotemporal sequence
[0097]
[0098] in, They respectively represent the road flow, density and average vehicle speed monitored by the monitoring point at position p at time t.
[0099] Step 32) The traffic flow information at different locations is input into the LSTM network. The internal Gated Recurrent Unit (GRU) models the LSTM mechanism of the information and learns the time dependency of the historical traffic flow data at the current waypoint. The forget gate f of the GRU unit corresponding to time t t for:
[0100] f t =σ(W f ·[h t-1 ,x t ]+b f ) (7)
[0101] Among them, h t-1 is the hidden state at the previous moment, x t is the original input, W f is the learnable weight corresponding to the hidden layer, b f is bias.
[0102] The input gate in GRU controls the degree of influence of the new input information on the current unit state. It includes a sigmoid activation function, which is used to generate a value between 0 and 1, indicating which values in each unit state should be updated. It is expressed as:
[0103] i t =σ(W i ·[h t-1 ,x t ]+b i ) (8)
[0104]
[0105] Among them, i t is the input gate information, is the cell memory state before updating, C t is the updated cell memory state, W i and W C is the corresponding learnable weight, b i and b C is bias.
[0106] The output gate in the GRU controls the hidden state at the current moment and how the cell state at the next moment affects the final output. It contains a sigmoid activation function to determine which parts of the output state will be activated. It is expressed as:
[0107] o t =σ(W o [h t-1 ,x t ]+b o ) (11)
[0108] h t =o t *tanh(C t ) (12)
[0109] Among them, t is the output gate information, W o is the corresponding learnable weight, b o is bias.
[0110] Step 33) Input the output of the LSTM network at different road points into the Transformer network, and capture the dependencies in different spatial and temporal dimensions through the cross-attention mechanism. By calculating the attention weights of each time and spatial position, the most important time period and road section for the current prediction are identified. For example, during peak hours in the morning and evening, the model will pay more attention to the historical data within this time window. Traffic flow information at time i of road point m Traffic flow information at time j and n road points The attention weight between is expressed as:
[0111]
[0112] in, yes The query vector in Transformer, K j n and V j n They are The key and value vectors in Transformer, d k is the dimension of the implicit feature.
[0113] Step 34) The model is trained by using the historical highway traffic flow data downloaded from the open source platform, and the traffic flow prediction model parameters are optimized by minimizing the mean square error (MSE) between the predicted and actual values of the traffic flow parameters. MSE is expressed as:
[0114]
[0115] Among them, yi and are the actual value and the predicted value respectively.
[0116] By introducing a traffic flow state prediction method based on the spatiotemporal attention mechanism, the prediction accuracy can be effectively improved, providing more reliable data support for subsequent congestion warning and dynamic traffic control.
[0117] Based on the prediction of traffic flow status, this step realizes real-time warning of traffic congestion by setting risk threshold rules, aiming to ensure that warning information is issued in time when the traffic flow status changes, so as to help the traffic management department take corresponding measures.
[0118] First, based on historical data analysis and expert experience, the risk thresholds of traffic flow are set, including the density threshold k critical and speed threshold v critical ;
[0119] Compare the traffic flow prediction value output by the traffic flow prediction model with the preset risk threshold to determine whether the warning condition is triggered;
[0120] When the warning conditions are triggered, detailed warning information is generated, including the warning level and warning content. The warning level is set according to the severity of the congestion risk (such as mild, moderate, and severe). The warning content includes the predicted congestion time, affected road sections, and recommended unblocking measures.
[0121] Specifically, according to expert experience, when the road is congested, the traffic flow parameters are generally characterized by excessive traffic density and low traffic speed. According to the formula q(t) = k(t)·v(t), it can be seen that the traffic volume is uncertain at this time, so only the density threshold k is enabled. critical and speed threshold v critical As the rule judgment standard of risk threshold, the rule is expressed as:
[0122] If the predicted traffic density is greater than the preset density threshold or the predicted average speed is less than the preset speed threshold, that is, k>k critical or v <v critical , it is considered that congestion may occur in the future and the warning condition is triggered. In addition, different congestion warning levels can be divided according to the threshold values by dividing the time periods and spatial segments where the density k and speed v are lower than the threshold values.
[0123] The generated warning information will be quickly transmitted to relevant management departments and drivers through various channels (such as traffic information boards, mobile phone APPs, management center systems, etc.) so that timely response measures can be taken.
[0124] Step 4) Based on the predicted traffic flow, the emergency lane activation decision model is used to output the road section location and opening time for activating the emergency lane to achieve dynamic unblocking.
[0125] In highway traffic management, the early warning system mainly relies on threshold judgment, which can quickly identify potential congestion. However, the decision to activate the emergency lane is much more complicated. It not only involves the changes in real-time traffic flow, but also needs to consider the notification time of the management department, the driver's response time and the actual activation effect. Therefore, in order to solve the problem that traditional empirical decision-making methods are difficult to effectively deal with these complex factors, the present invention introduces reinforcement learning (RL) and simulation feedback mechanism, and uses the self-learning and evolutionary capabilities of RL to make more reasonable and efficient decisions.
[0126] To support the training of reinforcement learning models, the present invention constructs a high-fidelity highway simulation environment. This environment uses the IDM model and the MOBIL (Minimizing Overall Braking Induced by Lane changes) model to configure traffic behavior. The IDM model configures the update rule of the vehicle longitudinal velocity v(t):
[0127]
[0128] Where a is the acceleration, v is the max is the road speed limit, d i-1 (t) is the distance to the vehicle ahead and T is the safety time interval.
[0129] The MOBIL model is used to handle the behavior when changing lanes:
[0130]
[0131] Among them, P i is the probability of car i changing lanes, F(v i ) is based on the speed v i Computed lane change effectiveness.
[0132] In the simulation environment, the observation space S set by reinforcement learning is the set of current traffic states, expressed as:
[0133] S={f1,f2,…,f n} (17)
[0134] The action space A is defined as the road section and time of opening the emergency lane, expressed as:
[0135] A={(l1,t1),(l2,t2),…,(l m ,t m )} (18)
[0136] Among them, l jIndicates the section of the emergency lane, t j Indicates the specific time point of activation.
[0137] The reward function R is used to guide the decision network to learn more reasonable and efficient decision-making effects, which is expressed as:
[0138] R=α·E efficiency -β cost -γ·C risk (19)
[0139] Among them, E efficiency It is an indicator of traffic flow efficiency, such as vehicle throughput rate; C cost is the equipment cost caused by activating the emergency lane, C risk is the potential risk caused by congestion or activation of the emergency lane (such as obstructing rescue vehicles), and α, β, and γ are weight parameters used to balance the importance of each indicator.
[0140] like Figure 4 As shown in the figure, during the training process, the model continuously improves its strategy through interaction with the simulation environment. The reinforcement learning algorithm calculates rewards based on the observed states and actions taken, and adjusts the strategy through feedback, gradually learning effective emergency lane activation decision instructions. This process ensures that the model can adapt to different traffic conditions and has significantly improved indicators such as traffic flow efficiency compared to traditional experience-based decision-making.
[0141] This embodiment also provides a real-time early warning and dynamic unblocking system for highway traffic congestion, which is used to implement the above method. The system includes:
[0142] Data acquisition module: real-time acquisition of road monitoring videos and network data;
[0143] Traffic flow parameter extraction module: extracts and analyzes the current road section traffic flow parameters in real time based on road monitoring videos and network data;
[0144] Traffic flow prediction module: Based on traffic flow parameters, the traffic flow prediction model is used to predict the future state of traffic flow and issue real-time warnings before persistent congestion occurs;
[0145] Traffic unblocking decision module: Based on the predicted traffic flow, the emergency lane activation decision model is used to output the road section location and opening time for activating the emergency lane to achieve dynamic unblocking.
[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0147] Based on the above method and system, this embodiment provides the following example to illustrate the effectiveness of the present invention.
[0148] First, obtain the surveillance video on the highway section that needs to be managed. Taking the surveillance video data of several cameras near a service area on the Ninghang Expressway as an example, the present invention transmits the video to the visual processing module based on Yolov8+SORT technology. The average inference time per frame is less than 0.005 seconds, demonstrating the excellent real-time performance of the machine vision technology proposed in the present invention. Figure 5 As shown, the visual processing module has an extremely low missed detection rate for target detection and accurate vehicle classification, demonstrating excellent accuracy and robustness.
[0149] Secondly, after the video data is processed by machine vision technology, the system will count and calculate traffic flow parameters (flow, density and average speed) in real time. These parameters are stored in the database and updated in real time for subsequent analysis and decision-making. The statistical parameters change over time. Figure 6 shown.
[0150] Then, a temporal attention mechanism neural network based on LSTM and Transformer is constructed, and the extracted traffic flow is divided into data training set, test set and validation set. The gated recurrent unit in the LSTM network contains short-term memory gate, long-term memory gate and forget gate to extract the temporal information under a single waypoint. Transformer adopts a multi-head cross attention mechanism, the implicit feature vector dimension of the encoder is 512, the position encoding adopts cosine encoding, and the multi-head cross attention mechanism projects the implicit features into 8 different vector spaces. The decoder adopts a multi-layer perceptron model, in which the number of hidden layer nodes is 2048. The loss function during network training is constructed as the mean square error loss between the real traffic flow data and the predicted traffic flow data, and the training batch size is set to 128. Figure 7 The comparison between the predicted value and the true value on the validation set after training 5000 batches is shown. At this time, the prediction error of the model is less than 0.5%, indicating that the temporal attention mechanism can effectively capture the coupling relationship between different waypoints in different time periods.
[0151] Furthermore, different levels of risk thresholds are set for real-time congestion warning driven by risk threshold rules. Take the traffic conditions of the road section near the service area during holidays as an example:
[0152] 1. Density threshold (unit: vehicles / km):
[0153] i. Mild congestion: more than 30 vehicles / km
[0154] ii. Moderate congestion: more than 50 vehicles / km
[0155] iii. Severe congestion: more than 70 vehicles / km
[0156] 2. Speed threshold (unit: km / h):
[0157] i. Mild congestion: less than 60km / h
[0158] ii. Moderate congestion: less than 40km / h
[0159] iii. Severe congestion: less than 20km / h
[0160] When the congestion levels determined by the two criteria are inconsistent, the higher level is taken as the final result. For example, when the density threshold determines that the congestion is mild and the speed threshold determines that the congestion is moderate, the final output congestion level is moderate.
[0161] Finally, the emergency lane activation decision model is trained using a reinforcement learning algorithm. The system proposed in the present invention is simulated and verified in a highway simulation environment. The simulation environment is initialized based on the current traffic flow monitoring, and the same traffic flow as in reality is configured in the simulator. The emergency lane activation decision system will output emergency lane opening instructions (whether to open, opening time, and open sections) according to the policy network in the reinforcement learning algorithm. The traffic in the simulator will enter or leave the emergency lane at the specified time according to the decision instructions, and the traffic status will be fed back to the reinforcement learning algorithm to update the policy network. The policy network update aims to maximize the reward function, and the loss function is defined as:
[0162]
[0163] in, is the advantage function, θ is the parameter of the policy network, and ε is the parameter that allows the new and old policy networks to offset. The policy network parameters are iteratively updated using the gradient descent method, and trained using two reinforcement learning algorithms, Proximal Policy Optimization (PPO) and Soft Actor-Critic (SAC). The loss curve of the decision model converges to zero after 70,000 steps.
[0164] The emergency lane activation decision model based on reinforcement learning simulation feedback mechanism used in the present invention is compared with the traditional artificial experience decision model through simulation experiments. Figure 8 As shown, the model of the present invention can reduce the duration of road congestion by nearly half.
[0165] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for real-time early warning and dynamic unblocking of highway traffic congestion, characterized in that: The following steps are involved: Step 1) Obtain road monitoring video and network data in real time; Step 2) extracting and analyzing the current road section traffic flow parameters in real time based on road monitoring video and network data; Step 3) Based on the traffic flow parameters, the traffic flow prediction model is used to predict the future state of the traffic flow, and a real-time warning is issued before persistent congestion occurs; Step 4) Based on the predicted traffic flow, the emergency lane activation decision model is used to output the road section location and opening time for activating the emergency lane to achieve dynamic unblocking.
2. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 1, characterized in that: The traffic flow parameters include flow, average speed and density, wherein the flow is the number of vehicles passing a point per unit time at a certain moment, the average speed is the average speed of vehicles passing a point at a certain moment, and the density is the number of vehicles per unit length at a certain place at a certain moment.
3. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 2, characterized in that: For each observation point, in each time interval Δt, count the number of vehicles passing through the observation point N(t,Δt) to obtain the vehicle flow q(t) in this time period: Where N(t,Δt) is the total number of vehicles passing the observation point in the time interval [t,t+Δt], and Δt is the time interval; For all vehicles passing through the observation point within the time interval Δt, calculate the average speed of the vehicles, that is, the average speed v(t) in this time period: Among them, v i (t) is the speed of the i-th vehicle when it passes the observation point at time t; Using the flow-speed-density relationship in basic traffic flow theory, that is: q(t)=k(t)·v(t) Derive the density k(t): Among them, n(t,L) is the total number of vehicles in the road section of length L at time t.
4. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 1, characterized in that: The step 2) is specifically as follows: extracting traffic flow parameters based on machine vision technology of Yolov8+SORT algorithm, wherein vehicle target detection and recognition are realized by YOLOv8 algorithm, and vehicle tracking is realized by SORT algorithm based on the target detection result. After obtaining the visual positioning information of the vehicle, the position of the detection target in the earth coordinate system is calculated according to the camera principle and the coordinate system conversion relationship, and the object movement speed is further obtained according to the video frame rate; the number of vehicles and speed information are counted in real time at each observation point to generate time series data, the vehicle detection results of the video are aligned with the time axis, and the vehicle flow, density and speed data per minute are generated.
5. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 1, characterized in that: In the step 3), the traffic flow historical parameter sequences at different observation points are used as input and transmitted to the long short-term memory network and the Transformer network of the traffic flow prediction model for prediction, so as to obtain the traffic flow state information of the monitoring point in the future, which specifically includes the following steps: Step 31) Obtain historical traffic flow data set and identify traffic flow information as spatiotemporal sequence in, They represent the road flow, density and average vehicle speed monitored by the monitoring point at position p at time t respectively; Step 32) The traffic flow information at different locations is input into the long short-term memory network, and the internal gated recurrent unit models the long short-term memory mechanism of the information to learn the time dependency of the historical traffic flow data at the current waypoint; Step 33) Input the output of the LSTM network at different road points into the Transformer network, and capture the dependencies in different spatial and temporal dimensions through the cross-attention mechanism. By calculating the attention weights of each time and spatial position, the most important time period and road section for the current prediction are identified. Among them, the traffic flow information at the m road point i time Traffic flow information at time j and n road points The attention weight between is expressed as: in, yes The query vector in Transformer, K j n and V j n They are The key and value vectors in Transformer, d k is the dimension of the implicit feature.
6. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 5, characterized in that: In the step 3), the traffic flow prediction model parameters are optimized by minimizing the mean square error between the predicted value and the actual value of the traffic flow parameter.
7. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 2, characterized in that: In step 3), by setting the risk threshold rule, a real-time warning of traffic congestion is achieved: Based on historical data analysis and expert experience, risk thresholds for traffic flow are set, including density thresholds and speed thresholds; Compare the traffic flow prediction value output by the traffic flow prediction model with the preset risk threshold to determine whether the warning condition is triggered; When the warning condition is triggered, detailed warning information is generated, including the warning level and warning content. The warning level is different levels set according to the severity of the congestion risk, and the warning content includes the predicted congestion time, affected road sections and recommended unblocking measures.
8. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 7, characterized in that: If the predicted traffic density is greater than the preset density threshold or the predicted average speed is less than the preset speed threshold, it is considered that congestion may occur in the future and the warning condition is triggered.
9. A method for real-time early warning and dynamic unblocking of highway traffic congestion according to claim 1, characterized in that: In step 4), the emergency lane activation decision model continuously optimizes the emergency lane activation decision through reinforcement learning based on the information given by the simulation environment, wherein the simulation environment uses the IDM model and the MOBIL model to configure the traffic behavior, and the IDM model configures the update rule of the vehicle longitudinal speed v(t): Where a is the acceleration, v is the max is the road speed limit, d i-1 (t) is the distance to the vehicle ahead, T is the safety time interval; The MOBIL model is used to handle the behavior when changing lanes: Among them, P i is the probability of car i changing lanes, F(v i ) is based on the speed v i the effectiveness of calculated lane changes; The observation space S set by reinforcement learning is the set of current traffic states, expressed as: S={f1,f2,…,f n } The action space A is defined as the road section and time of opening the emergency lane, expressed as: A={(l1,t1),(l2,t2),...,(l m ,t m )} Among them, l j Indicates the section of the emergency lane, t j Indicates the specific time point of activation; The reward function R is used to guide the decision network to learn more reasonable and efficient decision-making effects, which is expressed as: R=α·E efficiency -β·C cosi -γ·C risk Among them, E efficiency is an indicator of traffic flow efficiency, C cost is the equipment cost caused by activating the emergency lane, C risk is the potential risk caused by congestion or activation of the emergency lane, and α, β, and γ are weight parameters used to balance the importance of various indicators.
10. A real-time warning and dynamic clearing system for highway traffic congestion, characterized in that: For implementing the method according to any one of claims 1 to 9, the system comprises: Data acquisition module: real-time acquisition of road monitoring videos and network data; Traffic flow parameter extraction module: extracts and analyzes the current road section traffic flow parameters in real time based on road monitoring videos and network data; Traffic flow prediction module: Based on traffic flow parameters, the traffic flow prediction model is used to predict the future state of traffic flow and issue real-time warnings before persistent congestion occurs; Traffic unblocking decision module: Based on the predicted traffic flow, the emergency lane activation decision model is used to output the road section location and opening time for activating the emergency lane to achieve dynamic unblocking.
Citation Information
Patent Citations
Method and device for automatically detecting tunnel traffic jam events based on video
CN104464307A
Automatic driving lane changing decision control method based on rule fusion reinforcement learning
CN115257745A
AI traffic signal optimization method based on high-altitude panoramic video
CN117152971A
Sleeper life prediction method based on time series data feature fusion
CN117370783A
Ramp confluence area mixed traffic flow control method based on time-space diagram neural network reinforcement learning
CN117636651A
Cited By
Expressway severe weather congestion node prediction method and emergency response system
CN119694136A
Road traffic jam prediction method, computer equipment and readable storage medium
CN120412270A
Road traffic state real-time monitoring method and system
CN121236930A