Data sending method and device, equipment, storage medium and program product

By segmenting and serializing data and sending each segment separately, the reliability and real-time issues of data transmission in distributed systems are solved, achieving efficient and stable data transmission under unreliable transmission protocols.

CN121940356APending Publication Date: 2026-04-28ZEBRED NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

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

Technical Problem

In distributed systems, especially in autonomous driving systems, existing data transmission schemes struggle to balance high reliability and real-time performance. In particular, when using unreliable transport protocols such as UDP, transmitting large amounts of data can easily lead to buffer overflows and packet loss, affecting the stability of the communication link.

Method used

By serializing data in segments and sending each segment immediately after serialization, and using the serialization interval as the sending interval, the data sending rhythm is dynamically adjusted to avoid instantaneous traffic surges. This can be combined with synchronous or asynchronous sending methods to adapt to different needs.

Benefits of technology

Without increasing the total serialization time, it significantly reduces the packet loss rate during transmission, improves the transmission success rate, meets the real-time requirements of synchronous transmission scenarios, and avoids buffer overflow and packet loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121940356A_ABST
    Figure CN121940356A_ABST
Patent Text Reader

Abstract

The invention provides a data sending method and device, equipment, a storage medium and a program product. According to a preset segmentation serialization rule, segmentation serialization is carried out on to-be-transmitted data to obtain segmentation serialization data, and the segmentation serialization data is sent to a data receiving end; updating the to-be-transmitted data based on the segmented serialized data; under the condition that the to-be-transmitted data is not fully serialized, returning to execute the step started according to the preset segmentation serialization rule; and determining that the to-be-transmitted data is completely sent until the to-be-transmitted data is completely serialized. According to the invention, the data is sent in a segmented and serialized manner, and the serialization gap is used as the sending interval, so that the problem that the total end-to-end transmission delay is caused by sudden increase of instantaneous flow, packet loss of a transmission layer, retransmission repair of a protocol layer and the like due to too short sending interval is avoided; and compared with a mode of completely serializing the data and then transmitting the data, the packet loss rate in the transmission process can be reduced under the condition that the serialization and the total transmission time are not changed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed communication technology, and in particular to a data transmission method, apparatus, device, storage medium, and program product. Background Technology

[0002] In fields with extremely high real-time requirements, such as distributed systems, industrial automation, and intelligent transportation systems (e.g., autonomous driving), the reliability and efficiency of data transmission are core challenges. Taking autonomous driving systems as an example, vehicles need to transmit sensor data, control commands, and environmental perception information in real time via a distributed data distribution service (DDS). This data is typically communicated using unreliable transport protocols (such as UDP) to meet the demands of low latency and high throughput. However, the UDP protocol itself does not guarantee reliable data transmission, and its send buffer capacity is limited. When the system needs to transmit large volumes of data (such as high-resolution images, point cloud data, or complex state information), the serialized data needs to be transmitted through multiple data fragments. If a large number of data fragments are sent in a short period, it may cause the send buffer to overflow, triggering network packet loss and ultimately interrupting the communication link. For example, in autonomous driving scenarios, if perception data fails to be transmitted to the decision-making module in a timely manner due to packet loss, it may lead to the vehicle misjudging road conditions, causing safety hazards.

[0003] Currently, two main approaches are used to address the problem of large data transmission under unreliable transmission channels: flow control strategies and blocking transmission strategies. However, these two approaches struggle to simultaneously meet the real-time requirements of synchronous transmission scenarios or avoid transmission efficiency degradation. For example, flow control strategies change the data transmission mode from synchronous to asynchronous, introducing a transmission queue and flow scheduling mechanism. After data serialization, it enters a buffer queue, and the transmission thread sends data in batches according to a preset flow threshold. Although flow control strategies reduce packet loss by limiting the instantaneous transmission rate, they are only applicable to asynchronous transmission scenarios and cannot meet the needs of synchronous transmission or low-latency scenarios.

[0004] Therefore, there is an urgent need for a data transmission solution that balances reliability and real-time requirements. Summary of the Invention

[0005] This application provides a data transmission method, apparatus, device, storage medium, and program product to achieve the effect of balancing reliability and real-time requirements during data transmission.

[0006] In a first aspect, embodiments of this application provide a data transmission method applied to a DDS, wherein the DDS includes a data transmitter and a data receiver, comprising:

[0007] The data to be transmitted is obtained from the application through the data sending end;

[0008] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, which is then sent to the data receiving end.

[0009] Update the data to be transmitted based on segmented serialized data;

[0010] Determine whether the data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, return to the step of starting to serialize the data to be transmitted in segments according to the preset segment serialization rules.

[0011] The transmission of data is considered complete once the data to be transmitted has been fully serialized.

[0012] In one possible implementation, before obtaining the data to be transmitted sent by the application through the data sending end, the method further includes:

[0013] Determine the data transmission requirements corresponding to the application; the data transmission requirements should include at least the requirements for optimizing data transmission duration and the requirements for deterministic feedback on data transmission status;

[0014] Based on the data transmission requirements of the application, the data transmission method is determined; the data transmission method includes synchronous transmission and asynchronous transmission.

[0015] In one possible implementation, the data transmission method is determined based on the data transmission requirements corresponding to the application, including:

[0016] If a data transmission request indicates that the application needs to reduce data transmission time, then the data transmission method is determined to be asynchronous transmission;

[0017] If a data transmission request indicates that the application needs to obtain deterministic feedback on the data transmission status, then the data transmission method is determined to be synchronous transmission.

[0018] In one possible implementation, the data to be transmitted is segmented and serialized according to a preset segmentation serialization rule to obtain segmented serialized data, and the segmented serialized data is sent to the data receiving end, including:

[0019] When the data transmission method is synchronous transmission;

[0020] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and then the segmented serialized data is sent to the data receiving end;

[0021] Perform the step of determining whether the data to be transmitted has been fully serialized.

[0022] In one possible implementation, the method further includes:

[0023] When the data transmission method is asynchronous;

[0024] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data;

[0025] The step of updating the data to be transmitted based on segmented serialized data is initiated.

[0026] The segmented serialized data is then sent to the data buffer so that the serialized data to be sent can be retrieved from the data buffer according to the preset transmission threshold, and then sent to the data receiving end.

[0027] In one possible implementation, updating the data to be transmitted based on segmented serialized data includes:

[0028] Based on the segmented serialized data, determine the target data to be transmitted corresponding to the segmented serialized data in the data to be transmitted;

[0029] Add a serialization identifier to the data to be transmitted corresponding to the segmented serialized data; the serialization identifier indicates that the target data to be transmitted has been serialized.

[0030] In one possible implementation, determining whether the data to be transmitted has been fully serialized includes:

[0031] Determine whether there is data in the data to be transmitted that has not been marked with a serialization identifier;

[0032] If there is data in the data to be transmitted that has not been serialized, it is determined that the data to be transmitted has not been fully serialized.

[0033] If there is no data in the data to be transmitted that has not been serialized, then it is determined that the data to be transmitted has been fully serialized.

[0034] Secondly, embodiments of this application provide a data transmission apparatus applied to a DDS, wherein the DDS includes a data transmission end and a data receiving end, comprising:

[0035] The acquisition module is used to acquire the data to be transmitted sent by the application through the data sending end;

[0036] The serialization module is used to segment and serialize the data to be transmitted according to the preset segment serialization rules, obtain segmented serialized data, and send the segmented serialized data to the data receiving end.

[0037] The processing module is used to update the data to be transmitted based on the segmented serialized data;

[0038] The processing module is also used to determine whether the data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, it returns to the step of performing segmented serialization of the data to be transmitted according to the preset segmented serialization rules.

[0039] The determination module is used to determine that the data to be transmitted has been sent completely once the data to be transmitted has been fully serialized.

[0040] In one possible implementation, the processing module is further configured to:

[0041] Determine the data transmission requirements corresponding to the application; the data transmission requirements should include at least the requirements for optimizing data transmission duration and the requirements for deterministic feedback on data transmission status;

[0042] Based on the data transmission requirements of the application, the data transmission method is determined; the data transmission method includes synchronous transmission and asynchronous transmission.

[0043] In one possible implementation, the determining module is further configured to:

[0044] If a data transmission request indicates that the application needs to reduce data transmission time, then the data transmission method is determined to be asynchronous transmission;

[0045] If a data transmission request indicates that the application needs to obtain deterministic feedback on the data transmission status, then the data transmission method is determined to be synchronous transmission.

[0046] In one possible implementation, the serialization module is also used for:

[0047] When the data transmission method is synchronous transmission;

[0048] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and then the segmented serialized data is sent to the data receiving end;

[0049] Perform the step of determining whether the data to be transmitted has been fully serialized.

[0050] In one possible implementation, the serialization module is also used for:

[0051] When the data transmission method is asynchronous;

[0052] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data;

[0053] The step of updating the data to be transmitted based on segmented serialized data is initiated.

[0054] The segmented serialized data is then sent to the data buffer so that the serialized data to be sent can be retrieved from the data buffer according to the preset transmission threshold, and then sent to the data receiving end.

[0055] In one possible implementation, the processing module is further configured to:

[0056] Based on the segmented serialized data, determine the target data to be transmitted corresponding to the segmented serialized data in the data to be transmitted;

[0057] Add a serialization identifier to the data to be transmitted corresponding to the segmented serialized data; the serialization identifier indicates that the target data to be transmitted has been serialized.

[0058] In one possible implementation, the processing module is further configured to:

[0059] Determine whether there is data in the data to be transmitted that has not been marked with a serialization identifier;

[0060] If there is data in the data to be transmitted that has not been serialized, it is determined that the data to be transmitted has not been fully serialized.

[0061] If there is no data in the data to be transmitted that has not been serialized, then it is determined that the data to be transmitted has been fully serialized.

[0062] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0063] The memory stores instructions that the computer executes;

[0064] 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 as described above.

[0065] Fourthly, 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.

[0066] Fifthly, 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.

[0067] The data transmission method, apparatus, device, storage medium, and program product provided in this application embodiment obtain data to be transmitted sent by an application through a data sending end; serialize the data to be transmitted into segments according to a preset segmented serialization rule to obtain segmented serialized data, and send the segmented serialized data to a data receiving end; update the data to be transmitted based on the segmented serialized data; determine whether the data to be transmitted has been fully serialized; if the data to be transmitted has not been fully serialized, return to the step of starting to serialize the data to be transmitted into segments according to the preset segmented serialization rule; until the data to be transmitted has been fully serialized, it is determined that the data to be transmitted has been transmitted. This application avoids the instantaneous surge in traffic caused by too short a transmission interval, which would lead to packet loss at the transport layer and retransmission repair at the protocol layer, resulting in total end-to-end transmission delay. Compared with the method of transmitting data completely serialized first, this not only reduces peak traffic but also ensures that the packet loss rate during transmission is greatly reduced and the transmission success rate is improved while keeping the total serialization and transmission time unchanged. Attached Figure Description

[0068] 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.

[0069] Figure 1 A flowchart illustrating a data transmission method provided in this application Figure 1 ;

[0070] Figure 2 A flowchart illustrating a data transmission method provided in this application Figure 2 ;

[0071] Figure 3 A schematic diagram of the structure of a data transmission device provided in this application;

[0072] Figure 4 This is a schematic diagram of the structure of an electronic device provided in this application.

[0073] The accompanying drawings have illustrated 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 specific embodiments. Detailed Implementation

[0074] 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.

[0075] In fields with extremely high real-time requirements, such as distributed systems, industrial automation, and intelligent transportation systems (e.g., autonomous driving), the reliability and efficiency of data transmission are core challenges. Taking autonomous driving systems as an example, vehicles need to transmit sensor data, control commands, and environmental perception information in real time via a distributed data distribution service (DDS). This data is typically communicated using unreliable transport protocols (such as UDP) to meet the demands of low latency and high throughput. However, the UDP protocol itself does not guarantee reliable data transmission, and its send buffer capacity is limited. When the system needs to transmit large volumes of data (such as high-resolution images, point cloud data, or complex state information), the serialized data needs to be transmitted through multiple data fragments. If a large number of data fragments are sent in a short period, it may cause the send buffer to overflow, triggering network packet loss and ultimately interrupting the communication link. For example, in autonomous driving scenarios, if perception data fails to be transmitted to the decision-making module in a timely manner due to packet loss, it may lead to the vehicle misjudging road conditions, causing safety hazards.

[0076] Currently, two main approaches are used to address the problem of large data transmission under unreliable transmission channels: flow control strategies and blocking transmission strategies. However, these two approaches struggle to simultaneously meet the real-time requirements of synchronous transmission scenarios or avoid transmission efficiency degradation. For example, flow control strategies change the data transmission mode from synchronous to asynchronous, introducing a transmission queue and flow scheduling mechanism. After data serialization, it enters a buffer queue, and the transmission thread sends data in batches according to a preset flow threshold. Although flow control strategies reduce packet loss by limiting the instantaneous transmission rate, they are only applicable to asynchronous transmission scenarios and cannot meet the needs of synchronous transmission or low-latency scenarios.

[0077] Therefore, there is an urgent need for a data transmission solution that balances reliability and real-time requirements.

[0078] The data transmission method, apparatus, device, storage medium, and program product provided in this application acquire data to be transmitted from an application program at the data transmitting end; serialize the data to be transmitted into segments according to a preset segmentation serialization rule to obtain segmented serialized data, and send the segmented serialized data to the data receiving end; update the data to be transmitted based on the segmented serialized data; determine whether the data to be transmitted has been fully serialized; if the data to be transmitted has not been fully serialized, return to the step of starting to serialize the data to be transmitted into segments according to the preset segmentation serialization rule; until the data to be transmitted has been fully serialized, it is determined that the transmission of the data to be transmitted has been completed. This application avoids the instantaneous surge in traffic caused by too short a transmission interval, which would lead to packet loss at the transport layer and retransmission repair at the protocol layer, resulting in total end-to-end transmission delay. Compared with the method of transmitting data completely serialized first, this not only reduces peak traffic but also ensures that the packet loss rate during transmission is greatly reduced and the transmission success rate is improved while keeping the total serialization and transmission time unchanged.

[0079] 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.

[0080] Figure 1 A flowchart illustrating a data transmission method provided in this application Figure 1 ,like Figure 1 As shown, this method is applied to a DDS, which includes a data transmitter and a data receiver. The data transmission method provided in this embodiment includes:

[0081] In the process of using DDS to transmit data between different applications, the data sending end receives data sent by the first application and transmits the received data to the data receiving end; the data receiving end then sends the received data to the second application.

[0082] Currently, in large-scale data transmission, the maximum number of bytes sent in a single transmission is limited by the transport layer. The data to be transmitted is serialized completely and then transmitted from the sender to the receiver in the form of data fragments. When the amount of data transmitted is large, a large number of data fragments are transmitted in a short period. However, for unreliable transmission channels, such as UDP channels, the limited sending buffer capacity and the constraints imposed by network communication conditions can easily lead to significant packet loss.

[0083] For example, in sensor data transmission during autonomous driving, data needs to be serialized and transmitted using the DDS protocol. Due to the limited buffer capacity and lack of reliability guarantees of the UDP protocol, transmitting large amounts of data fragments in a short period can easily lead to buffer overflows and packet loss, ultimately disrupting the communication link. This solution uses a coordinated mechanism of segmented serialization and intermittent transmission to dynamically adjust the data transmission rhythm to adapt to the characteristics of unreliable transmission channels.

[0084] S101. Obtain the data to be transmitted sent by the application through the data sending end;

[0085] For example, the data to be transmitted, "data1", sent by the application "APP1", can be obtained through the data sending end.

[0086] In one possible implementation, before obtaining the data to be transmitted sent by the application through the data sending end, the method further includes:

[0087] Determine the data transmission requirements corresponding to the application; the data transmission requirements should include at least the requirements for optimizing data transmission duration and the requirements for deterministic feedback on data transmission status;

[0088] Based on the data transmission requirements of the application, the data transmission method is determined; the data transmission method includes synchronous transmission and asynchronous transmission.

[0089] This application breaks down the originally one-time serialization operation into segmented serialization, and sends the data segment immediately after each segment is serialized. This dynamically distributes the data transmission rhythm without changing the total serialization time, reducing instantaneous traffic spikes and avoiding buffer overflow and packet loss issues. By utilizing the intervals within the serialization process itself as transmission intervals, it satisfies the real-time requirements of synchronous transmission scenarios while avoiding the performance overhead introduced by additional buffer queues or scheduling mechanisms.

[0090] Therefore, before sending data, the current data sending method can be determined based on data transmission requirements and status feedback requirements. For example, for application APP1, the data transmission requirement 'a' corresponding to APP1 can be determined first, and the data sending method can be determined based on data transmission requirement 'a'.

[0091] In one possible implementation, the data transmission method is determined based on the data transmission requirements of the application, and the specific process is as follows:

[0092] If a data transmission request indicates that the application needs to reduce data transmission time, then the data transmission method is determined to be asynchronous transmission;

[0093] If a data transmission request indicates that the application needs to obtain deterministic feedback on the data transmission status, then the data transmission method is determined to be synchronous transmission.

[0094] Understandably, when the application has high deterministic requirements, that is, it needs to be certain that the data has been sent, then synchronous sending mode is chosen; when the application has high concurrency requirements, that is, to reduce the data transmission time, then asynchronous sending mode is chosen.

[0095] For example, if data transmission requirement a is "to confirm that the data has been sent", then the data transmission method is determined to be synchronous transmission; similarly, if data transmission requirement a is "to reduce data transmission latency and improve data transmission efficiency", then the data transmission method is determined to be synchronous transmission.

[0096] This step determines the data transmission method by identifying the data transmission requirements of the application, in order to meet the differentiated data transmission needs.

[0097] S102. According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and the segmented serialized data is sent to the data receiving end.

[0098] The preset segmented serialization rule refers to serializing the data to be transmitted segment by segment according to a certain proportion of the data size. For example, the preset segmented serialization rule is "serialize the data segment by segment according to the data size of 10kb".

[0099] For example, if the data to be transmitted, "Data 1," is 100kb in size, then according to the preset segmented serialization rules, Data 1 is divided into 10 serialization steps, and each 10kb segment of Data 1 is serialized sequentially. For instance, the first serialization serializes the segment from 0kb to 10kb in Data 1, and similarly, the second serialization serializes the segment from 10kb to 20kb in Data 1; and so on, until Data 1 is completely serialized.

[0100] For any segmented serialization, such as the first segmented serialization of data 1, the resulting segmented serialized data is "data 11", where data 11 corresponds to the "0-10kb" segment of data 1. This serialized segment of data is then sent to the data receiving end.

[0101] S103. Update the data to be transmitted based on the segmented serialized data;

[0102] Based on the segmented serialized data "data11", update the data to be transmitted "data1" to determine whether the data to be transmitted has been fully serialized.

[0103] In one possible implementation, the data to be transmitted is updated based on segmented serialized data, and the specific process is as follows:

[0104] Based on the segmented serialized data, determine the target data to be transmitted corresponding to the segmented serialized data in the data to be transmitted;

[0105] Add a serialization identifier to the target data to be transmitted corresponding to the segmented serialized data; the serialization identifier indicates that the target data to be transmitted has been serialized.

[0106] Based on the above, for example, "data 11", it can be determined that in the data to be transmitted "data 1", data 11 corresponds to the "0-10kb" segment of data 1, that is, the target data to be transmitted 1 is: the data corresponding to "0-10kb" in data 1; then, a serialization identifier is added to the target data to be transmitted 1 to indicate that the "0-10kb" data has been serialized.

[0107] S104. Determine whether the data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, return to the step of starting to serialize the data to be transmitted in segments according to the preset segment serialization rules.

[0108] Based on the above, determine whether the updated data 1 has been fully serialized; if data 1 has not been fully serialized, continue to serialize data 1 according to the preset segmented serialization rules.

[0109] In one possible implementation, the process of determining whether the data to be transmitted has been fully serialized is as follows:

[0110] Determine whether there is data in the data to be transmitted that has not been marked with a serialization identifier;

[0111] If there is data in the data to be transmitted that has not been serialized, it is determined that the data to be transmitted has not been fully serialized.

[0112] If there is no data in the data to be transmitted that has not been serialized, then it is determined that the data to be transmitted has been fully serialized.

[0113] Based on the foregoing, if the data in the "10kb-100kb" range of Data 1 does not have a serialization identifier, then Data 1 is not fully serialized; if the data in the "0-100kb" range of Data 1 all have a serialization identifier, then there is no data in Data 1 without a serialization identifier, and Data 1 is fully serialized.

[0114] In one possible implementation, the data to be transmitted is segmented and serialized according to a preset segmentation serialization rule to obtain segmented serialized data, and the segmented serialized data is sent to the data receiving end, including:

[0115] When the data transmission method is synchronous transmission;

[0116] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and then the segmented serialized data is sent to the data receiving end;

[0117] Perform the step of determining whether the data to be transmitted has been fully serialized.

[0118] Figure 2 A flowchart illustrating a data transmission method provided in this application Figure 2 ,like Figure 2 As shown, Figure 2 The process steps corresponding to the solid line are synchronous transmission methods.

[0119] In the case of synchronous transmission, the data to be transmitted is segmented and serialized according to the preset segmented serialization rules. After the segmented serialized data is sent to the data receiving end, the data to be transmitted is updated according to the segmented serialized data. Then, the step of determining whether the data to be transmitted has started full serialization is executed.

[0120] For example, according to the preset segmented serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data "data2". After data2 is sent to the data receiving end, the data to be transmitted is updated according to data2, and it is determined whether the updated data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, the steps of segmenting and serializing the data to be transmitted according to the preset segmented serialization rules continue to be executed.

[0121] This application utilizes the serialization interval as the transmission interval to avoid instantaneous traffic surges caused by excessively short transmission intervals, which could lead to packet loss at the transport layer and retransmission repair at the protocol layer, resulting in overall end-to-end transmission delay. Furthermore, compared to the traditional centralized transmission mode, this method avoids buffer overflow by segmented transmission without increasing the total serialization time, while maintaining the real-time requirements of synchronous transmission.

[0122] In one possible implementation, the method further includes:

[0123] When the data transmission method is asynchronous;

[0124] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data;

[0125] The step of updating the data to be transmitted based on segmented serialized data is initiated.

[0126] The segmented serialized data is then sent to the data buffer so that the serialized data to be sent can be retrieved from the data buffer according to the preset transmission threshold, and then sent to the data receiving end.

[0127] like Figure 2 As shown, Figure 2 The process steps corresponding to the dashed lines are asynchronous transmission methods. In the case of asynchronous transmission, the data to be transmitted is segmented and serialized according to the preset segmented serialization rules, resulting in segmented serialized data; while sending the segmented serialized data to the data receiving end, the data to be transmitted is updated based on the segmented serialized data; and the step of determining whether the data to be transmitted has started full serialization is executed.

[0128] For example, according to the preset segmented serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data "data 3". While sending data 3 to the data receiving end, the data to be transmitted is updated according to data 3, and it is determined whether the updated data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, the steps of segmenting and serializing the data to be transmitted according to the preset segmented serialization rules continue to be executed.

[0129] Furthermore, this asynchronous transmission method can be combined with flow control strategies to accommodate different scenarios, such as prioritizing transmission efficiency or communication quality. Specifically, asynchronous transmission includes a serialization thread and a sending thread. The serialization thread is used to serialize the data to be transmitted into segments according to preset segmented serialization rules and then sends the serialized data to the buffer area. The sending thread is used to retrieve the serialized data from the buffer area and send it to the data receiving end. In addition, by combining with flow control strategies, the sending thread can adjust its transmission rhythm according to the transmission traffic, avoiding buffer backlog caused by the serialization thread being blocked. Furthermore, by using segmented serialization, the instantaneous traffic peaks in the buffer area can be reduced, the risk of buffer overflow can be reduced, and communication delays caused by the sending thread waiting for the serialization thread can be avoided.

[0130] S105. Until the data to be transmitted has been fully serialized, it is determined that the data to be transmitted has been sent.

[0131] This application provides a data transmission method that involves: acquiring data to be transmitted from an application via a data sending end; serializing the data to be transmitted into segments according to a preset segmented serialization rule to obtain segmented serialized data; sending the segmented serialized data to a data receiving end; updating the data to be transmitted based on the segmented serialized data; determining whether the data to be transmitted has been fully serialized; if not, returning to the step of starting the segmented serialization of the data to be transmitted according to the preset segmented serialization rule; and continuing until the data to be transmitted has been fully serialized, at which point the transmission of the data is considered complete. This application avoids the instantaneous surge in traffic caused by excessively short transmission intervals, which can lead to packet loss at the transport layer and retransmission repair at the protocol layer, resulting in total end-to-end transmission delay. Compared to transmitting data fully serialized before transmission, this method not only reduces peak traffic but also significantly reduces packet loss during transmission while maintaining the same total serialization and transmission time, thereby improving the transmission success rate.

[0132] Figure 3 A schematic diagram of the structure of a data transmission device provided in this application is shown below. Figure 3 As shown, this is applied to a DDS, which includes a data transmitter and a data receiver. The data transmitter 300 provided in this embodiment includes:

[0133] The acquisition module 301 is used to acquire the data to be transmitted sent by the application through the data sending end;

[0134] The serialization module 302 is used to serialize the data to be transmitted into segments according to a preset segment serialization rule, obtain segment serialized data, and send the segment serialized data to the data receiving end.

[0135] Processing module 303 is used to update the data to be transmitted based on the segmented serialized data;

[0136] The processing module 303 is also used to determine whether the data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, it returns to the step of performing segmented serialization of the data to be transmitted according to the preset segmented serialization rules.

[0137] The determination module 304 is used to determine that the data to be transmitted has been sent completely once the data to be transmitted has been fully serialized.

[0138] In one possible implementation, the processing module 303 is further configured to:

[0139] Determine the data transmission requirements corresponding to the application; the data transmission requirements should include at least the requirements for optimizing data transmission duration and the requirements for deterministic feedback on data transmission status;

[0140] Based on the data transmission requirements of the application, the data transmission method is determined; the data transmission method includes synchronous transmission and asynchronous transmission.

[0141] In one possible implementation, the determining module 304 is further configured to:

[0142] If a data transmission request indicates that the application needs to reduce data transmission time, then the data transmission method is determined to be asynchronous transmission;

[0143] If a data transmission request indicates that the application needs to obtain deterministic feedback on the data transmission status, then the data transmission method is determined to be synchronous transmission.

[0144] In one possible implementation, the serialization module 302 is further configured to:

[0145] When the data transmission method is synchronous transmission;

[0146] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and then the segmented serialized data is sent to the data receiving end;

[0147] Perform the step of determining whether the data to be transmitted has been fully serialized.

[0148] In one possible implementation, the serialization module 302 is further configured to:

[0149] When the data transmission method is asynchronous;

[0150] According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data;

[0151] The step of updating the data to be transmitted based on segmented serialized data is initiated.

[0152] The segmented serialized data is then sent to the data buffer so that the serialized data to be sent can be retrieved from the data buffer according to the preset transmission threshold, and then sent to the data receiving end.

[0153] In one possible implementation, the processing module 303 is further configured to:

[0154] Based on the segmented serialized data, determine the target data to be transmitted corresponding to the segmented serialized data in the data to be transmitted;

[0155] Add a serialization identifier to the data to be transmitted corresponding to the segmented serialized data; the serialization identifier indicates that the target data to be transmitted has been serialized.

[0156] In one possible implementation, the processing module 303 is further configured to:

[0157] Determine whether there is data in the data to be transmitted that has not been marked with a serialization identifier;

[0158] If there is data in the data to be transmitted that has not been serialized, it is determined that the data to be transmitted has not been fully serialized.

[0159] If there is no data in the data to be transmitted that has not been serialized, then it is determined that the data to be transmitted has been fully serialized.

[0160] 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.

[0161] Figure 4 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 4 As shown, the electronic device 40 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus 404.

[0162] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to perform the above-described method.

[0163] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0164] 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.

[0165] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0166] 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.

[0167] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0168] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0169] 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.

[0170] 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.

[0171] 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.

[0172] 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 according to actual needs.

[0173] 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.

[0174] 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.

[0175] 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.

[0176] 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, Applied to a DDS, the DDS includes a data transmitter and a data receiver, including: The data to be transmitted sent by the application is obtained through the data sending end; According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and the segmented serialized data is sent to the data receiving end. The data to be transmitted is updated based on the segmented serialized data; Determine whether the data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, return to the step of starting to serialize the data to be transmitted in segments according to the preset segment serialization rules. Once the data to be transmitted has been fully serialized, it is determined that the data to be transmitted has been successfully sent.

2. The method according to claim 1, characterized in that, Before obtaining the data to be transmitted sent by the application through the data sending end, the process further includes: Determine the data transmission requirements corresponding to the application; the data transmission requirements include at least the data transmission duration optimization requirements and the deterministic feedback requirements of the data transmission status; Based on the data transmission requirements of the application, the data transmission method is determined; the data transmission method includes synchronous transmission and asynchronous transmission.

3. The method according to claim 2, characterized in that, The step of determining the data transmission method based on the data transmission requirements corresponding to the application includes: If a data transmission request indicates that the application needs to reduce data transmission time, then the data transmission method is determined to be asynchronous transmission; If the data transmission request indicates that the application needs to obtain deterministic feedback on the data transmission status, then the data transmission method is determined to be synchronous transmission.

4. The method according to claim 3, characterized in that, The step of segmenting and serializing the data to be transmitted into segments according to a preset segmentation serialization rule to obtain segmented serialized data, and sending the segmented serialized data to the data receiving end, includes: When the data transmission method is synchronous transmission; According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data, and then the segmented serialized data is sent to the data receiving end; Perform the step of determining whether the data to be transmitted has been fully serialized.

5. The method according to claim 4, characterized in that, The method further includes: When the data transmission method is asynchronous; According to the preset segmentation serialization rules, the data to be transmitted is segmented and serialized to obtain segmented serialized data; The step of updating the data to be transmitted based on the segmented serialized data begins; The segmented serialized data is then sent to the data buffer so that the serialized data to be sent can be retrieved from the data buffer according to a preset transmission threshold, and the serialized data to be sent to the data receiving end.

6. The method according to claim 5, characterized in that, Updating the data to be transmitted based on the segmented serialized data includes: Based on the segmented serialized data, determine the target data to be transmitted corresponding to the segmented serialized data in the data to be transmitted; A serialization identifier is added to the data to be transmitted corresponding to the segmented serialized data; the serialization identifier indicates that the target data to be transmitted has been serialized.

7. The method according to claim 5, characterized in that, The step of determining whether the data to be transmitted has been fully serialized includes: Determine whether there is any data in the data to be transmitted that has not been serialized; If the data to be transmitted contains data for which the serialization identifier has not been added, then it is determined that the data to be transmitted has not been fully serialized. If there is no data in the data to be transmitted that has not been added with the serialization identifier, then it is determined that the data to be transmitted has been fully serialized.

8. A data transmission device, characterized in that, Applied to a DDS, the DDS includes a data transmitter and a data receiver, including: The acquisition module is used to acquire the data to be transmitted sent by the application through the data sending end; The serialization module is used to segment and serialize the data to be transmitted according to a preset segmentation serialization rule to obtain segmented serialized data, and send the segmented serialized data to the data receiving end. The processing module is used to update the data to be transmitted based on the segmented serialized data; The processing module is also used to determine whether the data to be transmitted has been fully serialized. If the data to be transmitted has not been fully serialized, the module returns to the step of performing segmented serialization of the data to be transmitted according to the preset segmented serialization rules. The determination module is used to determine that the data to be transmitted has been sent completely once the data to be transmitted has been fully serialized.

9. 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.

10. 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.

11. 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.