Vehicle signal analysis methods and vehicles

By configuring a signal parsing module in the vehicle controller, signal parsing can be directly achieved using a preset communication matrix, which solves the problem of low efficiency in vehicle message signal parsing, simplifies the process, and improves parsing efficiency.

CN116781805BActive Publication Date: 2026-03-06SANY AUTOMOBILE MFG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310795489.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2026-03-06
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

In existing technologies, the efficiency of vehicle message signal parsing is relatively low. Especially when a vehicle is equipped with multiple control units, it is impossible to directly convert CAN messages into physical signals used by the application layer based on the communication matrix, resulting in a significant increase in data volume and a decrease in parsing efficiency.

Method used

By pre-configuring a signal parsing module in the vehicle controller, the conversion between signal unpacking values ​​and signal physical values ​​can be directly realized using a preset communication matrix, avoiding redundant processing of DBC files and C language code. Local area network and Ethernet message receiving interfaces are used to process different types of messages respectively, and signal parsing algorithms are configured to achieve direct conversion.

Benefits of technology

The message signal parsing process has been simplified, and the parsing efficiency of vehicle signals has been improved. Signal parsing is completed directly based on the preset communication matrix without the need for additional conversion, thus improving parsing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116781805B_ABST
    Figure CN116781805B_ABST
Patent Text Reader

Abstract

This invention relates to the field of vehicle control technology, and more particularly to an in-vehicle signal parsing method and a vehicle. The method includes: receiving a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces; determining the message parsing interface corresponding to the message to be parsed based on a first identifier contained in the message to be parsed, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix, the signal parsing algorithm being used to directly convert between signal unpacking values ​​and signal physical values ​​based on the preset communication matrix; and calling the message parsing interface corresponding to the message to be parsed to parse the signal unpacking values ​​corresponding to the message to be parsed, thereby obtaining the signal physical values ​​corresponding to the message to be parsed. This invention addresses the deficiency of low efficiency in in-vehicle message signal parsing in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle control technology, and in particular to an on-board signal analysis method and a vehicle. Background Technology

[0002] In the automotive field, the vehicle's original Controller Area Network (CAN) message signals, based on a communication matrix, require pre-converting the communication matrix needed for CAN message parsing into a Database Can (DBC) file. Then, using MATLAB software, the DBC file is integrated with the application-layer functional logic to generate C language code, which is then integrated into the vehicle control unit. Only after the control unit receives the CAN message can it parse it using the pre-written code. The CAN message parsing process requires significant pre-processing of the corresponding communication matrix, making it impossible to directly convert the CAN message into the physical signals used by the application layer based on the communication matrix, resulting in low message signal parsing efficiency. In particular, with the development of vehicles and the increasing number of control units, the amount of data that needs to be converted between message signals and physical signals is also increasing, further reducing the efficiency of onboard signal parsing. Summary of the Invention

[0003] This invention provides a vehicle signal parsing method and a vehicle to address the shortcomings of low efficiency in vehicle message signal parsing in the prior art.

[0004] This invention provides a vehicle signal parsing method, applied to a pre-configured signal parsing module in a vehicle controller. The method includes: receiving a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces; determining the message parsing interface corresponding to the message to be parsed based on a first identifier contained in the message to be parsed, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix, the signal parsing algorithm being used to directly convert between signal unpacking values ​​and signal physical values ​​based on the preset communication matrix; and calling the message parsing interface corresponding to the message to be parsed to parse the signal unpacking values ​​corresponding to the message to be parsed, thereby obtaining the signal physical values ​​corresponding to the message to be parsed.

[0005] According to a vehicle signal parsing method provided by the present invention, the method further includes: when a message transmission condition is triggered, obtaining a second identifier corresponding to a message to be encapsulated, wherein different types of messages correspond to different message encapsulation interfaces; determining the message encapsulation interface corresponding to the message to be encapsulated based on the second identifier, wherein the message encapsulation interface is configured with the signal parsing algorithm; calling the message encapsulation interface corresponding to the message to be encapsulated to encapsulate the signal physical value corresponding to the second identifier to obtain the signal unpacking value corresponding to the message encapsulation interface; and obtaining the encapsulated message based on the signal unpacking value corresponding to the message encapsulation interface.

[0006] According to a vehicle signal parsing method provided by the present invention, the signal parsing module includes a local area network (LAN) message receiving interface and an Ethernet message receiving interface; receiving a message to be parsed based on a preset communication matrix includes: receiving a LAN message to be parsed based on a LAN communication matrix through the LAN message receiving interface, wherein the LAN communication matrix includes at least one LAN identifier, and each LAN identifier corresponds to a LAN message parsing interface; or receiving an Ethernet message to be parsed based on an Ethernet communication matrix through the Ethernet message receiving interface, wherein the Ethernet communication matrix includes at least one parameter group number, and each parameter group number corresponds to an Ethernet message parsing interface.

[0007] According to a vehicle signal parsing method provided by the present invention, determining the parsing interface corresponding to the parsing message based on a first identifier contained in the parsing message includes: determining the local area network (LAN) parsing interface corresponding to the LAN parsing message based on a first LAN identifier contained in the LAN parsing message, wherein the LAN identifier includes the first LAN identifier; or, splitting the Ethernet parsing message into at least one parameter group data packet, and sequentially processing each parameter group data packet as follows: determining the Ethernet parsing interface corresponding to the parameter group data packet based on a first parameter group number contained in the parameter group data packet, wherein the parameter group number includes the first parameter group number.

[0008] According to a vehicle-mounted signal parsing method provided by the present invention, the signal parsing module includes a local area network (LAN) packet sending interface and an Ethernet packet sending interface; the step of obtaining a second identifier corresponding to the packet to be encapsulated when a packet sending condition is triggered includes: when a LAN packet sending condition is triggered, obtaining a second LAN identifier corresponding to the LAN packet to be encapsulated through the LAN packet sending interface, wherein the LAN communication matrix includes at least one LAN identifier, each LAN identifier corresponds to a LAN packet encapsulation interface, and the LAN identifier includes the second LAN identifier; or, when an Ethernet packet sending condition is triggered, obtaining at least one second parameter group number corresponding to the Ethernet packet to be encapsulated through the Ethernet packet sending interface, wherein the Ethernet communication matrix includes at least one parameter group number, each parameter group number corresponds to an Ethernet packet encapsulation interface, and the parameter group number includes the second parameter group number.

[0009] According to a vehicle signal parsing method provided by the present invention, the step of determining the packet encapsulation interface corresponding to the packet to be encapsulated based on the second identifier includes: determining the local area network packet encapsulation interface corresponding to the local area network packet to be encapsulated based on the second local area network identifier; or, determining the Ethernet packet encapsulation interface corresponding to each of the second parameter group numbers based on the second parameter group number; the step of calling the packet encapsulation interface corresponding to the packet to be encapsulated to encapsulate the signal physical value corresponding to the second identifier to obtain the signal unpacking value corresponding to the packet encapsulation interface includes: calling the local area network packet encapsulation interface corresponding to the local area network packet to be encapsulated to encapsulate the signal physical value corresponding to the second local area network identifier to obtain the signal unpacking value corresponding to the local area network packet to be encapsulated; or, sequentially calling the Ethernet packet encapsulation interface corresponding to each of the second parameter group numbers to encapsulate the signal physical value corresponding to each of the second parameter group numbers respectively, obtaining the parameter group data packet corresponding to each of the second parameter group numbers, merging each of the parameter group data packets to obtain the signal unpacking value corresponding to the Ethernet packet to be encapsulated.

[0010] According to a vehicle signal parsing method provided by the present invention, the development process of the signal parsing module is as follows: based on the preset communication matrix, a signal parsing template is obtained according to the conversion relationship between the signal unpacking value and the signal physical value; based on the preset communication matrix, at least one conversion unit of a conversion auxiliary tool is configured, wherein the conversion auxiliary tool is used to convert the preset communication matrix into corresponding machine code; the preset communication matrix and the signal parsing template are input into the conversion auxiliary tool to obtain the machine code corresponding to the signal parsing module.

[0011] According to the present invention, a vehicle signal parsing method is provided, wherein the conversion unit includes fixed code, signal parameter declaration, message parsing and encapsulation interface declaration, signal physical value initialization, signal parameter initialization, message parsing and encapsulation interface list, and message parsing and encapsulation interface definition.

[0012] According to a vehicle signal parsing method provided by the present invention, the step of obtaining a signal parsing template based on the preset communication matrix and according to the conversion relationship between the signal unpacking value and the signal physical value includes: obtaining a local area network (LAN) signal parsing template based on a LAN communication matrix and according to the LAN conversion relationship between the signal unpacking value and the signal physical value; and obtaining an Ethernet signal parsing template based on an Ethernet communication matrix and according to the Ethernet conversion relationship between the signal unpacking value and the signal physical value; the step of configuring at least one conversion unit of a conversion aid tool based on the preset communication matrix includes: configuring at least one conversion unit of the conversion aid tool based on the LAN communication matrix and the Ethernet communication matrix; the step of inputting the preset communication matrix and the signal parsing template into the conversion aid tool to obtain the machine code corresponding to the signal parsing module includes: inputting the LAN communication matrix, the Ethernet communication matrix, the LAN signal parsing template, and the Ethernet signal parsing template into the conversion aid tool to obtain the machine code corresponding to the signal parsing module.

[0013] The present invention also provides a vehicle, the vehicle including an on-board controller, the on-board controller being pre-configured with a signal parsing module; the signal parsing module in the on-board controller is used to receive a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces; based on a first identifier contained in the message to be parsed, the message parsing interface corresponding to the message to be parsed is determined, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix, the signal parsing algorithm being used to directly convert between signal unpacking values ​​and signal physical values ​​based on the preset communication matrix; the message parsing interface corresponding to the message to be parsed is invoked to parse the signal unpacking values ​​corresponding to the message to be parsed, thereby obtaining the signal physical values ​​corresponding to the message to be parsed.

[0014] According to a vehicle provided by the present invention, the vehicle further includes a bus; the vehicle controller includes an application layer, middleware, and a basic software layer; the signal parsing module is configured in the middleware; the basic software layer is used to acquire the message to be parsed through the bus and transmit the message to be parsed to the middleware; the middleware is used to transmit the physical signal value obtained by the signal parsing module to the application layer; the application layer is used to acquire the physical signal value transmitted by the middleware.

[0015] According to a vehicle provided by the present invention, the application layer is further configured to, when a message transmission condition is triggered, transmit the second identifier corresponding to the message to be encapsulated to the middleware; the signal parsing module in the middleware is configured to, when a message transmission condition is triggered, obtain the second identifier corresponding to the message to be encapsulated, wherein different types of messages correspond to different message encapsulation interfaces; determine the message encapsulation interface corresponding to the message to be encapsulated based on the second identifier, wherein the message encapsulation interface is configured with the signal parsing algorithm; call the message encapsulation interface corresponding to the message to be encapsulated to encapsulate the signal physical value corresponding to the second identifier, and obtain the signal unpacking value corresponding to the message encapsulation interface; obtain the encapsulated message based on the signal unpacking value corresponding to the message encapsulation interface; the middleware is configured to transmit the encapsulated message to the basic software layer; the basic software layer is configured to transmit the encapsulated message to the bus.

[0016] The vehicle signal parsing method and vehicle provided by this invention receive a message to be parsed based on a preset communication matrix through a pre-configured signal parsing module in the vehicle controller. The preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces. Based on a first identifier contained in the message to be parsed, the message parsing interface corresponding to the message to be parsed is determined. The message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix. The signal parsing algorithm is used to directly convert between the unpacked signal value and the physical signal value based on the preset communication matrix. The message parsing interface corresponding to the message to be parsed is called to parse the unpacked signal value corresponding to the message to be parsed, thereby obtaining the physical signal value corresponding to the message to be parsed. In the above process, the signal parsing module is directly configured in the vehicle's local on-board controller. Through this signal parsing module, the parsing of the message to be parsed can be completed directly based on the preset communication matrix. There is no need to perform DBC file conversion and C language code conversion on the preset communication matrix in advance. Instead, the signal parsing module configured in the on-board controller directly realizes the conversion between the signal unpacking value of the message to be parsed and the physical unpacking value used by the application layer based on the preset communication matrix. This avoids redundant processing of the preset communication matrix, simplifies the message signal parsing process, and improves the parsing efficiency of the on-board signal. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the signal parsing process in the vehicle signal parsing method provided by the present invention;

[0019] Figure 2 This is a schematic diagram of the signal reading rules provided by the present invention;

[0020] Figure 3 This is a schematic diagram of the CAN message parsing process provided by the present invention;

[0021] Figure 4 This is a schematic diagram of the ETH message parsing process provided by the present invention;

[0022] Figure 5 This is a schematic diagram of the CAN signal parsing process provided by the present invention;

[0023] Figure 6 This is a schematic diagram of the signal encapsulation process in the vehicle signal parsing method provided by the present invention;

[0024] Figure 7 This is a schematic diagram of the CAN message encapsulation process provided by the present invention;

[0025] Figure 8 This is a schematic diagram of the ETH message encapsulation process provided by the present invention;

[0026] Figure 9 This is a schematic diagram of the ETH signal encapsulation process provided by the present invention;

[0027] Figure 10 This is a schematic diagram of the CAN message signal parsing and encapsulation process provided by the present invention;

[0028] Figure 11 This is a schematic diagram of the ETH message signal parsing and encapsulation process provided by the present invention;

[0029] Figure 12 This is a schematic diagram of the development process of the signal analysis module provided by the present invention;

[0030] Figure 13 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0032] The following is combined with Figures 1 to 13 The present invention describes the vehicle signal parsing method and the vehicle thereof.

[0033] In this invention, a signal parsing module is pre-configured in the vehicle's onboard controller. This module enables the implementation of the onboard signal parsing method provided by this invention. The onboard controller can be an Electronic Control Unit (ECU) already installed locally in the vehicle. Further, the vehicle includes a bus and an ECU. The bus is used for transmitting messages, and the ECU includes an application layer, middleware, and a basic software layer. The signal parsing module is configured in the middleware. The logic processing of the signal parsing module is completed through the middleware. Configuring the signal parsing module in the middleware decouples the application layer and the basic software layer. When the basic software layer receives a message from the bus, it passes the message to the middleware, which parses the message and passes the parsed physical signal value to the application layer for invocation. After updating the physical signal value, the application layer passes the updated physical signal value to the middleware, which encapsulates it into a message and passes it to the basic software layer, which then sends it to the bus.

[0034] In one embodiment, such as Figure 1 As shown, the vehicle signal parsing method includes a message parsing process, as detailed below:

[0035] Step 101: Receive the message to be parsed based on the preset communication matrix, wherein the preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces.

[0036] In this embodiment, each node in the vehicle-mounted message signal parsing process needs to follow the message rules defined by the preset communication matrix in order to achieve information exchange. The preset communication matrix is ​​defined by the vehicle manufacturer before the vehicle leaves the factory. Preferably, the preset communication matrix is ​​generally in the form of an Excel spreadsheet for easy reading and use.

[0037] In this embodiment, the message to be parsed is a message transmitted from the bus that needs to be parsed. Further, the message to be parsed is transmitted to the vehicle's ECU via the bus. The basic software layer in the ECU passes the message to be parsed to the middleware, and the signal parsing module in the middleware completes the signal parsing, obtains the signal physical value corresponding to the message to be parsed, and passes the signal physical value to the application layer for calling.

[0038] In this embodiment, the preset communication matrix defines the types of information. However, the information storage capacity of a single message is limited. Therefore, a preset communication matrix typically corresponds to multiple types of messages, and each type of message is configured with a corresponding identifier to distinguish between them. To facilitate more convenient and accurate message parsing, multiple message parsing interfaces are pre-configured in the signal parsing module, with different message parsing interfaces corresponding to different types of messages. Through the message parsing interfaces, the specific parsing methods for different types of messages can be further clarified, thus improving the accuracy of message parsing.

[0039] Step 102: Based on the first identifier contained in the message to be parsed, determine the message parsing interface corresponding to the message to be parsed. The message parsing interface is configured with a signal parsing algorithm based on a preset communication matrix. The signal parsing algorithm is used to realize the direct conversion between the signal unpacking value and the signal physical value based on the preset communication matrix.

[0040] In this embodiment, after obtaining the message to be parsed, the first identifier in the message can be obtained, thus clarifying the specific type of the message. Among the various message parsing interfaces pre-configured for different messages, the message parsing interface corresponding to the message to be parsed is determined by the first identifier.

[0041] In this embodiment, according to the rules defined by the preset communication matrix, a signal parsing algorithm is pre-configured in each message parsing interface. This signal parsing algorithm can directly convert the signal unpacking value of the message into the signal physical value without the need for additional conversion of the base database (DBC) file. The message parsing logic is the same in each message parsing interface, but the specific parameter types and parameters configured on top of the logic are different depending on the type of message.

[0042] Step 103: Call the message parsing interface corresponding to the message to be parsed, parse the signal unpacking value corresponding to the message to be parsed, and obtain the signal physical value corresponding to the message to be parsed.

[0043] In this embodiment, the message parsing interface corresponding to the message to be parsed is determined, and the signal parsing algorithm configured for that interface is run to directly convert the signal unpacking value corresponding to the message into the signal physical value. Furthermore, the middleware passes the signal physical value corresponding to the message to be parsed to the application layer for application-level invocation.

[0044] In one embodiment, if the messages involved in the vehicle signal parsing process include local area network (CAN) messages and Ethernet (ETH) messages, then the CAN message receiving interface and the Ethernet message receiving interface are pre-configured in the signal parsing module.

[0045] The system receives messages to be parsed based on a preset communication matrix, specifically as follows: It receives LAN messages to be parsed based on a LAN communication matrix through a LAN message receiving interface, wherein the LAN communication matrix includes at least one LAN identifier, and each LAN identifier corresponds to a LAN message parsing interface; or, it receives Ethernet messages to be parsed based on an Ethernet communication matrix through an Ethernet message receiving interface, wherein the Ethernet communication matrix includes at least one parameter group number, and each parameter group number corresponds to an Ethernet message parsing interface.

[0046] In this embodiment, the message parsing process is further refined logically based on the different characteristics of CAN messages and ETH messages. Specifically, different message receiving interfaces are configured in the signal parsing module, namely a local area network (LAN) message receiving interface and an Ethernet message receiving interface. The LAN message receiving interface is used to receive CAN messages, and the Ethernet message receiving interface is used to receive ETH messages.

[0047] In this embodiment, corresponding communication matrices are pre-configured for CAN messages and ETH messages respectively. Specifically, a local area network communication matrix is ​​pre-configured for CAN messages, and an Ethernet communication matrix is ​​pre-configured for ETH messages.

[0048] In this embodiment, the local area network (LAN) communication matrix reflects information such as the start bit, precision, offset, maximum and minimum values ​​of the signal. For example, the LAN communication matrix example shown in Table 1 is as follows:

[0049] Table 1 Example of a Local Area Network Communication Matrix

[0050]

[0051]

[0052]

[0053]

[0054] In this embodiment, the Ethernet communication matrix is ​​similar to the LAN communication matrix, but it adds the frame header information required for Ethernet communication, including the Media Access Control (MAC) layer, network layer, and transport layer. An Ethernet packet consists of several Parameter Group Number (PGN) data packets. Preferably, a PGN packet is 10 bytes long, including 2 bytes of PGN and 8 bytes of data, where several signals are arranged in the data. The Ethernet communication matrix is ​​similar to the LAN communication matrix, reflecting information such as the start bit, precision, offset, maximum and minimum values ​​of the signals. For example, the Ethernet communication matrix example shown in Table 2 is as follows:

[0055] Table 2 Examples of Ethernet Communication Matrix

[0056]

[0057]

[0058]

[0059] In this embodiment, each type of CAN message in the LAN communication matrix corresponds to a unique LAN identifier. Based on each LAN identifier, a LAN message parsing interface corresponding to each LAN identifier is pre-configured in the signal parsing module, thereby achieving accurate parsing of various types of CAN messages. For each PGN packet in the ETH message, each PGN packet corresponds to a Parameter Group Number (PGN). Based on each Parameter Group Number, a LAN message parsing interface corresponding to each Parameter Group Number is pre-configured in the signal parsing module, thereby achieving accurate parsing of various PGN packets.

[0060] In one embodiment, the packet parsing interface corresponding to the packet to be parsed is determined based on the first identifier contained in the packet to be parsed, specifically as follows: the LAN packet parsing interface corresponding to the LAN packet to be parsed is determined based on the first LAN identifier contained in the LAN packet to be parsed, wherein the LAN identifier includes the first LAN identifier; or, the Ethernet packet to be parsed is split into at least one parameter group data packet, and each parameter group data packet is processed sequentially as follows: the Ethernet packet parsing interface corresponding to the parameter group data packet is determined based on the first parameter group number contained in the parameter group data packet, wherein the parameter group number includes the first parameter group number.

[0061] In this embodiment, based on the first LAN identifier contained in the LAN packet to be parsed, the LAN packet parsing interface corresponding to the LAN packet to be parsed is determined, and then the LAN packet parsing interface is called to parse the CAN packet. For ETH packets, the ETH packet first needs to be unpacked to obtain at least one parameter group data packet (PGN packet), and then the ETH packet is parsed based on the Ethernet packet parsing interface corresponding to the PGN packet.

[0062] In this embodiment, the bit order of CAN message transmission is as follows: the bit order on the CAN bus is big-endian (msb), that is, the high-order bit (msb) of the byte is transmitted first, and the low-order bit (lsb) of the byte is transmitted last.

[0063] CAN message transmission byte order: Generally adopts Intel format, which is similar to the little-endian format (LSB) of the chip. The low byte (byte0) is transmitted first, followed by the high byte (byte7). When transmitting, storing and reading, the high-order bits of the signal are placed in the high-order bits of the high byte, and the low-order bits of the signal are placed in the low-order bits of the low byte. The start bit of the signal is the low-order bit of the low byte.

[0064] In one example, in a CAN message {11, 22, 33, 44, 55, 66, 77, 88}, a certain signal starts from the 8th bit and is 16 bits long. The signal value should be 3322 instead of 2233 (22 is the low byte, which is at the beginning of the message).

[0065] In another example, such as Figure 2 As shown, a signal has a start bit of 3 and a length of 10. The rule for reading this signal is: 3 is the low bit (start bit) of the signal's physical value, up to the high bit of the 12-bit signal physical value.

[0066] In this embodiment, after the ETH message is split into PGN packets, the reading and writing method of the PGN packets is the same as that of the CAN message. Through the above, the signal unpacking value corresponding to the message can be obtained. After obtaining the signal unpacking value, the signal can be parsed according to the signal parameters to obtain the signal physical value, which is then passed to the application layer. The signal physical value is calculated as: signal unpacking value * signal precision + signal offset.

[0067] In a specific embodiment, such as Figure 3 As shown, the detailed process of CAN message parsing is as follows:

[0068] Step 301: The middleware layer receives the CAN message to be parsed and enters the CAN receive interrupt;

[0069] Step 302: Read the received CAN message to be parsed (i.e., the local area network message to be parsed), run the CANMatrix_ReceiveMsg() interface, and update the received CAN message to be parsed to the static variable rx_canMsg;

[0070] Among them, the CANMatrix_ReceiveMsg() interface is a local area network message receiving interface pre-configured in the algorithm parsing module; the static variable rx_canMsg is pre-configured in the algorithm parsing module and is used to temporarily store the data of the CAN message;

[0071] Step 303: Run the CANMatrix_Step_Rx() interface. Based on the CAN ID (i.e., the first identifier) ​​in rx_canMsg, poll the CAN message parsing and encapsulation interface list CANMatrix_List and enter the corresponding local area network message parsing interface.

[0072] Among them, the message parsing and encapsulation interface list CANMatrix_List is a list of local area network message parsing interfaces corresponding to each type of CAN message that is pre-configured in the algorithm parsing module according to the type (i.e., identifier) ​​of the CAN message; the CANMatrix_Step_Rx() interface is a local area network message receiving sub-interface, which is mainly used to poll the CAN message parsing / encapsulation interface list CANMatrix_List to determine the local area network message parsing interface corresponding to the CAN ID;

[0073] Step 304: Run the LAN message parsing interface msgToVariable(), input the received CAN message to be parsed, and finally output the signal physical value (already assigned to a global variable) corresponding to the CAN message to be parsed for use by the application layer and other modules;

[0074] Step 305: Exit CAN receive interrupt.

[0075] In a specific embodiment, such as Figure 4 As shown, the detailed process of ETH message parsing is as follows:

[0076] Step 401, Vehicle Ethernet receive callback function;

[0077] Step 402: Call the Ethernet message receiving interface to pass the ETH data to the Ethernet signal parsing and receiving function;

[0078] The ETH data includes ETH messages to be parsed (i.e., Ethernet messages to be parsed);

[0079] Step 403: Poll the list of Ethernet structures for the ETH message to be parsed based on the Ethernet identifier;

[0080] Step 404: Determine whether an ETH message to be parsed has been found. If not, continue with the polling process in step 403. If yes, proceed to step 405.

[0081] Step 405: Start traversing each PGN packet according to the number of PGNs in the Ethernet list;

[0082] Step 406: Extract a PGN packet from the ETH message to be parsed;

[0083] Step 407: Call the Ethernet packet parsing interface corresponding to the PGN packet to perform signal parsing;

[0084] Step 408: Determine whether all PGN packages have been traversed. If not, proceed to step 405 to process the next PGN package. If yes, proceed to step 409.

[0085] Step 409: Merge the parsing results of all PGN packets and output the signal physical value corresponding to the ETH message to be parsed.

[0086] In a specific embodiment, such as Figure 5 As shown, the signal analysis process in step 407 above is as follows:

[0087] Step 501, input the PGN packet;

[0088] Step 502: Extract the PGN (i.e., the first parameter group number) and data from the PGN packet;

[0089] Step 503: Start polling the PGN packet structure list based on PGN;

[0090] Step 504: Determine if the corresponding PGN packet is found. If not, proceed to step 503 and continue the polling process. If yes, proceed to step 505.

[0091] Step 505: Call the Ethernet packet parsing interface corresponding to the PGN packet;

[0092] Step 506: Call the packet-to-signal function corresponding to the Ethernet packet parsing interface;

[0093] Step 507: Assign values ​​to the global variables of the signal to obtain the signal physical values ​​corresponding to the PGN packet.

[0094] In one embodiment, such as Figure 6 As shown, the vehicle signal parsing method includes a signal encapsulation process, as detailed below:

[0095] Step 601: When the message sending condition is triggered, obtain the second identifier corresponding to the message to be encapsulated, wherein different types of messages correspond to different message encapsulation interfaces;

[0096] Step 602: Based on the second identifier, determine the message encapsulation interface corresponding to the message to be encapsulated, wherein the message encapsulation interface is configured with a signal parsing algorithm;

[0097] Step 603: Call the message encapsulation interface corresponding to the message to be encapsulated, encapsulate the signal physical value corresponding to the second identifier, and obtain the signal unpacking value corresponding to the message encapsulation interface;

[0098] Step 604: Obtain the encapsulated message based on the signal unpacking value corresponding to the message encapsulation interface.

[0099] In this embodiment, in contrast to the signal parsing process provided in the above embodiment, when the application layer updates the signal physical value, the middleware encapsulates the updated signal physical value into a message and transmits the message to the bus through the basic software layer to facilitate vehicle control.

[0100] In this embodiment, similar to the message parsing process, the signal parsing module pre-configures multiple message encapsulation interfaces to handle the encapsulation of various message types. Each message encapsulation interface is configured with the logic of a signal parsing algorithm to directly convert the physical value of the signal into the unpacked value, thereby obtaining the encapsulated message. The encapsulation logic of each message encapsulation interface is the same, but they are configured with parameter types and other information corresponding to the message type to more effectively complete the message encapsulation.

[0101] In one embodiment, for the encapsulation process of CAN messages and ETH messages, the signal parsing module pre-configures the LAN message sending interface and the Ethernet message sending interface.

[0102] When the message sending condition is triggered, the second identifier corresponding to the message to be encapsulated is obtained, specifically as follows: When the LAN message sending condition is triggered, the second LAN identifier corresponding to the LAN message to be encapsulated is obtained through the LAN message sending interface. The LAN communication matrix includes at least one LAN identifier, each LAN identifier corresponds to a LAN message encapsulation interface, and the LAN identifier includes the second LAN identifier; or, when the Ethernet message sending condition is triggered, at least one second parameter group number corresponding to the Ethernet message to be encapsulated is obtained through the Ethernet message sending interface. The Ethernet communication matrix includes at least one parameter group number, each parameter group number corresponds to an Ethernet message encapsulation interface, and the parameter group number includes the second parameter group number.

[0103] In this embodiment, the message encapsulation process is further refined logically based on the different characteristics of CAN messages and ETH messages. Specifically, different message receiving interfaces are configured in the signal parsing module, namely a LAN message sending interface and an Ethernet message sending interface. The LAN message sending interface is used to obtain the second LAN identifier corresponding to the LAN message to be encapsulated, and the Ethernet message sending interface is used to obtain at least one second parameter group number corresponding to the Ethernet message to be encapsulated.

[0104] In this embodiment, each type of CAN message in the LAN communication matrix corresponds to a unique LAN identifier. Based on each LAN identifier, the LAN message encapsulation interface corresponding to each LAN identifier is pre-configured in the signal parsing module, thereby achieving accurate encapsulation of various types of CAN messages. For each PGN packet in the ETH message, each PGN packet corresponds to a parameter group number (PGN). Based on each parameter group number, the Ethernet message encapsulation interface corresponding to each parameter group number is pre-configured in the signal parsing module, thereby achieving accurate encapsulation of various PGN packets.

[0105] In this embodiment, the encapsulation process triggering conditions for CAN messages and ETH messages can be set accordingly. For example, the local area network message sending condition is when the periodic / enabled CAN message timer reaches a threshold, or when an event-type CAN message event is triggered.

[0106] In one embodiment, the packet encapsulation interface corresponding to the packet to be encapsulated is determined based on the second identifier, specifically as follows: the LAN packet encapsulation interface corresponding to the LAN packet to be encapsulated is determined based on the second LAN identifier; or, the Ethernet packet encapsulation interface corresponding to each second parameter group number is determined based on the second parameter group number.

[0107] The message encapsulation interface corresponding to the message to be encapsulated is called to encapsulate the physical value of the signal corresponding to the second identifier, and the signal unpacking value corresponding to the message encapsulation interface is obtained. Specifically, the LAN message encapsulation interface corresponding to the LAN message to be encapsulated is called to encapsulate the physical value of the signal corresponding to the second LAN identifier, and the signal unpacking value corresponding to the LAN message to be encapsulated is obtained; or, the Ethernet message encapsulation interface corresponding to each second parameter group number is called sequentially to encapsulate the physical value of the signal corresponding to each second parameter group number, and the parameter group data packets corresponding to each second parameter group number are obtained. The data packets of each parameter group are merged to obtain the signal unpacking value corresponding to the Ethernet message to be encapsulated.

[0108] In this embodiment, based on the CAN message and PGN packet reading and writing method provided in the above embodiment, after the application layer updates the signal physical value, it can encapsulate the signal according to the signal parameters to obtain the signal unpacking value, and then obtain the message. The signal unpacking value = (signal physical value - signal offset) / signal precision.

[0109] In this embodiment, based on the second LAN identifier, the LAN packet encapsulation interface corresponding to the LAN packet to be encapsulated is determined. This LAN packet encapsulation interface then encapsulates the signal physical value corresponding to the second LAN identifier. For ETH packets, since an ETH packet contains multiple PGN packets, after determining the Ethernet packet encapsulation interface corresponding to each second parameter group number, the signal physical value corresponding to each second parameter group number needs to be encapsulated separately to obtain the parameter group data packet corresponding to each second parameter group number. Finally, each parameter group data packet is merged to obtain the signal unpacking value corresponding to the Ethernet packet to be encapsulated.

[0110] In a specific embodiment, such as Figure 7 As shown, the detailed process of CAN message encapsulation is as follows:

[0111] Step 701: Trigger the LAN message sending conditions (periodic / enabled message timer reaches the threshold, event-type message event is triggered), and run the CANMatrix_SendMsg() interface;

[0112] Among them, the CANMatrix_SendMsg() interface is a local area network message sending interface pre-configured in the algorithm parsing module;

[0113] Step 702: Run the CANMatrix_Step_Tx() interface. Based on the CAN ID (second identifier) ​​to be sent, poll the CANMatrix_List message parsing / encapsulation interface list and enter the corresponding message encapsulation interface.

[0114] Among them, the message parsing / encapsulation interface list CANMatrix_List is a list of local area network message parsing interfaces corresponding to each type of CAN message that is pre-configured in the algorithm parsing module according to the type (i.e., identifier) ​​of the CAN message; the CANMatrix_Step_Tx() interface is a local area network message sending sub-interface, which is mainly used to poll the CAN message parsing / encapsulation interface list CANMatrix_List to determine the local area network message encapsulation interface corresponding to the CAN ID;

[0115] Step 703: Run the LAN packet encapsulation interface variableToMsg(), input the signal physical value (global variable assignment has been completed), obtain the signal unpacking value corresponding to the LAN packet to be encapsulated, and then obtain the encapsulated LAN packet. Finally, the basic software layer sends the encapsulated LAN packet with data to the bus through the Can_Transmitted() interface.

[0116] Can_Transmitted() is a CAN message transmission interface pre-configured in the basic software layer.

[0117] In a specific embodiment, such as Figure 8 As shown, the detailed process of ETH message encapsulation is as follows:

[0118] Step 801: When the Ethernet packet sending condition is triggered, the signal group packet sending function is called through the Ethernet packet sending interface to obtain at least one second parameter group number corresponding to the Ethernet packet to be encapsulated.

[0119] Step 802: Start polling the list of Ethernet structures based on the Ethernet identifier;

[0120] Step 803: Determine whether a corresponding Ethernet packet to be encapsulated has been found. If not, proceed to step 802. If yes, proceed to step 804.

[0121] Step 804: Call the signal group packet function;

[0122] Step 805: The encapsulated Ethernet packet is passed to the basic software layer, and the encapsulated Ethernet packet is transmitted to the bus through the Ethernet packet sending function configured in the basic software layer.

[0123] In a specific embodiment, such as Figure 9 As shown, the signal encapsulation process in step 804 above is as follows:

[0124] Step 901, enter all the second parameter group numbers;

[0125] Step 902: Start polling the PGN packet structure list based on the second parameter group number;

[0126] Step 903: Determine if the corresponding PGN package is found. If not, proceed to step 902 to continue searching for the next PGN package. If yes, proceed to step 904.

[0127] Step 904: Iterate through the Ethernet list according to the number of PGNs.

[0128] Step 905: Call the Ethernet packet encapsulation interface number to packet function to obtain the PGN packet;

[0129] Step 906: Merge the PGN packets into the Ethernet packet to be encapsulated;

[0130] Step 907: Determine whether all PGN packets have been traversed. If not, proceed to step 904; if yes, proceed to step 908.

[0131] Step 908: Obtain the signal unpacking value corresponding to the Ethernet packet to be encapsulated, and obtain the encapsulated Ethernet packet.

[0132] In a specific embodiment, such as Figure 10 As shown, the CAN message signal parsing and encapsulation process is as follows:

[0133] The basic software layer transmits CAN messages from the bus to the middleware. Upon receiving the CAN message, the middleware's onboard controller parses the message to obtain the physical values ​​of signals 1, 2, ..., n, for use by the application layer. If the application layer updates the physical values, the onboard controller encapsulates the updated values ​​to obtain a packaged CAN message, which is then transmitted to the basic software layer, which in turn transmits the CAN message to the bus.

[0134] In a specific embodiment, such as Figure 11 As shown, the ETH message signal parsing and encapsulation process is as follows:

[0135] The basic software layer transmits the ETH messages from the bus to the middleware. Upon receiving the ETH message, the middleware first unpacks it to obtain PGN packets. The vehicle controller then parses these PGN packets to obtain the physical values ​​of signals 1, 2, ..., n, for use by the application layer. If the application layer updates the physical values, the vehicle controller encapsulates the updated signals 1, 2, ..., n to obtain individual PGN packets. These PGN packets are then merged to obtain the encapsulated ETH message, which is then transmitted to the basic software layer. The basic software layer then transmits the CAN message to the bus.

[0136] In one embodiment, the signal parsing module for implementing the above-mentioned vehicle signal parsing method needs to be pre-configured in the vehicle controller. In the process of functional modeling at the automotive application layer, the current signal parsing method is performed at the automotive application layer, requiring manual input of signal-related parameters into MATLAB for modeling. This process is cumbersome and prone to errors. As the number of ECUs in a car increases and the amount of vehicle CAN communication data grows, the signal parsing code generated by MATLAB modeling is large in size, has low execution efficiency, and is difficult to maintain, making it difficult to meet the needs of agile development. Currently, OEM designers convert the CAN communication matrix into a DBC database file and then release it to component suppliers. This method is not suitable for ETH communication.

[0137] To avoid the above problems, such as Figure 12 The development process of the signal parsing module used in the above embodiments is as follows:

[0138] Step 1201: Based on the preset communication matrix, obtain the signal parsing template according to the conversion relationship between the signal unpacking value and the signal physical value;

[0139] Step 1202: Based on the preset communication matrix, configure at least one conversion unit of the conversion auxiliary tool, wherein the conversion auxiliary tool is used to convert the preset communication matrix into corresponding machine code;

[0140] Step 1203: Input the preset communication matrix and signal analysis template into the conversion auxiliary tool to obtain the machine code corresponding to the signal analysis module.

[0141] Since the preset communication matrix contains a large amount of information, it requires the use of various message types for information transmission. Therefore, one preset communication matrix corresponds to multiple message types. However, the basic processing logic of the signal parsing algorithm is essentially the same for all message types. Therefore, to improve development efficiency, a signal parsing template is generated based on the processing logic provided by the vehicle signal parsing method in the above embodiments. This template only contains the processing procedures for representative message types in the preset communication matrix. Furthermore, based on the preset communication matrix, at least one conversion unit of the conversion auxiliary tool is configured, mainly to configure the parameter types and other information of each message type in the preset communication matrix. Finally, by inputting the preset communication matrix and the signal parsing template into the conversion auxiliary tool, the machine code corresponding to the signal parsing module can be directly obtained. This machine code is then written into the vehicle controller to complete the configuration of the signal parsing module.

[0142] In one embodiment, the conversion unit includes fixed code, signal parameter declaration, message parsing and encapsulation interface declaration, signal physical value initialization, signal parameter initialization, message parsing and encapsulation interface list, and message parsing and encapsulation interface definition.

[0143] In this embodiment, a conversion auxiliary tool can be developed based on the signal analysis template. Preferably, this conversion auxiliary tool is used to convert the communication matrix into C language code. The functions implemented by each conversion unit in the conversion auxiliary tool are as follows:

[0144] The fixed code is the code that is unrelated to the preset communication matrix during the implementation of the conversion auxiliary tool; this part of the code remains unchanged.

[0145] The signal parameter declaration defines the parameter type of the message signal based on the preset communication matrix;

[0146] The message parsing and encapsulation interface declaration defines the functions for message parsing and encapsulation, that is, the calculation functions between the unpacked signal value and the physical signal value;

[0147] The initial values ​​of the signal physical values ​​are defined based on a preset communication matrix.

[0148] The signal parameter initialization defines the initial values ​​of the message parameters based on the preset communication matrix;

[0149] The message parsing and encapsulation interface list defines a list of multiple message parsing interfaces and message encapsulation interfaces corresponding to different types of messages;

[0150] The message parsing and encapsulation interface is defined as the specific implementation of each message parsing interface and message encapsulation interface.

[0151] In a specific example, the signal parameter initialization section is as follows:

[0152]

[0153]

[0154] Each message generates a structure; the part before _Prop is {message name}; the part in the middle of _Prop_List is {message name}; the curly braces contain the signal's {start bit}, {length}, {precision}, {offset}, {...} and other information.

[0155] The conversion templates for other conversion units are similar to those described above.

[0156] In one embodiment, a signal parsing template is obtained based on a preset communication matrix and according to the conversion relationship between the signal unpacking value and the signal physical value, specifically as follows: a local area network (LAN) signal parsing template is obtained based on a LAN communication matrix and according to the LAN conversion relationship between the signal unpacking value and the signal physical value; and an Ethernet signal parsing template is obtained based on an Ethernet communication matrix and according to the Ethernet conversion relationship between the signal unpacking value and the signal physical value.

[0157] Based on a preset communication matrix, configure at least one conversion unit of the conversion assistance tool as follows: Based on a local area network communication matrix and an Ethernet communication matrix, configure at least one conversion unit of the conversion assistance tool.

[0158] Input the preset communication matrix and signal analysis template into the conversion aid tool to obtain the machine code corresponding to the signal analysis module, as follows: Input the LAN communication matrix, Ethernet communication matrix, LAN signal analysis template and Ethernet signal analysis template into the conversion aid tool to obtain the machine code corresponding to the signal analysis module.

[0159] In this embodiment, the preset communication matrix includes a preset local area network (LAN) communication matrix and a preset Ethernet communication matrix. Therefore, during the development of the algorithm parsing module, configuration is performed simultaneously based on the preset LAN communication matrix and the preset Ethernet communication matrix.

[0160] In this embodiment, application layer function development does not require consideration of signal parsing implementation, thus decoupling the application layer functional logic from the signal parsing module. Functional module development does not need to focus on signal parsing and encapsulation processes; signals are directly used as inputs and outputs, requiring only consideration of functional logic. When the communication matrix is ​​updated, the functional model does not need modification, improving the efficiency of function development. The communication matrix can be directly converted into signal parsing code, skipping the intermediate database file step, simplifying the development process, and enabling agile development of the ECU communication module. It supports the conversion of CAN and ETH communication matrices to C code, providing a unified signal parsing method for vehicle CAN and ETH messages, simplifying the development process, and providing a foundation for subsequent high-bandwidth and SOA implementations. It reduces ECU memory usage, improves execution efficiency, and reduces the real-time requirements of function execution.

[0161] The vehicle signal parsing method provided by this invention receives a message to be parsed based on a preset communication matrix through a pre-configured signal parsing module in the vehicle controller. The preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces. Based on a first identifier contained in the message to be parsed, the message parsing interface corresponding to the message to be parsed is determined. The message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix. The signal parsing algorithm is used to directly convert between the unpacked signal value and the physical signal value based on the preset communication matrix. The message parsing interface corresponding to the message to be parsed is called to parse the unpacked signal value corresponding to the message to be parsed, thereby obtaining the physical signal value corresponding to the message to be parsed. In the above process, the signal parsing module is directly configured in the vehicle's local on-board controller. Through this signal parsing module, the parsing of the message to be parsed can be completed directly based on the preset communication matrix. There is no need to perform DBC file conversion and C language code conversion on the preset communication matrix in advance. Instead, the signal parsing module configured in the on-board controller directly realizes the conversion between the signal unpacking value of the message to be parsed and the physical unpacking value used by the application layer based on the preset communication matrix. This avoids redundant processing of the preset communication matrix, simplifies the message signal parsing process, and improves the parsing efficiency of the on-board signal.

[0162] Furthermore, during the development of the signal parsing module, the preset communication matrix was directly converted into C language code using a code-assistance tool and then integrated into the vehicle controller to perform the same function. It also uniformly resolved the issue of message signal parsing for both CAN and Ethernet networks.

[0163] The vehicle provided by this invention is described below. The vehicle described below can be referred to in correspondence with the vehicle-mounted signal parsing method described above, and repeated details will not be repeated. The vehicle includes an on-board controller, which is pre-configured with a signal parsing module. The signal parsing module in the on-board controller is used to receive a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one message, and different types of messages correspond to different message parsing interfaces. Based on a first identifier contained in the message to be parsed, the message parsing interface corresponding to the message to be parsed is determined, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix. The signal parsing algorithm is used to realize the direct conversion between the unpacked signal value and the physical signal value based on the preset communication matrix. The message parsing interface corresponding to the message to be parsed is called to parse the unpacked signal value corresponding to the message to be parsed to obtain the physical signal value corresponding to the message to be parsed.

[0164] In one embodiment, the vehicle further includes a bus; the on-board controller includes an application layer, middleware, and a basic software layer; a signal parsing module is configured in the middleware; the basic software layer is used to acquire the message to be parsed through the bus and transmit the message to be parsed to the middleware; the middleware is used to transmit the physical signal value obtained by the signal parsing module to the application layer; the application layer is used to acquire the physical signal value transmitted by the middleware.

[0165] In one embodiment, the application layer is further configured to pass the second identifier corresponding to the message to be encapsulated to the middleware when the message sending condition is triggered; the signal parsing module in the middleware is configured to obtain the second identifier corresponding to the message to be encapsulated when the message sending condition is triggered, wherein different types of messages correspond to different message encapsulation interfaces; determine the message encapsulation interface corresponding to the message to be encapsulated based on the second identifier, wherein the message encapsulation interface is configured with a signal parsing algorithm; call the message encapsulation interface corresponding to the message to be encapsulated to encapsulate the signal physical value corresponding to the second identifier to obtain the signal unpacking value corresponding to the message encapsulation interface; obtain the encapsulated message based on the signal unpacking value corresponding to the message encapsulation interface; the middleware is configured to pass the encapsulated message to the basic software layer; the basic software layer is configured to transmit the encapsulated message to the bus.

[0166] Below, based on the vehicle signal parsing method and vehicle provided above, Figure 13 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 13 As shown, the electronic device may include a processor 1301, a communication interface 1302, a memory 1303, and a communication bus 1304. The processor 1301, communication interface 1302, and memory 1303 communicate with each other via the communication bus 1304. The processor 1301 can call logical instructions in the memory 1303 to execute an on-board signal parsing method. This method includes: receiving a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces; determining the message parsing interface corresponding to the message to be parsed based on a first identifier contained in the message to be parsed, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix, the signal parsing algorithm being used to directly convert between signal unpacking values ​​and signal physical values ​​based on the preset communication matrix; and calling the message parsing interface corresponding to the message to be parsed to parse the signal unpacking values ​​corresponding to the message to be parsed, thereby obtaining the signal physical values ​​corresponding to the message to be parsed.

[0167] Furthermore, the logical instructions in the aforementioned memory 1303 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0168] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the vehicle signal parsing method provided in the above embodiments, the method including: receiving a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one message, and different types of messages correspond to different message parsing interfaces; determining the message parsing interface corresponding to the message to be parsed based on a first identifier contained in the message to be parsed, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix, the signal parsing algorithm being used to realize the direct conversion between signal unpacking value and signal physical value based on the preset communication matrix; calling the message parsing interface corresponding to the message to be parsed, parsing the signal unpacking value corresponding to the message to be parsed, and obtaining the signal physical value corresponding to the message to be parsed.

[0169] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the vehicle signal parsing method provided in the above embodiments. The method includes: receiving a message to be parsed based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one type of message, and different types of messages correspond to different message parsing interfaces; determining a message parsing interface corresponding to the message to be parsed based on a first identifier contained in the message to be parsed, wherein the message parsing interface is configured with a signal parsing algorithm based on the preset communication matrix, the signal parsing algorithm being used to directly convert between signal unpacking values ​​and signal physical values ​​based on the preset communication matrix; and calling the message parsing interface corresponding to the message to be parsed to parse the signal unpacking values ​​corresponding to the message to be parsed, thereby obtaining the signal physical values ​​corresponding to the message to be parsed.

[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0171] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A vehicle-mounted signal analysis method characterized by comprising: The application is applied to a pre-configured signal analysis module in a vehicle-mounted controller, the vehicle-mounted controller comprises an application layer, a middleware and a basic software layer, the signal analysis module is configured in the middleware, and the method comprises the following steps: receiving a to-be-analyzed message based on a preset communication matrix, wherein the preset communication matrix corresponds to at least one message, different types of messages correspond to different message analysis interfaces; determining the message analysis interface corresponding to the to-be-analyzed message based on a first identifier contained in the to-be-analyzed message, wherein the message analysis interface is configured with a signal analysis algorithm based on the preset communication matrix, and the signal analysis algorithm is used to realize direct conversion between a signal unpacked value and a signal physical value based on the preset communication matrix; calling the message analysis interface corresponding to the to-be-analyzed message to analyze the signal unpacked value corresponding to the to-be-analyzed message, and obtaining the signal physical value corresponding to the to-be-analyzed message; wherein the signal analysis module provides the signal physical value to the application layer through the middleware, thereby realizing decoupling of the application layer and the analysis process of the to-be-analyzed message; the development process of the signal analysis module is as follows: based on the preset communication matrix, a signal analysis template is obtained according to the conversion relationship between the signal unpacked value and the signal physical value; based on the preset communication matrix, at least one conversion unit of a conversion auxiliary tool is configured, wherein the conversion auxiliary tool is used to convert the preset communication matrix into corresponding machine code; the preset communication matrix and the signal analysis template are input into the conversion auxiliary tool to obtain machine code corresponding to the signal analysis module.

2. The in-vehicle signal analysis method according to claim 1, characterized by, The method further comprises: when a message sending condition is triggered, a second identifier corresponding to a to-be-encapsulated message is obtained, wherein different types of messages correspond to different message encapsulation interfaces; based on the second identifier, the message encapsulation interface corresponding to the to-be-encapsulated message is determined, wherein the message encapsulation interface is configured with the signal analysis algorithm; the message encapsulation interface corresponding to the to-be-encapsulated message is called to encapsulate the signal physical value corresponding to the second identifier, and the signal unpacked value corresponding to the message encapsulation interface is obtained; based on the signal unpacked value corresponding to the message encapsulation interface, an encapsulated message is obtained.

3. The in-vehicle signal analysis method according to claim 1, characterized by, The signal analysis module comprises a local area network message receiving interface and an Ethernet message receiving interface; the receiving of the to-be-analyzed message based on the preset communication matrix comprises: through the local area network message receiving interface, a to-be-analyzed local area network message based on a local area network communication matrix is received, wherein the local area network communication matrix comprises at least one local area network identifier, and each local area network identifier corresponds to a local area network message analysis interface; or, through the Ethernet message receiving interface, a to-be-analyzed Ethernet message based on an Ethernet communication matrix is received, wherein the Ethernet communication matrix comprises at least one parameter group number, and each parameter group number corresponds to an Ethernet message analysis interface.

4. The in-vehicle signal analysis method according to claim 3, characterized by, The determining of the message analysis interface corresponding to the message to be analyzed based on the first identifier included in the message to be analyzed comprises: The determining of the LAN message analysis interface corresponding to the LAN message to be analyzed based on the first LAN identifier included in the LAN message to be analyzed, wherein the LAN identifier comprises the first LAN identifier; Or, the LAN message to be analyzed is split into at least one parameter group data packet, and each parameter group data packet is processed in turn as follows: the determining of the Ethernet message analysis interface corresponding to the parameter group data packet based on the first parameter group number included in the parameter group data packet, wherein the parameter group number comprises the first parameter group number.

5. The in-vehicle signal analysis method according to claim 2, characterized by, The signal analysis module comprises a LAN message sending interface and an Ethernet message sending interface; The obtaining of the second identifier corresponding to the message to be encapsulated when the message sending condition is triggered comprises: The obtaining of the second LAN identifier corresponding to the LAN message to be encapsulated through the LAN message sending interface when the LAN message sending condition is triggered, wherein the LAN communication matrix comprises at least one LAN identifier, each LAN identifier corresponds to a LAN message encapsulation interface, and the LAN identifier comprises the second LAN identifier; Or, the obtaining of at least one second parameter group number corresponding to the Ethernet message to be encapsulated through the Ethernet message sending interface when the Ethernet message sending condition is triggered, wherein the Ethernet communication matrix comprises at least one parameter group number, each parameter group number corresponds to an Ethernet message encapsulation interface, and the parameter group number comprises the second parameter group number.

6. The in-vehicle signal analysis method according to claim 5, characterized by, The determining of the message encapsulation interface corresponding to the message to be encapsulated based on the second identifier comprises: The determining of the LAN message encapsulation interface corresponding to the LAN message to be encapsulated based on the second LAN identifier; Or, the determining of the Ethernet message encapsulation interface corresponding to each second parameter group number based on the second parameter group number; The encapsulation of the signal physical value corresponding to the second identifier by calling the message encapsulation interface corresponding to the message to be encapsulated to obtain the signal unpacking value corresponding to the message encapsulation interface comprises: The encapsulation of the signal physical value corresponding to the second LAN identifier by calling the LAN message encapsulation interface corresponding to the LAN message to be encapsulated to obtain the signal unpacking value corresponding to the LAN message to be encapsulated; Or, the encapsulation of the signal physical value corresponding to each second parameter group number by sequentially calling the Ethernet message encapsulation interface corresponding to each second parameter group number to obtain the parameter group data packet corresponding to each second parameter group number, and the merging of each parameter group data packet to obtain the signal unpacking value corresponding to the Ethernet message to be encapsulated.

7. The in-vehicle signal analysis method according to claim 6, characterized by, The conversion unit includes a fixed code, a signal parameter declaration, a message parsing and packaging interface declaration, a signal physical value initialization, a signal parameter initialization, a message parsing and packaging interface list, and a message parsing and packaging interface definition.

8. The in-vehicle signal analysis method according to claim 6, characterized by, The signal analysis template is obtained based on the preset communication matrix and a conversion relationship between the signal unpacking value and the signal physical value. The LAN signal analysis template is obtained based on the LAN communication matrix and a LAN conversion relationship between the signal unpacking value and the signal physical value. The Ethernet signal analysis template is obtained based on the Ethernet communication matrix and an Ethernet conversion relationship between the signal unpacking value and the signal physical value. The at least one conversion unit of the conversion auxiliary tool is configured based on the preset communication matrix. The at least one conversion unit of the conversion auxiliary tool is configured based on the LAN communication matrix and the Ethernet communication matrix. The machine code corresponding to the signal analysis module is obtained by inputting the preset communication matrix and the signal analysis template into the conversion auxiliary tool. The machine code corresponding to the signal analysis module is obtained by inputting the LAN communication matrix, the Ethernet communication matrix, the LAN signal analysis template, and the Ethernet signal analysis template into the conversion auxiliary tool.

9. A vehicle characterized by comprising: The vehicle includes an on-board controller, and the on-board controller is pre-configured with a signal analysis module. The signal analysis module in the on-board controller is configured to receive a to-be-analyzed message based on a preset communication matrix, determine a message analysis interface corresponding to the to-be-analyzed message based on a first identifier contained in the to-be-analyzed message, call the message analysis interface corresponding to the to-be-analyzed message to analyze a signal unpacking value corresponding to the to-be-analyzed message, and obtain a signal physical value corresponding to the to-be-analyzed message. The development process of the signal analysis module is as follows: The signal analysis template is obtained based on the preset communication matrix and a conversion relationship between the signal unpacking value and the signal physical value. The at least one conversion unit of the conversion auxiliary tool is configured based on the preset communication matrix. The machine code corresponding to the signal analysis module is obtained by inputting the preset communication matrix and the signal analysis template into the conversion auxiliary tool. The vehicle also includes a bus.

10. The vehicle of claim 9, wherein, ​ The base software layer is configured to acquire the to-be-resolved message through the bus and deliver the to-be-resolved message to the middleware. The middleware is configured to deliver the signal physical value obtained by the signal resolution module to the application layer. The application layer is configured to acquire the physical signal value delivered by the middleware.

11. The vehicle of claim 10, wherein, The application layer is further configured to deliver a second identifier corresponding to the to-be-encapsulated message to the middleware when a message sending condition is triggered. The signal resolution module in the middleware is configured to acquire a second identifier corresponding to the to-be-encapsulated message when a message sending condition is triggered, wherein different types of messages correspond to different message encapsulation interfaces; determine the message encapsulation interface corresponding to the to-be-encapsulated message based on the second identifier, wherein the message encapsulation interface is configured with the signal resolution algorithm; call the message encapsulation interface corresponding to the to-be-encapsulated message to encapsulate the signal physical value corresponding to the second identifier, obtain the signal unpacking value corresponding to the message encapsulation interface; and acquire an encapsulated message based on the signal unpacking value corresponding to the message encapsulation interface. The middleware is configured to deliver the encapsulated message to the base software layer. The base software layer is configured to deliver the encapsulated message to the bus.

Citation Information

Patent Citations

  • MATLAB / Simulink-based vehicle-mounted bus data analysis method

    CN111556011A

  • Message parsing method and device and vehicle-mounted terminal

    CN111797098A