Vehicle-based communication method, device, vehicle, and storage medium

By determining semaphore information and using placeholder data to packetize messages in vehicle communication systems, the complexity and inefficiency caused by frequent semaphore updates are addressed, enhancing the operating efficiency of in-vehicle communication.

JP7807160B2Active Publication Date: 2026-01-27HUIZHOU DESAY SV AUTOMOTIVE
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024539764
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2023-03-02
Filing Date
2023-09-28
Publication Date
2026-01-27
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

The complexity of data processing in vehicle communication systems, particularly due to the need to update semaphores for each message, complicates the code and reduces operating efficiency.

Method used

A vehicle-based communication method that determines semaphore information including start position, signal identifier, and data length, and uses placeholder data to packetize messages based on a bit field data structure, eliminating the need for masking and shifting operations.

Benefits of technology

Simplifies the packetization process by defining a data framework that matches the message structure, reducing the need for frequent semaphore updates and improving the efficiency of in-vehicle communication systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007807160000002
    Figure 0007807160000002
  • Figure 0007807160000003
    Figure 0007807160000003
  • Figure 0007807160000004
    Figure 0007807160000004
Patent Text Reader

Abstract

This application discloses a vehicle-based communication method, device, vehicle and storage medium. The method can be applied to a vehicle having a message sender and a message receiver, and includes: a sender determines message information including a plurality of semaphore information; the sender determines a length of placeholder data of the semaphore and a bit field data structure including the placeholder data according to the message information and the preset message data length, and the length of the placeholder data is determined according to the start position and the data length of the semaphore; and the sender packetizes the plurality of semaphores according to the bit field data structure to obtain a target message, and transmits the target message to the receiver. In the technical solution of the embodiment of this application, the collected semaphore data can be directly packetized into a message, and steps such as masking and shifting in the message packetization process can be omitted by using placeholder data.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application claims priority from a Chinese patent application bearing application number 202310192219.5, filed with the State Intellectual Property Office of the People's Republic of China on March 2, 2023, the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the field of communications technology, for example, to a vehicle-based communications method, apparatus, vehicle, and storage medium. [Background technology]

[0003] With the continuous development of information technology, in-vehicle communication systems can solve communication problems encountered during driving and make driving safer and more convenient. Based on the development of intelligent transportation systems and sensor network technology, in-vehicle communication systems can realize the advanced information and intelligentization of transportation.

[0004] Currently, communication within in-vehicle systems is typically carried out in the form of CAN (Controller Area Network) messages. Before transmitting data to a receiving end such as an in-vehicle controller, packetization and unpacketization of messages typically require bit processing such as masking and shifting of semaphores for each message.

[0005] However, each time a semaphore is changed, the associated function must be called to update the semaphore for the entire message, and this data processing method not only complicates the code but also reduces the operating efficiency of the entire in-vehicle communication system. Summary of the Invention [Problem to be solved by the invention]

[0006] The present application provides a vehicle-based communication method, device, vehicle, and storage medium for solving the problem of the complexity of data processing in the vehicle communication process. [Means for solving the problem]

[0007] In a first aspect, the present application provides: 1. A vehicle-based communication method applied to a vehicle comprising a message sender and a message receiver, comprising: The sending side determines message information including a plurality of pieces of semaphore information, the semaphore information including a start position of semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the start position is determined based on a predetermined message data length; The sending side determines the length of placeholder data of the semaphore and a bit field data structure including the placeholder data based on the message information and the preset message data length, and the length of the placeholder data is determined based on the start position and the data length of the semaphore; packetizing, by the sender, a plurality of the semaphores based on the bit field data structure to obtain a target message, and transmitting the target message to the receiver. A vehicle-based communication method is provided.

[0008] In a second aspect, the present application provides: 1. A vehicle-based communication device located in a vehicle comprising a message sender and a message receiver, comprising: a message information determination module belonging to the sending side, used for determining message information including a plurality of semaphore information, the semaphore information including a start position of the semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the start position is determined according to a predetermined message data length; a result determination module belonging to the sending side, used to determine the length of the placeholder data of the semaphore and a bit field data structure containing the placeholder data according to the message information and the preset message data length, wherein the length of the placeholder data is determined according to the start position and the data length of the semaphore; a message sending module belonging to the sending side, used for packetizing a plurality of the semaphores according to the bit field data structure to obtain a target message, and sending the target message to the receiving side; A vehicle-based communication device is provided.

[0009] In a third aspect, the present application provides: at least one processor; a memory communicatively coupled to the at least one processor, the memory stores a computer program executable by at least one processor, the computer program being executed by the at least one processor such that the at least one processor can perform the vehicle-based communication method of the first aspect; Provide vehicles.

[0010] In a fourth aspect, the present application provides: storing computer instructions that, when executed by a processor, implement the vehicle-based communication method of the first aspect; A computer-readable storage medium is provided. [Effects of the Invention]

[0011] In a vehicle-based communication aspect provided in the present application, a transmitting side determines message information including multiple semaphore information, the semaphore information including a start position of semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, the start position being determined based on a preset message data length; the transmitting side determines a length of placeholder data for the semaphore and a bit field data structure including the placeholder data based on the message information and the preset message data length, the length of the placeholder data being determined based on the start position and the data length of the semaphore; and the transmitting side packetizes the multiple semaphores based on the bit field data structure to obtain a target message, and transmits the target message to a receiving side. By adopting the above technical solution, the sending side in the vehicle determines the length of the semaphore placeholder data and the bit field data structure containing this placeholder data based on the message information and the preset message data length, defines a data framework (bit field data structure) that matches the message structure, and can use this data structure to directly packetize the collected semaphore data into a message. By using the placeholder data, steps such as masking and shifting in the message packetization process are omitted, and the problem of having to call related functions to update the semaphore for the entire message every time the semaphore data changes, which is caused by the semaphore data length not matching the preset message data length, is solved. [Brief explanation of the drawings]

[0012] [Figure 1] 1 is a flowchart of a vehicle-based communication method according to a first embodiment of the present invention. [Figure 2] 10 is a flowchart of a vehicle-based communication method according to a second embodiment of the present invention. [Figure 3] FIG. 10 is a structural schematic diagram of a vehicle-based communication device according to a third embodiment of the present invention. [Figure 4]FIG. 10 is a structural schematic diagram of a vehicle according to a fourth embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0013] The terms "first," "second," and the like in the specification and claims of this application, as well as in the drawings, are used to distinguish between similar objects and are not intended to describe a particular order or priority. It should be understood that the data used in this manner can be interchanged as appropriate, so that the embodiments of this application described herein can be implemented in an order other than that shown or described herein. In this description, unless otherwise specified, "plurality" means two or more than two. "And / or" describes a relationship between related objects and indicates that there may be three relationships; for example, A and / or B can indicate three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects before and after it are in an "or" relationship. Furthermore, the terms "comprises" and "having" and any variations thereof are intended to be non-exclusive inclusive, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to the steps or units expressly recited, but may include other steps or units not expressly recited or inherent to the process, method, product or device. [Example]

[0014] FIG. 1 is a flowchart of a vehicle-based communication method according to a first embodiment of the present application. This embodiment can be applied to communication within a vehicle. The method can be executed by a vehicle-based communication device. The vehicle-based communication device can be realized in the form of hardware and / or software and can be located in a vehicle, for example, an on-board device. The vehicle is equipped with a message sender and a message receiver. The on-board device and other devices (e.g., a controller, etc.) within the vehicle can all be senders and receivers. The vehicle can be composed of two or more objects.

[0015] As shown in FIG. 1, the vehicle-based communication method according to the first embodiment of the present application specifically includes the following steps.

[0016] S101: A sending side determines message information including multiple semaphore information, the semaphore information including a starting position of semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the starting position is determined based on a preset message data length.

[0017] In this embodiment, when communication is performed within a vehicle, the same device may be both the sender and the receiver, for example, an in-vehicle device may be the sender when sending a message and the receiver when receiving a message. The message information may be embodied in the form of a message information table shown in Table 1 below. [Table 1]

[0018] The message sender can determine the message information to be sent, i.e., the message information containing multiple semaphore information, based on the data collected by the sensor or the received message. As shown in Table 1, the column with "Name" in Table 1 is the semaphore signal identifier, the column with "Bitpos" is the start position, and the column with "Length" is the data length. The semaphore may include wheel speed, door status, lamp status, tire pressure, etc. The start position of the semaphore data can be considered to be within a preset bit field corresponding to the preset message data length. For example, if the preset bit field is 0 to 63 bits and the first occupied bit position is, for example, bit 5, this bit is the start position. The preset message data length can be considered to be the length corresponding to the preset bit field. For example, if the preset bit field is 0 to 63 bits, the preset message data length is 8 bytes (each byte has 8 bits), and the preset bit field can be considered to be the sum of all semaphore data in the message information.

[0019] S102: The sending side determines the length of the placeholder data of the semaphore and a bit field data structure containing the placeholder data based on the message information and the preset message data length, and the length of the placeholder data is determined based on the starting position and the data length of the semaphore.

[0020] In this embodiment, the sending side can determine the length of the semaphore placeholder data based on the message information and the preset message data length. For example, if the preset message data length is 8 bytes, the preset bit field can be set to 0 to 63 bits. For example, if the corresponding position in the preset bit field of the sum of the data length and start position of a semaphore among multiple semaphore information included in the message information is the 6th bit, and the corresponding sub-bit field in the preset bit field of this semaphore is the 8th bit, the difference between these two positions, 2, can be used as the length of the placeholder data, and the length of the placeholder data for each semaphore can be determined accordingly. The difference between these two positions indicates that the semaphore data cannot fill the corresponding sub-bit field, i.e., there is an empty bit. Furthermore, based on the message information and the length of the placeholder data, a bit field data structure containing the placeholder data can be determined. For example, a signal identifier in the message information can be used as a variable identifier in the bit field data structure. Here, the preset bit field may be divided into multiple sub-bit fields, the number of sub-bit fields may be the same as the number of semaphores, and the preset bit field and sub-bit fields may be preset based on a communication protocol and a preset message data length, and the placeholder data may be empty data with no content.

[0021] S103, the sending side packetizes the plurality of semaphores according to the bit field data structure to obtain a target message, and sends the target message to the receiving side.

[0022] In this embodiment, the sender can packetize the data in the semaphore and send it to the receiver after obtaining the (target) message, thereby realizing communication between the sender and receiver. The bit field data structure contains placeholder data, which can fill in empty bits in the sub-bit field corresponding to the semaphore data, eliminating the need for operations such as shifting and masking during the packetization process. The packetization method can also be achieved by directly assigning the data in the semaphore to a variable in the bit field data structure.

[0023] In a vehicle-based communication method according to an embodiment of the present application, a transmitting side determines message information including multiple semaphore information, the semaphore information including a start position of semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, the start position being determined based on a preset message data length; the transmitting side determines a length of placeholder data for the semaphore and a bit field data structure including the placeholder data based on the message information and the preset message data length, the length of the placeholder data being determined based on the start position and the data length of the semaphore; and the transmitting side packetizes the multiple semaphores based on the bit field data structure to obtain a target message, and transmits the target message to a receiving side. According to the technical solution of the embodiment of the present application, the sending side in the vehicle determines the length of the semaphore placeholder data and the bit field data structure containing this placeholder data based on the message information and the preset message data length, defines a data framework (bit field data structure) that matches the message structure, and uses this data structure to directly packetize the collected semaphore data into a message. By using the placeholder data, steps such as masking and shifting in the message packetization process are omitted, and the problem of having to call related functions to update the semaphore for the entire message every time the semaphore data changes, which is caused by the semaphore data length not matching the preset message data length, is solved. [Example]

[0024] FIG. 2 is a flowchart of a vehicle-based communication method according to a second embodiment of the present application. The technical solution of the second embodiment of the present application goes beyond the above-mentioned optional technical solutions and provides a specific method for communication within a vehicle.

[0025] Determining by the sending side the length of placeholder data of the semaphore and a bit field data structure including the placeholder data based on the message information and the preset message data length may include: determining by the sending side a first bit field of the semaphore based on the sum of a start position of the semaphore data and a data length of the semaphore, wherein the start position of the first bit field is the start position of the semaphore data and the end position of the first bit field is a position corresponding to the sum; determining by the sending side a plurality of second bit fields based on the preset message data length and determining the length of placeholder data based on a bit field gap between the second bit field and the first bit field, wherein the sum of the length of the placeholder data and the data length of the semaphore matches the length corresponding to the second bit field; and determining by the sending side the bit field data structure including the placeholder data based on the message information and the length of the placeholder data. This has the advantage that the length of the placeholder data can be accurately determined using the bit field gap, thereby ensuring accuracy of communication between the receiving side and the sending side.

[0026] The sending side packetizing the plurality of semaphores based on the bit field data structure to obtain a target message may include the sending side writing the value of the semaphore to a variable corresponding to a target semaphore identifier to obtain a target variable, and packetizing the target variable to obtain the target message, wherein the bit field data structure further includes the target semaphore identifier, and the target semaphore identifier and the signal identifier of the semaphore match. This has the advantage that by writing the value of the semaphore to the variable corresponding to the target semaphore identifier, it is possible to complete the packetization of the message without an operation such as calling an encoding function.

[0027] The method may further include, after the sending side transmits the target message to the receiving side and the receiving side receives the target message, performing an unpacketization process on the target message, obtaining a value of the target variable from the unpacketization result, and controlling the running state of a vehicle corresponding to the vehicle based on the value. This has the advantage that the receiving side can complete the decoding of the message without calling a decode function, thereby making access to the semaphore direct.

[0028] As shown in FIG. 2, the vehicle-based communication method according to the second embodiment of the present application specifically includes the following steps.

[0029] S201: A sending side determines message information including multiple semaphore information.

[0030] S202, the sending side determines the first bit field of the semaphore based on the sum of the start position of the data of the semaphore and the data length of the semaphore.

[0031] Here, the start position of the first bit field is the start position of the semaphore data, and the end position of the first bit field is the position corresponding to the sum.

[0032] For example, if the starting position of the semaphore data is the 7th bit and the semaphore data length is 5 bits, the sum of these two is 12, and the corresponding first bit field is from the 7th bit to the 11th bit.

[0033] S203: The sending side determines a plurality of second bit fields according to a preset message data length, and determines a length of placeholder data according to a bit field gap between the second bit fields and the first bit field.

[0034] Here, the sum of the length of the placeholder data and the data length of the semaphore matches the length corresponding to the second bit field.

[0035] Specifically, as described above, based on the predetermined message data length and the number of semaphores, a predetermined bit field and a sub-bit field in the predetermined bit field can be determined, and this sub-bit field is the second bit field.

[0036] For example, the preset message data length is 3 bytes, the preset bit field is 0 to 23 bits, the number of semaphores is 4, the four second bit fields are bits 0 to 6, bits 7 to 12, bits 13 to 20, and bits 21 to 23, respectively, and the first bit fields are bits 0 to 6, bits 7 to 11, bits 13 to 20, and bits 21 to 23, respectively. Therefore, if there is a bit field gap between the second bit field (bits 7 to 12) and the first bit field (bits 7 to 11), and the difference in length corresponding to the bit field gap is 1, this difference of 1 can be used as the length of the placeholder data.

[0037] S204: The sending side determines a bit field data structure containing the placeholder data according to the message information and the length of the placeholder data.

[0038] Specifically, the bit field data structure may include, in addition to the placeholder data, some of the information in the message information, such as the semaphore identifier of the semaphore and the data length of the semaphore.

[0039] The bit field data structure may include at least a target semaphore identifier, a target data length, and the placeholder data, and determining by the sending side the bit field data structure including the placeholder data based on the message information and the length of the placeholder data may include determining by the sending side the signal identifier of the semaphore as the target semaphore identifier and the data length of the semaphore as the target data length, and determining by the sending side the bit field data structure including the placeholder data based on the bit field gap and the length of the placeholder data. This has the advantage that reading semaphore data is more intuitive, and code is more concise and readable.

[0040] Specifically, since the lengths of the placeholder data corresponding to different bit-field gaps are different, the corresponding bit-field data structures are also different, so the bit-field data structures can be defined based on the size of the bit-field gap and the length of the placeholder data. If there is no gap between the first and second bit-fields corresponding to each semaphore, i.e., if the bit-field gap is an empty gap, the length of the placeholder data in the bit-field data structure is zero.

[0041] For example, if the signal identifier of a semaphore is BCS_9_A_Checksum, this signal identifier can be determined as the target semaphore identifier in the bit field data structure, and if the data length of this signal identifier is 8 bits, this data length can be determined as the target data length in the bit field data structure.

[0042] Furthermore, determining by the sending side the bit field data structure including the placeholder data based on the bit field gap and the length of the placeholder data includes, if the bit field gap is a non-empty gap, determining by the sending side the length of the placeholder data corresponding to the non-empty gap as a target placeholder length of a semaphore corresponding to the bit field gap, where the type of the bit field gap includes an empty gap and the non-empty gap, the empty gap indicates that the second bit field and the first bit field match, and the length of the placeholder data corresponding to the empty gap is zero, and determining by the sending side the placeholder position of the placeholder data in the bit field data structure and the bit field data structure including the placeholder data based on the non-empty gap and the target placeholder length. This has the advantage that the bit field data structure and the placeholder position of its placeholder data are accurately determined, ensuring reliability of communication.

[0043] Illustratively, according to the message information shown in Table 1, the bit field data structure can be shown in code form as follows: / *CAN packet header file, named as “can_message.h”* / typedef unsigned char uint8; typedef unsigned short uint16; #pragma pack(1) typedef struct { uint8 BCS_9_A_Checksum; uint8 BCS_9_A_MsgCounter:4; uint8 :4; uint8 BCS_FLWheelRotatedDirectionAPA:2; uint8 BCS_FRWheelRotatedDirectionAPA:2; uint16 BCS_FRWheelSpd:13; uint16 BCS_FRWheelRotatedDirectionVD:1; uint16 :1; uint16 BCS_FRWheelSpdVD:1; uint16 BCS_FLWheelSpd:13; uint16 :3; uint8 :5; uint8 BCS_FLWheelSpdVD:1; uint8 :1; uint8 BCS_FLWheelRotatedDirectionVD:1; } can_BCS_9_A_t

[0044] Here, the data between the target semaphore identifiers is placeholder data, for example, uint8:4 between BCS_9_A_MsgCounter and BCS_FLWheelRotatedDirectionAPA indicates placeholder data occupying 4 bits, and the length of the placeholder data for a semaphore whose bit field gap is an empty gap, such as the semaphore corresponding to BCS_9_A_Checksum, is zero, so there is no placeholder data between BCS_9_A_Checksum and BCS_9_A_MsgCounter (the length of the placeholder data is zero), and the number after the target semaphore identifier indicates the target data length, for example, BCS_9_A_MsgCounter:4 indicates that the length of the data for the semaphore corresponding to BCS_9_A_MsgCounter is 4 bits and occupies 4 bits.

[0045] S205: The sending side writes the value of the semaphore into a variable corresponding to a target semaphore identifier to obtain a target variable, packetizes the target variable to obtain a target message, and sends the target message to the receiving side.

[0046] Here, the bit field data structure further includes the target semaphore identifier, and the target semaphore identifier and the signal identifier of the semaphore match.

[0047] For example, the process of packetizing target variables can be shown in code form as follows: #include “can_message.h” int main(void) { can_BCS_9_A_t canMsg; uint8 checksum, counter; uint16 wheelspeed; counter = 4; checksum = 123; wheelspeed = 5000; / *pack a message* / / *Assign a semaphore* / canMsg.BCS_9_A_Checksum = checksum; canMsg.BCS_9_A_MsgCounter = counter; canMsg.BCS_FRWheelSpd = wheelspeed; canMsg.BCS_FLWheelRotatedDirectionAPA = 2; canMsg.BCS_FRWheelRotatedDirectionAPA = 2; canMsg.BCS_FRWheelRotatedDirectionVD = 1; canMsg.BCS_FRWheelSpdVD = 1; canMsg.BCS_FLWheelSpd = 5123; canMsg.BCS_FLWheelSpdVD = 1; canMsg.BCS_FLWheelRotatedDirectionVD = 1; / *Encoding complete, send message* / Can_send(NID, DLC, (void *)&canMsg); return 0; }

[0048] Here, can_message.h is the name of the bitfield data structure, and the content between / *Assign semaphore* / and / *Encoding completed, send message* / is the process of writing the semaphore value to the variable corresponding to the target semaphore identifier.

[0049] S206: After receiving the target message, the receiving side performs an unpacketization process on the target message, obtains the value of the target variable from the unpacketization result, and controls the running state of the vehicle corresponding to the vehicle based on the value.

[0050] Specifically, after receiving the target message, the receiving side does not need to perform operations such as shifting or masking the target message, and can directly read the value of the target variable, i.e., the value of the semaphore, from the target message.

[0051] For example, the process of unpacketizing a target variable can be shown in code form as follows: #include “can_message.h” int main(void) { can_BCS_9_A_t canMsg; uint8 checksum, counter; uint16 wheelspeed; / *Omit canMsg and receive the assigned part...* / can_receive(nid, dlc, &canMsg); / * Assume the received CAN message is stored in canMsg * / / *unpack a message* / / *Get the semaphore directly* / checksum = canMsg.BCS_9_A_Checksum; counter = canMsg.BCS_9_A_MsgCounter; wheelspeed = canMsg.BCS_FRWheelSpd; printf(”BCS_9_A_Checksum %d\n”, canMsg.BCS_9_A_Checksum); printf(”BCS_9_A_MsgCounter %d\n”, canMsg.BCS_9_A_MsgCounter); printf(”BCS_FLWheelRotatedDirectionAPA %d\n”, canMsg.BCS_FLWheelRotatedDirectionAPA); printf(”BCS_FRWheelRotatedDirectionAPA %d\n”, canMsg.BCS_FRWheelRotatedDirectionAPA); printf(”BCS_FRWheelSpd %d\n”, canMsg.BCS_FRWheelSpd); printf(”BCS_FRWheelRotatedDirectionVD %d\n”, canMsg.BCS_FRWheelRotatedDirectionVD); printf(”BCS_FRWheelSpdVD %d\n”, canMsg.BCS_FRWheelSpdVD); printf(”BCS_FLWheelSpd %d\n”, canMsg.BCS_FLWheelSpd); printf(”BCS_FLWheelSpdVD %d\n”, canMsg.BCS_FLWheelSpdVD); printf(”BCS_FLWheelRotatedDirectionVD %d\n”, canMsg.BCS_FLWheelRotatedDirectionVD); return 0; }

[0052] Here, the content following / *Acquire semaphore directly* / is the process of acquiring the value of the target variable from the unpacketized result.

[0053] The bit field data structure may be defined based on the C or C++ programming language, which has the advantage that different types of CAN messages can be supported and the compatibility of the in-vehicle communication system can be improved.

[0054] Specifically, a bit-field data structure can be coded in the C or C++ programming languages ​​because the concept of a bit-field exists in the C or C++ programming languages.

[0055] In a vehicle-based communication method according to an embodiment of the present application, the sender in the vehicle first accurately determines the length of the placeholder data in the bit field data structure based on the starting position and data length of the semaphore in the message information, thereby ensuring the accuracy of communication between the sender and receiver. Furthermore, by writing the value of the semaphore to a variable corresponding to the target semaphore identifier, the message can be packetized without operations such as calling an encoding function, and then sent to the receiver. The receiver can complete the message decoding without calling a decoding function, which makes access to the semaphore straightforward, results in simpler code, improves code readability, saves system resources, and improves the operating efficiency of the entire in-vehicle communication system. This method can also be extended to any scenario in which communication is performed using compact encoded data messages with bits as the basic unit. [Example]

[0056] 3 is a structural schematic diagram of a vehicle-based communication device according to a third embodiment of the present application. This device can be disposed in a vehicle that includes a message sender and a message receiver. As shown in FIG. 3, this device: a message information determination module 301 belonging to the sending side, used for determining message information including a plurality of semaphore information, the semaphore information including a start position of the semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the start position is determined according to a predetermined message data length; a result determination module 302 belonging to the sending side, used to determine the length of the placeholder data of the semaphore and a bit field data structure containing the placeholder data according to the message information and the preset message data length, wherein the length of the placeholder data is determined according to the start position and the data length of the semaphore; a message sending module 303 belonging to the sending side, used for packetizing a plurality of the semaphores according to the bit field data structure to obtain a target message, and sending the target message to the receiving side;

[0057] In a vehicle-based communication device according to an embodiment of the present application, the transmitting side in the vehicle determines the length of the semaphore placeholder data and a bit field data structure containing this placeholder data based on message information and a preset message data length, defines a data framework (bit field data structure) that matches the message structure, and can use this data structure to directly packetize the collected semaphore data into a message. By using the placeholder data, steps such as masking and shifting in the message packetization process are omitted, and the problem of having to call related functions to update the semaphore for the entire message every time the semaphore data changes, which is caused by a mismatch between the semaphore data length and the preset message data length, is solved.

[0058] The result determination module is a bit field determination unit belonging to the sending side, used to determine a first bit field of the semaphore based on the sum of the start position of the data of the semaphore and the data length of the semaphore, the start position of the first bit field being the start position of the data of the semaphore, and the end position of the first bit field being a position corresponding to the sum; a length determination unit belonging to the sending side, for determining a plurality of second bit fields according to a preset message data length, and for determining a length of placeholder data according to a bit field gap between the second bit fields and the first bit field, such that the sum of the length of the placeholder data and the data length of the semaphore is equal to the length corresponding to the second bit fields; The data structure determining unit may belong to the sending side and be used to determine a bit field data structure containing the placeholder data according to the message information and the length of the placeholder data.

[0059] The bit field data structure includes at least a target semaphore identifier, a target data length, and the placeholder data, and determining by the sending side the bit field data structure including the placeholder data based on the message information and the length of the placeholder data may include determining by the sending side a signal identifier of the semaphore as the target semaphore identifier and a data length of the semaphore as the target data length, and determining by the sending side the bit field data structure including the placeholder data based on the bit field gap and the length of the placeholder data.

[0060] Further, determining by the sending side the bit field data structure including the placeholder data based on the bit field gap and the length of the placeholder data includes, if the bit field gap is a non-empty gap, determining by the sending side the length of the placeholder data corresponding to the non-empty gap as a target placeholder length of a semaphore corresponding to the bit field gap, where types of the bit field gap include empty gaps and the non-empty gaps, the empty gap indicates that the second bit field and the first bit field match, and the length of the placeholder data corresponding to the empty gap is zero, and determining by the sending side a placeholder position of placeholder data in the bit field data structure and a bit field data structure including the placeholder data based on the non-empty gap and the target placeholder length.

[0061] Specifically, the message sending module is used to write the value of the semaphore to a variable corresponding to a target semaphore identifier to obtain a target variable, and to packetize the target variable to obtain a target message, and the bit field data structure may further include the target semaphore identifier, and the target semaphore identifier and the semaphore signal identifier may be identical.

[0062] This device is The vehicle control device may further include a target variable value determination module, which belongs to the receiving side and, after receiving the target message, performs an unpacketization process on the target message, obtains the value of the target variable from the unpacketization result, and controls the running state of the vehicle corresponding to the vehicle based on the value.

[0063] The bitfield data structure may be defined based on the C or C++ programming language.

[0064] The vehicle-based communication device according to the embodiments of the present application can execute the vehicle-based communication method according to any embodiment of the present application, and has functional modules and beneficial effects according to the execution of the method. [Example]

[0065] 4 shows a structural schematic diagram of a vehicle 40 that can be used to implement embodiments of the present application. The components, their connections, relationships, and their functions shown herein are merely exemplary and do not limit the implementation of the present application as described and / or claimed herein.

[0066] The vehicle 40 includes a message sender and a message receiver, both of which may be on-board equipment or other devices (e.g., controllers) within the vehicle. As shown in FIG. 4 , the vehicle 40 includes at least one processor 41 and memory communicatively connected to the at least one processor 41, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate operations and processes based on the computer programs stored in the read-only memory (ROM) 42 or loaded from a storage unit 48 into the random access memory (RAM) 43. The RAM 43 may store various programs and data necessary for the operation of the vehicle 40. The processor 41, the ROM 42, and the RAM 43 are connected to one another via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0067] Multiple components in vehicle 40 are connected to an I / O interface 45, which comprises input units 46 such as a keyboard, mouse, etc., output units 47 such as various types of displays, speakers, etc., storage units 48 such as magnetic disks, optical disks, etc., and communication units 49 such as a network card, modem, wireless communication transceiver, etc. The communication units 49 allow vehicle 40 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks.

[0068] The processor 41 may be a general-purpose and / or specialized processing assembly having processing and computing capabilities. Some examples of the processor 41 may include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, processors that execute machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as vehicle-based communication methods.

[0069] In some embodiments, the vehicle-based communication method may be embodied as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, some or all of the computer program may be loaded and / or installed into vehicle 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, it may perform one or more steps of the vehicle-based communication method. Alternatively, in other embodiments, processor 41 may be configured to perform the vehicle-based communication method in any other suitable manner (e.g., via firmware).

[0070] Various embodiments of the systems and techniques described herein may be realized in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: embodied in one or more computer programs, which can be executed and / or interpreted by a programmable system including at least one programmable processor, which may be a special purpose or general purpose programmable processor, capable of receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device;

[0071] Computer programs for implementing the methods of the present application can be coded in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, so that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are performed. The computer program can be executed entirely on the device, partially on the device, as a separate software package partially on the device and partially on a remote device, or entirely on a remote device or server.

[0072] The above-described computer device can be used to perform the vehicle-based communication method according to any of the above-described embodiments, and has corresponding functions and beneficial effects. [Example]

[0073] In this specification, a computer-readable storage medium may be a tangible medium, and the computer-executable instructions, when executed by a computer processor, are used to perform a vehicle-based communication method, the method being applied to a vehicle comprising a message sender and a message receiver; The sending side determines message information including a plurality of pieces of semaphore information, the semaphore information including a start position of semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the start position is determined based on a predetermined message data length; The sending side determines the length of placeholder data of the semaphore and a bit field data structure including the placeholder data based on the message information and the preset message data length, and the length of the placeholder data is determined based on the start position and the data length of the semaphore; packetizing, by the sender, a plurality of the semaphores based on the bit field data structure to obtain a target message, and sending the target message to the receiver.

[0074] In this specification, a computer-readable storage medium may be a tangible medium, including or capable of storing a computer program for use in an instruction execution system, apparatus, or device, or a computer program for use in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. Further specific examples of machine-readable storage media include an electrical connection of one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk-read-only disk (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0075] The above-described computer device can be used to perform the vehicle-based communication method according to any of the above-described embodiments, and has corresponding functions and beneficial effects.

[0076] It should be noted that each unit and module included in the above embodiment of the vehicle-based communication device is merely divided according to functional logic, and is not limited to the above division as long as it can realize the corresponding function. Furthermore, the specific names of each functional unit are merely for the purpose of making them easily distinguishable from each other, and are not used to limit the scope of protection of the present application.

[0077] It should be noted that the above are only optional embodiments and technical principles used in the present application. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and various obvious changes, adjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in detail by the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the appended claims.

Claims

1. 1. A vehicle-based communication method applied to a vehicle comprising a message sender and a message receiver, comprising: The sending side determines message information including a plurality of pieces of semaphore information, the semaphore information including a start position of semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the start position is determined based on a predetermined message data length; The sending side determines the length of placeholder data of the semaphore and a bit field data structure including the placeholder data based on the message information and the preset message data length, and the length of the placeholder data is determined based on the start position and the data length of the semaphore; packetizing, by the sender, a plurality of the semaphores based on the bit field data structure to obtain a target message, and sending the target message to the receiver; determining, by the sending side, a length of placeholder data of the semaphore and a bit field data structure including the placeholder data based on the message information and the predetermined message data length; The sending side determines a first bit field of the semaphore based on the sum of the start position of the semaphore data and the data length of the semaphore, and the start position of the first bit field is the start position of the semaphore data and the end position of the first bit field is a position corresponding to the sum; The sending side determines a plurality of second bit fields based on a preset message data length, and determines a length of placeholder data based on a bit field gap between the second bit fields and the first bit field, and the sum of the length of the placeholder data and the data length of the semaphore is equal to the length corresponding to the second bit fields; determining, by the sending side, a bit field data structure including the placeholder data based on the message information and the length of the placeholder data; Vehicle-based communication methods.

2. The bit field data structure includes at least a target semaphore identifier, a target data length, and the placeholder data, and the sending side determines the bit field data structure including the placeholder data based on the message information and the length of the placeholder data, determining, by the sender, a signal identifier of the semaphore as the target semaphore identifier and a data length of the semaphore as the target data length; determining, by the sending side, a bit field data structure including the placeholder data based on the bit field gap and the length of the placeholder data; The method of claim 1.

3. determining, by the sending side, a bit field data structure including the placeholder data based on the bit field gap and the length of the placeholder data; If the bit field gap is a non-empty gap, the sending side determines the length of placeholder data corresponding to the non-empty gap as a target placeholder length of a semaphore corresponding to the bit field gap, the type of the bit field gap includes an empty gap and the non-empty gap, the empty gap indicates that the second bit field and the first bit field match, and the length of the placeholder data corresponding to the empty gap is zero; determining, by the sending side, a placeholder position of placeholder data in the bit field data structure and a bit field data structure including the placeholder data based on the non-empty gap and the target placeholder length; The method of claim 2.

4. packetizing, by the sender, a plurality of the semaphores based on the bit field data structure to obtain a target message, the sending side writes the value of the semaphore to a variable corresponding to a target semaphore identifier to obtain a target variable, and packetizes the target variable to obtain a target message, the bit field data structure further includes the target semaphore identifier, and the target semaphore identifier and the signal identifier of the semaphore are identical. The method of claim 1.

5. after the sender has sent the target message to the receiver, The method further includes, after receiving the target message, performing an unpacketization process on the target message by the receiving side, obtaining a value of the target variable from the unpacketization result, and controlling a running state of a vehicle corresponding to the vehicle based on the value. The method of claim 4.

6. The bit field data structure is defined based on the C or C++ programming language. The method of claim 1.

7. 1. A vehicle-based communication device located in a vehicle comprising a message sender and a message receiver, comprising: a message information determination module belonging to the sending side, used for determining message information including a plurality of semaphore information, the semaphore information including a start position of the semaphore data, a signal identifier of the semaphore, and a data length of the semaphore, and the start position is determined according to a predetermined message data length; a result determination module belonging to the sending side, used to determine the length of the placeholder data of the semaphore and a bit field data structure containing the placeholder data according to the message information and the preset message data length, wherein the length of the placeholder data is determined according to the start position and the data length of the semaphore; a message sending module belonging to the sending side, used for packetizing a plurality of the semaphores according to the bit field data structure to obtain a target message, and sending the target message to the receiving side; The result determination module: a bit field determination unit belonging to the sending side, used to determine a first bit field of the semaphore based on the sum of the start position of the semaphore data and the data length of the semaphore, the start position of the first bit field being the start position of the semaphore data and the end position of the first bit field being a position corresponding to the sum; a length determination unit, belonging to the sending side, for determining a plurality of second bit fields according to a preset message data length, and determining a length of placeholder data according to a bit field gap between the second bit fields and the first bit field, such that the sum of the length of the placeholder data and the data length of the semaphore is equal to the length corresponding to the second bit fields; a data structure determination unit, belonging to the sending side, used to determine a bit field data structure including the placeholder data according to the message information and the length of the placeholder data; Vehicle-based communication devices.

8. at least one processor; a memory communicatively coupled to the at least one processor, the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor such that the at least one processor is capable of performing the vehicle-based communication method according to any one of claims 1 to 6; vehicle.

9. storing computer instructions which, when executed by a processor, implement the vehicle-based communication method of any one of claims 1 to 6; A computer-readable storage medium.

Citation Information

Patent Citations

  • Data processing method and related device

    CN105450488A

  • Method and system for automatically generating source file of CAN signals

    CN107479526A

  • CAN signal package method and apparatus, and CAN signal analysis method and apparatus

    CN108471401A

  • Task processing method and apparatus

    WO2023004801A1