Search

CN-121996720-A - ASC log analysis system and method based on multimode CAN bus protocol

CN121996720ACN 121996720 ACN121996720 ACN 121996720ACN-121996720-A

Abstract

The invention discloses an ASC log analysis system and method based on a multimode CAN bus protocol, comprising an acquisition module, an analysis module and a storage module, wherein the acquisition module is used for acquiring ASC log files, the analysis module is used for analyzing the formats of the ASC log files and checking the ASC log files, carrying out standardized field conversion on the ASC log files to generate an analysis result list, the storage module is used for configuring a data storage environment and generating a database, inserting data of the analysis result list into the database in batches for transaction management, and counting data increment of the analysis result list. The method CAN be compatible with analysis of multi-format ASC logs, greatly improves the processing efficiency of large files, and reduces the query time for locating specific CAN IDs or time periods.

Inventors

  • YANG ZHONGFEI
  • GAO LANG
  • ZOU LIBAO
  • TIAN KAIWEN

Assignees

  • 武汉江夏楚能汽车技术研发有限公司

Dates

Publication Date
20260508
Application Date
20260126

Claims (10)

  1. 1. An ASC log parsing system based on a multimode CAN bus protocol, comprising: the file acquisition module is used for acquiring ASC log files; the analysis module comprises a regular list establishment sub-module, a verification criterion establishment sub-module and a standardization sub-module, wherein the regular list establishment sub-module is used for analyzing the format of the ASC log file, the verification criterion establishment sub-module is used for verifying the ASC log file, and the standardization sub-module is used for carrying out standardized field conversion on the ASC log file to generate an analysis result list; The storage module comprises a database sub-module and a batch insertion and transaction management sub-module, wherein the database sub-module is used for configuring a data storage environment and generating a database, and the batch insertion and transaction management sub-module is used for inserting data of the analysis result list into the database in batches and performing transaction management.
  2. 2. The system according to claim 1, wherein: The regular list building sub-module matches the format of the ASC log file through a regular list, the regular list comprises regular expressions which are mapped with the format of the ASC log file one by one, when matching is executed, each single effective row of the ASC log file is processed, matching is circulated according to the sequence of the regular expressions, the sequence is ordered based on the occurrence frequency of the format in an actual scene, after matching is successful, core fields are extracted according to the matched format, and matching verification of the follow-up format is terminated.
  3. 3. The system according to claim 1, wherein: the verification criteria creation sub-module verifies the ASC log file by creating verification criteria including presence verification criteria, entitlement verification criteria, code verification criteria, and oversized file adaptation criteria, and/or, The normalization submodule includes: a filtering unit, configured to filter invalid rows, where the invalid rows include a blank row, an annotation row, and a format disorder row: And the correction unit is used for removing the head and tail blank, replacing the full-angle blank, unifying the case and the unified separator.
  4. 4. The system of claim 1, wherein the database submodule comprises: the database connection configuration unit is used for supporting multithreading sharing connection, starting a log-before-write mode, supporting read-write concurrency, reducing the synchronization level, setting memory mapping and setting cache; The system comprises a table structure creation unit, a data structure generation unit and a data structure generation unit, wherein the table structure creation unit is used for creating an original data table and a statistical data table, the original data table is used for storing each piece of analyzed complete data of an analysis result list, and the statistical data table is used for storing the aggregation statistical information of each CAN_ID; The index optimization subunit is used for creating a composite index and screening data according to specific channels and directions as filtering conditions aiming at a high-frequency query scene.
  5. 5. The system of claim 1, wherein the bulk insert and transaction management submodule comprises: The batch logic unit is used for splitting the analysis result list, dividing the analysis result list into a plurality of batches and realizing batch processing; The system comprises a transaction execution unit, a batch execution function, a transaction guarantee function and a field mapping check function, wherein the transaction execution unit is used for calling a placeholder function, a batch execution function, a transaction guarantee function and a field mapping check function for each batch of data, the placeholder function is used for replacing dynamic values in SQL sentences, the batch execution function is used for inserting data in the analysis result list into a database in batch, the transaction guarantee function is used for putting the batch execution function into a transaction management range, the transaction is submitted if the insertion is successful, the transaction is rolled back if the insertion is abnormal, and the field mapping check function is used for adjusting core fields in the analysis result list into field sequences of SQL insertion sentences to be strictly consistent and converting the field sequences into a tuple list through list deduction.
  6. 6. The system of claim 1, further comprising a query module, the query module comprising: The condition generating unit is used for generating a cache item and a unique cache key of the query condition; The linkage query unit is used for checking the cache validity, and comprises a key existence check and an expiration time check, wherein the key existence check is used for checking whether a cache key exists in a preset cache dictionary, if the key does not exist, the key is judged to be missed, if the key exists, the interval between the current time and the creation time is calculated through the expiration time check, if the key is larger than the cache expiration time, the cache item is judged to be expired, the cache item is deleted and is judged to be missed, and if the key is smaller than or equal to the cache expiration time, the cache item is judged to be valid, and a query result is obtained.
  7. 7. The system according to claim 1, wherein: when the judging cache item is valid, acquiring a query result, and further comprising: Updating an access record, wherein the access record comprises access times and access time, and deleting the earliest access record if the length of the list exceeds 2; Return a cached item of the query condition, and/or, The determining that the cache entry is expired, deleting the cache entry and determining that the cache entry is not hit, further comprises: querying a database, and filtering query conditions by dynamically splicing SQL sentences; Acquiring field names of the filtered query conditions, converting a tuple list returned by the query into a dictionary list, and ensuring the format of the tuple list is consistent with that of the analysis result list; If the query result of the query condition is not null, writing the query result of the query condition into a cache, and triggering a cache elimination logic; and returning the query result of the query condition of the database.
  8. 8. An ASC log analysis method based on a multimode CAN bus protocol is characterized by comprising the following steps: Acquiring an ASC log file; Analyzing and checking the format of the ASC log file, and carrying out standardized field conversion on the ASC log file to generate an analysis result list; configuring a data storage environment and generating a database; Inserting the data of the analysis result list into a database in batches for transaction management, and counting the data increment of the analysis result list; Generating a cache item and a unique cache key of the query condition, and executing the query task.
  9. 9. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program comprises executable instructions which, when executed by a processor, implement the method of claim 8.
  10. 10. An electronic device, comprising: One or more processors; a memory for storing executable instructions for the processor that, when executed by the one or more processors, cause the one or more processors to implement the method of claim 8.

Description

ASC log analysis system and method based on multimode CAN bus protocol Technical Field The invention relates to the technical field of automobile electronic control, in particular to an ASC log analysis system and method based on a multimode CAN bus protocol. Background In the development and fault diagnosis process of an automobile electronic control system, CAN bus log analysis is a vital link. The prior art has the following technical bottlenecks: The format compatibility is insufficient, wherein the ASC log formats generated by different CAN analysis devices have differences, including various variants such as standard formats, extended frame formats, compact formats and the like, and the traditional resolvers cannot be fully compatible; The large file processing efficiency is low, the CAN log file generated by the vehicle road test usually reaches hundreds of MB or even GB level, and the traditional full memory loading mode leads to slow system response or even breakdown; The data retrieval performance is poor, namely the time for locating the signal of a specific CAN ID or time period in a large amount of data based on a linear scanning inquiry mode is too long; And the cache management mechanism is missing, namely the lack of an effective cache multiplexing mechanism when the same signal data are repeatedly queried, so that the waste of computing resources is caused. Disclosure of Invention Aiming at the problems in the prior art, the invention provides the ASC log analysis system and the ASC log analysis method based on the multimode CAN bus protocol, which CAN be compatible with analysis of ASC logs in multiple formats, greatly improve the processing efficiency of large files and reduce the inquiry time for positioning specific CAN IDs or time periods. Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application. According to a first aspect of the present application, there is provided an ASC log parsing system based on a multimode CAN bus protocol, comprising: the file acquisition module is used for acquiring ASC log files; the analysis module comprises a regular list establishment sub-module, a verification criterion establishment sub-module and a standardization sub-module, wherein the regular list establishment sub-module is used for analyzing the format of the ASC log file, the verification criterion establishment sub-module is used for verifying the ASC log file, and the standardization sub-module is used for carrying out standardized field conversion on the ASC log file to generate an analysis result list; The storage module comprises a database sub-module and a batch insertion and transaction management sub-module, wherein the database sub-module is used for configuring a data storage environment and generating a database, and the batch insertion and transaction management sub-module is used for inserting data of the analysis result list into the database in batches and performing transaction management. In some embodiments of the present application, based on the foregoing solution, the regular list building sub-module matches the format of the ASC log file through a regular list, where the regular list includes regular expressions mapped one by one with the format of the ASC log file, and when matching is performed, each valid row of the ASC log file is processed, matching is circularly performed according to the order of the regular expressions, where the order is ordered based on the frequency of occurrence of the format in the actual scene, and after matching is successful, core fields are extracted according to the matched format, and matching verification of the subsequent format is terminated. In some embodiments of the application, based on the foregoing, the verification criteria creation sub-module verifies the ASC log file by creating verification criteria including presence verification criteria, rights verification criteria, code verification criteria, and oversized file adaptation criteria, and/or, The normalization submodule includes: a filtering unit, configured to filter invalid rows, where the invalid rows include a blank row, an annotation row, and a format disorder row: And the correction unit is used for removing the head and tail blank, replacing the full-angle blank, unifying the case and the unified separator. In some embodiments of the present application, based on the foregoing scheme, the database submodule includes: the database connection configuration unit is used for supporting multithreading sharing connection, starting a log-before-write mode, supporting read-write concurrency, reducing the synchronization level, setting memory mapping and setting cache; The system comprises a table structure creation unit, a data structure generation unit and a data structure generation unit, wherein the table structure creation unit is used for creating an original data tabl