CN114979314A - Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment - Google Patents

Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN114979314A
CN114979314A CN202210755034.6A CN202210755034A CN114979314A CN 114979314 A CN114979314 A CN 114979314A CN 202210755034 A CN202210755034 A CN 202210755034A CN 114979314 A CN114979314 A CN 114979314A
Authority
CN
China
Prior art keywords
message
frame
data
file
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210755034.6A
Other languages
Chinese (zh)
Other versions
CN114979314B (en
Inventor
康大为
李�杰
王波
邓柯军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Deep Blue Automotive Technology Co ltd
Original Assignee
Chongqing Changan New Energy Automobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Changan New Energy Automobile Technology Co Ltd filed Critical Chongqing Changan New Energy Automobile Technology Co Ltd
Priority to CN202210755034.6A priority Critical patent/CN114979314B/en
Publication of CN114979314A publication Critical patent/CN114979314A/en
Application granted granted Critical
Publication of CN114979314B publication Critical patent/CN114979314B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to an automatic analysis method and system for automobile CAN data, a computer readable storage medium and electronic equipment, wherein the method comprises the following steps: editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file; loading the ith CAN message file, identifying the ID of the CAN signal to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file; and finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID. The invention extracts the 1Hz message data of the designated signal from the original message data, only aims at the 1Hz message data during analysis and calculation, and the 1Hz analysis result data also facilitates the final data analysis and processing when processing long-time process data, and CAN also realize the automatic processing of a plurality of CAN message files, thereby obviously improving the efficiency of CAN message analysis work.

Description

Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic device
Technical Field
The invention relates to the technical field of vehicle CAN signal analysis, in particular to an automatic analysis technology of automobile CAN data, a computer readable storage medium and electronic equipment.
Background
The CAN bus is an important communication system on the automobile, and the running state and the control instruction of the automobile are transmitted by the CAN bus. In vehicle research and development and vehicle fault diagnosis, collecting and analyzing a CAN message of a vehicle is an indispensable work. In the prior art, existing data acquisition equipment and software CAN analyze CAN messages, but automatic analysis and storage of large-batch CAN message files cannot be realized, repeated processing is needed after manual segmentation, when long-time process data of a vehicle are analyzed, an analyst often needs data with lower sampling frequency and the same sampling frequency, and the equipment and software in the prior art analyze original data with higher sampling frequency and different sampling frequency.
Disclosure of Invention
The invention aims to provide an automatic analysis method and system for automobile CAN data, a computer readable storage medium and electronic equipment, which solve the technical problems that: the existing data acquisition equipment and software CAN realize analysis of CAN messages, but CAN not realize automatic analysis and storage of large-batch CAN message files, repeated processing is needed for many times after manual segmentation, when long-time process data of a vehicle are analyzed, an analyst often needs data with lower sampling frequency and the same sampling frequency, and the equipment and software in the prior art analyze original data with higher sampling frequency and different sampling frequencies.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows: an automatic analysis method for automobile CAN data comprises the following steps:
s01, editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file;
s02, loading the ith CAN message file, identifying the ID of the CAN signal needing to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file;
s03, finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID;
s04, rounding the message time signal of the message frame based on the message frame position, and then deleting the data with repeated message time to obtain all message frame positions with the interval time of the first frame message ID as the preset value;
s05, sequentially carrying out processing of deleting repeated ID message frames on all messages between message frame positions with preset interval time to obtain resampling CAN message data with preset sampling frequency;
s06, resetting the index of the resampled CAN message data, loading the reset resampled CAN message and identifying the total message frame number m, the first frame message ID and all message frame positions corresponding to the first frame message ID;
s07, reading the jth Frame message, and converting the message into a message format recognizable by a CANlib function by using a Frame function;
s08, translating the message after format conversion by using a DBC.
S09, if j is less than or equal to the index of the ts moment of the first frame message ID, continuing to judge whether j is less than the index of the t moment message frame of the first frame message ID, if so, storing the CAN signal analysis result under the frame message, wherein the index is t, and the column label is the CAN signal name;
s10, j is added by 1;
s11, continuing to judge whether j is larger than m, if not, returning to S07 until the last frame of message of the current message is processed;
s12, if j is greater than m, then i is self-incremented by 1 and returns to S02, repeating S02 through S11;
s13, merging and analyzing result data after traversing all CAN message files;
s14, the parsed data is derived as CSV format data.
Preferably, the first and second electrodes are formed of a metal,
in S07, the converted content includes: the ID numerical system format of the message frame is converted into the numerical system format which is the same as the ID in the DBC; merging and converting the data segments of the message frame into a 16-system byte array; and extracting the data field byte number of the message frame.
Preferably, the first and second electrodes are formed of a metal,
in S09, if j is not equal to or less than the index of the ts time of the first frame message ID, directly storing the CAN signal analysis result under the frame message, where the index is t and the column label is the CAN signal name.
Preferably, the first and second electrodes are formed of a metal,
in S09, if j is not the index of the message frame at the time t that is smaller than the ID of the first frame message, t is self-incremented by 1, and the CAN signal analysis result under the frame message is stored, where the index is t and the column label is the name of the CAN signal.
Preferably, the first and second electrodes are formed of a metal,
in S06, the indexes of the resampled CAN packet data are reset in ascending order of time.
The invention also provides an automatic analysis system for the automobile CAN data, which comprises:
the editing module is used for editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file;
the processing module is used for loading the ith CAN message file, identifying the ID of the CAN signal needing to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file;
the searching module is used for finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID;
the rounding module is used for rounding the message time signal of the message frame based on the message frame position, and then deleting the data with repeated message time to obtain all message frame positions with preset interval time of the first frame message ID;
the deleting module is used for sequentially deleting repeated ID message frames of all messages among the message frame positions with preset interval time to obtain resampling CAN message data with preset sampling frequency;
the resetting module is used for resetting the index of the resampling CAN message data, loading the reset resampling CAN message and identifying the total message frame number m, the first frame message ID and all message frame positions corresponding to the first frame message ID;
the conversion module is used for reading the jth Frame message and converting the message into a message format which can be identified by a CANlib function by using a Frame function;
the translation module is used for translating the message after the format conversion by using a DBC.
The first judgment module is used for continuously judging whether j is smaller than the index of the message frame at the moment t of the ID of the first frame if j is smaller than or equal to the index of the message frame at the moment ts of the ID of the first frame, if so, the CAN signal analysis result under the frame message is stored, the index is t, and the column label is the CAN signal name;
the self-adding module is used for self-adding 1 to j;
the second judgment module is used for continuously judging whether j is larger than m, if not, returning to the conversion module until the last frame message of the current message is processed;
the returning module is used for self-adding 1 to the i if the j is larger than the m, returning to the processing module, and repeating the processing module to the second judging module;
the merging module is used for merging the analysis result data after traversing all CAN message files;
and the export module is used for exporting the analyzed data into CSV format data.
Preferably, the first and second electrodes are formed of a metal,
in the conversion module, the converted content includes: the ID numerical system format of the message frame is converted into the numerical system format which is the same as the ID in the DBC; merging and converting the data segments of the message frame into a 16-system byte array; and extracting the data field byte number of the message frame.
Preferably, the first and second electrodes are formed of a metal,
in the first judgment module, if j is not less than or equal to the index of the ts moment of the ID of the first frame message, directly storing the analysis result of the CAN signal under the frame message, wherein the index is t, and the column label is the name of the CAN signal.
Preferably, the first and second electrodes are formed of a metal,
in the first judgment module, if j is not the index of the message frame at the time t smaller than the ID of the first frame message, t is added by 1, the CAN signal analysis result under the frame message is stored, the index is t, and the column label is the name of the CAN signal.
Preferably, the first and second electrodes are formed of a metal,
and resetting the indexes of the re-sampled CAN message data in the resetting module according to the ascending sequence of time.
The present invention also provides a computer-readable storage medium having a program stored therein, the program being executed by hardware to implement the method as described above.
The invention also provides an electronic device comprising a processor and a memory, the memory having stored therein a program for execution by the processor to implement the method as described above.
By adopting the technical scheme, the invention has the following beneficial technical effects: the invention can extract the 1Hz message data of the designated signal from the original message data, and can greatly shorten the calculation time of the computer only aiming at the 1Hz message data during analysis and calculation. When long-time process data is processed, the 1Hz analysis result data also facilitates the final data analysis and processing. The invention CAN also realize the automatic processing of the multi-CAN message files, obviously improve the efficiency of CAN message analysis work, and particularly solve the problem of continuous analysis and storage of the CAN message files with more than a certain capacity.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The invention will be further explained with reference to the drawings.
The invention is used for analyzing the CAN signal of the vehicle, and particularly realizes the extraction and conversion of the CAN data of the vehicle through python.
The invention CAN use python software to extract the message ID in the DBC file after editing, and delete the message frame which is not needed in the CAN message file by using pthon software and message ID information. The 1Hz resampling of the original message data (different message IDs have different sampling frequencies) is realized by identifying all message time corresponding to the ID and the ID of the first frame message and combining the de-duplication operation. The message characteristics (ID, data segment and data segment byte number) of each message frame in the message file can be sequentially identified and extracted, and converted into the message frame in the CANlib format, and the message is translated by using a DBC. The translated messages can be grouped by seconds based on the position information of each message frame and the position information of the first frame message, and 1Hz analytic data of a single message file is obtained. And traversing all the message files, combining the analysis data of each message file to obtain the analysis data, and finally generating the analysis data into a CSV format text file.
As shown in fig. 1, the present invention provides an automatic analysis method for car CAN data, which is characterized by comprising the following steps:
s01, editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file; editing the DBC file and deleting the signals defined in the file but not required to be extracted. The edited DBC file is then loaded.
S02, loading the ith CAN message file, identifying the ID of the CAN signal needing to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file; loading a CAN message file, identifying message frame IDs (identities) needing to be extracted from the DBC file loaded in the last step, and deleting the message frames which cannot be matched with the IDs in the CAN message file.
S03, finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID; and then, identifying the ID of the first frame of the processed message file and the position information of all message frames corresponding to the ID.
S04, rounding the message time signal of the message frame based on the message frame position, and then deleting the data with repeated message time to obtain all message frame positions with the interval time of the first frame message ID as the preset value; and based on the message frame position information, rounding the time information of the message, then reserving the 1 st message frame with the same time information, deleting other message frames, and obtaining all position information of the interval 1s message frame of the ID of the first frame message.
S05, sequentially carrying out processing of deleting repeated ID message frames on all messages between message frame positions with preset interval time to obtain resampling CAN message data with preset sampling frequency; and based on the position information, carrying out duplicate removal processing on the processed message. The method is that only the first message frame with the same ID information is reserved for all message frames between two positions at intervals of 1 second, and other message frames are deleted to obtain 1Hz resampled message data.
S06, resetting the index of the resampled CAN message data, loading the reset resampled CAN message and identifying the total message frame number m, the first frame message ID and all message frame positions corresponding to the first frame message ID; resetting the indexes of the resampled CAN message data according to the ascending order of time; and resetting to obtain the index information of the message file, and ascending according to time. And loading the message file, and identifying the total number of message frames, the ID of the first frame of message and the positions of all message frames corresponding to the ID.
S07, reading the jth Frame message, and converting the message into a message format recognizable by a CANlib function by using a Frame function; the converted content includes: the ID numerical system format of the message frame is converted into the numerical system format which is the same as the ID in the DBC; merging and converting the data segments of the message frame into a 16-system byte array; extracting the number of bytes of the data field of the message frame; reading a 1 Frame message, and converting the Frame message into a message format which can be identified by a CANlib function by using a Frame function. The method specifically comprises the following steps: converting the ID value of the message frame into a numerical system format with the same ID in the DBC file so as to ensure that the ID of the message frame is correctly matched with the ID in the DBC file; merging and converting the character string format data segments of the message frames into a 16-system byte array; and extracting the byte length of the data segment of the message frame.
S08, translating the message after format conversion by using a DBC. S09, if j is less than or equal to the index of the ts moment of the first frame message ID, continuing to judge whether j is less than the index of the t moment message frame of the first frame message ID, if so, storing the CAN signal analysis result under the frame message, wherein the index is t, and the column label is the CAN signal name; if j is not less than or equal to the index of the ts moment of the ID of the first frame message, directly storing the analysis result of the CAN signal under the frame message, wherein the index is t, and the column label is the name of the CAN signal; if j is not the index of the message frame at the time t which is smaller than the ID of the first frame message, t is added by 1, the CAN signal analysis result under the frame message is stored, the index is t, and the column label is the name of the CAN signal; calculating the messages converted by the Frame function by using a DBC. If the position of the frame message is less than the initial position of the next second message segment, the index is the time of the one second message segment, the column label is the name of the CAN signal in the DBC file, and the signal value is the translation result of the data segment; if the position of the frame message is equal to the initial position of the next second message segment, the index is the time of the next second message segment, the column label is the name of the CAN signal in the DBC file, and the signal value is the translation result of the data segment; if the position of the frame message is larger than the initial position of the message segment in the last second, the index is the time of the message segment in the last second, the column label is the name of the CAN signal in the DBC file, and the signal value is the translation result of the data segment; a one-second segment refers to: based on the result of S06, the message time interval matching the first frame message ID is 1S. Based on the 1Hz packet obtained in S05, all packets included from a certain frame packet of the ID to the next frame packet of the ID (not including the next frame packet) are one-second segments.
S10, j is added by 1;
s11, continuing to judge whether j is larger than m, if not, returning to S07 until the last frame of message of the current message is processed; and traversing and reading each frame of message until the last frame of message of the current message file is processed.
S12, if j is greater than m, then i is self-incremented by 1 and returns to S02, repeating S02 through S11; and traversing and reading each message file.
S13, merging and analyzing result data after traversing all CAN message files; and merging the analysis results of all the message files.
S14, exporting the analyzed data into CSV format data; and exporting the analyzed data as a CSV file.
The invention also provides an automatic analysis system for the automobile CAN data, which comprises:
the editing module is used for editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file; editing the DBC file and deleting the signals defined in the file but not required to be extracted. The edited DBC file is then loaded.
The processing module is used for loading the ith CAN message file, identifying the ID of the CAN signal needing to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file; loading a CAN message file, identifying message frame IDs (identities) needing to be extracted from the DBC file loaded in the last step, and deleting the message frames which cannot be matched with the IDs in the CAN message file.
The searching module is used for finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID; and then, identifying the ID of the first frame of the processed message file and the position information of all message frames corresponding to the ID.
The rounding module is used for rounding the message time signal of the message frame based on the message frame position, and then deleting the data with repeated message time to obtain all message frame positions with the interval time of the first frame message ID as a preset value; and based on the message frame position information, rounding the time information of the message, then reserving the 1 st message frame with the same time information, deleting other message frames, and obtaining all position information of the interval 1s message frame of the ID of the first frame message.
The deleting module is used for sequentially deleting repeated ID message frames of all messages among the message frame positions with preset interval time to obtain resampling CAN message data with preset sampling frequency; and based on the position information, carrying out duplicate removal processing on the processed message. The method is that only the first message frame with the same ID information is reserved for all message frames between two positions at intervals of 1 second, and other message frames are deleted to obtain 1Hz resampled message data.
The resetting module is used for resetting the index of the resampling CAN message data, loading the reset resampling CAN message and identifying the total message frame number m, the first frame message ID and all message frame positions corresponding to the first frame message ID; resetting the indexes of the resampled CAN message data according to the ascending order of time; and resetting to obtain the index information of the message file, and ascending according to time. And loading the message file, and identifying the total number of message frames, the ID of the first frame of message and the positions of all message frames corresponding to the ID.
The conversion module is used for reading the jth Frame message and converting the message into a message format which can be identified by a CANlib function by using a Frame function; the converted content includes: the ID numerical system format of the message frame is converted into the numerical system format which is the same as the ID in the DBC; merging and converting the data segments of the message frame into a 16-system byte array; extracting the number of data field bytes of the message frame; reading a 1 Frame message, and converting the Frame message into a message format which can be identified by a CANlib function by using a Frame function. The method specifically comprises the following steps: converting the ID value of the message frame into a numerical system format with the same ID in the DBC file so as to ensure that the ID of the message frame is correctly matched with the ID in the DBC file; merging and converting the character string format data segments of the message frames into a 16-system byte array; and extracting the byte length of the data segment of the message frame.
The translation module is used for translating the message after the format conversion by using a DBC. The first judgment module is used for continuously judging whether j is less than the index of the ts moment of the first frame message ID or not if j is less than the index of the t moment message frame of the first frame message ID, if so, the CAN signal analysis result under the frame message is stored, the index is t, and the column label is the CAN signal name; calculating the messages converted by the Frame function by using a DBC. If the position of the frame message is less than the initial position of the next second message segment, the index is the time of the one second message segment, the column label is the name of the CAN signal in the DBC file, and the signal value is the translation result of the data segment; if the position of the frame message is equal to the initial position of the next second message segment, the index is the time of the next second message segment, the column label is the name of the CAN signal in the DBC file, and the signal value is the translation result of the data segment; if the position of the frame message is larger than the initial position of the message segment in the last second, the index is the time of the message segment in the last second, the column label is the name of the CAN signal in the DBC file, and the signal value is the translation result of the data segment; a one-second segment refers to: based on the result of S06, the message time interval matching the first frame message ID is 1S. Based on the 1Hz packet obtained in S05, all packets included from a certain frame packet of the ID to the next frame packet of the ID (not including the next frame packet) are one-second segments.
The self-adding module is used for self-adding 1 to j;
the second judgment module is used for continuously judging whether j is larger than m, if not, returning to the conversion module until the last frame message of the current message is processed; and traversing and reading each frame of message until the last frame of message of the current message file is processed.
The returning module is used for self-adding 1 to the i if the j is larger than the m, returning to the processing module, and repeating the processing module to the second judging module; and traversing and reading each message file.
The merging module is used for merging the analysis result data after traversing all CAN message files; and merging the analysis results of all the message files.
The export module is used for exporting the analyzed data into CSV format data; and exporting the analyzed data as a CSV file.
The present invention also provides a computer-readable storage medium having a program stored therein, the program being executable by hardware to implement the method as described above.
The invention also provides an electronic device comprising a processor and a memory, the memory having stored therein a program for execution by the processor to implement the method as described above.

Claims (12)

1. An automatic analysis method for automobile CAN data is characterized by comprising the following steps:
s01, editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file;
s02, loading the ith CAN message file, identifying the ID of the CAN signal needing to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file;
s03, finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID;
s04, rounding the message time signal of the message frame based on the message frame position, and then deleting the data with repeated message time to obtain all message frame positions with the interval time of the first frame message ID as the preset value;
s05, sequentially carrying out processing of deleting repeated ID message frames on all messages between message frame positions with preset interval time to obtain resampling CAN message data with preset sampling frequency;
s06, resetting the index of the resampled CAN message data, loading the reset resampled CAN message and identifying the total message frame number m, the first frame message ID and all message frame positions corresponding to the first frame message ID;
s07, reading the jth Frame message, and converting the message into a message format which can be identified by a CANlib function by using a Frame function;
s08, translating the message after format conversion by using a DBC.
S09, if j is less than or equal to the index of the ts moment of the first frame message ID, continuing to judge whether j is less than the index of the t moment message frame of the first frame message ID, if so, storing the CAN signal analysis result under the frame message, wherein the index is t, and the column label is the CAN signal name;
s10, j is added by 1;
s11, continuing to judge whether j is larger than m, if not, returning to S07 until the last frame of message of the current message is processed;
s12, if j is greater than m, then i is self-incremented by 1 and returns to S02, repeating S02 through S11;
s13, merging and analyzing result data after traversing all CAN message files;
s14, the parsed data is derived as CSV format data.
2. The method of claim 1,
in S07, the converted content includes: the ID numerical system format of the message frame is converted into the numerical system format which is the same as the ID in the DBC; merging and converting the data segments of the message frame into a 16-system byte array; and extracting the data field byte number of the message frame.
3. The method of claim 1,
in S09, if j is not equal to or less than the index of the ts time of the first frame message ID, directly storing the CAN signal analysis result under the frame message, where the index is t and the column label is the CAN signal name.
4. The method of claim 1,
in S09, if j is not the index of the message frame at the time t that is smaller than the ID of the first frame message, t is self-incremented by 1, and the CAN signal analysis result under the frame message is stored, where the index is t and the column label is the name of the CAN signal.
5. The method of claim 1,
in S06, the indexes of the resampled CAN packet data are reset in ascending order of time.
6. An automatic analysis system for automobile CAN data is characterized by comprising:
the editing module is used for editing the DBC file, deleting definition information of the CAN signal which does not need to be analyzed, and loading the edited DBC file;
the processing module is used for loading the ith CAN message file, identifying the ID of the CAN signal needing to be analyzed in the edited DBC file, and processing the CAN message file based on the ID, namely deleting the message frame which is not needed in the CAN message file;
the searching module is used for finding the first frame message ID of the processed CAN message file and all message frame positions corresponding to the first frame message ID;
the rounding module is used for rounding the message time signal of the message frame based on the message frame position, and then deleting the data with repeated message time to obtain all message frame positions with the interval time of the first frame message ID as a preset value;
the deleting module is used for sequentially deleting repeated ID message frames of all messages among the message frame positions with preset interval time to obtain resampling CAN message data with preset sampling frequency;
the resetting module is used for resetting the index of the resampling CAN message data, loading the reset resampling CAN message and identifying the total message frame number m, the first frame message ID and all message frame positions corresponding to the first frame message ID;
the conversion module is used for reading the jth Frame message and converting the message into a message format which can be identified by a CANlib function by using a Frame function;
the translation module is used for translating the message after the format conversion by using a DBC.
The first judgment module is used for continuously judging whether j is smaller than the index of the message frame at the moment t of the ID of the first frame if j is smaller than or equal to the index of the message frame at the moment ts of the ID of the first frame, if so, the CAN signal analysis result under the frame message is stored, the index is t, and the column label is the CAN signal name;
the self-adding module is used for self-adding 1 to j;
the second judgment module is used for continuously judging whether j is larger than m, if not, returning to the conversion module until the last frame message of the current message is processed;
the returning module is used for self-adding 1 to the i if the j is larger than the m, returning to the processing module, and repeating the processing module to the second judging module;
the merging module is used for merging the analysis result data after traversing all CAN message files;
and the export module is used for exporting the analyzed data into CSV format data.
7. The system of claim 6,
in the conversion module, the converted content includes: the ID numerical system format of the message frame is converted into the numerical system format which is the same as the ID in the DBC; merging and converting the data segments of the message frame into a 16-system byte array; and extracting the data field byte number of the message frame.
8. The system of claim 6,
in the first judgment module, if j is not less than or equal to the index of the ts moment of the ID of the first frame message, directly storing the analysis result of the CAN signal under the frame message, wherein the index is t, and the column label is the name of the CAN signal.
9. The system of claim 6,
in the first judgment module, if j is not the index of the message frame at the time t smaller than the ID of the first frame message, t is added by 1, the CAN signal analysis result under the frame message is stored, the index is t, and the column label is the name of the CAN signal.
10. The system of claim 6,
and resetting the indexes of the re-sampled CAN message data in the resetting module according to the ascending sequence of time.
11. A computer-readable storage medium, characterized in that the readable storage medium has stored therein a program which is executed by hardware to implement the method according to any one of claims 1 to 5.
12. An electronic device, characterized in that it comprises a processor and a memory, in which a program is stored which is executed by the processor to implement the method according to any one of claims 1 to 5.
CN202210755034.6A 2022-06-30 2022-06-30 Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment Active CN114979314B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210755034.6A CN114979314B (en) 2022-06-30 2022-06-30 Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210755034.6A CN114979314B (en) 2022-06-30 2022-06-30 Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114979314A true CN114979314A (en) 2022-08-30
CN114979314B CN114979314B (en) 2023-04-25

Family

ID=82967821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210755034.6A Active CN114979314B (en) 2022-06-30 2022-06-30 Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114979314B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115632745A (en) * 2022-10-17 2023-01-20 潍柴动力股份有限公司 Method and device for adjusting first frame message sending time, electronic equipment and storage medium
CN116132558A (en) * 2023-02-03 2023-05-16 重庆赛力斯新能源汽车设计院有限公司 Data analysis method and device, electronic equipment and storage medium
CN117176507A (en) * 2023-11-02 2023-12-05 上海鉴智其迹科技有限公司 Data analysis method, device, electronic equipment and storage medium
CN117812171A (en) * 2023-11-30 2024-04-02 宁德时代(上海)智能科技有限公司 Vehicle data analysis method and device, computer equipment, storage medium and vehicle

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126317A1 (en) * 2006-07-07 2008-05-29 Adam David Stout Method and system for converting source data files into database query language
CN108415408A (en) * 2018-03-16 2018-08-17 宁波杉杉汽车有限公司 Automobile packet parsing based on CAN communication and method for diagnosing faults
CN108600192A (en) * 2018-04-03 2018-09-28 南京越博动力系统股份有限公司 A kind of DBC document analysis and message analysis method based on regular expression
CN112069776A (en) * 2019-05-22 2020-12-11 上海汽车集团股份有限公司 File processing method and device and server
CN112714134A (en) * 2021-01-19 2021-04-27 广州导远电子科技有限公司 Analysis method, adaptation method, device, equipment and medium of CAN message
CN113067821A (en) * 2021-03-22 2021-07-02 聊城大学 CAN message analysis method based on single or multiple DBC files

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126317A1 (en) * 2006-07-07 2008-05-29 Adam David Stout Method and system for converting source data files into database query language
CN108415408A (en) * 2018-03-16 2018-08-17 宁波杉杉汽车有限公司 Automobile packet parsing based on CAN communication and method for diagnosing faults
CN108600192A (en) * 2018-04-03 2018-09-28 南京越博动力系统股份有限公司 A kind of DBC document analysis and message analysis method based on regular expression
CN112069776A (en) * 2019-05-22 2020-12-11 上海汽车集团股份有限公司 File processing method and device and server
CN112714134A (en) * 2021-01-19 2021-04-27 广州导远电子科技有限公司 Analysis method, adaptation method, device, equipment and medium of CAN message
CN113067821A (en) * 2021-03-22 2021-07-02 聊城大学 CAN message analysis method based on single or multiple DBC files

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JEONGHWANKIM等: "High Speed CAN Communication Standardization Management & DBC File Auto Generation System Development" *
谭凯: "汽车CAN总线安全性模糊测试技术研究" *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115632745A (en) * 2022-10-17 2023-01-20 潍柴动力股份有限公司 Method and device for adjusting first frame message sending time, electronic equipment and storage medium
CN116132558A (en) * 2023-02-03 2023-05-16 重庆赛力斯新能源汽车设计院有限公司 Data analysis method and device, electronic equipment and storage medium
CN117176507A (en) * 2023-11-02 2023-12-05 上海鉴智其迹科技有限公司 Data analysis method, device, electronic equipment and storage medium
CN117176507B (en) * 2023-11-02 2024-02-23 上海鉴智其迹科技有限公司 Data analysis method, device, electronic equipment and storage medium
CN117812171A (en) * 2023-11-30 2024-04-02 宁德时代(上海)智能科技有限公司 Vehicle data analysis method and device, computer equipment, storage medium and vehicle

Also Published As

Publication number Publication date
CN114979314B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
CN114979314A (en) Automatic analysis method and system for automobile CAN data, computer readable storage medium and electronic equipment
CN110019218B (en) Data storage and query method and equipment
CN110569214B (en) Index construction method and device for log file and electronic equipment
CN112632960B (en) Log analysis method and system based on dynamic field template
CN112887289B (en) Network data processing method, device, computer equipment and storage medium
CN112866800A (en) Video content similarity detection method, device, equipment and storage medium
CN113110995A (en) System migration test method and device
CN117112408A (en) Method, device and medium for generating automatic test case script
CN113391817B (en) ANTLR 4-based header file replacement method and device
CN111966339B (en) Buried point parameter input method and device, computer equipment and storage medium
CN111049684B (en) Data analysis method, device, equipment and storage medium
CN107590233B (en) File management method and device
CN112052248A (en) Audit big data processing method and system
CN113726824B (en) Fraud website searching method and system based on image characteristics
CN112217896A (en) JSON message conversion method and related device
CN106569939A (en) Multilateral language analysis system and multilateral language analysis method for control script programs
CN113886202A (en) Vehicle log analysis method, system, device, medium and vehicle
CN113076355A (en) Method for sensing data security flow situation
CN112133327B (en) Audio sample extraction method, device, terminal and storage medium
CN112256634B (en) Http-based low-memory large file analysis method
CN112380382B (en) Audio classification method, device and storage medium
CN116860509B (en) PST file repairing method, device and storage medium
CN116846615A (en) Specific network resource analysis method
CN112256651B (en) Method and device for collecting multi-source heterogeneous logs
CN117112846B (en) Multi-information source license information management method, system and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 401133 room 208, 2 house, 39 Yonghe Road, Yu Zui Town, Jiangbei District, Chongqing

Patentee after: Deep Blue Automotive Technology Co.,Ltd.

Address before: 401133 room 208, 2 house, 39 Yonghe Road, Yu Zui Town, Jiangbei District, Chongqing

Patentee before: CHONGQING CHANGAN NEW ENERGY AUTOMOBILE TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder