Vehicle safety event processing method and apparatus, electronic device, and storage medium
By using a time-series database instead of a traditional relational database, efficient storage and analysis of vehicle safety incident data were achieved, solving the problems of data latency and low statistical efficiency, and improving data processing and query speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2026-04-10
AI Technical Summary
Existing vehicle safety monitoring platforms suffer from data latency and low statistical analysis efficiency when handling vehicle safety incidents, especially when processing and querying large-scale data, where the performance of traditional relational databases is limited.
Using time-series databases (such as InfluxDB) for data storage, security event data is stored in an orderly manner according to timestamp information by generating time-series database insert statements, and statistical information is filtered according to preset threshold ranges and query categories, replacing the traditional relational database storage method.
It improved the writing speed of security incident data and the rate of large-scale data processing and statistical analysis, reduced data latency, improved the query rate of different statistical categories, and achieved second-level query speed and database disaster recovery mechanism.
Smart Images

Figure CN117290406B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automobile safety situation monitoring, and in particular to a vehicle safety event processing method and device, an electronic device and a storage medium. BACKGROUND
[0002] The automobile safety monitoring platform is used for monitoring vehicle safety events in real time and performing offline analysis on the vehicle safety events. At present, when most automobile safety monitoring platforms perform offline analysis on automobile safety events, the analysis method is mainly based on a relational database, the original data is slightly processed and then stored in the database, and a distributed architecture is used to store the processed original data. This processing method is time-consuming when performing offline analysis and statistics, which leads to the disadvantage of data delay in the monitoring large screen data display of the automobile safety monitoring platform using a polling method.
[0003] With the continuous increase of enterprise business volume, the data to be processed by the automobile safety monitoring platform increases geometrically, which brings huge overhead to the disk input and output of the traditional database, further slows down the data query, and requires the database operation and maintenance personnel to periodically empty the data in a certain time range at a specific time, which brings huge pressure on server resources when performing the operation. At this time, user statistical analysis will lead to extremely low analysis efficiency.
[0004] When using a traditional relational database to perform vehicle safety log statistics, the order of the event timestamps stored in the database may be disordered due to network factors. When querying and tracing the relationship between safety events on a certain timeline, a large amount of data sorting work is required, which is greatly affected by the machine performance.
[0005] Therefore, the existing processing method has the problems of data delay and low statistical analysis efficiency in monitoring and statistics of vehicle safety events. SUMMARY
[0006] The present application provides a vehicle safety event processing method, device, electronic device and storage medium, which solves the problems of data delay and low statistical analysis efficiency in monitoring and statistics of vehicle safety events by the existing processing method.
[0007] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0008] In a first aspect, the present application provides a vehicle safety event processing method, which comprises:
[0009] receiving a plurality of safety event data of a vehicle reported by a vehicle terminal in real time; each safety event data comprises timestamp information and vehicle statistical information;
[0010] corresponding to each piece of security event data as a label of the statistical information, generating a time-series database insertion statement according to each piece of statistical information, timestamp information corresponding to the statistical information, and the label of each piece of statistical information, and inserting the security event data into a target time-series database according to the time-series database insertion statement;
[0011] When the timestamp information in the target time-series database meets a preset threshold range, searching for statistical information whose statistical category meets a preset query category according to the label, and outputting the statistical information and timestamp information corresponding to the statistical information as a statistical result according to a time sequence of the timestamp information.
[0012] In a possible implementation, before the step of corresponding the statistical category corresponding to each piece of security event data to a label of the statistical information, generating a time-series database insertion statement according to each piece of statistical information, timestamp information corresponding to the statistical information, and the label of each piece of statistical information, the method further includes:
[0013] In the plurality of security event data, performing first data cleaning on security event data with abnormal timestamp information, obtaining a plurality of security event data arranged in a time sequence after first cleaning, and temporarily storing the plurality of security event data in a data buffer.
[0014] In a possible implementation, after the step of temporarily storing the plurality of security event data in the data buffer, the method further includes:
[0015] sequentially reading security event data in the data buffer, and performing second data cleaning on security event data with abnormal timestamp information, to obtain a plurality of security event data arranged in a time sequence after second cleaning.
[0016] In a possible implementation, the step of searching for statistical information whose statistical category meets a preset query category according to the label when the timestamp information in the target time-series database meets a preset threshold range specifically includes:
[0017] obtaining a statistical task input by a user; the statistical task includes a preset threshold range and a preset query category;
[0018] obtaining, in the target time-series database, statistical information whose timestamp information is within the preset threshold range and whose label is the same as the preset query category.
[0019] In a possible implementation, the step of searching for statistical information whose statistical category meets a preset query category according to the label when the timestamp information in the target time-series database meets a preset threshold range specifically includes:
[0020] starting a timing task when the current time is equal to the timing time; the timing task comprises a preset threshold range and a preset query category;
[0021] acquiring, through the timing task, statistical information in the target time series database, the statistical information having a timestamp information within the preset threshold range and having a same label and the preset query category.
[0022] In a possible implementation, after the statistical information and the timestamp information corresponding to the statistical information are output as the statistical result, the method further comprises:
[0023] sequentially sending the output statistical result to the data buffer according to time sequence;
[0024] acquiring the statistical result from the data buffer and displaying the statistical result in a table manner.
[0025] In a possible implementation, after the statistical information and the timestamp information corresponding to the statistical information are output as the statistical result, the method further comprises:
[0026] setting a maximum storage day number of data in the target time series database, and when the storage day number of historical security event data is greater than or equal to the maximum storage day number, sequentially rolling over the historical security event data according to the timestamp information of newly inserted security event data.
[0027] In a second aspect, the present application provides a vehicle security event processing device, which comprises:
[0028] a data acquisition module, configured to receive a plurality of security event data of a vehicle reported by a vehicle terminal in real time; each of the security event data comprises timestamp information and vehicle statistical information;
[0029] a data statistical marking module, configured to take a statistical category corresponding to the statistical information of each security event data as a label of the statistical information, to generate a time series database insertion statement according to each statistical information, the timestamp information corresponding to the statistical information and the label of each statistical information, and to insert the security event data into a target time series database according to the time series database insertion statement;
[0030] a data statistical analysis module, configured to find statistical information, which has a statistical category satisfying a preset query category, according to the label when the timestamp information in the target time series database satisfies a preset threshold range, and to output the statistical information and the timestamp information corresponding to the statistical information as a statistical result according to time sequence of the timestamp information.
[0031] In a possible implementation, the apparatus further includes a first data processing module configured to, before the generating of the time-series database insertion statement according to each statistical information, the timestamp information corresponding to the statistical information, and the label of each statistical information, perform first data cleaning on the security event data with abnormal timestamp information in the plurality of security event data, to obtain a plurality of security event data arranged in time sequence after first cleaning, and temporarily store the plurality of security event data in a data buffer.
[0032] In a possible implementation, the apparatus further includes a second data processing module configured to, after the temporarily storing of the plurality of security event data in the data buffer, sequentially read the security event data in the data buffer, and perform second cleaning on the security event data with abnormal timestamp information, to obtain a plurality of security event data arranged in time sequence after second cleaning.
[0033] In a possible implementation, when the timestamp information in the target time-series database meets the preset threshold range, and the statistical information meeting the preset query category is found according to the label, the data statistical analysis module is specifically configured to perform:
[0034] obtain a statistical task input by a user; the statistical task includes the preset threshold range and the preset query category;
[0035] obtain, in the target time-series database, the statistical information with the timestamp information in the preset threshold range and the same label as the preset query category.
[0036] In a possible implementation, when the timestamp information in the target time-series database meets the preset threshold range, and the statistical information meeting the preset query category is found according to the label, the data statistical analysis module is further configured to perform:
[0037] start a timing task when the current time is equal to the timing time; the timing task includes a starting time, the preset threshold range, and the preset query category;
[0038] obtain, in the target time-series database, the statistical information with the timestamp information in the preset threshold range and the same label as the preset query category through the timing task.
[0039] In a possible implementation, the apparatus further includes a statistical result processing module configured to, after the statistical information and the timestamp information corresponding to the statistical information are output as a statistical result, perform:
[0040] The statistical result output is sent to the data buffer in time sequence;
[0041] The statistical result is obtained from the data buffer and displayed in a table.
[0042] In a possible implementation, the device further comprises a data updating module, which is provided with a maximum storage time of data in the target time sequence database, and is configured to, after the statistical information and the time stamp information corresponding to the statistical information are output as the statistical result, perform rolling coverage on historical security event data according to time stamp information of newly inserted security event data in sequence when the storage time of the historical security event data is greater than or equal to the maximum storage time.
[0043] In a third aspect, the present application provides an electronic device, which comprises a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the vehicle security event processing method of any one of the above aspects.
[0044] In a fourth aspect, the present application provides a computer readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the vehicle security event processing method of any one of the above aspects.
[0045] The vehicle safety event processing method provided by the embodiment of the present application, in actual application, firstly, real-time receives the safety event data of the vehicle reported by the vehicle end; secondly, takes the statistical category corresponding to the statistical information of each safety event data as the label of the statistical information, dynamically generates a time sequence database insertion statement according to each statistical information, the timestamp corresponding to the statistical information and the label of the statistical information, and inserts the corresponding safety event data into the target time sequence database according to the time sequence database insertion statement; finally, filters the statistical information that meets the conditions in terms of the timestamp information and the statistical category according to the preset threshold range and the preset query category in the target time sequence database, and outputs the statistical information and the corresponding timestamp information as the statistical result according to the time sequence of the timestamp information corresponding to the statistical information; the method of the time sequence database for orderly storing data replaces the data storage mode of the traditional relational database, effectively improves the writing speed of the safety event data of the vehicle, and at the same time improves the processing and statistical analysis rate of the large-scale safety event data, solves the problem of data delay when the traditional relational database processes the safety event data; by setting different labels for the statistical information of different statistical categories, the query rate of the user for the statistical information of different statistical categories is further improved. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 The step flow chart of the vehicle safety event processing method provided by the embodiment of the present application;
[0047] Figure 2 The structure block diagram of the vehicle safety event processing device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0049] Hereinafter, the terms "first" and "second" are only used for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more. In addition, the use of "based on" or "according to" means openness and inclusiveness, because the process, step, calculation or other action "based on" or "according to" one or more stated conditions or values can be based on additional conditions or values beyond the stated values in practice.
[0050] In order to solve the problems of data delay and low statistical analysis efficiency in monitoring and counting vehicle safety events by using the existing processing method, the embodiment of the present application provides a vehicle safety event processing method, device, electronic equipment and storage medium.
[0051] As shown in Figure 1 The first aspect, the embodiment of the present application provides a vehicle safety event processing method, which comprises the following steps:
[0052] Step 101, real-time receiving a plurality of safety event data of a vehicle reported by a vehicle terminal.
[0053] The safety event data can be obtained from the safety event log of the vehicle.
[0054] Each safety event data comprises timestamp information and vehicle statistical information, and the vehicle statistical information comprises statistical information corresponding to a plurality of statistical categories.
[0055] The timestamp information is used to identify the time when the safety event data occurs; the statistical categories of the vehicle statistical information include vehicle type, component type, region and level.
[0056] The vehicle type refers to the type of the vehicle where the safety event occurs; the component type refers to the specific component of the vehicle where the safety event occurs; the region refers to the location area of the vehicle where the safety event occurs; and the level refers to the influence level of the safety event, for example, the influence level can be represented by one to four levels, one level represents that the influence of the safety event on the vehicle is particularly important, and the influence on the vehicle decreases with the increase of the level number.
[0057] Step 102, taking the statistical category corresponding to the statistical information of each safety event data as the label of the statistical information, generating a time series database insertion statement according to each statistical information, the timestamp information corresponding to the statistical information and the label of each statistical information, and inserting the safety event data into a target time series database according to the time series database insertion statement.
[0058] The time series database is also called time series database.
[0059] The time series database refers to a database for processing time-labeled data, and the time-labeled data is also called time series data. In this embodiment, the time series data refers to safety event data with timestamp information. The target time series database uses an influxDB time series database, and the time series database insertion statement is an insert statement of the influxDB database.
[0060] For example: insert add_test, Vehicle model = Model 1, Component Type = Type 1, Region = region1, grade = 001, 1564150279123000000
[0061] The use of the insert statement to add security event data to the influxDB database is specifically represented as follows:
[0062] name: add_test
[0063]
[0064] Wherein, add_test represents the name of the data table in the target time series database for storing security event data, and time represents the timestamp information; in add_test, Vehicle model, Component Type, Region, and grade are all labels of statistical information.
[0065] Wherein, Vehicle model represents the vehicle model, Component Type represents the component type, Region represents the region type, and grade represents the grade.
[0066] Step 103, in the target time series database, when the timestamp information meets the preset threshold range, according to the label, find the statistical information of the statistical category that meets the preset query category, and according to the time sequence of the timestamp information corresponding to the statistical information, output the statistical information and the timestamp information corresponding to the statistical information as the statistical result.
[0067] In the target time series database, the timestamp information is used as the main index, and data query statistics are performed according to the timestamp information and the labels of the statistical information to be queried.
[0068] Specifically, according to the pre-set preset threshold range and the pre-set preset query category, data query statistics are performed, and the statistical information in the target time series database whose timestamp information is within the preset threshold range and whose label is the preset query category is output as the statistical result.
[0069] The vehicle safety event processing method provided by the embodiment of the application has the following advantages in actual application. First, real-time vehicle safety event data reported by a vehicle terminal is received. Second, the statistical category corresponding to the statistical information of each safety event data is taken as the label of the statistical information, a time sequence database insertion statement is dynamically generated according to each statistical information, the timestamp corresponding to the statistical information, and the label of the statistical information, and the corresponding safety event data is inserted into a target time sequence database according to the time sequence database insertion statement. Finally, statistical information that meets the conditions in terms of the timestamp information and the statistical category is filtered from the target time sequence database according to a preset threshold range and a preset query category, and the statistical information and the corresponding timestamp information are taken as a statistical result and output according to the time sequence of the timestamp information corresponding to the statistical information.
[0070] The method for sequentially storing data in a time sequence database replaces the data storage mode of a traditional relational database, effectively improves the writing speed of vehicle safety event data, and improves the processing and statistical analysis rate of large-scale safety event data, thereby solving the problem of data delay in processing safety event data by a traditional relational database.
[0071] The method of setting different labels for statistical information of different statistical categories further improves the query rate of users for statistical information of different statistical categories.
[0072] Further, before taking the statistical category corresponding to the statistical information of each safety event data as the label of the statistical information and generating a time sequence database insertion statement according to each statistical information, the timestamp corresponding to the statistical information, and the label of each statistical information, the method further comprises the following steps.
[0073] In the plurality of safety event data, the safety event data with abnormal timestamp information is subjected to first data cleaning, and a plurality of safety event data arranged in time sequence after first cleaning is obtained, and the plurality of safety event data is temporarily stored in a data buffer.
[0074] Each safety event data contains timestamp information after being generated, and the plurality of safety event data is generally published in time sequence. However, in actual application, there may be safety event data without timestamp information, or a certain safety event data with obviously advanced or delayed timestamp information compared with the timestamp information of the data before or after it. The safety event data with the above problems in timestamp information is considered as safety event data with abnormal timestamp information.
[0075] Before storing the safety event data, the safety event data with abnormalities needs to be subjected to data cleaning, for example, deleting safety event data missing timestamp information, or writing the current time as the timestamp of the safety event data missing timestamp information.
[0076] After the data cleaning is completed, the plurality of security event data is sequentially arranged according to the timestamp information, and the plurality of security event data after cleaning is temporarily stored in a data buffer. The data buffer is a kafka message middleware or a mq message middleware.
[0077] In this embodiment, in order to ensure the throughput of data and prevent data loss caused by the extraction of security event data not being timely, the security event data after cleaning is temporarily stored through the kafka message middleware or the mq message middleware.
[0078] Further, after the plurality of security event data is temporarily stored in the data buffer, the method further comprises:
[0079] The security event data in the data buffer is sequentially read, and the security event data with abnormal timestamp information is cleaned for the second time to obtain a plurality of security event data sequentially arranged according to time after the second cleaning.
[0080] The security event data with abnormal timestamp information refers to security event data with timestamp information not arranged in time sequence. In the second data cleaning, the security event data with abnormal timestamp information is deleted to ensure that the plurality of security event data is time series data when the plurality of security event data is inserted into the time series database.
[0081] Further, when the timestamp information in the target time series database meets the preset threshold range, the statistical information of the statistical category meeting the preset query category is found according to the label, specifically comprising:
[0082] The statistical task input by the user is obtained.
[0083] The statistical task includes a preset threshold range and a preset query category. The statistical task can be input by the user through a fixed terminal or a mobile terminal.
[0084] Specifically, the preset threshold range can be a preset time range such as one hour, one day, three days, or one week, and the preset query category can be one or a combination of vehicle type, part type, region, and level.
[0085] The statistical information with the same label and the same preset query category in the target time series database is obtained.
[0086] Specifically, according to the preset threshold range and the preset query category in the obtained statistical task, the statistical information with the same label and the same preset query category in the target time series database is queried.
[0087] That is, in the present application, the security event data in the target time series database can be actively queried by the user inputting the statistical task.
[0088] Further, when the timestamp information in the target time series database meets the preset threshold range, the statistical information of the statistical category meeting the preset query category is found according to the label, specifically including:
[0089] When the current time is equal to the timing time, the timing task is started.
[0090] The timing task includes the start time, the preset threshold range and the preset query category.
[0091] The start time is a pre-set fixed time for starting the timing task, and the start time can be any time point of each day, which is not limited in the embodiment.
[0092] The preset threshold range can be the previous day, the previous three days or the previous week from the current start time; and the preset query category can be one or a combination of vehicle type, part type, region and level.
[0093] Through the timing task, the statistical information of the target time series database is obtained, in which the timestamp information is within the preset threshold range and the label is the same as the preset query category.
[0094] Specifically, after the current time reaches the start time of the timing task, the timing task automatically queries the statistical information in the target time series database, in which the timestamp information is within the preset threshold range and the label information is the same as the preset query category, according to the preset threshold range and the preset query category.
[0095] That is, in the present application, the security event data in the target time series database can be periodically queried by setting the timing task.
[0096] Further, after the statistical information and the timestamp information corresponding to the statistical information are output as the statistical result, the method further includes:
[0097] The output statistical result is sent to the data buffer in time sequence.
[0098] The data buffer is a kafka message middleware or a mq message middleware; the statistical result obtained by the statistical task or the timing task is sent to the data buffer for temporary storage, and when the user needs, the required data can be directly extracted from the data buffer for further statistics and analysis.
[0099] The statistical result is obtained from the data buffer and displayed in the form of a table.
[0100] Specifically, the user obtains the required statistical result from the data buffer, and displays the statistical result in the form of a table on the fixed terminal or the mobile terminal, so as to facilitate the user to view.
[0101] Further, after the statistical information and the timestamp information corresponding to the statistical information are output as the statistical result, the method further comprises:
[0102] The maximum storage days of data in the target time sequence database are set, and when the storage days of the historical security event data are greater than or equal to the maximum storage days, the historical security event data are sequentially rolled over according to the timestamp information of the newly inserted security event data.
[0103] Specifically, the target time sequence database stores data in a rolling coverage manner, and the timestamp information of the security event data can be used to determine the number of days for which the historical security event data have been stored; when the number of days for which the security event has been stored is greater than the preset maximum storage days, a deletion function of the target time sequence database can be called to automatically delete the overdue data and release the storage space of the overdue data; when new data arrives, the storage space can be used to store the newly arrived security event data.
[0104] That is, in the present application, for the problem of aging of a large amount of security event data, the automatic rolling update of the data within a preset date range can be realized by setting the influxDB time sequence database, and compared with the traditional relational database, the present application does not need human intervention for data aging, and can ensure the stability of the processing system in which the vehicle security event processing method is located.
[0105] The vehicle security event processing method provided by the embodiment of the present application utilizes the time sorting function of the time sequence database in actual application, adopts a distributed time sequence database to perform data persistence, and performs statistics and query on a large amount of security event data of the vehicle, and has a second-level query speed and a database disaster recovery mechanism; compared with the existing relational database, the vehicle security event processing method based on the time sequence database of the present application does not need to perform data sorting, and can reduce a large amount of time consumed by sorting; when data is inserted, a table structure does not need to be created first and then data is inserted as in the structured database, and a large amount of time consumed by creating a table structure can be reduced.
[0106] Meanwhile, the present application supports obtaining security event data from a data buffer such as a kafka message middleware or a mq message middleware, and can guarantee the integrity of the data while taking into account the throughput of the processing system in which the vehicle security event processing method is located.
[0107] The present application can also automatically delete aging data, and will not affect the statistical function of the processing system when the aging data is deleted, and can effectively reduce the operation risk of the monitoring system in real-time monitoring of the vehicle security situation.
[0108] As Figure 2 shown in the second aspect, the embodiments of the present application provide a vehicle safety event processing device, which comprises:
[0109] The data acquisition module 201 is configured to receive a plurality of safety event data of a vehicle reported by a terminal in real time, each of the safety event data comprising timestamp information and vehicle statistical information, the vehicle statistical information comprising statistical information corresponding to a plurality of statistical categories;
[0110] The data statistical marking module 202 is configured to take the statistical category corresponding to the statistical information of each safety event data as a label of the statistical information, to generate a time series database insertion statement according to each statistical information, the timestamp information corresponding to the statistical information, and the label of each statistical information, and to insert the safety event data into a target time series database according to the time series database insertion statement;
[0111] The data statistical analysis module 203 is configured to, when the timestamp information in the target time series database meets a preset threshold range, find statistical information whose statistical category meets a preset query category according to the label, and output the statistical information and the timestamp information corresponding to the statistical information as a statistical result according to the time sequence of the timestamp information.
[0112] Further, the device further comprises a first data processing module configured to, before taking the statistical category corresponding to the statistical information of each safety event data as a label of the statistical information and generating a time series database insertion statement according to each statistical information, the timestamp information corresponding to the statistical information, and the label of each statistical information, perform a first data cleaning on safety event data with abnormal timestamp information in the plurality of safety event data, obtain a plurality of safety event data arranged in time sequence after the first cleaning, and temporarily store the plurality of safety event data in a data buffer.
[0113] Further, the device further comprises a second data processing module configured to, after temporarily storing the plurality of safety event data in the data buffer, read the safety event data in the data buffer in sequence, and perform a second cleaning on the safety event data with abnormal timestamp information, to obtain a plurality of safety event data arranged in time sequence after the second cleaning.
[0114] Further, when the timestamp information in the target time series database meets a preset threshold range, and the statistical information whose statistical category meets a preset query category is found according to the label, the data statistical analysis module 203 is specifically configured to perform:
[0115] Obtain a statistical task input by a user; the statistical task comprises the preset threshold range and the preset query category;
[0116] The timestamp information in the target time-series database is within the preset threshold range, and the label and the preset query category are the same.
[0117] Further, when the timestamp information in the target time-series database meets the preset threshold range, and the label meets the preset query category according to the statistical category, the data statistical analysis module 203 is further configured to perform:
[0118] When the current time is equal to the timing time, the timing task is started; the timing task includes the start time, the preset threshold range, and the preset query category.
[0119] Through the timing task, the timestamp information in the target time-series database is within the preset threshold range, and the label and the preset query category are the same.
[0120] Further, the apparatus further includes a statistical result processing module, which is configured to perform, after the statistical information and the timestamp information corresponding to the statistical information are output as the statistical result:
[0121] The output statistical result is sequentially sent to the data buffer according to the time sequence.
[0122] The statistical result is obtained from the data buffer and displayed in the form of a table.
[0123] Further, the apparatus further includes a data updating module, which is provided with the maximum storage days of data in the target time-series database, for sequentially rolling over the historical security event data according to the timestamp information of the newly inserted security event data when the storage days of the historical security event data are greater than or equal to the maximum storage days after the statistical information and the timestamp information corresponding to the statistical information are output as the statistical result.
[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, apparatus, and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.
[0125] In a third aspect, the embodiments of the present application also provide an electronic device, which includes a processor and a memory, the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the vehicle security event processing method in the embodiments of the present application.
[0126] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by a processor to implement the vehicle safety event processing method in the embodiments of the present application.
[0127] In the above embodiments, the implementation can be achieved by software, hardware, firmware or any combination thereof, entirely or partially. When implemented by software, the implementation can be in the form of computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed by a computer, the implementation generates the processes or functions according to the embodiments of the present application, entirely or partially. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by the computer or data storage device such as server, data center, etc. containing one or more available medium sets. The available medium can be magnetic medium (for example, floppy disk, hard disk, magnetic tape), optical medium (for example, DVD) or semiconductor medium (for example, solid state disk (SSD)) etc.
[0128] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed by the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for handling vehicle safety incidents, characterized in that, The method includes: The system receives multiple safety event data reported by the vehicle in real time; each safety event data includes timestamp information and vehicle statistical information; the safety event data is obtained from the vehicle's safety event log; the vehicle statistical information includes statistical information corresponding to multiple statistical categories, and the statistical categories of the vehicle statistical information include vehicle model, component type, region, and level. Among the multiple security event data, the security event data with abnormal timestamp information is cleaned for the first time to obtain multiple security event data arranged in chronological order after the first cleaning, and the multiple security event data are temporarily stored in the data buffer. The security event data in the data buffer is read sequentially, and the security event data with abnormal timestamp information is cleaned a second time to obtain multiple security event data arranged in chronological order after the second cleaning. The statistical category corresponding to the statistical information of each security event data is used as the label of the statistical information. A time series database insertion statement is generated based on each statistical information, the timestamp information corresponding to the statistical information, and the label of each statistical information. The security event data is then inserted into the target time series database according to the time series database insertion statement. While the timestamp information in the target time series database meets the preset threshold range, statistical information that meets the preset query category is found according to the label, and the statistical information and the timestamp information corresponding to the statistical information are output as statistical results according to the time order of the timestamp information corresponding to the statistical information.
2. The method according to claim 1, characterized in that, While the timestamp information in the target time series database meets a preset threshold range, statistical information that meets a preset query category is searched based on the tag. Specifically, this includes: Obtain statistical tasks from user input; the statistical tasks include preset threshold ranges and preset query categories; Obtain statistical information from the target time series database that includes timestamp information within the preset threshold range and whose tags are the same as the preset query category.
3. The method according to claim 1, characterized in that, While the timestamp information in the target time series database meets a preset threshold range, statistical information that meets a preset query category is searched based on the tag. Specifically, this includes: When the current time equals the scheduled time, the scheduled task is started; the scheduled task includes a start time, a preset threshold range, and a preset query category; The scheduled task retrieves timestamp information from the target time series database within the preset threshold range, along with statistical information whose tags are the same as the preset query category.
4. The method according to claim 1, characterized in that, After the statistical information and the corresponding timestamp information are output as statistical results, the method further includes: The output statistical results are sent to the data buffer in chronological order. The statistical results are obtained from the data buffer and displayed in a table.
5. The method according to claim 1, characterized in that, After outputting the statistical information and the corresponding timestamp information as statistical results, the method further includes: Set the maximum number of days for storing data in the target time-series database. When the number of days for storing historical security event data is greater than or equal to the maximum number of days, the historical security event data is sequentially overwritten based on the timestamp information of the newly inserted security event data.
6. A vehicle safety incident handling device, characterized in that, The device includes: The data acquisition module is used to receive multiple safety event data reported by the vehicle terminal in real time; each safety event data includes timestamp information and vehicle statistical information; the safety event data is obtained from the vehicle's safety event log; the vehicle statistical information includes statistical information corresponding to multiple statistical categories, and the statistical categories of the vehicle statistical information include vehicle model, component type, region, and level; The first data processing module is used to perform a first data cleaning on security event data with abnormal timestamp information from multiple security event data, to obtain multiple security event data arranged in chronological order after the first cleaning, and to temporarily store the multiple security event data in a data buffer. The second data processing module is used to sequentially read the security event data in the data buffer and perform a second cleaning on the security event data with abnormal timestamp information to obtain multiple security event data arranged in chronological order after the second cleaning. The data statistics tagging module is used to use the statistical category corresponding to the statistical information of each security event data as the tag of the statistical information, generate a time series database insertion statement based on each statistical information, the timestamp information corresponding to the statistical information and the tag of each statistical information, and insert the security event data into the target time series database according to the time series database insertion statement; The data statistical analysis module is used to find statistical information that meets the preset query category according to the tag while the timestamp information in the target time series database meets the preset threshold range, and output the statistical information and the timestamp information corresponding to the statistical information as statistical results according to the time order of the timestamp information corresponding to the statistical information.
7. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the vehicle safety event handling method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the vehicle safety incident handling method as described in any one of claims 1-5.
Citation Information
Patent Citations
Time series data storage method and time series database applied to industrial internet of things
CN110795428A
Intelligent network connection vehicle state monitoring and analysis system and method
CN113905067A