A vehicle CAN signal abstract application method

CN116633715BActive Publication Date: 2025-02-14AUTOCORE INTELLIGENT TECH (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310586123.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2025-02-14
Estimated Expiration
2043-05-23

AI Technical Summary

Technical Problem

[0002]由于can信号是不同车厂按照标准can格式去定义,从而实现不同车辆功能,导致不同车厂的can信号数量,名称等都是不同的,且can的解析有Inter和Motorola二种格式,较为复杂,对于专注于车身应用的开发人员相对来说很不友好

Benefits of technology

[0034]本发明的有益效果在于,与现有技术相比,本发明提供can信号的收发解析功能,并通过dds进行传输,车厂开发者只需要关注vss标准,通过vss path实现特定功能,极大的减少车身应用开发的复杂度和难度,让车厂开发者更加关注于车身应用本身业务。同时只需要提供不同车厂的dbc文件,车身应用本身不需要进行修改,即可实现无缝对接不同车辆。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633715B_ABST
    Figure CN116633715B_ABST
Patent Text Reader

Abstract

The present invention discloses a vehicle CAN signal abstract application method, which is parsed by inputting DBC files of different car manufacturers, and then abstractly describing the CAN information through the VSS standard, converting it into a VSS path with high readability, and providing an interface to the vehicle body application through DDS. The present invention provides a CAN signal receiving and sending parsing function, and transmits it through DDS. Car manufacturer developers only need to pay attention to the VSS standard and implement specific functions through the VSS path, which greatly reduces the complexity and difficulty of vehicle body application development, allowing car manufacturer developers to pay more attention to the vehicle body application business itself. At the same time, only the DBC files of different car manufacturers need to be provided, and the vehicle body application itself does not need to be modified, so that seamless docking of different vehicles can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to CAN signal processing, and in particular to a vehicle CAN signal abstract application method. Background Art

[0002] Since CAN signals are defined by different car manufacturers according to the standard CAN format to achieve different vehicle functions, the number and names of CAN signals from different car manufacturers are different. In addition, CAN parsing has two formats, Inter and Motorola, which is relatively complicated and relatively unfriendly to developers who focus on body applications. Summary of the invention

[0003] In order to solve the deficiencies in the prior art, the purpose of the present invention is to provide a vehicle CAN signal abstract application method.

[0004] To achieve the purpose of the present invention, the technical solution adopted by the present invention is:

[0005] A vehicle CAN signal abstract application method is provided. DBC files of different car manufacturers are input for parsing. Then, the CAN information is abstractly described through the VSS standard, converted into a more readable VSS path, and an interface is provided to the vehicle body application through DDS.

[0006] Further, the specific steps include:

[0007] (1) Read the car manufacturer's dbc file and generate a CAN information message array;

[0008] (2) Read the mapping.json file of the correspondence between vss and can signals;

[0009] (3) Read the vss description file, parse and store the vss path;

[0010] (4) Open the socket to read the CAN signal;

[0011] (5) Enable the DDS topic and provide the functions of set vss path and get vss path;

[0012] (6) When the CAN signal is received, the message ID is obtained through the CAN frame data header, and the CAN information description file is obtained through the message ID. The byteOrder in the array is distributed to the InterParse and MotorolaParse functions for parsing;

[0013] (7) Find the vss path through the mapping relationship in mapping.json, store it in memory and sqllite, and broadcast it through DDS so that objects interested in the vss path can receive the change information;

[0014] (8) Receive a get request sent through DDS and return the vss value to the requester;

[0015] (9) Receive the set request sent by DDS, store it in memory and sqllite, and find the messageID through mapping.json. Get the values ​​of all CAN signals of the message from the memory through the messageID, assemble it according to the InterParse and MotorolaParse formats, and send the CAN message through the socket.

[0016] Furthermore, the InterParse parsing method is:

[0017] Create a bitset with all bits set to 0 <64> tmp;

[0018] Use a loop from the start bit of signal to the size of signal and set the bit where tmp is located to 1;

[0019] Take the AND result of the received CAN data and tmp, and then left-shift the start bit of signalale to get the value of signalale.

[0020] Furthermore, the MotorolaParse parsing method is:

[0021] Starting from the starting point of the received message, the length is 8 bits. Since the value in dbc is stored in big endian, the value of the parameter is extracted by left shift and right shift.

[0022] The number of left shifts is calculated as:

[0023] moveBit=ABS(startBit–highBit)+lowBit

[0024] The number of right shifts is calculated as:

[0025] If the message length is less than or equal to 8, the message should be right-shifted by (8-signalSize)+64-8.

[0026] If the message length is > 8 and <= 16, the message should be right-shifted by (16-signalSize)+64–16.

[0027] If the message length is >16 and <=32, the message should be right-shifted by (32-signalSize)+64–32.

[0028] If the message length is >32 and <=64, the message should be right-shifted by (64-signalSize)+64–64.

[0029] Further, InterParse format assembly method:

[0030] Shift the value directly to the left to the starting position of signal;

[0031] Just assign the left-shifted value to the 8-byte array.

[0032] Further, the MotorolaParse format assembly method:

[0033] The specific position in the message is calculated, and a 64-bit value is obtained by left shifting. The above operation is performed on all parameters and then added to obtain a complete 64-bit message.

[0034] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides the function of sending, receiving and parsing CAN signals, and transmits them through DDS. The car manufacturer developers only need to pay attention to the VSS standard and implement specific functions through the VSS path, which greatly reduces the complexity and difficulty of body application development, allowing car manufacturer developers to pay more attention to the body application business itself. At the same time, only the DBC files of different car manufacturers need to be provided, and the body application itself does not need to be modified, so that seamless docking of different vehicles can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart of the vehicle CAN signal abstract application method of the present invention;

[0036] Figure 2 This is a schematic diagram of a dbc file;

[0037] Figure 3 This is a diagram of the mapping.json file. DETAILED DESCRIPTION

[0038] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of this application.

[0039] The vehicle CAN signal abstract application method described in the present invention performs parsing by inputting DBC (DataBase for Can) files, i.e., CAN information description files, of different car manufacturers; then, the CAN information is abstractly described through the VSS (Vehicle Signal Specification) standard, converted into a more readable VSS path, and an interface is provided to the vehicle body application through DDS, so that developers can focus more on the development of upper-level vehicle body applications and provide underlying capability support for customized vehicle features.

[0040] like Figure 1 As shown, the vehicle CAN signal abstract application method of the present invention specifically includes the following steps:

[0041] (1) Read the car manufacturer's dbc file and generate a CAN information message array. The dbc file is as follows: Figure 2 ;

[0042] After parsing, the subscript of the array is 322, and the corresponding value is a structure, which is described as follows:

[0043] msgID equals 322

[0044] msgName equals ID142VCLEFT_liftgateStatus

[0045] msgSize is equal to 8

[0046] transmitter equals VehicleBus

[0047] sgNum (number of signals) equals 13

[0048] The signal structure array contains the following information, taking VCLEFT_liftgateStatusIndex as an example:

[0049] The array index is 0

[0050] sgName equals VCLEFT_liftgateStatusIndex

[0051] startBit is equal to 0

[0052] signalSize is equal to 2

[0053] byteOrder is equal to 1 (Inter format, 0 Motorola format)

[0054] valueType equals 1 (0 is unsigned, 1 is signed)

[0055] factor is equal to 1

[0056] Offset is equal to 0

[0057] minValue is equal to 0

[0058] maxValue is equal to 2

[0059] sgUint is an empty string

[0060] receiverNode is Receiver

[0061] (2) Read the mapping.json file of the correspondence between vss and can signals, such as Figure 3 ;

[0062] Figure 3 In the example, sgName: can signal name; messageID: the message ID of the current signal.

[0063] (3) Read the vss description file, parse and store the vss path;

[0064] (4) Open the socket to read the CAN signal;

[0065] (5) Enable the DDS topic and provide the functions of set vss path and get vss path;

[0066] (6) When the CAN signal is received, the message ID is obtained through the CAN frame data header, and the CAN information description file is obtained through the message ID. It is distributed to two functions (InterParse and MotorolaParse) for parsing through the byteOrder in the array;

[0067] InterParse parsing method:

[0068] Create a bitset with all bits set to 0 <64> tmp;

[0069] Use a loop from the start bit of signal to the size of signal and set the bit where tmp is located to 1;

[0070] Take the AND result of the received CAN data and tmp, and then left-shift the start bit of signalale to get the value of signalale.

[0071] The MotorolaParse parsing method is as follows:

[0072] Dbc file content:

[0073] BO_300Window_liftgateStatus:8VehicleBus

[0074] SG_VCRIGHT_wattsDemandEvap M:0|11@0+(1,0)[0|500]""Receiver

[0075] SG_VCRIGHT_hvacEvapEnable m0:12|1@0+(1,0)[0|1]""Receiver

[0076] SG_VCRIGHT_conditioningRequest m0:11|1@0+(1,0)[0|1]""Receiver

[0077] SG_VCRIGHT_tempEvaporator m0:10|11@1+(1,0)[0|4]""Receiver

[0078] SG_VCRIGHT_tempEvaporatorTarget m1:24|8@0-(1,0)[0|300]"deg"Receiver

[0079] SG_VCRIGHT_hvacBlowerSpeedRPMReq m0:32|10@1+(1,0)[0|455]""ReceiverSG_VCRIGHT_havcPerfTestRequest m0:45|1@1+(1,0)[0|1]""Receiver

[0080] SG_VCRIGHT_evapPerformantion m1:44|1@1+(1,0)[0|1]"deg / s"Receiver

[0081] SG_VCRIGHT_ceLow m1:43|8@1+(1,0)[0|256]"deg / s"Receiver

[0082] SG_VCRIGHT_havcheatingEnd m0:51|1@1+(1,0)[0|1]""Receiver

[0083] SG_VCRIGHT_hvacHeatingEnd m0:50|1@1+(1,0)[0|1]""Receiver

[0084] SG_VCRIGHT_hvacPerfTestState m1:48|2@1-(1,0)[0|8]"A"Receiver

[0085] SG_VCRIGHT_hvacUnavaliable m1:63|1@1-(1,0)[0|1]"%"Receiver

[0086] The received message is a 64-bit fixed-length message. The conversion steps are as follows, taking SG_VCRIGHT_ceLow as an example:

[0087] Its starting point in the message is 43, that is, it starts from the 43rd bit of the received message and has a length of 8 bits. However, since the value in dbc is stored in big endian mode, it is necessary to extract the value of the parameter by left shift and right shift.

[0088] The number of left shifts is calculated as:

[0089] moveBit=ABS(startBit–highBit)+lowBit

[0090] The calculation method of highBit is:

[0091] (startBit / 8+1)*8–1

[0092] The calculation method of lowBit is:

[0093] (startBit / 8)*8

[0094] For the above example, it is ABS(43–((43 / 8+1)*8–1))+(43 / 8)*8=44, so we first shift the received message left by 44 bits.

[0095] Then we calculate the number of right shifts. The calculation method is:

[0096] The message end position is calculated as follows:

[0097] If the message length is less than or equal to 8, the number of bits that the message should be shifted is:

[0098] (8–signalSize)+64–8

[0099] For this example, the message should be right-shifted by (8-8)+64–8=54 bits;

[0100] If the message length is > 8 and <= 16, the message should be right-shifted by (16-signalSize)+64–16.

[0101] If the message length is >16 and <=32, the message should be right-shifted by (32-signalSize)+64–32.

[0102] If the message length is >32 and <=64, the message should be right-shifted by (64-signalSize)+64–64.

[0103] Therefore, we shift the message right by 54 bits to obtain the specific value of the parameter.

[0104] (7) Find the vss path through the mapping relationship in mapping.json, store it in memory and sqllite, and broadcast it through DDS so that objects interested in the vss path can receive the change information;

[0105] (8) Receive a get request sent through DDS and return the vss value to the requester;

[0106] (9) Receive the set request sent by DDS, store it in memory and sqllite, and find the messageID through mapping.json. Get the values ​​of all CAN signals of the message from the memory through the messageID, assemble it according to the InterParse and MotorolaParse formats, and send the CAN message through the socket.

[0107] InterParse format assembly method:

[0108] Shift the value directly to the left to the starting position of signal;

[0109] Just assign the left-shifted value to the 8-byte array.

[0110] MotorolaParse format assembly method:

[0111] Take SG_VCRIGHT_conditioningRequest as an example, its value is 410 (00110011010), we need to calculate its specific position in the message, and get a 64-bit value by left shifting. By performing the above operations on all parameters and adding them together, we can get a complete 64-bit message.

[0112] The process is as follows:

[0113] The starting position of SG_VCRIGHT_conditioningRequest is 10 and the length is 11. Therefore, we need to calculate the number of left shifts first, and the result is ABS(10–((10 / 8+1)*8–1))+(10 / 8)*8=13

[0114] The length of the parameter is 11, so the parameter should be left shifted by (64–11-13)=40.

[0115] By processing and adding the values ​​of all parameters as above, a complete 64-bit CAN message can be obtained.

[0116] The present invention provides the function of sending, receiving and parsing CAN signals, and transmits them through DDS. The car manufacturer developers only need to pay attention to the VSS standard and implement specific functions through the VSS path, which greatly reduces the complexity and difficulty of body application development and allows car manufacturer developers to pay more attention to the body application business itself. At the same time, only the DBC files of different car manufacturers need to be provided, and the body application itself does not need to be modified to achieve seamless docking of different vehicles. In the scenario that can be imagined, when the vehicle is connected to the Internet, the owner can turn on the body air conditioner and set the temperature in advance through the mobile phone app. The car manufacturer developers only need to pay attention to the function of the mobile phone app and send the data to the present invention. The system automatically sends the CAN signal or the temperature data returned by the transceiver temperature sensor, and the corresponding sensor and actuator work.

[0117] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

Claims

1. A vehicle CAN signal abstract application method, characterized in that: By inputting dbc files from different car manufacturers for parsing, the CAN information is abstractly described according to the VSS standard, converted into a more readable VSS path, and an interface is provided to the body application through DDS. Including specific steps: (1) Read the car manufacturer's DBC file and generate a CAN information message array; (2) Read the mapping.json file that contains the correspondence between vss and can signals; (3) Read the vss description file, parse and store the vss path; (4) Open the socket to read the CAN signal; (5) Enable the DDS topic and provide the functions of set vss path and get vss path; (6) When the CAN signal is received, the message ID is obtained through the CAN frame data header, and the CAN information description file is obtained through the message ID. The byteOrder in the array is distributed to the InterParse and MotorolaParse functions for parsing; (7) Find the vss path through the mapping relationship in mapping.json, store it in memory and sqllite, and broadcast it through DDS so that objects interested in the vss path can receive the change information; (8) Receive a get request sent through DDS and return the vss value to the requester; (9) Receive the set request sent by DDS, store it in memory and sqllite, and find the messageID through mapping.json. Get the values ​​of all CAN signals of the message from the memory through the messageID, assemble it according to the InterParse and MotorolaParse formats, and send the CAN message through the socket.

2. The vehicle CAN signal abstract application method according to claim 1 is characterized in that: The InterParse parsing method is: Create a bitset with all bits set to 0 <64> tmp; Use a loop from the start bit of signal to the size of signal and set the bit where tmp is located to 1; Take the AND result of the received CAN data and tmp, and then left-shift the start bit of signalale to get the value of signalale.

3. The vehicle CAN signal abstract application method according to claim 1 is characterized in that: The MotorolaParse parsing method is: Starting from the starting point of the received message, the length is 8 bits. Since the value in dbc is stored in big endian, the value of the parameter is extracted by left shift and right shift. The number of left shifts is calculated as: moveBit = ABS(startBit – highBit) + lowBit The number of right shifts is calculated as: If the message length is <= 8, the message should be right-shifted by (8 – signalSize) + 64 – 8. If the message length is > 8 and <= 16, the message should be right-shifted by (16 - signalSize) + 64 - 16. If the message length is > 16 and <= 32, the message should be right-shifted by (32 - signalSize) + 64 - 32. If the message length is >32 and <=64, the message should be right-shifted by (64 - signalSize) + 64 – 64.

4. The vehicle CAN signal abstract application method according to claim 1 is characterized in that: InterParse format assembly method: Shift the value directly to the left by the starting position of signal; Just assign the left-shifted value bit by bit to the 8-byte array.

5. The vehicle CAN signal abstract application method according to claim 1 is characterized in that: MotorolaParse format assembly method: The specific position in the message is calculated, and a 64-bit value is obtained by left shifting. The above operation is performed on all parameters and then added to obtain a complete 64-bit message.

Citation Information

Patent Citations

  • Database DBC file generation method and device

    CN113568875A

  • Service-oriented automobile domain controller data forwarding system and method

    CN115412478A