Communication data transmission methods, computer-readable storage media and intelligent devices
By negotiating the target format and packet communication data in the automotive electronic and electrical architecture, and directly copying the data to the network driver buffer using a fast transmission path, the performance bottleneck in the traditional SOA data transmission process is solved, achieving efficient communication data transmission. This method is suitable for microcontroller platforms without an MMU.
Patent Information
- Application Number
- CN202611576904.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-17
AI Technical Summary
Traditional SOA data transmission processes suffer from performance bottlenecks in automotive electronic and electrical architectures, especially on microcontroller platforms without an MMU. This leads to a waste of CPU computing resources and memory bandwidth, making it difficult to systematically reduce the number of copies and transmission latency.
By negotiating the target format between the sender and receiver, data is communicated in groups. A fast transmission path is used to copy data directly from the send buffer to the network driver send buffer, avoiding redundant copying. A binary serialization format with a memory layout consistent with the online format is adopted, and callback interfaces and buffers are configured to achieve efficient transmission.
It effectively reduces the number of redundant copies, improves the transmission efficiency of communication data, and reduces the consumption of CPU computing resources and memory bandwidth, making it suitable for microcontroller platforms without an MMU.
Smart Images

Figure CN123123434A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a communication data transmission method, a computer-readable storage medium, and a smart device. Background Technology
[0002] In current automotive electronic and electrical architectures, SOA (Service-Oriented Architecture)-based communication is the cornerstone for achieving high-performance service calls between various electronic control units (ECUs) within the vehicle. However, traditional SOA data transmission processes suffer from significant performance bottlenecks. A typical data transmission path requires multiple memory copies and expensive serialization operations, such as from user memory to the application framework cache, then to the SOA middleware stack, through protocol serialization, into the transport layer buffer, and finally to the network driver transmission buffer. This process typically involves up to four memory copies and one CPU-intensive serialization encoding operation. When processing high-frequency, highly periodic vehicle signals (such as sensor data and control commands), this consumes a significant amount of valuable CPU computing resources and memory bandwidth, limiting system real-time performance and increasing power consumption.
[0003] Existing optimization solutions mostly focus on single-layer improvements, lacking a collaborative mechanism that spans the application layer, middleware layer, and underlying driver, making it difficult to systematically reduce the number of copies, context switching, and transmission latency. Existing zero-copy solutions (such as Linux sendfile or scatter-gather DMA) are mainly geared towards general operating system scenarios and typically rely on MMU (Memory Management Unit) / virtual memory mechanisms, making them difficult to directly adapt to MCU environments without an MMU.
[0004] Accordingly, there is a need in the field for a new method for transmitting communication data to solve the above problems. Summary of the Invention
[0005] In order to overcome the above-mentioned defects, this application is proposed to solve, or at least partially solve, the technical problem of how to effectively reduce redundant copies and improve transmission efficiency for microcontroller platforms without MMU.
[0006] In a first aspect, a method for transmitting communication data is provided, the method comprising:
[0007] The sending end of the communication data and the receiving end of the communication data negotiate to determine the target format for transmitting communication data between the sending end and the receiving end;
[0008] Based on the meta-attributes of the communication data, the communication data to be sent is grouped to obtain multiple message groups; wherein, the meta-attributes include the target format;
[0009] In response to a group trigger, the sending path for sending communication data of the message group is determined based on the message format and payload length of the message group; wherein, the sending path includes a fast sending path; the fast sending path performs a memory copy of the communication data of the message group from the sending buffer of the sending end to the network driver sending buffer once;
[0010] According to the sending path, the communication data of the message group is sent.
[0011] In one technical solution of the above-mentioned communication data transmission method, the method further includes:
[0012] During the communication initialization phase, for the fast sending path, a callback interface for the communication data is registered, and a corresponding sending buffer is configured for the communication data;
[0013] The callback interface corresponds to the service identifier of the communication data.
[0014] In one technical solution of the above-mentioned communication data transmission method, the method further includes:
[0015] During the communication data transmission phase, the communication middleware calls the callback interface according to the service identifier and obtains the address and effective length of the transmission buffer, so as to perform a memory copy of the communication data of the message group from the transmission buffer of the sending end to the network driver transmission buffer according to the callback interface, the address and the effective length.
[0016] In one technical solution of the above-mentioned communication data transmission method, determining the target format for communication data transmission between the sending end and the receiving end includes:
[0017] The sending end sends a set of supported serialization format identifiers and their priority order;
[0018] The receiving end determines the target format from the serialization formats supported by both parties according to the priority order and the serialization format identifier, and returns an acknowledgment message to the sending end.
[0019] In one technical solution of the above-mentioned communication data transmission method, the method further includes:
[0020] If no serialization format is supported by both parties, a preset compatible format is determined as the target format.
[0021] In one technical solution of the above-mentioned communication data transmission method, the meta-attribute further includes at least one of the following: the transmission period of the communication data, the transmission priority, and the upper limit of the length.
[0022] In one technical solution of the above-mentioned communication data transmission method, there are multiple message groups; the multiple message groups correspond to different transmission periods and transmission priorities; the method further includes:
[0023] The communication data of the message groups is sent according to the sending priority of the multiple message groups.
[0024] In one technical solution of the above-mentioned communication data transmission method, determining the transmission path of the message group for transmitting communication data based on the message format and payload length of the message group includes:
[0025] If the message format is consistent with the target format, and the payload length is less than or equal to the single-frame capacity of the network driver sending buffer, then the sending path is determined to be a fast sending path.
[0026] In one technical solution of the above-mentioned communication data transmission method, the transmission path further includes a normal transmission path; the normal transmission path is a path that transmits communication data to the network driver transmission buffer according to the protocol layer serialization, intermediate buffer queue and driver transmission process.
[0027] In one technical solution of the above-mentioned communication data transmission method, the target format is a binary serialization format with a memory layout consistent with the online format.
[0028] In a second aspect, a smart device is provided, comprising: a first controller where a communication data transmitting end is located and a second controller where a communication data receiving end is located;
[0029] The first controller and the second controller are connected via a communication network;
[0030] Both the first controller and the second controller include:
[0031] At least one processor; and a memory communicatively connected to said at least one processor;
[0032] The memory stores a computer program, which, when executed by the at least one processor, implements the method described in any of the above-described technical solutions for the communication data transmission method.
[0033] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and run by a processor to perform the method described in any of the technical solutions of the above-described communication data transmission method.
[0034] Solution 1. A method for transmitting communication data, characterized in that the method includes:
[0035] The sending end of the communication data and the receiving end of the communication data negotiate to determine the target format for transmitting communication data between the sending end and the receiving end;
[0036] Based on the meta-attributes of the communication data, the communication data to be sent is grouped to obtain multiple message groups; wherein, the meta-attributes include the target format;
[0037] In response to a group trigger, the sending path for sending communication data of the message group is determined based on the message format and payload length of the message group; wherein, the sending path includes a fast sending path; the fast sending path performs a memory copy of the communication data of the message group from the sending buffer of the sending end to the network driver sending buffer once;
[0038] According to the sending path, the communication data of the message group is sent.
[0039] Solution 2. The communication data transmission method according to Solution 1, characterized in that the method further includes:
[0040] During the communication initialization phase, for the fast sending path, a callback interface for the communication data is registered, and a corresponding sending buffer is configured for the communication data;
[0041] The callback interface corresponds to the service identifier of the communication data.
[0042] Solution 3. The communication data transmission method according to Solution 2, characterized in that the method further includes:
[0043] During the communication data transmission phase, the communication middleware calls the callback interface according to the service identifier and obtains the address and effective length of the transmission buffer, so as to perform a memory copy of the communication data of the message group from the transmission buffer of the sending end to the network driver transmission buffer according to the callback interface, the address and the effective length.
[0044] Option 4. The communication data transmission method according to Option 1, characterized in that,
[0045] Determining the target format for communication data transmission between the sending end and the receiving end includes:
[0046] The sending end sends a set of supported serialization format identifiers and their priority order;
[0047] The receiving end determines the target format from the serialization formats supported by both parties according to the priority order and the serialization format identifier, and returns an acknowledgment message to the sending end.
[0048] Solution 5. The communication data transmission method according to Solution 4, characterized in that the method further includes:
[0049] If no serialization format is supported by both parties, a preset compatible format is determined as the target format.
[0050] Scheme 6. The communication data transmission method according to Scheme 1, wherein the meta-attribute further includes at least one of the following: the transmission period of the communication data, the transmission priority, and the upper limit of the length.
[0051] Solution 7. The communication data transmission method according to Solution 6, characterized in that the message group is multiple; the multiple message groups correspond to different transmission periods and transmission priorities; the method further includes:
[0052] The communication data of the message groups is sent according to the sending priority of the multiple message groups.
[0053] Option 8. The communication data transmission method according to Option 1, characterized in that,
[0054] The step of determining the transmission path for sending communication data in the message group based on the message format and payload length includes:
[0055] If the message format is consistent with the target format, and the payload length is less than or equal to the single-frame capacity of the network driver sending buffer, then the sending path is determined to be a fast sending path.
[0056] Scheme 9. The communication data transmission method according to Scheme 1 or 8, characterized in that the transmission path further includes a normal transmission path; the normal transmission path is a path that transmits communication data to the network driver transmission buffer according to protocol layer serialization, intermediate buffer queue and driver transmission process.
[0057] Option 10. The communication data transmission method according to any one of Options 1 to 9, characterized in that,
[0058] The target format is a binary serialization format with a memory layout consistent with the online format.
[0059] Option 11. A smart device, characterized in that it comprises: a first controller where the transmitting end of communication data is located and a second controller where the receiving end of communication data is located;
[0060] The first controller and the second controller are connected via a communication network;
[0061] Both the first controller and the second controller include:
[0062] At least one processor;
[0063] And, a memory communicatively connected to the at least one processor;
[0064] The memory stores a computer program, which, when executed by the at least one processor, implements the communication data transmission method described in any one of schemes 1 to 10.
[0065] Scheme 12. A computer-readable storage medium storing a plurality of program codes, characterized in that the program codes are adapted to be loaded and run by a processor to perform the communication data transmission method described in any one of Schemes 1 to 10.
[0066] The above-described technical solutions of this application have at least one or more of the following beneficial effects:
[0067] In implementing the communication data transmission method provided in this application, the sending end and receiving end of the communication data negotiate to determine the target format for transmitting communication data between them; based on the meta-attributes of the communication data, the communication data to be transmitted is grouped to obtain multiple message groups; wherein, the meta-attributes include the target format; in response to group triggering, the transmission path for transmitting the communication data of the message group is determined based on the message format and payload length of the message group; wherein, the transmission path includes a fast transmission path; the fast transmission path performs a memory copy of the communication data of the message group from the sending buffer of the sending end to the network driver sending buffer; and the communication data of the message group is transmitted according to the transmission path. Through the above configuration method, this application can achieve group scheduling and path diversion in the communication data transmission process by grouping communication data, reducing the scheduling overhead and latency jitter caused by processing each message independently. Furthermore, this application determines the sending path of message group communication data based on message format and payload length. This enables a fast sending path, performing a single memory copy of the message group's communication data from the sending buffer to the network driver's sending buffer. This effectively avoids the communication middleware copying communication data or allocating temporary buffers within its own context, reducing stack occupancy and fragmentation risks, and significantly improving communication data transmission efficiency. The communication data sending method of this application can be implemented without relying on an MMU or virtual memory mechanism, and can also reduce redundant copying on microcontroller platforms without an MMU.
[0068] Furthermore, by configuring corresponding send buffers and callback interfaces for communication data, this application can facilitate the implementation of a faster send path and avoid redundant copying.
[0069] Furthermore, the binary serialization format used in this application, which has the same memory layout as the online format, can effectively reduce the number of data transfers during the serialization and deserialization processes in the fast transmission path, thereby further improving data transmission efficiency. Attached Figure Description
[0070] The disclosure of this application will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this application. Wherein:
[0071] Figure 1 This is a schematic flowchart of the main steps of a communication data transmission method according to an embodiment of this application;
[0072] Figure 2 This is a schematic diagram of the main structure of a smart device according to an embodiment of this application.
[0073] Figure label:
[0074] 11: First controller; 12: Second controller. Detailed Implementation
[0075] Some embodiments of this application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of this application and are not intended to limit the scope of protection of this application.
[0076] In the description of this application, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, and memory, and may also include software components, such as program code, or a combination of software and hardware. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular forms of the terms "a" and "this" can also include plural forms.
[0077] The relevant user personal information that may be involved in the various embodiments of this application is processed in strict accordance with the requirements of laws and regulations, following the principles of legality, legitimacy, and necessity, based on the reasonable purpose of the business scenario, and includes personal information that users actively provide or that is generated as a result of using the product / service, as well as personal information obtained with user authorization.
[0078] The personal information processed in this application will vary depending on the specific product / service scenario and will be based on the specific scenario in which the user uses the product / service. This may involve the user's account information, device information, driving information, vehicle information, or other related information. This application will treat the user's personal information and its processing with the utmost diligence.
[0079] This application attaches great importance to the security of users' personal information and has taken reasonable and feasible security protection measures that comply with industry standards to protect users' information and prevent unauthorized access, disclosure, use, modification, damage or loss of personal information.
[0080] See appendix Figure 1 , Figure 1 This is a schematic flowchart illustrating the main steps of a communication data transmission method according to an embodiment of this application. Figure 1 As shown, the communication data transmission method in this application embodiment mainly includes the following steps S101 to S104.
[0081] Step S101: The sending end and receiving end of the communication data negotiate to determine the target format for sending communication data between the sending end and the receiving end.
[0082] In this embodiment, the sending end and receiving end of the communication data can determine the target format for sending the communication data through negotiation.
[0083] In one implementation, the first controller, where the transmitting end is located, and the second controller, where the receiving end is located, can be connected via a communication network. The first and second controllers can be deployed in different domains of the vehicle (e.g., body domain, intelligent driving domain, cockpit domain, etc.). The first and second controllers achieve cross-domain communication through the communication network. This communication network can be an in-vehicle Ethernet network, a CAN (Controller Area Network) bus network, etc.
[0084] In one implementation, the first controller and the second controller can be an MCU (Microcontroller Unit), an MPU (Microprocessor Unit), or a SoC (System on Chip), respectively. The transmitting end can run on a microcontroller that does not contain an MMU (Memory Management Unit).
[0085] In one implementation, the sender may send a set of supported serialization format identifiers and a priority order. The receiver may determine the target format from the serialization formats supported by both parties based on the priority order and the serialization format identifiers, and return an acknowledgment message to the sender.
[0086] In one implementation, if neither the sender nor the receiver has a serialization format that both support, a preset compatible format can be determined as the target format.
[0087] In one implementation, before the target format negotiation between the sender and receiver, i.e., during the communication initialization phase, a callback interface for the communication data can be registered, and a corresponding send buffer can be configured for the communication data. The callback interface can correspond to the service identifier of the communication data.
[0088] In this embodiment, different callback interfaces can be registered for different sending services, and the callback interfaces can correspond to service identifiers. Static or pre-allocated sending buffers can be configured for different sending services. That is, in the initial stage of communication, the callback function with buffer mechanism in this application embodiment avoids the communication middleware from allocating temporary buffers in its own context, thereby effectively reducing stack occupancy and fragmentation risks.
[0089] In one implementation, during the data transmission phase, the communication middleware can invoke the callback interface (callback_fn) based on the service identifier (message_id) and obtain the address and effective length of the transmission buffer. The communication middleware does not create an intermediate temporary buffer for copying data during the data transmission phase.
[0090] In one implementation, the communicating parties can automatically exchange a set of serialization format identifiers and a priority order during the service discovery phase through message capabilities (e.g., the serialization formats supported by both parties can be listed in the form of a serialization format identifier list).
[0091] In one implementation, the target format can be a binary serialization format with a memory layout consistent with the wire format.
[0092] In this embodiment, using a binary serialization format with a memory layout consistent with the online format can effectively reduce data transfer during serialization and deserialization, thereby further improving the efficiency of communication data transmission. The online format refers to the underlying binary or text encoding specification used when data is transmitted in a communication network ("wire"). It is the core part of the serialization protocol, determining how data is packaged, sent, and decoded. The online format can include two serialization formats: Protobuf and Nano. Protobuf offers advantages such as compression and multi-platform compatibility. Nano is a compact binary serialization format with a memory layout consistent with the online format, which is more suitable for MCU RTOS (Real-Time Operator System) and can be directly copied to memory.
[0093] Step S102: Based on the meta-attributes of the communication data, group the communication data to be sent to obtain multiple message groups; wherein, the meta-attributes include the target format.
[0094] In this embodiment, the communication data to be sent can be grouped and arranged according to the meta-attributes of the communication data to obtain multiple message groups.
[0095] In one implementation, communication data can be grouped based on the meta-attributes of the communication data, using a group scheduling manager.
[0096] In one implementation, the meta-attributes may include at least the transmission period of the communication data, priority, negotiated target format, and upper limit of length.
[0097] In one implementation, there can be multiple message groups; these message groups correspond to different sending periods and sending priorities. The communication data of the message groups can be sent according to their sending priorities. That is, higher-priority message groups are scheduled to execute before lower-priority message groups.
[0098] Step S103: In response to group triggering, determine the sending path for the message group to send communication data based on the message format and payload length of the message group; wherein, the sending path includes a fast sending path; the fast sending path performs a memory copy of the message group's communication data from the sending buffer of the sending end to the network driver sending buffer once.
[0099] In this embodiment, after a message group is triggered, the sending path for sending communication data can be determined by combining the message format and payload length of the message group.
[0100] In one implementation, the transmission path may include a fast transmission path and a normal transmission path.
[0101] In this embodiment, the fast sending path performs a single memory copy of the message group's communication data from the sender's send buffer to the network driver send buffer. The normal sending path, on the other hand, sends the communication data to the network driver send buffer according to the protocol layer serialization, intermediate buffer queue, and driver sending process.
[0102] In one implementation, if the message format matches the target format and the payload length is less than or equal to the single-frame capacity of the network driver's transmit buffer, then the transmission path for the communication data can be determined as a fast transmission path. If the above requirements are not met, then the transmission path for the communication data can be determined as a normal transmission path. Through this method, the number of redundant copies of communication data can be reduced while also achieving effective data offloading.
[0103] In one implementation, the single-frame capacity of the network-driven transmit buffer can be the frame payload capacity corresponding to the maximum transmission unit (MTU) of the network link.
[0104] In one implementation, the network driver buffer can be a DMA (Direct Memory Access) buffer, and the group trigger can be a DMA transfer trigger.
[0105] In one implementation, group triggering can be based on a sending cycle. That is, the scheduler can trigger the corresponding message group according to the sending cycle and process the communication data within the message group sequentially in one trigger.
[0106] Step S104: Send the communication data of the message group according to the sending path.
[0107] In this embodiment, the communication data of the message group can be sent based on a determined sending path.
[0108] In one implementation, the transmission path of the communication data for a message group can be determined in the following way:
[0109] For message groups and ungrouped communication data that do not meet the sending conditions of the fast sending path: use the normal sending path;
[0110] For Nano communication data in packets: use a fast send path;
[0111] For Protobuf communication data in packets: use the normal send path;
[0112] For communication data whose payload length exceeds the single-frame capacity of the network driver's send buffer: use the normal send path.
[0113] Based on the methods described in steps S101 to S104 above, in this embodiment of the application, the sending end and receiving end of the communication data negotiate to determine the target format for sending communication data between the sending end and the receiving end; according to the meta-attributes of the communication data, the communication data to be sent is grouped to obtain multiple message groups; wherein, the meta-attributes include the target format; in response to group triggering, the sending path for sending communication data of the message group is determined according to the message format and payload length of the message group; wherein, the sending path includes a fast sending path; the fast sending path performs a memory copy of the communication data of the message group from the sending buffer of the sending end to the network driver sending buffer; according to the sending path, the communication data of the message group is sent. Through the above configuration method, this embodiment of the application can realize group scheduling and path diversion in the communication data sending process by grouping communication data, reducing the scheduling overhead and latency jitter caused by processing each message independently. Meanwhile, this application embodiment determines the sending path of the message group's communication data based on the message format and payload length. This enables a fast sending path, performing a single memory copy of the message group's communication data from the sending buffer to the network driver's sending buffer. This effectively avoids the communication middleware copying communication data or allocating temporary buffers within its own context, reducing stack occupancy and fragmentation risks, and significantly improving the transmission efficiency of communication data. The communication data sending method of this application embodiment can be implemented without relying on an MMU or virtual memory mechanism, and can also reduce redundant copying on microcontroller platforms without an MMU.
[0114] Furthermore, by configuring corresponding sending buffers and callback interfaces for communication data, the embodiments of this application can facilitate the rapid implementation of sending paths and avoid redundant copying.
[0115] Furthermore, the binary serialization format used in this embodiment of the application, which has the same memory layout as the online format, can effectively reduce the number of data transfers during the serialization and deserialization process of communication data in the fast transmission path, thereby further improving data transmission efficiency.
[0116] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effect of this application, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These adjusted solutions are equivalent to the technical solutions described in this application and therefore will also fall within the protection scope of this application.
[0117] Those skilled in the art will understand that all or part of the processes in the method of the above-described embodiment can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, RAM, and a software distribution medium, etc.
[0118] Another aspect of this application provides a computer-readable storage medium.
[0119] In one embodiment of a computer-readable storage medium according to this application, the computer-readable storage medium can be configured to store a program that performs the communication data transmission method of the above-described method embodiments. This program can be loaded and run by a processor to implement the above-described communication data transmission method. For ease of explanation, only the parts related to the embodiments of this application are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of this application. The computer-readable storage medium can be a storage device including various electronic devices, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. Optionally, in the embodiments of this application, the computer-readable storage medium is a non-transitory computer-readable storage medium.
[0120] Another aspect of this application provides a smart device.
[0121] In one embodiment of a smart device according to this application, the smart device mainly includes a first controller where a communication data transmitter is located and a second controller where a communication data receiver is located; the first controller and the second controller are connected via a communication network; each of the first controller and the second controller may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program, which, when executed by the at least one processor, implements the method described in any of the above embodiments. See Appendix Figure 2 , Figure 2 The example illustrates a communication connection between a first controller and a second controller via a communication network.
[0122] In some embodiments of this application, the processor may be a central processing unit, a microprocessor, a graphics processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor may be implemented in software, in hardware, or a combination of both.
[0123] In some embodiments of this application, the first controller and the second controller can be deployed in different domains of the vehicle (e.g., body domain, intelligent driving domain, cockpit domain, etc.). The first controller and the second controller achieve cross-domain communication through a communication network. This communication network can be an in-vehicle Ethernet network, a CAN (Controller Area Network) bus network, etc.
[0124] In some embodiments of this application, the first controller and the second controller may be MCU (Microcontroller Unit), MPU (Microprocessor Unit), SoC (System on Chip), etc., respectively.
[0125] In some embodiments of this application, the first controller may be a microcontroller unit (MCU) without an MMU. Specifically, the first controller may be an embedded vehicle controller.
[0126] In some embodiments of this application, the intelligent device described in this application may include driving equipment, intelligent vehicles, robots, and other devices.
[0127] The technical solution of this application has been described above with reference to one embodiment shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. Without departing from the principles of this application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of this application.
Claims
1. A method for transmitting communication data, characterized in that, The method includes: The sending end of the communication data and the receiving end of the communication data negotiate to determine the target format for transmitting communication data between the sending end and the receiving end; Based on the meta-attributes of the communication data, the communication data to be sent is grouped to obtain multiple message groups; wherein, the meta-attributes include the target format; In response to a group trigger, the sending path for sending communication data of the message group is determined based on the message format and payload length of the message group; wherein, the sending path includes a fast sending path; the fast sending path performs a memory copy of the communication data of the message group from the sending buffer of the sending end to the network driver sending buffer once; According to the sending path, the communication data of the message group is sent.
2. The communication data transmission method according to claim 1, characterized in that, The method further includes: During the communication initialization phase, for the fast sending path, a callback interface for the communication data is registered, and a corresponding sending buffer is configured for the communication data; The callback interface corresponds to the service identifier of the communication data.
3. The communication data transmission method according to claim 2, characterized in that, The method further includes: During the communication data transmission phase, the communication middleware calls the callback interface according to the service identifier and obtains the address and effective length of the transmission buffer, so as to perform a memory copy of the communication data of the message group from the transmission buffer of the sending end to the network driver transmission buffer according to the callback interface, the address and the effective length.
4. The communication data transmission method according to claim 1, characterized in that, Determining the target format for communication data transmission between the sending end and the receiving end includes: The sending end sends a set of supported serialization format identifiers and their priority order; The receiving end determines the target format from the serialization formats supported by both parties according to the priority order and the serialization format identifier, and returns an acknowledgment message to the sending end.
5. The communication data transmission method according to claim 4, characterized in that, The method further includes: If no serialization format is supported by both parties, a preset compatible format is determined as the target format.
6. The communication data transmission method according to claim 1, characterized in that, The meta-attributes also include at least one of the following: the transmission period of the communication data, the transmission priority, and the upper limit of the length.
7. The communication data transmission method according to claim 6, characterized in that, The message groups are multiple; the multiple message groups correspond to different sending periods and sending priorities; the method further includes: The communication data of the message groups is sent according to the sending priority of the multiple message groups.
8. The communication data transmission method according to claim 1, characterized in that, The step of determining the transmission path for sending communication data in the message group based on the message format and payload length includes: If the message format is consistent with the target format, and the payload length is less than or equal to the single-frame capacity of the network driver sending buffer, then the sending path is determined to be a fast sending path.
9. The communication data transmission method according to claim 1 or 8, characterized in that, The sending path also includes a normal sending path; the normal sending path is a path that sends communication data to the network driver sending buffer according to the protocol layer serialization, intermediate buffer queue and driver sending process.
10. The communication data transmission method according to any one of claims 1 to 9, characterized in that, The target format is a binary serialization format with a memory layout consistent with the online format.
