Vehicle violation data processing method, device, equipment and storage medium
By performing layered processing on vehicle violation data and implementing a duplicate determination algorithm, duplicate violation records can be automatically identified and merged, solving the problem of inefficient vehicle violation data processing and achieving efficient violation data processing.
Patent Information
- Application Number
- CN202510954379.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-10
AI Technical Summary
The existing technology is inefficient in processing vehicle violation data, mainly relying on manual review, resulting in low processing efficiency.
By establishing a hierarchical processing mechanism for violation records, double grouping is carried out according to vehicle identification and violation type, and a duplicate judgment algorithm is used to automatically identify and merge duplicate violation records on the same road section within the same time period, retaining the violation record with the highest driving speed.
While ensuring processing accuracy, it significantly improves the processing efficiency of large amounts of violation data and solves the problem of low efficiency of traditional manual review methods.
Smart Images

Figure CN120452210B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of traffic management technology, and in particular to a method, device, equipment and storage medium for processing vehicle violation data. Background Art
[0002] With the large-scale deployment of intelligent traffic monitoring systems, traffic violations have exploded. At the same time, urban traffic management departments are facing increasing pressure to process vehicle violation data.
[0003] At present, the method for handling traffic violations is mainly for staff to screen the vehicle violation data collected by monitoring equipment through manual review. However, this manual review method has the problem of low processing efficiency. Summary of the Invention
[0004] The present application provides a method, apparatus, device and storage medium for processing vehicle violation data, so as to at least solve the problem of low efficiency in processing vehicle violation data in related technologies.
[0005] The present application provides a method for processing vehicle violation data, comprising: reading, according to a preset processing cycle, multiple violation records within a preset time length from a storage database, wherein the violation records include a vehicle identification, a violation type, and a vehicle driving speed; grouping the multiple violation records according to the vehicle identification to obtain a violation record set corresponding to each vehicle identification; grouping the violation records in the violation record set corresponding to each vehicle identification again according to the violation type to obtain a violation record subset corresponding to each violation type; for any violation record subset, detecting whether the number of violation records is less than a preset threshold; if the number of violation records is less than the preset threshold, determining whether there are duplicate violation records in the violation record subset; if there are duplicate violation records in the violation record subset, retaining the violation record with the highest vehicle driving speed in the duplicate violation records, and deleting the remaining violation records in the duplicate violation records; and generating a violation behavior determination result of the violation type corresponding to the vehicle identification based on the retained violation records.
[0006] The present application also provides a vehicle violation data processing device, comprising:
[0007] The violation record acquisition module is used to read multiple violation records within a preset time period from the storage database according to a preset processing cycle, where the violation records include vehicle identification, violation type and vehicle speed.
[0008] The violation record grouping module is used to group multiple violation records according to vehicle identification and obtain a violation record set corresponding to each vehicle identification.
[0009] The violation record regrouping module is used to regroup the violation records in the violation record set corresponding to each vehicle identification according to the violation type, and obtain a violation record subset corresponding to each violation type.
[0010] The record quantity detection module is used to detect whether the number of violation records in any violation record subset is less than a preset threshold.
[0011] The duplicate record determination module is used to determine whether there are duplicate violation records in the violation record subset if the number of violation records is less than a preset threshold.
[0012] The duplicate record processing module is used to retain the violation record with the highest vehicle speed among the duplicate violation records if there are duplicate violation records in the violation record subset, and delete the remaining violation records among the duplicate violation records.
[0013] The determination result generating module is used to generate a violation behavior determination result of the violation type corresponding to the vehicle identification based on the retained violation records.
[0014] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned vehicle violation data processing methods when executing the computer program.
[0015] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned vehicle violation data processing methods are implemented.
[0016] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned vehicle violation data processing methods when executed by a processor.
[0017] Through the vehicle violation data processing method, device, equipment and storage medium of the present application, multiple violation records that have not been processed within a period of time are automatically read from the storage database according to the preset processing cycle, and double grouping is performed based on vehicle identification and violation type to form a refined classification. For each violation record subset, a duplicate judgment algorithm is used to automatically identify and merge duplicate violation records on the same road section within the same time period, and finally the violation record with the highest driving speed is retained. The above method can ensure that the processing efficiency of a large amount of violation data is significantly improved under the premise of processing accuracy, and solve the problem of low efficiency of traditional manual review methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A schematic diagram of a scenario of a method for processing vehicle violation data provided in an embodiment of the present application;
[0020] Figure 2 A flow chart of a method for processing vehicle violation data provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the structure of a vehicle violation data processing device provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.
[0024] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0025] In order to clearly understand the technical solution of this application, we first introduce the solution of the prior art in detail. With the large-scale deployment of intelligent traffic monitoring systems, traffic violations have exploded. At the same time, urban traffic management departments are facing increasing pressure to process vehicle violation data. The current method for handling traffic violations is mainly for staff to screen the vehicle violation data collected by monitoring equipment through manual review. However, this manual review method has the problem of low processing efficiency.
[0026] In order to solve the above technical problems, the inventors thought of establishing a hierarchical processing mechanism for violation records. First, double grouping is performed according to vehicle identification and violation type to form a refined classification. Then, a duplicate judgment algorithm is used for each violation record subset to automatically identify and merge duplicate violation records on the same road section within the same time period. Finally, the valid record with the highest driving speed is retained. This significantly improves the processing efficiency of a large amount of violation data while ensuring processing accuracy, solving the problem of low efficiency of traditional manual review methods.
[0027] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0028] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the vehicle violation data processing method depends, the specific application environment architecture or specific hardware architecture is described here. Figure 1 , Figure 1 Schematic diagram of the scenario of the vehicle violation data processing method provided in the embodiment of the present application. Figure 1 As shown, the scenario includes: electronic device 101 , storage database 102 and terminal 103 .
[0029] The electronic device 101 serves as a core processing unit and executes the vehicle violation data processing process.
[0030] The storage database 102 adopts a distributed architecture, such as a Ceph distributed file system, to store vehicle violation data collected by all monitoring devices, including multi-dimensional information such as geographic coordinates, driving direction angle, timestamp, and driving speed.
[0031] Among them, terminal 103 is used to receive the violation behavior judgment results generated by the electronic device 101, including a driver terminal and an auditor terminal. The driver terminal receives the violation behavior judgment results in real time, and the auditor terminal receives an audit request when the number of violation records exceeds a preset threshold, and supports manual review and abnormal behavior processing.
[0032] Specifically, the electronic device 101 reads multiple violation records within a preset time period from the storage database 102 according to a preset processing cycle, where the violation records include vehicle identification, violation type and vehicle driving speed, and groups the multiple violation records according to the vehicle identification to obtain a violation record set corresponding to each vehicle identification; according to the violation type, the violation records in the violation record set corresponding to each vehicle identification are grouped again to obtain a violation record subset corresponding to each violation type; for any violation record subset, detect whether the number of violation records is less than a preset threshold; if the number of violation records is less than the preset threshold, determine whether there are duplicate violation records in the violation record subset; if there are duplicate violation records in the violation record subset, retain the violation record with the highest vehicle driving speed in the duplicate violation records, and delete the remaining violation records in the duplicate violation records; based on the retained violation records, generate a violation behavior determination result of the violation type corresponding to the vehicle identification, and send the violation behavior determination result to the terminal 103.
[0033] Figure 2 The flowchart of the vehicle violation data processing method provided in the embodiment of the present application is as follows: Figure 1 The electronic device shown may also be other devices with similar functions, and the present application embodiment does not limit this. Figure 2 As shown, the embodiment of the present application provides a method for processing vehicle violation data, which is described in detail as follows:
[0034] S201: Reading a plurality of violation records within a preset time period from a storage database according to a preset processing cycle, wherein the violation records include a vehicle identification, a violation type, and a vehicle driving speed.
[0035] Among them, the processing status of the violation record read from the storage database is marked as unprocessed.
[0036] Among them, the violation record can be the violation photos taken by monitoring equipment.
[0037] Specifically, according to the system's preset processing cycle, such as every 12 hours, the traffic violation data marked as unprocessed within a period of time, such as within a week, are read in batches from the storage database. This data contains the vehicle's unique identification such as the license plate number, the violation type such as speeding, and the vehicle's driving speed.
[0038] S202: Grouping multiple violation records according to vehicle identifications to obtain a set of violation records corresponding to each vehicle identification.
[0039] Specifically, the unprocessed driving violation data are classified and collected according to the vehicle identification such as license plate number in each violation record, and all driving violation data of the same vehicle are integrated into an independent set, that is, the violation record set corresponding to each vehicle identification.
[0040] S203: Grouping the violation records in the violation record set corresponding to each vehicle identification again according to the violation type to obtain a violation record subset corresponding to each violation type.
[0041] Specifically, in the violation record set of a single vehicle, the violation records are divided according to the violation type, and the violation records of the same type are divided into subsets, that is, violation record subsets corresponding to each violation type.
[0042] S204: For any subset of traffic violation records, detect whether the number of traffic violation records is less than a preset threshold.
[0043] The violation record subset is a speeding violation record subset corresponding to any vehicle identification.
[0044] Specifically, for the subset of violation records of speeding violations corresponding to any vehicle identification, the number of records contained therein is counted, and the number of records is compared with the preset threshold. The smaller subset of violation records is screened, and the regular number of records is processed first. Abnormal data that exceeds the preset threshold, such as multiple violations by the same vehicle in a short period of time, is diverted to the abnormal review process.
[0045] S205: If the number of traffic violation records is less than a preset threshold, determine whether there are duplicate traffic violation records in the traffic violation record subset.
[0046] Specifically, for a subset of violations whose number of violation records is less than a preset threshold, the geographic coordinates, driving direction, and timestamp are analyzed to determine whether there are repeated violation records on consecutive road sections. The method for determining repeated violation records includes:
[0047] Sa1: Cluster and group the violation records in the violation record subset according to geographic coordinates and driving direction angles to obtain multiple groups of spatial clustering data.
[0048] Among them, the violation record also includes: geographic coordinates, driving direction angle and time stamp.
[0049] Specifically, the geographic coordinates of each violation record in the violation record subset are converted into a standard geographic code. By comparing the pre-set characters before the standard geographic code, records with similar geographical locations are screened out. The driving direction angle difference of these violation records is calculated. If the difference is less than or equal to a preset angle threshold, such as 15°, they are classified into the same spatial cluster group, thereby achieving spatial area division of the same road section and direction. The method specifically includes steps Sb1 to Sb4:
[0050] Sb1: Convert the geographic coordinates of each violation record in the violation record subset into standard geocoding.
[0051] Specifically, the longitude and latitude geographic coordinates of each violation record in the violation record subset are converted into a standard geographic code in a unified format through a grid index algorithm. The code length is dynamically adjusted according to the road type. For example, urban roads use 7-bit Geohash, corresponding to 150-meter accuracy.
[0052] Sb2: traverse the standard geographic codes of each violation record and determine whether the prefix positioning characters of the standard geographic codes of any two violation records are the same.
[0053] Specifically, all standardized standard geographic codes are traversed, and the first preset characters, such as the first 6 digits, of the standard geographic codes of any two violation records are compared. If the first preset characters are the same, it means that the geographic coordinates of the two are similar within the preset accuracy range, as if they belong to a 150m×150m grid area.
[0054] Sb3: If the prefix characters of the standard geocoding of any two violation records are the same, the direction deviation of the two violation records is calculated based on the driving direction angles of the two violation records.
[0055] The driving direction angle is measured clockwise with due north as 0°.
[0056] Specifically, for two violation records with the same location before geocoding, their driving direction angles are extracted, and the angular periodicity ambiguity is eliminated through normalization. The angle difference between the two is calculated to obtain the quantified value of the direction deviation. The calculation process of the direction deviation of the two violation records is as follows:
[0057] Sc1: Normalize the driving direction angles of the two violation records to obtain the standardized first direction angle and second direction angle.
[0058] Specifically, for the two violation records with the same preset location before geocoding, their original driving direction angles are extracted. Due to the periodicity of the angles, the angles are uniformly mapped to the range of 0°-360° by calculating the remainder of the angle with respect to 360°, and the standardized first direction angle and second direction angle are obtained.
[0059] Sc2: Calculate the difference between the first direction angle and the second direction angle, and determine the absolute value of the difference as the positive azimuth of the two violation records.
[0060] Specifically, the difference between the first and second normalized direction angles is calculated, and the absolute value of the difference is taken to obtain the positive azimuth angle between the two records.
[0061] For example, if the first direction angle is 80° and the second direction angle is 100°, the positive azimuth angle is |80°-100°|=20°.
[0062] Sc3: Determine the complementary angle azimuth of the two violation records based on the positive azimuth.
[0063] The supplementary angle azimuth is used to handle the case where the angle crosses the 0° boundary.
[0064] Specifically, based on the obtained positive azimuth angle, the difference between the positive azimuth angle and 360° is calculated to obtain the supplementary angle azimuth angle.
[0065] For example, if the positive azimuth angle is 20°, the supplementary azimuth angle is 360°-20°=340°.
[0066] Sc4: The minimum value between the positive azimuth and the supplementary azimuth is determined as the directional deviation of the two violation records.
[0067] Specifically, the positive azimuth and the supplementary azimuth are compared, and the minimum value between the two is selected as the final direction deviation of the two violation records.
[0068] For example, if the positive azimuth angle is 340° and the supplementary azimuth angle is 20°, 20° is taken as the direction deviation.
[0069] Sb4: If the direction deviation of the two violation records is less than or equal to the preset angle difference, the two violation records are determined to be the same group of spatial cluster data.
[0070] Specifically, if the directional deviation between two violation records is less than or equal to a preset angle difference, such as 15°, the two violation records are considered to be on the same road section and in the same direction, and the two violation records are grouped into the same spatial cluster data. If the directional deviation between the two violation records is greater than the preset angle difference, the two violation records are considered to be traveling in different directions and are divided into different spatial cluster data.
[0071] Sa2: Sort the violation records in each group of spatial clustering data according to the timestamp to obtain the sorted spatial clustering data of each group.
[0072] Specifically, each group of spatial clustering data is arranged in ascending order according to the timestamp, so that the violation records in the same spatial group are arranged in the order of occurrence time.
[0073] Sa3: For any set of sorted spatial clustering data, check whether the number of violation records is greater than one.
[0074] Specifically, the number of violation records in each group of sorted spatial clustering data is counted. If the number of violation records is only 1, it is directly determined that there are no duplicate records. If the number of violation records is greater than 1, it is necessary to further analyze whether there are duplicate violations in a continuous time period.
[0075] Sa4: If the number of violation records is greater than one, the time interval between adjacent violation records is calculated based on the timestamps corresponding to each violation record.
[0076] Specifically, for spatial clustering data with more than one violation record, the timestamps of two adjacent violation records are extracted in sequence and the difference is calculated. For example, the timestamp of the first violation record is 14:30:25, and the timestamp of the second violation record is 14:30:30, so the time interval is 5 seconds.
[0077] Sa5: Determine whether the time interval between adjacent violation records is less than or equal to a preset time window threshold.
[0078] Specifically, based on the speed limit value of the road section corresponding to the current spatial clustering group and the actual geographical distance between adjacent violation records, the preset time window threshold is dynamically calculated, and the time interval between adjacent violation records is compared with the preset time window threshold to determine whether adjacent violation records occur continuously within a reasonable time.
[0079] Specifically, the method for determining the preset time window threshold is:
[0080] Sd1: Determine the speed limit value of the road section where the violation record is located based on the geographic coordinates corresponding to the violation record in any set of sorted spatial clustering data.
[0081] Specifically, the latitude and longitude coordinates of the violation record are mapped to electronic map road network data, and the nearest road segment is quickly located using spatial indexing. The map's road information interface is called to query the speed limit attribute value for that road segment, and adjustments are made based on real-time data from traffic management departments. If the map's road information interface does not return a clear speed limit value, a machine learning model is used to infer the speed limit based on features such as road grade and nearby POI (Point of Interest) types.
[0082] Sd2: Determine the actual distances between adjacent traffic violation records based on the geographic coordinates of the adjacent traffic violation records.
[0083] Specifically, the latitude and longitude coordinates are converted to a rectangular coordinate system to eliminate spherical distance calculation errors. If the angular deviation between the two violation records is less than 15°, the driver is deemed to have traveled in a straight line, and the distance between the two points is calculated using the Euclidean distance formula. If the angular deviation between the two violation records is greater than 15°, the road network distance between the two points is queried through the geographic information interface.
[0084] Sd3: Determine the preset time window threshold corresponding to adjacent violation records based on the speed limit value and actual distance.
[0085] Specifically, the actual distance between adjacent violation records is determined based on the geographical coordinates corresponding to the adjacent violation records, and the theoretical driving time is calculated in combination with the speed limit value of the road section. The fluctuation coefficient of the road section is determined by real-time traffic data. The fluctuation coefficient is 2 when the road is congested, 1.5 when the road is unobstructed, and 0.8 when the highway is highway. The product of the theoretical driving time and the fluctuation coefficient is determined as the preset time window threshold corresponding to the adjacent violation records.
[0086] Sa6: If the time interval between adjacent traffic violation records is less than or equal to the preset time window threshold, it is determined that there are duplicate traffic violation records in the traffic violation record subset.
[0087] Specifically, if adjacent violation records meet the same preset characters before standard geocoding, and the driving direction angle difference is less than the preset angle difference, such as 15°, and the time interval between adjacent violation records is less than the preset time window threshold, they are determined to be duplicate violation records.
[0088] S206: If there are duplicate violation records in the violation record subset, retain the violation record with the highest vehicle speed among the duplicate violation records, and delete the remaining violation records among the duplicate violation records.
[0089] Specifically, when duplicate violation records are detected, only the one with the highest vehicle speed is retained, and the rest of the duplicate violation records are deleted. This means that the most serious violation record is retained for consecutive road sections. The process for deleting duplicate violation records is as follows: Among the duplicate violation records, mark all violation records except the one with the highest vehicle speed as pending deletion; filter the violation records in the storage database based on the pending deletion status to obtain the pending violation records; and batch delete the pending violation records, logging the batch deletion operation in the audit log.
[0090] For example, if two speeding records on the same road section are 120 km / h and 150 km / h respectively, only the 150 km / h record is retained.
[0091] S207: Generate a violation behavior determination result of the violation type corresponding to the vehicle identification based on the retained violation records.
[0092] Specifically, based on the final retained violation records, a standardized violation determination result is generated by integrating vehicle identification, violation type, and vehicle speed. This violation determination result is then sent to the driver's terminal, completing a complete violation data processing loop. After the standardized violation determination result is generated, the retained violation record is marked as processed in the storage database.
[0093] In summary, according to the preset processing cycle, multiple unprocessed violation records within a period of time are automatically read from the storage database, and double grouping is performed based on vehicle identification and violation type to form a refined classification. For each violation record subset, a duplicate judgment algorithm is used to automatically identify and merge duplicate violation records on the same road section within the same time period, and finally the violation record with the highest driving speed is retained. The above method can significantly improve the processing efficiency of a large amount of violation data while ensuring processing accuracy, solving the problem of low efficiency of traditional manual review methods.
[0094] In addition, the introduction of Geohash can reduce the time complexity of clustering and grouping, and greatly improve the efficiency of large-scale data processing.
[0095] In another embodiment of the present application, when the number of detected violation records is less than a preset threshold, the vehicle violation data processing method is as follows:
[0096] S301: If the number of violation records is not less than a preset threshold, the violation record of the violation type corresponding to the vehicle identification is stored in the abnormal behavior database.
[0097] Specifically, if the number of violation records is not less than a preset threshold, the system will store all violation records of the violation type corresponding to the vehicle identification in the abnormal behavior database for subsequent in-depth analysis and risk warning.
[0098] S302: Determine the notification method and review level for the violation type corresponding to the vehicle identification based on the number of violation records.
[0099] Specifically, the system comprehensively assesses the severity and risk level of the violation based on the number of violations, and then determines the notification method and review level for the violation type corresponding to the vehicle ID. For example, a low number of violations will result in a lower-level review process and standard notification methods. However, if a high number of violations presents a serious safety hazard, the system will upgrade the notification method, such as multiple reminders via SMS and phone calls, and increase the review level.
[0100] Specifically, when the number of vehicle violation records is greater than or equal to the preset threshold and less than the first-level threshold, the system determines that the violation behavior is abnormal but the risk level is low. At this time, the ordinary reviewers are notified through internal system messages so that they can pay attention to and handle the relevant violation records in a timely manner; if the number of violation records is between the first-level threshold and the second-level threshold, it indicates that the abnormality of the vehicle violation behavior has escalated. In order to ensure the efficient progress of the review work, the system will adopt a dual notification method combining SMS and email to push the violation information to senior reviewers with more experience in a timely manner; and when the number of violation records reaches or exceeds the second-level threshold, it means that the vehicle has highly frequent or serious violations and there is a major safety risk. The system will immediately activate the emergency notification mechanism and convey the review request to the supervisor as soon as possible through strong reminders such as phone calls and system pop-ups.
[0101] S303: Send an audit request to the auditor corresponding to the audit level according to the notification method.
[0102] Specifically, the system will send the review request containing information such as violation record details, vehicle identification and violation type accurately to the reviewers of the corresponding review level according to the determined notification method, ensuring that the review process is initiated in a timely manner and achieving efficient handling and supervision of abnormal violations.
[0103] In summary, through the classified storage of violation data, dynamic matching of review levels, and precise notification mechanisms, an intelligent hierarchical management system for abnormal traffic violations has been established. When the number of vehicle violation records reaches or exceeds the preset threshold, the system stores them in the abnormal behavior database, enabling centralized management and efficient retrieval of abnormal data, providing structured data support for subsequent risk assessments. Based on the different intervals of the number of violation records, differentiated notification methods and review levels are automatically matched to avoid resource waste and review delays, and to tilt review resources towards high-risk scenarios. Finally, the system accurately pushes review requests to the corresponding personnel according to the established notification strategy, ensuring that low-risk violations are quickly handled and high-risk behaviors are promptly controlled, significantly improving the efficiency of traffic violation review and the accuracy of supervision, and effectively reducing the risk of traffic accidents.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0105] Figure 3 This is a schematic diagram of the structure of the vehicle violation data processing device provided in the embodiment of the present application. Figure 3As shown, an embodiment of the present application also provides a vehicle violation data processing device, including: a violation record acquisition module 301, a violation record grouping module 302, a violation record regrouping module 303, a record quantity detection module 304, a duplicate record judgment module 305, a duplicate record processing module 306 and a judgment result generation module 307.
[0106] The violation record acquisition module 301 is used to read multiple violation records within a preset time period from the storage database according to a preset processing cycle, wherein the violation records include vehicle identification, violation type and vehicle speed.
[0107] The violation record grouping module 302 is used to group multiple violation records according to vehicle identifications to obtain a set of violation records corresponding to each vehicle identification.
[0108] The violation record regrouping module 303 is configured to regroup the violation records in the violation record set corresponding to each vehicle identification according to the violation type, to obtain a violation record subset corresponding to each violation type.
[0109] The record quantity detection module 304 is configured to detect, for any subset of traffic violation records, whether the number of traffic violation records is less than a preset threshold.
[0110] The duplicate record determination module 305 is configured to determine whether there are duplicate traffic violation records in the traffic violation record subset if the number of traffic violation records is less than a preset threshold.
[0111] The duplicate record processing module 306 is configured to retain the duplicate violation record with the highest vehicle speed among the duplicate violation records if there are duplicate violation records in the violation record subset, and delete the remaining violation records among the duplicate violation records.
[0112] The determination result generating module 307 is used to generate a violation behavior determination result of the violation type corresponding to the vehicle identification based on the retained violation records.
[0113] In one possible implementation, the duplicate record judgment module 305 is specifically used to cluster and group the violation records in the violation record subset according to the geographic coordinates and the driving direction angle to obtain multiple groups of spatial clustering data; sort the violation records in each group of spatial clustering data according to the timestamp to obtain each group of sorted spatial clustering data; for any group of sorted spatial clustering data, detect whether the number of violation records is greater than one; if the number of violation records is greater than one, calculate the time interval between adjacent violation records based on the timestamps corresponding to each violation record; determine whether the time interval between adjacent violation records is less than or equal to the preset time window threshold; if the time interval between adjacent violation records is less than or equal to the preset time window threshold, determine that there are duplicate violation records in the violation record subset.
[0114] In one possible implementation, the duplicate record determination module 305 is further specifically configured to convert the geographic coordinates of each violation record in the violation record subset into a standard geographic code; traverse the standard geographic codes of each violation record to determine whether the first preset characters of the standard geographic codes of any two violation records are the same; if the first preset characters of the standard geographic codes of any two violation records are the same, calculate the direction deviation of the two violation records based on the driving direction angles of the two violation records; if the direction deviation of the two violation records is less than or equal to the preset angle difference, determine the two violation records as the same group of spatial clustering data.
[0115] In one possible implementation, the duplicate record judgment module 305 is further specifically used to standardize the driving direction angles of the two violation records to obtain a standardized first direction angle and a second direction angle; calculate the difference between the first direction angle and the second direction angle, and determine the absolute value of the difference as the positive azimuth of the two violation records; determine the supplementary angle azimuth of the two violation records based on the positive azimuth; and determine the minimum value of the positive azimuth and the supplementary angle azimuth as the direction deviation of the two violation records.
[0116] In one possible embodiment, the vehicle violation data processing device also includes: a time window threshold determination module, which is used to determine the speed limit value of the road section where the violation record is located based on the geographic coordinates corresponding to the violation record in any group of sorted spatial clustering data; determine the actual distance corresponding to the adjacent violation records based on the geographic coordinates corresponding to the adjacent violation records; and determine the preset time window threshold value corresponding to the adjacent violation records based on the speed limit value and the actual distance.
[0117] In one possible embodiment, the vehicle violation data processing device also includes: an abnormal violation processing module, which is used to store the violation records of the violation type corresponding to the vehicle identification into the abnormal behavior database if the number of violation records is not less than a preset threshold; determine the notification method and review level for the violation type corresponding to the vehicle identification based on the number of violation records; and send an audit request to the auditor corresponding to the audit level based on the notification method.
[0118] In one possible implementation, the duplicate record processing module 306 is specifically configured to mark, among duplicate violation records, each violation record other than the violation record with the highest driving speed as a to-be-deleted state; filter the violation records to be deleted in the storage database according to the to-be-deleted state; and delete the violation records to be deleted in batches, and record the batch deletion operation in the audit log.
[0119] For the description of the features in the embodiment corresponding to the vehicle violation data processing device, please refer to the relevant description of the embodiment corresponding to the vehicle violation data processing method, and will not be repeated here.
[0120] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 4 As shown, the electronic device provided by this embodiment includes: at least one processor 401 and a memory 402. Optionally, the electronic device further includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus.
[0121] During the specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that the at least one processor 401 executes the above-mentioned vehicle violation data processing method embodiment.
[0122] The specific implementation process of the processor 401 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0123] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0124] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0125] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0126] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned vehicle violation data processing method embodiments when running.
[0127] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0128] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned vehicle violation data processing method embodiments are implemented.
[0129] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned vehicle violation data processing method embodiments.
[0130] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0131] The above is a detailed introduction to the vehicle violation data processing method, device, equipment and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for processing vehicle violation data, characterized in that: include: Reading a plurality of violation records within a preset time period from a storage database according to a preset processing cycle, wherein the violation records include a vehicle identification, a violation type, and a vehicle speed; Grouping the plurality of violation records according to the vehicle identification to obtain a set of violation records corresponding to each vehicle identification; According to the violation type, the violation records in the violation record set corresponding to each vehicle identifier are grouped again to obtain a violation record subset corresponding to each violation type; For any subset of traffic violation records, detecting whether the number of the traffic violation records is less than a preset threshold; If the number of violation records is less than a preset threshold, determining whether there are duplicate violation records in the violation record subset; If there are duplicate violation records in the violation record subset, retaining the violation record with the highest vehicle speed among the duplicate violation records, and deleting the remaining violation records in the duplicate violation records; Generating a violation behavior determination result of the violation type corresponding to the vehicle identification based on the retained violation records; The violation record also includes: geographic coordinates, driving direction angle and time stamp; Accordingly, the determining whether there are duplicate violation records in the violation record subset includes: Clustering and grouping the violation records in the violation record subset according to the geographic coordinates and the driving direction angle to obtain multiple groups of spatial clustering data; Sorting the violation records in each group of spatial clustering data according to the timestamp to obtain sorted spatial clustering data of each group; For any set of sorted spatial clustering data, detecting whether the number of violation records is greater than one; If the number of the violation records is greater than one, then calculating the time interval between adjacent violation records based on the timestamps corresponding to the violation records; Determine whether the time interval between the adjacent traffic violation records is less than or equal to a preset time window threshold; If the time interval between the adjacent traffic violation records is less than or equal to the preset time window threshold, it is determined that there are duplicate traffic violation records in the traffic violation record subset; Clustering and grouping the violation records in the violation record subset according to the geographic coordinates and the driving direction angle to obtain multiple groups of spatial clustering data includes: Converting the geographic coordinates of each violation record in the violation record subset into a standard geographic code; Traversing the standard geographic codes of the violation records, and determining whether the pre-set characters of the standard geographic codes of any two violation records are the same; If the pre-set characters of the standard geocodes of any two violation records are the same, calculating the direction deviation of the two violation records according to the driving direction angles of the two violation records; If the direction deviation of the two violation records is less than or equal to a preset angle difference, the two violation records are determined to be the same group of spatial cluster data; Calculating the direction deviation of the two violation records based on the driving direction angles of the two violation records includes: Normalizing the driving direction angles of the two violation records to obtain a standardized first direction angle and a second direction angle; Calculating a difference between the first direction angle and the second direction angle, and determining an absolute value of the difference as the positive azimuth angle of the two violation records; Determine the supplementary angle azimuths of the two violation records according to the positive azimuth, wherein the sum of the positive azimuth and the supplementary angle azimuth is 360°; The minimum value between the positive azimuth and the supplementary azimuth is determined as the directional deviation of the two violation records.
2. The vehicle violation data processing method according to claim 1, characterized in that: Before determining whether the time interval between adjacent traffic violation records is less than or equal to a preset time window threshold, the method further includes: Determining the speed limit value of the road section where the violation record is located according to the geographical coordinates corresponding to the violation record in any group of sorted spatial clustering data; Determining the actual distances corresponding to the adjacent traffic violation records based on the geographical coordinates corresponding to the adjacent traffic violation records; A preset time window threshold corresponding to the adjacent traffic violation records is determined according to the speed limit value and the actual distance.
3. The vehicle violation data processing method according to claim 1, characterized in that: After detecting whether the number of violation records is less than a preset threshold, the method further includes: If the number of violation records is not less than a preset threshold, the violation record of the violation type corresponding to the vehicle identification is stored in the abnormal behavior database; Determining, based on the number of violation records, a notification method and an audit level for the violation type corresponding to the vehicle identification; According to the notification method, an audit request is sent to the auditor corresponding to the audit level.
4. The vehicle violation data processing method according to claim 1, characterized in that: The deleting of the remaining violation records in the duplicate violation records includes: Among the repeated violation records, marking each violation record except the violation record with the highest driving speed as a pending deletion state; In the storage database, filtering and obtaining the violation records to be deleted according to the to-be-deleted status; The violation records to be deleted are deleted in batches, and the batch deletion operation is recorded in the audit log.
5. A vehicle violation data processing device, characterized in that: include: A violation record acquisition module is used to read a plurality of violation records within a preset time period from a storage database according to a preset processing cycle, wherein the violation records include vehicle identification, violation type and vehicle speed; A violation record grouping module, configured to group the plurality of violation records according to the vehicle identification to obtain a violation record set corresponding to each vehicle identification; a violation record regrouping module, configured to regroup the violation records in the violation record set corresponding to each vehicle identifier according to the violation type, to obtain a subset of violation records corresponding to each violation type; A record quantity detection module is used to detect whether the number of violation records in any violation record subset is less than a preset threshold; A duplicate record determination module, configured to determine whether there are duplicate violation records in the violation record subset if the number of violation records is less than a preset threshold; a duplicate record processing module configured to retain the violation record with the highest vehicle speed among the duplicate violation records if duplicate violation records exist in the violation record subset, and delete the remaining violation records among the duplicate violation records; A determination result generating module, configured to generate a violation behavior determination result of the violation type corresponding to the vehicle identification based on the retained violation records; The violation record also includes: geographic coordinates, driving direction angle and time stamp; Accordingly, the duplicate record determination module is specifically configured to: Clustering and grouping the violation records in the violation record subset according to the geographic coordinates and the driving direction angle to obtain multiple groups of spatial clustering data; Sorting the violation records in each group of spatial clustering data according to the timestamp to obtain sorted spatial clustering data of each group; For any set of sorted spatial clustering data, detecting whether the number of violation records is greater than one; If the number of the violation records is greater than one, then calculating the time interval between adjacent violation records based on the timestamps corresponding to the violation records; Determine whether the time interval between the adjacent traffic violation records is less than or equal to a preset time window threshold; If the time interval between the adjacent traffic violation records is less than or equal to the preset time window threshold, it is determined that there are duplicate traffic violation records in the traffic violation record subset; When the violation records in the violation record subset are clustered and grouped according to the geographic coordinates and the driving direction angle to obtain multiple groups of spatial cluster data, the duplicate record determination module is specifically configured to: Converting the geographic coordinates of each violation record in the violation record subset into a standard geographic code; Traversing the standard geographic codes of the violation records, and determining whether the pre-set characters of the standard geographic codes of any two violation records are the same; If the pre-set characters of the standard geocodes of any two violation records are the same, calculating the direction deviation of the two violation records according to the driving direction angles of the two violation records; If the direction deviation of the two violation records is less than or equal to a preset angle difference, the two violation records are determined to be the same group of spatial cluster data; When calculating the direction deviation of the two violation records based on the driving direction angles of the two violation records, the duplicate record determination module is specifically configured to: Normalizing the driving direction angles of the two violation records to obtain a standardized first direction angle and a second direction angle; Calculating a difference between the first direction angle and the second direction angle, and determining an absolute value of the difference as the positive azimuth angle of the two violation records; Determine the supplementary angle azimuths of the two violation records according to the positive azimuth, wherein the sum of the positive azimuth and the supplementary angle azimuth is 360°; The minimum value between the positive azimuth and the supplementary azimuth is determined as the directional deviation of the two violation records.
6. An electronic device, characterized in that: include: memory for storing computer programs; A processor is used to implement the steps of the vehicle violation data processing method as described in any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the vehicle violation data processing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data processing method and device
CN110457375A
Intelligent management method and system for violation data of big data platform
CN117762953A