Data transmission method and device, equipment, storage medium and program product
By dividing the DDS system into a memory allocator and an interface call layer, the adaptation problem of the DDS system on the CP platform is solved, and the stability and low-cost porting of cross-platform data transmission are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZEBRED NETWORK TECH CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-28
AI Technical Summary
Existing DDS systems are difficult to directly adapt to the CP platform, especially due to CP's strict restrictions on dynamic memory allocation. This makes it difficult to guarantee the stable operation of traditional DDS on different platforms and the stability of cross-platform data transmission.
The DDS system is divided into a memory allocator, an interface call layer, and a data processing layer. The interface call layer is configured with the function call interface of the operating system to realize data transfer between different operating systems, reduce porting costs, and ensure stability.
This achievement ensures stable operation of the DDS system on different operating system platforms and stable cross-platform data transmission, reducing the porting cost of the DDS system in different operating environments.
Smart Images

Figure CN121940436A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data transmission method, apparatus, device, storage medium, and program product. Background Technology
[0002] With the rapid development of autonomous driving and advanced driver assistance systems, automotive electronic systems are placing higher demands on the bandwidth, latency, and real-time performance of communication networks. Traditional in-vehicle communication buses, due to their low bandwidth and poor scalability, struggle to meet the data interaction needs of complex scenarios. Automotive Ethernet, with its high bandwidth, low latency, and excellent scalability, is gradually becoming the core carrier of next-generation in-vehicle communication networks. Data Distribution Service (DDS), as a distributed real-time communication middleware protocol built on automotive Ethernet, has become a key technology for achieving efficient collaboration between in-vehicle electronic control units, sensors, and actuators, thanks to its data-centric communication model, flexible Quality of Service (QoS) configuration capabilities, and high reliability. In practical applications, automotive electronic systems typically comprise two main platforms: embedded real-time systems based on classic AUSAR (CP) (such as traditional ECUs) and high-performance SoC platforms based on adaptive AUSAR (AP) (such as autonomous driving domain controllers). The CP platform focuses on static memory allocation and preemptive task scheduling, emphasizing real-time performance and predictability; while the AP platform is compatible with POSIX interfaces and supports dynamic resource management.
[0003] However, most existing DDS systems are designed for general-purpose operating systems and are difficult to directly adapt to the CP specification. In particular, CP's strict restrictions on dynamic memory allocation mean that porting traditional DDS to CP requires extensive modifications, and the modified solutions are often only applicable to specific hardware and software environments. Furthermore, the differences between CP and AP platforms in task scheduling, network protocol stacks, and memory management make it difficult to ensure the stable operation of DDS on different platforms and the stability of cross-platform data transmission.
[0004] Therefore, there is an urgent need for a data transmission solution that can be adapted to multiple operating systems. Summary of the Invention
[0005] This application provides a data transmission method, apparatus, device, storage medium, and program product to ensure the stable operation of DDS on different platforms and the stability of cross-platform data transmission.
[0006] In a first aspect, embodiments of this application provide a data transmission method applied to a first DDS system, the first DDS system being deployed in a first operating system, and a second DDS system being deployed in a second operating system; the first DDS system includes a first memory allocator, a first interface calling layer, and a first data processing layer, the first interface calling layer being configured based on the function call interface corresponding to the first operating system, including:
[0007] In response to a data transmission request sent by a first application, the system receives the data sent by the first application and writes the data into a data queue.
[0008] The first data to be transmitted is determined from the data queue; the first data to be transmitted is serialized through the first data processing layer to obtain serialized data.
[0009] The first memory allocator determines the transmission memory resources required for the first data to be transmitted;
[0010] Based on the required transmission memory resources for the first data to be transmitted, the serialized data is transmitted to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer.
[0011] Secondly, embodiments of this application provide a data transmission method applied to a second DDS system, wherein the second DDS system is deployed in a second operating system, and a first DDS system is deployed in a first operating system; the second DDS system includes a second memory allocator, a second interface calling layer, and a second data processing layer, wherein the second interface calling layer is configured based on the function call interface corresponding to the second operating system, and includes:
[0012] Through the second interface call layer, the interface corresponding to the second operating system is called to receive serialized data sent by the first DDS system;
[0013] The serialized data is deserialized through the second data processing layer to obtain the data.
[0014] Based on the second memory allocator and the data, determine the cache memory corresponding to the data and write the data into the cache memory;
[0015] In response to a data retrieval request from a second application, data is retrieved from cached memory and sent to the second application.
[0016] Thirdly, embodiments of this application provide a data transmission device applied to a first DDS system, the first DDS system being deployed in a first operating system, and a second DDS system being deployed in a second operating system; the first DDS system includes a first memory allocator, a first interface calling layer, and a first data processing layer, the first interface calling layer being configured based on the function call interface corresponding to the first operating system, including:
[0017] The receiving module is used to respond to the data transmission request sent by the first application, receive the data sent by the first application, and write the data into the data queue;
[0018] The processing module is used to determine the first data to be transmitted from the data queue; and to perform serialization processing on the first data to be transmitted through the first data processing layer to obtain serialized data.
[0019] The processing module is also used to determine the transmission memory resources required for the first data to be transmitted through the first memory allocator;
[0020] The transmission module is used to transmit serialized data to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer, based on the transmission memory resources required for the first data to be transmitted.
[0021] Fourthly, embodiments of this application provide a data transmission apparatus applied to a second DDS system, the second DDS system being deployed in a second operating system, and a first DDS system being deployed in a first operating system; the second DDS system includes a second memory allocator, a second interface calling layer, and a second data processing layer, the second interface calling layer being configured based on the function call interface corresponding to the second operating system, including:
[0022] The receiving module is used to call the interface corresponding to the second operating system through the second interface call layer to receive serialized data sent by the first DDS system;
[0023] The processing module is used to deserialize the serialized data through the second data processing layer to obtain the data.
[0024] The caching module is used to determine the cache memory corresponding to the data based on the second memory allocator and the data, and write the data into the cache memory;
[0025] The sending module is used to retrieve data from cached memory in response to a data retrieval request from the second application and send the data to the second application.
[0026] Fifthly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0027] The memory stores instructions that the computer executes;
[0028] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect, or the second aspect and / or various possible implementations of the second aspect.
[0029] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect, or the second aspect and / or various possible implementations of the second aspect.
[0030] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect, or the second aspect and / or various possible implementations of the second aspect.
[0031] The data transmission method, apparatus, device, storage medium, and program product provided in this application divide the DDS system into a memory allocator, an interface call layer, and a data processing layer. The interface call layer is a virtual platform layer created by separating the functions of the DDS system that depend on the underlying operating system. For DDS systems deployed on different operating systems, the interface call layer in the DDS system only needs to be configured in conjunction with the function call interface corresponding to the operating system, reducing the portability cost of the DDS system in different operating environments. During data transmission, the memory allocator determines the required transmission memory resources for the data to be transmitted, meeting the requirement that the CP environment cannot dynamically allocate memory at runtime. The interface call layer calls the interface of the corresponding operating system to realize data reception and transmission, thereby achieving data transmission between different operating systems. Attached Figure Description
[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0033] Figure 1 A schematic diagram illustrating a data transmission method provided in this application;
[0034] Figure 2 An interactive schematic diagram of a data transmission method provided in this application;
[0035] Figure 3 A flowchart illustrating a data transmission method provided in this application;
[0036] Figure 4A schematic diagram of the structure of a data transmission device provided in this application Figure 1 ;
[0037] Figure 5 A schematic diagram of the structure of a data transmission device provided in this application Figure 2 ;
[0038] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application.
[0039] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0041] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning. The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise indicated. It should be understood that such terms can be used interchangeably where appropriate, for example, to be implemented in an order other than those given in the illustrations or descriptions of the embodiments of this application. The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application, are intended to be omnipresent but not exclusive. For example, a product or device that comprises a series of components is not necessarily limited to those components that are explicitly listed, but may include other components that are not explicitly listed or are inherent to such products or devices. The term "module" as used in this application refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code capable of performing the functions associated with that element.
[0042] With the rapid development of autonomous driving and advanced driver assistance systems, automotive electronic systems are placing higher demands on the bandwidth, latency, and real-time performance of communication networks. Traditional in-vehicle communication buses, due to their low bandwidth and poor scalability, struggle to meet the data interaction needs of complex scenarios. Automotive Ethernet, with its high bandwidth, low latency, and excellent scalability, is gradually becoming the core carrier of next-generation in-vehicle communication networks. Data Distribution Service (DDS), as a distributed real-time communication middleware protocol built on automotive Ethernet, has become a key technology for achieving efficient collaboration between in-vehicle electronic control units, sensors, and actuators, thanks to its data-centric communication model, flexible Quality of Service (QoS) configuration capabilities, and high reliability. In practical applications, automotive electronic systems typically comprise two main platforms: embedded real-time systems based on classic AUSAR (CP) (such as traditional ECUs) and high-performance SoC platforms based on adaptive AUSAR (AP) (such as autonomous driving domain controllers). The CP platform focuses on static memory allocation and preemptive task scheduling, emphasizing real-time performance and predictability; while the AP platform is compatible with POSIX interfaces and supports dynamic resource management.
[0043] However, existing DDS implementations are mostly designed for general-purpose operating systems, making it difficult to directly adapt to the CP specification. In particular, CP's strict restrictions on dynamic memory allocation mean that porting traditional DDS to CP requires extensive modifications, and the modified solutions are often only applicable to specific hardware and software environments. Furthermore, the differences between CP and AP platforms in task scheduling, network protocol stacks, and memory management make it difficult to ensure the stable operation of DDS on different platforms and the stability of cross-platform data transmission.
[0044] Therefore, there is an urgent need for a data transmission solution that can be adapted to multiple operating systems.
[0045] The data transmission method, apparatus, device, storage medium, and program product provided in this application divide the DDS system into a memory allocator, an interface call layer, and a data processing layer. The interface call layer is a virtual platform layer created by separating the functions of the DDS system that depend on the underlying operating system. For DDS systems deployed on different operating systems, the interface call layer only needs to be configured in conjunction with the corresponding function call interfaces of the operating system, reducing the portability cost of the DDS system in different operating environments. During data transmission, the memory allocator determines the required transmission memory resources for the data to be transmitted, avoiding waste of memory resources. The interface call layer calls the interfaces of the corresponding operating system to realize data reception and transmission, thereby achieving data transmission between different operating systems.
[0046] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0047] Figure 1 A schematic diagram of a data transmission method provided in this application, such as... Figure 1 As shown, the first DDS system and the second DDS system are connected for communication. The first DDS system is deployed in a first operating system, and the second DDS system is deployed in a second operating system. Each of the first and second DDS systems can deploy multiple applications, which is not limited herein. This application takes the data interoperability between a first application deployed in the first DDS system and a second application deployed in the second DDS system as an example.
[0048] In a scenario where a first application in a first operating system has a data transmission request; the first DDS system responds to the data transmission request sent by the first application, determines the data to be transmitted, and serializes the data to be transmitted to obtain serialized data; through the memory allocator of the first DDS system, it determines the transmission memory resources required for the data to be transmitted; based on the transmission memory resources, it calls the corresponding interface of the first operating system through the interface call layer of the first DDS system to transmit the serialized data to the second DDS system; so that the second DDS system can send the data to the second application.
[0049] The second DDS system calls the interface corresponding to the second operating system through the second interface call layer to receive serialized data sent by the first DDS system; and writes the deserialized data into the cache memory; when the second application has a data acquisition request, it responds to the data acquisition request, retrieves the data from the cache memory, and feeds the data back to the second application.
[0050] It is understandable that data transmission between different operating systems is achieved through communication between DDS systems. Specifically, when a DDS system sends data to or receives data from a DDS system deployed in an external operating system, it does so by calling the corresponding interface of the deployed operating system through the interface call layer deployed in the DDS system.
[0051] The DDS system deployed within the operating system refers to a data transmission middleware running on the operating system, used to enable data transmission between network nodes running on different operating systems. Multiple operating systems can be deployed in a vehicle system, and each operating system can deploy its corresponding DDS system; this application does not impose any restrictions on this. This application takes the deployment of a first operating system and a second operating system in a vehicle system as an example, where the first operating system deploys its corresponding first DDS system, and the second operating system deploys its corresponding second DDS system.
[0052] To address the challenge of existing DDS systems being unable to adapt to different operating systems in AP and CP environments, this application employs a layered software architecture, dividing the DDS system into a memory allocator, an interface call layer, and a data processing layer. The interface call layer is a virtual platform layer created by separating the functionalities of the underlying operating system that the DDS system relies on. For example, operating system-related functions (such as thread scheduling and network communication) are decoupled from the core functions of the DDS system (such as data distribution and QoS management) and abstracted into the interface call layer. This interface call layer enables the interchangeability of different operating systems, ensuring that the DDS system's functionality is not dependent on a specific operating system.
[0053] For DDS systems deployed on different operating systems, the interface call layer of the DDS system only needs to be configured according to the function call interface corresponding to the operating system to make the DDS system compatible with that operating system. This eliminates the need to rewrite the core code for each operating system, reducing the portability cost of the DDS system in different operating environments. Furthermore, the interface call layer, through standardized interface encapsulation, solves compatibility issues between CP and AP platforms caused by differences in network protocol stacks and task scheduling mechanisms, ensuring stable operation of DDS in different hardware and software environments.
[0054] Figure 2 An interactive schematic diagram of a data transmission method provided in this application is shown below. Figure 2 As shown, the method includes:
[0055] S201. In response to the data transmission request sent by the first application, receive the data sent by the first application and write the data into the data queue;
[0056] The data queue is used to cache data received via the DDS interface in chronological order. This ensures data orderliness while preventing large amounts of data from directly entering the data processing layer, which would increase the load on the data processing layer and reduce data processing efficiency. Figure 1As shown, APP1 and APP2 are deployed in the first DDS system; for example, in response to the data transmission request sent by APP1, data A1 sent by APP1 is received; and the received data A1 is written into the data queue.
[0057] S202. Determine the first data to be transmitted from the data queue; perform serialization processing on the first data to be transmitted through the first data processing layer to obtain serialized data;
[0058] Data serialization refers to the standardization and encoding of data with complex structures. For example, as described above, the data stored in the data queue are: data B1, data B2, data C1, and data A1; wherein the data in the data queue is written in the following order: data B1 - data B2 - data C1 - data A1. Therefore, the first data to be transmitted, B1, is obtained from the data queue; after serialization processing by the first data processing layer, serialized data b1 is obtained.
[0059] S203. Determine the required transmission memory resources for the first data to be transmitted through the first memory allocator;
[0060] The memory allocator is used to manage the memory resources required by the DDS system during operation.
[0061] For example, if the size of the serialized data corresponding to the first data to be transmitted B1 is 2kB, then the first memory allocator will obtain 2kB of transmission memory resources from the memory resources to transmit the serialized data b1.
[0062] S204. Based on the transmission memory resources required for the first data to be transmitted, the serialized data is transmitted to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer.
[0063] For example, the first operating system is a POSIX-compliant operating system (Portable Operating System Interface for UNIX, or POSIX for short); when transmitting serialized data to the second DDS system, the serialized data b1 can be transmitted to the second DDS system by calling the Portable Operating System Interface (POSIX API) based on the transmission memory resources required by the first data to be transmitted B1.
[0064] S205. Through the second interface call layer, call the interface corresponding to the second operating system to receive serialized data sent by the first DDS system;
[0065] Similarly, the second DDS system, through the second receiving and calling layer, calls the interface corresponding to the second operating system to receive the serialized data b1 sent by the first DDS system.
[0066] S206. The serialized data is deserialized through the second data processing layer to obtain the data.
[0067] The received serialized data b1 is sent to the second data processing layer; the second data processing layer deserializes the serialized data b1 based on the corresponding deserialization rules to obtain data B1.
[0068] S207. Based on the second memory allocator and the data, determine the cache memory corresponding to the data and write the data into the cache memory;
[0069] For example, data B1 is 1.5kB in size; the second memory allocator is invoked to allocate corresponding cache memory b1 for data B1, and data B1 is cached in cache memory b1. If no request for new data is received from the application deployed in the second DDS, data B1 will remain stored in cache memory b1. Furthermore, if it is determined that data B1 has not been received, and the second DDS system receives a request for new data from the application, the second DDS system will return an error code after responding to the request to reject the data retrieval request from the second DDS system.
[0070] S208. In response to the data retrieval request from the second application, retrieve data from the cache memory and send the data to the second application.
[0071] Specifically, when the second DDS system receives a data retrieval request from an application, it determines whether new data exists for the data type corresponding to the requested data. If new data exists, it retrieves the corresponding new data from the cache memory and sends it back to the application. For example, the data cached in the second DDS system includes: data type 1 "new data C2" - cache memory c2, and data type 2 "new data D1" - cache memory d1. In response to the data retrieval request "request to retrieve data of data type 1" from the second application APP3, the system retrieves the new data "new data C2" corresponding to data type 1 from the cache memory c2 and sends it back to the second application APP3.
[0072] This application provides a data transmission method that divides a DDS system into a memory allocator, an interface call layer, and a data processing layer. The interface call layer is a virtual platform layer created by separating the functions of the DDS system that depend on the underlying operating system. For DDS systems deployed on different operating systems, the interface call layer only needs to be configured with the corresponding function call interfaces of the operating system, reducing the portability cost of the DDS system in different operating environments. During data transmission, the memory allocator determines the required transmission memory resources for the data to be transmitted, avoiding waste of memory resources. The interface call layer calls the interfaces of the corresponding operating system to realize data reception and transmission, thereby achieving data transmission between different operating systems.
[0073] Figure 3 A flowchart illustrating a data transmission method provided in this application is shown below. Figure 3 As shown, in this embodiment... Figure 2 Based on the embodiments, the data transmission method is described in detail, which includes:
[0074] S301, In response to a data transmission request sent by the first application, receive data sent by the first application;
[0075] Step S301 is similar to step S201, and will not be described in detail here.
[0076] S302. Based on preset data transmission rules, determine the tag information corresponding to the data; the tag information is used to indicate the expiration time of the data; write the data and the corresponding tag information into the data queue;
[0077] The preset data transmission rules include "the validity period of the received data is 5 minutes". For example, for the received data A1, the time corresponding to the received data A1 is 12:30. Based on the preset data transmission rules, the expiration time corresponding to data A1 is determined to be 12:35. Then, data A1 and the corresponding tag information "expiration time 12:35" are written into the data queue.
[0078] This step determines the expiration time of the data based on preset data transmission rules, ensuring that all data transmitted from the first DDS system to the second DDS system is valid, and preventing the application in the second DDS system from using expired data and causing business decision errors.
[0079] S303. Determine whether there is a second data to be transmitted in the data queue. If there is a second data to be transmitted in the data queue, determine whether the second data to be transmitted has reached the corresponding expiration time for any second data to be transmitted in the data queue.
[0080] Since the data received by the first DDS system has a time limit, if the received data is not transmitted before the corresponding expiration time, it is determined that the data has expired and will no longer be transmitted.
[0081] The second data to be transmitted is used to indicate the data stored in the data queue.
[0082] In conjunction with the foregoing, for example, if the first operating system is POSIX OS, a task thread can be created using `pthread_create`, such as "scanning the data queue according to a preset scan cycle, obtaining the first data to be transmitted, and transmitting it." The scan cycle is set based on system resources, for example, to 5 milliseconds. Then, the first interface call layer, according to a periodic task, obtains the first data to be transmitted from the data queue and sends it to the first data processing layer for serialization. Specifically, when executing this task, it first determines whether there is second data to be transmitted in the data queue. If there is second data to be transmitted, it checks whether the second data to be transmitted has reached its corresponding expiration time. If there is no second data to be transmitted in the data queue, the task ends.
[0083] Understandably, if no data is found in the data queue, it is determined that there is no second data to be transmitted in the data queue, and the task ends. Similarly, if data is found in the data queue, these data are used as the second data to be transmitted, such as "data1, data2, data3, data4". Then it is determined whether "data1, data2, data3, data4" have reached their corresponding expiration time.
[0084] S304. If the second data to be transmitted has not reached the corresponding expiration time, then the second data to be transmitted is used as the first data to be transmitted, and the first data to be transmitted is written into the cache queue.
[0085] For example, for any second piece of data to be transmitted, such as "data 1", the expiration time of data 1 is determined to be 12:40, and the current time is 12:42. By comparison, data 1 has reached its expiration time, so it is determined that data 1 has expired and there is no need to process data 1 for transmission. For "data 2", the expiration time of data 2 is determined to be 12:45, and by comparison, data 2 has not reached its expiration time. Similarly, data 3 has not reached its expiration time, while data 4 has reached its expiration time. Therefore, data 2 and data 3 are written into the buffer queue as the first pieces of data to be transmitted.
[0086] Specifically, regarding data 2 and data 3, data 2 is written to the data queue first, while data 3 is written to the cache queue in that order, so that the first data processing layer can serialize the first data to be transmitted in the cache queue in that order.
[0087] S305. The first data to be transmitted is serialized through the first data processing layer to obtain serialized data;
[0088] Step S305 is similar to step S202, and will not be described in detail here.
[0089] S306. Determine the data type of the first data to be transmitted, and based on the data type, determine the transmission memory block corresponding to the data type from the preset memory block set;
[0090] The preset memory block set includes transfer memory blocks corresponding to various data types. These transfer memory blocks are obtained by dividing the memory resources corresponding to the first operating system according to data types. For example, the memory resources corresponding to the first operating system are 1MB; the data types include: Data Type 1, Data Type 2, Data Type 3, and Data Type 4; dividing the transfer memory blocks according to different data types yields "Data Type 1 - Transfer Memory Block 1 (0.2MB)", "Data Type 2 - Transfer Memory Block (0.25MB)", "Data Type 3 - Transfer Memory Block 3 (0.3MB)", "Data Type 4 - Transfer Memory Block 4 (0.1MB)", and "Memory occupied by DDS operation - Transfer Memory Block (0.15MB)".
[0091] By pre-dividing the operating system's memory resources into multiple memory blocks, the required transmission memory resources are allocated only from the memory blocks corresponding to the data types during data transmission. This ensures that the DDS system, when running in the CP environment, meets the strict requirements of the CP environment for static memory allocation and real-time performance, while avoiding the dynamic allocation of operating system memory resources during DDS runtime, which would lead to memory fragmentation.
[0092] In conjunction with the foregoing, for example, for the first data to be transmitted, “data 2”, the data type corresponding to data 2 is determined to be data type 4; thus, the transmission memory block corresponding to “data type 4” is determined to be “transmission memory block 4” from the preset memory block set.
[0093] S307. Using the first memory allocator, based on the first data to be transmitted and historical transmission data, allocate the transmission memory resources required for the first data to be transmitted from the transmission memory block;
[0094] For example, the historical data corresponding to data type 4, "historical data 11, historical data 12, and historical data 13", are determined. Historical data 11, historical data 12, and historical data 13 use a total of 30kB of transmission memory resources. By comparison, the used transmission memory resources have not reached 0.1MB. That is, transmission memory block 4 still has transmission memory resources remaining. Among them, the data size corresponding to data 2 is 10kB. Then, through the first memory allocator, 10kB of transmission memory resources are allocated from the remaining transmission memory resources for transmitting data 2.
[0095] This step determines the remaining transmission memory resources of the corresponding transmission memory block based on historical transmission data; and determines the required transmission memory resources based on the data to be transmitted, so as to accurately match the memory requirements of data transmission and avoid wasting memory resources.
[0096] S308. Based on the transmission memory resources required for the first data to be transmitted, the serialized data is transmitted to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer.
[0097] S309. Through the second interface call layer, call the interface corresponding to the second operating system to receive serialized data sent by the first DDS system;
[0098] S310. The serialized data is deserialized through the second data processing layer to obtain the data.
[0099] S311. Based on the second memory allocator and the data, determine the cache memory corresponding to the data and write the data into the cache memory;
[0100] S312. In response to a data retrieval request from the second application, retrieve data from the cache memory and send the data to the second application.
[0101] Steps S308, S309, S301, S311, and S312 are similar to steps S204, S205, S206, S207, and S208, and will not be described in detail here.
[0102] This application provides a data transmission method that avoids large amounts of data directly entering the data processing layer, thus preventing increased load and reduced efficiency, by writing received data into a data queue. The method uses an interface call layer to retrieve data to be transmitted from the data queue according to the writing order and send it to the data processing layer. The data processing layer performs serialization processing on the data to be transmitted to reduce its size and improve data transmission efficiency. A memory allocator determines the required transmission memory resources for the data to be transmitted, avoiding waste of memory resources. The interface call layer calls the corresponding operating system's interface to achieve data reception and transmission, thereby enabling data transmission between different operating systems.
[0103] In one possible implementation, the method further includes:
[0104] In response to the data transmission information sent by the first DDS system, the data transmission information is used to indicate the valid data currently cached by the first DDS system, and the valid data includes the target data;
[0105] Based on the data transmission information, the data reception information of the target data is determined and sent to the first DDS system; wherein, the data reception information is used to indicate the reception status of the target data sent by the first DDS system to the second DDS system, and the reception status indicates that the second DDS system has received the target data.
[0106] Here, the target data refers to any one of the valid data currently cached by the first DDS system among all the data sent from the first DDS system to the second DDS system. For example, if the first DDS system has sent data 1, data 2, and data 3 to the second DDS system, and the valid data currently cached by the first DDS system includes data 2 and data 3, then any one of the sent data 2 and data 3 will be used as the target data.
[0107] Understandably, the first DDS system, while transmitting data, also sends corresponding data information to the second DDS system. For example, regarding target data "data 3" already sent to the second DDS system by the first DDS system, the first DDS system simultaneously sends the data transmission information "data 2, data 3 available" to the second DDS system. Upon receiving the data transmission information, the second DDS system, based on the data transmission information and the received data, determines the data reception information for data 3. If the second DDS system has received data 3, it determines the data reception information as "data 3 received"; if the second DDS system has not received data 3, it determines the data reception information as "data 2 received." This data reception information is then fed back to the first DDS system so that the first DDS system can retransmit the data that the second DDS system did not receive.
[0108] In one possible implementation, the method further includes:
[0109] For any target data sent to the second DDS system, receive data reception information fed back by the second DDS system. The data reception information is used to indicate the reception status of the target data sent by the first DDS system to the second DDS system.
[0110] Based on the data reception information, determine whether the second DDS system has received the target data; if the second DDS system has not received the target data, resend the target data to the second DDS system.
[0111] Based on the foregoing, for example, regarding the data reception information "Data 2 received" from the second DDS system, it can be determined that the second DDS system has not received "Data 3"; therefore, "Data 3" is retransmitted to the second DDS system. This step, by combining the data reception status, determines whether the second DDS system has not received any data, and promptly retransmits the corresponding data to the second DDS system if no data has been received, thus improving the reliability of data transmission.
[0112] Figure 4 A schematic diagram of the structure of a data transmission device provided in this application Figure 1 ,like Figure 4 As shown, the first DDS system is deployed in a first operating system, and the second DDS system is deployed in a second operating system. The first DDS system includes a first memory allocator, a first interface call layer, and a first data processing layer. The first interface call layer is configured based on the function call interface corresponding to the first operating system. The data transmission device 400 provided in this embodiment includes:
[0113] The receiving module 401 is used to receive data sent by the first application in response to a data transmission request sent by the first application, and write the data into a data queue;
[0114] The processing module 402 is used to determine the first data to be transmitted from the data queue; and to perform serialization processing on the first data to be transmitted through the first data processing layer to obtain serialized data.
[0115] Processing module 402 is also used to determine the transmission memory resources required for the first data to be transmitted through the first memory allocator;
[0116] The transmission module 403 is used to transmit serialized data to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer, based on the transmission memory resources required for the first data to be transmitted.
[0117] In one possible implementation, the receiving module 401 is further configured to:
[0118] Based on preset data transmission rules, the tag information corresponding to the data is determined; the tag information is used to indicate the expiration time of the data.
[0119] Write the data and its corresponding tag information into the data queue.
[0120] In one possible implementation, the processing module 402 is further configured to:
[0121] Determine whether there is a second piece of data to be transmitted in the data queue. If there is a second piece of data to be transmitted in the data queue, then for any second piece of data to be transmitted in the data queue, determine whether the second piece of data to be transmitted has reached its corresponding expiration time.
[0122] If the second data to be transmitted has not reached its corresponding expiration time, then the second data to be transmitted will be used as the first data to be transmitted, and the first data to be transmitted will be written into the cache queue.
[0123] In one possible implementation, the processing module 402 is further configured to:
[0124] For any target data sent to the second DDS system, receive data reception information fed back by the second DDS system. The data reception information is used to indicate the reception status of the target data sent by the first DDS system to the second DDS system.
[0125] Based on the data reception information, determine whether the second DDS system has received the target data; if the second DDS system has not received the target data, resend the target data to the second DDS system.
[0126] In one possible implementation, the transmission module 403 is further configured to:
[0127] The data type of the first data to be transmitted is determined, and based on the data type, the corresponding transmission memory block is determined from a preset memory block set; wherein, the preset memory block set includes transmission memory blocks corresponding to multiple data types, and the transmission memory blocks are obtained by dividing the memory resources corresponding to the first operating system according to the data type;
[0128] The first memory allocator allocates the required transmission memory resources for the first data to be transmitted from the transmission memory block based on the first data to be transmitted and historical transmission data.
[0129] The data transmission device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0130] Figure 5 A schematic diagram of the structure of a data transmission device provided in this application Figure 2 ,like Figure 5As shown, the second DDS system is deployed in a second operating system, while the first DDS system is deployed in a first operating system. The second DDS system includes a second memory allocator, a second interface call layer, and a second data processing layer. The second interface call layer is configured based on the function call interface corresponding to the second operating system. The data transmission device 500 provided in this embodiment includes:
[0131] The receiving module 501 is used to call the interface corresponding to the second operating system through the second interface call layer to receive serialized data sent by the first DDS system;
[0132] The processing module 502 is used to deserialize the serialized data through the second data processing layer to obtain the data.
[0133] The cache module 503 is used to determine the cache memory corresponding to the data based on the second memory allocator and the data, and write the data into the cache memory;
[0134] The sending module 504 is used to retrieve data from the cache memory in response to a data retrieval request from the second application and send the data to the second application.
[0135] In one possible implementation, the processing module 502 is further configured to:
[0136] In response to the data transmission information sent by the first DDS system, the data transmission information is used to indicate the valid data currently cached by the first DDS system, and the valid data includes the target data;
[0137] Based on the data transmission information, the data reception information of the target data is determined and sent to the first DDS system; wherein, the data reception information is used to indicate the reception status of the target data sent by the first DDS system to the second DDS system, and the reception status indicates that the second DDS system has received the target data.
[0138] The data transmission device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0139] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604.
[0140] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to perform the above-described method.
[0141] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0142] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0143] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0144] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0145] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0146] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0147] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0148] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0149] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0150] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0151] In addition, 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.
[0152] If a function 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0153] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0154] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A data transmission method, characterized in that, The first DDS system is deployed in a first operating system, and the second DDS system is deployed in a second operating system. The first DDS system includes a first memory allocator, a first interface call layer, and a first data processing layer. The first interface call layer is configured based on the function call interface corresponding to the first operating system and includes: In response to a data transmission request sent by a first application, the system receives data sent by the first application and writes the data into a data queue. From the data queue, a first piece of data to be transmitted is determined; the first piece of data to be transmitted is serialized through the first data processing layer to obtain serialized data; The first memory allocator determines the transmission memory resources required for the first data to be transmitted; Based on the transmission memory resources required for the first data to be transmitted, the serialized data is transmitted to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer.
2. The method according to claim 1, characterized in that, The step of writing the data into the data queue includes: Based on preset data transmission rules, the tag information corresponding to the data is determined; the tag information is used to indicate the expiration time of the data. The data and corresponding tag information are written into the data queue.
3. The method according to claim 2, characterized in that, Determining the first data to be transmitted from the data queue includes: Determine whether there is second data to be transmitted in the data queue. If there is second data to be transmitted in the data queue, determine whether the second data to be transmitted has reached the corresponding expiration time for any second data to be transmitted in the data queue. If the second data to be transmitted has not reached its corresponding expiration time, then the second data to be transmitted is used as the first data to be transmitted, and the first data to be transmitted is written into the cache queue.
4. The method according to claim 3, characterized in that, The method further includes: For any target data sent to the second DDS system, receive data reception information fed back by the second DDS system; wherein, the data reception information is used to indicate the reception status of the target data by the second DDS system; Based on the data reception information, it is determined whether the second DDS system has received the target data; if the second DDS system has not received the target data, the target data is retransmitted to the second DDS system.
5. The method according to claim 1, characterized in that, The step of determining the required transmission memory resources for the first data to be transmitted through the first memory allocator includes: The data type of the first data to be transmitted is determined, and based on the data type, the corresponding transmission memory block is determined from a preset memory block set; wherein, the preset memory block set includes transmission memory blocks corresponding to multiple data types, and the transmission memory blocks are obtained by dividing the memory resources corresponding to the first operating system according to the data type; The first memory allocator allocates the required transmission memory resources for the first data to be transmitted from the transmission memory block based on the first data to be transmitted and historical transmission data.
6. A data transmission method, characterized in that, This is applied to a second DDS system, which is deployed in a second operating system, while the first DDS system is deployed in a first operating system. The second DDS system includes a second memory allocator, a second interface call layer, and a second data processing layer. The second interface call layer is configured based on the function call interface corresponding to the second operating system and includes: Through the second interface call layer, the interface corresponding to the second operating system is called to receive serialized data sent by the first DDS system; The serialized data is deserialized through the second data processing layer to obtain the data. Based on the second memory allocator and the data, the cache memory corresponding to the data is determined, and the data is written into the cache memory; In response to a data retrieval request from a second application, the data is retrieved from the cache memory and sent to the second application.
7. The method according to claim 6, characterized in that, The method further includes: In response to data transmission information sent by the first DDS system, the data transmission information is used to indicate the valid data currently cached by the first DDS system, the valid data including the target data; Based on the data transmission information, the data reception information of the target data is determined, and the data reception information is sent to the first DDS system; wherein, the data reception information is used to indicate the reception status of the target data sent by the first DDS system to the second DDS system, and the reception status indicates that the second DDS system has received the target data.
8. A data transmission device, characterized in that, The first DDS system is deployed in a first operating system, and the second DDS system is deployed in a second operating system. The first DDS system includes a first memory allocator, a first interface call layer, and a first data processing layer. The first interface call layer is configured based on the function call interface corresponding to the first operating system and includes: The receiving module is configured to receive data sent by the first application in response to a data transmission request sent by the first application, and write the data into a data queue; The processing module is used to determine the first data to be transmitted from the data queue; and to perform serialization processing on the first data to be transmitted through the first data processing layer to obtain serialized data. The processing module is further configured to determine the transmission memory resources required for the first data to be transmitted through the first memory allocator; The transmission module is used to transmit the serialized data to the second DDS system by calling the interface corresponding to the first operating system through the first interface call layer, based on the transmission memory resources required for the first data to be transmitted.
9. A data transmission device, characterized in that, This is applied to a second DDS system, which is deployed in a second operating system, while the first DDS system is deployed in a first operating system. The second DDS system includes a second memory allocator, a second interface call layer, and a second data processing layer. The second interface call layer is configured based on the function call interface corresponding to the second operating system and includes: The receiving module is used to call the interface corresponding to the second operating system through the second interface call layer to receive serialized data sent by the first DDS system; The processing module is used to deserialize the serialized data through the second data processing layer to obtain data; A caching module is used to determine the cache memory corresponding to the data based on the second memory allocator and the data, and write the data into the cache memory; The sending module is configured to, in response to a data retrieval request from the second application, retrieve the data from the cache memory and send the data to the second application.
10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
12. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.