Message transmission methods, devices, storage media, vehicles, and computer program products

By assembling Ethernet messages and sending them to the target microcontroller, the transmission problem of Ethernet and CAN bus messages in high-concurrency, high-data-volume scenarios in vehicles is solved, improving message sending efficiency and reducing the risk of vehicle actuator lag.

CN118972197BActive Publication Date: 2026-03-13CHINA FAW CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Ethernet and CAN bus messages in vehicles are difficult to transmit effectively in high-concurrency, high-data-volume scenarios, causing vehicle actuators to lag, a problem that existing technologies have not been able to solve effectively.

Method used

By receiving Ethernet messages, assembling them using message type and target configuration file, generating communication bus messages, and sending them to the target microcontroller to control actuator actions, the occupancy of the communication channel is reduced.

Benefits of technology

It improves message sending efficiency in high-concurrency, high-data-volume scenarios, reduces the risk of vehicle actuator lag, and enhances the stability of vehicle control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972197B_ABST
    Figure CN118972197B_ABST
Patent Text Reader

Abstract

This invention discloses a message sending method, apparatus, storage medium, vehicle, and computer program product, relating to the field of vehicle control technology. The method includes: receiving Ethernet messages sent by multiple processes of a vehicle; assembling the Ethernet messages into packets using the message type and target configuration file of the Ethernet messages to obtain a packet assembly result, wherein the target configuration file defines the correspondence between message types and multiple candidate microcontrollers of the vehicle; generating a communication bus message to be sent based on the packet assembly result; and sending the communication bus message to a target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller controls a target actuator of the vehicle to perform a target action, the target action being determined by the process functions of the multiple processes. This invention solves the technical problem that message sending methods provided in related technologies are difficult to apply to high-concurrency, high-data-volume scenarios and easily lead to vehicle execution lag.
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 more specifically, to a message transmission method, apparatus, storage medium, vehicle, and computer program product. Background Technology

[0002] As the domain controller architecture of vehicles shifts from distributed to centralized, the number of controllers installed in vehicles decreases, the functions carried by each controller increase, and the number of internal network communication messages in vehicles increases, which means that the concurrency of vehicle communication messages is improved.

[0003] Typically, a vehicle's central computing platform performs fusion calculations on data generated during vehicle operation, with the relevant algorithms executed on a System-on-Chip (SOC). However, SOCs only support Ethernet communication and not Controller Area Network (CAN) bus communication. Furthermore, most vehicle actuators (such as those corresponding to the battery, motor, electronic control system, doors, lathes, and wipers) are developed based on traditional microcontrollers (MCUs). These actuators are not suitable for high-latency Ethernet communication, and currently, most vehicles use CAN bus communication to control these actuators.

[0004] Since Ethernet messages can handle high-concurrency data but have high latency, while CAN bus messages have low latency but are difficult to handle high-concurrency data, how to send the data during vehicle operation to the actuator via Ethernet messages and / or CAN bus messages after the SOC has completed the calculation has become one of the important technical problems in the related technical field.

[0005] There is currently no effective solution to the above problems. Summary of the Invention

[0006] This invention provides a message sending method, apparatus, storage medium, vehicle, and computer program product to at least solve the technical problem that message sending methods provided in related technologies are difficult to apply to high-concurrency, high-data-volume scenarios and easily cause vehicle execution lag.

[0007] According to one aspect of the present invention, a message transmission method is provided, comprising: receiving Ethernet messages sent by multiple processes of a vehicle; assembling the Ethernet messages into packets using the message type of the Ethernet messages and a target configuration file to obtain a packet assembly result, wherein the target configuration file is used to define the correspondence between message types and multiple candidate microcontrollers of the vehicle; generating a communication bus message to be sent based on the packet assembly result; and sending the communication bus message to a target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller is used to control a target actuator of the vehicle to perform a target action, and the target action is determined by the process functions of the multiple processes.

[0008] Optionally, the message sending method further includes: determining at least one message type for each process in the multiple processes based on the process functions of the multiple processes; and creating a corresponding message sending and receiving interface for each message type based on the at least one message type.

[0009] Optionally, receiving Ethernet messages sent by multiple processes of the vehicle includes: receiving Ethernet messages sent by multiple processes through the message transceiver interface within the current packet assembly period.

[0010] Optionally, the packet assembly result includes a bus communication message queue; using the message type and target configuration file of the Ethernet message, the Ethernet message is assembled into a packet, and the packet assembly result includes: adding the Ethernet message to the Ethernet message queue corresponding to the current packet assembly period according to the message type; and using the target configuration file, the Ethernet message queue is converted into a bus communication message queue.

[0011] Optionally, the Ethernet message queue includes at least one first sub-queue corresponding to the message type; converting the Ethernet message queue into a bus communication message queue using the target configuration file includes: determining the target microcontroller corresponding to the target first sub-queue in the at least one first sub-queue according to the target configuration file; adding the bus communication message identifier corresponding to the target microcontroller to the target first sub-queue to obtain the bus communication message queue, wherein the bus communication message queue includes at least one second sub-queue corresponding to the at least one first sub-queue.

[0012] Optionally, generating a communication bus message to be sent based on the packet assembly result includes: determining the target quantity using the queue length of the target second sub-queue in the bus communication message queue, wherein the target quantity is the number of data frames contained in the communication bus message corresponding to the target second sub-queue; and generating a communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data.

[0013] Optionally, generating a communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data includes: creating a first data frame according to the queue length and the target quantity; creating at least one second data frame according to the queue content data; and generating a message data packet corresponding to the target second sub-queue in the communication bus message based on the first data frame and at least one second data frame.

[0014] Optionally, sending the communication bus message to the target microcontroller among the multiple candidate microcontrollers includes: selecting the target microcontroller corresponding to the target second sub-queue from the multiple candidate microcontrollers according to the bus communication message identifier recorded in the target second sub-queue; and sending the message data packet corresponding to the target second sub-queue to the target microcontroller.

[0015] According to another aspect of the present invention, a message sending apparatus is also provided, comprising: a receiving module for receiving Ethernet messages sent by multiple processes of a vehicle; a packet assembly module for assembling Ethernet messages using the message type of the Ethernet messages and a target configuration file to obtain a packet assembly result, wherein the target configuration file is used to define the correspondence between message types and multiple candidate microcontrollers of the vehicle; a generating module for generating a communication bus message to be sent based on the packet assembly result; and a sending module for sending the communication bus message to a target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller is used to control a target actuator of the vehicle to perform a target action, and the target action is determined by the process functions of the multiple processes.

[0016] According to another aspect of the present invention, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is running, it controls the device where the storage medium is located to execute the message transmission method of any of the above.

[0017] According to another aspect of the present invention, a vehicle is also provided, including an on-board memory and an on-board processor, wherein the on-board memory stores a computer program, and the on-board processor is configured to run the computer program to execute the message transmission method of any of the above.

[0018] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the message transmission method of any of the above.

[0019] In this embodiment of the invention, Ethernet packets sent by multiple processes of a vehicle are received; the Ethernet packets are reassembled using their packet types and target configuration files to obtain a packet assembly result, wherein the target configuration file defines the correspondence between packet types and multiple candidate microcontrollers of the vehicle; based on the packet assembly result, a communication bus packet to be sent is generated; the communication bus packet is sent to the target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller controls the target actuator of the vehicle to perform a target action, the target action being determined by the process functions of the multiple processes. Thus, this invention achieves the goal of reducing the occupation of communication channels and ensuring packet transmission efficiency by reassembling Ethernet packets to generate communication bus packets to be sent, thereby improving packet transmission efficiency in high-concurrency, high-data-volume scenarios and reducing the risk of vehicle execution lag. This solves the problem that packet transmission methods provided in related technologies are difficult to apply to high-concurrency, high-data-volume scenarios and easily lead to vehicle execution lag. Attached Figure Description

[0020] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0021] Figure 1 This is a hardware structure block diagram of a computing terminal for a message sending method according to an embodiment of the present invention;

[0022] Figure 2 This is a flowchart of a message sending method according to an embodiment of the present invention;

[0023] Figure 3 This is a schematic diagram of an optional SOC chip message transmission process according to an embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of an optional message generation and transmission process according to an embodiment of the present invention;

[0025] Figure 5 This is a schematic diagram of an optional single-process message data processing procedure according to an embodiment of the present invention;

[0026] Figure 6 This is a structural block diagram of a message sending device according to an embodiment of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] According to an embodiment of the present invention, a method embodiment for a message transmission method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, steps shown or described may be executed in a different order than that shown here.

[0030] Figure 1 This is a hardware structure block diagram of an optional computing terminal for a message sending method according to an embodiment of the present invention, such as... Figure 1 As shown, a computing terminal (e.g., a computer terminal, a mobile smart terminal, a vehicle terminal, or a cloud computing virtual terminal) may include: one or more processors 102, a memory 104, and a transmission device 106 configured to implement communication functions. Each processor 102 may include, but is not limited to, a processing component such as a microprocessor (MCU) or a field programmable gate array (FPGA).

[0031] The aforementioned computing terminal may further include: a display device 110, an input / output device 108, a Universal Serial Bus (USB) port (which can be used as one of the ports of a computer bus, not shown in the figure), a network interface (not shown in the figure), a power supply (not shown in the figure), and a camera (not shown in the figure). Those skilled in the art will understand that... Figure 1 The structure of the computing terminal shown is for illustrative purposes only and does not impose strict limitations on the structure of the computing terminal described above. For example, the computing terminal may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0032] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits may be embodied, in whole or in part, as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within a computing terminal (or mobile device).

[0033] The memory 104 may be configured to store software programs and modules for application software, such as the program instructions / data storage device corresponding to the message sending method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned message sending method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computing terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is configured to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computing terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, configured to communicate with the Internet wirelessly.

[0035] Under the above operating environment, the embodiments of the present invention provide as follows: Figure 2 The message sending method shown is as follows: Figure 2This is a flowchart of a message sending method according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following implementation steps:

[0036] Step S201: Receive Ethernet packets sent by multiple processes of the vehicle;

[0037] Step S202: Using the message type and target configuration file of the Ethernet message, the Ethernet message is assembled into a packet to obtain the packet assembly result. The target configuration file is used to define the correspondence between the message type and multiple candidate microcontrollers of the vehicle.

[0038] Step S203: Based on the packet assembly result, generate a communication bus message to be sent;

[0039] Step S204: The communication bus message is sent to the target microcontroller among multiple candidate microcontrollers. The target microcontroller is used to control the target actuator of the vehicle to perform the target action. The target action is determined by the process functions of multiple processes.

[0040] The vehicle's SOC chip can include a microprocessor unit (MPU) core and a microcontroller unit (MCU) core, as well as a data management model (DMM) connected to the MPU core and MCU core. The implementation steps provided in this embodiment can be configured to be executed by the DMM. That is, the DMM can assemble Ethernet packets sent by threads running in the MPU core and then send CAN bus packets to the vehicle's MCU, reducing the occupation of the inter-process communication (IPC) channel when the MPU core needs to send CAN bus packets.

[0041] Through steps S201 to S204 described above, this application receives Ethernet messages sent by multiple processes of the vehicle; uses the message type and target configuration file of the Ethernet messages to reassemble the Ethernet messages into packets, obtaining a packet assembly result, wherein the target configuration file is used to define the correspondence between message types and multiple candidate microcontrollers of the vehicle; based on the packet assembly result, a communication bus message to be sent is generated; and the communication bus message is sent to the target microcontroller among the multiple candidate microcontrollers. Thus, this invention achieves the goal of reducing the occupation of communication channels and ensuring message transmission efficiency by reassembling Ethernet messages to generate communication bus messages to be sent, thereby improving message transmission efficiency in high-concurrency, high-data-volume scenarios and reducing the risk of vehicle execution lag. This solves the problem that message transmission methods provided in related technologies are difficult to apply to high-concurrency, high-data-volume scenarios and easily lead to vehicle execution lag.

[0042] The methods described in the embodiments of the present invention will be further described below.

[0043] In an exemplary application scenario, the SOC chip includes an MPU core and an MCU core. The MPU core runs the Linux operating system, while the MCU core runs the standard AUTOSAR CP operating system (an operating system based on the vehicle open electronic systems standard). Typically, the MPU core can send Ethernet messages. If the MPU core needs to send CAN bus messages, it can transfer the message data to the MCU core via the IPC communication channel, and then the MCU core will send the CAN bus messages.

[0044] In the above application scenarios, the process of the SOC chip sending messages can be illustrated as follows: Figure 3 As shown, according to the solutions provided by related technologies, when a process in the MPU core needs to send a CAN bus message, that process will directly occupy the IPC communication channel to transmit the message data, while the MCU core will occupy the CAN bus message transmission channel to send the message data. The solutions provided by these related technologies are suitable for situations where the data volume is small and the number of processes running in the MPU core is small. However, when the data volume is high (e.g., tens of thousands of messages) or the number of processes running in the MPU core is large (e.g., thousands of processes), the solutions provided by these related technologies will lead to excessive data transmission load, causing chip lag, preventing message data from being sent to the actuator in a timely manner, resulting in component execution lag (e.g., motor acceleration jerking), and affecting the user experience.

[0045] In response, this embodiment of the invention uses DMM to realize the packetization and transmission of Ethernet packets, avoiding the need to occupy the IPC communication channel for each Ethernet packet transmission. This makes the packet transmission method more suitable for high-concurrency, high-data-volume scenarios, reducing SOC chip lag and lowering the risk of vehicle component execution lag.

[0046] Optionally, the above message sending method may further include the following steps:

[0047] Step S251: Based on the process functions of the multiple processes, determine at least one message type corresponding to each process in the multiple processes;

[0048] Step S252: Based on at least one message type, create a corresponding message sending and receiving interface for each message type.

[0049] Based on the above method steps, embodiments of the present invention provide, as follows: Figure 4 The message transmission scheme is shown below. Figure 4 As shown, the multiple processes running in the MPU include: Process 1, Process 2, Process 3, and Process 4, each with a different function. Each process may send Ethernet packets of at least one message type depending on its function. For example... Figure 4 As shown, process 1 can send message Y1, process 2 can send messages Y2 and Y3, process 3 can send messages 4 and 5, and process 4 can send message Y6.

[0050] It should be noted that messages Y1, Y2, Y3, Y4, Y5, and Y6 can be understood as different types of Ethernet messages. In this embodiment of the invention, the Data Management Component (DMM) can create a corresponding message transceiver interface for each message type. For example, the DMM will receive message Y1 sent by process 1 through the message transceiver interface corresponding to message Y1.

[0051] For example, process 2 is the intelligent driving control process. Message Y2 sent by this process is a motor control message, and message Y3 sent by this process is an electronic control system control message. Correspondingly, an interface "DMM_TX_Msg2(vector<int>)" is created for message Y2.<uint_8> &a), create an interface "DMM_TX_Msg3(vector)" for message Y3.<uint_8> &a), thus, process 2 can call the interface "DMM_TX_Msg2(vector<int>)"<uint_8> Process 2 sends message Y2 to DMM via the interface "DMM_TX_Msg3(vector<int>)".<uint_8> &a)”Send message Y3 to DMM.

[0052] Optionally, in step S201 above, receiving Ethernet packets sent by multiple processes of the vehicle may further include the following execution steps:

[0053] Step S211: During the current packet assembly period, receive Ethernet packets sent by multiple processes through the message transceiver interface.

[0054] In application scenarios, the DMM will periodically process Ethernet packets sent by multiple processes according to a preset packet assembly period (e.g., 10 milliseconds). Within the current packet assembly period, the DMM receives all Ethernet packets sent by multiple processes within the current packet assembly period through the packet transceiver interface, so as to perform unified processing of the packet data of these Ethernet packets subsequently.

[0055] Optionally, the packet assembly result includes the bus communication message queue; in step S202 above, the Ethernet packets are assembled using the packet type and target configuration file to obtain the packet assembly result, and may also include the following execution steps:

[0056] Step S221: Add the Ethernet packet to the Ethernet message queue corresponding to the current packet assembly period according to the packet type.

[0057] Step S222: Using the target configuration file, the Ethernet message queue is converted into a bus communication message queue.

[0058] In the application scenario, the process of assembling Ethernet packets is explained using process 2 as an example. Figure 5 As shown, during the execution of process 2, in the first phase of the current packet assembly cycle, message Y2 sends "12345678", adding its data to the Ethernet message queue. At this time, the Ethernet message queue contains the sub-queue corresponding to message Y2, and the data in this sub-queue includes "12345678". In the second phase of the current packet assembly cycle, message Y3 sends "12345678", adding its data to the Ethernet message queue. At this time, the Ethernet message queue contains the sub-queues corresponding to both message Y2 and message Y3. The data in the subqueue corresponding to message Y3 includes "12345678". In the third stage of the current packet assembly cycle, message Y2 sends 12345678, adding the message data of message Y2 to the Ethernet message queue. At this time, the Ethernet message queue contains the subqueue corresponding to message Y2 and the subqueue corresponding to message Y3. The data in the subqueue corresponding to message Y2 is updated to "1234567812345678". That is, the subqueue corresponding to message Y2 can concatenate and store the message data corresponding to message Y2 in the first and third stages.

[0059] The aforementioned target configuration file can be a pre-defined configuration file. This target configuration file stores key message parameters corresponding to multiple processes and multiple controllers (or multiple actuators), and establishes a correspondence between key message parameters based on the correspondence between multiple processes and multiple controllers. In other words, the target configuration file is used to define the correspondence between message types and multiple candidate microcontrollers of the vehicle.

[0060] It should be noted that, depending on the application scenario requirements, the packet data of the Ethernet message can be copied to the Ethernet message queue according to the target configuration file, or the Ethernet message queue can be converted into a CAN message queue according to the target configuration file.

[0061] For example, the target configuration file mentioned above can be used to represent the following correspondence: the message ID of the CAN bus message of actuator 1 (such as a motor) is 0x1, which is converted from message Y1 or message Y2; the message ID of the CAN bus message of actuator 2 (such as a battery) is 0x2, which is converted from message Y3 or message Y4; the message ID of the CAN bus message of actuator 3 (such as an electronic control unit) is 0x3, which is converted from message Y5 or message Y6.

[0062] Optionally, the Ethernet message queue includes at least one first sub-queue corresponding to the message type; in step S222 above, converting the Ethernet message queue into a bus communication message queue using the target configuration file may further include the following execution steps:

[0063] Step S223: Based on the target configuration file, determine the target microcontroller corresponding to at least one target first sub-queue in the first sub-queue;

[0064] Step S224: Add the bus communication message identifier corresponding to the target microcontroller to the target first sub-queue to obtain the bus communication message queue, wherein the bus communication message queue includes at least one second sub-queue corresponding to at least one first sub-queue.

[0065] In the application scenario, based on the target configuration file, the target MCU corresponding to each first sub-queue in the Ethernet message queue can be determined. This target MCU can be the MCU whose message data is to be sent to the corresponding first sub-queue. For example, if the message data of message Y2 is to be sent to actuator 1 (such as a motor), then the target MCU corresponding to the Ethernet message sub-queue of message Y2 can be the motor controller. Further, the identifier 0x1 of this target MCU is added to the first sub-queue corresponding to message Y2, and similarly, the identifier 0x2 is added to the first sub-queue corresponding to message Y3, thus obtaining the bus communication message queue.

[0066] Still as Figure 5As shown, the bus communication message queue includes: a second sub-queue "0x1_1234567812345678" corresponding to message Y2 and a second sub-queue "0x2_12345678" corresponding to message Y3. The second sub-queue "0x1_1234567812345678" is to be sent to actuator 1 (e.g., a motor), and the second sub-queue "0x2_12345678" is to be sent to actuator 2 (e.g., a battery).

[0067] Furthermore, we obtain, as Figure 5 After the bus communication message queue shown, the data in at least one second sub-queue will be transferred to the MCU core through the IPC communication channel, and then sent by the MCU core to the CAN bus, and then transmitted to the corresponding actuator to control the actuator to perform actions.

[0068] Optionally, in step S203 above, generating the communication bus message to be sent based on the packet assembly result may further include the following execution steps:

[0069] Step S231: Determine the target quantity using the queue length of the target second sub-queue in the bus communication message queue, wherein the target quantity is the number of data frames contained in the communication bus message corresponding to the target second sub-queue;

[0070] Step S232: Generate a communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data.

[0071] In application scenarios, since a CAN bus message sends 8 bytes of data at a time, but the message data to be sent usually exceeds 8 bytes, in order to ensure the efficiency of message data transmission, ensure the continuous transmission of message data to avoid data frame loss, and reduce message data transmission errors, the above execution steps of this embodiment of the invention provide a method for generating communication bus messages.

[0072] Taking the second sub-queue "0x1_1234567812345678" corresponding to message Y2 in the aforementioned application scenario as an example, the 16 bytes of data in "12345657812345678" will be split into two data frames for transmission. In other words, the number of data frames to be generated is determined based on the queue length of the second sub-queue "0x1_1234567812345678" corresponding to message Y2 in the bus communication message queue. Further, based on the number of data frames, the queue length, and the queue content data of the second sub-queue "0x1_1234567812345678", a CAN bus message to be transmitted is generated.

[0073] Optionally, in step S232 above, generating a communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data may further include the following execution steps:

[0074] Step S233: Create the first data frame according to the queue length and the number of targets;

[0075] Step S234: Create at least one second data frame according to the queue content data;

[0076] Step S235: Based on the first data frame and at least one second data frame, generate a message data packet in the communication bus message that corresponds to the target second sub-queue.

[0077] The data in the first data frame described above is used to represent the queue length and the number of targets. Taking the second sub-queue "0x1_1234567812345678" corresponding to message Y2 in the aforementioned application scenario as an example, the queue length is 16, and the number of targets corresponding to this second sub-queue is 3. Based on this, the created first data frame is "0x00 00 00 10 00 00 00 03". The first 4 bytes of data in the first data frame indicate that the queue length is 16, and the last 4 bytes of data in the first data frame indicate that the message data of length 16 needs to be split into 3 data frames for transmission.

[0078] Furthermore, the message data "1234567812345678" in the second sub-queue "0x1_12345678" corresponding to message Y2 is split into three 8-byte second data frames: "0x01 01 02 03 0405 0607", "0x02 08 01 02 03 04 05 06", and "0x03 07 08 00 00 00 00 00". The first byte of each of these three second data frames can represent the frame number of that second data frame.

[0079] Furthermore, the first data frame mentioned above is taken as the first data frame in the message data packet corresponding to message Y2, and the three second data frames are arranged in order of frame number as the subsequent data frames of the aforementioned message data packet (that is, the second to fourth data frames), thereby generating the communication bus message corresponding to message Y2. Still as... Figure 4 As shown, message Y2 is an Ethernet message to be sent to actuator 1. The data management component can generate message C1 based on message Y2 according to the above execution steps. It should be noted that message C1 is a CAN bus message, and message C1 may contain more than just the message data corresponding to message Y2. In addition, messages C2 and C3 are also CAN bus messages, with message C2 corresponding to actuator 2 and message C3 corresponding to actuator 3.

[0080] Optionally, in step S204 above, sending the communication bus message to the target microcontroller among multiple candidate microcontrollers may further include the following execution steps:

[0081] Step S241: Select the target microcontroller corresponding to the target second sub-queue from multiple candidate microcontrollers based on the bus communication message identifier recorded in the target second sub-queue;

[0082] Step S242: Send the message data packet corresponding to the second sub-queue of the target to the target microcontroller.

[0083] In the application scenario, the target MCU is determined based on the message data packet corresponding to each CAN bus message, and the message data packet is sent to the target MCU.

[0084] According to the solutions provided by relevant technologies, it is assumed that it takes 10ms for a single MPU core to send a CAN bus message to the bus, while it takes 10000ms for 1000 processes to each send a CAN bus message to the bus. However, through the above steps, the message sending method provided in this embodiment of the invention can shorten the time for 1000 processes to each send a CAN bus message to the bus to no more than 100ms, thereby improving message transmission efficiency.

[0085] In application scenarios, based on the embodiments of the present invention, a method for assembling Ethernet packets can also be provided. By filling in the key parameters of the packets corresponding to multiple processes in the configuration file, Ethernet packets sent by multiple processes are periodically combined into an Ethernet packet data packet for transmission.

[0086] In application scenarios, based on embodiments of the present invention, a CAN bus message packet assembly method is also provided. By filling in the message key parameters corresponding to multiple actuators in the configuration file, the Ethernet message data packets are split or combined to obtain CAN bus message data packets to be sent to each actuator.

[0087] As described above, this embodiment of the invention combines the above-mentioned Ethernet message packetization scheme with the above-mentioned CAN bus message packetization scheme to decouple the Ethernet transmission module corresponding to the vehicle SOC from the CAN bus transmission module corresponding to the vehicle actuator, thereby enabling flexible configuration of the message transmission method and improving the development efficiency of the vehicle controller.

[0088] Furthermore, this embodiment of the invention also provides a long-frame CAN bus message transmission scheme to ensure the accuracy of message data and the real-time transmission of a large amount of concurrent message data.

[0089] According to embodiments of the present invention, an apparatus embodiment for a message sending device is also provided. This message sending device is configured to implement the above-described method embodiments and various optional implementations of the method embodiments. The technical content already described above will not be repeated in the apparatus embodiment. It should be noted that, in the following related descriptions of the apparatus embodiment, a "module" can be configured as software, hardware, or a combination of software and hardware that implements a specified function.

[0090] Figure 6 This is a structural block diagram of a message sending device according to an embodiment of the present invention, such as... Figure 6 As shown, the device includes:

[0091] The receiving module 601 is used to receive Ethernet packets sent by multiple processes of the vehicle;

[0092] The packet assembly module 602 is used to assemble Ethernet packets using the packet type and target configuration file to obtain the packet assembly result. The target configuration file is used to define the correspondence between packet types and multiple candidate microcontrollers of the vehicle.

[0093] The generation module 603 is used to generate communication bus messages to be sent based on the packet assembly results;

[0094] The sending module 604 is used to send communication bus messages to the target microcontroller among multiple candidate microcontrollers. The target microcontroller is used to control the target actuator of the vehicle to perform the target action, which is determined by the process functions of multiple processes.

[0095] Optionally, in addition to all the modules mentioned above, the above-mentioned message sending device also includes a creation module 605 (not shown in the figure), which is used to: determine at least one message type corresponding to each process in the multiple processes according to the process functions of the multiple processes; and create a corresponding message sending and receiving interface for each message type based on the at least one message type.

[0096] Optionally, the receiving module 601 is further configured to: receive Ethernet packets sent by multiple processes through the message transceiver interface during the current packet assembly period.

[0097] Optionally, the packet assembly result includes a bus communication message queue; the packet assembly module 602 is further configured to: add Ethernet packets to the Ethernet message queue corresponding to the current packet assembly period according to the packet type; and convert the Ethernet message queue into a bus communication message queue using the target configuration file.

[0098] Optionally, the Ethernet message queue includes at least one first sub-queue corresponding to the message type; the packet assembly module 602 is further configured to: determine the target microcontroller corresponding to the target first sub-queue in the at least one first sub-queue according to the target configuration file; add the bus communication message identifier corresponding to the target microcontroller to the target first sub-queue to obtain a bus communication message queue, wherein the bus communication message queue includes at least one second sub-queue corresponding to at least one first sub-queue.

[0099] Optionally, the generation module 603 is further configured to: determine the target quantity using the queue length of the target second sub-queue in the bus communication message queue, wherein the target quantity is the number of data frames contained in the communication bus message corresponding to the target second sub-queue; and generate a communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data.

[0100] Optionally, the generation module 603 is further configured to: create a first data frame according to the queue length and the target quantity; create at least one second data frame according to the queue content data; and generate a message data packet in the communication bus message corresponding to the target second sub-queue based on the first data frame and at least one second data frame.

[0101] Optionally, the sending module 604 is further configured to: select the target microcontroller corresponding to the target second sub-queue from multiple candidate microcontrollers according to the bus communication message identifier recorded in the target second sub-queue; and send the message data packet corresponding to the target second sub-queue to the target microcontroller.

[0102] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0103] According to another aspect of the present invention, a computer-readable storage medium is also provided, the storage medium including a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to execute any of the aforementioned message transmission methods.

[0104] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: receiving Ethernet packets sent by multiple processes of the vehicle; assembling Ethernet packets into packets using the packet type and target configuration file of the Ethernet packets to obtain a packet assembly result, wherein the target configuration file is used to define the correspondence between packet types and multiple candidate microcontrollers of the vehicle; generating a communication bus packet to be sent based on the packet assembly result; and sending the communication bus packet to the target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller is used to control the target actuator of the vehicle to perform a target action, and the target action is determined by the process functions of the multiple processes.

[0105] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: determining at least one message type corresponding to each of the multiple processes based on the process functions of the multiple processes; and creating a corresponding message sending and receiving interface for each message type based on the at least one message type.

[0106] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: receiving Ethernet packets sent by multiple processes through a message transceiver interface during the current packet assembly cycle.

[0107] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: the packet assembly result includes a bus communication message queue; according to the message type, the Ethernet message is added to the Ethernet message queue corresponding to the current packet assembly period; and the Ethernet message queue is converted into a bus communication message queue using a target configuration file.

[0108] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: the Ethernet message queue includes at least one first sub-queue corresponding to a message type; according to the target configuration file, the target microcontroller corresponding to the target first sub-queue in the at least one first sub-queue is determined; the bus communication message identifier corresponding to the target microcontroller is added to the target first sub-queue to obtain a bus communication message queue, wherein the bus communication message queue includes at least one second sub-queue corresponding to at least one first sub-queue.

[0109] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: determining the target quantity using the queue length of the target second sub-queue in the bus communication message queue, wherein the target quantity is the number of data frames contained in the communication bus message corresponding to the target second sub-queue; and generating a communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data.

[0110] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: creating a first data frame according to the queue length and the target quantity; creating at least one second data frame according to the queue content data; and generating a message data packet in the communication bus message corresponding to the target second sub-queue based on the first data frame and at least one second data frame.

[0111] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: selecting a target microcontroller corresponding to the target second sub-queue from a plurality of candidate microcontrollers based on the bus communication message identifier recorded in the target second sub-queue; and sending the message data packet corresponding to the target second sub-queue to the target microcontroller.

[0112] Optionally, the aforementioned computer storage media may include, but are not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.

[0113] According to another aspect of the present invention, a vehicle is also provided, including an on-board memory and an on-board processor, wherein the on-board memory stores a computer program and the on-board processor is configured to run the computer program to execute the message transmission method of any of the foregoing embodiments.

[0114] Optionally, in this embodiment, the on-board processor can be configured to perform the following steps via a computer program: receiving Ethernet packets sent by multiple processes of the vehicle; using the packet type and target configuration file of the Ethernet packets to assemble the Ethernet packets into packets, obtaining a packet assembly result, wherein the target configuration file is used to define the correspondence between packet types and multiple candidate microcontrollers of the vehicle; generating a communication bus packet to be sent based on the packet assembly result; and sending the communication bus packet to the target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller is used to control the target actuator of the vehicle to perform a target action, and the target action is determined by the process functions of the multiple processes.

[0115] According to an embodiment of this application, a computer program product is also provided. Optionally, in this embodiment, the computer program product can provide a message sending service based on the message sending methods provided in the foregoing embodiments.

[0116] Optionally, in this embodiment, the computer program product described above may be a set of instructions and code pre-written according to the message sending method described above. This computer program product can run on various computer platforms, including personal computers, servers, mobile devices, etc.

[0117] Optionally, in this embodiment, the instructions and code corresponding to the computer program product are used to implement the following method steps: receiving Ethernet messages sent by multiple processes of the vehicle; using the message type and target configuration file of the Ethernet message to assemble the Ethernet message into a packet to obtain a packet assembly result, wherein the target configuration file is used to define the correspondence between the message type and multiple candidate microcontrollers of the vehicle; generating a communication bus message to be sent based on the packet assembly result; and sending the communication bus message to the target microcontroller among the multiple candidate microcontrollers, wherein the target microcontroller is used to control the target actuator of the vehicle to perform a target action, and the target action is determined by the process functions of the multiple processes.

[0118] The aforementioned computer program product provides message transmission services in application scenarios involving the conversion between Ethernet messages and CAN bus messages in the field of vehicle technology. It achieves the goal of reducing the occupation of communication channels and ensuring message transmission efficiency by repackaging Ethernet messages to generate communication bus messages to be sent. This improves message transmission efficiency in high-concurrency, high-data-volume scenarios and reduces the risk of vehicle execution lag. It also solves the problem that message transmission methods provided in related technologies are difficult to apply to high-concurrency, high-data-volume scenarios and are prone to causing vehicle execution lag.

[0119] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and their optional implementations, and will not be repeated here.

[0120] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0121] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces; the indirect coupling or communication connection between units or modules can be electrical or other forms.

[0122] 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 units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0123] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0124] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or 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, ROM, RAM, portable hard drives, magnetic disks, or optical disks.

[0125] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A message sending method, characterized in that, include: Receive Ethernet packets sent by multiple processes of the vehicle; Using the message type and target configuration file of the Ethernet message, the Ethernet message is assembled into a packet to obtain the packet assembly result. The target configuration file is used to define the correspondence between the message type and multiple candidate microcontrollers of the vehicle. Based on the packet assembly results, a communication bus message to be sent is generated; The communication bus message is sent to the target microcontroller among the plurality of candidate microcontrollers, wherein the target microcontroller is used to control the target actuator of the vehicle to perform a target action, and the target action is determined by the process function of the plurality of processes; The packet assembly result includes a bus communication message queue; using the message type of the Ethernet message and the target configuration file, the Ethernet message is assembled into a packet to obtain the packet assembly result, which includes: adding the Ethernet message to the Ethernet message queue corresponding to the current packet assembly period according to the message type; and using the target configuration file to convert the Ethernet message queue into the bus communication message queue. The Ethernet message queue includes at least one first sub-queue corresponding to the message type; converting the Ethernet message queue into the bus communication message queue using the target configuration file includes: determining the target microcontroller corresponding to the target first sub-queue in the at least one first sub-queue according to the target configuration file; adding the bus communication message identifier corresponding to the target microcontroller to the target first sub-queue to obtain the bus communication message queue, wherein the bus communication message queue includes at least one second sub-queue corresponding to the at least one first sub-queue; Based on the packet assembly result, generating the communication bus message to be sent includes: determining the target quantity using the queue length of the target second sub-queue in the bus communication message queue, wherein the target quantity is the number of data frames contained in the communication bus message corresponding to the target second sub-queue; and generating the communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data. Generating the communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data includes: creating a first data frame according to the queue length and the target quantity; creating at least one second data frame according to the queue content data; and generating a message data packet corresponding to the target second sub-queue in the communication bus message based on the first data frame and the at least one second data frame.

2. The message sending method according to claim 1, characterized in that, The message sending method further includes: Based on the process functions of the plurality of processes, determine at least one message type corresponding to each of the plurality of processes; Based on the at least one message type, create a corresponding message sending and receiving interface for each message type.

3. The message sending method according to claim 2, characterized in that, Receiving the Ethernet packets sent by the plurality of processes of the vehicle includes: During the current packet assembly cycle, the Ethernet packets sent by the multiple processes are received through the message transceiver interface.

4. The message sending method according to claim 1, characterized in that, Sending the communication bus message to the target microcontroller among the plurality of candidate microcontrollers includes: Based on the bus communication message identifier recorded in the target second sub-queue, the target microcontroller corresponding to the target second sub-queue is selected from the plurality of candidate microcontrollers; The message data packet corresponding to the second sub-queue of the target is sent to the target microcontroller.

5. A message sending device, characterized in that, include: The receiving module is used to receive Ethernet packets sent by multiple processes of the vehicle. The packet assembly module is used to assemble the Ethernet packets using the packet type and target configuration file to obtain the packet assembly result. The target configuration file is used to define the correspondence between the packet type and multiple candidate microcontrollers of the vehicle. The generation module is used to generate a communication bus message to be sent based on the packet assembly result; A sending module is used to send the communication bus message to the target microcontroller among the plurality of candidate microcontrollers, wherein the target microcontroller is used to control the target actuator of the vehicle to perform a target action, and the target action is determined by the process function of the plurality of processes; The packet assembly result includes a bus communication message queue; the packet assembly module is further configured to add the Ethernet message to the Ethernet message queue corresponding to the current packet assembly period according to the message type; and use the target configuration file to convert the Ethernet message queue into the bus communication message queue. The Ethernet message queue includes at least one first sub-queue corresponding to the message type; the packet assembly module is further configured to determine the target microcontroller corresponding to the target first sub-queue in the at least one first sub-queue according to the target configuration file; add the bus communication message identifier corresponding to the target microcontroller to the target first sub-queue to obtain the bus communication message queue, wherein the bus communication message queue includes at least one second sub-queue corresponding to the at least one first sub-queue; The generation module is further configured to determine the target quantity using the queue length of the target second sub-queue in the bus communication message queue, wherein the target quantity is the number of data frames contained in the communication bus message corresponding to the target second sub-queue; and generate the communication bus message based on the target quantity, the queue length of the target second sub-queue, and the queue content data. The generation module is further configured to: create a first data frame according to the queue length and the target quantity; create at least one second data frame according to the queue content data; and generate a message data packet in the communication bus message corresponding to the target second sub-queue based on the first data frame and the at least one second data frame.

6. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the message sending method of any one of claims 1 to 4.

7. A vehicle, characterized in that, It includes an on-board memory and an on-board processor, wherein the on-board memory stores a computer program, and the on-board processor is configured to run the computer program to perform the message transmission method of any one of claims 1 to 4.

8. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the message sending method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-channel bus data simulation system

    CN104765709A

  • Vehicle data processing method, device and equipment based on service-oriented architecture

    CN117082102A