Data transmission method and related apparatus

By adjusting the retransmission count and duration of handshake messages through customized connection configuration information, the problem of low efficiency in establishing TCP connections in weak network environments is solved, achieving fast connection and reliable data transmission.

WO2026045602A1PCT designated stage Publication Date: 2026-03-05HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/105133
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-27
Filing Date
2025-06-28
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

In weak network scenarios based on Transmission Control Protocol (TCP), the frequent loss of handshake messages during connection establishment between the client and the server leads to low connection establishment efficiency. In existing technologies, the number of SYN message retransmissions and the duration are fixed, which cannot adapt to network fluctuations, resulting in excessively long connection establishment times.

Method used

By setting custom connection configuration information, the maximum number of retransmissions and optimizations for handshake messages can be increased, and the retransmission duration can be adjusted in intervals. The connection will be terminated after the maximum number of retransmissions is exceeded to reduce network resource consumption and ensure that a connection can still be established quickly in poor network environments.

Benefits of technology

It improves connection establishment efficiency in weak network environments, reduces connection establishment time and network resource consumption, and enhances data transmission reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025105133_05032026_PF_FP_ABST
    Figure CN2025105133_05032026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a data transmission method and a related apparatus, which are used by a first device and a second device to retransmit a lost handshake message in a handshake stage, thereby increasing the upper-limit number of retransmissions of the handshake message, and thus improving the efficiency of establishment of a connection between the first device and the second device. The method comprises: a first device sending a first handshake message to a second device, wherein the first handshake message is used for requesting the establishment of a connection with the second device; and when no second handshake message has been received, retransmitting the first handshake message, wherein the number of retransmissions of the first handshake message does not exceed a first number of retransmissions, the second handshake message is a response of the second device to the first handshake message, the first number of retransmissions is an upper limit value of the number of retransmissions of the first handshake message, the first number of retransmissions is greater than a second number of retransmissions, and the second number of retransmissions is a system default upper limit value of the number of retransmissions of the first handshake message.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method and related devices

[0001] This application claims priority to Chinese Patent Application No. 202411186317.9, filed with the State Intellectual Property Office of China on August 27, 2024, entitled "Data Transmission Method and Related Apparatus", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communications, and more particularly to a data transmission method and related apparatus. Background Technology

[0003] In weak network scenarios based on the Transmission Control Protocol (TCP), the client and server establish a connection through a three-way handshake. During the handshake phase, messages are frequently lost when the client and server exchange handshake packets. TCP provides a timeout retransmission mechanism to retransmit packets. The initial retransmission duration of the TCP timer is 1 second, and the default retransmission count for SYN packets is 6, with the retransmission duration doubling with each retransmission. When the network signal is poor, a SYN packet may not receive a response even after 6 retransmissions, causing the connection between the client and server to fail. In this case, the connection attempt time is 63 seconds, and the client needs to retry establishing the connection with the server. Therefore, establishing a TCP connection is inefficient in weak network scenarios.

[0004] Therefore, how to improve the efficiency of establishing connections has become an urgent problem to be solved. Summary of the Invention

[0005] In a first aspect, embodiments of this application provide a data transmission method applied to a first device. In this method, the first device sends a first handshake message to a second device. The first handshake message is used to request the establishment of a connection with the second device. The first device can be the initiator of a TCP connection, such as a client, and the second device can be the receiver of a TCP connection, such as a server. The first handshake message is a message sent between the first device and the second device during the initial handshake process, and the first handshake message can be a SYN message.

[0006] If the second handshake message is not received, the first handshake message is retransmitted. The second handshake message is a response to the first handshake message and can be a SYN+ACK message. The number of SYN message retransmissions does not exceed the first retransmission limit, which is the maximum number of SYN message retransmissions. The maximum number of SYN message retransmissions is greater than the second retransmission limit, which is the system default maximum number of SYN message retransmissions. The system default maximum number of SYN message retransmissions is the default maximum number of SYN message retransmissions in TCP.

[0007] In this application, during the connection establishment phase between the first device and the second device, when a handshake message is lost, the first handshake message is retransmitted multiple times until the first device receives the second handshake message or the number of retransmissions of the first handshake message reaches the retransmission limit. Increasing the retransmission limit of the first handshake message beyond the system default limit increases the upper limit of the number of retransmissions, ensuring that even if the number of retransmissions exceeds the system default limit, retransmission of the first handshake message continues instead of terminating the connection. If the connection is terminated when the number of retransmissions of the first handshake message reaches the system default limit, the first device and the second device need to retry establishing the connection, which takes longer and results in low connection establishment efficiency. Therefore, this embodiment can improve the efficiency of establishing a connection between the first device and the second device.

[0008] In one alternative implementation, before retransmitting the first handshake message, connection configuration information related to the second device is obtained from the application interface or configuration file, including the number of first retransmissions.

[0009] The connection configuration information includes parameters involved in the handshake phase between the first device and the second device, such as the maximum number of retransmissions of the first handshake message, the number of retransmission optimizations for the first handshake message, and the maximum duration of the first handshake message.

[0010] The first device obtains the first retransmission count related to the second device from the application interface. The application interface is a predefined functional module that exposes the program's functionality while hiding the specific implementation, facilitating the reuse of functional modules and data communication and sharing between modules. The first retransmission count is obtained from the application interface, and when the first retransmission count changes, the latest parameters can be automatically retrieved through the application interface, enabling dynamic updating and management of the parameters.

[0011] The first device retrieves the first retransmission count related to the second device from the configuration file. The configuration file is a file that stores predefined configurations, used to store parameters required by the application during runtime, such as configuration tables. Writing the first retransmission count to the configuration file allows the parameter part to be extracted from the business logic, facilitating portability, enabling centralized storage and management of parameters, and making it easier to modify parameters related to the business logic.

[0012] Furthermore, by setting the connection level through the connection configuration information of the first and second devices, the configuration only applies to the configured connection and does not affect the system configuration or other connection information. This enables customized business requirements for TCP connection level and optimizes retransmission for connections using the method of this embodiment.

[0013] In one optional implementation, the connection configuration information further includes a first upper limit duration, the first duration being less than or equal to the first upper limit duration, the first duration being the duration of retransmitting the first handshake message, that is, the duration of each retransmission of the first handshake message does not exceed the first upper limit duration.

[0014] In this application, by ensuring that the duration of each retransmission of the first handshake message does not exceed the upper limit, the retransmission duration of the handshake message can be controlled within a certain time frame. Even when retransmitted multiple times, the retransmission duration will not be too long, thereby reducing the overall retransmission process duration and improving the efficiency of establishing a connection between the first device and the second device.

[0015] In one optional implementation, the connection configuration information further includes a third retransmission count, which is less than the first retransmission count. If the retransmission count of the first handshake message is greater than the third retransmission count but less than or equal to the first retransmission count, and the second handshake message is not received, the first duration is the product of a preset multiple and the duration of the previous retransmission of the first handshake message. The third retransmission count is the optimized retransmission count of the first handshake message.

[0016] In this application, when the number of retransmissions of a SYN packet is greater than the number of retransmission optimizations but does not exceed the maximum number of retransmissions, the retransmission duration is doubled. The number of retransmissions is divided into different intervals by the number of retransmission optimizations and the maximum number of retransmissions, thereby achieving interval adjustment of the retransmission duration.

[0017] In one alternative implementation, if the number of retransmissions of the first handshake message is less than or equal to the number of retransmissions of the third handshake message, the first duration is less than or equal to the second upper limit duration.

[0018] In this application, when the number of retransmissions of a SYN packet does not exceed the optimized number of retransmissions, the retransmission duration of the SYN packet does not exceed the second upper limit duration. By making the upper limit of retransmissions greater than the optimized number of retransmissions, the number of retransmissions of SYN packets is divided into different intervals, and the retransmission duration of different retransmission intervals is controlled in a graded manner by using the upper limit duration.

[0019] In one alternative implementation, if the number of retransmissions of the first handshake message exceeds the first retransmission count and no second handshake message is received, the connection with the second device is terminated.

[0020] In this application, when the number of retransmissions of the first handshake message exceeds the retransmission limit and the second handshake message is still not received, it indicates that the retransmission of the first handshake message has been attempted many times but has still failed, the network environment is poor, and the connection with the second device is terminated to reduce the occupation of network resources.

[0021] In one alternative implementation, upon receiving the second handshake message, the first device sends a third handshake message to the second device, the third handshake message being used to instruct the first device to establish a connection with the second device.

[0022] In this application, the third handshake message can be an ACK message. When the first device receives the SYN+ACK message, it sends an ACK message to the second device, and then the first device and the second device establish a connection.

[0023] In one alternative implementation, the first retransmission count and the third retransmission count are determined based on the service data.

[0024] In this application, the first retransmission count is the maximum number of retransmissions for SYN packets, and the third retransmission count is the optimized retransmission count for SYN packets. The maximum and optimized retransmission counts for SYN packets are determined based on business data, allowing these counts to be set to optimal values ​​that meet business requirements. The business data can include the most recent maximum retransmission count, the most recent optimized retransmission count, the average of historical maximum retransmission counts, and the average of historical optimized retransmission counts.

[0025] In one optional implementation, the connection configuration information further includes a fourth retransmission count, which is the number of times the data packet is optimized for retransmission, used to determine a second duration, which is the retransmission duration of the data packet. After the first device and the second device establish a connection, the first device sends a first data packet to the second device. If the second data packet is not received, the first data packet is retransmitted within the second duration. The second duration is determined based on the fourth retransmission count and the number of retransmissions of the first data packet. The second data packet is the response of the second device to the first data packet.

[0026] In this application, after the first device and the second device establish a connection, they exchange data packets during the data transmission phase. This enables timeout retransmission of data packets in the event of data packet loss, thereby improving the reliability of data packet transmission. The duration of each retransmission is determined based on the number of retransmission optimizations and the number of data packet retransmissions, providing a flexible way to adjust the retransmission duration so that the packet retransmission duration is more suitable for the network environment.

[0027] In one alternative implementation, if the number of retransmissions of the first data packet does not exceed the fourth retransmission, the second duration is calculated based on the round-trip time of the first data packet.

[0028] In this application, the retransmission duration is calculated based on the round-trip time of the data packet, which can control the retransmission duration to fluctuate within a relatively optimal range as the network environment changes.

[0029] In one optional implementation, the connection configuration information further includes a third upper limit duration, wherein the second duration does not exceed the third upper limit duration if the number of retransmissions of the first data packet does not exceed the fourth number of retransmissions.

[0030] In this application, the duration of each retransmission of the first data packet by the first device does not exceed the upper limit, and the retransmission duration of the data packet can be controlled within a certain time. When retransmission is performed multiple times, the retransmission duration will not be too long.

[0031] In one optional implementation, if the number of retransmissions of the first data packet exceeds the fourth retransmission, the second duration is the product of a preset multiple and the duration of the previous retransmission of the first data packet.

[0032] In this application, when the number of retransmissions of the first data packet exceeds the fourth retransmission and the second data packet is not received, it indicates that the number of retransmissions is sufficient but the retransmission still fails, and the current network environment is extremely poor. By setting the retransmission duration to increase by a multiple, the retransmission duration of each retransmitted data packet can be extended, waiting for the network to recover, and maintaining the long connection between the first device and the second device.

[0033] In one alternative implementation, if the first data packet has been retransmitted more than the fourth time and the second data packet has not been received, the connection with the second device is disconnected.

[0034] In this application, if the second data packet is not received after the number of retransmissions of the data packet is greater than the fourth retransmission, it indicates that the number of retransmissions is sufficient but the retransmission still fails, the current network environment is extremely poor, and the connection can be actively disconnected to reduce the occupation of network resources.

[0035] Secondly, embodiments of this application provide a data transmission method applied to a second device. In this method, after receiving a first handshake message sent by a first device, the second device sends a second handshake message to the first device. The second handshake message is a response to the first handshake message. If a third handshake message is not received, the second handshake message is retransmitted. The number of times the second handshake message is retransmitted does not exceed the fifth retransmission count, which is the upper limit of the number of retransmissions of the second handshake message. The fifth retransmission count is greater than the sixth retransmission count, which is the system default upper limit of the number of retransmissions of the second handshake message. The third handshake message can be an ACK message.

[0036] In this application, by making the number of retransmissions of the second handshake message greater than the system default upper limit, the handshake message can still be retransmitted instead of the connection being terminated when the number of retransmissions of the second handshake message exceeds the system default upper limit, thereby improving the efficiency of establishing a connection between the first device and the second device.

[0037] In one alternative implementation, before retransmitting the second handshake message, connection configuration information related to the first device is obtained from the application interface or configuration file, including the fifth retransmission count.

[0038] In this application, the first device obtains the fifth retransmission count related to the second device from the application interface. When the fifth retransmission count changes, the latest parameters can be automatically obtained through the application interface to realize dynamic updating and management of the parameters.

[0039] The first device obtains the fifth retransmission count related to the second device from the configuration file, which can extract the parameter part from the business logic, making it easy to port, realize centralized storage and management of parameters, and facilitate changes to parameters related to business logic.

[0040] Furthermore, by configuring the connection between the first and second devices, connection-level settings can be implemented. These settings only apply to the configured connections and do not affect system configurations or other connection information, thus enabling customized business requirements for TCP connection levels.

[0041] In one optional implementation, the connection configuration information further includes a fourth upper limit duration, wherein the third duration does not exceed the fourth upper limit duration, and the third duration is the duration for retransmitting the second handshake message, that is, the retransmission duration of each SYN+ACK message does not exceed the fourth upper limit duration.

[0042] In this application, by ensuring that the duration of each retransmission of the second handshake message does not exceed the upper limit, the retransmission duration of the handshake message can be controlled within a certain time frame. Even when retransmitted multiple times, the retransmission duration will not be too long, thereby reducing the overall retransmission process and improving the efficiency of establishing a connection between the first and second devices.

[0043] In one optional implementation, the connection configuration information further includes a seventh retransmission count, which does not exceed the fifth retransmission count. If the retransmission count of the second handshake message is greater than the seventh retransmission count and less than or equal to the fifth retransmission count, and no third handshake message is received, the third duration is the product of a preset multiple and the duration of the previous retransmission of the second handshake message.

[0044] In this application, the seventh retransmission number is the retransmission optimization number of the second handshake message. When the retransmission number of the second handshake message is greater than the retransmission optimization number but does not exceed the retransmission limit number, the retransmission duration is doubled. The retransmission number is divided into different intervals by the retransmission optimization number and the retransmission limit number, so as to realize the interval adjustment of the retransmission duration.

[0045] In one alternative implementation, if the number of retransmissions of the second handshake message does not exceed the seventh retransmission, the third duration is less than or equal to the fifth upper limit duration.

[0046] In this application, when the number of retransmissions of the second handshake message does not exceed the retransmission optimization number, the retransmission duration of the second handshake message does not exceed the fifth upper limit duration. By making the upper limit of retransmissions greater than the retransmission optimization number, the number of retransmissions of the second handshake message is divided into different intervals, and the retransmission duration of different retransmission intervals is controlled in a graded manner by using the upper limit duration.

[0047] In one alternative implementation, if the number of retransmissions of the second handshake message is greater than or equal to the number of retransmissions of the fifth handshake message, and the third handshake message is not received, the connection with the first device is terminated.

[0048] In this application, if the maximum number of retransmissions has been reached and the third handshake message has not been received, it indicates that the retransmission of the second handshake message has been attempted many times without success, indicating that the current network environment is poor. The second device terminates the connection with the first device to reduce the occupation of network resources.

[0049] In one alternative implementation, the fifth and seventh retransmission times are determined based on the service data.

[0050] In this application, the fifth retransmission count is the upper limit for the second handshake message retransmission, and the seventh retransmission count is the optimized retransmission count for the second handshake message. The upper limit and optimized retransmission counts for the second handshake message are determined based on business data, allowing them to be set to optimal values ​​that meet business requirements. The business data can include the most recent retransmission upper limit, the most recent optimized retransmission value, the average of historical retransmission upper limits, and the average of historical optimized retransmission counts, etc.

[0051] In one optional implementation, the connection configuration information also includes an eighth retransmission count. After the first device and the second device establish a connection, the second device sends a second data packet to the first device. If the third data packet is not received, the second data packet is retransmitted within a fourth duration. The fourth duration is determined based on the eighth retransmission count and the number of retransmissions of the second data packet. The third data packet is the first device's response to the second data packet.

[0052] In this application, after the first device and the second device establish a connection, the data transmission phase begins. The second device sends data packets to the first device. After receiving the data packets from the second device, the first device sends a response packet to the second device. The second device determines whether it receives the response packet within the retransmission timer's retransmission duration. If it receives the response packet within the retransmission timer's retransmission duration, it indicates that the data packet transmission between the first and second devices is normal. If it does not receive the response packet within the initial duration of the retransmission timer, it indicates that the data packet has been lost. The second device then retransmits the data packet to the first device. The retransmission duration is determined based on the number of retransmission optimizations and the number of retransmissions of the data packet. By using different retransmission duration calculation methods based on the number of retransmissions falling within different intervals defined by the number of retransmission optimizations, flexible adjustments to service requirements are achieved. Multiple timeout retransmissions during the connection phase improve the reliability of data packet transmission.

[0053] In one alternative implementation, if the number of retransmissions of the second data packet does not exceed the eighth retransmission, the fourth duration is calculated based on the round-trip time of retransmitting the second data packet.

[0054] In this application, the retransmission duration is calculated based on the round-trip time of the data packet, which can control the retransmission duration to fluctuate within a relatively optimal range as the network environment changes.

[0055] In one optional implementation, the connection configuration information also includes a sixth upper limit duration, wherein the duration of each retransmission of the second data packet by the second device does not exceed the upper limit duration if the number of retransmissions of the second data packet does not exceed the eighth retransmission number.

[0056] In this application, by ensuring that the duration of each retransmission of a data packet does not exceed the upper limit, the retransmission duration of the data packet can be controlled within a certain time frame. When retransmissions are performed multiple times, the retransmission duration will not be too long, thereby reducing the overall retransmission process duration.

[0057] In one optional implementation, if the number of retransmissions of the second data packet exceeds the eighth retransmission, the fourth duration is the product of a preset multiple and the duration of the previous retransmission of the second data packet.

[0058] In this application, when the number of times the second device retransmits data packets to the first device exceeds the retransmission optimization number and no response packet is received, it indicates that the second device has retransmitted data packets a sufficient number of times but still fails to retransmit, and the current network environment is extremely poor. By setting the retransmission duration to a multiple increase, the retransmission duration of each retransmitted data packet can be extended, waiting for the network to recover, and maintaining the long connection state between the first device and the second device.

[0059] In one alternative implementation, if the second data packet has been retransmitted more than the eighth retransmission and the third data packet has not been received, the connection with the first device is disconnected.

[0060] In this application, when the second device sends a data packet to the first device and fails to receive a response packet from the first device after the number of retransmissions exceeds the retransmission optimization number, it indicates that the second device has retransmitted the data packet a sufficient number of times but still fails to retransmit, and the current network environment is extremely poor. The second device can actively disconnect from the first device to reduce the occupation of network resources.

[0061] Thirdly, embodiments of this application provide a data transmission method applied to a third device, wherein the third device and a fourth device transmit data, wherein the third device and the fourth device are two devices that have established a connection, and can be a first device and a second device, or two other devices that have established a connection in the network.

[0062] In this method, the third device obtains connection configuration information with the fourth device, including the ninth retransmission count, which is the number of retransmission optimizations for the data packet. The third device sends a data packet to the fourth device. The third device determines whether it receives a response message from the fourth device within the duration of the retransmission timer. If it receives the response message, it indicates that the data packet transmission between the third device and the fourth device is normal. If it does not receive the response message, the third device retransmits the data packet to the fourth device. The duration of each retransmission is determined based on the number of retransmission optimizations and the number of retransmissions for the data packet. If the third device receives a response message during any retransmission, it stops retransmitting the data packet to the fourth device.

[0063] In this application, the reliability of data packet transmission is improved by a data packet retransmission mechanism between the third and fourth devices. The duration of each retransmission is determined based on the number of retransmission optimizations and the number of data packet retransmissions, and the retransmission duration can be adaptively adjusted according to the number of retransmissions.

[0064] In one alternative implementation, the connection configuration information also includes a seventh upper limit duration, wherein the fifth duration does not exceed the seventh upper limit duration.

[0065] In this application, the duration of each retransmission of a data packet does not exceed the upper limit, and the retransmission duration of the data packet can be controlled within a certain time. When retransmissions are performed multiple times, the retransmission duration will not be too long.

[0066] In one optional implementation, if the number of retransmissions of the fourth data packet does not exceed the number of retransmissions of the ninth data packet, the fifth duration is calculated based on the round-trip time of retransmitting the fourth data packet.

[0067] In this application, the retransmission duration is calculated based on the round-trip time of the data packet, which can control the retransmission duration to fluctuate within a relatively optimal range as the network environment changes.

[0068] In one optional implementation, if the number of retransmissions of the fourth data packet is greater than the number of retransmissions of the ninth data packet, the fifth duration is the product of a preset multiple and the duration of the previous retransmission of the fourth data packet.

[0069] In this application, when the third device retransmits data packets to the fourth device more than the ninth retransmission count and no response packet is received, it indicates that the third device has retransmitted data packets a sufficient number of times but still failed to retransmit, and the current network environment is extremely poor. By setting the retransmission duration to increase by a multiple, the retransmission duration of each retransmitted data packet can be extended, waiting for the network to recover, and maintaining the long connection between the third device and the fourth device.

[0070] In one alternative implementation, if the number of retransmissions of the fourth data packet exceeds the ninth retransmission and the fifth data packet is not received, the connection with the fourth device is disconnected.

[0071] In this application, when the third device sends a data packet to the fourth device and fails to receive a response packet from the fourth device after more than the ninth retransmission, it indicates that the third device has retransmitted the data packet many times but still failed to retransmit. The current network environment is extremely poor, and the connection with the fourth device can be actively disconnected to reduce the occupation of network resources.

[0072] In one alternative implementation, the connection configuration information is obtained from the application interface or configuration file.

[0073] In this application, the third device obtains connection configuration information related to the fourth device from the application interface. The connection configuration information includes parameters involved between the third device and the fourth device during the transmission phase. When the connection configuration information changes, the latest parameters can be automatically obtained through the application interface to realize dynamic updating and management of the parameters.

[0074] The third device obtains the connection configuration information related to the fourth device from the configuration file, which can extract the parameter part from the business logic, making it easy to port, realize the centralized storage and management of parameters, and facilitate the modification of parameters related to business logic.

[0075] Furthermore, by configuring the connection information between the third and fourth devices, connection-level settings can be implemented. These settings only apply to the configured connections and do not affect system configurations or other connection information, thus enabling customized business requirements for TCP connection levels.

[0076] In one alternative implementation, the ninth retransmission number is determined based on the service data.

[0077] In this application, the ninth retransmission count is the number of times the message retransmission is optimized. The number of optimized retransmission counts is determined based on business data, and can be set to an optimal value that meets business requirements. The business data can be the most recent optimized retransmission value, the average of historical optimized retransmission counts, etc.

[0078] Fourthly, embodiments of this application provide a data transmission method applied to a fourth device, where a third device and the fourth device transmit data. The third and fourth devices are two devices that have already established a connection; they can be a first device, a second device, or two other devices in the network that have established a connection. In this method, the fourth device sends a fifth data packet to the third device. The fifth data packet is a response to the fourth data packet, which is a retransmitted packet if the third device does not receive the fifth data packet within a fifth time duration. The fifth time duration is the duration for retransmitting the fourth data packet, determined by the third device based on a ninth retransmission count and the number of retransmissions of the fourth data packet. The ninth retransmission count is connection configuration information obtained by the third device, and this connection configuration information is related to the fourth device.

[0079] In this application, after receiving a data packet from the third device, the fourth device sends a response packet to the third device. If the third device does not receive the response packet within the retransmission timer's retransmission duration, the third device retransmits the fourth data packet to the fourth device. This data packet retransmission mechanism between the third and fourth devices improves the reliability of data packet transmission. The duration of each retransmission is determined based on the number of retransmission optimizations and the number of retransmissions, allowing for adaptive adjustment of the retransmission duration according to the number of retransmissions.

[0080] Fifthly, this application provides a communication device, comprising:

[0081] The sending module is used to send a first handshake message to the second device, which is used to request the establishment of a connection with the second device.

[0082] The retransmission module is used to retransmit the first handshake message if the second handshake message is not received. The number of times the first handshake message is retransmitted does not exceed the first retransmission count. The second handshake message is the response of the second device to the first handshake message. The first retransmission count is the upper limit of the number of times the first handshake message can be retransmitted. The first retransmission count is greater than the second retransmission count. The second retransmission count is the system default upper limit of the number of times the first handshake message can be retransmitted.

[0083] The communication device in the fifth aspect can perform the operations performed by the first device in the aforementioned embodiment, which will not be described in detail here.

[0084] Sixthly, this application provides a communication device, comprising:

[0085] The sending module is used to send a second handshake message to the first device after receiving the first handshake message sent by the first device. The second handshake message is a response to the first handshake message.

[0086] The retransmission module is used to retransmit the second handshake message if the third handshake message is not received. The number of times the second handshake message is retransmitted shall not exceed the fifth retransmission count, which is the upper limit of the number of times the second handshake message can be retransmitted. The fifth retransmission count is greater than the sixth retransmission count, which is the system default upper limit of the number of times the second handshake message can be retransmitted.

[0087] The communication device in the sixth aspect can perform the operations performed by the second device in the aforementioned embodiment, which will not be described in detail here.

[0088] In a seventh aspect, this application provides a communication device, comprising:

[0089] The sending module is used to send a fourth data packet to the fourth device;

[0090] The retransmission module is used to retransmit the fourth data packet within a fifth time period if the fifth data packet is not received. The fifth time period is the duration for retransmitting the fourth data packet. The fifth time period is determined based on the ninth retransmission count and the retransmission count of the fourth data packet. The fifth data packet is a response to the fourth data packet. The ninth retransmission count is connection configuration information obtained by the third device. The connection configuration information is related to the fourth device.

[0091] The communication device in the seventh aspect can perform the operations performed by the third device in the aforementioned embodiments, which will not be described in detail here.

[0092] Eighthly, this application provides a communication device, comprising:

[0093] The sending module is used to send a fifth data packet to the third device. The fifth data packet is a response to the fourth data packet sent by the third device. The fourth data packet is a retransmitted packet when the third device does not receive the fifth data packet within a fifth duration. The fifth duration is the duration for the third device to retransmit the fourth data packet. The fifth duration is determined by the third device based on the ninth retransmission count and the retransmission count of the fourth data packet. The ninth retransmission count is the connection configuration information obtained by the third device, and the connection configuration information is related to the fourth device.

[0094] Ninthly, embodiments of this application provide a network device including a processor coupled to a memory for storing instructions. When the instructions are executed by the processor, the network device performs the method in any one of the optional embodiments of the first, second, third, or fourth aspects described above.

[0095] In a tenth aspect, embodiments of this application provide a computer-readable storage medium including a computer program or instructions that, when executed on a computer, cause the computer to perform the method in any one of the optional embodiments of the first, second, third, or fourth aspects described above.

[0096] In the eleventh aspect, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method in any one of the optional embodiments of the first, second, third, or fourth aspects described above. Attached Figure Description

[0097] Figure 1 is a network architecture diagram in an embodiment of this application;

[0098] Figure 2 is a schematic diagram of an application scenario in an embodiment of this application;

[0099] Figure 3 is a schematic diagram of an embodiment of the data transmission method in this application;

[0100] Figure 4 is a schematic diagram of the message structure in an embodiment of this application;

[0101] Figure 5 is a schematic diagram of another embodiment of the data transmission method in this application;

[0102] Figure 6 is a schematic diagram of another embodiment of the data transmission method in this application;

[0103] Figure 7 is a schematic diagram showing the relationship between the number of retransmissions and the retransmission duration in an embodiment of this application;

[0104] Figure 8 is a schematic diagram of another embodiment of the data transmission method in this application;

[0105] Figure 9 is a schematic diagram showing the relationship between the number of retransmissions and the retransmission duration in an embodiment of this application;

[0106] Figure 10 is a schematic diagram showing the relationship between the number of retransmissions and the retransmission duration in an embodiment of this application;

[0107] Figure 11 is a schematic diagram of another embodiment of the data transmission method in this application;

[0108] Figure 12 is a schematic diagram of another embodiment of the data transmission method in this application;

[0109] Figure 13 is a schematic diagram of another embodiment of the data transmission method in this application;

[0110] Figure 14 is a schematic diagram of another embodiment of the data transmission method in this application;

[0111] Figure 15 is a schematic diagram of another embodiment of the data transmission method in this application;

[0112] Figure 16 is a schematic diagram showing the relationship between the number of retransmissions and the retransmission duration in an embodiment of this application;

[0113] Figure 17 is a schematic diagram of another embodiment of the data transmission method in this application;

[0114] Figure 18 is a schematic diagram showing the relationship between the number of retransmissions and the retransmission duration in an embodiment of this application;

[0115] Figure 19 is a schematic diagram of a communication device according to an embodiment of this application;

[0116] Figure 20 is a schematic diagram of another communication device in an embodiment of this application;

[0117] Figure 21 is a schematic diagram of another communication device in an embodiment of this application;

[0118] Figure 22 is a schematic diagram of another communication device in an embodiment of this application;

[0119] Figure 23 is a schematic diagram of one embodiment of the network device in this application. Detailed Implementation

[0120] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. With the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0121] The terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of modules is not necessarily limited to those modules, but may include other modules not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0122] Please refer to Figure 1. The network architecture on which the data transmission method in this embodiment is based will be briefly described below.

[0123] For the communication network provided in this application, for example, its architecture can be as shown in FIG1. ​​The communication network may include one or more terminals and one or more network devices, and the one or more terminals are connected to the one or more network devices.

[0124] The terminal may also be referred to as terminal equipment, user equipment (UE), electronic equipment, etc., and this application is not limited to these terms. Specifically, the terminal may include: mobile phone, tablet computer, laptop computer, PC, wearable device, extended reality (XR) device, virtual reality (VR) device, augmented reality (AR) device, vehicle, in-vehicle terminal, or other electronic equipment, etc.

[0125] Specifically, the network device can be a node in a communication network, such as a server, base station, evolved NodeB (eNodeB), next-generation NodeB (gNB), next-generation base station in a 6th generation (6G) mobile communication system, base station in a future mobile communication system, or access node in a WiFi system.

[0126] It should be noted that in the following embodiments of this application, the first device and the second device are used as examples for illustrative purposes. The first device can be a terminal or a network device, the second device can be a terminal or a network device, and the first device and the second device can both be terminals or network devices. The first device and the second device communicate based on the TCP protocol.

[0127] The data transmission method of this application embodiment is used for timeout retransmission of messages between the first device and the second device. On the one hand, it is used to retransmit lost handshake messages multiple times during the three-way handshake phase to establish a connection between the first device and the second device. On the other hand, it is used to retransmit lost data messages multiple times during the data transmission phase after the first device and the second device have established a connection, thereby improving the reliability of transmitted data messages.

[0128] Please refer to Figure 2. The application scenarios of the data transmission method in the embodiments of this application are described below.

[0129] In TCP-based video call scenarios, terminals (such as mobile phones) and network devices (such as cloud servers) need to frequently exchange and transmit messages. When the network is at a low speed or with a weak signal, messages often cannot be delivered for a long time, resulting in frequent network packet loss.

[0130] During the handshake phase of establishing a connection between the mobile phone and the cloud server, a small number of handshake messages are transmitted. The mobile phone sends a SYN message to the cloud server, the cloud server replies with a SYN+ACK message to the mobile phone, and after receiving the SYN+ACK message, the mobile phone sends an ACK message to the cloud server. Through the three-way handshake, a TCP connection is established between the mobile phone and the cloud server.

[0131] After a connection is established between the mobile phone and the cloud server, data transmission involves ping-pong interaction. Ping-pong mode is a working mode of TCP sockets at both ends, used for cross-sending of packets in both directions. A socket is an intermediate software abstraction layer for communication between the application layer and the TCP protocol. In design patterns, sockets belong to the facade pattern, encapsulating the complex features and functions of the TCP protocol and providing a simple calling method. Sockets bind to three socket parameters to distinguish communication from different application processes or network connections, enabling concurrent data transmission services. These three socket parameters include: the destination IP address, the transport layer protocol used, and the port number used. The mobile phone's socket determines the corresponding IP address and port number of the cloud server based on these three socket parameters, thus determining the connection between the mobile phone and a specific process on the cloud server, enabling network communication between the two devices. By binding the mobile phone's socket to different port numbers on the cloud server, multiple TCP connections between the mobile phone and the cloud server can be established.

[0132] It should be noted that the above application scenario is only one application scenario involved in the embodiments of this application. The embodiments of this application also involve other business scenarios based on TCP message interaction, such as voice scenarios, chat scenarios, etc., which are not limited here.

[0133] Based on the foregoing descriptions of the first and second devices, this embodiment of the application uses the first device as the connection initiator and the second device as the connection receiver as an example for explanation. The connection initiator includes a client, and the connection receiver includes a server. The method provided in this embodiment can be used to transmit handshake messages during the connection establishment phase, and also to transmit data packets during the data transmission phase. The connection establishment phase and the data transmission phase are described separately below.

[0134] Part 1: Connection Establishment Phase

[0135] The first device and the second device establish a connection through a three-way handshake process. A brief description of the three-way handshake process is as follows: The first device sends a SYN packet to the second device. After receiving the SYN packet, the second device sends a SYN+ACK packet to the first device. After receiving the SYN+ACK packet, the first device sends an ACK packet to the second device, thus establishing the connection between the two devices. During the connection phase, the transmission of messages between the first and second devices involves three handshake packets: a SYN packet, a SYN+ACK packet, and an ACK packet. In the three-way handshake process, the SYN+ACK packet is the response packet to the SYN packet, and the ACK packet is the response packet to the SYN+ACK packet.

[0136] When network signal is poor, the first device may not receive a SYN+ACK packet for a long time after sending a SYN packet, or the second device may not receive an ACK packet for a long time after sending a SYN+ACK packet. In cases where neither the first nor the second device receives a response packet for an extended period, each device can set a retransmission timer. The retransmission timer starts counting when a device sends a handshake packet, and its duration is the preset duration for retransmitting the handshake packet. If the device does not receive a response packet within the retransmission timer's duration, it retransmits the handshake packet until the number of retransmissions exceeds the retransmission limit or the device receives a response packet within the retransmission duration.

[0137] In this embodiment, connection configuration information is provided to configure relevant parameters during the connection process between the first device and the second device. These parameters include the upper limit for the number of handshake message retransmissions, the upper limit for the duration of handshake message retransmissions, and the optimization number of handshake message retransmissions. By setting different parameters in the connection configuration information, the handshake message retransmission process between the first device and the second device can be controlled. For example, by increasing the upper limit for the number of handshake message retransmissions and decreasing the upper limit for the duration of handshake message retransmissions, it is possible to control the first device and the second device to send more handshake messages in a shorter time, thereby improving the efficiency of establishing a connection between the first device and the second device.

[0138] The following explains the different parameters included in the connection configuration information when the first device retransmits the handshake message.

[0139]

Example 1

[0140] Please refer to Figure 3, which is a flowchart illustrating a data transmission method provided in this application.

[0141] 301. The first device obtains the maximum number of retransmissions of SYN packets.

[0142] The first device obtains connection configuration information related to the second device. The connection configuration information includes parameters involved in the handshake or transmission phase between the first and second devices, such as the maximum number of retransmissions, the number of retransmission optimizations, and the maximum duration.

[0143] In this embodiment, the first device obtains the maximum number of retransmissions of SYN packets. The maximum number of retransmissions of SYN packets is greater than the system default maximum value, which is the default maximum number of SYN packet retransmissions in TCP.

[0144] The first device obtains connection configuration information related to the second device from the application interface. The application interface is a predefined functional module that exposes the program's functionality while hiding its specific implementation, facilitating the reuse of functional modules and data communication and sharing between modules. The first device can obtain connection configuration information from either the input parameters or the return value of the application interface; the specific method is not limited here. Obtaining connection configuration information from the application interface allows for automatic retrieval of the latest parameters when the connection configuration information changes, enabling dynamic parameter updates and management.

[0145] The first device retrieves connection configuration information related to the second device from a configuration file. A configuration file is a file that stores predefined configurations and parameters required for application runtime, such as configuration tables. Writing the connection configuration information to a configuration file allows the parameter portion to be extracted from the business logic, facilitating portability, centralized storage and management of parameters, and making it easier to modify parameters related to business logic.

[0146] In practical applications, connection configuration information can be obtained from application interfaces or configuration files, or by querying a local database or from network elements; no specific restrictions are imposed here.

[0147] 302. The first device sends a SYN message to the second device.

[0148] Figure 4 shows a TCP packet format provided in an embodiment of this application. The TCP packet includes a TCP header and a TCP data portion. The TCP header includes control bits, consisting of 6 bits: URG, ACK, PSH, RST, SYN, and FIN. The SYN packet is a type of TCP packet that indicates that a synchronization character SYN bit must be sent before sending information or responding. It is used in the first handshake process during the connection establishment phase between the first and second devices to achieve synchronization between the sender and receiver. During the first handshake, the SYN packet carries the synchronization character SYN bit in the TCP header, setting SYN to 1, and simultaneously selecting an initial sequence number seq = x.

[0149] The first device sends a SYN message to the second device to request a connection. At this time, the first device enters the SYN-SENT state.

[0150] 303. The second device sends a SYN+ACK message to the first device.

[0151] As shown in Figure 4, an ACK bit of 1 indicates that the acknowledgment number is valid, while a bit of 0 indicates that the message does not contain acknowledgment information and the acknowledgment number field is ignored.

[0152] When the second device receives the SYN packet from the first device, it indicates that the initial handshake was successful. If the second device agrees to establish a connection, it sends an acknowledgment packet, i.e., a SYN+ACK packet, to the first device. In the acknowledgment packet, both the SYN and ACK bits are set to 1, the acknowledgment number is ack = x + 1, and an initial sequence number seq = y is chosen for itself. At this point, the second device enters the SYN-SENT (synchronization sent) state.

[0153] 304. The first device determines whether it has received a SYN+ACK message from the second device within the duration of the retransmission timer. If yes, proceed to step 307; otherwise, proceed to step 305.

[0154] After the first device sends a SYN packet, its retransmission timer starts counting down. It checks whether a SYN+ACK packet from the second device is received within the set duration of the retransmission timer, which is the retransmission duration. If the first device receives a SYN+ACK packet within the retransmission duration, it indicates that the two handshakes between the first and second devices were successful and no handshake packets were lost. Therefore, there is no need to retransmit the SYN or SYN+ACK packet, and the third handshake process continues, proceeding to step 307.

[0155] If the first device does not receive the SYN+ACK packet within the retransmission time limit, including the following possibilities: the SYN packet is lost during the first handshake, the SYN+ACK packet is lost during the second handshake, or the time it takes for the first device to receive the SYN+ACK packet exceeds the retransmission time limit, when any of these situations occur, the SYN packet needs to be retransmitted, and step 305 should be executed.

[0156] It should be noted that the retransmission duration of each retransmission of a message by the retransmission timer can be a fixed value or a value that is dynamically calculated based on the actual transmission of the message. For example, the retransmission duration can be a preset duration or a retransmission duration calculated based on the duration of the previous retransmission. The specific duration is not limited here.

[0157] 305. Determine whether the number of retransmissions of the SYN packet of the first device exceeds the retransmission limit. If yes, proceed to step 308; otherwise, repeat step 304.

[0158] Determine whether the number of retransmissions of the SYN packet is greater than the retransmission limit. If the number of retransmissions of the SYN packet is greater than the retransmission limit, terminate the connection with the second device. If the number of retransmissions of the SYN packet is less than or equal to the retransmission limit, retransmit the SYN packet, i.e., execute step 306.

[0159] 306. Retransmit the SYN message and repeat step 304.

[0160] The first device sends a SYN packet to the second device, incrementing the retransmission count of the SYN packet by 1. The retransmission duration can be updated based on the previous transmission or left unchanged. The first device checks whether it receives a SYN+ACK packet within the retransmission timer's retransmission duration. If it does, it sends an ACK packet to the second device, and the first device establishes a connection with the second device. If it does not receive an ACK packet, it checks whether the retransmission count of the SYN packet exceeds the retransmission limit. If it does, it terminates the connection with the second device. If it does not exceed the retransmission limit, it retransmits the SYN packet and repeats step 304.

[0161] 307. The first device sends an ACK message to the second device.

[0162] When the handshake process between the first and second devices is normal, and a SYN+ACK packet is received within the retransmission timer's retransmission duration, the first device sends an ACK packet to the second device. The ACK packet is set to 1 and can carry data. At this point, the TCP connection has been established, and the first device enters the ESTABLISHED state.

[0163] 308. Terminate the connection between the first device and the second device.

[0164] When the first device retransmits a SYN packet to the second device, and the number of retransmissions exceeds the retransmission limit, it indicates that the first device has retransmitted the SYN packet a sufficient number of times but still fails to retransmit. The current network environment is extremely poor, and the device can proactively terminate the connection with the second device to reduce the consumption of network resources.

[0165] It should be noted that in this embodiment, step 301 can be executed before step 305, and there is no specific limitation here.

[0166] The above explains the execution process of connection configuration information, including the maximum number of retransmissions. The following example provides a more detailed explanation.

[0167] As shown in Figure 5, the system default upper limit for the number of SYN packet retransmissions is 6, and the upper limit for the number of SYN packet retransmissions is 10. Following the above process in this embodiment, the connection establishment process is as follows: The first device sends a SYN packet to the second device. After receiving the SYN packet, the second device sends a SYN+ACK packet to the first device. If the first device does not receive the SYN+ACK packet within the retransmission timer duration, it retransmits the SYN packet for the first time. If it does not receive the SYN+ACK packet within the retransmission timer duration during the first retransmission, it retransmits the SYN packet for the second time. If it does not receive the SYN+ACK packet within the retransmission timer duration during the second retransmission, it retransmits the SYN packet for the third time. This process is repeated. If a SYN+ACK packet is received during the eighth retransmission, the first device sends an ACK packet to the second device, and the first device and the second device establish a connection. If no SYN+ACK message is received after the 10th retransmission of the SYN message, the connection with the second device will be terminated.

[0168] It should be noted that the upper limit of 10 for the number of SYN packet retransmissions is just an example. The upper limit of the number of SYN packet retransmissions can be greater than the system default upper limit. In this embodiment, when the number of SYN packet retransmissions is greater than 6 and less than 10, and a SYN+ACK packet is not received within the retransmission time, the SYN packet can continue to be retransmitted instead of terminating the connection with the second device.

[0169] In this embodiment of the application, when the first device loses a handshake message during the first handshake and the second handshake with the second device, the first device determines whether to retransmit the SYN message by judging whether a SYN+ACK message is received within the retransmission timeout. When the number of SYN message retransmissions exceeds the retransmission limit, the connection is terminated. By performing multiple timeout retransmissions, the probability of successful SYN message transmission is increased.

[0170] By increasing the maximum number of SYN packet retransmissions beyond the system default limit, the handshake message can still be retransmitted even when the number of SYN packet retransmissions exceeds the system default limit, instead of terminating the connection with the second device, thus improving the efficiency of establishing a connection between the first and second devices.

[0171] In addition, this embodiment obtains connection configuration information from the application interface or connection configuration file. The connection configuration information includes the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations. By setting the maximum number of retransmissions in this way, the connection level can be set without changing the system's default maximum value. It can achieve retransmission optimization only for connections that apply the method of this embodiment, without affecting the default connection.

[0172]

Example 2

[0173] Please refer to Figure 6, which is a flowchart illustrating a data transmission method provided in this application.

[0174] 601. The first device obtains the maximum number of retransmissions and the maximum duration of SYN packets.

[0175] In this embodiment, the maximum number of SYN packet retransmissions is greater than the system default maximum, which is the maximum number of SYN packet retransmissions allowed in TCP. The maximum duration is a threshold for the duration of SYN packet retransmissions, used to limit the retransmission duration of SYN packets from exceeding the threshold within the corresponding range.

[0176] Based on the aforementioned description of the connection configuration information in section 301, the first device obtains the maximum number of retransmissions and the maximum duration of SYN packets from the application interface or configuration file, which will not be elaborated here.

[0177] 602. The first device sends a SYN message to the second device.

[0178] 603. The second device sends a SYN+ACK message to the first device.

[0179] 604. The first device determines whether it receives the SYN+ACK packet sent by the second device within the retransmission timer's retransmission duration. If yes, proceed to step 607; otherwise, proceed to step 605.

[0180] 605. Determine the retransmission duration based on the number of SYN message retransmissions, the maximum number of retransmissions, and the maximum duration.

[0181] If the retransmission time exceeds the upper limit for each SYN packet retransmission, the upper limit will be used as the retransmission time for the SYN packet.

[0182] Referring to Figure 7, when the number of SYN packet retransmissions is less than or equal to the maximum retransmission count, and the retransmission duration is less than the maximum duration, the retransmission duration remains unchanged. When the number of SYN packet retransmissions is less than or equal to the maximum retransmission count, and the retransmission duration is greater than or equal to the maximum duration, the maximum duration is used as the retransmission duration for the SYN packet. When the number of SYN packet retransmissions exceeds the maximum retransmission count, step 608 is executed.

[0183] 606. Retransmit the SYN packet and repeat step 604.

[0184] 607. The first device sends an ACK message to the second device.

[0185] 608. The first device terminates the connection with the second device.

[0186] It should be noted that in this embodiment, step 601 can be executed before step 605, and there is no specific limitation here.

[0187] Steps 601 to 604 in this embodiment are similar to steps 301 to 304 in the embodiment shown in Figure 3 above, and steps 606 to 608 are similar to steps 306 to 308 in the embodiment shown in Figure 3 above. The specific details will not be repeated here.

[0188] The above explains the execution process of connection configuration information, including the maximum number of retransmissions and the maximum duration. The following example provides a more detailed explanation.

[0189] As shown in Figure 7, with a maximum retransmission count of 8, a maximum retransmission duration of 10 seconds, and an initial retransmission timer duration of 1 second, the connection establishment process is as follows: The first device sends a SYN packet to the second device. If the first device does not receive a SYN+ACK packet within 1 second, it performs the first SYN packet retransmission for 2 seconds. If the first device does not receive a SYN+ACK packet within 2 seconds during the first retransmission, it performs a second retransmission for 4 seconds. If the first device does not receive a SYN+ACK packet within 4 seconds during the second retransmission, it performs the third retransmission... The retransmission duration for the third retransmission is 8 seconds. If the first device does not receive the SYN+ACK packet within 8 seconds during the third retransmission, a fourth retransmission is initiated. According to the doubling algorithm, the retransmission duration for the fourth retransmission is 16 seconds, which exceeds the upper limit. Therefore, the duration of the fourth retransmission is updated to 10 seconds. If the first device does not receive the SYN+ACK packet within 10 seconds during the fourth retransmission, a fifth retransmission is initiated. The retransmission duration for the subsequent sixth and seventh retransmissions is 10 seconds. If the first device receives the SYN+ACK packet during the seventh retransmission, it stops retransmitting SYN packets and sends a SYN+ACK packet to the second device, thus establishing a connection between the first and second devices.

[0190] It should be noted that the initial duration of the retransmission timer is 1 second. The fact that the retransmission duration of each SYN packet is twice the duration of the previous SYN packet is just an example. The retransmission duration of the retransmission timer can be doubled, limited to a certain threshold, or calculated according to different algorithms. Therefore, the relationship between the number of SYN packet retransmissions and the upper limit duration shown in Figure 7 is only one possibility, and no specific limitation is made here.

[0191] In this embodiment, the retransmission duration is determined based on the number of SYN packet retransmissions, the maximum number of retransmissions, and the maximum duration. By ensuring that the number of SYN packet retransmissions is greater than the system's default maximum value, the duration of each SYN packet retransmission is limited to not exceeding the maximum duration. This prevents the retransmission duration of SYN packets from increasing with the number of retransmissions. By increasing the number of SYN packet retransmissions within a certain time, the duration of the entire retransmission process is reduced, thereby improving the efficiency of establishing a connection between the first device and the second device.

[0192] [Example 3] The first device retransmits the SYN packet. The connection configuration information includes the maximum number of retransmissions of the SYN packet, the maximum duration, and the number of retransmission optimizations.

[0193] Please refer to Figure 8, which is a flowchart illustrating a data transmission method provided in this application.

[0194] 801. The first device obtains the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations for SYN packets.

[0195] Based on the aforementioned description of the connection configuration information in section 301, the first device obtains the maximum number of retransmissions, maximum duration, and number of retransmission optimizations for SYN packets from the application interface or configuration file. The specifics will not be elaborated here.

[0196] 802. The first device sends a SYN message to the second device.

[0197] 803. The second device sends a SYN+ACK message to the first device.

[0198] 804. The first device determines whether it receives the SYN+ACK message sent by the second device within the retransmission timer's retransmission duration. If yes, proceed to step 807; otherwise, proceed to step 805.

[0199] 805. Determine the retransmission duration based on the number of SYN message retransmissions, the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations.

[0200] In this embodiment, the maximum number of SYN packet retransmissions is greater than the system default maximum, which is the maximum number of SYN packet retransmissions allowed in TCP. The maximum duration is a threshold for the duration of SYN packet retransmissions, used to limit the retransmission duration of SYN packets within a given range from exceeding the threshold. The optimized retransmission count is used to divide the number of SYN packet retransmissions into different ranges, determining different retransmission durations within each range.

[0201] Referring to Figure 9, when the number of SYN packet retransmissions is less than or equal to the retransmission optimization count, and the retransmission duration is less than or equal to the first upper limit duration, the retransmission duration remains unchanged. When the number of SYN packet retransmissions is less than or equal to the retransmission optimization count, and the retransmission duration is greater than the first upper limit duration, the first upper limit duration is used as the retransmission duration. When the number of SYN packet retransmissions is greater than the retransmission optimization count, but less than or equal to the retransmission upper limit count, the retransmission duration of the SYN packet is the product of a preset multiple and the duration of the previous retransmission of the SYN packet. When the number of SYN packet retransmissions is greater than the retransmission upper limit count, step 808 is executed.

[0202] Referring to Figure 10, when the number of SYN packet retransmissions is less than or equal to the retransmission optimization count, and the retransmission duration is less than or equal to the first upper limit duration, the retransmission duration remains unchanged. When the number of SYN packet retransmissions is less than or equal to the retransmission optimization count, and the retransmission duration is greater than the first upper limit duration, the first upper limit duration is used as the retransmission duration. When the number of SYN packet retransmissions is greater than the retransmission optimization count, but less than or equal to the retransmission upper limit count, and the retransmission duration is less than or equal to the second upper limit duration, the retransmission duration remains unchanged. When the number of SYN packet retransmissions is greater than the retransmission optimization count, but less than or equal to the retransmission upper limit count, and the retransmission duration is greater than the second upper limit duration, the second upper limit duration is used as the retransmission duration. When the number of SYN packet retransmissions is greater than the retransmission upper limit count, step 808 is executed.

[0203] It should be noted that Figure 7 illustrates the scenario where the retransmission duration of a SYN packet is controlled by the upper limit when the number of retransmissions does not exceed the upper limit. Figure 9 illustrates the scenario where the retransmission duration of a SYN packet is controlled by the upper limit when the number of retransmissions does not exceed the optimized retransmission count. Figure 10 illustrates the scenario where the retransmission duration is controlled by the first upper limit when the number of retransmissions does not exceed the optimized retransmission count, and by the second upper limit when the number of retransmissions is between the optimized and the upper limit. This application's embodiments provide some scenarios where the retransmission duration is controlled by the upper limit when the number of retransmissions is in different ranges; other possible scenarios are not elaborated here. The trend line showing the relationship between retransmission duration and the number of retransmissions in the figures is only one possibility, and no specific limitation is made here.

[0204] 806. Retransmit the SYN packet and repeat step 804.

[0205] 807. The first device sends an ACK message to the second device.

[0206] 808. Terminate the connection between the first device and the second device.

[0207] It should be noted that in this embodiment, step 801 can be executed before step 805, and there is no specific limitation here.

[0208] Steps 801 to 804 in this embodiment are similar to steps 301 to 304 in the embodiment shown in Figure 3 above, and steps 806 to 808 are similar to steps 306 to 308 in the embodiment shown in Figure 3 above. The specific details will not be repeated here.

[0209] In this embodiment, by exceeding the upper limit of retransmissions by the optimized retransmission count, the number of SYN packet retransmissions is divided into different intervals. Furthermore, the retransmission duration within each interval is adjusted using the upper limit duration, enabling tiered adjustment of the retransmission duration. Simultaneously, this prevents the retransmission duration of SYN packets from continuously increasing with the number of retransmissions, thereby increasing the number of handshake packet retransmissions within a certain timeframe, reducing the overall retransmission process duration, and improving the efficiency of establishing a connection between the first and second devices.

[0210] In practical applications, connection configuration information, including the maximum number of retransmissions, maximum duration, and number of retransmission optimizations for SYN packets, is determined based on business data. This business data is the preferred data for retransmitting SYN packets, determined from historical data. For example, business data could be the most recent retransmission limit, the most recent optimized retransmission value, the average number of historical retransmission limits, or the average number of historical optimized retransmissions. Determining connection configuration information based on business data allows for setting optimal values, increasing the probability of establishing a connection between the first and second devices.

[0211] The above explains the situation of the first device retransmitting SYN packets. The following explains the situation of the second device retransmitting SYN+ACK packets.

[0212]

Example 4

[0213] Please refer to Figure 11, which is a flowchart illustrating a data transmission method provided in this application.

[0214] 1101. The second device obtains the maximum number of retransmissions of the SYN+ACK message.

[0215] The second device obtains connection configuration information related to the first device. This connection configuration information includes parameters involved in the handshake or transmission phases between the first and second devices, such as the maximum number of retransmissions, the number of retransmission optimizations, and the maximum duration. In this embodiment, the second device obtains the maximum number of retransmissions for SYN+ACK packets. The maximum number of retransmissions for SYN+ACK packets is greater than the system default maximum value, which is the default maximum number of SYN+ACK packet retransmissions in a TCP connection.

[0216] The second device obtains connection configuration information related to the first device from the application interface. The application interface is a predefined functional module that exposes the program's functionality while hiding its specific implementation, facilitating the reuse of functional modules and data communication and sharing between modules. The second device can obtain connection configuration information from either the input parameters or the return value of the application interface; the specific method is not limited here. Obtaining connection configuration information from the application interface allows for automatic retrieval of the latest parameters when the connection configuration information changes, enabling dynamic parameter updates and management.

[0217] The second device retrieves connection configuration information related to the first device from a configuration file. A configuration file is a file that stores predefined configurations and parameters required for application runtime, such as configuration tables. Writing the connection configuration information into the configuration file allows the parameter portion to be extracted from the business logic, facilitating portability, centralized storage and management of parameters, and making it easier to modify parameters related to business logic.

[0218] In practical applications, connection configuration information can be obtained from application interfaces or configuration files, or by querying a local database or from network elements; no specific restrictions are imposed here.

[0219] 1102. The first device sends a SYN message to the second device.

[0220] 1103. The second device sends a SYN+ACK message to the first device.

[0221] 1104. The first device sends an ACK message to the second device.

[0222] 1105. The second device determines whether it has received an ACK packet sent by the first device within the retransmission timer's retransmission duration. If yes, the connection between the first and second devices has been established. If not, proceed to step 1106.

[0223] After the second device sends a SYN+ACK message, its retransmission timer starts counting down. It checks whether it receives an ACK message from the first device within the set duration of the retransmission timer, which is the retransmission duration itself. If the second device receives an ACK message within the retransmission duration, it indicates that the three-way handshake between the first and second devices was successful, and a connection has been established between them.

[0224] If the second device does not receive an ACK packet within the retransmission time, the following possibilities exist: the SYN+ACK packet is lost during the handshake process, or the ACK packet is lost. When any of these situations occur, proceed to step 1106.

[0225] It should be noted that the retransmission duration of each retransmission of a message by the retransmission timer can be a fixed value or a value that is dynamically calculated based on the actual transmission of the message. For example, the retransmission duration can be a preset duration or a retransmission duration calculated based on the duration of the previous retransmission. The specific duration is not limited here.

[0226] 1106. Determine whether the number of retransmissions of the SYN+ACK packet exceeds the retransmission limit. If yes, proceed to step 1108; otherwise, proceed to step 1107.

[0227] Determine whether the number of retransmissions of the SYN+ACK packet is greater than the retransmission limit. If the number of retransmissions of the SYN+ACK packet is greater than the retransmission limit, terminate the connection with the first device. If the number of retransmissions of the SYN+ACK packet is less than or equal to the retransmission limit, proceed to step 1107.

[0228] 1107. Retransmit the SYN+ACK message and repeat step 1105.

[0229] 1108. Terminate the connection between the first device and the second device.

[0230] When the second device retransmits the SYN+ACK packet to the first device, and the number of retransmissions exceeds the retransmission limit, but the ACK packet is still not received, it indicates that the second device has retransmitted the SYN+ACK packet a sufficient number of times but still failed to retransmit. The current network environment is extremely poor, and the second device can actively terminate the connection with the first device to reduce the occupation of network resources.

[0231] It should be noted that in this embodiment, step 1101 can be executed before step 1106, and there is no specific limitation here.

[0232] The above explains the execution process of connection configuration information, including the maximum number of retransmissions. The following example provides a more detailed explanation.

[0233] Referring to Figure 12, the system default upper limit for the number of SYN+ACK message retransmissions is 6, and the upper limit for the number of SYN message retransmissions is 10. Following the above process in this embodiment, the connection establishment process is as follows: The first device sends a SYN message to the second device. After receiving the SYN message, the second device sends a SYN+ACK message to the first device. The first device sends an ACK message to the second device. If the second device does not receive an ACK message within the retransmission timer duration, it retransmits the SYN+ACK message for the first time. If it does not receive an ACK message within the retransmission timer duration during the first retransmission of the SYN+ACK message, it retransmits the SYN+ACK message for the second time. If it does not receive an ACK message within the retransmission timer duration during the second retransmission of the SYN+ACK message, it retransmits the SYN+ACK message for the third time. This process is repeated. If an ACK message is received during the eighth retransmission of the SYN+ACK message, it indicates that the first device and the second device have established a connection. If no ACK message is received after the 10th retransmission of the SYN+ACK message, the connection with the first device will be terminated.

[0234] It should be noted that the upper limit of 10 for the number of SYN+ACK message retransmissions is just an example. The upper limit of the number of SYN+ACK message retransmissions can be greater than the system default upper limit. In this embodiment, when the number of SYN+ACK message retransmissions is greater than 6 and less than 10, and an ACK message is not received within the retransmission time, the SYN+ACK message can continue to be retransmitted instead of terminating the connection with the first device.

[0235] In this embodiment of the application, when the second device loses a handshake message during the second and third handshake processes with the first device, i.e., when the SYN+ACK message or ACK message is lost, the second device determines whether to retransmit the SYN+ACK message by judging whether the ACK message is received within the retransmission timeout. When the number of retransmissions of the SYN+ACK message exceeds the retransmission limit, the connection is terminated. By performing multiple timeout retransmissions, the probability of successful transmission of the SYN+ACK message is increased.

[0236] By increasing the maximum number of retransmissions of SYN+ACK packets beyond the system default limit, the maximum number of retransmissions of SYN+ACK packets is increased. This allows the handshake packets to continue being retransmitted even when the number of retransmissions exceeds the system default limit, instead of terminating the connection with the first device, thus improving the efficiency of establishing a connection between the first and second devices.

[0237] In addition, this embodiment obtains connection configuration information from the application interface or connection configuration file. The connection configuration information includes the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations. By setting the maximum number of retransmissions in this way, the connection level can be set without changing the system's default maximum value. It can achieve retransmission optimization only for connections that apply the method of this embodiment, without affecting the default connection.

[0238]

Example 5

[0239] Please refer to Figure 13, which is a flowchart illustrating a data transmission method provided in this application.

[0240] 1301. The second device obtains the maximum number of retransmissions and the maximum duration of the SYN+ACK message.

[0241] In this embodiment, the maximum number of retransmissions of SYN+ACK packets is greater than the system default maximum value, which is the maximum number of SYN+ACK packet retransmissions allowed in a TCP connection. The maximum duration is a threshold for the duration of retransmitting SYN+ACK packets, used to limit the retransmission duration of SYN+ACK packets from exceeding the threshold within the corresponding range.

[0242] Based on the aforementioned introduction to connection configuration information in section 1101, the second device obtains the maximum number of retransmissions and the maximum duration of SYN+ACK packets from the application interface or configuration file, which will not be elaborated here.

[0243] 1302. The first device sends a SYN message to the second device.

[0244] 1303. The second device sends a SYN+ACK message to the first device.

[0245] 1304. The first device sends an ACK message to the second device.

[0246] 1305. The second device determines whether it has received an ACK packet sent by the first device within the retransmission timer's retransmission duration. If yes, the connection between the first and second devices has been established. If not, proceed to step 1306.

[0247] 1306. Determine the retransmission duration based on the number of SYN+ACK message retransmissions, the maximum number of retransmissions, and the maximum duration.

[0248] If the retransmission time exceeds the upper limit for each retransmission of the SYN+ACK packet, the second device will use the upper limit as the retransmission time for the SYN+ACK packet.

[0249] Referring to Figure 7, when the number of retransmissions of the SYN+ACK packet is less than or equal to the maximum retransmission count, and the retransmission duration is less than the maximum duration, the retransmission duration remains unchanged. When the number of retransmissions of the SYN+ACK packet is less than or equal to the maximum retransmission count, and the retransmission duration is greater than or equal to the maximum duration, the maximum duration is used as the retransmission duration for the SYN+ACK packet. When the number of retransmissions of the SYN+ACK packet is greater than the maximum retransmission count, step 1308 is executed.

[0250] 1307. Retransmit the SYN+ACK message and repeat step 1305.

[0251] 1308. Terminate the connection between the first device and the second device.

[0252] It should be noted that in this embodiment, step 1301 can be executed before step 1305, and the specific execution is not limited here.

[0253] Steps 1301 to 1305 in this embodiment are similar to steps 1101 to 1105 in the embodiment shown in Figure 11 above, and will not be described in detail here.

[0254] In this embodiment, the retransmission duration is determined based on the number of SYN+ACK packet retransmissions, the maximum number of retransmissions, and the maximum duration. By ensuring that the number of SYN+ACK packet retransmissions exceeds the system's default maximum value, the duration of each SYN+ACK packet retransmission is limited to the maximum duration. This prevents the retransmission duration of SYN+ACK packets from increasing with the number of retransmissions. By increasing the number of SYN+ACK packet retransmissions within a certain timeframe, the overall retransmission process duration is reduced, thereby improving the efficiency of establishing a connection between the first and second devices.

[0255] [Example 6] The second device retransmits the SYN+ACK message. The connection configuration information includes the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations for the SYN+ACK message.

[0256] Please refer to Figure 14, which is a flowchart illustrating a data transmission method provided in this application.

[0257] 1401. The second device obtains the maximum number of retransmissions, maximum duration, and number of retransmission optimizations for SYN+ACK packets.

[0258] Based on the aforementioned introduction to connection configuration information in section 1101, the second device obtains the maximum number of retransmissions, maximum duration, and number of retransmission optimizations for SYN+ACK packets from the application interface or configuration file. The specifics will not be elaborated here.

[0259] 1402. The first device sends a SYN message to the second device.

[0260] 1403. The second device sends a SYN+ACK message to the first device.

[0261] 1404. The first device sends an ACK message to the second device.

[0262] 1405. The second device determines whether it has received an ACK packet sent by the first device within the retransmission timer's retransmission duration. If yes, the connection between the first and second devices has been established. If not, proceed to step 1406.

[0263] 1406. Determine the retransmission duration based on the number of SYN+ACK message retransmissions, the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations.

[0264] In this embodiment, the maximum number of SYN packet retransmissions is greater than the system default maximum, which is the maximum number of SYN packet retransmissions allowed in TCP. The maximum duration is a threshold for the duration of SYN packet retransmissions, used to limit the retransmission duration of SYN packets within a given range from exceeding the threshold. The optimized retransmission count is used to divide the number of SYN packet retransmissions into different ranges, determining different retransmission durations within each range.

[0265] The following explains how the retransmission duration is determined based on the number of SYN+ACK message retransmissions, the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations.

[0266] Referring to Figure 9, when the number of retransmissions of the SYN+ACK packet is less than or equal to the retransmission optimization count, and the retransmission duration is less than or equal to the first upper limit duration, the retransmission duration remains unchanged. When the number of retransmissions of the SYN+ACK packet is less than or equal to the retransmission optimization count, and the retransmission duration is greater than the first upper limit duration, the first upper limit duration is used as the retransmission duration. When the number of retransmissions of the SYN+ACK packet is greater than the retransmission optimization count, but less than or equal to the retransmission upper limit count, the duration of the retransmitted SYN+ACK packet is the product of a preset multiple and the duration of the previous retransmitted SYN+ACK packet. When the number of retransmitted SYN+ACK packets is greater than the retransmission upper limit count, step 1408 is executed.

[0267] Referring to Figure 10, when the number of retransmissions of the SYN+ACK packet is less than or equal to the number of optimized retransmissions, and the retransmission duration is less than or equal to the first upper limit duration, the retransmission duration remains unchanged. When the number of retransmissions of the SYN+ACK packet is less than or equal to the number of optimized retransmissions, and the retransmission duration is greater than the first upper limit duration, the first upper limit duration is used as the retransmission duration. When the number of retransmissions of the SYN+ACK packet is greater than the number of optimized retransmissions, but less than or equal to the upper limit number of retransmissions, and the retransmission duration is less than or equal to the second upper limit duration, the retransmission duration remains unchanged. When the number of retransmissions of the SYN+ACK packet is greater than the number of optimized retransmissions, but less than or equal to the upper limit number of retransmissions, and the retransmission duration is greater than the second upper limit duration, the second upper limit duration is used as the retransmission duration. When the number of retransmissions of the SYN+ACK packet is greater than the upper limit number of retransmissions, step 1408 is executed.

[0268] It should be noted that Figure 7 illustrates the scenario where the retransmission duration of a SYN+ACK packet is controlled by the upper limit when the number of retransmissions does not exceed the maximum retransmission limit. Figure 9 illustrates the scenario where the retransmission duration of a SYN+ACK packet is controlled by the upper limit when the number of retransmissions does not exceed the optimized retransmission limit. Figure 10 illustrates the scenario where the retransmission duration of a SYN+ACK packet is controlled by the first upper limit when the number of retransmissions does not exceed the optimized retransmission limit, and by the second upper limit when the number of retransmissions is between the optimized and the maximum retransmission limit. This application's embodiments provide some scenarios where the retransmission duration is controlled by the upper limit when the number of retransmissions is in different ranges; other possible scenarios are not elaborated here. The trend line showing the relationship between retransmission duration and the number of retransmissions in the figures is only one possibility, and no specific limitation is made here.

[0269] 1407. Retransmit the SYN+ACK message and repeat step 1405.

[0270] 1408. Terminate the connection between the first device and the second device.

[0271] It should be noted that in this embodiment, step 1401 can be executed before step 1405, and the specific execution is not limited here.

[0272] Steps 1401 to 1405 in this embodiment are similar to steps 1101 to 1105 in the embodiment shown in Figure 11 above, and will not be described in detail here.

[0273] In this embodiment, by exceeding the maximum number of retransmissions by the optimized number of retransmissions, the number of retransmissions for SYN+ACK packets is divided into different intervals. Furthermore, the retransmission duration within each interval is adjusted using the maximum retransmission duration, enabling tiered adjustment of the retransmission duration. Simultaneously, this prevents the retransmission duration of SYN+ACK packets from continuously increasing with the number of retransmissions, thereby increasing the number of handshake packet retransmissions within a certain timeframe, reducing the overall retransmission process duration, and improving the efficiency of establishing a connection between the first and second devices.

[0274] In practical applications, connection configuration information, including the maximum number of retransmissions, maximum retransmission duration, and number of retransmission optimizations for SYN+ACK packets, is determined based on business data. This business data is the preferred data for retransmitting SYN+ACK packets, determined from historical data. For example, business data could be the most recent maximum retransmission value, the most recent optimized retransmission value, the average number of historical maximum retransmissions, or the average number of historical optimized retransmissions. Determining connection configuration information based on business data allows for setting optimal values, increasing the probability of establishing a connection between the first and second devices.

[0275] It should be noted that the connection configuration information related to the second device obtained by the first device in Examples 1 to 3 includes: the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations for SYN packets. The connection configuration information related to the first device obtained by the second device in Examples 4 to 6 includes: the maximum number of retransmissions, the maximum duration, and the number of retransmission optimizations for SYN+ACK packets. The parameters and parameter values ​​included in the connection configuration information obtained by the first device and the connection configuration information obtained by the second device can be the same or different; no specific limitation is made here.

[0276] It should be noted that embodiments 1 to 3 can be implemented by the initiator alone, embodiments 4 to 6 can be implemented by the receiver alone, or any one of embodiments 1 to 3 can be combined with any one of embodiments 4 to 6. The specifics will not be elaborated here.

[0277] Part Two: Data Transmission Phase

[0278] After the first device and the second device establish a connection through a three-way handshake, they enter the data transmission phase. During this phase, the first device and the second device exchange data packets. When a data packet is lost, the method described in this embodiment is executed for timeout retransmission, improving the reliability of the transmitted data packets. It should be noted that the first device and the second device in this section can be either the devices that established a connection through the three-way handshake mentioned above, or any two devices that have already established a connection in the network; there is no specific limitation here.

[0279] [Example 7] A data packet was lost during the transmission of a data packet from the first device to the second device.

[0280] Please refer to Figure 15, which is a flowchart illustrating a data transmission method provided in this application.

[0281] 1501. The first device obtains the optimization number of retransmissions and the upper limit of the duration for data packets.

[0282] The first device obtains connection configuration information related to the second device. The connection configuration information includes parameters involved in the transmission phase between the first and second devices, such as the number of data packet retransmission optimizations and the upper limit duration of data packet retransmission. The first device can obtain the number of retransmission optimizations and the upper limit duration related to the second device from the application interface or configuration file, similar to step 301 in the embodiment shown in Figure 3 above, and will not be described in detail here.

[0283] 1502. The first device sends a data packet to the second device.

[0284] The format of a data packet is shown in Figure 4. It should be noted that handshake packets are used during the handshake phase, while data packets are used during the data transmission phase. During connection establishment, ACK packets can carry a data portion; when an ACK packet carries a data portion, it can also be considered a data packet.

[0285] 1503. The second device sends a response message to the first device.

[0286] After receiving the data packet sent by the first device, the second device sends a response packet to the first device.

[0287] 1504. The first device determines whether a response message has been received within the retransmission timer's retransmission duration. If yes, the connection between the first device and the second device is maintained. If no, step 1505 is executed.

[0288] After sending a data packet, the first device starts its retransmission timer to determine whether a response packet from the second device has been received within the set duration of the retransmission timer. The set duration of the retransmission timer is the retransmission duration. If the first device receives a response packet within the retransmission duration, it indicates that no data packet was lost, and the connection is maintained. If the first device does not receive a response packet within the retransmission duration, step 1505 is executed.

[0289] It should be noted that the retransmission duration of each retransmission by the retransmission timer can be a fixed value or a value dynamically calculated based on the actual transmission of the message. For example, the retransmission duration can be a preset duration or a retransmission duration calculated based on the duration of the previous retransmission. No specific limitation is made here.

[0290] 1505. Determine the retransmission duration based on the number of retransmissions, the number of retransmission optimizations, and the upper limit duration of the data packet.

[0291] In this embodiment, the upper limit duration is a threshold for the duration of retransmitted data packets, used to limit the retransmission duration of data packets from exceeding the threshold within a corresponding range. If the retransmission duration exceeds the upper limit duration in each retransmission, the upper limit duration is used as the retransmission duration of the data packet. The retransmission optimization number is used to divide the number of retransmissions of data packets into different ranges, so as to determine different retransmission durations within different retransmission number ranges.

[0292] Referring to Figure 16, the determination of the retransmission duration based on the number of retransmissions, the number of retransmission optimizations, and the upper limit duration of the data packet is explained. When the number of retransmissions is less than or equal to the number of retransmission optimizations, and the retransmission duration is less than or equal to the upper limit duration, the retransmission duration remains unchanged. When the number of retransmissions is less than or equal to the number of retransmission optimizations, and the retransmission duration is greater than the upper limit duration, the upper limit duration is used as the retransmission duration. When the number of retransmissions is greater than the number of retransmission optimizations, step 1507 is executed.

[0293] 1506. Retransmit the data packet and repeat step 1504.

[0294] 1507. Retransmission time doubled, waiting for network recovery.

[0295] The retransmission duration is doubled, meaning that the duration of each retransmission is the product of a preset multiple and the duration of the previous retransmission.

[0296] For example, if the preset multiplier is 3, the first retransmission duration of the retransmission timer is 1s, then the second retransmission duration is 3s, the third retransmission duration is 9s, the fourth retransmission duration is 27s, and the fifth retransmission duration is 81s.

[0297] When the number of times the first device retransmits data packets to the second device exceeds the retransmission optimization limit and no response packet is received, it indicates that the first device has retransmitted data packets a sufficient number of times but still failed to retransmit. The current network environment is extremely poor. Doubling the retransmission duration can extend the retransmission time of each data packet, wait for the network to recover, and maintain the long connection between the first device and the second device.

[0298] 1508. The first device is disconnected from the second device.

[0299] If the number of retransmissions of data packets from the first device to the second device exceeds the retransmission optimization count, and no response message is received from the first device, it indicates that the first device has retransmitted the data packets a sufficient number of times but still failed to retransmit. The current network environment is extremely poor, and the connection with the second device can be actively disconnected to reduce the occupation of network resources.

[0300] It should be noted that in this embodiment, step 1501 can be executed before step 1505, and the specific execution is not limited here.

[0301] In this embodiment, during the data transmission phase, when the first device and the second device are transmitting data to each other, if a data packet is lost, the party that did not receive a response packet will retransmit the data packet to the other party. The party that retransmits the packet will determine whether it receives a response packet within the retransmission time. If it receives the response packet during retransmission, normal data communication between the two devices will be maintained. If it still does not receive the response packet during retransmission, it will be retransmitted again, and the retransmission time will be determined whether the condition is met. Each time a data packet is retransmitted, if the number of retransmissions does not exceed the retransmission optimization number, the retransmission time is set to not exceed the upper limit, which can increase the number of data packets sent within a certain period of time. If the number of retransmissions exceeds the retransmission optimization number, it indicates that there are too many retransmissions and the current network environment is poor. The retransmission time can be doubled or the connection can be disconnected. Doubling the retransmission time is to wait for the network to recover and maintain a long connection between the two devices. By using a retransmission mechanism between two devices, the reliability of data packet transmission is improved. The retransmission duration is determined based on the number of retransmissions, the number of retransmission optimizations, and the upper limit duration, providing a flexible way to adaptively adjust the retransmission duration so that the packet retransmission duration is more in line with the network environment.

[0302]

Example 8

[0303] Please refer to Figure 17, which is a flowchart illustrating a data transmission method provided in this application.

[0304] 1701. The first device obtains the maximum number of retransmissions of the SYN packet.

[0305] 1702. The first device sends a SYN message to the second device.

[0306] 1703. After receiving the SYN message, the second device sends a SYN+ACK message to the first device.

[0307] 1704. The first device determines whether a SYN+ACK packet has been received within the retransmission timer's retransmission duration. If yes, proceed to step 1707; otherwise, proceed to step 1705.

[0308] 1705. The first device determines whether the number of retransmissions of the SYN packet exceeds the retransmission limit. If yes, proceed to step 1712; otherwise, proceed to step 1706.

[0309] 1706. The first device retransmits the SYN message and repeats step 1704 in a loop.

[0310] 1707. The first device sends an ACK message to the second device.

[0311] 1708. The second device obtains the maximum number of retransmissions and the maximum duration of SYN+ACK packets.

[0312] 1709. The second device determines whether an ACK packet has been received within the retransmission timer's retransmission duration. If yes, proceed to step 1713; otherwise, proceed to step 1710.

[0313] The second device determines whether an ACK packet has been received within the retransmission timer's retransmission duration. If yes, the first and second devices have established a connection; otherwise, step 1710 is executed.

[0314] 1710. The second device determines the retransmission duration based on the number of retransmissions, the maximum number of retransmissions, and the maximum duration of the SYN+ACK message.

[0315] 1711. Retransmit the SYN+ACK message and repeat step 1709.

[0316] 1712. Terminate connection establishment.

[0317] 1713. The first device establishes a connection with the second device.

[0318] Through the above process, the first device and the second device establish a connection through a three-way handshake. Next, we will explain the process by having the second device send a data packet to the first device.

[0319] 1714. The second device sends a data packet to the first device.

[0320] 1715. The first device sends a response message to the second device.

[0321] The response message is a confirmation from the first device to the data packets sent by the second device.

[0322] 1716. The second device optimizes the number of retransmissions of data packets.

[0323] 1717. The second device determines whether a response message has been received within the retransmission timer's retransmission duration. If yes, proceed to step 1718. If no, proceed to step 1719.

[0324] 1718. The second device remains connected to the first device.

[0325] 1719. Determine the current retransmission duration based on the round-trip time of the data packet.

[0326] Referring to Figure 18, the case where the retransmission duration is determined based on the number of retransmission optimizations is explained. When the number of retransmissions of a data packet is greater than the number of retransmission optimizations, step 1721 is executed. When the number of retransmissions of a data packet is less than or equal to the number of retransmission optimizations, the second device determines the current retransmission duration based on the round-trip time of the retransmitted data packet.

[0327] The following explains the calculation method for determining the current retransmission duration based on the round-trip time of the retransmission.

[0328] TCP defines the time from when a packet is sent to when a reply is received as the round-trip time (RTT). RTT can be directly measured. If a packet is sent and no reply is received within the RTT period, the packet times out, and a retransmission process is initiated. The duration of the retransmission timer is called the retransmission timeout (RTO).

[0329] One method for calculating RTO based on RTT is as follows: First, sample the RTT values ​​several times, and then use a weighted moving average to calculate the smoothed round-trip time (RTTS). For example, RTTS(n) = (1-alpha)*RTTS(n-1) + alpha*RTT(n), where n is the current retransmission count, n-1 is the previous retransmission count, and when n is 1, the value of RTTS is the value of the measured RTT sample, and alpha is the smoothing factor.

[0330] Next, the Round-Trip Time Deviation (RTTD) is calculated based on RTT and RTTS. For example, RTTD(n) = (1-beta)*RTTD(n-1) + beta*|RTTS(n)-RTT(n)|, where n is the current retransmission count, n-1 is the previous retransmission count, and when n is 1, RTTD is half of the RTT sample value, and beta is the smoothing factor for calculating the deviation.

[0331] Next, RTO is calculated based on RTTS and RTTD. For example, RTO(n) = RTTS(n) + 4 * RTTD(n).

[0332] For example, assuming the initial RTT is 1.5s, alpha is 0.125, and beta is 0.25, then RTTD(1) = 0.75, RTTS(1) = 1.5s, and RTO(1) = RTTS(1) + 4 * RTTD(1) = 4.5s. During the second retransmission, the measured RTT(2) is 18s, then RTTS(2) = (1 - 0.125) × 1.5s + 18 × 2.5s = 1.625s, RTTD(2) = (1 - 0.25) × 0.75s + 0.25 × |1.625s - 2.5s| = 0.78125s, and RTO(2) = RTTS(2) + 4 * RTTD(2) = 1.625 + 4 * 0.78125 = 4.75s.

[0333] It should be noted that the method for calculating retransmission duration based on round-trip time provided above is only one algorithm provided by the embodiments of this application. Other methods for calculating retransmission duration based on round-trip time are also included, but are not limited here.

[0334] In practical applications, network fluctuations cause the RTT measured each time to change with the network fluctuations, which in turn leads to changes in the volatility of RTO. The retransmission duration shown in Figure 18 when the number of retransmissions does not exceed the number of retransmission optimizations is just one example of the fluctuation curve shown in the figure. No specific limit is made here.

[0335] 1720. The second device retransmits the data packet, and executes step 1717 repeatedly.

[0336] 1721. Retransmission time doubled, waiting for network recovery.

[0337] 1722. The second device disconnects from the first device.

[0338] It should be noted that in this embodiment, step 1701 can be executed before step 1705. Step 1708 can be executed either before or after steps 1701 to 1707, and it only needs to be executed before step 1710. Step 1716 is an execution step in the data transmission stage, and it only needs to be executed before step 1719; the specific execution is not limited here.

[0339] Steps 1701 to 1705 in this embodiment are similar to steps 301 to 305 in the embodiment shown in Figure 3 above, and will not be described in detail here. Steps 1709 to 1711 in this embodiment are similar to steps 1305 to 1307 in the embodiment shown in Figure 3 above, and will not be described in detail here.

[0340] It's important to note that during the three-way handshake, the SYN packet in the first handshake and the SYN+ACK packet in the second handshake do not carry data. The ACK packet in the third handshake carries data. Therefore, when the second device receives the ACK packet, it indicates that the connection between the first and second devices has been established. During the connection establishment phase, if either the first or second device retransmits more than the maximum retransmission limit, both devices can terminate the connection since it is not yet established. Conversely, during the data transmission phase, if either the first or second device retransmits more data packets than the maximum retransmission limit, the connection can be closed since it is already established.

[0341] This embodiment describes the retransmission of messages between the first and second devices during the handshake and transmission phases. During the three-way handshake phase, the first and second devices increase the maximum number of retransmissions and control the maximum retransmission duration by timeout retransmissions of SYN and SYN+ACK messages. This allows for sending more handshake messages in less time, improving the efficiency of establishing a connection between the first and second devices. During the data transmission phase, the first and second devices use different retransmission duration calculation methods based on the different intervals defined by the retransmission optimization count for data packets, enabling flexible adjustments to service requirements. When the retransmission count does not exceed the optimization count, the retransmission duration is kept below the maximum duration or calculated based on the round-trip time, controlling the retransmission duration to fluctuate within an optimal range. When the retransmission count exceeds the optimization count, indicating a poor network environment, the retransmission duration is doubled to wait for network recovery, maintaining a long connection, or the connection is directly disconnected.

[0342] It should be noted that embodiments 1 to 8 can be implemented individually, embodiments 1 to 3 can be implemented with the initiator, and embodiments 4 to 6 can be implemented with the receiver. Embodiment 7 can be implemented by any of the connected parties, including the initiator or the receiver. Embodiment 8 is an implementation combining embodiments 1, 5, and 7. Any one of embodiments 1 to 3, any one of embodiments 4 to 6, and embodiment 7 can be implemented in combination, and the specific combination steps are similar to those of embodiment 8, which will not be repeated here.

[0343] Please refer to Figure 19, which illustrates one embodiment of the communication device 1900 in this application, including:

[0344] The sending module 1901 is used to send a first handshake message to the second device, the first handshake message being used to request the establishment of a connection with the second device;

[0345] The retransmission module 1902 is used to retransmit the first handshake message if the second handshake message is not received. The number of times the first handshake message is retransmitted does not exceed the first retransmission count. The second handshake message is the response of the second device to the first handshake message. The first retransmission count is the upper limit of the number of times the first handshake message can be retransmitted. The first retransmission count is greater than the second retransmission count. The second retransmission count is the system default upper limit of the number of times the first handshake message can be retransmitted.

[0346] The communication device in this application embodiment can perform the operations performed by the first device in the aforementioned embodiment, and the specifics will not be repeated here.

[0347] Please refer to Figure 20. One embodiment of the communication device 2000 in this application includes:

[0348] The sending module 2001 is used to send a second handshake message to the first device after receiving the first handshake message sent by the first device. The second handshake message is a response to the first handshake message.

[0349] The retransmission module 2002 is used to retransmit the second handshake message if the third handshake message is not received. The number of times the second handshake message is retransmitted shall not exceed the fifth retransmission count, which is the upper limit of the number of times the second handshake message can be retransmitted. The fifth retransmission count is greater than the sixth retransmission count, which is the system default upper limit of the number of times the second handshake message can be retransmitted.

[0350] The communication device in this application embodiment can perform the operations performed by the second device in the aforementioned embodiment, and the specifics will not be repeated here.

[0351] Please refer to Figure 21. One embodiment of the communication device 2100 in this application includes:

[0352] The sending module 2101 is used to send a fourth data packet to the fourth device;

[0353] The retransmission module 2102 is used to retransmit the fourth data packet within a fifth time period if the fifth data packet is not received. The fifth time period is the duration for retransmitting the fourth data packet. The fifth time period is determined based on the ninth retransmission count and the retransmission count of the fourth data packet. The fifth data packet is a response to the fourth data packet. The ninth retransmission count is connection configuration information obtained by the third device. The connection configuration information is related to the fourth device.

[0354] The communication device in this application embodiment can perform the operations performed by the third device in the foregoing embodiment, and the specifics will not be repeated here.

[0355] Please refer to Figure 22. One embodiment of the communication device 2200 in this application includes:

[0356] The sending module 2201 is used to send a fifth data packet to the third device. The fifth data packet is a response to the fourth data packet sent by the third device. The fourth data packet is a retransmitted packet when the third device does not receive the fifth data packet within a fifth duration. The fifth duration is the duration for the third device to retransmit the fourth data packet. The fifth duration is determined by the third device based on the ninth retransmission count and the retransmission count of the fourth data packet. The ninth retransmission count is the connection configuration information obtained by the third device, and the connection configuration information is related to the fourth device.

[0357] The communication device in this application embodiment can perform the operations performed by the fourth device in the aforementioned embodiment, and the specifics will not be repeated here.

[0358] Please refer to Figure 23. One embodiment of the network device 2300 in this application includes:

[0359] Figure 23 is a schematic diagram of the structure of a network device provided in an embodiment of this application. The network device 2300 may include one or more central processing units (CPUs) 2301 and a memory 2305, in which one or more applications or data are stored.

[0360] The memory 2305 can be volatile or persistent storage. The program stored in the memory 2305 can include one or more modules, each module including a series of instruction operations on the server. Furthermore, the central processing unit 2301 can be configured to communicate with the memory 2305 and execute the series of instruction operations stored in the memory 2305 on the network device 2300.

[0361] The network device 2300 may also include one or more power supplies 2302, one or more wired or wireless network interfaces 2303, one or more input / output interfaces 2304, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0362] The central processing unit 2301 can perform the operations performed by the first device, the second device, the third device or the fourth device in the aforementioned embodiments, and the specifics will not be elaborated here.

[0363] This application also provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the methods described in the foregoing embodiments.

[0364] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods described in the foregoing embodiments.

[0365] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0366] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules 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, apparatuses, or modules, and may be electrical, mechanical, or other forms.

[0367] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0368] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0369] If the integrated module is implemented as a software functional module 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 application, in essence, or the part that contributes to the prior art, or all or 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 described in the various embodiments of this application. 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.

Claims

1. A data transmission method, characterized in that, Applied to the first device, including: Send a first handshake message to the second device, the first handshake message being used to request the establishment of a connection with the second device; If the second handshake message is not received, the first handshake message is retransmitted. The number of times the first handshake message is retransmitted does not exceed the first retransmission count. The second handshake message is the response of the second device to the first handshake message. The first retransmission count is the upper limit of the number of times the first handshake message can be retransmitted. The first retransmission count is greater than the second retransmission count. The second retransmission count is the system default upper limit of the number of times the first handshake message can be retransmitted.

2. The data transmission method according to claim 1, characterized in that, Before retransmitting the first handshake message, the method further includes: Obtain connection configuration information related to the second device from the application interface or configuration file, the connection configuration information including the first retransmission count.

3. The data transmission method according to claim 2, characterized in that, The connection configuration information also includes a first upper limit duration, the first duration being less than or equal to the first upper limit duration, and the first duration being the duration for retransmitting the first handshake message.

4. The data transmission method according to claim 2 or 3, characterized in that, The connection configuration information also includes a third retransmission count, which is less than the first retransmission count. The method further includes: If the number of retransmissions of the first handshake message is greater than the third retransmission number but less than or equal to the first retransmission number, and the second handshake message is not received, the first duration is the product of a preset multiple and the duration of the previous retransmission of the first handshake message.

5. The data transmission method according to claim 4, characterized in that, The method further includes: If the number of retransmissions of the first handshake message is less than or equal to the third retransmission number, and the second handshake message is not received, the first duration is less than or equal to the second upper limit duration.

6. The data transmission method according to any one of claims 1 to 5, characterized in that, The method further includes: If the number of retransmissions of the first handshake message is greater than or equal to the number of retransmissions, and the second handshake message is not received, the connection with the second device is terminated.

7. The data transmission method according to any one of claims 1 to 6, characterized in that, The method further includes: Upon receiving the second handshake message, a third handshake message is sent to the second device, the third handshake message being used to instruct the first device to establish a connection with the second device.

8. The data transmission method according to any one of claims 1 to 7, characterized in that, The connection configuration information also includes a fourth retransmission count, which is used to determine a second duration, the second duration being the retransmission duration of the data packet. After the first device and the second device establish a connection, the method further includes: Send the first data packet to the second device; If the second data packet is not received, the first data packet is retransmitted within the second time period, the second time period being determined based on the fourth retransmission count and the retransmission count of the first data packet, and the second data packet being the response of the second device to the first data packet.

9. The data transmission method according to claim 8, characterized in that, The method further includes: If the number of retransmissions of the first data packet is less than or equal to the number of retransmissions of the fourth data packet, the second duration is determined based on the round-trip time of retransmitting the first data packet.

10. The data transmission method according to claim 8, characterized in that, The method further includes: The connection configuration information also includes a third upper limit duration, wherein if the number of retransmissions of the first data packet is less than or equal to the fourth number of retransmissions, the second duration is less than or equal to the third upper limit duration.

11. The data transmission method according to claim 8, characterized in that, The method further includes: If the number of retransmissions of the first data packet is greater than the number of retransmissions of the fourth data packet, the second duration is the product of a preset multiple and the duration of the previous retransmission of the first data packet.

12. The data transmission method according to claim 8, characterized in that, The method further includes: If the number of retransmissions of the first data packet is greater than the number of retransmissions of the fourth data packet, the connection with the second device is disconnected.

13. A data transmission method, characterized in that, Applied to a second device, including: After receiving the first handshake message sent by the first device, a second handshake message is sent to the first device, the second handshake message being a response to the first handshake message; If the third handshake message is not received, the second handshake message is retransmitted. The number of times the second handshake message is retransmitted does not exceed the fifth retransmission count, which is the upper limit of the number of times the second handshake message can be retransmitted. The fifth retransmission count is greater than the sixth retransmission count, which is the system default upper limit of the number of times the second handshake message can be retransmitted.

14. The data transmission method according to claim 13, characterized in that, Before retransmitting the second handshake message, the method further includes: Obtain connection configuration information related to the first device from the application interface or configuration file, the connection configuration information including the fifth retransmission count.

15. The data transmission method according to claim 14, characterized in that, The connection configuration information also includes a fourth upper limit duration, and a third duration that is less than or equal to the fourth upper limit duration. The third duration is the duration for retransmitting the second handshake message.

16. The data transmission method according to claim 14 or 15, characterized in that, The connection configuration information also includes a seventh retransmission count, which is less than the fifth retransmission count. The method further includes: If the number of retransmissions of the second handshake message is greater than the seventh retransmission number and less than or equal to the fifth retransmission number, and the third handshake message is not received, the third duration is the product of a preset multiple and the duration of the previous retransmission of the second handshake message.

17. The data transmission method according to claim 16, characterized in that, The method further includes: If the number of retransmissions of the second handshake message is less than or equal to the seventh retransmission number, and the third handshake message is not received, the third duration is less than or equal to the fifth upper limit duration.

18. The data transmission method according to any one of claims 13 to 17, characterized in that, The method further includes: If the number of retransmissions of the second handshake message is greater than the number of retransmissions of the fifth handshake message, and the third handshake message is not received, the connection with the first device is terminated.

19. The data transmission method according to any one of claims 13 to 18, characterized in that, The connection configuration information also includes an eighth retransmission count, which is used to determine a fourth duration, the fourth duration being the retransmission duration of the data packet. After the first device and the second device establish a connection, the method further includes: Send a second data packet to the first device; If the third data packet is not received, the second data packet is retransmitted within a fourth time period, the fourth time period being determined based on the eighth retransmission count and the retransmission count of the second data packet, and the third data packet being the first device's response to the second data packet.

20. The data transmission method according to claim 19, characterized in that, The method further includes: If the number of retransmissions of the second data packet is less than or equal to the eighth retransmission number, the fourth duration is determined based on the round-trip time of retransmitting the second data packet.

21. The data transmission method according to claim 19, characterized in that, The method further includes: The connection configuration information also includes a sixth upper limit duration. If the number of retransmissions of the second data packet is less than or equal to the eighth retransmission number, the fourth duration is less than or equal to the sixth upper limit duration.

22. The data transmission method according to claim 19, characterized in that, The method further includes: If the number of retransmissions of the second data packet is greater than the number of retransmissions of the eighth data packet, the fourth duration is the product of a preset multiple and the duration of the previous retransmission of the second data packet.

23. The data transmission method according to claim 19, characterized in that, The method further includes: If the number of retransmissions of the second data packet is greater than the eighth retransmission number, the connection with the first device is disconnected.

24. A data transmission method, characterized in that, Applied to third-party devices, including: Send a fourth data packet to the fourth device; If the fifth data packet is not received, the fourth data packet is retransmitted within a fifth time period, wherein the fifth time period is the duration for retransmitting the fourth data packet, and the fifth time period is determined based on the ninth retransmission count and the retransmission count of the fourth data packet, wherein the fifth data packet is a response to the fourth data packet, and the ninth retransmission count is the connection configuration information obtained by the third device, wherein the connection configuration information is related to the fourth device.

25. The data transmission method according to claim 24, characterized in that, The connection configuration information also includes a seventh upper limit duration, wherein the fifth duration is less than or equal to the seventh upper limit duration.

26. The data transmission method according to claim 24, characterized in that, The method further includes: If the number of retransmissions of the fourth data packet is less than or equal to the number of retransmissions of the ninth data packet, the fifth duration is obtained based on the round-trip time of retransmitting the fourth data packet.

27. The data transmission method according to claim 24, characterized in that, The method further includes: If the number of retransmissions of the fourth data packet is greater than the number of retransmissions of the ninth data packet, the fifth duration is the product of a preset multiple and the duration of retransmission of the fourth data packet.

28. The data transmission method according to claim 24, characterized in that, The method further includes: If the number of retransmissions of the fourth data packet is greater than the number of retransmissions of the ninth data packet, the connection with the fourth device shall be disconnected.

29. A data transmission method, characterized in that, Applied to the fourth device, including: A fifth data packet is sent to a third device, wherein the fifth data packet is a response to the fourth data packet sent by the third device, the fourth data packet is a retransmission message when the third device does not receive the fifth data packet within a fifth time period, the fifth time period is the duration for the third device to retransmit the fourth data packet, the fifth time period is determined by the third device based on the ninth retransmission number and the retransmission number of the fourth data packet, the ninth retransmission number is the connection configuration information obtained by the third device, and the connection configuration information is related to the fourth device.

30. A network device, characterized in that, The device includes a processor coupled to a memory for storing instructions that, when executed by the processor, cause the network device to perform the method as described in any one of claims 1 to 12, or claims 13 to 23, or claims 24 to 28, or claim 29.

31. A computer program product, characterized in that, Includes code that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 12, or claims 13 to 23, or claims 24 to 28, or claim 29.

32. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, thereon stores the computer program or instructions thereon, and when the computer program or instructions are executed, they cause the computer to perform the method as described in any one of claims 1 to 12, or claims 13 to 23, or claims 24 to 28, or claim 29.

Citation Information

Patent Citations

  • Data transmitting method and associated device

    CN101808080A

  • TCP (Transmission Control Protocol) retransmission method and device

    CN109560897A

  • Message retransmission method and device

    CN117579233A

  • Managing sequence values with added headers in computing devices

    US20150312384A1