CAN data analysis method and system

Through the CAN data analysis method, simple host computer software is used to analyze and filter CAN signals, and the problems of inconvenient and high cost of CAN data analysis in the existing technology are solved, and efficient and low-cost data analysis and analysis effects are achieved.

CN119254860APending Publication Date: 2025-01-03KEXIN POWER BATTERY SYSTEM (HUBEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411371978.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The methods for CAN data analysis in the prior art mainly rely on Vector tools, which are inconvenient to use and costly, and the installation files are too large, lacking flexible and efficient parsing solutions.

Method used

Provide a CAN data analysis method, which can analyze CAN signals, extract CAN original messages, filter and analyze data, obtain signal information, and convert it into data files in a specified format. It uses simple host computer software to support DBC and Analysis of ASC format files.

Benefits of technology

It realizes efficient parsing and analysis of CAN data, reduces costs, is easy to use, avoids hardware authorization and installation complexity, and improves data parsing efficiency and readability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254860A_ABST
    Figure CN119254860A_ABST
Patent Text Reader

Abstract

The invention discloses a CAN data analysis method and system, and relates to the field of transmission data processing. The method comprises the following steps: analyzing a CAN signal according to a communication protocol of CAN data to obtain a CAN original message; performing data filtering on the CAN original message; and analyzing the CAN original message after data filtering to obtain CAN data signal information. According to the method provided by the invention, only simple upper computer software needs to be carried, and the software is free from installation and can be operated after being directly opened, so that the method is convenient to use and low in cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of transmission data processing, and in particular to a method and system for analyzing CAN (Controller Area Network serial communication protocol bus for real-time applications) data. Background Art

[0002] With the development of industrial automation and intelligence, the application of CAN bus is becoming more and more extensive, and CAN data analysis is becoming more and more important. CAN data analysis includes steps such as data parsing, data conversion and data storage; these data can be used for historical data viewing, fault diagnosis and production process control.

[0003] Currently, the mainstream way to analyze CAN data is through Vector tools, and there is no other CAN data analysis method. Summary of the invention

[0004] In view of the defects existing in the prior art, the technical problem solved by the present invention is to provide a CAN data analysis method different from the prior art.

[0005] In a first aspect, an embodiment of the present application provides a method for analyzing CAN data, comprising the following steps: parsing a CAN signal according to a communication protocol of the CAN data to obtain a CAN original message; filtering the CAN original message; and parsing the filtered CAN original message to obtain CAN data signal information.

[0006] In combination with the first aspect, in one implementation, the process of filtering data on the CAN original message includes: establishing a corresponding parsing function according to the CAN original message, and identifying valid messages in the CAN original message through the parsing function for extraction.

[0007] In combination with the first aspect, in one implementation, the valid message is CAN data defined in a DBC file.

[0008] In combination with the first aspect, in one implementation, the process of parsing the CAN original message includes: parsing traversal values ​​and original message data.

[0009] In combination with the first aspect, in one implementation, the process of parsing the CAN original message further includes: replaying the parsing process of the CAN data.

[0010] In combination with the first aspect, in one implementation, the replayed CAN data is a specified single and / or multiple CAN data, and the playback process includes: setting a playback interval duration for adjusting a display interval between adjacent frame data.

[0011] In combination with the first aspect, in one implementation, after obtaining the CAN data signal information, the method further includes the following steps: converting the CAN data signal information and its acquisition timestamp into a data file in a specified format.

[0012] In combination with the first aspect, in one implementation, the communication protocol is obtained from a DBC file.

[0013] In combination with the first aspect, in one implementation, the process of parsing the CAN signal includes: extracting a signal ID, a signal name, a signal start bit, a length, a resolution, an offset, and a period in the CAN signal according to a communication protocol.

[0014] In a second aspect, an embodiment of the present application provides a CAN data analysis system, which includes a host computer, and is characterized in that: the host computer is used to implement the steps of the method provided in the first aspect.

[0015] Compared with the prior art, the advantages of the present invention are:

[0016] The present invention discloses a method for parsing CAN data. Compared with the Vector tool in the prior art, the Vector tool is very inconvenient to use in terms of software, hardware and cost. It requires software and hardware authorization to use, and the installation file is too large. The method provided by the present invention only needs to be equipped with simple host computer software, and the software does not need to be installed. It can be directly opened and run, which is not only convenient to use, but also low in cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 It is a structural block diagram of a CAN data analysis system according to an embodiment of the present invention;

[0019] Figure 2 This is a schematic diagram of the hardware structure of the CAN data analysis device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0021] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0022] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0023] In a first aspect, an embodiment of the present application provides a method for analyzing CAN data, the steps of the method comprising: parsing a CAN signal according to a communication protocol of the CAN data, extracting the CAN data to obtain a CAN original message; filtering the CAN original message; and parsing the filtered CAN original message to obtain CAN data signal information.

[0024] It can be seen that the present invention discloses a method for parsing CAN data. Compared with the Vector tool in the prior art, the Vector tool is very inconvenient to use in terms of software, hardware and cost. It requires software and hardware authorization to use, and the installation file is too large. The method provided by the present invention can be used with only simple host computer software, which is not only convenient to use, but also low in cost.

[0025] In one embodiment, the communication protocol in the above method is obtained in a DBC file (Database CAN, a network communication file format).

[0026] In one embodiment, the process of parsing the CAN signal in the above method includes: extracting information such as signal ID, signal name, signal start bit, length, resolution, offset, period, etc. in the CAN signal according to the communication protocol.

[0027] In one embodiment, the process of filtering data on CAN original messages in the above method includes: establishing a corresponding parsing function based on the CAN original message, identifying valid messages in the CAN original message through the parsing function and extracting them, that is, extracting corresponding data information in a targeted manner to improve data parsing efficiency; on this basis, the subsequent loading of the extracted data file can display the number of valid messages in the file.

[0028] Furthermore, the above-mentioned valid message is CAN data defined in the DBC file.

[0029] In one embodiment, the process of parsing the CAN original message in the above method includes: only parsing the traversal values ​​and the original message data, thereby avoiding updating most of the data, greatly improving the parsing efficiency.

[0030] At the same time, the process of parsing the CAN original message also includes: replaying the parsing process of the CAN data.

[0031] On this basis, the CAN data for single playback is a specified single and / or multiple CAN data (single playback or one-click batch playback), and the playback process can be: setting a playback interval duration for adjusting the display interval between adjacent frame data.

[0032] In one embodiment, after the above method obtains the CAN data signal information, it also includes the following steps: converting the CAN data signal information and its acquisition timestamp into a data file of a specified format, such as an Excel data file; of course, single data conversion or batch conversion can be specified by ID; at the same time, it supports the display of a progress bar during the conversion process, which is convenient for direct frame-by-frame analysis of data through Excel tables, bringing great convenience to data analysis.

[0033] It can be seen that the present invention supports CAN data analysis of most ASC format files and supports the protocol of general DBC files; it has the playback of specified ID and all ID data and supports the setting of playback waiting time; it supports the conversion of specified ID data and all ID data into Excel table data with message time identifier information, which makes it easier to locate the time of fault information and the data is highly readable.

[0034] In a second aspect, the embodiment of the present application also provides a CAN data analysis system, which includes a host computer based on C# CAN data parsing, see Figure 1 As shown, the host computer includes a DBC file parsing unit, an ASC format data extraction unit, a data parsing unit and a data storage unit.

[0035] The DBC file parsing unit is used to: execute the step of parsing the CAN signal according to the communication protocol of the CAN data in the above method to obtain the CAN original message;

[0036] The ASC format data extraction unit is used to: perform the step of filtering the CAN original message in the above method;

[0037] The data parsing unit is used to: execute the step of parsing the CAN original message after data filtering in the above method to obtain CAN data signal information;

[0038] The data storage unit is used to: execute the step of converting the CAN data signal information and its acquisition time stamp into a data file in a specified format in the above method.

[0039] In a third aspect, an embodiment of the present application provides a CAN data analysis device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.

[0040] Reference Figure 2 , Figure 2 The hardware structure diagram of the CAN data analysis device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the CAN data analysis device may include a processor, a memory, a communication interface, and a communication bus.

[0041] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0042] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the CAN data analysis device, and the interface used to realize the interconnection between the CAN data analysis device and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0043] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0044] The processor may be a general-purpose processor, and the general-purpose processor may call the analysis program of CAN data stored in the memory and execute the analysis method of CAN data provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the analysis program of CAN data is called may refer to the various embodiments of the analysis method of CAN data of the present application, which will not be repeated here.

[0045] Those skilled in the art will understand that Figure 2 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0046] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0047] The computer-readable storage medium of the present application stores a CAN data analysis program, wherein when the CAN data analysis program is executed by a processor, the steps of the CAN data analysis method as described above are implemented.

[0048] Among them, the method implemented when the CAN data analysis program is executed can refer to the various embodiments of the CAN data analysis method of the present application, and will not be repeated here.

[0049] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0050] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0051] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0052] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0053] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0054] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0055] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0056] The above are only specific implementations of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the embodiments of the present invention, and these modifications or replacements should be included in the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for analyzing CAN data, characterized in that: The method comprises the following steps: parsing a CAN signal according to a communication protocol of CAN data to obtain an original CAN message; filtering the original CAN message; parsing the filtered original CAN message to obtain CAN data signal information.

2. The method for analyzing CAN data according to claim 1, characterized in that: The process of filtering data of the CAN original message includes: establishing a corresponding parsing function according to the CAN original message, and identifying and extracting valid messages in the CAN original message through the parsing function.

3. The method for analyzing CAN data as claimed in claim 2, characterized in that: The valid message is the CAN data defined in the DBC file.

4. The method for analyzing CAN data according to claim 1, wherein: The process of parsing the CAN original message includes: parsing traversal values ​​and original message data.

5. The method for analyzing CAN data as claimed in claim 4, characterized in that: The process of parsing the original CAN message also includes: replaying the parsing process of the CAN data.

6. The method for analyzing CAN data as claimed in claim 5, characterized in that: The replayed CAN data is a specified single piece and / or multiple pieces of CAN data, and the replay process includes: setting a replay interval duration for adjusting the display interval between adjacent frame data.

7. The method for analyzing CAN data according to any one of claims 1 to 6, characterized in that: After obtaining the CAN data signal information, the method further includes the following steps: converting the CAN data signal information and its acquisition time stamp into a data file in a specified format.

8. The method for analyzing CAN data according to any one of claims 1 to 6, characterized in that: The communication protocol is obtained in the DBC file.

9. The method for analyzing CAN data according to any one of claims 1 to 6, characterized in that: The process of parsing the CAN signal includes: extracting the signal ID, signal name, signal start bit, length, resolution, offset and period in the CAN signal according to the communication protocol.

10. A CAN data analysis system, the system comprising a host computer, characterized in that: The host computer is used to implement the method described in any one of claims 1 to 9.