Summary of the invention
The present invention proposes a kind of automatic traffic behavior decision method of taking into account accuracy and real-time, and it is specially a kind of method based on annular coil of signal lamp system differentiation road traffic state, comprising:
A, by occupation rate and track average velocity in flow, track cycle in the toroid winding detector acquisition track cycle;
B, with the track in the cycle flow, track in the cycle occupation rate and track average velocity be scaled section average velocity, section average occupancy and bicycle average occupancy respectively, through after misdata reparation and the data smoothing processing, deposit section average velocity, section average occupancy and bicycle average occupancy in database as historical data again;
C, after the historical data in the accumulation predetermined period, at first to the data normalization of predetermined period, with three kinds of different raw data be converted into no unit and the identical data of the order of magnitude, to find the solution cluster centre based on the data after the standardization again, so that the Weighted distance quadratic sum of each sample to three cluster centre reaches minimum, three cluster centres are corresponding unimpeded respectively, crowded, three class traffic behaviors block up, according to the variable standardization formula cluster centre is carried out reverse computing, obtain three kinds of traffic behaviors by section average velocity, the section average occupancy, the cluster centre vector that the bicycle average occupancy is formed, and judge respectively corresponding which kind of traffic behavior of each vector based on vector;
D, current real time traffic data is carried out after the pre-service, calculate Euclidean distance respectively with described three cluster centres, obtain the cluster centre with current real time traffic data Euclidean distance minimum, judge the traffic behavior of current traffic behavior for the cluster centre correspondence of this Euclidean distance minimum;
E, the current traffic behavior that will judge are reflected on the electronic chart with colour code intuitively.
Wherein, finding the solution cluster centre among the step C comprises the steps:
C11, initialization are according to the given exponential factor m of result that parameter is determined, given iteration cut-off error ε>0, algorithm maximum iteration time TMaxAnd initial cluster center V0={v1,0, v2,0, v3,0;
C12, calculating Ut=[uIk, t], wherein, uIkBe the degree of membership of k sample to i cluster centre; Make Ut=[uIk, t], wherein, dIkBe k sample and i distances of clustering centers; If dIk=0, u thenIk, t=1, and to j ≠ i, uIk, t=0,1≤i≤3,1≤k≤n; If dIk, t>0, then
1≤i≤3,1≤k≤n;
C13, calculating VT+1=[v1, t+1, v2, t+1, v3, t+1],
1≤i≤3;
C14, judgement, ifOr t reaches maximum iteration time TMax, termination of iterations then; Otherwise, make t=t+1, get back to C11;
C15, the V when iteration stops are the cluster centre of asking.
Further, determine among the step C11 that the m value comprises the steps:
C111, the historical data sample X that collects according to detecting device calculate λMax[Cx];
C112: if λ
Max[C
x]<0.5, then
If
λMax[Cx] 〉=0.5, then m ∈ [1.5,2.5];
C113: with step-length is to carry out progressive optimizing between the m location among 0.1 couple of step2, calculates the distance between the corresponding all kinds of cluster centres of different m values, seeks the maximum m value of distance between all kinds of cluster centres that make classification.
Wherein, the computing formula of real-time traffic characteristic parameter and cluster centre Euclidean distance is among the step D:
Wherein: x represents through pretreated real-time traffic parameter vector; viRepresent i cluster centre vector; xj, vIjRepresent j parameter in real-time traffic parameter vector and the cluster centre vector respectively, j=1,2,3 represents section average velocity, section average occupancy and bicycle average occupancy respectively.
Simultaneously, step D also comprises: have only the traffic behavior in continuous two cycles all inconsistent with original traffic behavior, and these two cycle traffic behavior unanimities, the just traffic behavior of change output.
The present invention also proposes a kind of device based on annular coil of signal lamp system differentiation road traffic state, it is characterized in that comprising:
Data acquisition module is used for by toroid winding detector acquisition track flow, track occupation rate and track average velocity in the cycle in the cycle;
Data preprocessing module, be used for the track in the cycle flow, track in the cycle occupation rate and track average velocity be scaled section average velocity, section average occupancy and bicycle average occupancy respectively, through after misdata reparation and the data smoothing processing, deposit section average velocity, section average occupancy and bicycle average occupancy in database as historical data again;
Historical data cluster analysis module, be used for after the historical data in the accumulation predetermined period, at first to the data normalization of predetermined period, with three kinds of different raw data be converted into no unit and the identical data of the order of magnitude, to find the solution cluster centre based on the data after the standardization again, so that the Weighted distance quadratic sum of each sample to three cluster centre reaches minimum, three cluster centres are corresponding unimpeded respectively, crowded, three class traffic behaviors block up, according to the variable standardization formula cluster centre is carried out reverse computing, obtain three kinds of traffic behaviors by section average velocity, the section average occupancy, the cluster centre vector that the bicycle average occupancy is formed, and judge respectively corresponding which kind of traffic behavior of each vector based on vector;
The road traffic state discrimination module, be used for current real time traffic data is carried out after the pre-service, calculate Euclidean distance respectively with described three cluster centres, obtain the cluster centre with current real time traffic data Euclidean distance minimum, judge the traffic behavior of current traffic behavior for the cluster centre correspondence of this Euclidean distance minimum;
The road traffic state display module is used for the current traffic behavior that will judge and is reflected to electronic chart with colour code intuitively.
The present invention is from existing annular coil of signal lamp system data, selection can reflect the characteristic parameter of traffic behavior, consider signal lamp cycle, after raw data is carried out pre-service, auto-correlation pattern in green light cycle inner analysis coil image data, realize the automatic revision of traffic state judging standard, thereby determine road traffic state comparatively accurately.
Above-mentioned and other purpose, feature and advantage of the present invention will become clear and definite for those skilled in the art after the detailed description below having read in conjunction with the accompanying drawing that shows and describe specific embodiments of the invention.
Embodiment
The enforcement of the embodiment of the invention needs the historical data accumulation of certain hour, is that basic cluster goes out rational discrimination standard with historical data.
With time is horizontal ordinate (time shaft need comprise the crowded period), historical data with each traffic characteristic parameter of annular coil of signal lamp system collection is the ordinate mapping, can compare, crowded generation, lasting reaching in the evanishment, speed that the annular coil of signal lamp system detecting device collects and occupation rate parameter are all stronger to crowded time sensitivity and degree susceptibility, the susceptibility of flow then obviously a little less than.But occupation rate is divided by flow, and promptly the bicycle average occupancy then changes comparatively obvious.Therefore speed, occupation rate, bicycle average occupancy are the most suitable traffic characteristic parameters.Therefore, the present invention chooses the foundation that these parameters are used as judging traffic.
As shown in Figure 2, system administers and maintains module, Dynamic Data Acquiring module, dynamic data pretreatment module, data normalization module, historical data update module, historical data cluster analysis module, road traffic state discrimination module, road junction traffic behavior display module, data memory module by static data and constitutes.
Wherein static data is meant that road network geometric configuration, network topology structure etc. are long-term and changes little data, and relatively stable attribute datas such as highway section number of track-lines, grade.These data need be spent the bigger time initialized the time, need to carry out traffic study in case of necessity.The data structure of the highway section data that need safeguard is as follows:
Highway section between adjacent two crossings is except that the one-way road is single highway section, and the highway section of different trends numbering is different, and the start-stop node is opposite.
System's parameter conversion, misdata reparation, smoothing processing through the dynamic data pretreatment module after collecting the real-time green light cycle parameter data of annular coil of signal lamp system detecting device stores database afterwards into.
The pretreated idiographic flow of data is as follows.
A, valid data time set
Consider the laying place of annular coil of signal lamp system and the periodic characteristic of urban highway traffic, think valid data of data in the green time, because lamp system and toroid winding link, therefore can directly in system, set, only allow toroid winding return the interior detection data of green time.
B, input parameter convert
What the annular coil of signal lamp system detecting device provided is occupation rate and track average velocity in flow in the cycle of track, track cycle, so need further be scaled section average velocity, section average occupancy and bicycle average occupancy.
The section flow is:
Section average velocity is:
The section average occupancy is:
The bicycle average occupancy is:
In the formula: qi, oi, viRepresent the magnitude of traffic flow, time occupancy and average velocity in each lane detection cycle respectively; N represents number of track-lines.
C, misdata reparation
Random disturbance is more in the urban road, and misdata might appear in the raw data that directly collects by the toroid winding detecting device, if these data are directly used in the differentiation of traffic behavior, can influence the result of traffic behavior greatly.
Therefore can determine the last lower threshold value of section flow, section average occupancy and bicycle average occupancy according to the actual conditions of every road, thereby determine a valid interval,, then think misdata in case exceed this interval.Need utilize the weighted estimation of historical data and measured data to repair to misdata, its computing formula is:
In the formula: x(t)NewBe the data after t answers constantly; x(t-1)It is t-1 measured data constantly; x(t)OldBe t historical data constantly, i.e. t the previous day data constantly; α is a weighting coefficient, has reacted t-1 measured data and t historical data role in data repair constantly constantly, and α is big more, and measured data is big more to the data influence after repairing, and vice versa.α can determine desired value according to actual measurement.
D, data smoothing are handled
Smoothing processing adopts the method for moving average, its objective is for the traffic of removing short-term to disturb, and concrete formula is as follows:
In the formula: x '(t)It is the moving average of t period.M is the data number that moving average calculation is got; The size of m is very big to the smooth effect influence, and m obtains little, and smooth curve is highly sensitive, but the poor performance of anti-random disturbance; M obtains very big, and it is good that anti-random disturbance gets performance, but sensitivity is low, and is insensitive to new variation tendency.So the selection of m is the key of the method for moving average.At concrete problem, when selecting m, should consider the length that how much reaches data collection cycle of object time series data.In general, m gets 3.
When data accumulation to certain fate, but just starting algorithm.The whole algorithm flow process of the cluster analysis module of historical data as shown in Figure 3.
At first historical data being carried out data normalization handles, because the unit and the order of magnitude of speed, occupation rate, three parameters self of bicycle average occupancy are all inequality, so need carry out the standardization computing to three kinds of original different pieces of informations, with its all be converted into no unit and the identical data of the order of magnitude import as variable, like this could better utilization the data digging method of cluster analysis study.
The data normalization utilization be the mean difference principle.For one group of data (x1, x2..., xn), its standardization formula is as follows:
In the formula: E is a mean difference; EiBe xiDifference with respect to arithmetic mean; yiBe xiMetric after the standardization.
After standardization is finished, carry out the data clusters analysis by historical data cluster analysis module.Fuzzy cluster analysis
Historical data in N before adopting (N can according to the actual conditions value, general desirable 15) day is as the basis of cluster analysis, and these data all are through depositing historical data base in after the data pre-service certainly.Only need from historical data base, to transfer to get final product.
The target of algorithm is that historical data is divided into three groups automatically, so that the Weighted distance quadratic sum of each sample to three cluster centre reaches minimum.
A, model are constructed
With X={x1, x2..., xnThe set of preceding N days historical data of expression annular coil of signal lamp system, n represents the number of samples in the historical data set.Now these historical datas to be divided into three groups automatically, three cluster centres are promptly arranged, corresponding respectively unimpeded, three class traffic behaviors crowd, block up.If these three cluster centre vectors are V={v1, v2, v3.uIkBe the degree of membership of k sample to i cluster centre, U=[uIk] be one 3 * n matrix.Then the objective function of fuzzy clustering algorithm is:
(1)
Constraint condition is:
Jm is the weighted sum of squares objective function of error in the class, and m is the fuzzy index that can control cluster result, and (1, ∞), fuzzy index is big more, and the fog-level of cluster is just big more for m ∈.
|| xk-vi|| the sample x that expression is gatheredkWith the cluster centre vector viEuclidean distance.
Wherein j=1,2,3 represents 3 indexs in sample and the cluster centre vector respectively: section flow, section average occupancy and section average velocity.
The target of this algorithm is the minimal value of asking formula (1) under condition (2) constraint, and when trying to achieve minimum value, an optimum that just can obtain X is fuzzy to be divided
B, parameter are determined
The value of fuzzy exponent m has considerable influence to cluster result, and its selection depends on the statistic λ of the historical data sample X of annular coil of signal lamp system detecting deviceMax[Cx].
||xi-x||≠0
λ whereiniBe Matrix CxCharacteristic root, work as λMax[Cx]<0.5 o'clock, then
Value not like this, then the cluster result of fuzzy clustering algorithm is not ideal enough.Work as λMax[Cx] 〉=0.5 o'clock, then m>1.According to a large amount of analysis of experimental data, the optimal selection interval [1.5,2.5] of m value.
This shows, determine that the step of m value is as follows:
Step1: the historical data sample X that collects according to detecting device calculates λMax[Cx];
Step2: if λMax[Cx]<0.5, then
If λMax[Cx] 〉=0.5 a m ∈ [1.5,2.5];
Step3: adopting heuristic, is to carry out progressive optimizing between the m location among 0.1 couple of step2 with step-length, calculates the distance between the corresponding all kinds of cluster centres of different m values, seeks the maximum m value of distance between all kinds of cluster centres that make classification.
C, find the solution cluster centre
Make JmTo viAnd uIkPartial derivative be 0, then can release the computing formula of cluster centre and degree of membership according to the objective function of fuzzy clustering.
The cluster centre computing formula is:
The degree of membership computing formula is:
Then the solution procedure of cluster centre is as follows:
Step1: initialization, according to the given exponential factor m of result that parameter is determined, given iteration cut-off error ε>0, algorithm maximum iteration time TMaxAnd initial cluster center V0={v1,0, v2,0, v3,0, v wherein1,0, v2,0, v3,0Corresponding to cluster centre initial value unimpeded, the three class traffic behaviors that crowd, block up.
Step2: calculate Ut=[uIk, t], make dIk, t=|| xk-vi||2If, dIk=0, u thenIk, t=1, and to j ≠ i, uIk, t=0,1≤i≤3,1≤k≤n; If dIk, t>0, then
1≤i≤3,1≤k≤n。
Step3: calculate VT+1=[v1, t+1, v2, t+1, v3, t+1],
1≤i≤3。
Step4: judge, if
Or t reaches maximum iteration time TMax, termination of iterations then; Otherwise, make t=t+1, get back to the first step.
V when iteration stops is the cluster centre of asking.Because the input data are through the data behind the data normalization, so the cluster centre after the iteration end also is the dimensionless number certificate.Can carry out reverse computing to cluster centre according to the variable standardization formula, obtain the cluster centre vector of forming by section average velocity, section average occupancy, bicycle average occupancy of three kinds of traffic behaviors.
N days in the past historical data automatic Iterative goes out after the cluster centre, can this cluster centre be that standard is differentiated the road traffic state when the day before yesterday just.Road traffic state is differentiated flow process as shown in Figure 4.Only need cluster once every day, only real time data need be carried out after the pre-service during differentiation, calculates the Euclidean distance with three cluster centres respectively.The computing formula of real-time traffic characteristic parameter and cluster centre Euclidean distance is:
Wherein: x represents through pretreated real-time traffic parameter vector; viRepresent i cluster centre vector; xj, vIjRepresent j parameter in real-time traffic parameter vector and the cluster centre vector respectively, j=1,2,3 represents section average velocity, section average occupancy and bicycle average occupancy respectively.Apart from the minimum current traffic behavior that is.This method of discrimination calculates very easy, and operation time is extremely short, has guaranteed the real-time of algorithm.But unlikely too frequent in order to guarantee that traffic behavior changes, think that the traffic behavior that has only continuous two cycles is all inconsistent with original traffic behavior, and these two cycle traffic behavior unanimities, the traffic behavior of change output just now.
The road traffic state display module is responsible for the traffic behavior of the final output of road traffic state discrimination module is reflected on the electronic chart with colour code intuitively, and red expression is blocked up, and yellow expression is crowded, and green expression is unimpeded.
The traffic state judging algorithm that the embodiment of the invention proposes is applicable to urban road more, can realize the automatic revision of traffic state judging standard.
The above is preferred embodiment of the present invention only, is not limited to the present invention, all any modifications of being made within the present invention spirit and principle, is equal to replacement and improvement etc., all is contained within protection scope of the present invention.