CN110136452A - A kind of car statistics method and device - Google Patents

A kind of car statistics method and device Download PDF

Info

Publication number
CN110136452A
CN110136452A CN201810130365.4A CN201810130365A CN110136452A CN 110136452 A CN110136452 A CN 110136452A CN 201810130365 A CN201810130365 A CN 201810130365A CN 110136452 A CN110136452 A CN 110136452A
Authority
CN
China
Prior art keywords
period
vehicle
license plate
train
car
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.)
Pending
Application number
CN201810130365.4A
Other languages
Chinese (zh)
Inventor
王龙
沈秋军
董则恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201810130365.4A priority Critical patent/CN110136452A/en
Publication of CN110136452A publication Critical patent/CN110136452A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count

Abstract

The embodiment of the invention provides a kind of car statistics method and device, this method are as follows: determines the car statistics period;According to car statistics information stored in the car statistics information table corresponding recent statistics period, the first sub-period and the second sub-period in the car statistics period are determined;In the case where the first sub-period is not sky, from car statistics information table, obtains the license plate number that there is the vehicle that garage is in the first sub-period and cross train number number;In the case where the second sub-period is not sky, car data of crossing that is storing in caching and acquiring in the second sub-period is counted, the license plate number that there is the vehicle that garage is in the second sub-period is obtained and crosses train number number;According to license plate number obtained and train number number is crossed, is generated in the car statistics period based on the statistical result for crossing train number number.It may be implemented to vehicle in the setting period and its cross the statistics of train number number using scheme provided in an embodiment of the present invention.

Description

A kind of car statistics method and device
Technical field
The present invention relates to big data processing technology fields, set more particularly to a kind of car statistics method and device, electronics Standby, computer readable storage medium.
Background technique
With the development of society, vehicle becomes the important vehicles, the vehicle travelled in city is also more and more.In order to The vehicle active degree for studying a certain area needs the vehicle for travelling this area and its crosses train number number to count, thus Vehicle ranking is enlivened to this area.Vehicle ranking is enlivened, i.e., license plate is ranked up according to frequency of occurrence within the period of setting, than Such as, the vehicle occurred for certain urban district in nearest 5 days counts, and is ranked up according to frequency of occurrence to the license plate occurred.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of car statistics method, apparatus, to realize to vehicle in the setting period And its cross train number number statistics.Specific technical solution is as follows:
In order to achieve the above objectives, the embodiment of the invention provides a kind of car statistics methods, which comprises
Determine the car statistics period;
According to car statistics information stored in the car statistics information table corresponding recent statistics period, the vehicle is determined The first sub-period and the second sub-period in statistical time range, wherein first sub-period are as follows: from the car statistics information table The middle period for obtaining car statistics information, second sub-period are as follows: vehicle system is obtained according to the car data of crossing stored in caching Count the period of information;
In the case where the first sub-period is not sky, from the car statistics information table, obtain in first period of the day from 11 p.m. to 1 a.m There is the license plate number for the vehicle that garage is in section and crossed train number number;
In the case where the second sub-period is not sky, to mistake being stored in caching and in second sub-period acquisition Car data is counted, and is obtained the license plate number that there is the vehicle that garage is in second sub-period and is crossed train number number;
According to license plate number obtained and train number number is crossed, is generated in the car statistics period based on the system for crossing train number number Count result.
Optionally, in the case where the car statistics period including the current statistic period, further includes:
After generating the statistical result based on mistake train number number, using the first preset duration as time interval, per a period of time is obtained Between be spaced in acquire cross car data;
Obtain acquire in each time interval cross car data after, according to license plate number, car data obtained of crossing is carried out Statistics determines and there is the license plate number for the vehicle that garage is and crossed train number number, and according to license plate number, cumulative to cross train number number Identified train number number excessively is updated to described based in the statistical result of train number number excessively by mode.
Optionally, after current statistic end cycle, the method also includes:
Car data of crossing storing in caching, acquiring in the current statistic period is counted, the current statistic period is obtained Inside there is the license plate number for the vehicle that garage is and crossed train number number, and by license plate number obtained and cross train number number be updated to it is described Car statistics information table;
Acquisition in the license plate number for crossing the vehicle that garage is and crosses train number number in object statistics cycle memory, wherein the mesh Mark measurement period are as follows: in the corresponding statistical time range of statistical result based on mistake train number number most apart from current statistic cycle duration Long measurement period;
According to the license plate number of the vehicle obtained for being in garage excessively in object statistics cycle memory, reduced with crossing train number number Mode, use it is obtained object statistics cycle memory cross garage for vehicle cross train number number be based on vehicle to described The statistical result of number is updated.
Optionally, the car data of crossing acquired in each time interval is counted, is obtained every according to license plate number described There is the license plate number for the vehicle that garage is in one time interval and crossed before the step of train number number, further includes:
The car data progress data validation verification of crossing acquired in each time interval is pressed described in execution if legal According to license plate number, the car data of crossing acquired in each time interval is counted, obtains in each time interval and there is garage For vehicle license plate number and cross train number number step.
Optionally, the method also includes:
Generate it is described based on the statistical result of train number number is crossed after, according to crossing train number number to described based on crossing train number number License plate number in statistical result is ranked up, and obtains the car statistics period corresponding license plate number ranking.
Optionally, in the car statistics information further include: the vehicle characteristics of vehicle corresponding to license plate number;
After generation is described based on the statistical result of train number number is crossed, the method also includes:
It was based on based on train number number is crossed in the statistical result for crossing train number number to described according to license plate number, and according to described The vehicle characteristics of vehicle corresponding to license plate number in the statistical result of train number number are counted, and are obtained in the car statistics period Statistical result based on vehicle characteristics.
Optionally, including: that each license plate number obtained is corresponding in the statistical result based on mistake train number number crosses vehicle Number queue, wherein cross the element for including in the queue of train number number are as follows: sum (m- (m+i));
M are as follows: apart from current statistic cycle duration shortest statistics week in each measurement period in the car statistics period The mark of phase, (m+i) are as follows: according to apart from the duration in current statistic period sequence from short to long, in the car statistics period The mark of i-th of measurement period, 0≤i≤n, n are as follows: apart from current statistic in each measurement period in the car statistics period The mark of the longest measurement period of cycle duration;
Sum (m- (m+i)) is indicated: vehicle corresponding to a license plate number crosses train number number, the target in objective time interval Period are as follows: the period formed from the measurement period for being identified as m to the measurement period for being identified as (m+i).
Optionally, described according to license plate number, and according to the train number number excessively based in the statistical result of train number number excessively, it is right The vehicle characteristics of vehicle corresponding to the license plate number based in the statistical result for crossing train number number are counted, and the vehicle is obtained The step of statistical result in statistical time range based on vehicle characteristics, comprising:
It is carried out at duplicate removal to described based on the corresponding train number number queue excessively of each license plate number in the statistical result of train number number excessively Reason, wherein the corresponding element representation crossed in the queue of train number number of duplicate removal processing the latter license plate number: corresponding to the license plate number Vehicle whether there is garage within the element corresponding period;
Train number number team is crossed to corresponding to the license plate number based on the identical vehicle of feature in the statistical result for crossing train number number Column are counted, and are obtained the vehicle of each feature and are crossed vehicle statistics letter within each element corresponding period for crossing the queue of train number number Breath;
Vehicle statistical information is crossed according to obtained, generates the statistics knot based on vehicle characteristics in the car statistics period Fruit.
In order to achieve the above objectives, the embodiment of the invention also provides a kind of car statistics device, described device includes:
First determining module, for determining the car statistics period;
Second determining module, for according to the corresponding recent statistics of car statistics information stored in car statistics information table Period determines the first sub-period and the second sub-period in the car statistics period, wherein first sub-period are as follows: from The period of car statistics information, second sub-period are as follows: according to what is stored in caching are obtained in the car statistics information table Spend the period that car data obtains car statistics information;
First obtains module, for from the car statistics information table, obtaining in the case where the first sub-period is not sky It obtains the license plate number that there is the vehicle that garage is in first sub-period and crosses train number number;
Second obtains module, in the case where the second sub-period is not sky, to storing in caching and described the The car data of crossing of two sub-periods acquisition is counted, and the license plate that there is the vehicle that garage is in second sub-period is obtained Number and cross train number number;
Generation module, for according to described first obtain module and described second obtain module license plate number obtained and Train number number is crossed, is generated in the car statistics period based on the statistical result for crossing train number number.
Optionally, described device further include:
Third obtains module, is used in the case where the car statistics period including the current statistic period, described in generation After crossing the statistical result of train number number, using the first preset duration as time interval, the mistake acquired in each time interval is obtained Car data;
First update module, for obtain acquired in each time interval cross car data after, according to license plate number, to being obtained Car data of crossing counted, determine and there is the license plate number for the vehicle that garage is and crossed train number number, and according to license plate number, By cross train number number it is cumulative in a manner of, by it is identified cross train number number be updated to it is described based on crossing in the statistical result of train number number.
Optionally, described device further include:
Second update module, for being adopted in the period to stored in caching, current statistic after current statistic end cycle The car data of crossing of collection is counted, and is obtained current statistic cycle memory in the license plate number for crossing the vehicle that garage is and is crossed train number number, And license plate number obtained is updated to the car statistics information table with train number number is crossed;
4th obtains module, for obtaining the license plate number and mistake vehicle of the vehicle for being in garage excessively in object statistics cycle memory Number, wherein the object statistics period are as follows: described to be worked as based on distance in the corresponding statistical time range of statistical result for crossing train number number The preceding longest measurement period of measurement period duration;
Third update module, for the license plate according to the vehicle obtained for being in garage excessively in object statistics cycle memory Number, by cross the reduction of train number number in a manner of, use it is obtained object statistics cycle memory cross garage for vehicle cross vehicle Number is updated to described based on the statistical result for crossing train number number.
Optionally, described device further include:
Correction verification module, for carrying out data validation verification to the car data of crossing acquired in each time interval, if closed Method triggers first update module.
Optionally, described device further include:
Sorting module, for generate it is described based on the statistical result of train number number is crossed after, according to crossing train number number to described It is ranked up based on the license plate number in the statistical result for crossing train number number, obtains the car statistics period corresponding license plate number row Name.
Optionally, in the car statistics information further include: the vehicle characteristics of vehicle corresponding to license plate number;
Described device further include:
Statistical module, after the statistical result based on mistake train number number described in generating, according to license plate number, and according to institute It states based on train number number is crossed in the statistical result for crossing train number number, to the license plate number institute based in the statistical result for crossing train number number The vehicle characteristics of corresponding vehicle are counted, and the statistical result based on vehicle characteristics in the car statistics period is obtained.
Optionally, including: that each license plate number obtained is corresponding in the statistical result based on mistake train number number crosses vehicle Number queue, wherein cross the element for including in the queue of train number number are as follows: sum (m- (m+i));
M are as follows: apart from current statistic cycle duration shortest statistics week in each measurement period in the car statistics period The mark of phase, (m+i) are as follows: according to apart from the duration in current statistic period sequence from short to long, in the car statistics period The mark of i-th of measurement period, 0≤i≤n, n are as follows: apart from current statistic in each measurement period in the car statistics period The mark of the longest measurement period of cycle duration;
Sum (m- (m+i)) is indicated: vehicle corresponding to a license plate number crosses train number number, the target in objective time interval Period are as follows: the period formed from the measurement period for being identified as m to the measurement period for being identified as (m+i).
Optionally, the statistical module, comprising:
Duplicate removal submodule, for crossing train number number to each license plate number is corresponding in the statistical result based on mistake train number number Queue carries out duplicate removal processing, wherein the corresponding element representation crossed in the queue of train number number of duplicate removal processing the latter license plate number: Vehicle corresponding to the license plate number whether there is garage within the element corresponding period;
Statistic submodule, for the license plate number institute based on the identical vehicle of feature in the statistical result for crossing train number number It corresponded to train number number queue to be counted, and obtained the vehicle of each feature in each element corresponding period for crossing the queue of train number number Interior crosses vehicle statistical information;
Submodule is generated, for crossing vehicle statistical information according to obtained, is generated in the car statistics period based on vehicle The statistical result of feature.
In order to achieve the above objectives, the embodiment of the invention also provides a kind of electronic equipment, including processor and memory, In:
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any of the above-described car statistics method Method and step.
In order to achieve the above objectives, the embodiment of the invention also provides a kind of computer readable storage mediums, which is characterized in that Computer program is stored in the computer readable storage medium, the computer program is realized above-mentioned when being executed by processor The method and step of any car statistics method.
Scheme provided in an embodiment of the present invention, in advance according to measurement period to it is being stored in caching, acquire in measurement period Car data of crossing counted to obtain car statistics information, and car statistics information is stored in car statistics information table, After determining the car statistics period, according to car statistics information stored in the car statistics information table corresponding recent statistics period, It can be two sub-periods by car statistics Time segments division, and obtain the two sons from car statistics information table and caching respectively License plate number and mistake train number number in period, to generate in the car statistics period based on the car statistics result for crossing train number number. As it can be seen that scheme provided in an embodiment of the present invention, may be implemented to the statistics for setting vehicle and its train number number excessively in the period, and by In car statistics information corresponding in measurement period is stored in car statistics information table according to measurement period, therefore generating When in the car statistics period based on the car statistics result for crossing train number number, first directly can be obtained from car statistics information table Car statistics information in sub-period, reduces calculation amount, improves in the car statistics period based on the statistics knot for crossing train number number The formation speed of fruit.Certainly, it implements any of the products of the present invention or method must be not necessarily required to reach above-described institute simultaneously There is advantage.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of car statistics method provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of another car statistics method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of another car statistics method provided in an embodiment of the present invention;
Fig. 4 is the flow diagram of a specific embodiment provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of car statistics device provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another car statistics device provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another car statistics device provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
To solve problem of the prior art, the embodiment of the invention provides a kind of car statistics method and device, electronics to set Standby, computer readable storage medium.A kind of car statistics method provided in an embodiment of the present invention is introduced first below.
It should be noted that a kind of executing subject of car statistics method method provided in an embodiment of the present invention, Ke Yiwei A kind of car statistics device, specifically, the car statistics device can be located in electronic equipment, electronic equipment can be service Device, mobile terminal etc., are not construed as limiting herein.
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of car statistics method provided in an embodiment of the present invention, comprising:
S101 determines the car statistics period.
In one implementation, the car statistics period can be the time comprising any measurement period being arbitrarily designated Section, it is assumed that with 24 hours for measurement period, if this period comprising 10 measurement periods of designated statistics 170901-170910 Interior car statistics information, then it is determined that the car statistics period be 170901-170910.
In addition, the car statistics period may be the specified default statistics duration since the current statistic period forward, Such as car statistics information in designated statistics 7 days, then it is determined that the car statistics period be since current date forward Continuous 7 days.
S102, according to car statistics information stored in the car statistics information table corresponding recent statistics period, determining should The first sub-period and the second sub-period in the car statistics period.
Wherein, the first sub-period are as follows: the period of car statistics information, the second sub-period are obtained from car statistics information table Are as follows: according to the period for crossing car data and obtaining car statistics information stored in caching.The vehicle stored in car statistics information table Statistical information are as follows: car data excessively storing in caching, acquiring in measurement period is counted according to measurement period Data, car statistics information include: each license plate number in the corresponding train number number excessively of each measurement period.
As it can be seen that car statistics information table is updated according to measurement period, measurement period can be for preset duration For time interval, such as 24 hours, 12 hours etc..In one implementation, measurement period is 24 hours, can be daily Zero point is counted to obtain in preceding 24 hours this measurement periods to the car data of crossing acquired in 24 hours storing in caching, preceding In the presence of garage's vehicle for being license plate number and cross train number number, and according to license plate number and cross train number number and update car statistics information Table.The structure of car statistics information table can be as shown in table 1:
Table 1
RowKey Column name Timestamp Value
2- surveys A12345 Column=cf:property 1504283538815 1,5,6
2- surveys A12345 Column=cfd:170902 1504283538815 4101,4101
2- surveys A12345 Column=cfd:170903 1504369946100 5105,9206
2- surveys A12345 Column=cfd:170904 1504456375788 8387,17593
2- surveys A12345 Column=cfd:170905 1504542764914 4532,22125
Since the license plate of vehicle is distinguished by text on license plate and license plate color, license plate can be used On text and license plate color carry out the license plate of one vehicle of unique identification.Such as the license plate of vehicle A is blue, the text on license plate To survey A12345, then the license plate number of vehicle A can indicate are as follows: indigo plant-survey A12345 or 2- surveys A12345, wherein 2 indicate blue Color.In table 1 therefore, " 2- surveys A12345 " indicates the license plate number of vehicle.
It can also include the vehicle characteristics of vehicle corresponding to license plate number in car statistics information table.It should be understood that vehicle The attribute feature of character representation vehicle, vehicle characteristics can capture camera by the front end being arranged on road and analyze to obtain, example Such as body color, type of vehicle, vehicle brand essential characteristic and some years that can be gone out by deep learning network analysis The secondary identification features such as money, annual test mark, ornament, paper towel box, sunshading board, safety belt.
If cf:property arranges corresponding value value and can be used for identifying the vehicle characteristics of vehicle in table 1, in table 1 There are three values by value, and first value is for identifying the brand of vehicle, and second value is for identifying the type of vehicle, third value For identifying the color of vehicle, for example, it is class public, that second value indicates vehicle for 5 that first value, which is 1 expression vehicle brand, Type is automobile, and third value is that the color of 6 expression vehicles is white.
It should be noted that with the different color of different digital representations or different vehicle characteristics in table 1, it is a certain specific Number represented by color perhaps feature can preset and color or feature corresponding to can be between number It is independent, it does not interfere with each other, for example, number 2 can be used to indicate that license plate color as blue, can be used for indicating that type of vehicle is Honda can be also used for indicating vehicle color for blue.
Cfd:170903 indicates to cross vehicle number on the day of Septembers in 2017 3 that September 4 zero points in 2017 count in table 1 According to value 5105,9206 indicates that the vehicle occurs 5105 times in No. 3 this days of in September, 2017 and adds up to occur 9206 times.
Timestamp corresponding to every a line in table 1 indicates that the row data are added to the time of car statistics information table, wherein The first row is identical with the timestamp of the second row, indicates that the vehicle was collected garage on the day of September 2 in 2017 for the first time and is.
It is exemplified by Table 1, stored car statistics information corresponding recent statistics week in car statistics information table shown in table 1 Phase is 170905 (i.e. Septembers 5 in 2017), if the car statistics period determined by step S101 is 170902-170906, The car statistics period is divided into two sub-periods according to the recent statistics period, be respectively as follows: the first sub-period 170902-170905, Second sub-period 170906;If the car statistics period determined by step S101 is 170902-170904, according to newest system The car statistics period is divided into two sub-periods by the meter period, is respectively as follows: the first sub-period 170902-170904, the second sub-period For sky;If the car statistics period determined by step S101 is 170906, when according to the recent statistics period by car statistics Section is divided into two sub-periods, be respectively as follows: the first sub-period be it is empty, the second sub-period is 170906.
S103 in the case that the first sub-period is not sky, from car statistics information table, is obtained in the first sub-period memory In the license plate number for crossing the vehicle that garage is and cross train number number.
By taking above-mentioned table 1 as an example, if the first sub-period is 170902-170905, acquisition exists in the first sub-period The license plate number for crossing the vehicle that garage is is that 2- surveys A12345, and crossing train number number is 22125.
S104, in the case where the second sub-period is not sky, to mistake being stored in caching and in the acquisition of the second sub-period Car data is counted, and is obtained the license plate number that there is the vehicle that garage is in the second sub-period and is crossed train number number.
Second sub-period is not sky, that is, the second sub-period was in the current statistic period, in this case, the second son Acquire in period cross car data due to not to measurement period without being counted and being stored in car statistics information table, because This, the license plate number and train number number needs excessively that there is the vehicle that garage is in the second sub-period are obtained from caching.According to slow The car statistics information of middle storage crossed car data and obtain the second sub-period is deposited, which may include in the second son There is license plate number corresponding to each vehicle that garage is in period, license plate color, vehicle characteristics, spend train number number and statistics day Phase.For example, obtaining each vehicle that there is garage on September 6th, 2017 and be from caching if the second sub-period is 170906 Corresponding includes license plate number and the car statistics information for crossing train number number.
S105 according to license plate number obtained and crosses train number number, generates and be based on train number number in the car statistics period Statistical result.
It, can be with for obtained license plate number and mistake train number number when the first sub-period and the second sub-period are not empty Train number number is subjected to read group total according to license plate number, each license plate number is obtained and crosses train number number within the car statistics period, To generate statistical result of each license plate number based on train number number excessively in the car statistics period.For example, the first sub-period is 170902-170905, license plate number are that cross train number number of the 2- survey A12345 in the first sub-period is 22125;Second sub-period is 170906, license plate number is that cross train number number of the 2- survey A12345 in the second sub-period is 1000;That license plate number is that 2- surveys A12345 Train number number of crossing within the car statistics period is 23125.
It further, can also be according to train number number excessively after step S105 is generated based on the statistical result of train number number excessively It is ranked up to based on the license plate number in the statistical result for crossing train number number, obtains car statistics period corresponding license plate number row Name.It is more to cross train number number, license plate number ranking is more forward, indicates that the corresponding vehicle of the license plate number is more living within the car statistics period Jump.
It can be seen from the above, scheme provided in an embodiment of the present invention, may be implemented to vehicle in the setting period and its crosses train number Several statistics, and since car statistics information corresponding in measurement period is stored in car statistics information according to measurement period It, can be directly from car statistics in table, therefore when generating in the car statistics period based on the car statistics result for crossing train number number The car statistics information in the first sub-period is obtained in information table, reduces calculation amount, is improved and is based in the car statistics period Cross the formation speed of the statistical result of train number number.
Continue it will be appreciated by persons skilled in the art that capturing camera due to the front end being mounted on road in acquisition road Car data is crossed in road, therefore, if the above-mentioned car statistics period includes current statistic period, base in the car statistics period In cross train number number statistical result be also dynamic change.
Therefore, in order to obtain in the car statistics period based on cross train number number real-time statistics as a result, in a kind of realization side In formula, as shown in Fig. 2, on the basis of embodiment shown in Fig. 1, the case where the car statistics period includes the current statistic period Under, which can also include:
S106, using the first preset duration as time interval, obtains per a period of time after generating based on the statistical result of train number number is crossed Between be spaced in acquire cross car data.
First preset duration can be set to 5 minutes, 10 minutes etc., in order to obtain more real-time statistical result, can also To be set as 5 seconds, 10 seconds etc., it is not limited here.
S107 after obtaining the car data excessively acquired in each time interval, according to license plate number, crosses car data to obtained It is counted, determines and there is the license plate number for the vehicle that garage is and crossed train number number, and according to license plate number, it is tired to cross train number number Identified train number number excessively is updated to based in the statistical result of train number number excessively by the mode added.
Wherein, above-mentioned according to license plate number, in such a way that train number number excessively is cumulative, identified train number number excessively is updated to and is based on Cross the step in the statistical result of train number number, a kind of implementation are as follows: according to license plate number, train number will be crossed in current time interval What time interval added up before number is added to crosses train number number, and according still further to license plate number, the train number number of crossing after adding up is updated to step In the statistical result based on mistake train number number that rapid S105 is generated;Another implementation are as follows: according to license plate number, when directly will be current Between interval in cross train number number be added to last time interval it is updated based on cross train number number statistical result in.
In addition, since there may be for sky or not available feelings for the car data of crossing that acquires in each time interval of acquisition Condition, therefore in order to guarantee the accuracy based on the statistical result for crossing train number number, in above-mentioned steps S107 according to license plate number, to each The car data of crossing acquired in time interval is counted, and the license plate number that there is the vehicle that garage is in each time interval is obtained And cross before train number number, data validation verification can also be carried out to the car data of crossing acquired in each time interval, if It is legal, then above-mentioned steps S107 is executed according to license plate number, the car data of crossing acquired in each time interval is counted, is obtained There is the license plate number for the vehicle that garage is in each time interval and crossed train number number.If illegal, return to execution and obtain Obtain the step of crossing car data of acquisition in next time interval.
It should be understood that when current statistic end cycle and enter new measurement period after, can also continue to vehicle into Row is based on the real-time statistics for crossing train number number, but the car statistics period at this time is also changed accordingly.For example, still For the car statistics information table represented by the above-mentioned table 1, if the car statistics period determined in step S101 is 170902- 170906, then after current statistic end cycle, the car statistics period becomes 170903-170907 accordingly.
In one implementation, after current statistic end cycle, in order to continue to cross the progress of train number number in fact to vehicle Shi Tongji, the car statistics method can also include:
Car data of crossing storing in caching, acquiring in the current statistic period is counted, the current statistic period is obtained Inside there is the license plate number for the vehicle that garage is and crossed train number number, and license plate number obtained is updated to vehicle with train number number is crossed Statistics table;
Acquisition in the license plate number for crossing the vehicle that garage is and crosses train number number in object statistics cycle memory, wherein the mesh Mark measurement period are as follows: based on longest apart from current statistic cycle duration in the corresponding statistical time range of statistical result for crossing train number number Measurement period;
According to the license plate number of the vehicle obtained for being in garage excessively in object statistics cycle memory, reduced with crossing train number number Mode, use obtain object statistics cycle memory cross garage for vehicle cross train number number to being based on train number number Statistical result be updated.
Wherein, above-mentioned object statistics cycle memory is in the license plate number for crossing the vehicle that garage is and the acquisition side for crossing train number number Formula can be obtained from car statistics information table, can also be obtained from caching, it is not limited here.It should be noted that if First sub-period determined by step S102 is sky, then object statistics cycle memory is in the license plate number and mistake for crossing the vehicle that garage is Train number number should be obtained from caching.
Below to the above-mentioned license plate number according to the vehicle obtained for being in garage excessively in object statistics cycle memory, with mistake The mode of train number number reduction, use obtain object statistics cycle memory cross garage for vehicle cross train number number to base It is illustrated in the step of statistical result for crossing train number number is updated.Again with car statistics represented by above-mentioned table 1 For information table, if the car statistics period determined in step S101 is 170902-170906, that is, counts in 5 days and there is vehicle The license plate number of the vehicle of behavior and excessively train number number, and the current statistic period is 170906, then in the zero point on the 7th of September in 2017 Moment current statistic end cycle, the car statistics period becomes 170903-170907 accordingly at this time, and therefore, it is necessary to obtain mesh The mark system period 170902, (170902 this measurement period were in the car statistics period apart from the longest system of current statistic cycle duration Meter the period) in existed the vehicle that garage is license plate number and cross train number number, then according to license plate number, from 170902-170906 It is subtracted in 170902 this measurement period in statistical result based on mistake train number number in this car statistics period and there is garage For vehicle cross train number number, thus to based on cross train number number statistical result be updated.
For example, within this car statistics period of 170902-170906 based on cross train number number statistical result in, license plate number The train number number of crossing that 2- surveys A12345 is 22125, and license plate number is that the train number number of crossing that 2- surveys A12346 is 20025;Believe from car statistics It ceases in table and obtains within the object statistics period 170902, the train number number of crossing that license plate number 2- surveys A12345 is 1000, license plate number 2- The train number number of crossing for surveying A12346 is 0;Therefore, the vehicle for being according to there is garage in the object statistics period 170902 obtained License plate number, by cross the reduction of train number number in a manner of, use existed in the object statistics period 170902 obtained garage for The train number number of crossing of vehicle is updated to based on the statistical result for crossing train number number, updated based on the statistical result for crossing train number number In, the train number number of crossing that license plate number 2- surveys A12345 is 21125, and license plate number is that the train number number of crossing that 2- surveys A12346 is 20025.
As it can be seen that, in the case where the car statistics period including the current statistic period, being generated using embodiment illustrated in fig. 2 In the car statistics period based on the statistical result of train number number is crossed after, can continue to carry out real-time statistics to the train number number of crossing of vehicle.
It will be appreciated by persons skilled in the art that in order to obtain vehicle characteristics ranking in the setting period, in vehicle It can also include: the vehicle characteristics of vehicle corresponding to license plate number in statistical information, as cf:property column are corresponding in table 1 Value value.
In order to obtain vehicle characteristics statistical result, after generating based on the statistical result of train number number is crossed, as shown in figure 3, On the basis of embodiment shown in Fig. 1, which can also include:
S108, according to license plate number, and according to based on train number number is crossed in the statistical result for crossing train number number, to being based on train number The vehicle characteristics of vehicle corresponding to license plate number in several statistical results are counted, and are obtained in the car statistics period based on vehicle The statistical result of feature.
It in one implementation, may include: each license plate number obtained in the statistical result based on mistake train number number It is corresponding to cross the queue of train number number, wherein to cross the element for including in the queue of train number number are as follows: sum (m- (m+i));
M are as follows: apart from the shortest measurement period of current statistic cycle duration in each measurement period in the car statistics period Mark, (m+i) are as follows: according to sequence, i-th of the statistics in the car statistics period apart from the duration in current statistic period from short to long The mark in period, 0≤i≤n, n are as follows: longest apart from current statistic cycle duration in each measurement period in the car statistics period The mark of measurement period;
Sum (m- (m+i)) is indicated: vehicle corresponding to a license plate number crosses train number number, objective time interval in objective time interval Are as follows: the period formed from the measurement period for being identified as m to the measurement period for being identified as (m+i).
For example, if m=0, n=30, then cross the queue of train number number be expressed as [sum0, sum (0-1), sum (0-2) ..., Sum (0-30)], i.e. the car statistics period is from current statistic period to current statistic period the 30th measurement period institute shape forward At period, which contains 31 measurement periods.If m=1, n=30, then crosses the queue of train number number and be expressed as [sum1, sum (1-2), sum (1-3) ..., sum (1-31)], i.e. car statistics period are previous from the current statistic period To the current statistic period, the 31st measurement period is formed by the period to measurement period forward, which also contains 31 A measurement period.
It is in one implementation, above-mentioned according to vehicle according to the above-mentioned form of expression based on the statistical result for crossing train number number The trade mark, and train number number is crossed according in the statistical result based on mistake train number number, to based on the vehicle in the statistical result for crossing train number number The vehicle characteristics of vehicle corresponding to the trade mark are counted, and the step of the statistical result based on the vehicle characteristics car statistics period Nei is obtained Suddenly, may include:
Duplicate removal processing is carried out to based on the corresponding train number number queue excessively of each license plate number in the statistical result of train number number excessively, In, the corresponding element representation crossed in the queue of train number number of duplicate removal processing the latter license plate number: vehicle corresponding to the license plate number Whether there is garage within the element corresponding period is;
To based on cross train number number statistical result in the identical vehicle of feature license plate number corresponding to cross the queue of train number number into Row statistics obtains the vehicle of each feature and crosses vehicle statistical information within each element corresponding period for crossing the queue of train number number;
Vehicle statistical information is crossed according to obtained, generates the statistical result based on vehicle characteristics in the car statistics period.
It is understood that cross the queue of train number number carry out duplicate removal processing, can to avoid in calculating vehicle feature due to Vehicle, which is crossed, to be repeated to count caused by train number number.A kind of pair is crossed the mode that the queue of train number number carries out duplicate removal processing are as follows: by train number number Queue is converted to 0-1 matrix format, and the element sum (m- (m+i)) even crossed in the queue of train number number is greater than 0, then the mistake after duplicate removal The element in train number number queue is 1, if the element sum (m- (m+i)) crossed in the queue of train number number is equal to 0, the mistake after duplicate removal The element in train number number queue is 0.It should be understood that having served as vehicle according to the data characteristics for the element crossed in the queue of train number number A certain bit element in number queue is 1, then all elements after bit element are 1.For example, if the corresponding mistake of certain license plate number Train number number queue [sum0, sum (0-1), sum (0-2) ..., sum (0-30)]=[0,0,10,20,30,40 ..., 300], then Train number number queue of crossing after duplicate removal is [0,0,1,1,1,1 ..., 1], and first element and second element are 0, indicate the license plate Garage was not present within the two elements corresponding period in vehicle corresponding to number.
Certainly duplicate removal processing can also be carried out using other way, for example, if crossing the element sum (m- in the queue of train number number (m+i)) it is greater than 0, then the corresponding element in the queue of train number number of crossing after duplicate removal is A, if crossing the element sum in the queue of train number number (m- (m+i)) is equal to 0, then the corresponding element in the queue of train number number of crossing after duplicate removal is a.Crossing in the queue of train number number i.e. after duplicate removal Elements A indicate that vehicle corresponding to license plate number had garage within the element corresponding period and is, cross train number number after duplicate removal Element a in queue indicates that vehicle corresponding to license plate number was not present garage within the element corresponding period and is.
For in the way of 0-1 matrix, if based on vehicle corresponding to 6 license plate numbers is included in the statistical result for crossing train number number Cross train number number and vehicle characteristics, the train number number of crossing of each license plate number is carried out after duplicate removal processing as shown in table 2.
Table 2
License plate number Characteristic type 1: Characteristic type 2: Characteristic type 3: The queue of train number number is crossed after duplicate removal
111111 1 1 2 [0,1,1,1,1,1,1]
222222 2 1 2 [0,0,0,0,0,1,1]
333333 2 2 1 [0,0,1,1,1,1,1]
444444 3 2 1 [0,0,0,1,1,1,1]
555555 2 1 2 [1,1,1,1,1,1,1]
666666 1 2 1 [0,0,0,0,0,0,1]
If desired the statistical result for obtaining each feature that characteristic type is vehicle brand, then according to " characteristic type in table 2 1: vehicle brand " it arranges and " crossing the queue of train number number after duplicate removal " arranges, after duplicate removal corresponding to the identical license plate number of vehicle brand It crosses train number number queue to be counted, obtains the vehicle of each vehicle brand in each element corresponding period for crossing the queue of train number number Interior crosses vehicle statistical information, as shown in table 3:
Table 3
Characteristic type 1: Cross vehicle statistical information
1 [0,1,1,1,1,1,2]
2 [1,1,2,2,2,3,3]
3 [0,0,0,1,1,1,1]
The corresponding vehicle statistical information of crossing of the feature that vehicle brand is 1 in table 3 is [0,1,1,1,1,1,2], wherein the 1st Element is 0 expression: within the element corresponding period, it is that the 7th element is that the vehicle with this feature, which did not had garage, 2 indicate: within the element corresponding period, being with the presence of 2 vehicles with this feature garage.
Vehicle statistical information is crossed according to obtained, the statistics knot based on vehicle characteristics in the car statistics period can be generated Fruit can also be ranked up each feature in the statistical result based on vehicle characteristics, obtain each feature in each period Interior ranking.In table 3, within the 7th element corresponding period, the ranking of vehicle brand feature are as follows: vehicle brand 2, vehicle Brand 1, vehicle brand 3.
It should be noted that being calculated using matrix by the way of 0-1 matrix train number number queue progress duplicate removal processing is crossed Vehicle statistical information is crossed, duplicate removal problem can be quickly handled, substantially increase performance.
Using embodiment illustrated in fig. 3, on the basis of realizing to vehicle in the setting period and its crossing the statistics of train number number, also The statistics to vehicle characteristics in the setting period may be implemented.
Car statistics method provided in an embodiment of the present invention is illustrated with a specific embodiment below.
Method provided by the embodiment of the present invention can be realized based on distributed system, be obtained by kafka system in road Car data is crossed in the front end candid photograph camera acquisition of road setting, wherein kafka system is a distributed post-subscription message System, real time data are sent initially in Kafka, can carry out establishing ElasticSearch to data using its consumer interface It indexes and is persisted in database, ElasticSearch is the search server based on Lucene, provides one point The full-text search engine of cloth multi-user capability.The car data excessively of acquisition is sent to kafka as real time data, then reads in real time The real time data in kafka is taken to establish ElasticSearch index and real time data is persisted in database.
The timed task for setting daily morning crosses car data from ElasticSearch analysis the previous day, counts previous There is the license plate number for the vehicle that garage is and crossed train number number in it, and will count license plate number and cross train number number and update to vehicle In Statistics table.
In view of the data volume for crossing car data that camera acquisition is captured in front end is bigger, and what is acquired crosses car data as real When data can postpone when be transmitted to kafka, it is possible to there is same day transmission acquisition yesterday crosses car data to kafka Situation.In this case, the car data of crossing acquired yesterday can also be regarded into real time data processing, i.e., for car statistics Period includes the case where the same day or yesterday, is required to the flow processing according to real-time statistics.The process flow of real-time statistics can join See Fig. 4, in flow chart shown in Fig. 4, if the car statistics period is 30 days, initial time is first 30th day of the same day, eventually Only the time is the same day, if the same day is the 0th day, the previous day is the 1st day, and so on, then initial time is the 30th day.
In Fig. 4, first with Spark, (Spark is to aim at large-scale data processing and design quick logical to step S401 Computing engines can be used to construct large-scale, low latency data analysis application program) distributed treatment car statistics information Table obtains first 2 days-preceding 30 days statistical results from car statistics information table, then executes step S402 from ElasticSearch The middle license plate number for obtaining the 1st day and it is corresponding cross the statistical result of train number number, step S403 obtains the from ElasticSearch 0 day license plate number and the corresponding statistical result for crossing train number number, then merge above three according to license plate number in step s 404 Statistical result obtained in step obtains benchmark vehicle statistical information Benchmark RDD (in Spark data organization knot Structure is abstracted as RDD, indicates the data set of immutable subregion).
For example, this specific embodiment is carried out so that vehicle characteristics include vehicle brand, type of vehicle, vehicle color as an example It illustrates.Car statistics information table is loaded from database using Spark distributed computing and carry out accumulation operations and from ElasticSearch is obtained by license plate color-license plate number grouping as a result, the merging of the two result can obtain reference information Benchmark RDD is simultaneously stored in multi-level buffer (it is slow to carry out data in the different systemic hierarchials of whole system framework for multi-level buffer Deposit, to promote data read-write efficiency), the data format of Benchmark RDD is as shown in table 4, wherein sum0 be from The same day that ElasticSearch is obtained crosses train number number accumulated value, and sum1 is the mistake from ElasticSearch the previous day obtained Train number number accumulated value, sum2 are the train number number excessively of the 2nd day obtained from car statistics information table, and sum (2-30) is to unite from vehicle That counts the 2nd day to the 30th day of information table acquisition crosses train number number accumulated value, and so on.
Table 4
After obtaining benchmark vehicle statistical information Benchmark RDD, executes step S405 and utilize Spark-Streaming (park-streaming is a kind of extensive stream data processing frame, constructs on Spark, can turn streaming computing Chemical conversion is a series of stateless, the deterministic batch processing of short time intervals) real-time number is obtained from kafka by the interval batch According to then execution step S406 carries out data validation verification to real time data obtained, if verification passes through, executes step Rapid S407 updates the 0th day and the 1st day real time data to add up by batch.
For example, Spark-Streaming obtains a collection of real time data, legitimacy verifies every the batch time from kafka Afterwards, it is grouped by license plate color-license plate number and accumulation state information function updateStateByKey is utilized to return to front and added up Whole batches license plate grouping information, the data format of cumulative real time data RDD is as shown in table 5, and wherein sum0 is real-time The train number number accumulated value excessively on the same day of acquisition, sum1 are the train number number accumulated value excessively of the yesterday obtained in real time.
Table 5
Key 0th day real-time accumulated value 1st day real-time accumulated value
License plate number-license plate color sum0 sum1
Next, executing step S408, merges step S404 and step S407 data obtained, obtain the meter of this batch Calculate statistical information Compute RDD, i.e. the car statistics information of this batch.
Table 6 is the data format of Compute RDD, by taking above-mentioned table 4 and table 5 as an example, according to Key (license plate color-license plate number Code) data that merge table 4, table 5, merge table 4, corresponding sum0, sum1 in table 5, and update according to sum0, sum1 in table 5 Accumulated value in table 4, the results are shown in Table 6.
Table 6
After obtaining counting statistics information Compute RDD, executing step S409 can tire out according in Compute RDD Each accumulated value in value added list obtains the mistake for corresponding to vehicle to any one day license plate number in 31 days since the 0th day Train number number ranking (i.e. license plate topN), and (Redis is a kind of based on interior by license plate ranking deposit distributed caching Redis The distributed Key-Value database deposited) in.
After obtaining counting statistics information Compute RDD, step S410 can also be performed, according to Compute RDD It calculates vehicle characteristics ranking and is stored in distributed caching Redis.Specifically, characteristic statistics are carried out according to Compute RDD, it will be every The characteristic value of vehicle corresponding to one license plate number-license plate color and cumulative value information are converted into " 0-1 matrix " format, certain in List It is 1 that one element, which is greater than 0 in " 0-1 matrix " element, and it is 0 that a certain element, which is equal to 0 in " 0-1 matrix " element, and according to Data characteristics, when position previous in List is 1, elements all thereafter is all 1, the 0-1 matrix that table 7 is characterized.
Table 7
Feature 1 Feature 2 Feature 3 " 0-1 matrix "
Vehicle brand Type of vehicle Vehicle color [0,0,0,1,1,1…1]
For example, need to only obtain first row in table 7 if to calculate the vehicle brand ranking for 7 day datas that the 0th day starts The reduceByKey letter of Spark is rewritten as shown in table 8 with " the 0-1 matrix " generated according to the 0th day in table 6 cumulative value list Number, sequence can obtain the statistical result of vehicle brand after being added according to Key respective items in table 6, as shown in table 9.
Table 8
Vehicle brand " 0-1 matrix "
1 [0,1,1,1,1,1,1]
2 [0,0,0,0,0,1,1]
2 [0,0,1,1,1,1,1]
2 [1,1,1,1,1,1,1]
Table 9
Vehicle brand " 0-1 matrix "
1 [0,1,1,1,1,1,1]
2 [1,1,2,2,2,3,3]
Step S411 in flow chart shown in Fig. 4 judges whether carrying out full dose update, and it is more that wherein full dose, which updates, New Benchmark RDD, specifically, daily zero point by the sum0 and sum1 in Benchmark RDD data structure and most Then zeros data one day after updates the cumulative value list in Benchmark RDD according to newest one day data information List.Full dose update complete and then return to step S405 using Spark-Streaming by the interval batch from The step of real time data is obtained in kafka, continues the real-time statistics process of vehicle.
Further, the scheme that this specific embodiment provides can also realize the query function of statistical result, be specifically divided into The inquiry of historical data and real time data inquiry.Wherein the inquiry of historical data can be obtained by distributed treatment car statistics information table , for example, it is assumed that the date on the same day is 20170911, if the statistical result in 0902-0910 this 9 days is inquired, from vehicle The license plate number that there is the vehicle that garage is in this 9 days and corresponding train number number excessively are obtained in Statistics table, and are directed to Each license plate number shows statistical result in the form of a list.Such as license plate number is " 2- surveys A88888 " in car statistics information table Vehicle occurs 10 times in 20170910-20170902 daily, then statistical result such as 10 institute of table of " 2- surveys A8888 " within the period Show.Statistical result is persisted to database according to topN after all license plate numbers of distributed treatment.
Table 10
0910 0909 0908 0907 0906 0905 0904 0903 0902
0910 10 20 30 40 50 60 70 80 90
By the real-time statistics result obtained by process shown in above-mentioned Fig. 4 and distributed treatment car statistics information can be passed through The historical statistics result that table obtains can be recorded with the form such as table 11, improve search efficiency, wherein A0-A8, B0-B8 are real-time Statistical result, C0-C8, D0-D8, E0-E8 etc. are historical statistics result.Assuming that the statistics in the user query 0912-0905 period As a result A7 is then directly acquired from distributed caching, the statistical result inquired in the 0910-0906 period is then obtained from database C4。
Table 11
0912 0911 0910 0909 0908 0907 0906 0905 0904
0912 A0 A1 A2 A3 A4 A5 A6 A7 A8
0911 B0 B1 B2 B3 B4 B5 B6 B7
0910 C0 C1 C2 C3 C4 C5 C6
0909 D0 ......
0908 E0 ……
As known from the above, this specific embodiment has the beneficial effect that 1, using the design of car statistics information table, convenient for into Row historical snapshot and real-time statistics logical process can support the ranking problem of multiple features, scalability strong;2, real-time statistics It is combined in process flow using real-time stream process and snapshot calculating, introduce distributed computing engine and can quickly merge statistics letter Breath, using multi-level buffer storage, real-time statistics result obtains processing result from distributed caching, and historical statistics result is from data It is obtained in library, also can guarantee the stability of system while promoting inquiry velocity;3, vehicle characteristic information is used into matrix identification, It is finally calculated using matrix, can quickly handle duplicate removal problem and can calculate in batches, improve performance.
Corresponding to above-mentioned car statistics embodiment of the method, the embodiment of the invention provides a kind of car statistics devices, with Fig. 1 Shown embodiment of the method is corresponding, and Fig. 5 is a kind of structural schematic diagram of car statistics device provided in an embodiment of the present invention, the dress It sets and may include:
First determining module 501, for determining the car statistics period;
Second determining module 502, for corresponding newest according to car statistics information stored in car statistics information table Measurement period determines the first sub-period and the second sub-period in the car statistics period, wherein first sub-period Are as follows: the period of car statistics information, second sub-period are as follows: deposit according in caching are obtained from the car statistics information table The period for crossing car data and obtaining car statistics information of storage;
First obtains module 503, in the case where the first sub-period is not sky, from the car statistics information table In, it obtains the license plate number that there is the vehicle that garage is in first sub-period and crosses train number number;
Second obtains module 504, in the case where the second sub-period is not sky, to storing in caching and in institute The car data of crossing for stating the acquisition of the second sub-period is counted, and acquisition had the vehicle that garage is in second sub-period License plate number and excessively train number number;
Generation module 505, it is obtained for obtaining module 504 according to the first acquisition module 503 and described second License plate number and excessively train number number generate in the car statistics period based on the statistical result for crossing train number number.
Using scheme provided in an embodiment of the present invention, the system of train number number is may be implemented to vehicle in the setting period and its crossed Meter, and since car statistics information corresponding in measurement period being stored in car statistics information table according to measurement period, It therefore, can be directly from car statistics information table when generating in the car statistics period based on the car statistics result for crossing train number number The middle car statistics information obtained in the first sub-period, reduces calculation amount, improves in the car statistics period and be based on train number The formation speed of several statistical results.
Corresponding with embodiment of the method shown in Fig. 2 as a kind of embodiment of the embodiment of the present invention, Fig. 6 is this hair The structural schematic diagram for another car statistics device that bright embodiment provides, the device can also include:
Third obtains module 506, for generating institute in the case where the car statistics period including the current statistic period After stating based on the statistical result of train number number is crossed, using the first preset duration as time interval, acquisition in each time interval is obtained Cross car data;
First update module 507 is right according to license plate number after obtaining the car data excessively acquired in each time interval Car data obtained of crossing is counted, and determines and there is the license plate number for the vehicle that garage is and crossed train number number, and according to vehicle The trade mark, by cross train number number it is cumulative in a manner of, by it is identified cross train number number be updated to it is described based on the statistical result for crossing train number number In.
As a kind of embodiment of the embodiment of the present invention, described device can also include:
Second update module, for being adopted in the period to stored in caching, current statistic after current statistic end cycle The car data of crossing of collection is counted, and is obtained current statistic cycle memory in the license plate number for crossing the vehicle that garage is and is crossed train number number, And license plate number obtained is updated to the car statistics information table with train number number is crossed;
4th obtains module, for obtaining the license plate number and mistake vehicle of the vehicle for being in garage excessively in object statistics cycle memory Number, wherein the object statistics period are as follows: described to be worked as based on distance in the corresponding statistical time range of statistical result for crossing train number number The preceding longest measurement period of measurement period duration;
Third update module, for the license plate according to the vehicle obtained for being in garage excessively in object statistics cycle memory Number, by cross the reduction of train number number in a manner of, use it is obtained object statistics cycle memory cross garage for vehicle cross vehicle Number is updated to described based on the statistical result for crossing train number number.
As a kind of embodiment of the embodiment of the present invention, described device can also include:
Correction verification module, for carrying out data validation verification to the car data of crossing acquired in each time interval, if closed Method triggers first update module.
As a kind of embodiment of the embodiment of the present invention, described device can also include:
Sorting module, for generate it is described based on the statistical result of train number number is crossed after, according to crossing train number number to described It is ranked up based on the license plate number in the statistical result for crossing train number number, obtains the car statistics period corresponding license plate number row Name.
As a kind of embodiment of the embodiment of the present invention, in the car statistics information further include: corresponding to license plate number The vehicle characteristics of vehicle;
Corresponding with embodiment of the method shown in Fig. 3, Fig. 7 is another car statistics device provided in an embodiment of the present invention Structural schematic diagram, described device can also include:
Statistical module 508, for generate it is described based on the statistical result of train number number is crossed after, according to license plate number, and root According to described based on train number number is crossed in the statistical result for crossing train number number, to the license plate based in the statistical result for crossing train number number The vehicle characteristics of vehicle corresponding to number are counted, and the statistical result based on vehicle characteristics in the car statistics period is obtained.
It include: to be obtained in the statistical result based on mistake train number number as a kind of embodiment of the embodiment of the present invention The each license plate number obtained is corresponding to cross the queue of train number number, wherein crosses the element for including in the queue of train number number are as follows: sum (m- (m+ i));
M are as follows: apart from current statistic cycle duration shortest statistics week in each measurement period in the car statistics period The mark of phase, (m+i) are as follows: according to apart from the duration in current statistic period sequence from short to long, in the car statistics period The mark of i-th of measurement period, 0≤i≤n, n are as follows: apart from current statistic in each measurement period in the car statistics period The mark of the longest measurement period of cycle duration;
Sum (m- (m+i)) is indicated: vehicle corresponding to a license plate number crosses train number number, the target in objective time interval Period are as follows: the period formed from the measurement period for being identified as m to the measurement period for being identified as (m+i).
As a kind of embodiment of the embodiment of the present invention, the statistical module 508 may include:
Duplicate removal submodule, for crossing train number number to each license plate number is corresponding in the statistical result based on mistake train number number Queue carries out duplicate removal processing, wherein the corresponding element representation crossed in the queue of train number number of duplicate removal processing the latter license plate number: Vehicle corresponding to the license plate number whether there is garage within the element corresponding period;
Statistic submodule, for the license plate number institute based on the identical vehicle of feature in the statistical result for crossing train number number It corresponded to train number number queue to be counted, and obtained the vehicle of each feature in each element corresponding period for crossing the queue of train number number Interior crosses vehicle statistical information;
Submodule is generated, for crossing vehicle statistical information according to obtained, is generated in the car statistics period based on vehicle The statistical result of feature.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 8, include processor 801, communication interface 802, Memory 803 and communication bus 804, wherein processor 801, communication interface 802, memory 803 are complete by communication bus 804 At mutual communication,
Memory 803, for storing computer program;
Processor 801 when for executing the program stored on memory 803, realizes following steps:
Determine the car statistics period;
According to car statistics information stored in the car statistics information table corresponding recent statistics period, the vehicle is determined The first sub-period and the second sub-period in statistical time range, wherein first sub-period are as follows: from the car statistics information table The middle period for obtaining car statistics information, second sub-period are as follows: vehicle system is obtained according to the car data of crossing stored in caching Count the period of information;
In the case where the first sub-period is not sky, from the car statistics information table, obtain in first period of the day from 11 p.m. to 1 a.m There is the license plate number for the vehicle that garage is in section and crossed train number number;
In the case where the second sub-period is not sky, to mistake being stored in caching and in second sub-period acquisition Car data is counted, and is obtained the license plate number that there is the vehicle that garage is in second sub-period and is crossed train number number;
According to license plate number obtained and train number number is crossed, is generated in the car statistics period based on the system for crossing train number number Count result.
Specific implementation and relevant explanation content about each step of this method may refer to above-mentioned method shown in FIG. 1 Embodiment, this will not be repeated here.
In addition, processor 801 executes other realities of the program stored on memory 803 and the car statistics method realized Existing mode, it is identical as implementation mentioned by preceding method embodiment part, it also repeats no more here.
Electronic equipment provided in an embodiment of the present invention may be implemented to vehicle in the setting period and its cross the system of train number number Meter, and since car statistics information corresponding in measurement period being stored in car statistics information table according to measurement period, It therefore, can be directly from car statistics information table when generating in the car statistics period based on the car statistics result for crossing train number number The middle car statistics information obtained in the first sub-period, reduces calculation amount, improves in the car statistics period and be based on train number The formation speed of several statistical results.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
The embodiment of the invention also provides a kind of computer readable storage medium, stored in the computer readable storage medium There is instruction, when run on a computer, so that computer executes any car statistics method in above-described embodiment.
By running computer program product provided in an embodiment of the present invention, may be implemented to vehicle in the setting period and its The statistics of train number number is crossed, and since car statistics information corresponding in measurement period is stored in vehicle system according to measurement period It counts in information table, therefore when generating in the car statistics period based on the car statistics result for crossing train number number, it can be directly from vehicle The car statistics information in the first sub-period is obtained in Statistics table, is reduced calculation amount, is improved the car statistics period The interior formation speed based on the statistical result for crossing train number number.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For electronic equipment and computer readable storage medium embodiment, since it is substantially similar to the method embodiment, so description It is fairly simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (18)

1. a kind of car statistics method, which is characterized in that the described method includes:
Determine the car statistics period;
According to car statistics information stored in the car statistics information table corresponding recent statistics period, the car statistics are determined The first sub-period and the second sub-period in period, wherein first sub-period are as follows: obtained from the car statistics information table Obtain the period of car statistics information, second sub-period are as follows: car statistics letter is obtained according to the car data of crossing stored in caching The period of breath;
In the case where the first sub-period is not sky, from the car statistics information table, obtain in first sub-period In the presence of garage's vehicle for being license plate number and cross train number number;
In the case where the second sub-period is not sky, to vehicle number excessively being stored in caching and in second sub-period acquisition According to being counted, obtains the license plate number that there is the vehicle that garage is in second sub-period and cross train number number;
According to license plate number obtained and train number number is crossed, is generated in the car statistics period based on the statistics knot for crossing train number number Fruit.
2. the method according to claim 1, wherein including the current statistic period in the car statistics period In the case of, further includes:
Generate it is described based on the statistical result of train number number is crossed after, using the first preset duration as time interval, obtain between each time Car data is crossed every interior acquisition;
After obtaining the car data excessively acquired in each time interval, according to license plate number, car data obtained of crossing is counted, It determines and there is the license plate number for the vehicle that garage is and crossed train number number, and according to license plate number, in a manner of crossing train number number and add up, Identified train number number excessively is updated to described based in the statistical result of train number number excessively.
3. according to the method described in claim 2, it is characterized in that, after current statistic end cycle, the method also includes:
Car data of crossing storing in caching, acquiring in the current statistic period is counted, current statistic cycle memory is obtained In the license plate number for crossing the vehicle that garage is and train number number is crossed, and license plate number obtained is updated to the vehicle with train number number is crossed Statistics table;
Acquisition in the license plate number for crossing the vehicle that garage is and crosses train number number in object statistics cycle memory, wherein the target system Count the period are as follows: described based on longest apart from current statistic cycle duration in the corresponding statistical time range of statistical result for crossing train number number Measurement period;
According to the license plate number of the vehicle obtained for being in garage excessively in object statistics cycle memory, to cross the side of train number number reduction Formula, use it is obtained object statistics cycle memory cross garage for vehicle cross train number number be based on train number number to described Statistical result be updated.
4. according to the method described in claim 2, it is characterized in that, described according to license plate number, to being adopted in each time interval The car data of crossing of collection is counted, and is obtained the license plate number that there is the vehicle that garage is in each time interval and is crossed train number number The step of before, further includes:
Data validation verification is carried out to the car data of crossing acquired in each time interval, if legal, is executed described according to vehicle The trade mark counts the car data of crossing acquired in each time interval, obtains in each time interval and there is garage The license plate number of vehicle and the step for crossing train number number.
5. method according to any of claims 1-4, which is characterized in that the method also includes:
Generate it is described based on the statistical result of train number number is crossed after, according to crossing train number number to described based on the statistics for crossing train number number As a result the license plate number in is ranked up, and obtains the car statistics period corresponding license plate number ranking.
6. method according to any of claims 1-4, which is characterized in that in the car statistics information further include: The vehicle characteristics of vehicle corresponding to license plate number;
After generation is described based on the statistical result of train number number is crossed, the method also includes:
Train number was based on to described based on train number number is crossed in the statistical result for crossing train number number according to license plate number, and according to described The vehicle characteristics of vehicle corresponding to license plate number in several statistical results are counted, and obtain being based in the car statistics period The statistical result of vehicle characteristics.
7. according to the method described in claim 6, it is characterized in that,
Including: that each license plate number obtained is corresponding in the statistical result based on mistake train number number crosses the queue of train number number, In, cross the element for including in the queue of train number number are as follows: sum (m- (m+i));
M are as follows: apart from the shortest measurement period of current statistic cycle duration in each measurement period in the car statistics period Mark, (m+i) are as follows: according to apart from the duration in current statistic period sequence from short to long, i-th in the car statistics period The mark of measurement period, 0≤i≤n, n are as follows: in the car statistics period in each measurement period apart from the current statistic period when The mark of long longest measurement period;
Sum (m- (m+i)) is indicated: vehicle corresponding to a license plate number crosses train number number, the objective time interval in objective time interval Are as follows: the period formed from the measurement period for being identified as m to the measurement period for being identified as (m+i).
8. the method according to the description of claim 7 is characterized in that described according to license plate number, and being based on train number according to described Train number number is crossed in several statistical results, to the vehicle of vehicle corresponding to the license plate number based in the statistical result for crossing train number number The step of feature is counted, and the statistical result in the car statistics period based on vehicle characteristics is obtained, comprising:
Duplicate removal processing is carried out based on the corresponding train number number queue excessively of each license plate number in the statistical result of train number number excessively to described, In, the corresponding element representation crossed in the queue of train number number of duplicate removal processing the latter license plate number: vehicle corresponding to the license plate number Whether there is garage within the element corresponding period is;
To it is described based on cross train number number statistical result in the identical vehicle of feature license plate number corresponding to cross the queue of train number number into Row statistics obtains the vehicle of each feature and crosses vehicle statistical information within each element corresponding period for crossing the queue of train number number;
Vehicle statistical information is crossed according to obtained, generates the statistical result based on vehicle characteristics in the car statistics period.
9. a kind of car statistics device, which is characterized in that described device includes:
First determining module, for determining the car statistics period;
Second determining module, for according to car statistics information stored in car statistics information table corresponding recent statistics week Phase determines the first sub-period and the second sub-period in the car statistics period, wherein first sub-period are as follows: from institute State the period that car statistics information is obtained in car statistics information table, second sub-period are as follows: according to the mistake stored in caching The period of car data acquisition car statistics information;
First obtains module, for from the car statistics information table, obtaining in the case where the first sub-period is not sky There is the license plate number for the vehicle that garage is in first sub-period and crossed train number number;
Second obtains module, in the case where the second sub-period is not sky, to storing in caching and in second son Period acquisition cross car data counted, acquisition existed in second sub-period license plate number for the vehicle that garage is with And cross train number number;
Generation module, for obtaining module and the second acquisition module license plate number obtained according to described first and crossing vehicle Number generates in the car statistics period based on the statistical result for crossing train number number.
10. device according to claim 9, which is characterized in that described device further include:
Third obtains module, for being based on described in generation in the case where the car statistics period including the current statistic period After crossing the statistical result of train number number, using the first preset duration as time interval, obtain the interior acquisition of each time interval crosses vehicle number According to;
First update module, after obtaining the car data excessively acquired in each time interval, according to license plate number, to obtained It crosses car data to be counted, determines and there is the license plate number for the vehicle that garage is and crossed train number number, and according to license plate number, with mistake Identified train number number excessively is updated to described based in the statistical result of train number number excessively by the cumulative mode of train number number.
11. device according to claim 10, which is characterized in that described device further include:
Second update module, for after current statistic end cycle, to it is being stored in caching, acquire in the current statistic period It crosses car data to be counted, obtain current statistic cycle memory in the license plate number for crossing the vehicle that garage is and crosses train number number, and will License plate number obtained is updated to the car statistics information table with train number number is crossed;
4th obtains module, for obtaining the license plate number and mistake train number of the vehicle for being in garage excessively in object statistics cycle memory Number, wherein the object statistics period are as follows: described current based on distance in the corresponding statistical time range of statistical result for crossing train number number The longest measurement period of measurement period duration;
Third update module, for according to it is obtained in object statistics cycle memory in the license plate number for crossing garage's vehicle for being, By cross the reduction of train number number in a manner of, use it is obtained object statistics cycle memory cross garage for vehicle cross train number number It is updated to described based on the statistical result for crossing train number number.
12. device according to claim 10, which is characterized in that described device further include:
Correction verification module, for carrying out data validation verification to the car data of crossing acquired in each time interval, if legal, touching Send out the first update module described.
13. the device according to any one of claim 9-12, which is characterized in that described device further include:
Sorting module, for being based on according to train number number is crossed to described after generation is described based on the statistical result of train number number is crossed The license plate number crossed in the statistical result of train number number is ranked up, and obtains the car statistics period corresponding license plate number ranking.
14. the device according to any one of claim 9-12, which is characterized in that also wrapped in the car statistics information It includes: the vehicle characteristics of vehicle corresponding to license plate number;
Described device further include:
Statistical module, after the statistical result based on mistake train number number described in generating, according to license plate number, and according to the base Train number number is crossed in the statistical result for crossing train number number, to corresponding to the license plate number based in the statistical result for crossing train number number The vehicle characteristics of vehicle are counted, and the statistical result based on vehicle characteristics in the car statistics period is obtained.
15. device according to claim 14, which is characterized in that
Including: that each license plate number obtained is corresponding in the statistical result based on mistake train number number crosses the queue of train number number, In, cross the element for including in the queue of train number number are as follows: sum (m- (m+i));
M are as follows: apart from the shortest measurement period of current statistic cycle duration in each measurement period in the car statistics period Mark, (m+i) are as follows: according to apart from the duration in current statistic period sequence from short to long, i-th in the car statistics period The mark of measurement period, 0≤i≤n, n are as follows: in the car statistics period in each measurement period apart from the current statistic period when The mark of long longest measurement period;
Sum (m- (m+i)) is indicated: vehicle corresponding to a license plate number crosses train number number, the objective time interval in objective time interval Are as follows: the period formed from the measurement period for being identified as m to the measurement period for being identified as (m+i).
16. device according to claim 15, which is characterized in that the statistical module, comprising:
Duplicate removal submodule, for crossing the queue of train number number to each license plate number is corresponding in the statistical result based on mistake train number number Carry out duplicate removal processing, wherein the corresponding element representation crossed in the queue of train number number of duplicate removal processing the latter license plate number: the vehicle Vehicle corresponding to the trade mark whether there is garage within the element corresponding period;
Statistic submodule, for corresponding to the license plate number based on the identical vehicle of feature in the statistical result for crossing train number number It crosses train number number queue to be counted, obtains the vehicle of each feature within each element corresponding period for crossing the queue of train number number Cross vehicle statistical information;
Submodule is generated, for crossing vehicle statistical information according to obtained, is generated special based on vehicle in the car statistics period The statistical result of sign.
17. a kind of electronic equipment, which is characterized in that including processor and memory, in which:
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-8.
18. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-8 any method and step when the computer program is executed by processor.
CN201810130365.4A 2018-02-08 2018-02-08 A kind of car statistics method and device Pending CN110136452A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810130365.4A CN110136452A (en) 2018-02-08 2018-02-08 A kind of car statistics method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810130365.4A CN110136452A (en) 2018-02-08 2018-02-08 A kind of car statistics method and device

Publications (1)

Publication Number Publication Date
CN110136452A true CN110136452A (en) 2019-08-16

Family

ID=67567892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810130365.4A Pending CN110136452A (en) 2018-02-08 2018-02-08 A kind of car statistics method and device

Country Status (1)

Country Link
CN (1) CN110136452A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115294776A (en) * 2022-06-23 2022-11-04 北京北大千方科技有限公司 Method, device, equipment and medium for counting vehicle traffic based on time slice

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7376509B2 (en) * 2003-04-11 2008-05-20 Xanavi Informatics Corporation Travel time calculating method and traffic information display method for a navigation device
CN104598551A (en) * 2014-12-31 2015-05-06 华为软件技术有限公司 Data statistics method and device
CN105913656A (en) * 2016-04-28 2016-08-31 泰华智慧产业集团股份有限公司 Distributed statistics based method and system for frequently passing vehicles
CN106682232A (en) * 2017-01-13 2017-05-17 西安电子科技大学 Statistical statement generating method of vehicle monitoring system
CN107391681A (en) * 2017-07-24 2017-11-24 广州市百果园信息技术有限公司 Business datum ranks processing method and machinable medium
CN107484201A (en) * 2017-09-30 2017-12-15 广东欧珀移动通信有限公司 Flow statistical method and device, terminal, computer-readable recording medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7376509B2 (en) * 2003-04-11 2008-05-20 Xanavi Informatics Corporation Travel time calculating method and traffic information display method for a navigation device
CN104598551A (en) * 2014-12-31 2015-05-06 华为软件技术有限公司 Data statistics method and device
CN105913656A (en) * 2016-04-28 2016-08-31 泰华智慧产业集团股份有限公司 Distributed statistics based method and system for frequently passing vehicles
CN106682232A (en) * 2017-01-13 2017-05-17 西安电子科技大学 Statistical statement generating method of vehicle monitoring system
CN107391681A (en) * 2017-07-24 2017-11-24 广州市百果园信息技术有限公司 Business datum ranks processing method and machinable medium
CN107484201A (en) * 2017-09-30 2017-12-15 广东欧珀移动通信有限公司 Flow statistical method and device, terminal, computer-readable recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115294776A (en) * 2022-06-23 2022-11-04 北京北大千方科技有限公司 Method, device, equipment and medium for counting vehicle traffic based on time slice
CN115294776B (en) * 2022-06-23 2024-04-12 北京北大千方科技有限公司 Method, device, equipment and medium for counting traffic of vehicles based on time slices

Similar Documents

Publication Publication Date Title
EP2750087A1 (en) Methods and systems for determining estimated package delivery/pick-up times
CN108229999B (en) Method and device for evaluating competitive products
Tan et al. Grid-based data management in distributed simulation
CN106844178B (en) Prediction is presented the method for information transferring rate, calculates equipment, server and system
JP2006004411A5 (en)
CN109033234A (en) It is a kind of to update the streaming figure calculation method and system propagated based on state
CN106776928A (en) Recommend method in position based on internal memory Computational frame, fusion social environment and space-time data
CN110162292A (en) Voice broadcast method and device
CN107038620A (en) Based on user call a taxi preference information push and device
CN110276012A (en) The generation method of visual user portrait a kind of, device and calculate equipment
CN103970747B (en) Data processing method for network side computer to order search results
CN104809246B (en) The processing method and processing device of charge data
CN109558544A (en) Sort method and device, server and storage medium
CN111310052A (en) User portrait construction method and device and computer readable storage medium
CN102072735A (en) Method and system for calculating mileage quickly
CN110136452A (en) A kind of car statistics method and device
CN109829098A (en) Search result optimization method, device and server
CN107273544B (en) Application program recommendation method, application program recommendation device and server
CN112418941A (en) Resource popularity calculation method, system and storage medium based on real-time flow
CN110472143A (en) A kind of information-pushing method, device, readable storage medium storing program for executing and terminal device
CN109740621A (en) A kind of video classification methods, device and equipment
CN106992901A (en) Method and apparatus for scheduling of resource simulated pressure
CN112579691B (en) Data processing method and device supporting large-screen display
CN113094388B (en) Method and related device for detecting user workplace and residence
CN109033158A (en) Data deduplication statistical method and device based on specified time window

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190816

RJ01 Rejection of invention patent application after publication