DBC file parsing and message analyzing method based on regular expression

A technology of message analysis and file parsing, which is applied in the field of CAN bus of new energy vehicles, can solve the problems of increased operation difficulty, waste of manpower and time costs, complexity and difficulty, etc., to reduce the probability of definition errors and quickly transplant Use and expandable effects

CN108600192AActive Publication Date: 2018-09-28NANJING YUEBOO POWER SYST CO LTD
6 Cites 25 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2018-09-28

Smart Images

  • Figure 1
    Figure 1
Patent Text Reader

Abstract

The invention discloses a DBC file parsing and message analyzing method based on a regular expression. In the method, a content of a DBC file is parsed through a processing method of matching and substituting of the regular expression, the parsed DBC data is used for analyzing a CAN message acquired from a finished automobile, a corresponding CAN network message block in the DBC file and signals contained in the CAN network message block are found according to a message ID, actual data is obtained through data type, start bit, bit length, offset, proportionality coefficient and parsing type ofthe CAN network message block, and the data is stored in a corresponding file. The method provided by the invention has excellent effects of being simple and highly expandable, not only being capableof performing CAN message parsing, but also being capable of performing acquisition and calibration of use completed data of protocols of XCP and CCP.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to a DBC file analysis and message analysis method based on regular expressions, and belongs to the technical field of CAN bus of new energy vehicles. Background technique

[0002] At present, with the development of new energy vehicle technology, the functions of the vehicle are becoming more and more complex, and the safety requirements are getting higher and higher, so more and more controllers are applied to the vehicle. In order to realize real-time communication between different controllers, CAN bus is also widely used. Through the CAN network, the data of different controllers are sent to the CAN bus with ID as the distinction, and the controller quickly finds the required data from the bus. The CAN bus has the functions of arbitration and inspection, which can ensure the accuracy of the data. Reliable and stable fieldbus. However, because the message IDs and bus data between controllers are different, the amount of data...

Examples

Embodiment Construction

[0077] Embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. Such as figure 1 Shown, method of the present invention comprises the following steps:

[0078] Step 1. Analyze the DBC file, read the DBC file in the form of text, and then use regular expressions to match, find the corresponding CAN network message block in the DBC file, and extract the corresponding CAN message ID and node name , message name, and then search down the content contained in the CAN network, extract the corresponding data type, start bit, bit length, offset, proportional coefficient, and analysis type, and store them in the structure array.

[0079] The CAN network message block in the DBC file is that a message will immediately follow a multi-line signal until another message is parsed, indicating that a CAN network message block ends, and when all lines are parsed, all CAN network message blocks are is parsed. It is ignored w...