A kind of large-scale road network signal lamp presumption method
Technical field
The present invention relates to field of traffic control, refer in particular to a kind of large-scale road network signal lamp presumption method.
Background technology
Existing many traffic signal timing schemes do not have adaptivity, the reason is that the formulation of these traffic signal timing schemes
The mode that criterion is derived from road experience or theoretical calculation mostly obtains the timing schemes of several groups of fixed time periods, no
It can be suitably used for various roads environment;Some traffic signal timing scheme has adaptivity, but due to original initial configuration
Scheme does not have adaptivity, causes the adaptivity of this kind of timing scheme not very good.
Since signal lamp is large number of, and timing scheme does not have adaptivity, so usually in traffic administration often
It is difficult to which the timing to traffic lights is effectively estimated.
Invention content
In order to solve the problems, such as that the prior art is difficult effectively to be estimated to the timing of traffic lights, the present invention proposes
A kind of large-scale road network signal lamp estimates method, and carrying out adaptive map to road network by calculating Signal Density situation draws
Point, realize the load balancing that the traffic signal timing optimization time calculates in multiple blocks, it is great with Hadoop distributed systems
The efficiency of the generation of road network map division is improved, traffic signal timing scheme has adaptivity and real-time, can effectively optimize
Road is original or the timing duration problem of newly-increased signal lamp.
The technical solution adopted in the present invention is:A kind of large-scale road network signal lamp presumption method, includes the following steps:
S1 obtains road network information:Selected road network A obtains the signal lamp quantity S in road network A from road network information database0、
Signal optimization calculates duration T0, crossing number N, the vehicle flowrate D in each section, each section running time T, and obtain each signal lamp
GPS position information and each section GPS position information;
S2, road network map divide:Road network A is horizontally divided into MiBlock is vertically divided into NjRoad network A is divided into M by blockiNjA area
Block passes through GPS information and the block M of each signal lampiNjGPS information carry out matching primitives, determine signal lamp in the area of road network A
Block MiNjInterior distribution situation, and so on determine distribution situation of the signal lamp in other blocks;
S3, the adaptive timing of signal lamp;
S4, the Distributed Calculation based on Hadoop.
Preferably, in the step S2, block M of the signal lamp in road network AiNjThe determination step of interior distribution situation is such as
Under:
A. signal lamp error radius is calculated:
B. the block M of road network A is calculatediNjInterior alternative section:It is set to center with target position signal lamp position, it is ellipse with error
Round major semiaxis is all sections fallen in this region in the border circular areas of radius;
C. location matches:The air line distance in each alternative section is calculated, distance minimum is considered Optimum Matching section.
Preferably, in the step a, the computational methods of the signal lamp error radius are:
Assuming that the random error of signal lamp GPS position information meets the variance-covariance matrix model of system, it is
Wherein σx、σyIt is the standard deviation of signal location error,It is the variance of signal location error, σxy、σyx
It is the covariance of signal location error, then error ellipse formula is as follows:
Wherein a is the major semiaxis of error ellipse, and b is the semi-minor axis of error ellipse, φ be the long axis of error ellipse be orientated with
Direct north angle.
Preferably, in the step c, the calculating of location matches is as follows:
If the intersection point of error ellipse and road is respectively:(x1,y1), (x2,y2), then it is by the linear equation of intersection pointWherein a=1,
Coordinate is (x0,y0) signal lamp to the straight line distanceSo that it is determined that signal lamp (x0,
y0) in the block M of road network AiNjIn position, can similarly calculate the signal lamp quantity S of each block of all road network A0。
Preferably, in the step S3, M is selectediNjArea's road in the block, this road NnThere is n four crossway
Mouth N, 4 directions of each crossroad are expressed asLeft-hand rotation, right-hand rotation and straight trip three classes traveling side
To time be T respectivelyTurn left、TIt turns rightAnd TStraight trip, when timing designing of signal lamp a length of T0, the specific step of the adaptive timing of signal lamp
It is rapid as follows:
(i) all directions vehicle flowrate of corresponding period is extracted from database be expressed as DTurn left、DIt turns rightAnd DStraight tripAnd congestion in road
Rate β;
(ii) according to the period T of the crossroad travel direction of settingTurn left, TIt turns rightAnd TStraight trip, and correspond to each side of period
To vehicle flowrate DTurn left, DIt turns rightAnd DStraight tripHistogram is drawn to analyze data:
When the travel direction in crossing direction is straight trip, normal vehicle operation, usual cycle time is 1 hour, certain
Cycle time TStraight tripIt is interior, study every 30 seconds vehicle flowrate data DStraight trip.With cycle time TStraight tripInterior every 30 seconds are horizontal axis x, corresponding
Vehicle flowrate data are that longitudinal axis y establishes histogram, and the data distribution on histogram indicates corresponding vehicle flowrate in cycle time section, leads to
Least square method is crossed by histogram-fitting into curve, method is as follows:Equipped with function y=f (x), there is i a mutually different in plane
The distance of point (x, y), point to function is di, fitting criterion is to make i and function y=f (xi) distance quadratic sum it is minimum,
I.e.It can similarly obtainThe travel direction in crossing direction is the histogram for turning left and turning right;
Judge that certain crossroad turns left whether to need that green light, crossroad is separately providedThe vehicle flowrate in direction is denoted as DTurn left,The vehicle flowrate in direction is denoted as D'Straight trip, threshold θ is arranged according to practical vehicle flowrate situation1And θ2, work as DTurn left>θ1And D'Straight trip>θ2Shi Zuo
Turn that green light should be separately provided;
It is k that can obtain the average vehicle flow in cycle time by histogram calculation, and highest vehicle flowrate is h, minimum vehicle flowrate
For l, then the timing calculation of green light is obtained by function f (k, h, l):
N1 1TIt is green=f (k, h, l)=α1k+α2h+α3l(α1, α2, α3For parameter);
Direction can similarly be obtainedWithGreen light timing, be N respectively1 2TIt is green、N1 3TIt is greenAnd N1 4TIt is green;Due to signal lamp
Phase setting principle, N1 1TIt is red=N1 2TIt is green, directionWithRed light timing, be N respectively1 2TIt is red、N1 3TIt is redAnd N1 4TIt is red;
In new traffic signal timing, congestion rate β is calculated1IfThen timing is reasonable;IfThen timing is unreasonable, again through histogram analysis data, Optimal Parameters α1, α2, α3This makes it possible to obtain this
The timing designing duration T of crossroad individual signals lamp0, similarly estimate and obtain each block MiNjThe signal of all crossroad N
Lamp calculates duration To';
Road network A is repartitioned according to the timing designing time of Signal Density and entire road network A, keeps traffic signal timing excellent
Change time calculation amount load balancing, and the M that new road network is dividediNjArea's signal location information in the block is stored in data
In table.
Preferably, in the step S4, the Distributed Calculation based on Hadoop is as follows:
A. the record read from tables of data is divided into key-value pair<Kn,Vn>, n=1,2,3,4 ... N, wherein KnFor MiNjBlock
Number, VnFor block MiNjIncluding signal lamp location information;
B. distributed algorithm is by all M in road network AiNjIntegrated regulation is done in the timing of the signal lamp of block;
C. from the traffic signal timing scheme deposit road network A obtained in b step, a, b step are repeated according to result.
The beneficial effects of the invention are as follows:Adaptive map partitioning is carried out to road network by calculating Signal Density situation, it is real
The load balancing that the traffic signal timing optimization time calculates in existing multiple blocks, greatly improves with Hadoop distributed systems
The efficiency for the generation that road network map divides, the presumption for traffic signal timing scheme, by analyzing special bus flow historical data,
One group of signal lamp initial configuration scheme is conducive to road and passes unimpeded so that signal lamp adaptively adjusts timing on setting road;This hair
The traffic signal timing scheme of bright formulation has adaptivity and real-time, the even daily signal lamp duration of each cycle time section
It is different from, can effectively optimize that road is original or the timing duration problem of newly-increased signal lamp.
Description of the drawings
Fig. 1 is a kind of flow diagram of the present invention;
Fig. 2 is the schematic diagram of road network A of the present invention;
Fig. 3 is crossing N of the present inventionnSchematic diagram;
Fig. 4 is the curve histogram by least square fitting in step S3 of the present invention;
Fig. 5 is crossing left-hand rotation schematic diagram.
Specific implementation mode
The present invention is described in further detail with reference to the accompanying drawings and examples.
As shown in Figure 1, a kind of large-scale road network signal lamp estimates method, include the following steps:
S1 obtains road network information:Selected road network A obtains the signal lamp quantity S in road network A from road network information database0、
Signal optimization calculates duration T0, crossing number N, the vehicle flowrate D in each section, each section running time T, and obtain each signal lamp
GPS position information and each section GPS position information.
S2, road network map divide:As shown in Fig. 2, road network A is horizontally divided into MiBlock is vertically divided into NjBlock, i.e., by road network A points
At MiNjA block passes through GPS information and the block M of each signal lampiNjGPS information carry out matching primitives, determine that signal lamp exists
The block M of road network AiNjInterior distribution situation, and so on determine distribution situation of the signal lamp in other blocks.
Wherein, block M of the signal lamp in road network AiNjSteps are as follows for the determination of interior distribution situation:
A. signal lamp error radius is calculated:
B. the block M of road network A is calculatediNjInterior alternative section:It is set to center with target position signal lamp position, it is ellipse with error
Round major semiaxis is all sections fallen in this region in the border circular areas of radius;
C. location matches:The air line distance in each alternative section is calculated, distance minimum is considered Optimum Matching section.
In above-mentioned steps a, the computational methods of the signal lamp error radius are:
Assuming that the random error of signal lamp GPS position information meets the variance-covariance matrix model of system, it is
Wherein σx、σyIt is the standard deviation of signal location error,It is the variance of signal location error, σxy、σyx
It is the covariance of signal location error, then error ellipse formula is as follows:
Wherein a is the major semiaxis of error ellipse, and b is the semi-minor axis of error ellipse, φ be the long axis of error ellipse be orientated with
Direct north angle.
In step c, the calculating of location matches is as follows:
If the intersection point of error ellipse and road is respectively:(x1,y1), (x2,y2), then it is by the linear equation of intersection pointWherein a=1,Coordinate is (x0,y0) signal lamp is to the straight line
DistanceSo that it is determined that signal lamp (x0,y0) in the block M of road network AiNjIn position, similarly may be used
To calculate the signal lamp quantity S of each block of all road network A0。
S3, the adaptive timing of signal lamp.
In step S3, M is selectediNjArea's road in the block, as shown in figure 3, this road NnThere is n crossroad N,
4 directions of each crossroad are expressed asLeft-hand rotation, right-hand rotation and straight trip three classes travel direction
Time be T respectivelyTurn left、TIt turns rightAnd TStraight trip, when timing designing of signal lamp a length of T0, the specific steps of the adaptive timing of signal lamp
It is as follows:
(i) all directions vehicle flowrate of corresponding period is extracted from database be expressed as DTurn left、DIt turns rightAnd DStraight tripAnd congestion in road
Rate β;
(ii) according to the period T of the crossroad travel direction of settingTurn left, TIt turns rightAnd TStraight trip, and correspond to each side of period
To vehicle flowrate DTurn left, DIt turns rightAnd DStraight tripHistogram is drawn to analyze data:
When the travel direction in crossing direction is straight trip, normal vehicle operation, usual cycle time is 1 hour, certain
Cycle time TStraight tripIt is interior, study every 30 seconds vehicle flowrate data DStraight trip.With cycle time TStraight tripInterior every 30 seconds are horizontal axis x, corresponding
Vehicle flowrate data are that longitudinal axis y establishes histogram, and the data distribution on histogram indicates corresponding vehicle flowrate in cycle time section, leads to
Least square method is crossed by histogram-fitting at curve, as shown in figure 4, method is as follows:Equipped with function y=f (x), there are i in plane
The distance of mutually different point (x, y), point to function is di, fitting criterion is to make i and function y=f (xi) distance it is flat
Side and minimum, i.e.,It can similarly obtainThe travel direction in crossing direction is the histogram for turning left and turning right;
As shown in figure 5, judging that certain crossroad turns left whether to need that green light, crossroad is separately providedThe wagon flow in direction
Amount is denoted as DTurn left,The vehicle flowrate in direction is denoted as D'Straight trip, threshold θ is arranged according to practical vehicle flowrate situation1And θ2, work as DTurn left>θ1And
D'Straight trip>θ2Green light should be separately provided in Shi Zuozhuan;
It is k that can obtain the average vehicle flow in cycle time by histogram calculation, and highest vehicle flowrate is h, minimum vehicle flowrate
For l, then the timing calculation of green light is obtained by function f (k, h, l):
N1 1TIt is green=f (k, h, l)=α1k+α2h+α3l(α1, α2, α3For parameter);
Direction can similarly be obtainedWithGreen light timing, be N respectively1 2TIt is green、N1 3TIt is greenAnd N1 4TIt is green;Due to signal lamp
Phase setting principle, N1 1TIt is red=N1 2TIt is green, directionWithRed light timing, be N respectively1 2TIt is red、N1 3TIt is redAnd N1 4TIt is red;
In new traffic signal timing, congestion rate β is calculated1IfThen timing is reasonable;IfThen timing is unreasonable, again through histogram analysis data, Optimal Parameters α1, α2, α3This makes it possible to obtain this
The timing designing duration T of crossroad individual signals lamp0, similarly estimate and obtain each block MiNjThe signal of all crossroad N
Lamp calculates duration To'。
Here congestion rate calculates the speed of service and lane occupancy ratio that can refer to different function grade road, and 8% is
According to the experience percentage that road traffic is set, value can be optimized by actual conditions by be not limited to fixed constant
8%.
Road network A is repartitioned according to the timing designing time of Signal Density and entire road network A, keeps traffic signal timing excellent
Change time calculation amount load balancing, and the M that new road network is dividediNjArea's signal location information in the block is stored in data
In table.
S4, the Distributed Calculation based on Hadoop.Distributed Calculation based on Hadoop is as follows:
A. the record read from tables of data is divided into key-value pair<Kn,Vn>, n=1,2,3,4 ... N, wherein KnFor MiNjBlock
Number, VnFor block MiNjIncluding signal lamp location information;
B. distributed algorithm is by all M in road network AiNjIntegrated regulation is done in the timing of the signal lamp of block;
C. from the traffic signal timing scheme deposit road network A obtained in b step, a, b step are repeated according to result.
By above step, calculates Signal Density situation and adaptive map partitioning is carried out to road network, realize multiple blocks
The load balancing that the interior traffic signal timing optimization time calculates greatly improves road network map with Hadoop distributed systems and draws
The efficiency of the generation divided, traffic signal timing scheme have adaptivity and real-time, it is original or newly-increased effectively to optimize road
The timing duration problem of signal lamp.
Above example is merely illustrative of the invention's technical idea, and protection scope of the present invention cannot be limited with this, every
According to technological thought proposed by the present invention, any change done on the basis of technical solution each falls within the protection model of the present invention
Within enclosing.