A data transmission method and device, electronic equipment and computer readable medium

CN117176669BActive Publication Date: 2026-09-22CCB FINTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311110743.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2026-09-22
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请实施例提供一种数据传输方法、装置、电子设备及计算机可读介质,能够解决现有的数据传输的接收方每次都在等待一段时间后才发送确认,数据传输效率低,吞度量低的问题

Benefits of technology

[0057]本申请实施例的一种计算机程序产品,包括计算机程序,程序被处理器执行时实现本申请实施例提供的数据传输方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117176669B_ABST
    Figure CN117176669B_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method and device, electronic equipment and computer readable medium, relates to the technical field of Internet of Things, and a specific embodiment includes receiving a data transmission request, obtaining a corresponding session handshake message, determining a session priority and a session receiving window; determining a session sending window; according to the session sending window, executing the process of transmitting data packets from a first container to a second container; receiving the acknowledgement character returned by the second container, and then determining the data packet to be retransmitted and updating the session sending window; determining the retransmission type based on the data packet to be retransmitted, executing the retransmission process of the data packet to be retransmitted according to the retransmission type, in response to successful retransmission, executing the transmission process of the corresponding data packet based on the updated session sending window; in response to congestion prompt information, determining the priority of the data packet corresponding to the updated session sending window, and executing the transmission process of the corresponding data packet based on the priority. Thus, the data transmission efficiency is improved, and the throughput is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a data transmission method, apparatus, electronic device, and computer-readable medium. Background Technology

[0002] Currently, during data transmission, the Transmission Control Protocol (TCP) uses a cumulative acknowledgment mechanism by default. In this case, if out-of-order packets arrive, the receiver will only re-acknowledge the last in-order segment. Therefore, the sender can only re-acknowledge the segment following the one that arrived in order, making it impossible to accurately determine which segments arrived and which did not. Because of the cumulative acknowledgment, the receiver waits for a period of time before sending an acknowledgment each time, resulting in low data transmission efficiency and low throughput. Summary of the Invention

[0003] In view of this, embodiments of this application provide a data transmission method, apparatus, electronic device, and computer-readable medium, which can solve the problems of low data transmission efficiency and low throughput in existing data transmissions, where the receiver waits for a period of time before sending an acknowledgment each time.

[0004] To achieve the above objectives, according to one aspect of an embodiment of this application, a data transmission method is provided, comprising:

[0005] Receive data transmission requests, obtain the corresponding session handshake messages, and then determine the session priority and session receive window based on the session handshake messages;

[0006] The session sending window is determined based on session priority and session receive window;

[0007] Based on the session sending window, execute the process of transferring datagrams from the first container to the second container;

[0008] Receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window;

[0009] The retransmission type is determined based on the data packet to be retransmitted, and the retransmission process of the data packet to be retransmitted is executed according to the retransmission type. In response to successful retransmission, the transmission process of the corresponding data packet is executed based on the updated session sending window.

[0010] In response to congestion alerts, the priority of the datagram corresponding to the updated session sending window is determined, and the transmission process of the corresponding datagram is executed based on the priority.

[0011] Optionally, the session sending window is determined, including:

[0012] Determine the session congestion window based on session priority;

[0013] Compare the session congestion window with the session receive window. If the session congestion window is smaller than the session receive window, determine the session send window based on the number of datagrams that can pass through the session congestion window.

[0014] In response to a session congestion window being larger than the session receive window, the session send window is determined based on the number of datagrams that can pass through the session receive window.

[0015] Optionally, the data packet to be retransmitted is determined based on the acknowledgment character, including:

[0016] Determine the sequence number of the timed-out unacknowledged data packet based on the acknowledgment character;

[0017] The corresponding data packet to be retransmitted is determined based on the sequence number of the timed-out unacknowledged data packet.

[0018] Optionally, the retransmission type is determined based on the data packet to be retransmitted, including:

[0019] Get the sequence number of the first datagram corresponding to the datagram to be retransmitted and the maximum sequence number of the second datagram corresponding to the acknowledgment character;

[0020] Calculate the difference between the largest second datagram sequence number and the first datagram sequence number, and determine the retransmission type based on the difference.

[0021] Optionally, the retransmission type can be determined based on the difference, including:

[0022] If the difference is greater than the fast retransmission threshold, the retransmission type is determined to be timeout retransmission.

[0023] If the difference is less than or equal to the fast retransmission threshold, the retransmission type is determined to be wait-for-time retransmission.

[0024] Optionally, the retransmission process for the datagram to be retransmitted is performed according to the retransmission type, including:

[0025] In response to a retransmission type of timeout retransmission, the data packet to be retransmitted is retrieved from the timeout retransmission queue first and retransmitted.

[0026] In response to the retransmission type being wait-timeout retransmission, once the wait timeout is triggered or the difference is greater than the fast retransmission threshold, the data packets to be retransmitted in the wait-timeout queue are added to the timeout retransmission queue, and the data packets to be retransmitted in the timeout retransmission queue are retransmitted first.

[0027] Optionally, update the session sending window, including:

[0028] Remove the sequence number of the datagram to be retransmitted from the session sending window and reduce the size of the session sending window accordingly.

[0029] In addition, this application also provides a data transmission device, including:

[0030] The receiving unit is configured to receive data transmission requests, obtain the corresponding session handshake messages, and then determine the session priority and session receiving window based on the session handshake messages.

[0031] The session sending window determination unit is configured to determine the session sending window based on the session priority and the session receiving window;

[0032] The datagram transmission unit is configured to execute the process of transmitting datagrams from the first container to the second container according to the session sending window;

[0033] The update unit is configured to receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window.

[0034] The retransmission unit is configured to determine the retransmission type based on the data packet to be retransmitted, execute the retransmission process for the data packet to be retransmitted according to the retransmission type, and execute the transmission process of the corresponding data packet based on the updated session sending window in response to successful retransmission.

[0035] The execution unit is configured to, in response to congestion alerts, determine the priority of the datagram corresponding to the updated session sending window, and execute the transmission process of the corresponding datagram based on the priority.

[0036] Optionally, the session sending window determination unit is further configured to:

[0037] Determine the session congestion window based on session priority;

[0038] Compare the session congestion window with the session receive window. If the session congestion window is smaller than the session receive window, determine the session send window based on the number of datagrams that can pass through the session congestion window.

[0039] In response to a session congestion window being larger than the session receive window, the session send window is determined based on the number of datagrams that can pass through the session receive window.

[0040] Optionally, the update unit is further configured to:

[0041] Determine the sequence number of the timed-out unacknowledged data packet based on the acknowledgment character;

[0042] The corresponding data packet to be retransmitted is determined based on the sequence number of the timed-out unacknowledged data packet.

[0043] Optionally, the retransmission unit is further configured to:

[0044] Get the sequence number of the first datagram corresponding to the datagram to be retransmitted and the maximum sequence number of the second datagram corresponding to the acknowledgment character;

[0045] Calculate the difference between the largest second datagram sequence number and the first datagram sequence number, and determine the retransmission type based on the difference.

[0046] Optionally, the retransmission unit is further configured to:

[0047] If the difference is greater than the fast retransmission threshold, the retransmission type is determined to be timeout retransmission.

[0048] If the difference is less than or equal to the fast retransmission threshold, the retransmission type is determined to be wait-for-time retransmission.

[0049] Optionally, the retransmission unit is further configured to:

[0050] In response to a retransmission type of timeout retransmission, the data packet to be retransmitted is retrieved from the timeout retransmission queue first and retransmitted.

[0051] In response to the retransmission type being wait-timeout retransmission, once the wait timeout is triggered or the difference is greater than the fast retransmission threshold, the data packets to be retransmitted in the wait-timeout queue are added to the timeout retransmission queue, and the data packets to be retransmitted in the timeout retransmission queue are retransmitted first.

[0052] Optionally, the update unit is further configured to:

[0053] Remove the sequence number of the datagram to be retransmitted from the session sending window and reduce the size of the session sending window accordingly.

[0054] In addition, this application also provides a data transmission electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the data transmission method as described above.

[0055] In addition, this application also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the data transmission method described above.

[0056] To achieve the above objectives, according to another aspect of the embodiments of this application, a computer program product is provided.

[0057] A computer program product according to an embodiment of this application includes a computer program that, when executed by a processor, implements the data transmission method provided in an embodiment of this application.

[0058] One embodiment of the above invention has the following advantages or beneficial effects: This application receives a data transmission request, obtains the corresponding session handshake message, and then determines the session priority and session receive window based on the session handshake message; determines the session send window based on the session priority and session receive window; executes the process of transmitting data packets from the first container to the second container according to the session send window; receives the acknowledgment character returned by the second container, determines the data packet to be retransmitted based on the acknowledgment character and updates the session send window; determines the retransmission type based on the data packet to be retransmitted, executes the retransmission process of the data packet to be retransmitted according to the retransmission type, and in response to successful retransmission, executes the transmission process of the corresponding data packet based on the updated session send window; in response to congestion warning information, determines the priority of the data packet corresponding to the updated session send window, and executes the transmission process of the corresponding data packet based on the priority. This improves data transmission efficiency and increases throughput.

[0059] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0060] The accompanying drawings are provided to better understand this application and do not constitute an undue limitation thereof. Wherein:

[0061] Figure 1 This is a schematic diagram illustrating the main flow of a data transmission method according to an embodiment of this application;

[0062] Figure 2 This is a schematic diagram illustrating the main flow of a data transmission method according to an embodiment of this application;

[0063] Figure 3 This is a schematic diagram of the main flow of a data transmission method according to an embodiment of this application;

[0064] Figure 4 This is a schematic diagram of the main units of a data transmission apparatus according to an embodiment of this application;

[0065] Figure 5 This is an exemplary system architecture diagram to which embodiments of this application can be applied;

[0066] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers in the embodiments of this application. Detailed Implementation

[0067] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the collection, analysis, use, transmission, and storage of user personal information involved in the technical solutions of this application comply with relevant laws and regulations, are used for legitimate and reasonable purposes, are not shared, disclosed, or sold outside of these legitimate uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent unauthorized access to such personal information data, ensure that personnel authorized to access personal information data comply with relevant laws and regulations, and ensure the security of user personal information. Once this user personal information data is no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0068] When used, including in certain relevant applications, data is deidentified to protect user privacy, for example by removing specific identifiers, controlling the amount or specificity of stored data, controlling how data is stored, and / or other methods.

[0069] Figure 1 This is a schematic diagram illustrating the main flow of a data transmission method according to an embodiment of this application, as shown below. Figure 1 As shown, the data transmission method includes:

[0070] Step S101: Receive data transmission request, obtain the corresponding session handshake message, and then determine session priority and session receive window based on the session handshake message.

[0071] In this embodiment, the execution entity of the data transmission method (e.g., a server) can receive data transmission requests via wired or wireless connections. Upon receiving the data transmission request, the execution entity can obtain the corresponding session handshake message. The client sends a session handshake message to the execution entity (e.g., the server), which carries the session priority and session receive window size. The execution entity can determine the session priority and session receive window size (i.e., the session receive window in this application) of the session data to be transmitted based on the session handshake message. The session receive window size can be the number of datagrams the client can receive.

[0072] Step S102: Determine the session sending window based on session priority and session receiving window.

[0073] Upon receiving the handshake message, the executing entity (e.g., the server) assigns a connection identifier to the corresponding session and initializes the session sending window and congestion window based on the session receive window and session priority. Higher session priority results in a larger initial congestion window, and the session sending window equals the minimum (session receive window, congestion window).

[0074] Step S103: Based on the session sending window, execute the process of transferring the datagram from the first container to the second container.

[0075] The first container can be a server, which is the execution entity of the data transmission method in this embodiment of the application, and the second container can be a client. The execution entity can place the connection identifier in the session response message to generate a datagram, and then send the corresponding number of datagrams to the client according to the number of datagrams that the session sending window can hold.

[0076] Step S104: Receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window.

[0077] Specifically, determining the data packet to be retransmitted based on the acknowledgment character includes: determining the sequence number of the timed-out unacknowledged data packet based on the acknowledgment character; and determining the corresponding data packet to be retransmitted based on the sequence number of the timed-out unacknowledged data packet.

[0078] An acknowledgment character, such as the acknowledge character (ACK), is a transmission control character sent by the receiver to the sender in data communication, indicating that the received data has been acknowledged correctly. Based on the received acknowledgment character and its corresponding sequence number, the sequence number of the timed-out unacknowledged datagram can be determined. Specifically, the executing entity can remove the sequence numbers corresponding to the acknowledgment characters from the session sending window to obtain the remaining timed-out unacknowledged datagram sequence numbers. For example, if the session sending window contains datagram sequence numbers 3, 4, 5, and 6, and acknowledgment characters for sequence numbers 3 and 6 are received but acknowledgment characters for sequence numbers 4 and 5 are not received after the timeout, then sequence numbers 4 and 5 can be determined as timed-out unacknowledged datagram sequence numbers. The datagrams corresponding to sequence numbers 4 and 5 are then designated as datagrams to be retransmitted.

[0079] After identifying the data packets to be retransmitted, the executing entity can update the sequence number and quantity of the data packets contained in the session sending window based on the data packets to be retransmitted.

[0080] Step S105: Determine the retransmission type based on the data packet to be retransmitted, execute the retransmission process for the data packet to be retransmitted according to the retransmission type, and in response to successful retransmission, execute the transmission process of the corresponding data packet based on the updated session sending window.

[0081] Specifically, determining the retransmission type based on the data packet to be retransmitted includes: obtaining the sequence number of the first data packet corresponding to the data packet to be retransmitted and the maximum sequence number of the second data packet corresponding to the acknowledgment character; calculating the difference between the maximum sequence number of the second data packet and the sequence number of the first data packet, and determining the retransmission type based on the difference.

[0082] Specifically, the retransmission type is determined based on the difference, including: determining the retransmission type as timeout retransmission in response to the difference being greater than the fast retransmission threshold; and determining the retransmission type as waiting for timeout retransmission in response to the difference being less than or equal to the fast retransmission threshold.

[0083] For example, assuming the fast retransmission threshold is 2, and the client (i.e., the receiver) has not received datagrams with sequence numbers 3 and 4, and the maximum sequence number (seq) of the acknowledgment datagram is 6, then...

[0084] The difference between datagram 3 and datagram 3 is 6 - 3 = 3. Since the difference 3 is greater than the fast retransmission threshold 2, datagram 3 is added to the retransmission queue and the retransmission type is timeout retransmission.

[0085] The difference between datagram 4 and datagram 4 is 6-4=2. Since the difference of 2 is equal to the fast retransmission threshold of 2, datagram 4 is added to the waiting timeout queue and the retransmission type is waiting timeout retransmission.

[0086] Specifically, the retransmission process for the data packets to be retransmitted is executed according to the retransmission type, including: in response to the retransmission type being timeout retransmission, retransmitting the data packets to be retransmitted from the timeout retransmission queue first; in response to the retransmission type being wait timeout retransmission, when a wait timeout is triggered or the difference is greater than the fast retransmission threshold, adding the data packets to be retransmitted from the wait timeout queue to the timeout retransmission queue, and retransmitting the data packets to be retransmitted from the timeout retransmission queue first.

[0087] When the retransmission type is timeout retransmission, the datagram to be retransmitted is added to the timeout retransmission queue to await retransmission. When an idle thread is available, the execution entity can call the idle thread to retrieve the datagram to be retransmitted from the timeout retransmission queue for retransmission. When the retransmission type is wait-for-timeout retransmission, the datagram to be retransmitted is added to the wait-for-timeout queue to await retransmission. When an idle thread is available, the execution entity can call the idle thread to prioritize retransmitting the datagrams to be retransmitted in the wait-for-timeout queue.

[0088] Step S106: In response to the congestion warning information, determine the priority of the datagram corresponding to the updated session sending window, and execute the transmission process of the corresponding datagram based on the priority.

[0089] If congestion occurs during data packet retransmission, a congestion alert message will be generated. Upon receiving the congestion alert message, the executing entity will respond by first obtaining the priority of the data packet corresponding to the updated session sending window. This priority can be determined based on the initially received session handshake message. When congestion occurs, data packets with higher priority have a greater chance of being transmitted. Specifically, the corresponding data packets to be transmitted can be sorted according to priority, and the top N data packets are selected for priority transmission based on the sorting result. In this embodiment, N is not specifically limited.

[0090] This embodiment improves data transmission efficiency and increases throughput by receiving data transmission requests, obtaining corresponding session handshake messages, determining session priority and session receive window based on the handshake messages, determining session send window based on session priority and session receive window, executing the process of transmitting data packets from the first container to the second container according to the session send window, receiving acknowledgment characters returned by the second container, determining data packets to be retransmitted based on the acknowledgment characters and updating the session send window, determining the retransmission type based on the data packets to be retransmitted, executing the retransmission process for the data packets to be retransmitted according to the retransmission type, and executing the transmission process for the corresponding data packets based on the updated session send window in response to successful retransmission, and determining the priority of the data packets corresponding to the updated session send window in response to congestion warning information.

[0091] Figure 2 This is a schematic diagram of the main flow of a data transmission method according to an embodiment of this application, as shown below. Figure 2 As shown, the data transmission method includes:

[0092] Step S201: Receive data transmission request, obtain the corresponding session handshake message, and then determine session priority and session receive window based on the session handshake message.

[0093] Step S202: Determine the session congestion window based on session priority.

[0094] During session initialization, the execution entity initializes the size of the session congestion window based on the session priority. The higher the session priority, the larger the initial congestion window will be.

[0095] Step S203: Compare the session congestion window with the session receive window. In response to the session congestion window being smaller than the session receive window, determine the session send window based on the number of data packets that can pass through the session congestion window.

[0096] Step S204: In response to the session congestion window being larger than the session receive window, determine the session send window based on the number of datagrams that can pass through the session receive window.

[0097] Specifically, the executing entity can dynamically adjust the number of datagrams the server can send based on the size of the congestion window and the size of the client's receiving window. The size of the session sending window is equal to min(session congestion window, session receiving window), that is, the size of the session sending window is equal to the smaller of the congestion window and the session receiving window. When the session congestion window is smaller than the session receiving window, the size of the session sending window is the same as the size of the session congestion window; when the session congestion window is larger than the session receiving window, the size of the session sending window is the same as the size of the session receiving window. In this embodiment, the window size can be understood as the number of datagrams that can pass through the window simultaneously.

[0098] Step S205: Based on the session sending window, execute the process of transferring the datagram from the first container to the second container.

[0099] The first container can be a session sending container, such as a server, and the second container can be a session receiving container, such as a client.

[0100] Step S206: Receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window.

[0101] Specifically, updating the session sending window includes: removing the sequence number of the datagram to be retransmitted from the session sending window and reducing the size of the session sending window accordingly.

[0102] For example, when the executing entity (e.g., the server) detects a timeout in the transmission of a data packet, it removes the data packet from the session sending window and adds it to the timeout retransmission queue, and reduces the size of the session sending window accordingly. When the executing entity (e.g., the server) sends data, the timeout retransmission queue has the highest priority. That is, the executing entity first checks whether the timeout retransmission queue is not empty. If it is not empty, it sends the data packets in the timeout retransmission queue first.

[0103] Step S207: Determine the retransmission type based on the data packet to be retransmitted, execute the retransmission process for the data packet to be retransmitted according to the retransmission type, and in response to successful retransmission, execute the transmission process of the corresponding data packet based on the updated session sending window.

[0104] Retransmission types can include timeout retransmission and wait-for-timeout retransmission. Timeout retransmission is a retransmission after the timeout has already occurred, while wait-for-timeout retransmission is a retransmission performed after a preset time has elapsed if no acknowledgment character is received and the datagram transmission has not timed out.

[0105] In the updated session sending window, data packets have a lower transmission priority than data packets awaiting retransmission in the retransmission queue. When the executing entity sends data packets next, it prioritizes sending data packets in the retransmission queue. Only after the data packets in the retransmission queue have been successfully transmitted will the data packets in the updated session sending window be transmitted. This achieves accurate retransmission, reduces bandwidth waste caused by retransmissions, and enables faster retransmissions.

[0106] Step S208: In response to the congestion warning information, determine the priority of the datagram corresponding to the updated session sending window, and execute the transmission process of the corresponding datagram based on the priority.

[0107] This application's embodiments introduce session priority into the congestion control mechanism. When network congestion occurs and a congestion warning message is received, sessions with higher priority have a greater chance to send data. Congestion control based on session priority provides better data transmission service quality and improves data transmission throughput.

[0108] Figure 3This is a schematic diagram illustrating an application scenario of a data transmission method according to an embodiment of this application. The data transmission method of this embodiment can be applied to scenarios involving data packet retransmission. This embodiment introduces a session mechanism, where each session has an independent connection identifier, ensuring the connection is unaffected by address changes and enabling session-based flow control. Furthermore, this embodiment introduces session priority based on congestion control; sessions with higher priority have more opportunities to send data, resulting in better service provision capabilities. The UDP ex header is the UDP extended protocol header in this embodiment. UDP is a connectionless, unreliable, datagram-based transport protocol. When a user application sends a datagram, it adds the UDP ex header before the user data. The UDP ex header can be divided into management messages and data messages; management messages include session handshake messages, session termination messages, and ACK messages; data messages can carry user data. Taking the client (the execution subject of the data transmission method in this embodiment) as the receiver and the server as the sender as an example, the data transmission method of this embodiment is described as follows: The client sends a session handshake message to the server (that is, the execution subject of the data transmission method in this embodiment). The session handshake message carries the session priority and the session receiving window size. The server receives the handshake message, allocates a connection identifier for the session, and initializes the sending window and congestion window according to the session receiving window and session priority. The higher the session priority, the larger the initial congestion window. Session sending window = min(session receiving window, session congestion window). Finally, the connection identifier is placed in the session response message and sent to the client. The client receives the session response message, obtains the connection identifier from it, and saves it. For example, the server sends data packets 3, 4, 5, and 6 within the session sending window. The client receives data packets 3, 4, 5, and 6 and sends corresponding acknowledgment characters, such as ack.seq_num = 3, ack.recv_wnd_bitmap = 0b111100… (the number of bits is equal to the size of the session receiving window). The server receives the acknowledgment characters and updates the session sending window according to the acknowledgment characters. Once a datagram in the session sending window is acknowledged, the session sending window moves forward, thus updating the session sending window. If the server does not receive an acknowledgment after sending a datagram, it retransmits the corresponding datagram. There are two strategies for datagram retransmission: timeout retransmission and fast retransmission.

[0109] Timeout retransmission:

[0110] If the server does not receive an acknowledgment within the RTO time after sending a data packet, it will retransmit the data packet.

[0111] RTO is dynamically adjusted based on the round-trip time (RTT) of the data packet.

[0112] RTT = Receive Acknowledgment Time - Last Packet Data Transmission Time, as in the example above:

[0113] RTT = Receive ACK time - Datagram 6 transmission time;

[0114] Refer to the Linux RTO calculation method:

[0115] To estimate round-trip time, it is usually necessary to sample the following two:

[0116] 1. Sample the RTT time, then perform a weighted average to calculate a smoothed RTT value; 2. Sample the fluctuation range of the RTT.

[0117] Calculate the timeout retransmission time (RTO) using the following formula:

[0118] The initial RTO is calculated, where R1 is the round-trip time (RTT) of the first measurement:

[0119] SRTT = R1;

[0120] DevRTT = R1 / 2;

[0121]

[0122] The RTO is then calculated, where R2 is the most recently measured RTT:

[0123] SRTT=SRTT+α(RTT-SRTT)=R1+α*(R2-R1);

[0124] DevRTT=(1-β)*DevRTT+β*(|RTT-SRTT|)=(1-β)*(R1 / 2)+β*(|R2-R1|);

[0125]

[0126] Where SRTT is the calculated smoothed RTT, and DevRTR is the difference between the calculated smoothed RTT and the latest RTT. Under Linux, α = 0.125, β = 0.25, μ = 1.

[0127] When the server detects a data packet transmission timeout, it removes the data packet from the session sending window and adds it to the timeout retransmission queue, and reduces the size of the session sending window accordingly. The timeout retransmission queue has the highest priority when the server sends data. That is, the server first checks whether the timeout retransmission queue is not empty. If it is, the server sends the data packets in the timeout retransmission queue first.

[0128] Fast retransmission, such as Figure 3 As shown:

[0129] In this embodiment, ack (Acknowledge character) is a transmission control character sent by the receiving station to the sending station in data communication. It indicates that the received data has been acknowledged without error. When the server receives the acknowledgement character, it indicates that some data packets have not been received. It then calculates the difference between the sequence number seq of the largest acknowledged data packet and the sequence number seq of the unacknowledged data packet. If the difference is greater than the fast retransmission threshold, the data packet is added to the timeout retransmission queue without waiting for the timeout retransmission timeout timeout (RTO). Otherwise, it is added to the waiting timeout queue. The waiting timeout queue buffers data packets that have not been acknowledged by ack and have not timed out. Data packets in this queue have three possible outcomes: 1. RTO timeout, the data packet is added to the retransmission queue; 2. The difference between the sequence number seq of the largest acknowledged data packet and the sequence number seq of the unacknowledged data packet is greater than the fast retransmission threshold, the corresponding unacknowledged data packet is added to the retransmission queue; 3. The unacknowledged data packet is acknowledged by a subsequent ack, and the data packet is removed from the waiting timeout queue.

[0130] like Figure 3 As shown in the example above: the data packets that have been sent and acknowledged are: 0, 1, 2, 5, 6; data packets 7, 8, and 9 within the sliding window can be sent; data packet 10 outside the sliding window cannot be sent.

[0131] Assuming the fast retransmission threshold is 2, and the client did not receive data packets 3 and 4, the ACK is as follows:

[0132] ack.seq_num = 3

[0133] ack.recv_wnd_bitmap = 0b001100… (bits equal to the receive window size), the maximum sequence number (seq) of the acknowledged datagram is 6, then…

[0134] The difference between datagram 3 and datagram 3 is diff = 6 - 3 = 3. Since the difference 3 is greater than the fast retransmission threshold 2, datagram 3 is added to the retransmission queue.

[0135] The difference between datagram 4 and datagram 4 is diff = 6 - 4 = 2. Since the difference 2 is equal to the fast retransmission threshold 2, the datagram is added to the waiting timeout queue.

[0136] In the data transmission method of this application embodiment, traffic control may also be included. Specifically, taking the server as the sender (i.e., the execution subject of this application embodiment) and the client as the receiver as an example: traffic control means that the sender controls the amount of data sent according to the receiver's data receiving capacity, thereby avoiding the problem of retransmission due to the receiver's inability to process the data. This application embodiment achieves traffic control by dynamically adjusting the number of data packets that the server (i.e., the sender) can send. When the client (i.e., the receiver) sends data to the server (i.e., the sender) (e.g., an ACK data packet), it will announce its receiving window size to the server in the UDP ex header. The server dynamically adjusts the number of data packets that it can send according to the congestion window size and the client's receiving window size, and its size is equal to min(session congestion window, session receiving window). The number of data packets that the server can send includes the session sending window and the timeout retransmission queue. For example, assuming the session congestion window is 5 and the client receive window is 4, the server sends the data packets in the session send window to the client. For example, the server sends data packets 3 and 4. At this time, the number of data packets that the server can send is 2. The client acknowledges data packets 3 and 4 and informs the server that the receive window size is 4. The executing entity changes the number of data packets that the server can send to 4.

[0137] The data transmission method in this application embodiment may further include congestion control. Specifically, this application embodiment introduces session priority based on the Linux congestion control mechanism. When network congestion occurs, higher-priority sessions have more opportunities to send data. Linux congestion control includes four algorithms: slow start, congestion avoidance, congestion occurrence, and fast recovery. During session initialization, the server initializes the session congestion window size according to the session priority; the higher the priority, the larger the initial congestion window. When congestion control enters the congestion avoidance phase, higher-priority sessions have a faster linear growth rate. When congestion occurs, congestion control reverts to the slow start process, at which point higher-priority sessions have a larger initial congestion window value and a higher slow start threshold. During fast recovery, higher-priority sessions have a larger congestion window and a faster linear growth rate.

[0138] The session mechanism based on connection identifiers in this application is not affected by changes in IP addresses; the session mechanism is more easily accepted by services and facilitates link reuse; the ACK mechanism based on data packets allows the data sender to clearly know which data packets have not been acknowledged, enabling accurate retransmission and reducing bandwidth waste caused by retransmission; batch ACK reduces the number of ACKs and enables faster retransmission; and congestion control based on session priority has better service provision capabilities.

[0139] Figure 4 This is a schematic diagram of the main units of a data transmission apparatus according to an embodiment of this application. Figure 4As shown, the data transmission device 400 includes a receiving unit 401, a session sending window determining unit 402, a data packet transmission unit 403, an update unit 404, a retransmission unit 405, and an execution unit 406.

[0140] The receiving unit 401 is configured to receive data transmission requests, obtain the corresponding session handshake messages, and then determine the session priority and session receiving window based on the session handshake messages.

[0141] The session sending window determination unit 402 is configured to determine the session sending window based on the session priority and the session receiving window.

[0142] Datagram transmission unit 403 is configured to execute the process of transmitting datagrams from the first container to the second container according to the session sending window.

[0143] Update unit 404 is configured to receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window.

[0144] The retransmission unit 405 is configured to determine the retransmission type based on the datagram to be retransmitted, execute the retransmission process for the datagram to be retransmitted according to the retransmission type, and execute the transmission process of the corresponding datagram based on the updated session sending window in response to successful retransmission.

[0145] Execution unit 406 is configured to, in response to congestion alert information, determine the priority of the datagram corresponding to the updated session sending window, and execute the transmission process of the corresponding datagram based on the priority.

[0146] In some embodiments, the session sending window determination unit 402 is further configured to: determine a session congestion window based on session priority; compare the session congestion window with the session receiving window; and, in response to the session congestion window being smaller than the session receiving window, determine a session sending window based on the number of data packets that can pass through the session congestion window; and, in response to the session congestion window being larger than the session receiving window, determine a session sending window based on the number of data packets that can pass through the session receiving window.

[0147] In some embodiments, the update unit 404 is further configured to: determine the sequence number of the timed-out unacknowledged data packet based on the acknowledgment character; and determine the corresponding data packet to be retransmitted based on the sequence number of the timed-out unacknowledged data packet.

[0148] In some embodiments, the retransmission unit 405 is further configured to: obtain the first data packet sequence number corresponding to the data packet to be retransmitted and the maximum second data packet sequence number corresponding to the acknowledgment character; calculate the difference between the maximum second data packet sequence number and the first data packet sequence number; and determine the retransmission type based on the difference.

[0149] In some embodiments, the retransmission unit 405 is further configured to: determine the retransmission type as timeout retransmission in response to a difference greater than the fast retransmission threshold; and determine the retransmission type as waiting for timeout retransmission in response to a difference less than or equal to the fast retransmission threshold.

[0150] In some embodiments, the retransmission unit 405 is further configured to: in response to a retransmission type of timeout retransmission, prioritize retransmitting the data packet to be retransmitted from the timeout retransmission queue; in response to a retransmission type of waiting timeout retransmission, when a waiting timeout is triggered or the difference is greater than the fast retransmission threshold, add the data packet to be retransmitted in the waiting timeout queue to the timeout retransmission queue, and prioritize retransmitting the data packet to be retransmitted in the timeout retransmission queue.

[0151] In some embodiments, the update unit 404 is further configured to: remove the sequence number of the datagram corresponding to the datagram to be retransmitted from the session sending window, and reduce the size of the session sending window accordingly.

[0152] It should be noted that the data transmission method and data transmission device in this application are related in specific implementation, so repeated content will not be described again.

[0153] Figure 5 An exemplary system architecture 500 is shown that can be applied to the data transmission method or data transmission apparatus of the embodiments of this application.

[0154] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0155] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0156] Terminal devices 501, 502, and 503 can be various electronic devices with data transmission processing screens and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0157] Server 505 can be a server providing various services, such as a background management server (for example only) supporting data transmission requests submitted by users using terminal devices 501, 502, and 503. The background management server can receive data transmission requests, obtain the corresponding session handshake message, and then determine the session priority and session receive window based on the session handshake message; determine the session send window based on the session priority and session receive window; execute the process of transmitting data packets from the first container to the second container according to the session send window; receive the acknowledgment character returned by the second container, determine the data packets to be retransmitted based on the acknowledgment character, and update the session send window; determine the retransmission type based on the data packets to be retransmitted, execute the retransmission process for the data packets to be retransmitted according to the retransmission type, and in response to successful retransmission, execute the transmission process of the corresponding data packets based on the updated session send window; in response to congestion warning information, determine the priority of the data packets corresponding to the updated session send window, and execute the transmission process of the corresponding data packets based on the priority. This improves data transmission efficiency and increases throughput.

[0158] It should be noted that the data transmission method provided in this application embodiment is generally executed by server 505, and correspondingly, the data transmission device is generally set in server 505.

[0159] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0160] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device according to the embodiments of this application. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0161] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0162] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0163] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.

[0164] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0165] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0166] The units described in the embodiments of this application can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including a receiving unit, a session sending window determination unit, a datagram transmission unit, an update unit, a retransmission unit, and an execution unit. The names of these units do not necessarily limit the specific unit itself.

[0167] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to receive a data transmission request, obtain the corresponding session handshake message, and then determine a session priority and a session receive window based on the session handshake message; determine a session send window based on the session priority and the session receive window; execute a process of transmitting a data packet from a first container to a second container according to the session send window; receive an acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character and update the session send window; determine the retransmission type based on the data packet to be retransmitted, execute a retransmission process for the data packet to be retransmitted according to the retransmission type, and in response to a successful retransmission, execute a transmission process for the corresponding data packet based on the updated session send window; and in response to a congestion warning message, determine the priority of the data packet corresponding to the updated session send window, and execute a transmission process for the corresponding data packet based on the priority.

[0168] The computer program product of this application includes a computer program that, when executed by a processor, implements the data transmission method in the embodiments of this application.

[0169] According to the technical solution of the embodiments of this application, data transmission efficiency can be improved and throughput can be increased.

[0170] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A data transmission method, characterized in that, include: Receive data transmission request, obtain the corresponding session handshake message, and then determine the session priority and session receiving window based on the session handshake message; The session sending window is determined based on the session priority and the session receiving window; According to the session sending window, execute the process of transmitting datagrams from the first container to the second container; Receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window; Based on the data packet to be retransmitted, the retransmission type is determined, and the retransmission process for the data packet to be retransmitted is executed according to the retransmission type. In response to successful retransmission, the transmission process of the corresponding data packet is executed based on the updated session sending window. In response to the congestion warning information, the priority of the datagram corresponding to the updated session sending window is determined, and the transmission process of the corresponding datagram is executed based on the priority.

2. The method according to claim 1, characterized in that, The determination of the session sending window includes: The session congestion window is determined based on the session priority; The session congestion window is compared with the session receive window. In response to the session congestion window being smaller than the session receive window, the session send window is determined based on the number of datagrams that can pass through the session congestion window. In response to the session congestion window being larger than the session receive window, the session send window is determined based on the number of datagrams that can pass through the session receive window.

3. The method according to claim 1, characterized in that, The step of determining the data packet to be retransmitted based on the acknowledgment character includes: Based on the confirmation character, determine the sequence number of the timed-out unconfirmed data packet; The corresponding data packet to be retransmitted is determined based on the sequence number of the timed-out unacknowledged data packet.

4. The method according to claim 1, characterized in that, Determining the retransmission type based on the data packet to be retransmitted includes: Obtain the sequence number of the first datagram corresponding to the datagram to be retransmitted and the maximum sequence number of the second datagram corresponding to the acknowledgment character; Calculate the difference between the largest second data packet sequence number and the first data packet sequence number, and determine the retransmission type based on the difference.

5. The method according to claim 4, characterized in that, The step of determining the retransmission type based on the difference includes: In response to the difference being greater than the fast retransmission threshold, the retransmission type is determined to be timeout retransmission; In response to the difference being less than or equal to the fast retransmission threshold, the retransmission type is determined to be wait-for-time-out retransmission.

6. The method according to claim 4, characterized in that, The step of executing the retransmission process for the datagram to be retransmitted according to the retransmission type includes: In response to the retransmission type being timeout retransmission, the data packet to be retransmitted is retrieved from the timeout retransmission queue first and retransmitted. In response to the retransmission type being wait-out retransmission, once a wait-out timeout is triggered or the difference is greater than the fast retransmission threshold, the data packets to be retransmitted in the wait-out queue are added to the timeout retransmission queue, and the data packets to be retransmitted in the timeout retransmission queue are retransmitted first.

7. The method according to claim 1, characterized in that, Updating the session sending window includes: Remove the sequence number of the datagram to be retransmitted from the session sending window and reduce the size of the session sending window accordingly.

8. A data transmission device, characterized in that, include: The receiving unit is configured to receive data transmission requests, obtain corresponding session handshake messages, and then determine session priority and session receiving window based on the session handshake messages. The session sending window determination unit is configured to determine the session sending window based on the session priority and the session receiving window; The datagram transmission unit is configured to execute the process of transmitting datagrams from the first container to the second container according to the session sending window; The update unit is configured to receive the acknowledgment character returned by the second container, determine the data packet to be retransmitted based on the acknowledgment character, and update the session sending window. The retransmission unit is configured to determine the retransmission type based on the data packet to be retransmitted, execute the retransmission process for the data packet to be retransmitted according to the retransmission type, and, in response to successful retransmission, execute the transmission process of the corresponding data packet based on the updated session sending window. The execution unit is configured to, in response to congestion alert information, determine the priority of the datagram corresponding to the updated session sending window, and execute the transmission process of the corresponding datagram based on the priority.

9. The apparatus according to claim 8, characterized in that, The session sending window determination unit is further configured to: The session congestion window is determined based on the session priority; The session congestion window is compared with the session receive window. In response to the session congestion window being smaller than the session receive window, the session send window is determined based on the number of datagrams that can pass through the session congestion window. In response to the session congestion window being larger than the session receive window, the session send window is determined based on the number of datagrams that can pass through the session receive window.

10. The apparatus according to claim 8, characterized in that, The update unit is further configured to: Based on the confirmation character, determine the sequence number of the timed-out unconfirmed data packet; The corresponding data packet to be retransmitted is determined based on the sequence number of the timed-out unacknowledged data packet.

11. The apparatus according to claim 8, characterized in that, The retransmission unit is further configured to: Obtain the sequence number of the first datagram corresponding to the datagram to be retransmitted and the maximum sequence number of the second datagram corresponding to the acknowledgment character; Calculate the difference between the largest second data packet sequence number and the first data packet sequence number, and determine the retransmission type based on the difference.

12. The apparatus according to claim 11, characterized in that, The retransmission unit is further configured to: In response to the difference being greater than the fast retransmission threshold, the retransmission type is determined to be timeout retransmission; In response to the difference being less than or equal to the fast retransmission threshold, the retransmission type is determined to be wait-for-time-out retransmission.

13. The apparatus according to claim 11, characterized in that, The retransmission unit is further configured to: In response to the retransmission type being timeout retransmission, the data packet to be retransmitted is retrieved from the timeout retransmission queue first and retransmitted. In response to the retransmission type being wait-out retransmission, once a wait-out timeout is triggered or the difference is greater than the fast retransmission threshold, the data packets to be retransmitted in the wait-out queue are added to the timeout retransmission queue, and the data packets to be retransmitted in the timeout retransmission queue are retransmitted first.

14. A data transmission electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.

15. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for controlling multi-priority connection congestion time windows in multi-path TCP

    CN104702527A

  • Window control method and device based on TCP protocol and electronic equipment

    CN111371692A