The method that section is stopped in identification track of vehicle based on dynamic threshold
Technical field
This application involves technical field of control over intelligent traffic, specifically, are related to a kind of identification vehicle based on dynamic threshold
The method that section is stopped in track.
Background technology
With becoming increasingly popular for motor vehicle, the crime case using motor vehicle as the vehicles or using motor vehicle to encroach on target
Part is continuously increased.While all kinds of swindles of operating motor vehicles, burglary, the number of robbery crime are constantly soaring, with all kinds of
Motor vehicle is the theft of crime target, robbery is also progressively increasing.How to carry out investigations and such as to relating to thing track of vehicle
The information what obtains motorist has very big necessity.
With widely using with car plate vehicle targets progressively for the monitoring devices such as city video monitoring, traffic block port
Perfect, the Vehicle tracing based on traffic block port has come true via theory.Automobile is obtained behind the track of bayonet, is done
Case personnel can transfer supermarket's monitoring, bank monitoring and public security bayonet of automobile stop section attachment etc. and obtain motorist
Image, further to obtain drivers information.It is worth however, the section for how judging to stop from track of vehicle is one
Consider the problems of.The method of mainstream is to set the fixed threshold value (density and warp set based on local transit bayonet at present
Test and be manually specified, for example, it is 5km that longest distance is spaced between the traffic block port in a certain area, automobile in local operation most
Slow train speed may be 20km/h, and threshold value is arranged to 15 minutes or 20 minutes), vehicle is by the track of traffic block port, passing through
The time interval for crossing two traffic block ports thinks stop of the section between two traffic block ports for target vehicle more than threshold value
Section.
If fixed threshold value is set excessive, it is possible to omit the stop section of target vehicle, setting is too small will
Non- stop section is introduced, the later stage can increase the workload of personnel in charge of the case transferring, reduce merit when the monitoring of stop section
Case handling efficiency;In addition, the distance between different section, traffic congestion situation etc. are not quite similar, if limited with single threshold value,
Inapplicable all sections, obtained result have many errors.
The content of the invention
In view of this, there is provided a kind of identification vehicle rails based on dynamic threshold for technical problems to be solved in this application
In actual traffic road, different vehicles is obtained by mutually going the same way by analyzing car data for the method that section is stopped in mark
The section used time is similar to normal distribution, using big data frame Hadoop, calculates the average use by all vehicles with a road section
When and standard deviation, set dynamic threshold, using dynamic threshold judge target vehicle whether certain a road section stop.It is same by being directed to
All analyses for crossing vehicle record of a road section, it is real that the dynamic threshold calculated can cross overall height peak, section construction etc. according to festivals or holidays
Border situation dynamic changes, and reliability is high, shortens handling a case the time for personnel in charge of the case, reduces job costs.
In order to solve the above-mentioned technical problem, the application has following technical solution:
A kind of method that section is stopped in identification track of vehicle based on dynamic threshold, which is characterized in that including:
The mistake wheel paths that target vehicle passes through traffic block port according to time order and function order are obtained, what the target vehicle passed through
Bayonet number is n, and the bayonet that the target vehicle passes through is expressed as km, by being expressed as vehicle moment t at the time of each bayonetm,
In, 1≤m≤n, the process footprint of the target vehicle is expressed as:(k1,t1), (k2,t2), (k3,t3) ... ..., (kn-1,tn-1),
(kn,tn);
The target vehicle by the wheel paths of crossing of traffic block port is split, obtains n-1 bayonet pair, each
Bayonet is to representing the stretch line in actual traffic road, and the bayonet is to being expressed as:((k1,t1), (k2,t2)), ((k2,t2),
(k3,t3)) ... ..., ((kn-1,tn-1), (kn,tn));
The n-1 bayonet is obtained to crossing car data at the appointed time section, calculating point is carried out to the car data of crossing
Analysis, obtains the dynamic threshold of each bayonet pair and the target vehicle passes through the used time of each bayonet pair, judges the target
Vehicle whether in a certain bayonet to being stopped in corresponding section.
Preferably, wherein:
It is described that calculating analysis is carried out to the car data of crossing, obtain the dynamic threshold of each bayonet pair and the target carriage
The used time of each bayonet pair of process, judge the target vehicle whether in a certain bayonet to being stopped in corresponding section, into
One step is:
For i-th of bayonet to ((ki,ti), (ki+1,ti+1)), obtained vehicle moment tiWith vehicle moment t excessivelyi+1The place date
It is interior all by bayonet kiWith bayonet ki+1Cross car data, wherein, 1≤i≤n-1;
Car data is crossed according to described, calculates each vehicle by bayonet to ((ki,ti), (ki+1,ti+1)) corresponding to section
Used time;
Each vehicle is calculated by the bayonet to ((ki,ti), (ki+1,ti+1)) used time mean μ and standard deviation
σ;
The dynamic threshold of each bayonet pair is calculated, i-th of bayonet is expressed as Y to corresponding dynamic thresholdi;
Target vehicle is t to the used time in corresponding section by i-th of bayoneti+1-tiIf ti+1-ti< Yi, then judging should
Bayonet is target vehicle normally travel section to corresponding section;If ti+1-ti≥Yi, then judge that the corresponding section of the bayonet is
The stop section of target vehicle is sequentially completed the target vehicle in the used time of all bayonets pair and the dynamic threshold of corresponding bayonet pair
The calculating of value is compared.
Preferably, wherein:
I-th of bayonet is to corresponding dynamic threshold Yi=μ+p σ, wherein, the value of p meets so that normal distribution
Confidence level be more than or equal to 90% be less than or equal to 95%.
Preferably, wherein:
The value of p is 1.65~1.96.
Preferably, wherein:
It is described obtain target vehicle according to time order and function order pass through traffic block port mistake wheel paths, further for:
The target vehicle is obtained from distributed system architecture Hadoop and passes through traffic according to time order and function order
The mistake wheel paths of bayonet.
Preferably, wherein:
Car data excessively is stored in the distributed data base towards row by the distributed system architecture Hadoop
In Hbase, for inquiring about the mistake wheel paths of the target vehicle, while distribution is stored in the form of a file by car data is crossed
In file system, dynamic threshold is obtained for calculating.
Preferably, wherein:
The car data of crossing includes but not limited to bayonet number, crosses vehicle moment, license plate number, car plate color, type of vehicle, vehicle
Body color, vehicle brand and mistake vehicle picture.
Compared with prior art, method described herein has reached following effect:
First, the present invention is based on identifying in the method that section is stopped in track of vehicle for dynamic threshold, in actual traffic road
Lu Zhong obtains different vehicles by analyzing wagon flow data and is similar to normal distribution by the same road segment used time, therefore, passes through meter
The average used time by all vehicles with a road section and standard deviation are calculated, there is provided dynamic thresholds, judge using dynamic threshold
Whether target vehicle is stopped in certain a road section.Compared with prior art it is middle using fixed threshold judge target vehicle stop section and
Speech, can be real according to the distance between different sections of highway, traffic congestion situation and section construction etc. present invention introduces dynamic threshold
Border situation and dynamic change, hence judging result accuracy higher, better reliability, are more advantageous to reducing personnel in charge of the case's
Workload shortens handling a case the time for personnel in charge of the case, greatly reduces work undertaking, effectively increases the effect of handling a case of personnel in charge of the case
Rate.
Second, the present invention is based on the methods that section is stopped in the identification track of vehicle of dynamic threshold, utilize big data frame
Hadoop distributed storages and the advantage calculated, calculate the dynamic threshold of each bayonet pair, judge target carriage using dynamic threshold
Whether certain a road section stop.Hadoop can carry out the processing that magnanimity crosses car data in a manner of efficient, reliable, telescopic.
Assuming that calculating elements and storage can fail, since it can safeguard multiple operational data copies, thereby, it is ensured that failure can be directed to
Node redistribution processing, therefore the accuracy and reliability of judging result of the present invention can be improved, and Hadoop is with simultaneously
Capable mode works, and by parallel processing speed up processing, improves data-handling efficiency, in addition, Hadoop still can stretch
Contracting, PB level data can be handled, meets the processing requirement that magnanimity crosses car data.
Description of the drawings
Attached drawing described herein is used for providing further understanding of the present application, forms the part of the application, this Shen
Schematic description and description please does not form the improper restriction to the application for explaining the application.In the accompanying drawings:
Fig. 1 is the flow for the method that section is stopped in a kind of identification track of vehicle based on dynamic threshold of the present invention
Figure;
Fig. 2 be the present invention judge target vehicle whether in a certain bayonet to the flow chart that is stopped in corresponding section;
Fig. 3 is the application for the method that section is stopped in a kind of identification track of vehicle based on dynamic threshold of the present invention
The flow chart of embodiment;
Fig. 4 is the bayonet for the method that section is stopped in a kind of identification track of vehicle based on dynamic threshold of the present invention
Decomposing trajectories schematic diagram.
Specific embodiment
Some vocabulary has such as been used to censure specific components among specification and claim.Those skilled in the art should
It is understood that hardware manufacturer may call same component with different nouns.This specification and claims are not with name
The difference of title is used as the mode for distinguishing component, but is used as the criterion of differentiation with the difference of component functionally.Such as logical
The "comprising" of piece specification and claim mentioned in is an open language, therefore should be construed to " include but do not limit
In "." substantially " refer in receivable error range, those skilled in the art can be described within a certain error range solution
Technical problem basically reaches the technique effect.In addition, " coupling " word is herein comprising any direct and indirect electric property coupling
Means.Therefore, if one first device of described in the text is coupled to a second device, representing the first device can directly electrical coupling
It is connected to the second device or is electrically coupled to the second device indirectly through other devices or coupling means.Specification
Subsequent descriptions for implement the application better embodiment, so it is described description be for the purpose of the rule for illustrating the application,
It is not limited to scope of the present application.The protection domain of the application is when subject to appended claims institute defender.
Embodiment 1
Method shown in Figure 1 for stop section in a kind of herein described identification track of vehicle based on dynamic threshold
Flow chart, including:
Step 101 obtains the mistake wheel paths that target vehicle passes through traffic block port according to time order and function order, the target carriage
For n, the bayonet that the target vehicle passes through is k for the bayonet number passed throughm, by being expressed as vehicle moment t at the time of each bayonetm,
Wherein, 1≤m≤n, the process footprint of the target vehicle are expressed as:(k1,t1), (k2,t2), (k3,t3) ... ..., (kn-1,
tn-1), (kn,tn);
Step 102 is split the target vehicle by the mistake wheel paths of traffic block port, obtains n-1 bayonet pair,
Each bayonet is to representing the stretch line in actual traffic road, and the bayonet is to being expressed as:((k1,t1), (k2,t2)), ((k2,
t2), (k3,t3)) ... ..., ((kn-1,tn-1), (kn,tn));
Step 103 obtains the n-1 bayonet to crossing car data at the appointed time section, to the car data excessively into
Row calculates analysis, obtains the dynamic threshold of each bayonet pair and the target vehicle passes through the used time of each bayonet pair, judge
The target vehicle whether in a certain bayonet to being stopped in corresponding section.
In actual traffic road, different vehicles is obtained by analyzing wagon flow data and is similar to by the same road segment used time
Normal distribution, therefore, by calculating average used time and standard deviation by all vehicles with a road section, there is provided dynamic thresholds
Value, the dynamic threshold according to actual traffic situation dynamic change, using dynamic threshold come judge target vehicle whether at certain all the way
Section is stopped.Compared with prior art for the middle stop section that target vehicle is judged using fixed threshold, present invention introduces dynamic thresholds
Value, actual conditions and the dynamic change such as can construct according to the distance between different sections of highway, traffic congestion situation and section, because
This causes judging result accuracy higher, and better reliability is more advantageous to reducing the workload of personnel in charge of the case, shortens personnel in charge of the case
Handle a case the time, greatly reduce work undertaking, effectively increase the case handling efficiency of personnel in charge of the case.
Embodiment 2
It is described that calculating analysis is carried out to the car data of crossing in step 103 on the basis of embodiment 1, obtain each card
Whether the dynamic threshold and the target vehicle of mouth pair pass through the used time of each bayonet pair, judge the target vehicle a certain
Bayonet to being stopped in corresponding section, further for:
Step 201, for i-th of bayonet to ((ki,ti), (ki+1,ti+1)), obtain tiAnd ti+1All warps in the date of place
Cross bayonet kiWith bayonet ki+1Cross car data, wherein, 1≤i≤n-1.
The influence that section is repaired the roads in order to prevent or the abnormal conditions such as traffic control are brought, the date herein is using day to be single
Position.
Step 202 crosses car data according to described, calculates each vehicle by bayonet to ((ki,ti), (ki+1,ti+1)) institute it is right
The used time in the section answered.
That is, for current bayonet pair, from distributed system architecture Hadoop obtain one day in all processes
The vehicle of current bayonet pair crosses vehicle moment tiAnd ti+1, and with calculate their used time, i.e. ti+1-ti。
Step 203, calculate each vehicle used time mean μ and standard deviation sigma.
Step 204 calculates the corresponding dynamic threshold of each bayonet, and the corresponding dynamic threshold of i-th of bayonet is expressed as Yi。
Step 205, target vehicle are t to the used time in corresponding section by i-th of bayoneti+1-tiIf ti+1-ti< Yi,
It is target vehicle normally travel section to corresponding section then to judge the bayonet;If ti+1-ti≥Yi, then judge that the bayonet corresponds to
Section be target vehicle stop section, be sequentially completed used time and corresponding bayonet pair of the target vehicle in all bayonets pair
The calculating of dynamic threshold compare.
In above-mentioned steps 204, YiThe value of=μ+p σ, p should meet so that the confidence level of normal distribution is more than or equal to
90% is less than or equal to 95%.
In actual traffic road, show that different vehicles passes through same road segment by a large amount of car datas of crossing of sampling analysis
Used time be similar to normal distribution.Normal distribution is a kind of probability distribution, and average value and standard deviation are the parameters of normal distribution, only
It is to be understood that meet the data of normal distribution average value and standard deviation with regard to the ratio of frequency in arbitrary value range can be estimated.
Therefore, the present invention sets dynamic threshold by calculating by the average used time of all vehicles with a road section and standard deviation, utilizes
Dynamic threshold judges whether target vehicle is stopped in certain a road section.Moreover, section is repaired the roads in order to prevent or traffic control etc. is different
The influence that reason condition is brought when calculating dynamic threshold, is chosen and target vehicle is on the same day by all vehicles with a road section
Cross car data.
Further, can the value of p be set to the arbitrary value of section [1.65,1.96], for example is set to 1.65, at this point, dynamic
Threshold value is:+ 1.65 times of standard deviations of average, i.e. Yi+ 1.65 σ of=μ.
When 1.65 times of standard deviations are arranged to, Y is more than in all sample datas of normal distributioniAccount for 95%,
That is using all same day by bayonet to the used time before maximum 5% vehicle as parked vehicles.According to real data, when putting
Letter is horizontal when be more than or equal to 90% and be less than or equal to 95%, vehicle has the suspicion of stop, all confidence levels that meet
Standard deviation multiple can be adopted so that the multiple of standard deviation of the confidence level more than 95%, which easily causes, fails to judge.
The value of p is the conclusion drawn by analysis of experiments many times herein, those skilled in the art without
Performing creative labour can not obtain the conclusion.
In above-mentioned steps 101, the mistake wheel paths for obtaining target vehicle and passing through traffic block port according to time order and function order,
It is further:
The target vehicle is obtained from distributed system architecture Hadoop and passes through traffic according to time order and function order
The mistake wheel paths of bayonet.
Car data excessively is stored in the distributed data base towards row by the distributed system architecture Hadoop
In Hbase, for inquiring about the mistake wheel paths of the target vehicle, while distribution is stored in the form of a file by car data is crossed
In file system HDFS (Hadoop Distributed File System), dynamic threshold is obtained for calculating.
Hadoop is a software frame that analysis mode processing can be carried out to mass data, with efficient, reliable, telescopic
Mode carries out the processing that magnanimity crosses car data.Assuming that calculating elements and storage can fail, since it can safeguard multiple work numbers
According to copy, thereby, it is ensured that the node redistribution processing of failure can be directed to, and also Hadoop works in a parallel fashion, passes through
Parallel processing speed up processing, in addition, Hadoop or telescopic, can handle PB level data.
Wherein, distributed file system HDFS has the characteristics of high fault tolerance, can be provided effectively for the car data of crossing of magnanimity
Storage, and be designed to be deployed on cheap hardware, advantageously reduce cost, and it provides high-throughput (high
Throughput) carry out the data of access application, effectively meet the processing requirement for largely crossing car data.It is in addition, distributed
File system HDFS can access the data in file system in the form of streaming.
The present invention is obtained from distributed system architecture Hadoop crosses vehicle according to time order and function order by bayonet
During track, program calls Hbase and API to cross vehicle number to what is stored in Hbase according to license plate number input by user and initial time
According to being filtered, obtain crossing car data according to vehicle time-sequencing excessively, formed wheel paths, and then divided crossing wheel paths
Cut, by " bayonet 1- bayonets 2 " " bayonet 2, bayonet 3 " ... in the way of be divided into several bayonets pair, calculate target vehicle warp
Spend the used time of each bayonet pair.
Signified car data of crossing of the invention includes but not limited to bayonet number, crosses vehicle moment, license plate number, car plate color, vehicle
Type, body color, vehicle brand and cross vehicle picture.
Embodiment 3
The Application Example of a kind of present invention presented below, referring to Fig. 3.
The method in section is stopped in identification track of vehicle based on dynamic threshold to be included:
Step 301, using distributed system architecture Hadoop, limiting time scope and target vehicle license plate number, obtain
Go out bayonet and the vehicle time series excessively that vehicle passes through sequentially in time, it is assumed that the bayonet number that target vehicle passes through
The bayonet k passed through for n, target vehiclemIt represents, spends the vehicle moment and use tmIt represents (1≤m≤n);
Step 302 is split the bayonet track of process, referring to Fig. 4, it is assumed that the mistake wheel paths of target vehicle are (k1,
t1), (k2,t2), (k3,t3) ... ..., (kn-1,tn-1), (kn,tn), decomposition obtains n-1 bayonet pair:
((k1,t1), (k2,t2)),
((k2,t2), (k3,t3)),
...,
((kn-1,tn-1), (kn,tn))
Step 303, traversal n-1 bayonet pair, judge target vehicle whether in the bayonet to being stopped in representative section,
It is as follows:
A), for i-th of bayonet to ((ki,ti), (ki+1,ti+1)), obtain tiAnd ti+1(using day to be single in the date of place
Position) it is all by bayonet kiWith bayonet ki+1Cross car data, wherein, 1≤i≤n-1;
B), calculate by bayonet kiWith bayonet ki+1It is all cross the car data used times;
C) mean μ and standard deviation sigma of all used times, is calculated;
D) dynamic threshold, is calculated, uses YiRepresent the corresponding dynamic threshold of i-th of bayonet, then:
Yi=μ+p σ
Vehicle passes through same time on road approximate normal distribution, according to normal distribution, the probability of [+1.65 σ of μ -1.65 σ, μ]
It is 90%, therefore, dynamic threshold is less than+1.65 σ of μ, i.e. the probability of [+1.65 σ of-∞, μ] is about 95%;According to normal distribution,
The probability of [+1.96 σ of μ -1.96 σ, μ] is 95%, and therefore, dynamic threshold is less than the probability of+1.96 σ of μ, i.e. [+1.96 σ of-∞, μ]
About 97.5%.Choose μ+p σ as judge section whether be stop section threshold value, by real data repetition test, p value
Value meet section [1.65,1.96];
E), target vehicle is t to the used time in corresponding section by i-th of bayoneti+1-tiIf ti+1-ti< Yi, then
It is target vehicle normally travel section to corresponding section to judge the bayonet;If ti+1-ti≥Yi, then judge that the bayonet corresponds to
Section be target vehicle stop section;
F), i is from increasing 1, if i < n, continues to repeat step a), otherwise terminates program.
A kind of real case presented below:
It is as follows that target vehicle bayonet crosses vehicle record:
(0001,2016-04-15 8:00:00)
(0002,2016-04-15 8:25:00)
(0003,2016-04-15 9:00:00)
(0004,2016-04-15 9:20:00)
(0005,2016-04-15 9:30:00)
Wherein, 0001~0005 bayonet number being represented, 2016-04-15 represented the vehicle date, and 8:00:00 grade represented vehicle
Moment.
Set threshold value be:
μ+1.65σ
Bayonet is to 1:(0001,0002)
Used time 25*60=1500s
Assuming that by 5 vehicles (including target vehicle), (unit s) is respectively when excessively automobile-used:
1500,1400,1580,1620,1450,
Average value and standard deviation are respectively:
μ=1510, σ=91
Threshold value:
1510+1.65*91=1660
Herein, used time 1500s, threshold value 1660s, the used time is less than threshold value, so can determine whether bayonet to 1 corresponding section
For normal vehicle operation section.
Bayonet is to 2:(0002,0003)
Used time 35*60=2100s
Assuming that by 6 vehicles, it is respectively when excessively automobile-used:
2100,1400,1300,800,1100,750,
Average value and standard deviation are respectively:1242,494
Threshold value:
1242+1.65*494=2057
Herein, used time 2100s, threshold value 2057s, the used time is more than threshold value, so can determine whether bayonet to 2 corresponding sections
Section is stopped for vehicle abnormality.
Bayonet is to 3:(0003,0004)
Used time 20*60=1200s
Assuming that by 8 vehicles, it is respectively when excessively automobile-used:
1200,1200,1300,800,1100,1400,1350,1000
Average value and standard deviation are respectively:1168,198
Threshold value:
1168+1.65*198=1495
Herein, used time 1200s, threshold value 1495s, the used time is less than threshold value, so can determine whether bayonet to 3 corresponding sections
For normal vehicle operation section.
Bayonet is to 4:(0004,0005)
Used time 30*60=1800s
Assuming that by 4 vehicles, it is respectively when excessively automobile-used:
1800,2000,1900,1600
Average value and standard deviation are respectively:1825,171
Threshold value:
1825+1.65*171=2107
Herein, used time 1800s, threshold value 2107s, the used time is less than threshold value, so can determine whether bayonet to 4 corresponding sections
For normal vehicle operation section.
By various embodiments above, advantageous effect existing for the application is:
First, the present invention is based on identifying in the method that section is stopped in track of vehicle for dynamic threshold, in actual traffic road
Lu Zhong obtains different vehicles by analyzing wagon flow data and is similar to normal distribution by the same road segment used time, therefore, passes through meter
The average used time by all vehicles with a road section and standard deviation are calculated, there is provided dynamic thresholds, judge using dynamic threshold
Whether target vehicle is stopped in certain a road section.Compared with prior art it is middle using fixed threshold judge target vehicle stop section and
Speech, can be real according to the distance between different sections of highway, traffic congestion situation and section construction etc. present invention introduces dynamic threshold
Border situation and dynamic change, hence judging result accuracy higher, better reliability, are more advantageous to reducing personnel in charge of the case's
Workload shortens handling a case the time for personnel in charge of the case, greatly reduces work undertaking, effectively increases the effect of handling a case of personnel in charge of the case
Rate.
Second, the present invention is based on the methods that section is stopped in the identification track of vehicle of dynamic threshold, utilize big data frame
Hadoop distributed storages and the advantage calculated, calculate the dynamic threshold of each bayonet pair, judge target carriage using dynamic threshold
Whether certain a road section stop.Hadoop can carry out the processing that magnanimity crosses car data in a manner of efficient, reliable, telescopic.
Assuming that calculating elements and storage can fail, since it can safeguard multiple operational data copies, thereby, it is ensured that failure can be directed to
Node redistribution processing, therefore the accuracy and reliability of judging result of the present invention can be improved, and Hadoop is with simultaneously
Capable mode works, and by parallel processing speed up processing, improves data-handling efficiency, in addition, Hadoop still can stretch
Contracting, PB level data can be handled, meets the processing requirement that magnanimity crosses car data.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, apparatus or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the application
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the application
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
Several preferred embodiments of the application have shown and described in above description, but as previously described, it should be understood that the application
Be not limited to form disclosed herein, be not to be taken as the exclusion to other embodiment, and available for various other combinations,
Modification and environment, and above-mentioned introduction or the technology or knowledge of association area can be passed through in the scope of the invention is set forth herein
It is modified.And changes and modifications made by those skilled in the art do not depart from spirit and scope, then it all should be in this Shen
It please be in the protection domain of appended claims.