Data transmission method and device and storage medium

By adapting to the transmission modes of the data requesting end and the data sharing end in the DDS protocol stack, the problem that a single transmission mode cannot meet the diverse application scenarios is solved, and flexible data transmission and improved system performance are achieved.

CN119917318APending Publication Date: 2025-05-02CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510103429.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In existing data distribution services (DDS), a single transmission mode cannot meet the needs of diverse application scenarios.

Method used

After receiving the data request message on the data sharing end, the sharing function information between the data requesting end and the data sharing end is obtained, and the data transmission mode is determined. If both parties support shared memory, a transmission mode based on shared memory is adopted; if not, a transmission mode based on transport layer protocol is adopted.

Benefits of technology

It realizes the selection of appropriate transmission modes according to specific application scenarios and needs, enhances the flexibility of the data transmission process, and improves the concurrency performance and adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917318A_ABST
    Figure CN119917318A_ABST
Patent Text Reader

Abstract

The invention relates to a data transmission method and device and a storage medium, and relates to the technical field of communication. The technical problem that a single transmission mode cannot meet diversified application scene requirements in the prior art is at least solved. The method is applied to a data sharing end and comprises the steps that a data request message sent by a data request end is received, and the data request message is used for requesting target data; and obtaining sharing function information of the data request end and sharing function information of the data sharing end, wherein the sharing function information is used for indicating whether the shared memory is supported or not. And determining a data transmission mode based on the sharing function information of the data request end and the sharing function information of the data sharing end. And transmitting the target data to the data request end based on the data transmission mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, in particular to the field of data distribution service technology, and specifically to a data transmission method, device and storage medium. Background Art

[0002] Data distribution service (DDS) is a distributed real-time communication middleware protocol that can provide a variety of quality of service (QoS) strategies to ensure real-time, efficient, and flexible data distribution in distributed systems. At present, most DDS transmission modes are relatively single. However, with the diversification of application scenarios, different applications have different requirements for DDS transmission modes, and a single transmission mode cannot meet the needs of diverse application scenarios. Summary of the invention

[0003] According to the first aspect provided by the present application, the present application provides a data transmission method, device and storage medium to at least solve the technical problem in the related art that a single transmission mode cannot meet the needs of diversified application scenarios.

[0004] The technical solution of the present application is applied to a data sharing terminal. The method includes: receiving a data request message sent by a data request terminal, the data request message is used to request target data. Acquiring sharing function information of the data request terminal and sharing function information of the data sharing terminal, the sharing function information is used to indicate whether shared memory is supported. Based on the sharing function information of the data request terminal and the sharing function information of the data sharing terminal, determining a data transmission mode. Transmitting target data to the data request terminal based on the data transmission mode.

[0005] In a possible implementation, based on the sharing function information of the data request end and the sharing function information of the data sharing end, determining the data transmission mode includes: if both the data request end and the data sharing end support shared memory, determining the data transmission mode to be a transmission mode based on shared memory. If the data request end or the data sharing end does not support shared memory, determining the data transmission mode to be a transmission mode based on a transport layer protocol.

[0006] In a possible implementation, transmitting data to a data request end based on a data transmission mode includes: if the data transmission mode is a transmission mode based on a shared memory, storing the target data in a shared memory pool, and sending a sharing message to the data request end, the sharing message is used to indicate that the target data has been stored in the shared memory pool. If the data transmission mode is a transmission mode based on a transport layer protocol, sending the target data to the data request end based on the transport layer protocol.

[0007] In a possible implementation manner, the data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

[0008] In a possible implementation, sending a shared message to the data request end includes: obtaining inter-process communication (IPC) channel information of the data request end. Based on the IPC channel information of the data request end, sending a shared message to the data request end through the IPC channel of the data request end, the shared message including: information of the shared memory pool.

[0009] In a possible implementation, the data transmission method further includes: broadcasting IPC channel information and sharing function information of the data sharing terminal.

[0010] According to a second aspect provided by the present application, the present application provides a data transmission method, which is applied to a data requesting end. The method includes: sending a data request message to a data sharing end, the data request message is used to request target data. Receiving a sharing message sent by the data sharing end, the sharing message is used to indicate that the target data has been stored in a shared memory pool. Based on the sharing message, the target data is obtained from the shared memory pool.

[0011] In a possible implementation, the sharing message includes: information of a shared memory pool.

[0012] In a possible implementation manner, the data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

[0013] According to a third aspect provided by the present application, a data transmission device is provided, which is applied to a data sharing end, and the device includes an acquisition module and a processing module. The acquisition module is used to receive a data request message sent by a data request end, and the data request message is used to request target data. The acquisition module is also used to obtain the sharing function information of the data request end and the sharing function information of the data sharing end, and the sharing function information is used to indicate whether shared memory is supported. The processing module is used to determine the data transmission mode based on the sharing function information of the data request end and the sharing function information of the data sharing end. The processing module is also used to transmit the target data to the data request end based on the data transmission mode.

[0014] In a possible implementation, the processing module is used to determine that the data transmission mode is a transmission mode based on shared memory if both the data request end and the data sharing end support shared memory. The processing module is also used to determine that the data transmission mode is a transmission mode based on the transport layer protocol if the data request end or the data sharing end does not support shared memory.

[0015] In a possible implementation, the processing module is used to store the target data in the shared memory pool if the data transmission mode is a transmission mode based on shared memory, and send a sharing message to the data request end, the sharing message is used to indicate that the target data has been stored in the shared memory pool. The processing module is also used to send the target data to the data request end based on the transport layer protocol if the data transmission mode is a transmission mode based on the transport layer protocol.

[0016] In a possible implementation manner, the data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

[0017] In a possible implementation, the acquisition module is used to acquire the inter-process communication (IPC) channel information of the data request end. The processing module is used to send a shared message to the data request end through the IPC channel of the data request end based on the IPC channel information of the data request end, and the shared message includes: information of the shared memory pool.

[0018] In a possible implementation, the processing module is used to broadcast the IPC channel information and sharing function information of the data sharing terminal.

[0019] According to a fourth aspect provided by the present application, a data transmission device is provided, which is applied to a data requesting end, and the device includes an acquisition module and a processing module. The processing module is used to send a data request message to a data sharing end, and the data request message is used to request target data. The acquisition module is used to receive a sharing message sent by the data sharing end, and the sharing message is used to indicate that the target data has been stored in a shared memory pool. The processing module is also used to obtain the target data from the shared memory pool based on the sharing message.

[0020] In a possible implementation, the sharing message includes: information of a shared memory pool.

[0021] In a possible implementation manner, the data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

[0022] According to the fifth aspect provided by the present application, a data transmission device is provided, including: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute instructions to implement the method of the above-mentioned first aspect, second aspect and any possible implementation method thereof.

[0023] According to the sixth aspect provided by the present application, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor of a data transmission device, the data transmission device is enabled to execute the method in the above-mentioned first aspect, second aspect and any possible implementation manner thereof.

[0024] According to the seventh aspect provided by the present application, a computer program product is provided, the computer program product comprising computer instructions, when the computer instructions are executed on a data transmission device, the data transmission device executes the method in the above-mentioned first aspect, second aspect and any possible implementation manner thereof.

[0025] Therefore, the above technical features of the present application have the following beneficial effects:

[0026] (1) The data sharing end can send inter-process communication (IPC) channel information and sharing function information to other data requesting ends and data sharing ends through broadcasting, so that other data requesting ends and data sharing ends can determine whether the data sharing end supports shared memory.

[0027] (2) The data sharing end can determine the transmission mode of the message sent from the data sharing end to the data requesting end by judging whether the data requesting end and the data sharing end support shared memory. Thus, the appropriate transmission mode can be selected according to the specific application scenario and requirements, thereby enhancing the flexibility of the data transmission process.

[0028] (3) Both the data request end and the data sharing end have independent shared memory spaces, which enable each data request end and data sharing end to process its own data independently without waiting for other processes to complete. This helps improve the concurrent performance of the system, allowing multiple processes to process data simultaneously, thereby speeding up the completion of the overall task.

[0029] (4) The data sharing end sends a sharing message to the data requesting end through the IPC channel of the data requesting end, which can promptly and synchronously notify the data requesting end to obtain the target data, thus avoiding data loss caused by data overwriting and untimely reading.

[0030] (5) The data sharing end uses a shared memory-based transmission mode for local communication. It can utilize shared memory space to reduce the multiple data copying processes of the central processing unit (CPU). It has no transmission content size limit and does not need to transmit large data packets in fragments. The transmission mode based on the transport layer protocol can support broadcast and multicast transmission modes, sending data to multiple receivers at the same time. In this way, it can be flexibly applied to different scenarios.

[0031] (6) The data sharing end can receive a data request message sent by the data request end, and the data request message is used to request the target data. Afterwards, the data sharing end obtains the sharing function information of the data request end and the sharing function information of the data sharing end, and the sharing function information is used to indicate whether shared memory is supported. Afterwards, the data sharing end can determine the data transmission mode based on the sharing function information of the data request end and the sharing function information of the data sharing end. Afterwards, the data sharing end transmits the target data to the data request end based on the data transmission mode. In this way, the data sharing end can use the shared memory data transmission mode within the domain and the transport layer protocol-based transmission mode between domains, so that data transmission can be achieved between the data sharing end and the data request end. In this way, by adaptively adapting the transmission modes of both ends in the DDS protocol stack, it can automatically switch or use in combination under different network conditions, thereby improving the adaptability and stability of the system.

[0032] (7) After the data request end obtains the information of the shared memory pool, it can determine the target shared memory block based on the information of the shared memory pool and obtain the target data. In this way, the accuracy of data access can be improved.

[0033] (8) The data request end can send a data request message to the data sharing end. The data request message is used to request the target data. Afterwards, the data request end receives the sharing message sent by the data sharing end. The sharing message is used to indicate that the target data has been stored in the shared memory pool. Based on the sharing message, the data request end then obtains the target data from the shared memory pool. In this way, the data request end can directly obtain data from the shared memory pool of the data sharing end, thereby avoiding data transmission delay and significantly improving data access speed.

[0034] It should be noted that the technical effects brought about by any implementation method in the third to seventh aspects can refer to the technical effects brought about by the corresponding implementation methods in the first and second aspects, and will not be repeated here.

[0035] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute improper limitations on the present application.

[0037] Figure 1 is a flowchart of a data transmission method according to an exemplary embodiment;

[0038] Figure 2 is a flowchart of another data transmission method according to an exemplary embodiment;

[0039] Figure 3 is a schematic diagram showing an example of a data transmission method according to an exemplary embodiment;

[0040] Figure 4 is a schematic diagram of another data transmission method according to an exemplary embodiment;

[0041] Figure 5 is a flowchart of another data transmission method according to an exemplary embodiment;

[0042] Figure 6 is a flowchart of another data transmission method according to an exemplary embodiment;

[0043] Figure 7 is a flowchart of another data transmission method according to an exemplary embodiment;

[0044] Figure 8 is a schematic structural diagram of a data transmission device according to an exemplary embodiment;

[0045] Fig. 9 is a schematic structural diagram of another data transmission device according to an exemplary embodiment;

[0046] Fig.10 It is a schematic structural diagram of another data transmission device according to an exemplary embodiment. DETAILED DESCRIPTION

[0047] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0049] With the rapid development of automotive electronics technology, autonomous driving technology has been widely used in vehicles, and the complexity and frequency of data interaction between functional modules within the controller unit have also increased significantly. In order to meet the high-intensity data transmission requirements between functional modules within the controller unit, the data transmission volume has increased from kilobytes per second to gigabytes per second. The traditional application development model can no longer meet the high-intensity data transmission requirements between functional modules within the controller unit, and upper-level applications have gradually begun to transform to a service-oriented architecture model. The service-oriented architecture model can achieve functional decoupling and reuse by splitting the different functions of the application into independent services and communicating through standardized interfaces.

[0050] In order to meet the needs of high-intensity and low-latency data transmission between different services in the service-oriented architecture model, DDS is a distributed real-time communication middleware protocol that can provide a wealth of service quality QoS strategies to ensure real-time, efficient and flexible distribution of data in distributed systems. It is widely used in vehicle communication middleware. Among them, the commonly used transmission modes of DDS include: user datagram protocol (UDP), transmission control protocol (TCP) and shared memory. At present, the transmission mode of most DDS is relatively simple. UDP and TCP are mainly used for communication between controllers. The shared memory transmission mode is generally used to transmit large data within the controller domain. UDP and TCP transmission modes are commonly used for local communication, cross-node communication and network communication.

[0051] However, with the diversification of application scenarios, different applications have different requirements for the DDS transmission mode, and a single transmission mode cannot meet the needs of diverse application scenarios.

[0052] In some embodiments, some methods can realize the DDS adaptive shared memory transmission mode, but they introduce a third-party shared memory management module and send the data of each DDS communication node to the shared memory management module for distribution and reception. If there is a single point problem in the shared memory management module, all communications of the DDS communication nodes will fail.

[0053] In some embodiments, some methods also pass the shared memory information itself through the shared memory. After the other end reads the shared memory, it parses the shared memory content to read the address where the actual transmission content is located. However, in this method, the receiving end cannot confirm when the sending end writes information and data, and needs to poll the receiving end when the buffer memory is updated by the sending end. The polling cycle affects the data transmission and reception delay.

[0054] In some embodiments, some methods can dynamically use DDS communication and shared memory IPC communication, and shared memory IPC communication is independent of DDS communication. However, this method cannot use the QOS configuration of DDS for transmission when using shared memory communication.

[0055] In order to solve the above problems, the present application provides a data transmission method, which is applied to a data sharing end, and the method includes: the data sharing end can receive a data request message sent by a data request end, and the data request message is used to request target data. Afterwards, the data sharing end obtains the sharing function information of the data request end and the sharing function information of the data sharing end, and the sharing function information is used to indicate whether shared memory is supported. Afterwards, the data sharing end can determine the data transmission mode based on the sharing function information of the data request end and the sharing function information of the data sharing end. Afterwards, the data sharing end transmits the target data to the data request end based on the data transmission mode. In this way, the data sharing end can use the data transmission mode of shared memory within the domain and the transmission mode based on the transport layer protocol between domains, so that data transmission can be realized between the data sharing end and the data request end. In this way, by adaptively adapting the transmission modes of both ends in the DDS protocol stack, it can be automatically switched or used in combination under different network conditions, thereby improving the adaptability and stability of the system.

[0056] For ease of understanding, the data transmission method provided by the present application is specifically introduced below with reference to the accompanying drawings.

[0057] Figure 1 is a flow chart of a data transmission method according to an exemplary embodiment. Figure 1 As shown, the data transmission method is applied to the data sharing end, and the method includes:

[0058] S101. A data sharing end receives a data request message sent by a data request end.

[0059] The data request message is used to request target data.

[0060] In a possible implementation, a monitoring module is provided at the data sharing end, and the data sharing end receives a data request message sent by the data request end based on the monitoring module.

[0061] In another possible implementation, the data sharing end includes a data writer, which is used to indicate an entity that performs a write operation on data. The data writer of the data sharing end and the data reader of the data request end can establish a target connection through the DDS discovery protocol to obtain a target connection message, and the data reader is used to indicate an entity that performs a read operation on data. The target connection message can be used as a data request message sent by the data request end.

[0062] S102: The data sharing end obtains the sharing function information of the data requesting end and the sharing function information of the data sharing end.

[0063] The sharing function information is used to indicate whether shared memory is supported.

[0064] In a possible design, the sharing function information of the data requesting end and the sharing function information of the data sharing end are one or more.

[0065] In a possible implementation, the data sharing end stores the sharing function information of the data sharing end in advance. The data sharing end can receive the sharing broadcast message sent by the data request end. Afterwards, the data sharing end parses the sharing broadcast message to obtain the sharing function information of the data request end.

[0066] In some embodiments, the data sharing end may receive an IPC channel information message sent by the data requesting end. Afterwards, the data sharing end parses the IPC channel information message to obtain the IPC channel information of the data requesting end. Based on the IPC channel information, the data sharing end may obtain the IPC channel of the data requesting end.

[0067] It should be noted that the data sharing end has only one IPC channel, and the data request end has only one IPC channel.

[0068] In some embodiments, the data sharing end broadcasts the IPC channel information and sharing function information of the data sharing end.

[0069] It should be noted that the data sharing end includes a data writer and a data reader. The data sharing end may be a data request end, and the data request end may be a data sharing end.

[0070] In a possible implementation, the data sharing end may encapsulate the IPC channel information and the sharing function information of the data sharing end to obtain a sharing broadcast message. Afterwards, the data sharing end broadcasts the sharing broadcast message.

[0071] Exemplarily, the data sharing end shares the broadcast message via UDP broadcast.

[0072] It is understandable that the data sharing end can send IPC channel information and sharing function information to other data requesting ends and data sharing ends through broadcasting, so that other data requesting ends and data sharing ends can determine whether the data sharing end supports shared memory.

[0073] S103: The data sharing end determines a data transmission mode based on the sharing function information of the data requesting end and the sharing function information of the data sharing end.

[0074] The data transmission mode is used to indicate the transmission mode in which the data sharing end sends a message to the data requesting end.

[0075] In a possible implementation, the data sharing end can create a data requesting end proxy entity (i.e., proxy participant) and a data sharing end proxy entity based on the sharing function information of the data requesting end and the sharing function information of the data sharing end, and store the sharing function information of the data requesting end in the data requesting end proxy entity, and store the sharing function information of the data sharing end in the data sharing end proxy entity. Afterwards, the data sharing end obtains the target connection identifier of the target connection based on the data requesting end proxy entity, and the target connection identifier is used to indicate whether the target connection supports shared memory. Afterwards, the data sharing end determines the data transmission mode based on the target connection identifier.

[0076] In one possible design, if all the shared function information of the data request end stored in the data request end proxy entity is used to indicate that shared memory is not supported, the target connection identifier is used to indicate that the target connection does not support shared memory, and the data sharing end determines that the data transmission mode is a transmission mode based on the transport layer protocol; if there is at least one data request end's shared function information in the data request end proxy entity that is used to indicate support for shared memory, the target connection identifier is used to indicate that the target connection supports shared memory, and the data sharing end determines that the data transmission mode is a transmission mode based on shared memory.

[0077] For example, Figure 2As shown, the data sharing end obtains the corresponding shared memory pool and the corresponding IPC channel, and maps the shared memory pool to the address space of the data sharing end. Afterwards, in the simple participant discovery protocol (SPDP) stage, the data sharing end receives the shared broadcast message sent by the data requesting end. Afterwards, the data sharing end parses the shared broadcast message to obtain the shared function information and IPC channel information of the data requesting end. The data sharing end can create a peer data requesting end proxy entity based on the shared function information of the data requesting end and the IPC channel information of the data requesting end, and store the shared function information of the data requesting end and the IPC channel information of the data requesting end in the peer data requesting end proxy entity. Afterwards, in the simple endpoint discovery protocol (SEDP) stage, the data sharing end sends a data sharing end information message to the data requesting end, and obtains the data requesting end information message of the data requesting end through the data writer. The data sharing end information message includes the Internet protocol (IP) address of the data sharing end, and the data requesting end information message includes the IP address of the data requesting end. Afterwards, the data sharing end obtains the data sharing end information message of the data requesting end through the data writer, and establishes a target connection with the data reader of the data sharing end based on the data sharing end information message.

[0078] In another possible implementation, the data sharing end determines whether both the data requesting end and the data sharing end support shared memory based on the sharing function information of the data requesting end and the sharing function information of the data sharing end, thereby determining the data transmission mode.

[0079] In a possible design, if both the data request end and the data sharing end support shared memory, the data sharing end determines the data transmission mode to be a transmission mode based on shared memory. If the data request end or the data sharing end does not support shared memory, the data sharing end determines the data transmission mode to be a transmission mode based on the transport layer protocol.

[0080] It can be understood that by judging whether the data requesting end and the data sharing end support shared memory, the transmission mode of the data sharing end sending messages to the data requesting end can be determined, so that the appropriate transmission mode can be selected according to the specific application scenario and requirements, thereby enhancing the flexibility of the data transmission process.

[0081] S104: The data sharing end transmits target data to the data requesting end based on the data transmission mode.

[0082] In a possible implementation, if the data transmission mode is a shared memory-based transmission mode, the data sharing end stores the target data in a shared memory pool and sends a sharing message to the data requesting end, where the sharing message is used to indicate that the target data has been stored in the shared memory pool.

[0083] The shared message includes: information about a shared memory pool. The data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end. The shared memory pool includes multiple preset memory blocks of different sizes.

[0084] It is understandable that the data request end and the data sharing end have independent shared memory spaces, which can greatly improve the data transmission delay and throughput performance within the domain, reduce CPU consumption, and make the deployment of DDS in each domain of the vehicle change from a single node to multiple nodes in each domain of the vehicle, so that each data request end and data sharing end can process its own data independently without waiting for other processes to complete. This helps to improve the concurrent performance of the system, allowing multiple processes to process data at the same time, thereby speeding up the completion of the overall task.

[0085] It should be noted that the present application does not limit the size and number of the preset memory blocks. For example, the size of the preset memory blocks may be 2 megabytes, 4 megabytes, 8 megabytes, 12 megabytes, or 20 megabytes. The number of preset memory blocks may be 10, 30, 50, 70, or 100.

[0086] For example, Figure 3 As shown, the shared memory pool includes a preset memory block of 256 bytes, a preset memory block of 512 bytes, a preset memory block of 1 kilobyte, a preset memory block of 4 kilobytes, and a preset memory block of 1 megabyte. Each preset memory block includes header information (i.e., header) and a data unit (i.e., block). The header information includes verification information (i.e., magic), the size of the preset memory block (i.e., size), the length of the target data in the preset memory block (i.e., len), the offset of the preset memory block (i.e., offset), and the flag information of the memory block (i.e., flag). The verification information is used to verify whether the preset shared memory block where the target data is located is overwritten.

[0087] In a possible design, the data sharing end matches the target shared memory block based on the length of the target data, and stores the target data in the target shared memory block to obtain information of the shared memory pool, wherein the target shared memory block is the smallest preset data block for storing the target data.

[0088] In a possible design, the data sharing end may obtain the IPC channel information of the data requesting end, and then the data sharing end sends a sharing message to the data requesting end through the IPC channel of the data requesting end based on the IPC channel information of the data requesting end.

[0089] Specifically, the data sharing end can create a peer data request end proxy entity based on the sharing function information of the data request end and the IPC channel information of the data request end, and store the sharing function information of the data request end and the IPC channel information of the data request end in the peer data request end proxy entity. The data sharing end can create a peer data sharing end proxy entity based on the sharing function information of the data sharing end and the IPC channel information of the sharing end, and store the sharing function information of the data sharing end and the IPC channel information of the data sharing end in the peer data sharing end proxy entity. The data sharing end can obtain the IPC channel information based on the peer data sharing end proxy entity.

[0090] It should be noted that multiple data sharing terminals can send sharing messages to one data requesting terminal through an IPC channel of one data requesting terminal.

[0091] For example, Figure 4 As shown, data sharing terminal 1 (i.e., DDS proc1) sends a sharing message to the IPC channels of data requesting terminal 1 (i.e., DDS proc2) and data requesting terminal 2 (i.e., DDS proc3) through the data writer and the IPC channel (i.e., ipc channel) of data sharing terminal 1. Afterwards, data requesting terminal 1 and data requesting terminal 2 receive the sharing message sent by data sharing terminal 1 through their respective data readers, and obtain the target data from the shared memory pool (i.e., shm) of data sharing terminal 1 based on the sharing message.

[0092] It should be noted that the data sharing end can store the target data in the shared memory pool through the data writer, and the data sharing end can read data from the shared memory pool through the data reader. The data sharing end cannot store the target data in the shared memory pool through the data reader.

[0093] It is understandable that the data sharing end sends a sharing message to the data requesting end through the IPC channel of the data requesting end, which can promptly and synchronously notify the data requesting end to obtain the target data, thereby avoiding data loss caused by data overwriting and untimely reading.

[0094] In some embodiments, a shared memory management module exists at the data sharing end for managing the transmission mode based on the shared memory. The shared memory management module includes an asynchronous notification shared memory information module, which is used by the data request end to send a shared message.

[0095] In some embodiments, configuration information is pre-stored in the data sharing terminal. The data sharing terminal obtains a sharing function message based on the configuration information. If the sharing function message is used to indicate that the data sharing terminal supports shared memory, the data sharing terminal creates a shared memory pool and an IPC channel. If the sharing function message is used to indicate that the data sharing terminal does not support shared memory, the data sharing terminal does not broadcast its own sharing function message.

[0096] Exemplarily, the configuration information may be a data format for configuring shared data.

[0097] For example, Figure 5 As shown, the data sharing end initializes the DDS protocol. Afterwards, the data sharing end obtains a sharing function message based on the configuration information. The data sharing end determines that the sharing function message is used to indicate that the data sharing end supports shared memory. If the sharing function message is used to indicate that the data sharing end supports shared memory, the data sharing end creates a shared memory pool and an IPC channel, and establishes a target connection with the data request end that supports shared memory; if the sharing function message is used to indicate that the data sharing end does not support shared memory, the data sharing end does not broadcast its own sharing function message.

[0098] In some embodiments, the data sharing end stores the target data in the shared data pool by circular overwriting.

[0099] Exemplarily, there are n memory blocks preset in the shared data pool, which are used in a 1-n cycle.

[0100] In some embodiments, the data sharing end may receive the retransmission message sent by the data requesting end, and then the data sharing end may store the target data in the shared memory pool and send a new sharing message to the data requesting end.

[0101] In a possible implementation, if the data transmission mode is a transmission mode based on a transport layer protocol, the data sharing end sends the target data to the data requesting end based on the transport layer protocol.

[0102] Exemplarily, the transport layer protocol is UDP protocol or TCP protocol.

[0103] For example, Figure 6 As shown, the data sharing end serializes the data to be transmitted to obtain the target data. After that, the data sharing end stores the target data in the target shared memory block. After that, the data sharing end transmits the target data to the data request end based on the data transmission mode.

[0104] It is understandable that the transmission mode based on shared memory is used in local communication, which can utilize shared memory space, reduce the multiple data copying processes of the CPU, and has no limit on the size of the transmission content, and does not need to transmit large data packets in fragments. The transmission mode based on the transport layer protocol can support broadcast and multicast transmission modes, and send data to multiple receivers at the same time. In this way, flexible application in different scenarios can be achieved.

[0105] Based on the above technical solution, the data sharing end can receive a data request message sent by the data request end, and the data request message is used to request the target data. Afterwards, the data sharing end obtains the sharing function information of the data request end and the sharing function information of the data sharing end, and the sharing function information is used to indicate whether shared memory is supported. Afterwards, the data sharing end can determine the data transmission mode based on the sharing function information of the data request end and the sharing function information of the data sharing end. Afterwards, the data sharing end transmits the target data to the data request end based on the data transmission mode. In this way, the data sharing end can use the data transmission mode of shared memory within the domain and the transmission mode based on the transport layer protocol between domains, so that data transmission can be realized between the data sharing end and the data request end. In this way, by adaptively adapting the transmission modes of both ends in the DDS protocol stack, it can be automatically switched or used in combination under different network conditions, thereby improving the adaptability and stability of the system.

[0106] Figure 7 is a flow chart of a data transmission method according to an exemplary embodiment. Figure 7 As shown, the data transmission method is applied to the data requesting end, and the method includes:

[0107] S701: The data requesting end sends a data request message to the data sharing end.

[0108] The data request message is used to request target data.

[0109] In a possible implementation manner, the data requesting end sends a data request message to the data sharing end through broadcasting.

[0110] In another possible implementation, the data request end includes a data reader, and the data reader is used to indicate an entity that performs a read operation on the data. The data sharing end establishes a target connection with the data reader of the data request end through the data writer through the DDS discovery protocol to obtain a target connection message. The target connection message can be used as a data request message sent by the data request end.

[0111] In a possible design, the data requesting end obtains the subject information of the data requesting end, and the subject information is used to indicate the data type of the data transmitted by the data writer of the data sharing end. If the data type of the data transmitted by the data writer of the data sharing end is inconsistent with the data type of the data received by the data reader of the data requesting end, the data requesting end does not establish a target connection with the data sharing end. If the data type of the data transmitted by the data writer of the data sharing end is consistent with the data type of the data received by the data reader of the data requesting end, the data requesting end establishes a target connection with the data sharing end.

[0112] In a possible design, the data request end receives a data sharing end information message sent by the data sharing end, and the data sharing end information message includes the IP address of the data sharing end. Then, the data request end establishes a target connection with the data sharing end based on the data sharing end information message. Then, the data request end stores the shared memory address information of the data sharing end in the shared information table.

[0113] It can be understood that the data requesting end stores the shared memory information of the data sharing end in the shared information table, so that after the data requesting end receives the sharing message sent by the data sharing end, it can directly obtain the address of the shared memory corresponding to the data requesting end from the shared information table without having to access the proxy entity to obtain the shared memory address.

[0114] For example, Figure 2 As shown, the data request end obtains the corresponding shared memory pool and the corresponding IPC channel, and maps the shared memory pool to the address space of the data sharing end. Afterwards, in the SPDP stage, the data request end receives the shared broadcast message sent by the data sharing end. Afterwards, the data request end parses the shared broadcast message to obtain the shared function information of the data sharing end. The data request end can create a peer data sharing end proxy entity based on the shared function information of the data sharing end, and store the shared function information of the data sharing end in the data sharing end proxy entity. Afterwards, in the SEDP stage, the data request end obtains the data request end information message of the data sharing end through the data reader, and establishes a target connection with the data writer of the data request end based on the data request end information message.

[0115] S702: The data requesting end receives a sharing message sent by the data sharing end.

[0116] The shared message is used to indicate that the target data has been stored in the shared memory pool.

[0117] In a possible implementation, the data request end monitors the IPC channel and receives the sharing message sent by the data sharing end if the data request end monitors the data sharing end sending the sharing message.

[0118] In one possible design, the data request end monitors the IPC channel based on a listening program.

[0119] Exemplarily, the listening program is a Waitset module.

[0120] In some embodiments, the data request end monitors the transport layer protocol channel. If the data request end monitors that the data sharing end sends a target data message, the target data message is received and the target data message is decapsulated to obtain the target data.

[0121] S703: The data requesting end obtains target data from the shared memory pool based on the shared message.

[0122] It should be noted that this application uses the receiving thread of DDS communication and does not add a new thread. For the receiving thread of DDS communication, reference can be made to the prior art and will not be repeated here.

[0123] The shared message includes: information of a shared memory pool. The information of the shared memory pool includes at least one of the following: an identifier of the shared memory pool, a size of the shared memory pool, a size of a shared memory block where target data is located, verification information, a length of target data, and an offset of the shared memory pool. The identifier of the shared memory pool is used to indicate a name of the shared memory pool.

[0124] It is understandable that after the data request end obtains the information of the shared memory pool, it can determine the target shared memory block based on the information of the shared memory pool and obtain the target data, thereby improving the accuracy of data access.

[0125] In a possible design, the data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

[0126] It is understandable that the data request end and the data sharing end have independent shared memory spaces, which enable each data request end and data sharing end to process its own data independently without waiting for other processes to complete. This helps to improve the concurrent performance of the system, allowing multiple processes to process data at the same time, thereby speeding up the completion of the overall task.

[0127] In a possible implementation, the data requesting end obtains target data from a shared memory pool based on a shared message.

[0128] In a possible design, the data request end obtains the address of the shared memory pool where the target data is located from the shared memory information table based on the information of the shared memory pool. Afterwards, the data request end obtains the target data from the shared memory pool where the target data is located based on the address of the shared memory pool where the target data is located and the information of the shared memory pool.

[0129] Specifically, before the data request end obtains the target data from the shared memory pool where the target data is located, it will check whether the preset shared memory block where the target data is located is overwritten based on the verification information. If the preset shared memory block where the target data is located is not overwritten, the data request end obtains the target data from the shared memory pool where the target data is located; if the preset shared memory block where the target data is located is overwritten, the data request end sends an overwrite message to the data sharing end, and the overwrite message is used to indicate that the preset shared memory block where the target data is located is overwritten.

[0130] Exemplarily, the verification information is a verification value. If the verification value of the preset shared memory block where the target data is located is consistent with the verification value in the shared memory pool information, it means that the preset shared memory block where the target data is located has not been overwritten; if the verification value of the preset shared memory block where the target data is located is inconsistent with the verification value in the shared memory pool information, it means that the preset shared memory block where the target data is located is overwritten.

[0131] In some embodiments, the data request end performs data processing on the target data based on the DDS protocol stack processing method.

[0132] It should be noted that the DDS protocol stack processing method can refer to the conventional DDS protocol stack processing flow method, which will not be described in detail here.

[0133] Exemplarily, the data request end monitors the IPC channel and the transport layer protocol channel. If the data request end monitors the IPC channel data sharing end to send a sharing message, the sharing message sent by the data sharing end is received, and the target data is obtained from the shared memory pool based on the sharing message. Afterwards, the target data is processed based on the DDS protocol stack processing method. If the data request end monitors the transport layer protocol channel data sharing end to send a data transmission message, the target data message is received, and the target data message is unsealed to obtain the target data. Afterwards, the target data is processed based on the DDS protocol stack processing method.

[0134] Based on the above technical solution, the data request end can send a data request message to the data sharing end, and the data request message is used to request the target data. Afterwards, the data request end receives the sharing message sent by the data sharing end, and the sharing message is used to indicate that the target data has been stored in the shared memory pool. Based on the sharing message. Afterwards, the data request end obtains the target data from the shared memory pool. In this way, the data request end can directly obtain data from the shared memory pool of the data sharing end, thereby avoiding data transmission delay and significantly improving data access speed.

[0135] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the data transmission device (i.e., middleware) includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0136] The embodiment of the present application can divide the data transmission device into functional modules according to the above method. For example, the data transmission device can include various functional modules corresponding to the various functional divisions, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0137] Figure 8 FIG. 1 is a schematic diagram showing a structure of a data transmission device according to an exemplary embodiment. Figure 8 The data transmission device includes an acquisition module 801 and a processing module 802.

[0138] The acquisition module 801 is used to receive a data request message sent by a data request end, where the data request message is used to request target data.

[0139] The acquisition module 801 is used to acquire the sharing function information of the data requesting end and the sharing function information of the data sharing end, where the sharing function information is used to indicate whether the shared memory is supported.

[0140] The processing module 802 is used to determine the data transmission mode based on the sharing function information of the data requesting end and the sharing function information of the data sharing end.

[0141] The processing module 802 is used to transmit target data to the data request end based on the data transmission mode.

[0142] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0143] Fig. 9 FIG. 1 is a schematic diagram showing the structure of another data transmission device according to an exemplary embodiment. Fig. 9The data transmission device includes an acquisition module 901 and a processing module 902.

[0144] The processing module 902 is used to send a data request message to the data sharing end, where the data request message is used to request target data.

[0145] The acquisition module 901 is used to receive a sharing message sent by a data sharing terminal, where the sharing message is used to indicate that the target data has been stored in the shared memory pool.

[0146] The processing module 902 is used to obtain target data from the shared memory pool based on the shared message.

[0147] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0148] Fig.10 FIG. 1 is a schematic diagram showing a structure of a data transmission device according to an exemplary embodiment. Fig.10 As shown, the data transmission device includes but is not limited to: a processor 1001 and a memory 1002 .

[0149] The memory 1002 is used to store executable instructions of the processor 1001. It can be understood that the processor 1001 is configured to execute instructions to implement the data transmission method in the above embodiment.

[0150] It should be noted that those skilled in the art can understand that Fig.10 The data transmission device structure shown in the figure does not constitute a limitation on the data transmission device, and the data transmission device may include Fig.10 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.

[0151] The processor 1001 is the control center of the data transmission device. It uses various interfaces and lines to connect various parts of the entire data transmission device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it performs various functions of the data transmission device and processes data, thereby monitoring the data transmission device as a whole. The processor 1001 may include one or more processing units. Optionally, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.

[0152] The memory 1002 may be used to store software programs and various data. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional module (such as a determination unit, a processing unit, etc.), etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0153] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1002 including instructions. The above instructions can be executed by the processor 1001 of the data transmission device to implement the method in the above embodiment.

[0154] In actual implementation, the functions of the acquisition module 801, the processing module 802, the acquisition module 901 and the processing module 902 can all be Fig.10 The processor 1001 in the embodiment calls the computer program stored in the memory 1002 to implement. The specific execution process can refer to the description of the method part in the above embodiment, which will not be repeated here.

[0155] Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0156] In an exemplary embodiment, the present application also provides a computer program product including one or more instructions, and the one or more instructions can be executed by the processor 1001 of the data transmission device to complete the method in the above embodiment.

[0157] It should be noted that when the instructions in the above-mentioned computer-readable storage medium or one or more instructions in the computer program product are executed by the processor of the data transmission device, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect as the above-mentioned method can be achieved. To avoid repetition, they will not be repeated here.

[0158] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0160] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the full classification part or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute the full classification part or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD and other media that can store program code.

[0163] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data transmission method, characterized in that: Applied to the data sharing end, the method includes: receiving a data request message sent by a data request end, wherein the data request message is used to request target data; Acquire the sharing function information of the data requesting end and the sharing function information of the data sharing end, wherein the sharing function information is used to indicate whether shared memory is supported; Determining a data transmission mode based on the sharing function information of the data requesting end and the sharing function information of the data sharing end; The target data is transmitted to the data requesting end based on the data transmission mode.

2. The method according to claim 1, characterized in that The determining of the data transmission mode based on the sharing function information of the data requesting end and the sharing function information of the data sharing end includes: If both the data requesting end and the data sharing end support shared memory, determining that the data transmission mode is a transmission mode based on shared memory; If the data requesting end or the data sharing end does not support shared memory, the data transmission mode is determined to be a transmission mode based on a transport layer protocol.

3. The method according to claim 1, characterized in that The transmitting data to the data requesting end based on the data transmission mode includes: If the data transmission mode is a shared memory-based transmission mode, the target data is stored in a shared memory pool, and a sharing message is sent to the data requesting end, where the sharing message is used to indicate that the target data has been stored in the shared memory pool; If the data transmission mode is a transmission mode based on a transport layer protocol, the target data is sent to the data requesting end based on the transport layer protocol.

4. The method according to claim 3, characterized in that The data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

5. The method according to claim 3, characterized in that: Sending the sharing message to the data requesting end includes: Obtaining the inter-process communication (IPC) channel information of the data requesting end; Based on the IPC channel information of the data request end, the shared message is sent to the data request end through the IPC channel of the data request end, and the shared message includes: information of the shared memory pool.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Broadcast the IPC channel information of the data sharing terminal and the sharing function information.

7. A data transmission method, characterized in that: Applied to a data requesting end, the method comprises: Sending a data request message to the data sharing end, wherein the data request message is used to request target data; receiving a sharing message sent by the data sharing end, wherein the sharing message is used to indicate that the target data has been stored in the shared memory pool; Based on the shared message, the target data is obtained from the shared memory pool.

8. The method according to claim 7, characterized in that The sharing message includes: information of the shared memory pool.

9. The method according to claim 7, characterized in that: The data request end and the data sharing end each correspond to a memory pool, and the shared memory pool is the memory pool of the data sharing end.

10. A data transmission device, characterized in that: Applied to a data sharing terminal, the device comprises an acquisition module and a processing module; The acquisition module is used to receive a data request message sent by a data request end, wherein the data request message is used to request target data; The acquisition module is further used to acquire the sharing function information of the data requesting end and the sharing function information of the data sharing end, wherein the sharing function information is used to indicate whether shared memory is supported; The processing module is further used to determine a data transmission mode based on the sharing function information of the data requesting end and the sharing function information of the data sharing end; The processing module is further configured to transmit target data to the data requesting end based on the data transmission mode.

11. A data transmission device, characterized in that: Applied to a data requesting end, the device comprises an acquisition module and a processing module; The processing module is used to send a data request message to the data sharing terminal, wherein the data request message is used to request target data; The acquisition module is used to receive a sharing message sent by the data sharing terminal, wherein the sharing message is used to indicate that the target data has been stored in the shared memory pool; The processing module is further configured to obtain the target data from the shared memory pool based on the shared message.

12. A data transmission device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of a data transmission device, the data transmission device can perform the method according to any one of claims 1 to 9.

14. A computer program product, characterized in that The computer program product comprises computer instructions, which, when executed on a data transmission device, enable the data transmission device to perform the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Switch, system and method for data transmission based on dynamic route descriptor and shared pool

    CN121309511A