CN113706860A - Intelligent timing traffic light control method based on raspberry group - Google Patents
Intelligent timing traffic light control method based on raspberry group Download PDFInfo
- Publication number
- CN113706860A CN113706860A CN202110803564.9A CN202110803564A CN113706860A CN 113706860 A CN113706860 A CN 113706860A CN 202110803564 A CN202110803564 A CN 202110803564A CN 113706860 A CN113706860 A CN 113706860A
- Authority
- CN
- China
- Prior art keywords
- model
- time
- intersection
- traffic
- raspberry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 240000007651 Rubus glaucus Species 0.000 title claims abstract description 30
- 238000000034 method Methods 0.000 title claims abstract description 29
- 235000011034 Rubus glaucus Nutrition 0.000 title claims abstract description 28
- 235000009122 Rubus idaeus Nutrition 0.000 title claims abstract description 28
- 230000007704 transition Effects 0.000 claims abstract description 12
- 230000002068 genetic effect Effects 0.000 claims abstract description 8
- 238000004364 calculation method Methods 0.000 claims abstract description 7
- 238000001514 detection method Methods 0.000 claims abstract description 4
- 210000000349 chromosome Anatomy 0.000 claims description 10
- 238000005457 optimization Methods 0.000 claims description 10
- 238000012937 correction Methods 0.000 claims description 6
- 230000035772 mutation Effects 0.000 claims description 4
- 238000012545 processing Methods 0.000 claims description 4
- 238000012216 screening Methods 0.000 claims description 4
- 238000007689 inspection Methods 0.000 claims description 3
- 230000003044 adaptive effect Effects 0.000 claims description 2
- 230000008030 elimination Effects 0.000 claims description 2
- 238000003379 elimination reaction Methods 0.000 claims description 2
- 238000011156 evaluation Methods 0.000 claims description 2
- 238000000605 extraction Methods 0.000 claims description 2
- 238000009396 hybridization Methods 0.000 claims description 2
- 235000021013 raspberries Nutrition 0.000 claims description 2
- 230000000717 retained effect Effects 0.000 claims description 2
- 238000010187 selection method Methods 0.000 claims description 2
- 230000006870 function Effects 0.000 description 14
- 238000005311 autocorrelation function Methods 0.000 description 10
- 238000009826 distribution Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 3
- 238000007476 Maximum Likelihood Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 241001123248 Arma Species 0.000 description 1
- 206010039203 Road traffic accident Diseases 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 238000003915 air pollution Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000295 fuel oil Substances 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000000528 statistical test Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 238000011410 subtraction method Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G06Q50/40—
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
- G08G1/0133—Traffic data processing for classifying traffic situation
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0137—Measuring and analyzing of parameters relative to traffic conditions for specific applications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/07—Controlling traffic signals
- G08G1/08—Controlling traffic signals according to detected number or speed of vehicles
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Abstract
The invention relates to the field of intelligent traffic lights, in particular to a raspberry group-based intelligent timing traffic light control method, which comprises the steps of utilizing a plurality of high-definition cameras to collect road conditions and vehicle information in real time and transmitting the road conditions and the vehicle information to a raspberry group computer; the raspberry pi computer predicts the hourly traffic flow by using a differential autoregressive moving average model; predicting the number of vehicles in a set period, and forming two time sequences through stored historical data; the predicted traffic flow and the data of detection and analysis are subjected to the minimum delay time calculation as a target by adopting a transition delay model, and the signal lamps of the intersection are accurately matched by utilizing a genetic algorithm; the method and the system predict the traffic flow on the whole road in the next time period in a short term under the condition of ensuring that the signal lamp is accurately controlled, predict and adjust in real time, and finish intelligent timing of the signal lamp.
Description
Technical Field
The invention relates to the technical field of intelligent traffic lights, in particular to a raspberry group-based intelligent timing traffic light control method.
Background
Traffic jam is a common disease of many cities, which causes inconvenience to people living in the cities, the traditional signal lamp has unreasonable time control, faults and failures frequently occur, which causes traffic accidents, working hours loss, noise pollution, air pollution, fuel oil increase, illegal traffic rules and other problems, a plurality of traffic polices are often required to conduct on-site command in rush hours and off duty, which increases the cost of manpower and material resources, but the accidents frequently occur, so as to avoid the above situations,
for example, chinese patent application No. 201811079047.6 discloses an intelligent management system for urban traffic based on raspberry pi, comprising: the design scheme uses an artificial intelligent algorithm to control vehicle traffic by adopting a density-based method, the timing of traffic signal lamps can be automatically changed in the intersection perception traffic density state, the proposed system uses the raspberry group to combine with the high-definition camera to build a neural network analysis prediction, the time of the traffic signal lamps at road junction points is automatically changed to adapt to the movement and the sparse and dense state of vehicles, so that the unnecessary waiting time at the road junction is avoided, the scheme cannot predict the traffic flow of the whole course at the next time period, the prediction time is adjusted, and the intelligent timing of traffic lamps is completed.
Disclosure of Invention
Aiming at the defects, the intelligent timing traffic signal lamp is adopted, and under the condition that the signal lamp is accurately controlled to be timed, the signal lamp can be regulated and controlled in real time according to road conditions and vehicle conditions, namely the intelligent timing traffic signal lamp predicts the traffic flow on the whole road in the next time period in a short time period, analyzes and adjusts the effect, the vehicle passing time on the existing road is timed, and the time is predicted and adjusted in real time, so that the intelligent timing of the traffic signal lamp is completed.
In order to achieve the purpose, the invention provides the following technical scheme:
an intelligent timing traffic light control method based on raspberry dispatching comprises the following steps:
step 1, collecting road conditions and vehicle information in real time by using a plurality of high-definition cameras, compressing the collected information into an h264 format, and transmitting the compressed information to a raspberry host computer;
step 2, predicting the hourly traffic flow by utilizing a differential autoregressive moving average model in a raspberry dispatching computer system;
step 3, predicting the number of vehicles in a set period, forming two time sequences through stored historical data, wherein the two time sequences respectively adopt the model in the step 2, realizing the stable operation of the data by using a difference method, then carrying out order fixing on model parameters (p, d, q), determining an optimal model by using a BIC (building information center) criterion, then carrying out standardized residual error inspection on the model, determining the reliability of the model, predicting the traffic flow in the next time period, comparing the standardized residual errors generated by the two time sequences, and selecting the minimum result as the final result of traffic flow prediction;
and 4, accurately timing signal lamps of the intersection by using a genetic algorithm by using the data of the traffic flow and the video detection analysis predicted in the step 3 and aiming at obtaining the minimum delay time by using a transition delay model.
The technical scheme of the invention is further improved as follows: in the step 1, OpenCV is dispatched through raspberries to operate information, vehicles in the information are captured, vehicles of continuous frames in the information are tracked, and finally the tracked vehicles are counted and classified.
The technical scheme of the invention is further improved as follows: in step 3, one of the two time sequences is a time sequence formed according to the first 10 periods of the current required prediction period, and the other is a time sequence formed by acquiring ten pieces of traffic flow data of the same time node on different dates in the database according to the current time node.
Compared with the prior art, the intelligent timing traffic light control method based on the raspberry group has the following beneficial effects:
1. the invention provides an intelligent timing traffic light control method based on raspberry assignment, which regulates and controls a traffic light according to road conditions and vehicle conditions under the condition of ensuring accurate timing of the traffic light, predicts the traffic flow on the whole road in the next time period in a short time, predicts and adjusts the time in real time, and completes intelligent timing of the traffic light.
Detailed Description
The technical solution of the present invention will be clearly and completely described by the following detailed description. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The intelligent timing traffic light control method based on the raspberry group comprises the following steps:
step 1, collecting road conditions and vehicle information in real time by using a plurality of high-definition cameras, compressing the collected information into an h264 format, and transmitting the compressed information to a raspberry host computer;
in the embodiment, a high-definition camera is adopted to collect the road condition video in real time, and the video is compressed into an h264 format and transmitted to a raspberry host computer; performing background deduction operation on the video stream through a raspberry serving OpenCV, capturing vehicles in the video stream, tracking the vehicles of continuous frames in the video, and finally counting and classifying the tracked vehicles;
the method comprises the following specific steps:
1. the high-definition camera module is connected with the raspberry group through the CSI interface to carry out video transmission;
2. all the latest functions and drivers are installed inside the raspberry pi computer using commands to update the operating system, enabling correct access to the internet: the command of $ sudo apt-get update # updates the operating system with the latest functions and drivers, $ sudo raspi-config raspi-config # opens the configuration tool written and maintained by the raspbian operating system;
3.$ raspivid-o video. h264-t 1000 to capture video coded in h264 for t seconds;
4. in order to detect the vehicle, a background subtraction method is adopted to subtract a road image without the vehicle from another image with the vehicle on the road, wherein the background subtraction is a process of extracting a target image from an original image; the formula is as follows:
Target(x,y)=(1-alpha)﹒target(x,y)+alpha﹒origin(x,y)
wherein origin (x, y) is an 8-bit or 32-bit floating point number of an original image which is a color or gray image; target (x, y) is a 32-bit or 64-bit floating point of the image; alpha is the weight of the input image; the update rate is determined by alpha, which sets a lower value for this variable in the existing frame;
5. vehicle tracking, wherein the main target of tracking is to determine a target object in continuous frames of a video, match an input centroid with the centroid of an existing object for tracking a current object, and calculate the distance between each pair of objects, such as the Euclidean distance;
6. the method comprises the steps of vehicle classification counting, wherein tracked vehicles are counted when leaving an intersection or crossing an intersection stop line, in order to count the vehicles in each phase, a vehicle counting area is drawn from the stop line of each lane to the tail part of a video shot by using a counting line, each intersection is divided into 4 phases, and the phases are respectively south-north straight driving plus right turning, south-north left turning, east-west straight driving plus right turning and east-west left turning; the counted vehicles are classified based on the circumference, and if the circumference of the bounding box is less than 300, the counted vehicles are counted as bicycles; if the perimeter of the bounding box is less than 500, then it is counted as a car, and if the perimeter of the bounding box is greater than 500, then it is counted as a truck/bus;
7. the obtained vehicle data including vehicle types, quantity, vehicle distances and the like are stored in an Aliskiu MYSQL by editing tables with four phases separated and each signal period as a time unit, and then the vehicle types are subjected to unified standard conversion (4-5 seats of cars are used as standard cars), wherein the conversion coefficients are as follows:
type of vehicle | Conversion factor |
Bicycle with a wheel | 0.4 |
Car (R.C.) | 1.0 |
Truck/bus | 1.5 |
Step 2, predicting the hourly traffic flow by utilizing a differential autoregressive moving average model in a raspberry dispatching computer system;
in the embodiment, a differential auto-regression mobile model (ARIMA) is adopted;
1. autoregressive model (AR): describing the relationship between the current value and the historical value, and predicting the variable by using the historical time data of the variable; the formula definition of the p-order autoregressive process:
2. moving average Model (MA): the moving average model focuses on the accumulation of error terms in the autoregressive model; the formula definition of the q-order autoregressive process:
3. differential autoregressive moving average model (ARIMA): AR is autoregressive, p is an autoregressive term, MA is a moving average, q is the number of terms of the moving average, and d is the number of differences made when the time series becomes stationary;
in the formula: y istIs the current predicted value, mu is a constant term, p, q are orders, gammaiAnd thetaiIs the autocorrelation coefficient, yt-iFor the first few data of the sequence, etIs an error;
4. the model construction steps are as follows:
4.1. data pre-processing
The original traffic flow data sequence is { B (t) }, which is generally non-stationary, and it is differenced, i.e., ordered
yn=B(t-n)B(t),
Wherein the content of the first and second substances,is a combination coefficient; d-order difference of { B (t) }For ARMA (p, q) sequence, we call { B (t) } a differential autoregressive moving average model of (p, d, q) order, denoted ARIMA (p, d, q);
4.2. stability determination of differential sequences
Sequencing the time series according to the time period by adopting a Daniel trend test method to obtain Y1,Y2,…,YN(serial numbers arranged by year), sorting the time values from small to large to obtain corresponding serial numbers X1,X2,…,XNThe statistical test applies a rank correlation coefficient of:
in the formula: di=Xi-Yi(ii) a And N is the data volume.
The p and q orders are determined by the autocorrelation function (ACF) and the partial autocorrelation function (PACF):
4.3.1. autocorrelation function ACF:
the autocorrelation function of the ordered random variable sequence compared with itself reflects the correlation formula of the values of the same sequence in different sequences:
variation of a variable from itself, ytAnd yt-1To ytAnd yt-kCorrelation coefficient of (1), hysteresis point of order k, [ rho ]KIs in the range of [ -1,1 [ ]];
4.3.2. Partial autocorrelation function (PACF):
for a stationary ar (p) model, when the lag k autocorrelation coefficient p (k) is found, it is not actually a pure correlation between x (t) and x (t-k). x (t) is simultaneously influenced by intermediate k-1 random variables x (t-1), x (t-2) and … x (t-k +1), and the k-1 random variables have a correlation relation with x (t-k), so that the influence of other variables on x (t) and x (t-k) is actually doped in the autocorrelation coefficient p (k), and the correlation degree of the influence of x (t) and x (t-k) is obtained after the interference of the intermediate k-1 random variables x (t-1), x (t-2) and … x (t-k +1) is eliminated;
4.3.3 validation methods, table below:
tail cutting: within the confidence interval, AR (p) sees PACE, MA (q) sees ACF;
4.4. selecting an optimal model: the subjectivity of rank determination according to the autocorrelation function and the partial autocorrelation function is compensated through a BIC criterion, a relatively optimal fitting model is searched in a limited rank range, a Bayesian information criterion is a common criterion for model selection, a model with the minimum BIC value is generally selected,
BIC is defined as: BIC (T) log (n) T-2log (L)
In the formula: t is the number of parameters in the model, and L is the maximum likelihood function of the model;
in the case of ARIMA model, from the values of P and q obtained above, P ∈ [0, P ] is obtained],Q∈[0,q]D, M can be matchedn,n is 1, …, and P is Q model, and the parameter of each candidate model is assumed to be thetanParameter θnIs Pr (theta)n|Mn) Then give dataThen, Mn,The posterior probability of (a) is:
Pr(Mn|B)∝Pr(Mn)Pr(B|Mn)
∝Pr(Mn)*∫Pr(B|θnMn)Pr(θn|Mn)dθn
two different models MnAnd MlWe compare their posterior probabilities:
if the above ratio is greater than 1, we select model MnIn the above formula
Referred to as bayesian factors, which measure the contribution of the training set to the posterior probability,
in general, we assume that the prior distributions for the different models are the same, which is obtained based on the so-called Laplace approximation:
in the formula:representing maximum likelihood estimates of parameters, dnDenotes thetanThe dimension(s) of (a) is,
the BIC can be obtained by multiplying (-2), and the smaller the BIC value is, the more preferable the model is;
4.5. model normalized residual test
The residuals of the model are examined for a normal distribution with a mean of 0 and a constant variance. The residual means an observed value and a predicted value (difference between fitted values), i.e., observed value BtAnd the value predicted from the modelThe difference, denoted by e, for the checking of the normality of epsilon can be done by analysis of the normalized residual, which is the value obtained by dividing the residual by its standard deviation, also called Pearson residual, with ReThus, the normalized residual for the ith observation is:
If the distribution of the normalized residual errors follows normal distribution, the error term epsilon follows normal distribution, and about 95% of the normalized residual errors fall between (-2, 2);
step 3, predicting the number of vehicles in a set period, forming two time sequences through stored historical data, wherein the two time sequences respectively adopt the model in the step 2, realizing the stable operation of the data by using a difference method, then carrying out order fixing on model parameters (p, d, q), determining an optimal model by using a BIC (building information center) criterion, then carrying out standardized residual error inspection on the model, determining the reliability of the model, predicting the traffic flow in the next time period, comparing the standardized residual errors generated by the two time sequences, and selecting the minimum result as the final result of traffic flow prediction;
in the embodiment, the number of vehicles in a certain period needs to be predicted, and two time sequences are formed through stored historical data, wherein one time sequence is formed according to the previous 10 periods of the current period needing to be predicted, and the other time sequence is formed by acquiring ten pieces of traffic flow data of the same time node in the database on different dates according to the current time node. And the two time sequences respectively utilize the models, utilize a difference method to realize the stable operation of data, then carry out order fixing on model parameters (p, d, q), determine an optimal model by utilizing a BIC criterion, then carry out standardized residual error test on the model, determine the reliability of the model, and then predict the traffic flow in the hour period in the future. Comparing the standardized residuals generated by the two time sequences, and selecting the minimum result as the final result of traffic flow prediction;
step 4, adopting the data of the traffic flow and the video detection analysis predicted in the step 3, and accurately timing signal lamps of the intersection by utilizing a genetic algorithm by taking the minimum delay time obtained by using a transition delay model as a target; the method comprises the following steps:
1. transition delay model:
1.1. the parameters used by the model are as follows: c: a signal period duration; gg: green light time; gr: red light time;
λ: the entrance lane direction split ratio is calculated according to the formula: λ ═ Gg/C;qa: the actual traffic arrival flow at the entrance lane; q: road traffic capacity; s: road saturation flow; y: the inlet passage traffic flow ratio is calculated according to the formula: q isa/C;Xs: and (3) the saturation in the direction of the entrance, calculating the formula:Tw: observing the set time; du: average delay time of the vehicle; dr: vehicle random arrival delay time; n is a radical ofa: average number of vehicles left;
XS0: an intersection saturation critical value;
1.2. transition delay model:
the average delay time of the vehicle is calculated according to the following formula:
the vehicle random arrival delay time is calculated according to the following formula:
the average number of retained vehicles and the intersection saturation critical value are calculated according to the following formula:
1.3. optimizing the transition model: according to the evaluation indexes of the road condition of the intersection, in order to alleviate the traffic pressure and obtain the optimal signal timing, on one hand, the traffic capacity of the road needs to be improved, and on the other hand, the average delay time needs to be reduced, so that the following objective function is obtained:
for the multi-objective problem, generally, the objective is converted into a general objective for optimization, and because the units of two parameter indexes are different, the two parameter indexes are subjected to non-dimensionalization processing to obtain a multi-objective joint optimization function:
in the formula: d0The initial total average delay time of the vehicle at the intersection; q0The initial traffic capacity of the intersection; beta is the weight of the average delay time of the intersection;
1.4. and (3) modifying the optimization model: in order to reduce the stopping time of vehicles at each intersection, a group of adjacent signalized intersections on a trunk road are connected for coordination control, and a trunk intersection coordination control system, called drive-by-wire for short, is generated. Based on the thought, the multi-target joint optimization function is corrected, and the purpose of line control is achieved. Introducing a variable parameter gamma to correct the original average delay time so as to achieve the purpose of emphasizing the importance of the trunk line, wherein the corrected average delay time model has the following calculation formula:
in the formula: n is the number of elements of the set N capable of evacuating the phases of the vehicles on the main road, gammaiAs a set, the correction coefficients for phase i in N;
modified objective function:
1.5. model constraints comprising the steps of:
1.5.1. period of signal
If the signal period is too short, the vehicle is caused to start and stop frequently at the intersection, and if the period is too long, the vehicle waiting time is caused to be too long, the delay time of the vehicle is increased, so that the constraint is that:
Cmin≤C≤Cmax
1.5.2. split constraint
The higher the green ratio of a certain signal phase, the longer the green time of the phase, the shorter the green time of other phases, and the upper and lower limits are set so as to coordinate the smooth passing of vehicles at each phase through the intersection, and the upper limit cannot be larger than 1:
λmin≤λj≤λmax<1,λj=Gg,j/Cj
in the formula: gg,jGreen time for jth, phase;
1.6. in summary, the calculation formula of the modified transition delay model is as follows:
1.7. the correction involves a phase correction parameter γ, calculated by the formula γ ═ e μ +1, where μ is the ratio;
1.8. solving the weight beta to be 0.5 by using a genetic algorithm to obtain a timing optimization scheme;
2. solving by using a genetic algorithm:
2.1. and randomly generating chromosomes with a preset population number by adopting a binary coding method according to the number of the vehicles entering and leaving in the next two adjacent intersections A and B in each direction predicted in the first stage. Setting a period value, a population number, a chromosome length and an iteration total algebra;
2.2. setting a fitness function, setting an objective function as J, representing the average delay time of the intersection and needing to obtain the minimum value, wherein the fitness function is represented by Z, and the expression is Z-Omax-J, wherein OmaxIs the maximum estimated value;
2.3. calculating and screening adaptive function, and solving the fitness Z contacting the current populationtAnd t represents the current generationAnd (4) counting. To ZtThe data in (1) is processed,whereinIs the maximum value of fitness in the t generation population;
2.4. according to a proportional selection method, for the processed ZtProcessing corresponding chromosome, selecting chromosome group as new population, and screening out nth chromosome with probability of
2.5. Performing cross operation on the candidate solution according to a random extraction number in the candidate solution group at a preset cross rate;
2.6. extracting candidate solutions according to a predetermined hybridization and mutation rate to carry out crossover and mutation operations;
2.7. calculating the objective function value of each candidate solution, and eliminating the worst objective function value in the candidate solutions according to the selected elimination rate, wherein the lacking position is generated from the better solution of the objective function;
2.8. judging whether the preset iteration times are reached, if so, continuing the next step, and otherwise, turning to the step 2.5 to repeat the step for calculation;
2.9. and calculating the optimal timing of each phase.
The above-mentioned embodiments are merely illustrative of the preferred embodiments of the present invention, and do not limit the scope of the present invention, and various modifications and improvements of the technical solution of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the appended claims.
Claims (6)
1. A raspberry group-based intelligent timing traffic light control method is characterized in that: the method comprises the following steps:
step 1, collecting road conditions and vehicle information in real time by using a plurality of high-definition cameras, compressing the collected information into an h264 format, and transmitting the compressed information to a raspberry host computer;
step 2, predicting the hourly traffic flow by utilizing a differential autoregressive moving average model in a raspberry dispatching computer system;
step 3, predicting the number of vehicles in a set period, forming two time sequences through stored historical data, wherein the two time sequences respectively adopt the model in the step 2, realizing the stable operation of the data by using a difference method, then carrying out order fixing on model parameters (p, d, q), determining an optimal model by using a BIC (building information center) criterion, then carrying out standardized residual error inspection on the model, determining the reliability of the model, predicting the traffic flow in the next time period, comparing the standardized residual errors generated by the two time sequences, and selecting the minimum result as the final result of traffic flow prediction;
and 4, accurately timing signal lamps of the intersection by using a genetic algorithm by using the data of the traffic flow and the video detection analysis predicted in the step 3 and aiming at obtaining the minimum delay time by using a transition delay model.
2. The raspberry-based intelligent timing traffic light control method according to claim 1, characterized in that: in the step 1, OpenCV is dispatched through raspberries to operate information, vehicles in the information are captured, vehicles of continuous frames in the information are tracked, and finally the tracked vehicles are counted and classified.
3. The raspberry-based intelligent timing traffic light control method according to claim 1, characterized in that: in step 2, the differential autoregressive moving average model is calculated and constructed by adopting an autoregressive model (AR), a moving average Model (MA) and a differential autoregressive moving average model (ARIMA).
4. The raspberry-based intelligent timing traffic light control method according to claim 1, characterized in that: in step 3, one of the two time sequences is a time sequence formed according to the first 10 periods of the current required prediction period, and the other is a time sequence formed by acquiring ten pieces of traffic flow data of the same time node on different dates in the database according to the current time node.
5. The raspberry-based intelligent timing traffic light control method according to claim 1, characterized in that: in step 4, the transition delay model includes the following steps:
5.1. the parameters used by the model are as follows: c: a signal period duration; gg: green light time; gr: red light time;
λ: the entrance lane direction split ratio is calculated according to the formula: λ ═ Gg/C;qa: the actual traffic arrival flow at the entrance lane; q: road traffic capacity; s: road saturation flow; y: the inlet passage traffic flow ratio is calculated according to the formula: q isa/C;Xs: and (3) the saturation in the direction of the entrance, calculating the formula:Tw: observing the set time; du: average delay time of the vehicle; dr: vehicle random arrival delay time; n is a radical ofa: average number of vehicles left;
XS0: an intersection saturation critical value;
5.2. transition delay model:
the average delay time of the vehicle is calculated according to the following formula:
the vehicle random arrival delay time is calculated according to the following formula:
the average number of retained vehicles and the intersection saturation critical value are calculated according to the following formula:
5.3. optimizing the transition model: according to the evaluation indexes of the road condition of the intersection, in order to alleviate the traffic pressure and obtain the optimal signal timing, on one hand, the traffic capacity of the road needs to be improved, and on the other hand, the average delay time needs to be reduced, so that the following objective function is obtained:
for the multi-objective problem, generally, the objective is converted into a general objective for optimization, and because the units of two parameter indexes are different, the two parameter indexes are subjected to non-dimensionalization processing to obtain a multi-objective joint optimization function:
in the formula: d0The initial total average delay time of the vehicle at the intersection; q0The initial traffic capacity of the intersection; beta is the weight of the average delay time of the intersection;
5.4. and (3) modifying the optimization model: in order to reduce the stopping time of a vehicle at each intersection, a group of adjacent signalized intersections on a trunk road are connected for coordination control to generate a trunk intersection coordination control system, called drive-by-wire for short, based on the thought, a multi-target joint optimization function is corrected to achieve the purpose of drive-by-wire, a variable parameter gamma is introduced to correct the original average delay time to achieve the purpose of emphasizing the importance of the trunk road, and the corrected average delay time model has the following calculation formula:
in the formula: n is the number of elements of the set N capable of evacuating the phases of the vehicles on the main road, gammaiAs a set, the correction coefficients for phase i in N;
modified objective function:
5.5. model constraints comprising the steps of:
5.5.1. period of signal
If the signal period is too short, the vehicle is caused to start and stop frequently at the intersection, and if the period is too long, the vehicle waiting time is caused to be too long, the delay time of the vehicle is increased, so that the constraint is that:
Cmin≤C≤Cmax
5.5.2. split constraint
The higher the green ratio of a certain signal phase, the longer the green time of the phase, the shorter the green time of other phases, and the upper and lower limits are set so as to coordinate the smooth passing of vehicles at each phase through the intersection, and the upper limit cannot be larger than 1:
λmin≤λj≤λmax<1,λj=Gg,j/Cj
in the formula: gg,jGreen time for the j-th phase;
5.6. in summary, the calculation formula of the modified transition delay model is as follows:
5.7. the correction involves a phase correction parameter γ, calculated by the formula γ ═ e μ +1, where μ is the ratio;
5.8. and (5) solving by using a genetic algorithm by making the weight beta equal to 0.5 to obtain a timing optimization scheme.
6. The raspberry-based intelligent timing traffic light control method according to claim 1, characterized in that: in step 4, the genetic algorithm comprises the following steps:
6.1. according to the number of vehicles entering and exiting from the adjacent two intersections A and B in the next period in all directions, which is obtained by prediction in the first stage, a binary coding method is adopted, chromosomes of a preset population number are randomly generated, and a period value, the population number, the length of the chromosomes and an iteration total algebra are set;
6.2. setting a fitness function, setting an objective function as J, representing the average delay time of the intersection and needing to obtain the minimum value, wherein the fitness function is represented by Z, and the expression is Z-Omax-J, wherein OmaxIs the maximum estimated value;
6.3. calculating and screening adaptive function, and solving the fitness Z contacting the current populationtT represents the current population generation, for ZtThe data in (1) is processed,whereinIs the maximum value of fitness in the t generation population;
6.4. according to a proportional selection method, for the processed ZRProcessing corresponding chromosome, selecting chromosome group as new population, and screening out nth chromosome with probability of
6.5. Performing cross operation on the candidate solution according to a random extraction number in the candidate solution group at a preset cross rate;
6.6. extracting candidate solutions according to a predetermined hybridization and mutation rate to carry out crossover and mutation operations;
6.7. calculating the objective function value of each candidate solution, and eliminating the worst objective function value in the candidate solutions according to the selected elimination rate, wherein the lacking position is generated from the better solution of the objective function;
6.8. judging whether the preset iteration times are reached, if so, continuing the next step, and if not, switching to the 6.5 th step to repeat the calculation of the step;
6.9. and calculating the optimal timing of each phase.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110803564.9A CN113706860B (en) | 2021-07-14 | 2021-07-14 | Intelligent timing traffic light control method based on raspberry group |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110803564.9A CN113706860B (en) | 2021-07-14 | 2021-07-14 | Intelligent timing traffic light control method based on raspberry group |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113706860A true CN113706860A (en) | 2021-11-26 |
CN113706860B CN113706860B (en) | 2022-08-16 |
Family
ID=78648761
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110803564.9A Active CN113706860B (en) | 2021-07-14 | 2021-07-14 | Intelligent timing traffic light control method based on raspberry group |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113706860B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114333361A (en) * | 2022-02-22 | 2022-04-12 | 南京慧尔视智能科技有限公司 | Signal lamp timing method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108665715A (en) * | 2018-05-09 | 2018-10-16 | 上海电科智能系统股份有限公司 | A kind of road junction intelligent traffic is studied and judged and signal optimizing method |
CN109191841A (en) * | 2018-09-17 | 2019-01-11 | 天津中德应用技术大学 | A kind of urban transportation intelligent management system based on raspberry pie |
CN110517510A (en) * | 2019-08-27 | 2019-11-29 | 华侨大学 | Based on the Intersections timing designing method for improving Webster function and genetic algorithm |
CN110751834A (en) * | 2019-10-23 | 2020-02-04 | 长安大学 | Method for optimizing signal timing of urban saturated intersection |
CN111739284A (en) * | 2020-05-06 | 2020-10-02 | 东华大学 | Traffic signal lamp intelligent timing method based on genetic algorithm optimization fuzzy control |
WO2020259301A1 (en) * | 2019-06-26 | 2020-12-30 | 南京慧尔视智能科技有限公司 | Method and device for calculating delay time and number of stops of vehicles at intersection |
-
2021
- 2021-07-14 CN CN202110803564.9A patent/CN113706860B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108665715A (en) * | 2018-05-09 | 2018-10-16 | 上海电科智能系统股份有限公司 | A kind of road junction intelligent traffic is studied and judged and signal optimizing method |
CN109191841A (en) * | 2018-09-17 | 2019-01-11 | 天津中德应用技术大学 | A kind of urban transportation intelligent management system based on raspberry pie |
WO2020259301A1 (en) * | 2019-06-26 | 2020-12-30 | 南京慧尔视智能科技有限公司 | Method and device for calculating delay time and number of stops of vehicles at intersection |
CN110517510A (en) * | 2019-08-27 | 2019-11-29 | 华侨大学 | Based on the Intersections timing designing method for improving Webster function and genetic algorithm |
CN110751834A (en) * | 2019-10-23 | 2020-02-04 | 长安大学 | Method for optimizing signal timing of urban saturated intersection |
CN111739284A (en) * | 2020-05-06 | 2020-10-02 | 东华大学 | Traffic signal lamp intelligent timing method based on genetic algorithm optimization fuzzy control |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114333361A (en) * | 2022-02-22 | 2022-04-12 | 南京慧尔视智能科技有限公司 | Signal lamp timing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN113706860B (en) | 2022-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110164128B (en) | City-level intelligent traffic simulation system | |
CN110097755B (en) | Highway traffic flow state identification method based on deep neural network | |
CN108346293B (en) | Real-time traffic flow short-time prediction method | |
CN109785618B (en) | Short-term traffic flow prediction method based on combinational logic | |
CN109345832B (en) | Urban road overtaking prediction method based on deep recurrent neural network | |
CN111079640B (en) | Vehicle type identification method and system based on automatic amplification sample | |
CN114023062B (en) | Traffic flow information monitoring method based on deep learning and edge calculation | |
CN112084890B (en) | Method for identifying traffic signal sign in multiple scales based on GMM and CQFL | |
CN111179592B (en) | Urban traffic prediction method and system based on spatio-temporal data flow fusion analysis | |
CN113051811B (en) | Multi-mode short-term traffic jam prediction method based on GRU network | |
CN111784017A (en) | Road condition factor regression analysis-based road traffic accident quantity prediction method | |
CN113706860B (en) | Intelligent timing traffic light control method based on raspberry group | |
CN111524345B (en) | Induction control method for multi-objective optimization under constraint of real-time queuing length of vehicle | |
CN111950583B (en) | Multi-scale traffic signal sign recognition method based on GMM (Gaussian mixture model) clustering | |
CN115662113A (en) | Signalized intersection people-vehicle game conflict risk assessment and early warning method | |
CN107730882B (en) | Road congestion prediction system and method based on artificial intelligence | |
CN114842285A (en) | Roadside berth number identification method and device | |
CN110751829A (en) | Vehicle queuing dissipation time prediction method based on image self-learning | |
CN112991399B (en) | Bus passenger number detection system based on RFS | |
CN111127887B (en) | Signal control optimization system and method based on real-time traffic state driving | |
CN115796030A (en) | Traffic flow prediction method based on graph convolution | |
CN116386020A (en) | Method and system for predicting exit flow of highway toll station by multi-source data fusion | |
CN115223087A (en) | Group control elevator traffic mode identification method | |
CN114926819A (en) | Unknown abnormal obstacle identification method and system for complex scene | |
TWM618607U (en) | Automated traffic steering quantitative survey report production system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |