Traffic control method, system, storage medium and electronic device
Through the autoregressive differential moving average model and real-time vehicle data, the traffic light cycle is dynamically adjusted, which solves the problem of low flexibility in the existing traffic light control mechanism, and achieves efficient response to complex traffic conditions and resource optimization.
Patent Information
- Application Number
- CN202410110535.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-25
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-01-25
AI Technical Summary
The existing traffic light control mechanism lacks flexibility and automation, and cannot effectively deal with complex and changing traffic conditions, resulting in poor information circulation and waste of resources.
The autoregressive differential moving average model is used to process historical traffic data, predict traffic information, and combine real-time vehicle data to dynamically adjust the traffic light cycle time and lighting strategy to generate a high-flexible signal light lighting strategy.
It has achieved high flexibility in adapting to complex traffic conditions, automatically adjusting traffic lights, making full use of traffic data, and improving the efficiency of traffic flow and resource utilization.
Smart Images

Figure CN117894196B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, system, storage medium and electronic device for traffic control. Background Art
[0002] The current mainstream control mechanism for traffic lights is timing control, which means that traffic lights operate according to a pre-set timing plan, also known as fixed-cycle control. Timing control is suitable for intersections with relatively stable traffic volume, and is generally based on single-stage timing control, that is, only one timing plan is used per day. For intersections with large changes in traffic volume, multi-stage timing control can be used, that is, different timing plans are used according to traffic volume in different time periods, but the flexibility to deal with complex traffic conditions is still limited.
[0003] With the continuous development of science and technology, it is becoming easier to collect and obtain road traffic information. At present, the relevant departments for traffic information collection have collected a large amount of traffic road information data in recent years, but they are unable to make full use of these data. The existing traffic light control system lacks intelligent and automated means, and cannot monitor and analyze complex and changeable traffic conditions in real time, resulting in poor information flow and waste of resources. Summary of the invention
[0004] In view of this, the purpose of the present disclosure is to propose a method, system, storage medium and electronic device for traffic control, which solve the problems of low flexibility and low automation of the control mechanism of traffic lights.
[0005] In order to achieve one of the above disclosed purposes, the present disclosure provides a method for traffic control, the method comprising:
[0006] Acquire and preprocess historical traffic information to obtain historical traffic data, wherein the historical traffic data includes a time series and traffic data arranged according to the time series;
[0007] Based on the historical traffic data, obtaining the difference order of the time series;
[0008] Calculating the autocorrelation function and partial autocorrelation function of the time series, and confirming the autoregressive order and the moving average order;
[0009] Constructing an autoregressive difference moving average model according to the difference order, the autoregressive order and the moving average order;
[0010] Based on the autoregressive difference moving average model, a traffic light cycle time is obtained;
[0011] Collect real-time traffic video and its video frames, and obtain the vehicle area in the video frame;
[0012] The vehicle position and predicted speed are obtained through the vehicle area in the adjacent video frames;
[0013] Based on the traffic light cycle time and the predicted speed, the green wave band length is calculated and a signal light lighting strategy is generated.
[0014] As a further improvement of an embodiment of the present disclosure, obtaining the difference order of the time series based on the historical traffic data includes:
[0015] Determining whether the time series is stationary, and in response to the time series being non-stationary, performing a difference operation on the time series;
[0016] Perform N difference operations on the time series until the time series is stationary, where N is the difference order of the time series.
[0017] As a further improvement of an embodiment of the present disclosure, after obtaining the difference order of the time series, the method further includes:
[0018] Determine whether the stationary time series after the difference operation has seasonality;
[0019] In response to the stationary time series having seasonality, performing a seasonal difference operation on the stationary time series and calculating a seasonal autoregressive term and a seasonal moving average term;
[0020] According to the seasonal autoregressive term and the seasonal moving average term, a seasonal autoregressive integrated moving average model is obtained;
[0021] Based on the seasonal autoregressive integrated moving average model, predicted traffic information is obtained.
[0022] As a further improvement of an embodiment of the present disclosure, the collecting of real-time traffic video and its video frame and obtaining the vehicle area in the video frame includes:
[0023] Capture video frames from real-time traffic videos, or capture real-time traffic images;
[0024] Performing Gaussian blur processing on the video frame or image to obtain a vehicle outline in the video frame or image;
[0025] The vehicle outline is processed using the target detection algorithm to obtain the pre-selected vehicle area;
[0026] The falsely detected parts and overlapping areas in the pre-selected vehicle area are removed to obtain the vehicle area, and the vehicle area is represented by a color histogram.
[0027] As a further improvement of an embodiment of the present disclosure, obtaining the vehicle position and predicted speed through the vehicle area in the adjacent video frames includes:
[0028] Detecting the vehicle area, and performing feature extraction on the vehicle area to obtain a vehicle area feature value;
[0029] Using the Kalman filter formula, the vehicle area in the current video frame is matched with the vehicle area in the previous video frame to generate the vehicle's motion model and observation information;
[0030] The vehicle position and the predicted speed are obtained according to the motion model and the observation information of the vehicle.
[0031] As a further improvement of an embodiment of the present disclosure, the green wave band length is calculated based on the traffic light and the predicted speed, and the signal light lighting strategy is generated, including:
[0032] The formula for calculating the length of the green wave band is: L=V*T;
[0033] Wherein, T is the traffic light cycle time, V is the predicted speed, and L is the green wave band length;
[0034] The signal light lighting strategy is set to implement a green wave traffic control mode at an intersection on a road of length L.
[0035] As a further improvement of an embodiment of the present disclosure, after obtaining the vehicle position and the predicted speed and before calculating the green wave band length, the method further includes:
[0036] Utilize the rule engine to analyze the characteristic values of the vehicle area and determine whether there is an emergency;
[0037] The convolutional neural network algorithm model is used to predict and process the emergency situation and send a control notification.
[0038] Based on the same inventive concept, the present disclosure also provides a traffic control system, including:
[0039] A processing module, used for acquiring and preprocessing historical traffic information to obtain historical traffic data, wherein the historical traffic data includes a time series and vehicle data arranged according to the time series;
[0040] A first generating module, used for obtaining the difference order of the time series based on the historical traffic data;
[0041] A calculation module, used to calculate the autocorrelation function and partial autocorrelation function of the time series, and to determine the autoregressive order and the moving average order;
[0042] A construction module, used for constructing an autoregressive difference moving average model according to the difference order, the autoregressive order and the moving average order;
[0043] A second generating module, used for obtaining a traffic light cycle time based on the autoregressive difference moving average model;
[0044] The acquisition module is used to acquire real-time traffic video and its video frames, and obtain the vehicle area in the video frame;
[0045] A third generation module is used to obtain the vehicle position and predicted speed through the vehicle area in the adjacent video frames;
[0046] The fourth generation module is used to calculate the green wave band length and generate a signal light lighting strategy based on the traffic light cycle time and the predicted speed.
[0047] Based on the same inventive concept, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned traffic control methods.
[0048] Based on the same inventive concept, the present disclosure also provides an electronic device, including: a processor and a memory; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any of the traffic control methods described above.
[0049] Compared with the prior art, the technical effect of the present invention is that: the present invention utilizes the autoregressive difference moving average model to process historical traffic data, predict traffic information, and update the traffic light cycle time in real time according to the predicted traffic information; by obtaining real-time vehicle data and the predicted speed of the vehicle, the traffic light cycle time and the predicted speed are used to calculate the green wave band, and a signal light lighting strategy generated according to historical traffic data and real-time vehicle conditions is obtained, which can adapt to various traffic conditions with high flexibility, automatically adjust traffic lights, and make full use of traffic data. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the implementation methods or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only implementation methods of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flow chart of a method for traffic control provided in one embodiment of the present disclosure;
[0052] Figure 2 A flow chart for obtaining a differential order provided in another embodiment of the present disclosure;
[0053] Figure 3 A flowchart for determining seasonality provided in another embodiment of the present disclosure;
[0054] Figure 4 A flowchart of obtaining a car area provided by another embodiment of the present disclosure;
[0055] Figure 5 A flowchart for obtaining a predicted speed of a vehicle provided by another embodiment of the present disclosure;
[0056] Figure 6 A flowchart for handling emergencies provided in accordance with another embodiment of the present disclosure;
[0057] Figure 7 A flowchart of implementing a green wave traffic control mode provided by another embodiment of the present disclosure;
[0058] Figure 8 A schematic diagram of a traffic control system provided for an embodiment of the present disclosure;
[0059] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0060] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0061] Embodiments It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0062] The present disclosure provides a method for traffic control. Figure 1 As shown, the method for traffic control includes the following steps:
[0063] Step S100, acquiring and preprocessing historical traffic information to obtain historical traffic data, wherein the historical traffic data includes a time series and traffic data arranged according to the time series.
[0064] The traffic information collection system is used to obtain historical traffic information, and then connected to the information management module to proceed to the next step of processing. The original historical traffic information needs to be processed into a data format that can be recognized by the algorithm to facilitate the next step of processing and analysis.
[0065] Specifically, each intersection on the road has a set of traffic data, including camera sequence, date, time period, location (latitude and longitude), traffic flow, speed, vehicle type, accidents, traffic control, weather and other information dimensions. It can be processed into structured data, as shown in Table 1:
[0066]
[0067] Table 1
[0068] Step S200, obtaining the difference order of the time series based on historical traffic data.
[0069] The difference order is part of the autoregressive difference moving average model. In order to construct the autoregressive difference moving average model, the difference order of the time series needs to be calculated.
[0070] In one possible implementation of the present disclosure, for step S200, Figure 2 As shown, it also includes:
[0071] Step S210, determining whether the time series is stationary, and in response to the time series being non-stationary, performing a difference operation on the time series.
[0072] It should be noted that we first need to determine whether the time series is stationary. If it is not, perform a difference operation to obtain the difference order. If the time series is stationary, no difference order is required, and the autoregressive moving average model can be directly constructed to complete the prediction of traffic data. However, in actual scenarios, time series are not stationary under normal circumstances.
[0073] Specifically, using the format data in Table 1, the unit root ADF test method is used to test whether the time series is stable. The calculation formula is as follows:
[0074] Δy t =α+βt+γy t-1 +δ1Δy t-1 +…+δ p Δy t-p +ε t ;
[0075] Among them, y t represents the value of time series data (i.e. the result of calculating traffic flow), α and β represent constants and trend terms, and γ represents y t-1The coefficients of δ1 to δ p represents the coefficient of the difference term, ε t represents the error term. If the time series data has a unit root, then γ = 1, that is, y t-1 The coefficient of is equal to 1, indicating that the data has random drift. If the time series data does not have a unit root, then γ<1, indicating that the data tends to be stable.
[0076] Step S220, performing N difference operations on the time series until the time series is stationary, where N is the difference order of the time series.
[0077] Specifically, when the time series of traffic flow is not stable, it is necessary to perform a differential operation on the data until a stable time series is obtained. t and X t-1 Indicates adjacent values in the time series. Use X t and X t-1 Calculate the differences between adjacent moments to obtain a difference series. By calculating the difference, the trend and seasonal components in the time series can be eliminated, making it more stable.
[0078] First, perform a first-order difference operation. The first-order difference refers to subtracting the data at adjacent moments to obtain a new sequence. The calculation formula is as follows:
[0079] Y t =X t -X t-1 ;
[0080] Among them, X t represents the value of the time series at time point t, and X t-1 Represents the value of the time series at time point t-1.
[0081] If the new sequence obtained after the first-order difference operation is still not stable, continue to perform the second-order difference operation to obtain the second-order difference sequence. The calculation formula is as follows:
[0082] Z t =Y t -Y t-1 =(X t -X t-1 )-(X t-1 -X t-2 )=X t -2X t-1 +X t-2 ;
[0083] After each order of difference operation, the unit root is used to test whether the new series is stable. After N order difference operations, until the latest time series is confirmed to be a stable time series, then the N order is the optimal difference order. The difference operation can eliminate the trend in the time series and make it more stable.
[0084] In one possible implementation of the present disclosure, after step S200, as follows Figure 3 As shown, it also includes:
[0085] Step S201, determining whether the stationary time series after the difference operation has seasonality.
[0086] Specifically, after the difference operation is performed to obtain a stationary time series, seasonality is judged. By observing the changing pattern of traffic flow on the stationary time series, it is judged whether it has seasonality. If the traffic flow changes in a certain periodic pattern, it has seasonality.
[0087] It should be noted that seasonality refers to the characteristics of seasonal fluctuations in time series data, that is, there are significant differences in the fluctuations of the series in different seasons. Here, season is a time period, such as a quarter or a month. This seasonal characteristic may be caused by factors such as the natural environment, production cycle, and social customs. Seasonality can be described by seasonal parameters. Seasonal parameters represent the laws and characteristics of seasonal fluctuations, which can help the model better capture seasonal changes in time series and improve the prediction accuracy of the model.
[0088] Step S202, in response to the stationary time series having seasonality, performing a seasonal difference operation on the stationary time series and calculating a seasonal autoregressive term and a seasonal moving average term.
[0089] Specifically, after confirming that the stationary time series has seasonality, the seasonal autoregression and seasonal moving average terms are calculated. The specific calculation formula is:
[0090] (SAR):
[0091] (SMA):
[0092] Among them, X t represents the value of the time series, c is a constant term, p and q are the orders of the seasonal autoregressive term and the seasonal moving average term, respectively, P and Q are the seasonal orders of the seasonal autoregressive term and the seasonal moving average term, respectively, and θ i is the corresponding coefficient and εt is the random error term.
[0093] Step S203, obtaining a seasonal autoregressive integrated moving average model according to the seasonal autoregressive term and the seasonal moving average term.
[0094] Specifically, the seasonal autoregressive integrated moving average model is a horizontal extension of the autoregressive difference moving average model on seasonal data. It can model and predict seasonal traffic flow data and is more suitable for traffic flow data with obvious seasonal changes.
[0095] Step S204, obtaining predicted traffic information based on the seasonal autoregressive integrated moving average model.
[0096] Specifically, the seasonal autoregressive integrated moving average model is abbreviated as SARIMA.
[0097] The SARIMA model expression is:
[0098] SARIMA(p,d,g(P,D,Q)s;
[0099] Among them, the seasonal autoregressive order (P) and the seasonal moving average order (Q) are determined by using the seasonal autocorrelation function (SACF) and the seasonal partial autocorrelation function (SPACF) to determine the order of seasonal AR and MA. The specific calculation formula is as follows:
[0100]
[0101] In the formula, hs represents the seasonal lag period, y t represents the observed value of time series data, represents the mean of the time series data, and n represents the length of the time series.
[0102]
[0103] In the formula, C(hs|hs) is the autocovariance of the time series data under the seasonal lag period hs, C(hs|hs+1,h.s+2,..,n) is the conditional autocovariance of the time series data under other seasonal lag conditions, and Var(y) is the variance of the time series data.
[0104] The seasonal difference order (D), like the autoregressive difference moving average model, needs to be determined by using the unit root ADF test for stationarity or by using methods such as the seasonal difference plot.
[0105] Seasonal cycle (s) refers to the time interval of seasonal fluctuations in time series data, for example, the cycle of the four quarters of a year is 4.
[0106] Step S300, calculating the autocorrelation function and partial autocorrelation function of the time series, and confirming the autoregressive order and the moving average order.
[0107] Specifically, the autocorrelation function (ACF) of the time series traffic flow is calculated. The autocorrelation coefficient measures the correlation between the same event in two different periods, that is, the impact of past behavior on current behavior. The calculation formula of the autocorrelation function is:
[0108]
[0109] Among them, γk represents the covariance of the time series at time t and time tk, and γ0 represents the variance of the time series.
[0110] Calculating the partial autocorrelation function (PACF) is to consider the influence of other factors as constants when calculating the influence and correlation of one factor on another factor. That is, temporarily ignoring the influence of other factors and studying the closeness of the relationship between two factors separately, which is called partial correlation. The calculation formula of the partial autocorrelation function is:
[0111]
[0112] Among them, k represents the lag period, γ(k) is the autocovariance function of the data when the lag period is k, and α1 to α k-1 It is the coefficient of the time series after being fitted by the autoregressive model, and PACF(i) represents the partial autocorrelation coefficient when the lag period is i.
[0113] The autocorrelation function and partial autocorrelation function generate ACF sample charts and PACF sample charts respectively. Find the trailing lag order p and the prominent lag order q in the sample charts, where p is the autoregressive order and q is the moving average order.
[0114] For example, by looking for a significantly non-zero value through the sample graph, we can observe that the trend series ACF has a first-order truncation and the PACF has a first-order truncation, so p=1, q=1. The order of the model can be determined by tailing and truncation, or the information criterion, the test of model residuals, etc. can be selected to comprehensively judge the most appropriate model order.
[0115] Step S400: construct an autoregressive difference moving average model according to the difference order, the autoregressive order and the moving average order.
[0116] Specifically, an autoregressive difference moving average model, referred to as an ARIMA model, is constructed according to the determined order. In the ARIMA model, p represents the autoregressive order, d represents the difference order, and q represents the moving average order. The formula of the ARIMA model is expressed as follows:
[0117] Yt =c+φ1·(Y t-1 -c)+φ2·(Y t-2 -c)+...+φ p ·(Y t-p -c)+θ1·ε t-1 +θ2·ε t-2 +...+θ q ·ε t-q +ε t ;
[0118] Among them, Y t is the time series data, c is the constant term, φ i is the autoregressive coefficient, ε t is white noise, θ i is the moving average coefficient, q is the autoregressive order, and p is the moving average order.
[0119] Furthermore, parameter estimation is also required in the process of fitting the ARIMA model. The parameters in the ARIMA model are calculated using the maximum likelihood estimation method or other estimation methods. Through parameter estimation, the model parameters of the traffic flow data set are inferred using the existing time series.
[0120] Furthermore, the residuals of the ARIMA model are tested to see whether the model meets the assumptions. The test methods include stationarity test of the residual sequence and autocorrelation test of the residual sequence. The stationarity test can use the unit root ADF test method used in the above disclosure to test whether the residual sequence is stationary; the autocorrelation test can be divided into two types:
[0121] The first is the Ljung-Box test. First, fit the ARIMA model and obtain the residual sequence. Then, calculate the Q statistic by the lag order calculated by the autocorrelation function (ACF) and the partial autocorrelation function (PACF). The specific calculation formula is as follows:
[0122]
[0123] Where n is the sample size, h is the lag order, and γk is the autocorrelation coefficient of the residual sequence. Based on the calculated Q statistic and degrees of freedom, a hypothesis test is performed to determine whether there is autocorrelation in the residual sequence.
[0124] The second is the Durbin-Watson test, which also fits the ARIMA model and obtains the residual sequence, then calculates the first-order difference of the residual sequence and the autocorrelation coefficient of the residual sequence after calculating the first-order difference. The calculated autocorrelation coefficient is used to determine whether the residual sequence has autocorrelation. The specific calculation formula is as follows:
[0125]
[0126] Among them, e t is the residual sequence.
[0127] If the residuals of the model do not meet the assumptions, you can try to adjust the order of the model, refit the model, and perform residual tests until the model assumptions are met.
[0128] Step S500, obtaining the traffic light cycle time based on the autoregressive difference moving average model.
[0129] Specifically, the Autoregressive Invariant Moving Average (ARIMA) model is a widely used time series analysis method that can be used to model the trend, seasonality and other influencing factors of time series data, and can use historical data to predict future data. The ARIMA model is used to predict the traffic flow in the future, and the cycle time of the traffic light is formulated according to the predicted traffic flow in each direction at the intersection. This cycle time changes with the changes in historical traffic data and the changes in predicted traffic flow, and has high flexibility.
[0130] It should be noted that the autoregressive difference moving average model can effectively process non-stationary time series data, and can extract characteristics such as trends and seasonality in the series without affecting data quality; it improves the accuracy of predictions by identifying patterns and relationships in the data through parameter estimation and model selection; the autoregressive difference moving average model uses historical data for predictions and continuously improves the model through posterior evaluation of the prediction results.
[0131] Step S600: collect real-time traffic video and its video frames, and obtain the vehicle area in the video frame.
[0132] Specifically, it is also necessary to collect real-time vehicle information as a reference value for setting the traffic light cycle. First, the vehicles in the collected video need to be converted into calculable feature information.
[0133] The present disclosure provides an implementation method, for step S600, as Figure 4 As shown, it also includes:
[0134] Step S610: collecting video frames in real-time traffic video, or collecting real-time traffic images.
[0135] Specifically, real-time traffic videos or images are collected by shooting with road cameras. For example, if traffic videos are collected, multiple video frames need to be obtained from the traffic videos; if images are collected, the image collection time needs to be recorded.
[0136] Step S620, performing Gaussian blur processing on the video frame or image to obtain a vehicle outline in the video frame or image.
[0137] Specifically, the image is processed and Gaussian blur technology is used to reduce the noise in the video frame or image and highlight the vehicle outline. The calculation formula is:
[0138]
[0139] Where G(x, y) represents the value of the Gaussian function at the coordinate (x, y), and σ is the standard deviation of the Gaussian blur.
[0140] Step S630, using a target detection algorithm to process the vehicle outline to obtain a pre-selected vehicle area;
[0141] Step S640, removing the misdetected parts and overlapping areas in the pre-selected vehicle area to obtain the vehicle area, and representing the vehicle area with a color histogram.
[0142] Specifically, a feature-based target detection method or a deep learning method is used to detect vehicle areas in the image. In addition, the detected vehicle areas are screened and filtered to remove false detection parts and overlapping areas. For each detected vehicle area, feature extraction is performed using a color histogram algorithm.
[0143] Step S700, obtaining the vehicle position and predicted speed through the vehicle area in the adjacent video frames.
[0144] By tracking the vehicle in adjacent video frames, the vehicle position and predicted speed can be calculated.
[0145] The present disclosure provides an implementation method, for step S700, as Figure 5 As shown, it also includes:
[0146] Step S710, detecting the vehicle area, and extracting features of the vehicle area to obtain a vehicle area feature value;
[0147] Step S720, using the Kalman filter formula, matching the vehicle area in the current video frame with the vehicle area in the previous video frame to generate a vehicle motion model and observation information;
[0148] Step S730, obtaining the vehicle position and the predicted speed according to the motion model and the observation information of the vehicle.
[0149] Specifically, a tracking algorithm, namely the Kalman filter formula, is used to match and track the vehicle area of the current frame with the vehicle in the previous frame. The calculation formula of the Kalman filter step is as follows:
[0150]
[0151] P k|k-1=FP k-1|k-1 F T +Q;
[0152] K k =P k|k-1 H T (HP k|k-1 H T +R) -1 ;
[0153]
[0154] Pk|k=(IK k H)P k|k-1 ;
[0155] Among them, k is the current video frame, k-1 is the previous video frame, represents the estimated value of the state, P k|k-1 represents the covariance matrix of the state, F is the state transfer matrix, B is the control input matrix, U k-1 is the control input, Q is the covariance matrix of the process noise, K k is the Kalman gain, H is the vehicle region eigenvalue matrix, R is the covariance matrix of the observation noise, and Z k is the vehicle area characteristic value.
[0156] The present invention discloses a possible implementation method, after step S700, as follows Figure 6 As shown, it also includes:
[0157] Step S701, using a rule engine to analyze the vehicle area feature value to determine whether there is an emergency;
[0158] Step S702: Use a convolutional neural network algorithm model to predict and process the emergency situation, and send a control notification.
[0159] Specifically, the rule engine is used to analyze the characteristic values of the vehicle area to identify whether there are any emergencies, and then the convolutional network algorithm model is used to predict and handle the current special situation. At the same time, the traffic control center is reminded to intervene and track the progress of handling special situations.
[0160] Step S800, based on the traffic light cycle time and predicted speed, the green wave band length is calculated to generate a traffic light lighting strategy.
[0161] The present disclosure provides an implementation method, for step S800, as Figure 7 As shown, it also includes:
[0162] Step S810, the formula for calculating the length of the green wave band is: L=V*T;
[0163] Wherein, T is the traffic light cycle time, V is the predicted speed, and L is the green wave band length.
[0164] Step S820, setting the signal light lighting strategy to implement a green wave traffic control mode at an intersection on a road of length L.
[0165] It should be noted that the green wave traffic control mode is a method of controlling urban traffic arteries. That is, at a series of intersections on the road, the traffic lights have a specific cycle and green-to-signal ratio automatic control, so that when the traffic on the main road arrives at each intersection in turn, it will avoid the red light and encounter the green light. This green wave traffic control mode can reduce the parking delay of vehicles before the intersection and improve the average driving speed and traffic capacity on the road.
[0166] Specifically, by combining the traffic light cycle time generated according to the predicted traffic flow and the vehicle predicted speed generated according to the real-time monitoring of vehicles, a traffic light lighting strategy is obtained, which allows vehicles to encounter green lights at multiple intersections in sequence while reducing the waiting time at red lights, greatly improving the vehicle's traffic efficiency.
[0167] This solution provides a method for traffic control. It uses historical traffic data and an autoregressive difference moving average model to predict traffic flow, generates a traffic light lighting cycle for a single intersection based on the predicted traffic flow, and then obtains the predicted vehicle speed by collecting vehicle information on the road in real time. Combining the traffic light lighting cycle and the predicted vehicle speed at a single intersection, a traffic light lighting strategy for trunk roads is obtained, which reduces the waiting time for red lights and the probability of encountering red lights during driving, thereby improving driving efficiency.
[0168] like Figure 8 As shown, another embodiment of the present disclosure discloses a traffic control system, including:
[0169] The processing module 100 is used to acquire and pre-process historical traffic information to obtain historical traffic data, wherein the historical traffic data includes a time series and vehicle data arranged according to the time series;
[0170] A first generating module 200, configured to obtain a differential order of the time series based on the historical traffic data;
[0171] The first calculation module 300 is used to calculate the autocorrelation function and partial autocorrelation function of the time series, and determine the autoregressive order and the moving average order;
[0172] A construction module 400 is used to construct an autoregressive difference moving average model according to the difference order, the autoregressive order and the moving average order;
[0173] A second generating module 500 is used to obtain a traffic light cycle time based on the autoregressive difference moving average model;
[0174] The first acquisition module 600 is used to acquire real-time traffic video and its video frames, and obtain the vehicle area in the video frame;
[0175] The third generation module 700 is used to obtain the vehicle position and predicted speed through the vehicle area in the adjacent video frames;
[0176] The fourth generating module 800 is used to calculate the green wave band length and generate a traffic light lighting strategy based on the traffic light cycle time and the predicted speed.
[0177] This system uses the autoregressive difference moving average model to process historical traffic data, predict traffic information, and update the traffic light cycle time in real time based on the predicted traffic information; by obtaining real-time vehicle data and the predicted speed of the vehicle, using the traffic light cycle time and predicted speed, the green wave band is calculated, and the signal light lighting strategy generated based on historical traffic data and real-time vehicle conditions is obtained. It can adapt to various traffic conditions with high flexibility, automatically adjust traffic lights, and make full use of traffic data.
[0178] In one possible implementation of the present disclosure, the first generation module 200 further includes:
[0179] The first judgment module 210 is used to judge whether the time series is stationary, and in response to the time series being non-stationary, perform a difference operation on the time series.
[0180] The difference module 220 is used to perform N difference operations on the time series until the time series is stable, where N is the difference order of the time series.
[0181] In one implementation of the present disclosure, after the first generation module 200, the following is further included:
[0182] The second judgment module 201 is used to judge whether the stationary time series after the difference operation has seasonality.
[0183] The second calculation module 202 is used for performing a seasonal difference operation on the stationary time series and calculating a seasonal autoregressive term and a seasonal moving average term in response to the stationary time series having seasonality.
[0184] The fifth generating module 203 is used to obtain a seasonal autoregressive integrated moving average model according to the seasonal autoregressive term and the seasonal moving average term.
[0185] The sixth generating module 204 is used to obtain predicted traffic information based on the seasonal autoregressive integrated moving average model.
[0186] In one possible implementation of the present disclosure, the first acquisition module 600 further includes:
[0187] The second acquisition module 610 is used to acquire video frames in real-time traffic videos, or acquire real-time traffic images.
[0188] The first processing module 620 is used to perform Gaussian blur processing on the video frame or image to obtain the vehicle outline in the video frame or image.
[0189] The second processing module 630 is used to process the vehicle contour using a target detection algorithm to obtain a pre-selected vehicle area;
[0190] The removal module 640 is used to remove the misdetected parts and overlapping areas in the pre-selected vehicle area to obtain the vehicle area, and the vehicle area is represented by a color histogram.
[0191] In one implementation of the present disclosure, the third generation module 700 further includes:
[0192] The detection module 710 is used to detect the vehicle area and extract features of the vehicle area to obtain a vehicle area feature value;
[0193] A matching module 720 is used to match the vehicle region of the current video frame with the vehicle region of the previous video frame using a Kalman filter formula to generate a motion model and observation information of the vehicle;
[0194] The seventh generation module 730 is used to obtain the vehicle position and the predicted speed according to the motion model and the observation information of the vehicle.
[0195] The present disclosure may be implemented in a manner that, after the third generation module 700, further includes:
[0196] An analysis module 701 is used to analyze the vehicle area characteristic value using a rule engine to determine whether there is an emergency;
[0197] The prediction module 702 is used to use a convolutional neural network algorithm model to predict the emergency situation and send a control notification.
[0198] In one implementation of the present disclosure, the fourth generating module 800 further includes:
[0199] The third calculation module 810 is used to calculate the length of the green wave band using the formula: L=V*T;
[0200] Wherein, T is the traffic light cycle time, V is the predicted speed, and L is the green wave band length;
[0201] The setting module 820 is used to set the signal light lighting strategy to implement a green wave traffic control mode at an intersection on a road of length L.
[0202] Based on the same inventive concept, corresponding to any of the above-mentioned implementation methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for generating an order request described in any of the above implementation methods is implemented.
[0203] Fig. 9 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0204] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the implementation methods of this specification.
[0205] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0206] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0207] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0208] The bus 1050 includes pathways that transmit information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0209] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the implementation scheme of this specification, and does not necessarily include all the components shown in the figure.
[0210] The electronic device of the above-mentioned embodiment is used to implement the corresponding traffic control method in any of the above-mentioned embodiments, and has the beneficial effects of the corresponding method implementation method, which will not be repeated here.
[0211] Based on the same inventive concept, corresponding to any of the above-mentioned implementation methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the traffic control method described in any of the above implementation methods.
[0212] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0213] The computer instructions stored in the storage medium of the above-mentioned embodiments are used to enable the computer to execute the traffic control method described in any of the above-mentioned embodiments, and have the beneficial effects of the corresponding method implementation methods, which will not be repeated here.
[0214] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. This narrative style of the specification is only for the sake of clarity, and those skilled in the art should take the specification as a whole. Under the concept of the present disclosure, the above embodiments or the technical features in different embodiments may be appropriately combined, the steps may be implemented in any order, and there are many other variations of different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0215] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is obvious to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0216] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0217] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and principles of the embodiments of the present disclosure shall be included in the scope of protection of the present disclosure.
Claims
1. A method for traffic control, characterized in that: The method comprises: Acquire and preprocess historical traffic information to obtain historical traffic data, wherein the historical traffic data includes a time series and traffic data arranged according to the time series; Based on the historical traffic data, obtaining the difference order of the time series; Calculating the autocorrelation function and partial autocorrelation function of the time series, and confirming the autoregressive order and the moving average order; Constructing an autoregressive difference moving average model according to the difference order, the autoregressive order and the moving average order; Based on the autoregressive difference moving average model, a traffic light cycle time is obtained; Collect real-time traffic video and its video frames, and obtain the vehicle area in the video frame; The vehicle position and predicted speed are obtained through the vehicle area in the adjacent video frames; Based on the traffic light cycle time and predicted speed, the green wave band length is calculated to generate a signal light lighting strategy; The autoregressive difference moving average model is used to predict the traffic flow in the future, and the cycle time of the traffic light is specified according to the predicted traffic flow in each direction at the intersection; The method of obtaining the vehicle position and predicted speed through the vehicle region in the adjacent video frames includes: Detecting the vehicle area, and performing feature extraction on the vehicle area to obtain a vehicle area feature value; Using the Kalman filter formula, the vehicle area in the current video frame is matched with the vehicle area in the previous video frame to generate the vehicle's motion model and observation information; Obtaining the vehicle position and the predicted speed according to the motion model and the observation information of the vehicle; The method of calculating the green wave band length based on the traffic light and the predicted speed and generating a signal light lighting strategy includes: The formula for calculating the length of the green wave band is: L=V*T; Wherein, T is the traffic light cycle time, V is the predicted speed, and L is the green wave band length; The signal light lighting strategy is set to implement a green wave traffic control mode at an intersection on a road of length L.
2. The method for traffic control according to claim 1, characterized in that: The step of obtaining the difference order of the time series based on the historical traffic data includes: Determining whether the time series is stationary, and in response to the time series being non-stationary, performing a difference operation on the time series; Perform N difference operations on the time series until the time series is stationary, where N is the difference order of the time series.
3. The method of traffic control according to claim 2, characterized in that: After obtaining the difference order of the time series, the method further includes: Determine whether the stationary time series after the difference operation has seasonality; In response to the stationary time series having seasonality, performing a seasonal difference operation on the stationary time series and calculating a seasonal autoregressive term and a seasonal moving average term; According to the seasonal autoregressive term and the seasonal moving average term, a seasonal autoregressive integrated moving average model is obtained; Based on the seasonal autoregressive integrated moving average model, predicted traffic information is obtained.
4. The method of traffic control according to claim 1, characterized in that: The collecting of real-time traffic video and video frames thereof, and obtaining vehicle regions in the video frames, includes: Capture video frames from real-time traffic videos, or capture real-time traffic images; Performing Gaussian blur processing on the video frame or image to obtain a vehicle outline in the video frame or image; The vehicle outline is processed using the target detection algorithm to obtain the pre-selected vehicle area; The falsely detected parts and overlapping areas in the pre-selected vehicle area are removed to obtain the vehicle area, and the vehicle area is represented by a color histogram.
5. The method of traffic control according to claim 1, characterized in that: After obtaining the vehicle position and predicted speed and before calculating the green wave band length, the method further includes: Utilize the rule engine to analyze the characteristic values of the vehicle area and determine whether there is an emergency; The convolutional neural network algorithm model is used to predict and process the emergency situation and send a control notification.
6. A traffic control system, characterized in that: The system comprises: A processing module, used for acquiring and preprocessing historical traffic information to obtain historical traffic data, wherein the historical traffic data includes a time series and vehicle data arranged according to the time series; A first generating module, used for obtaining the difference order of the time series based on the historical traffic data; A first calculation module is used to calculate the autocorrelation function and partial autocorrelation function of the time series, and determine the autoregressive order and the moving average order; A construction module, used for constructing an autoregressive difference moving average model according to the difference order, the autoregressive order and the moving average order; A second generating module, used for obtaining a traffic light cycle time based on the autoregressive difference moving average model; The first acquisition module is used to acquire real-time traffic video and its video frames, and obtain the vehicle area in the video frame; A third generation module is used to obtain the vehicle position and predicted speed through the vehicle area in the adjacent video frames; A fourth generating module, configured to calculate the green wave band length and generate a signal light lighting strategy based on the traffic light cycle time and the predicted speed; The autoregressive difference moving average model is used to predict the traffic flow in the future, and the cycle time of the traffic light is specified according to the predicted traffic flow in each direction at the intersection; The method of obtaining the vehicle position and predicted speed through the vehicle region in the adjacent video frames includes: Detecting the vehicle area, and performing feature extraction on the vehicle area to obtain a vehicle area feature value; Using the Kalman filter formula, the vehicle area in the current video frame is matched with the vehicle area in the previous video frame to generate the vehicle's motion model and observation information; Obtaining the vehicle position and the predicted speed according to the motion model and the observation information of the vehicle; The method of calculating the green wave band length based on the traffic light and the predicted speed and generating a signal light lighting strategy includes: The formula for calculating the length of the green wave band is: L=V*T; Wherein, T is the traffic light cycle time, V is the predicted speed, and L is the green wave band length; The signal light lighting strategy is set to implement a green wave traffic control mode at an intersection on a road of length L.
7. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the traffic control method described in any one of claims 1 to 5.
8. An electronic device, characterized in that: include: Processor and memory; The memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the traffic control method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Traffic signal control method and device
CN106530762A
Intelligent timing traffic signal lamp control method based on Raspberry Pi
CN113706860A
Intelligent traffic signal unified optimization control system and method based on cloud management and cloud control
CN116994443A
Intelligent traffic management method for adjustment based on traffic flow
CN117351702A
Method and apparatus for generating prediction model, and computer readable storage medium
WO2020010710A1
