Disclosure of Invention
The invention provides a vehicle aggregation analysis method and device, which can reduce the misjudgment rate of vehicle aggregation events.
In order to achieve the purpose, the invention is realized by the following technical scheme:
in one aspect, the present invention provides a vehicle aggregation analysis method, including:
s1: determining a target retention event;
s2: determining at least one first stuck-at-time gate of a first vehicle at which the target stuck event occurs, and determining at least one second gate logically adjacent to the first gate corresponding to the target stuck event;
s3: acquiring each retention event corresponding to the first bayonet and each second bayonet;
s4: executing, for each acquired retention event: determining a common hold-up duration for a current hold-up event and the target hold-up event; determining at least one second stuck-at-frequent-stay gate of a second vehicle at which the current stuck event occurred; when it is determined that the common retention time period is not less than a first preset threshold value and the at least one first frequent-retention bayonet and the at least one second frequent-retention bayonet do not simultaneously include the first bayonet, it is determined that an aggregation event is generated between the first vehicle and the second vehicle.
Further, the S1 includes:
a1: acquiring at least one bayonet passing record of the first vehicle in a first preset time period, wherein each bayonet passing record comprises a bayonet mark and passing time, and the at least one bayonet passing record is sequentially arranged according to an arrangement sequence of the passing time from first to last;
a2: determining a current gate passing record in the at least one gate passing record;
a3: calculating the retention time corresponding to the current gate passage record according to a formula I;
a4: judging whether the retention time length is not less than a second preset threshold value, if so, determining the target retention event, and executing S2, otherwise, taking the next gate passage record as the current gate passage record, and executing A2;
wherein the target retention event comprises: a first gate corresponding to the target retention event, a vehicle on which the target retention event occurs, a retention time, a retention start time and a retention stop time;
wherein the first gate is a gate corresponding to a gate identifier in the current gate passage record, the vehicle in which the target retention event occurs is the first vehicle, the retention starting time is the passage time in the current gate passage record, and the difference between the retention deadline and the retention starting time is the calculated retention time length,
the formula one comprises:
wherein, △ tiThe retention time length t corresponding to the ith card slot passing record in the at least one card slot passing recordiThe passing time in the ith card entrance passing record is obtained, n is the total number of the at least one card entrance passing record, and t' is the deadline time of the first preset time period.
Further, before the S2, the method further includes:
determining at least one third gate, wherein the first vehicle has a retention event at any one of the third gates;
for each of the third bayonets: calculating the number of times of the retention event of the first vehicle at the current third interface within a second preset time period;
determining the maximum number of times of the calculated at least one number of times;
for each of said calculated times, performing: calculating a first difference value between the current times and the maximum times according to a formula II; when the first difference value is judged to be not larger than a third preset threshold value, recording a third bayonet corresponding to the current times as a first frequently-retained bayonet of the first vehicle;
the second formula includes:
wherein Y is the first difference, nmaxIs the maximum number, niIs the ith number of the at least one number.
Further, before the S2, the method further includes:
determining at least one fourth bayonet, wherein the distance between the first bayonet and any one fourth bayonet is not greater than a fifth preset threshold;
for each of the fourth bayonets: when the passing time length of any vehicle passing through the current fourth gate and the first gate is determined to be not more than a fourth preset threshold value, controlling the effective vehicle passing number between the current fourth gate and the first gate to be added with 1;
and recording that the current fourth bayonet is logically adjacent to the first bayonet when the effective vehicle passing quantity between the current fourth bayonet and the first bayonet is not less than a sixth preset threshold within a third preset time period.
Further, in S4, the determining the common retention time period of the current retention event and the target retention event includes:
determining a maximum value of the retention start time of the current retention event and the retention start time of the target retention event as a common retention start time;
determining a minimum of a retention deadline for the current retention event and a retention deadline for the target retention event as a common retention deadline;
determining a difference between the common hold-up deadline minus the common hold-up start time as a common hold-up duration for determining a current hold-up event and the target hold-up event.
Further, in S4, the method further includes: and judging whether the retention time of the current retention event is not less than a seventh preset threshold, if so, executing the determination of the common retention time of the current retention event and the target retention event.
Further, in S4, the method further includes: according to a formula III, calculating the retention time similarity of the current retention event and the target retention event;
when the first bayonet is judged to be included in the at least one first frequent detention bayonet or the at least one second frequent detention bayonet, judging whether the detention time similarity is not less than an eighth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle;
when the at least one first frequent detention bayonet and the at least one second frequent detention bayonet are judged to not comprise the first bayonet, judging whether the detention time similarity is not less than a ninth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle;
wherein the ninth preset threshold is not less than the eighth preset threshold;
the third formula includes:
wherein η is the residence time similarity, t is the common residence time length, taIs the retention duration of the current retention event, tbIs the retention time period of the target retention event.
In another aspect, the present invention provides a vehicle aggregation analysis apparatus including:
a first determination unit for determining a target retention event;
a second determination unit for determining at least one first detention-often-mount of a first vehicle at which the target detention event occurs, and determining at least one second mount logically adjacent to the first mount corresponding to the target detention event;
the acquisition unit is used for acquiring each retention event corresponding to the first bayonet and each second bayonet;
a first processing unit, configured to execute, for each acquired retention event: determining a common hold-up duration for a current hold-up event and the target hold-up event; determining at least one second stuck-at-frequent-stay gate of a second vehicle at which the current stuck event occurred; when it is determined that the common retention time period is not less than a first preset threshold value and the at least one first frequent-retention bayonet and the at least one second frequent-retention bayonet do not simultaneously include the first bayonet, it is determined that an aggregation event is generated between the first vehicle and the second vehicle.
Further, the first determination unit includes: the system comprises an acquisition subunit, a determination subunit, a calculation subunit and a processing subunit;
the obtaining subunit is configured to obtain at least one bayonet passage record of the first vehicle in a first preset time period, where each bayonet passage record includes a bayonet identifier and a passage time, and the at least one bayonet passage record is sequentially arranged according to an arrangement sequence of the passage times from first to last;
the determining subunit is configured to determine a current gate passage record in the at least one gate passage record;
the calculating subunit is configured to calculate, according to a formula one, a retention time duration corresponding to the current gate passage record;
the processing subunit is configured to determine whether the retention time is not less than a second preset threshold, determine the target retention event and trigger the second determining unit if the retention time is not less than the second preset threshold, and otherwise, take the next gate passage record as the current gate passage record and trigger the determining subunit;
wherein the target retention event comprises: a first gate corresponding to the target retention event, a vehicle on which the target retention event occurs, a retention time, a retention start time and a retention stop time;
wherein the first gate is a gate corresponding to a gate identifier in the current gate passage record, the vehicle in which the target retention event occurs is the first vehicle, the retention starting time is the passage time in the current gate passage record, and the difference between the retention deadline and the retention starting time is the calculated retention time length,
the formula one comprises:
wherein, △ tiThe retention time length t corresponding to the ith card slot passing record in the at least one card slot passing recordiThe passing time in the ith card entrance passing record is obtained, n is the total number of the at least one card entrance passing record, and t' is the deadline time of the first preset time period.
Further, the vehicle aggregation analysis apparatus further includes: the second processing unit is used for determining at least one third gate, wherein the first vehicle has a retention event at any one of the third gates; for each of the third bayonets: calculating the number of times of the retention event of the first vehicle at the current third interface within a second preset time period; determining the maximum number of times of the calculated at least one number of times; for each of said calculated times, performing: calculating a first difference value between the current times and the maximum times according to a formula II; when the first difference value is judged to be not larger than a third preset threshold value, recording a third bayonet corresponding to the current times as a first frequently-retained bayonet of the first vehicle;
the second formula includes:
wherein Y is the first difference, nmaxIs the maximum number, niIs the ith number of the at least one number.
Further, the vehicle aggregation analysis apparatus further includes: the third processing unit is used for determining at least one fourth bayonet, wherein the distance between the first bayonet and any one fourth bayonet is not greater than a fifth preset threshold; for each of the fourth bayonets: when the passing time length of any vehicle passing through the current fourth gate and the first gate is determined to be not more than a fourth preset threshold value, controlling the effective vehicle passing number between the current fourth gate and the first gate to be added with 1; and recording that the current fourth bayonet is logically adjacent to the first bayonet when the effective vehicle passing quantity between the current fourth bayonet and the first bayonet is not less than a sixth preset threshold within a third preset time period.
Further, the first processing unit is specifically configured to determine that a maximum value of the retention start time of the current retention event and the retention start time of the target retention event is a common retention start time; determining a minimum of a retention deadline for the current retention event and a retention deadline for the target retention event as a common retention deadline; determining a difference between the common hold-up deadline minus the common hold-up start time as a common hold-up duration for determining a current hold-up event and the target hold-up event.
Further, the first processing unit is further configured to determine whether a retention time duration of the current retention event is not less than a seventh preset threshold, and if so, execute the determination of a common retention time duration of the current retention event and the target retention event.
Further, the first processing unit is further configured to calculate a retention time similarity between the current retention event and the target retention event according to a formula three; when the first bayonet is judged to be included in the at least one first frequent detention bayonet or the at least one second frequent detention bayonet, judging whether the detention time similarity is not less than an eighth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle; when the at least one first frequent detention bayonet and the at least one second frequent detention bayonet are judged to not comprise the first bayonet, judging whether the detention time similarity is not less than a ninth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle;
wherein the ninth preset threshold is not less than the eighth preset threshold;
the third formula includes:
wherein η is the residence time similarity, t is the common residence time length, taIs the retention duration of the current retention event, tbIs the retention time period of the target retention event.
The invention provides a vehicle aggregation analysis method and a device, wherein the method comprises the following steps: determining a target retention event; determining each frequent detention gate of a first vehicle with a target detention event and each second gate which is logically adjacent to the first gate corresponding to the target detention event; acquiring each retention event corresponding to the first bayonet and each second bayonet; executing the following steps for each acquired retention event: determining a common retention time length of a current retention event and a target retention event; determining each frequent detention checkpoint of a second vehicle in which the current detention event occurs; when the common detention time length is judged to be not less than a first preset threshold value and the first gate is not the frequent detention gate of the first vehicle and the second vehicle at the same time, it is determined that the aggregation event is generated between the two vehicles. Based on the traffic situation of each vehicle at each gate, a vehicle aggregation event can be determined. The vehicle traffic data volume is large, and the source is wide, so the invention can reduce the misjudgment rate of the vehicle gathering event.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a vehicle aggregation analysis method, which may include the following steps:
step 101: a target retention event is determined.
Step 102: the method further includes determining at least one first stuck-at-time gate of a first vehicle at which the target stuck event occurred, and determining at least one second gate logically adjacent to the first gate corresponding to the target stuck event.
Step 103: and acquiring each retention event corresponding to the first bayonet and each second bayonet respectively.
Step 104: executing, for each acquired retention event: determining a common hold-up duration for a current hold-up event and the target hold-up event; determining at least one second stuck-at-frequent-stay gate of a second vehicle at which the current stuck event occurred; when it is determined that the common retention time period is not less than a first preset threshold value and the at least one first frequent-retention bayonet and the at least one second frequent-retention bayonet do not simultaneously include the first bayonet, it is determined that an aggregation event is generated between the first vehicle and the second vehicle.
The embodiment of the invention provides a vehicle aggregation analysis method, which is used for determining a target retention event; determining each frequent detention gate of a first vehicle with a target detention event and each second gate which is logically adjacent to the first gate corresponding to the target detention event; acquiring each retention event corresponding to the first bayonet and each second bayonet; executing the following steps for each acquired retention event: determining a common retention time length of a current retention event and a target retention event; determining each frequent detention checkpoint of a second vehicle in which the current detention event occurs; when the common detention time length is judged to be not less than a first preset threshold value and the first gate is not the frequent detention gate of the first vehicle and the second vehicle at the same time, it is determined that the aggregation event is generated between the two vehicles. Based on the traffic situation of each vehicle at each gate, a vehicle aggregation event can be determined. The vehicle traffic data volume is large, and the source is wide, so the embodiment of the invention can reduce the misjudgment rate of the vehicle gathering event.
In one embodiment of the invention, the gate can be a high-speed intersection, a traffic light intersection and the like, and the gate can acquire the license plate number of the passing vehicle and record the passing time of the vehicle and the like.
In the embodiment of the invention, for any vehicle, when the vehicle passes through a gate A and a gate B, the used passing time can be used as the staying time of the vehicle at the gate A. In general, the vehicle passes through the gate a and then passes through the gate B, so the retention time period may be the difference between the transit time of the vehicle at the gate B and the transit time at the gate a.
Wherein, bayonet A and bayonet B can be the same bayonet, also can be different bayonets.
For example, a vehicle may pass through a plurality of gates during driving, and the gate a and the gate B may be any two adjacent gates, or even any two adjacent intersections that are not adjacent to each other.
For another example, if the vehicle passes through a gate, the vehicle owner gets off and stops, such as the vehicle owner goes home, the vehicle owner arrives at a destination office, and the vehicle owner stays for a certain time and gets on and drives, the vehicle can return through the gate, so that the gate a and the gate B are the same gate.
Based on the above, in the embodiment of the present invention, when the staying time period of the vehicle at the gate a is not less than the corresponding set threshold, it may be considered that the vehicle has a staying event at the gate a.
In the embodiment of the invention, the effective vehicle passing number between the two gates can be determined: for the bayonets A and B, no matter passing through the bayonets B through the bayonets A or passing through the bayonets A through the bayonets B, as long as it is determined that the used passing time of a vehicle between the two bayonets is not more than the corresponding set threshold value, the effective vehicle passing quantity between the bayonets A and B is added by 1.
Based on the above, in the embodiment of the present invention, if the number of vehicles passing through the two gates is not less than the corresponding threshold in the corresponding preset time period, the two gates may be considered to be logically adjacent to each other.
Based on the above, in the embodiment of the present invention, according to the entrance detention condition of each vehicle, the common detention time length of any two vehicles at any entrance can be determined, and if the common detention time length is not less than the corresponding set threshold, it can be considered that the two vehicles have an aggregation event at the entrance.
For example, after the vehicle 1 passes through the bayonet A at 13:00 for 5 hours, the vehicle returns through the bayonet A again at 18:00, and after the vehicle 2 passes through the bayonet A at 14:00 for 4.5 hours, the vehicle passes through the bayonet B at 18:30, so that the common detention time period of the two vehicles can be 14: 00-18: 00, and the common detention time period of the two vehicles at the bayonet A can be determined to be 4 hours.
Based on the above, in the embodiment of the present invention, based on the residence time lengths of the two vehicles at the gate a respectively and the common residence time length of the two vehicles at the gate a, the residence time similarity may be further determined for the vehicle aggregation event.
For example, case 1: the detention time of the vehicle 1 at the bayonet A is 5h, the detention time of the vehicle 2 at the bayonet A is 4.5h, and the common detention time of the vehicle 1 and the vehicle at the bayonet A is 4 h;
case 2: the detention time of the vehicle 1 at the bayonet A is 5h, the detention time of the vehicle 2 at the bayonet A is 4.5h, and the common detention time of the vehicle and the vehicle at the bayonet A is 1 h;
case 3: the detention time of the vehicle 1 at the bayonet A is 10h, the detention time of the vehicle 2 at the bayonet A is 4.5h, and the common detention time of the vehicle and the vehicle at the bayonet A is 4 h;
in the above three cases, it is considered that the residence time similarity in case 1 is higher than that in case 2 and higher than that in case 3.
In view of the above, in the embodiment of the present invention, for any vehicle, if the number of times of the retention events of the vehicle in one bay is relatively large, the bay may be regarded as the regular retention bay of the vehicle. Generally, the number of the often-detained bayonets of any vehicle is at least one. For example, the residence and office of the user are easily determined to be frequently detained at the bayonet.
The vehicle aggregation analysis method provided by the embodiment of the invention can be further specifically limited based on the defined vehicle retention time, retention events, the effective vehicle passing number between the gates, logic adjacency of the gates, vehicle aggregation, retention time similarity, frequent vehicle retention at the gates and the like.
In one embodiment of the present invention, to illustrate one possible implementation of determining a target retention event, thestep 101 includes:
a1: acquiring at least one bayonet passing record of the first vehicle in a first preset time period, wherein each bayonet passing record comprises a bayonet mark and passing time, and the at least one bayonet passing record is sequentially arranged according to an arrangement sequence of the passing time from first to last;
a2: determining a current gate passing record in the at least one gate passing record;
a3: calculating the retention time corresponding to the current gate traffic record according to the following formula (1);
a4: judging whether the retention time length is not less than a second preset threshold value, if so, determining the target retention event, and executingstep 102, otherwise, taking the next gate passage record as the current gate passage record, and executing A2;
wherein the target retention event comprises: a first gate corresponding to the target retention event, a vehicle on which the target retention event occurs, a retention time, a retention start time and a retention stop time;
wherein the first gate is a gate corresponding to a gate identifier in the current gate passage record, the vehicle in which the target retention event occurs is the first vehicle, the retention starting time is the passage time in the current gate passage record, and the difference between the retention deadline and the retention starting time is the calculated retention time length,
wherein, △ tiThe retention time length t corresponding to the ith card slot passing record in the at least one card slot passing recordiThe passing time in the ith card entrance passing record is obtained, n is the total number of the at least one card entrance passing record, and t' is the deadline time of the first preset time period.
In detail, the staff may set the first preset time period and the second preset threshold as needed. For example, the first preset time period may be the current day, the current month, or approximately 3 months. If the retention time reaches 1h, the retention time is considered to be retained, so the second preset threshold value can be 1 h.
In detail, when the worker considers that the first vehicle needs to be analyzed, the license plate number of the first vehicle is specified, so that the passing record of the gate of the first vehicle in a preset time period is obtained. Typically, each gate passage record may include a vehicle identification, a gate identification, and a passage time. In order to conveniently calculate the vehicle residence time at each bayonet, the collected bayonet passing records can be sequentially arranged according to the time sequence.
Then, based on the arranged passage records of the gates, the detention time of the first vehicle at each gate can be calculated and compared with the corresponding threshold, if the detention time is not less than the threshold, the detention time of the first vehicle at the gate is longer, so that a detention event exists, and if the detention time is less than the threshold, the next detention time can be continuously calculated.
When it is determined that a retention event exists, i.e., the target retention event, thestep 102 may be performed for the target retention event.
However, when the first preset time period is long, the collected checkpoint communication records may include a plurality of detention events of the first vehicle. In this way, after theabove steps 101 to 104 are performed, each retention event may be determined again, and theabove steps 101 to 104 may be repeatedly performed for each retention event determined.
Of course, in another embodiment of the present invention, all retention events may be determined according to the collected checkpoint communication records, and theabove steps 101 to 104 may be performed for each determined retention event.
It should be noted that, for example, the first preset time period is from 8:00 of the day to 8:00 of the next day, the second preset threshold is 1h, and if the passing time of the last gate passing record is 21:00 of the day, since there is no next gate passing record, it is obvious that the vehicle does not pass through any gate in the time period from 21:00 of the day to 8:00 of the next day, and the vehicle stays in the 11 h. Therefore, in the above formula (1), the retention time period is calculated in a different manner when i < n and i ═ n.
Based on the foregoing, in one embodiment of the invention, a vehicle holdup event calculation model may be constructed: by means of Hand the adoop MapReduce distributed computing framework is used for computing and analyzing the detention events of the license plate numbers of the mass specified types. According to the appointed license plate number, searching a Hbase database, and arranging the passing records of the vehicle at the entrance in the appointed time period in the passing time sequence to form a result set LIST 1; traversing a result set LIST1, and from the second record, subtracting the last recorded passing time from the current recorded passing time to obtain the residence time of the vehicle at the last gate; if the retention time is greater than the set time threshold T0And recording the license plate number, the previous gate passing time, the current gate passing time, the previous gate number, the current gate number and the retention time in the Hbase retention event table.
In detail, the retention event of each vehicle may be determined in advance before the above-describedsteps 101 to 104. Thus, the staff can take any retention event as a target retention event according to the requirement so as to perform subsequent analysis.
In an embodiment of the present invention, to illustrate a possible implementation manner of determining the frequent detention bayonet, the method further includes, before the step 102:
determining at least one third gate, wherein the first vehicle has a retention event at any one of the third gates;
for each of the third bayonets: calculating the number of times of the retention event of the first vehicle at the current third interface within a second preset time period;
determining the maximum number of times of the calculated at least one number of times;
for each of said calculated times, performing: calculating a first difference between the current number and the maximum number according to the following formula (2); when the first difference value is judged to be not larger than a third preset threshold value, recording a third bayonet corresponding to the current times as a first frequently-retained bayonet of the first vehicle;
wherein Y is the first difference, nmaxIs the maximum number, niIs the ith number of the at least one number.
In detail, to analyze the stuck-at gates of any vehicle, it is first necessary to collect all the gates of the vehicle where the stuck event exists, i.e. the at least one third gate. And determining each third bayonet based on the calculated residence time corresponding to each bayonet according to the collected vehicle passing record of the bayonet.
For example, it is calculated that, in the last year, the number of times of the retention events of the first vehicle at each third interface in the descending order is: bayonet 01: 2 ten thousand times, bayonet 03: 1.5 ten thousand times, bayonet 10: 0.8 ten thousand times, bayonet 04: 0.1 ten thousand times, bayonet 06: … … times of 0.09 million. Thus, the maximum number of times is 2 ten thousand, and the first difference between 2 ten thousand times and 2 ten thousand times is calculated to be 0%, the first difference between 1.5 ten thousand times and 2 ten thousand times is calculated to be 25%, and the first difference between 0.8 ten thousand times and 2 ten thousand times is calculated to be 60%. Assuming that the third preset threshold is 30%, of the gates, only the gate 01 and the gate 03 are the constant retention gates of the first vehicle.
In another embodiment of the present invention, after calculating the number of times that the first vehicle has a retention event at each third card slot, each number of times may be compared with a set value, and if not less than the set value, the first vehicle may be considered as a regular retention card slot of the first vehicle. For example, when the predetermined value is 0.5 ten thousand times, all of the gates 01, 03, and 10 are the gates that are always retained in the first vehicle.
Based on the above, in one embodiment of the present invention, a vehicle frequent detention checkpoint calculation model may be constructed: and calculating and analyzing the retention events of the license plate numbers of the mass specified types by using a Hadoop MapReduce distributed calculation framework. Retrieving the gate passing records of the vehicle in the Hbase database within a specified time period according to the specified license plate number, and arranging the gate passing records in the passing time sequence to form a result set LIST 2; traversing the result set LIST2, and from the beginning of the second record, subtracting the previous record passing time from the current record passing time to obtain the residence time of the vehicle at the previous gate, and if the residence time is greater than the set time threshold T2, adding 1 to the long-time residence time of the license plate at the previous gate. And after traversing is finished, finding the frequently detained card slots by utilizing a clustering algorithm according to the detaining times of the card slots corresponding to the license plates.
In detail, the frequent leaving gate of each vehicle may be determined in advance before theabove steps 101 to 104.
According to the above, it can be determined that any vehicle often stays at the gate, and the embodiment of the present invention is not described herein.
In an embodiment of the present invention, to illustrate a possible implementation manner of determining logical adjacency of a bayonet, the method further includes, before the step 102: determining at least one fourth bayonet, wherein the distance between the first bayonet and any one fourth bayonet is not greater than a fifth preset threshold;
for each of the fourth bayonets: when the passing time length of any vehicle passing through the current fourth gate and the first gate is determined to be not more than a fourth preset threshold value, controlling the effective vehicle passing number between the current fourth gate and the first gate to be added with 1;
and recording that the current fourth bayonet is logically adjacent to the first bayonet when the effective vehicle passing quantity between the current fourth bayonet and the first bayonet is not less than a sixth preset threshold within a third preset time period.
In detail, any one of the fourth bayonets is usually closer to the first bayonets in physical distance.
In detail, the used passage time length not only relates to the record of the passage of the vehicle from the current fourth gate to the first gate, but also relates to the record of the passage of the vehicle from the first gate to the current fourth gate.
Based on the above, in an embodiment of the present invention, a bayonet adjacency calculation model may be constructed: and calculating and analyzing the mass vehicle passing data of the gate by utilizing a Hadoop MapReduce distributed calculation framework. Retrieving vehicle access records in a specified time period, and arranging the vehicle access records in the sequence of license plate numbers and access time to form a result set LIST 3; traversing a result set LIST3, and from the beginning of the second record, subtracting the passing time of the last record passing through the gate G1 from the passing time of the current gate G2, namely the residence time of the vehicle at the last gate, and if the residence time is less than a set time threshold T3, adding 1 to the effective vehicle passing number records G1-G2; until the traversal is completed, obtaining a plurality of key value pair sets of adjacent gates and effective vehicle passing numbers, such as { "G1-G2": 200000, "G1-G3": 100000, "G4-G5": 10000, … … }; traversing this set, if a certain two checkpoints have a valid number of passing cars greater than a threshold N1, then the two checkpoints are considered to be logically adjacent checkpoints.
In detail, each logically adjacent bayonet may be determined in advance before theabove steps 101 to 104.
According to the above, the logically adjacent gates of any vehicle can be determined, and the embodiment of the present invention is not described herein again.
In one embodiment of the present invention, to illustrate one possible implementation of determining a common retention period, the determining 104 a common retention period of a current retention event and a target retention event comprises:
determining a maximum value of the retention start time of the current retention event and the retention start time of the target retention event as a common retention start time;
determining a minimum of a retention deadline for the current retention event and a retention deadline for the target retention event as a common retention deadline;
determining a difference between the common hold-up deadline minus the common hold-up start time as a common hold-up duration for determining a current hold-up event and the target hold-up event.
In detail, based on the retention start-stop times of the two retention events, the common retention period of the two can be determined.
In an embodiment of the present invention, thestep 104 further includes: and judging whether the retention time of the current retention event is not less than a seventh preset threshold, if so, executing the determination of the common retention time of the current retention event and the target retention event.
For example, if the detention time of a vehicle at a gate exceeds a set value of 1h, the detention event is considered to occur, so that some vehicle passing conditions with short detention time are screened out in a large range. When analyzed for a particular aggregate event, further screening may be performed based on the retention duration of the retention event. That is, the retention is usually, but not necessarily, accumulation.
For example, when the situation of the crowd gambling needs to be analyzed, the seventh preset threshold value may be determined to be 5h, considering that the duration of the crowd gambling is not less than half a day. Thus, when the retention time of a retention event is longer than 1h but not longer than 5h, the retention event can be screened out, so that the common retention time and the subsequent flow do not need to be calculated, and the data calculation amount can be greatly reduced while the requirement is met.
Similarly, in thestep 104, the common retention time period is required to be not less than the first preset threshold. For example, in the case of a betting share, the first preset threshold may be determined to be 4 h. If a retention event has a retention time longer than 5h but the common retention time with the target retention event is only 0.5h, it can be considered that the two are not subjected to mass gambling, i.e. are not subjected to aggregation event, because the common retention time is short.
For the determination of the aggregate event, for example, the residents in the same cell are both staying at a gate and the common staying time period is sufficient, but the two are not actually considered in the analysis of the situation of the crowd gambling, so that in thestep 104, it is required that the first gate is not the frequent staying gate of the first vehicle and the second vehicle at the same time.
Thus, when two vehicles are considered to be gathered, the first bayonet can meet any one of the following conditions:
condition 1: the first bayonet is a bayonet which is usually detained by the first vehicle;
condition 2: the first bayonet is a bayonet which is usually retained by the second vehicle;
condition 3: the first bayonet is neither a commonly detained bayonet of the first vehicle nor a commonly detained bayonet of the second vehicle.
Based on the above, when the aggregation event is judged, the common retention time length, the retention time length and the frequent retention bayonet are considered in the processing, and the retention time similarity can be further judged for reducing the large data calculation amount on the basis of ensuring the judgment accuracy.
In detail, with respect to the above condition 1 or condition 2, there may be the following case 1:
when the user A goes to the user B to make a visitor, the residence time of the vehicle used by the user A is usually relatively long, and the residence time of the vehicle used by the user B is usually relatively short. For example, if user a returns home at 18:00 of the day and leaves home at 8:00 of the next day, the residence time is 14h, and if user B makes guests at home at 18:30 of the day and leaves home at 21:30 of the day, the residence time is 3 h.
In detail, with respect to the above condition 3, there may be the following case 2:
user a and user B agree to a restaurant for dinner, and the residence time of the vehicle used by user a and user B is typically relatively short. For example, user A departs at 13:00 to arrive at the restaurant and departs at 15:00 for a residence time of 2 hours, and user B departs at 12:45 to arrive at the restaurant and departs at 15:00 for a residence time of 2.25 hours.
Comparing case 1 with case 2, it can be seen that the residence time similarity in case 1 is relatively low, and the residence time similarity in case 2 is relatively high, so that different determination thresholds can be set for the above 3 modes.
Based on the above, in an embodiment of the present invention, in order to illustrate a possible implementation manner of defining the aggregation events according to the residence time similarity, thestep 104 further includes: calculating a retention time similarity of the current retention event and the target retention event according to the following formula (3);
when the first bayonet is judged to be included in the at least one first frequent detention bayonet or the at least one second frequent detention bayonet, judging whether the detention time similarity is not less than an eighth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle;
when the at least one first frequent detention bayonet and the at least one second frequent detention bayonet are judged to not comprise the first bayonet, judging whether the detention time similarity is not less than a ninth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle;
wherein the ninth preset threshold is not less than the eighth preset threshold;
wherein η is the residence time similarity, t is the common residence time length, taIs the retention duration of the current retention event, tbIs the retention time period of the target retention event.
In summary, in one embodiment of the present invention, a vehicle aggregate event calculation model may be constructed: and analyzing a result set generated by the vehicle retention event calculation model by utilizing a Hadoop MapReduce distributed calculation framework, and analyzing each retention event one by one. The method specifically comprises the following steps: (1) obtaining a gate G1 where the target retention event is located; (2) according to the bayonet adjacent calculation model, all logically adjacent bayonet sets M1 of the bayonet G1 are searched, and a bayonet G1 is additionally added to M1; (3) according to the bayonet set M1, searching a vehicle retention event set M2 of all bayonets in the set; (4) and traversing the retention event set M2, analyzing and comparing each retention event with the current retention event, judging from the aspects of retention time length, common retention time length, retention time similarity and vehicle frequent retention bayonet, and judging that the two vehicles which are currently compared generate the aggregation event if the retention time length is greater than a corresponding threshold value, the common retention time length is greater than a corresponding threshold value, the retention time similarity is greater than a corresponding threshold value and the retention bayonet is not the vehicle frequent retention bayonet of the two vehicles at the same time.
In summary, the embodiment of the present invention provides a mass data mining analysis method for various social vehicle checkpoint traffic records, which can establish an effective computational analysis model for vehicle abnormal aggregation analysis, thereby enriching the types and ranges of the analyzed vehicles and reducing the false rate of vehicle abnormal aggregation events.
As shown in fig. 2, an embodiment of the present invention provides another vehicle aggregation analysis method, which specifically includes the following steps:
step 201: a target retention event is determined.
Step 202: at least one first stuck-at-time gate of a first vehicle at which a target stuck event occurs is determined.
Step 203: at least one second bayonet logically adjacent to the first bayonet corresponding to the target retention event is determined.
Step 204: and acquiring each retention event corresponding to the first bayonet and each second bayonet.
Step 205: executing for each acquired retention event: and judging whether the retention time of the current retention event is not less than a threshold value 1, if so, executing astep 206, otherwise, ending the current process.
Step 206: a common hold-up duration for the current hold-up event and the target hold-up event is determined.
Step 207: and judging whether the common retention time length is not less than the threshold value 2, if so, executing thestep 208, and otherwise, ending the current process.
Step 208: at least one second stuck-at-time gate of a second vehicle in which the current stuck event occurred is determined.
Step 209: and judging whether the at least one first frequent detention bayonet and the at least one second frequent detention bayonet do not simultaneously comprise the first bayonet, if so, executing thestep 210, and otherwise, ending the current process.
Step 210: calculating the residence time similarity of the current residence event and the target residence event.
Step 211: and judging whether the similarity of the residence time is not less than a threshold value 3, if so, determining that an aggregation event is generated between the first vehicle and the second vehicle, and otherwise, ending the current process.
As shown in fig. 3, an embodiment of the present invention provides a vehicle aggregation analysis apparatus including:
afirst determination unit 301 for determining a target retention event;
a second determiningunit 302, configured to determine at least one first stuck-at-time gate of the first vehicle at which the target stuck event occurs, and determine at least one second gate logically adjacent to the first gate corresponding to the target stuck event;
an obtainingunit 303, configured to obtain each retention event corresponding to the first gate and each second gate, respectively;
afirst processing unit 304, configured to perform, for each acquired retention event: determining a common hold-up duration for a current hold-up event and the target hold-up event; determining at least one second stuck-at-frequent-stay gate of a second vehicle at which the current stuck event occurred; when it is determined that the common retention time period is not less than a first preset threshold value and the at least one first frequent-retention bayonet and the at least one second frequent-retention bayonet do not simultaneously include the first bayonet, it is determined that an aggregation event is generated between the first vehicle and the second vehicle.
In an embodiment of the present invention, referring to fig. 4, the first determiningunit 301 includes: anacquisition subunit 3011, adetermination subunit 3012, acalculation subunit 3013, and aprocessing subunit 3014;
the obtainingsubunit 3011 is configured to obtain at least one gate passage record of the first vehicle in a first preset time period, where each gate passage record includes a gate identifier and a passage time, and the at least one gate passage record is sequentially arranged according to an arrangement sequence of the passage times from first to last;
the determiningsubunit 3012 is configured to determine a current gate passage record in the at least one gate passage record;
thecalculation subunit 3013 is configured to calculate, according to the above formula (1), a retention time duration corresponding to the current gate passage record;
theprocessing subunit 3014 is configured to determine whether the retention time is not less than a second preset threshold, if so, determine the target retention event, and trigger the second determiningunit 302, otherwise, use the next gate passage record as the current gate passage record, and trigger the determiningsubunit 3012;
wherein the target retention event comprises: a first gate corresponding to the target retention event, a vehicle on which the target retention event occurs, a retention time, a retention start time and a retention stop time;
the first gate is a gate corresponding to a gate identifier in the current gate passage record, the vehicle in which the target retention event occurs is the first vehicle, the retention starting time is the passage time in the current gate passage record, and the difference between the retention stop time and the retention starting time is the calculated retention time length.
In an embodiment of the present invention, referring to fig. 4, the vehicle aggregation analysis apparatus may further include: asecond processing unit 401, configured to determine at least one third gate, where a retention event occurs at any third gate of the first vehicle; for each of the third bayonets: calculating the number of times of the retention event of the first vehicle at the current third interface within a second preset time period; determining the maximum number of times of the calculated at least one number of times; for each of said calculated times, performing: calculating a first difference between the current number of times and the maximum number of times according to the formula (2); and when the first difference value is judged to be not larger than a third preset threshold value, recording a third bayonet corresponding to the current times as a first frequently-retained bayonet of the first vehicle.
In an embodiment of the present invention, referring to fig. 4, the vehicle aggregation analysis apparatus may further include: athird processing unit 402, configured to determine at least one fourth bayonet, where a distance between the first bayonet and any one of the fourth bayonets is not greater than a fifth preset threshold; for each of the fourth bayonets: when the passing time length of any vehicle passing through the current fourth gate and the first gate is determined to be not more than a fourth preset threshold value, controlling the effective vehicle passing number between the current fourth gate and the first gate to be added with 1; and recording that the current fourth bayonet is logically adjacent to the first bayonet when the effective vehicle passing quantity between the current fourth bayonet and the first bayonet is not less than a sixth preset threshold within a third preset time period.
In an embodiment of the present invention, thefirst processing unit 304 is specifically configured to determine that a maximum value of the retention start time of the current retention event and the retention start time of the target retention event is a common retention start time; determining a minimum of a retention deadline for the current retention event and a retention deadline for the target retention event as a common retention deadline; determining a difference between the common hold-up deadline minus the common hold-up start time as a common hold-up duration for determining a current hold-up event and the target hold-up event.
In an embodiment of the present invention, thefirst processing unit 304 is further configured to determine whether a retention time duration of the current retention event is not less than a seventh preset threshold, and if so, perform the determining of the common retention time duration of the current retention event and the target retention event.
In an embodiment of the present invention, thefirst processing unit 304 is further configured to calculate a retention time similarity between the current retention event and the target retention event according to the above formula (3); when the first bayonet is judged to be included in the at least one first frequent detention bayonet or the at least one second frequent detention bayonet, judging whether the detention time similarity is not less than an eighth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle; when the at least one first frequent detention bayonet and the at least one second frequent detention bayonet are judged to not comprise the first bayonet, judging whether the detention time similarity is not less than a ninth preset threshold, if so, executing the step of determining that an aggregation event is generated between the first vehicle and the second vehicle; wherein the ninth preset threshold is not less than the eighth preset threshold.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
In summary, the embodiments of the present invention have at least the following advantages:
1. in the embodiment of the invention, a target retention event is determined; determining each frequent detention gate of a first vehicle with a target detention event and each second gate which is logically adjacent to the first gate corresponding to the target detention event; acquiring each retention event corresponding to the first bayonet and each second bayonet; executing the following steps for each acquired retention event: determining a common retention time length of a current retention event and a target retention event; determining each frequent detention checkpoint of a second vehicle in which the current detention event occurs; when the common detention time length is judged to be not less than a first preset threshold value and the first gate is not the frequent detention gate of the first vehicle and the second vehicle at the same time, it is determined that the aggregation event is generated between the two vehicles. Based on the traffic situation of each vehicle at each gate, a vehicle aggregation event can be determined. The vehicle traffic data volume is large, and the source is wide, so the embodiment of the invention can reduce the misjudgment rate of the vehicle gathering event.
2. The embodiment of the invention provides a mass data mining and analyzing method for various social vehicle checkpoint traffic records, which can be used for establishing an effective calculation and analysis model for vehicle abnormal gathering analysis, thereby enriching the types and ranges of analyzed vehicles and reducing the misjudgment rate of vehicle abnormal gathering events.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.