Data transmission method, device, equipment and computer readable storage medium

By using timers to manage packet transmission in network communication, the inefficiency problem caused by packet loss in high-speed data transmission is solved, and faster and more efficient data transmission is achieved.

CN115913474BActive Publication Date: 2025-02-07GUANGZHOU HEDONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211301581.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2025-02-07
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

Existing network communication technologies are prone to packet loss when sending large amounts of data at high speed, resulting in extremely low data transmission efficiency.

Method used

By starting the timer in packet transmission, if the packet is not confirmed to be sent successfully after the timer timed out, it will be resent, and the earliest unconfirmed packet is preferred when a packet jump occurs.

Benefits of technology

It effectively reduces packet loss and retransmission time, improves the efficiency and speed of data transmission, and avoids invalid repeated retransmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913474B_ABST
    Figure CN115913474B_ABST
Patent Text Reader

Abstract

The present invention relates to a data transmission method, comprising the steps of: sending a data packet, and starting a timer corresponding to the data packet one by one; receiving reception confirmation information corresponding to the data packet one by one, and marking the corresponding data packet as successfully transmitted; after the timer times out, if the corresponding data packet is not marked as successfully transmitted, retransmitting the data packet; if the number of data packets between a first data packet and a second data packet is greater than a preset number of retransmission jump packets, retransmitting the earliest data packet that is not marked as successfully transmitted, wherein the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest transmitted data packet. Compared with the prior art, when the data packet transmission fails, the method of the present application can retransmit the data packet that failed to be transmitted without having to transmit from the beginning, thereby improving the transmission efficiency of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a data transmission method, device, equipment and computer-readable storage medium. Background Art

[0002] With the development of network technology, people's work and life have an increasing demand for network data. In order to ensure people's network communication experience, it is necessary to increase the speed of network communication while transmitting large amounts of data. In existing network communication technologies, packet loss is prone to occur when sending large amounts of data at high speeds, and after packet loss occurs, all data packets need to be resent as a whole, which leads to extremely low data transmission efficiency and affects network use. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a data transmission method that can quickly establish a network connection, reduce packet loss and retransmission time, and thus improve data transmission efficiency.

[0004] The present invention is implemented by the following technical solution: A data transmission method comprises the following steps:

[0005] Sending a data packet and starting a timer corresponding to the data packet;

[0006] Receive reception confirmation information corresponding to the data packets one by one, and mark the corresponding data packets as sent successfully;

[0007] After the timer times out, if the corresponding data packet is not marked as successfully sent, the data packet is retransmitted; if the number of data packets between the first data packet and the second data packet is greater than the preset number of retransmission jump packets, the earliest data packet that is not marked as successfully sent is retransmitted, wherein the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

[0008] Compared with the prior art, the present invention provides a data transmission method that can retransmit the failed data packet without retransmitting it from the beginning when the data packet transmission fails, thereby improving the transmission efficiency of data transmission. Moreover, before the timer times out, when the data packet transmission fails or the number of packet jumps is too large, the sender can give priority to sending subsequent data packets without repeated retransmission, thereby further improving the speed and efficiency of data transmission.

[0009] Furthermore, the timing duration of the timer is the sum of the communication time and the retransmission delay, the communication time is the time for completing a request and a response in one communication, and the retransmission delay is a preset fixed value.

[0010] Furthermore, the method further comprises the steps of: obtaining the remaining capacity for receiving the data packet, and when the remaining capacity is zero, delaying the sending of subsequent data packets.

[0011] Based on the same inventive concept, the present application also provides a data transmission method, comprising the following steps:

[0012] receiving data packets, each of which is provided with a corresponding timer;

[0013] Sending reception confirmation information corresponding to the data packets one by one, wherein the data packets corresponding to the reception confirmation are marked as being sent successfully;

[0014] A retransmitted data packet is received, wherein the retransmitted data packet is a data packet that is not marked as successfully sent after the corresponding timer times out; the retransmitted data packet is the earliest data packet that is not marked as successfully sent after the timer times out, when the number of data packets between the first data packet and the second data packet is greater than a preset number of retransmission jump packets, the first data packet is the data packet corresponding to the latest reception confirmation, and the second data packet is the latest sent data packet.

[0015] Furthermore, the timing duration of the timer is the sum of the communication time and the retransmission delay, the communication time is the time for completing a request and a response in one communication, and the retransmission delay is a preset fixed value.

[0016] Furthermore, the method further comprises the steps of: obtaining the remaining capacity for receiving the data packet, and when the remaining capacity is zero, delaying the reception of subsequent data packets.

[0017] Based on the same inventive concept, the present application also provides a data transmission device, including:

[0018] A sending module, used for sending a data packet and starting a timer corresponding to each data packet;

[0019] A marking module, used for receiving reception confirmation information corresponding to the data packets one by one, and marking the corresponding data packets as being sent successfully;

[0020] A retransmission module is used to retransmit the data packet after the timer times out if the corresponding data packet is not marked as successfully sent; if the number of data packets between the first data packet and the second data packet is greater than a preset number of retransmission jump packets, retransmit the earliest data packet that is not marked as successfully sent, wherein the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

[0021] Based on the same inventive concept, the present application also provides a data transmission device, including:

[0022] A receiving module, used for receiving data packets and returning a reception confirmation corresponding to the data packets, each of which is provided with a corresponding timer;

[0023] A confirmation module, used for sending reception confirmation information corresponding to the data packets one by one, and the data packets corresponding to the reception confirmation are marked as being sent successfully;

[0024] The re-receiving module is used to receive a retransmitted data packet, wherein the retransmitted data packet is the data packet that is not marked as successfully sent after the corresponding timer times out; the retransmitted data packet is the earliest data packet that is not marked as successfully sent after the timer times out, when the number of data packets between the first data packet and the second data packet is greater than a preset number of retransmission jump packets, the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

[0025] Based on the same inventive concept, the present application also provides an electronic device, comprising: a processor, the processor is coupled to a memory, the memory is used to store a computer program, when the processor calls the computer program, the device executes the method as described above.

[0026] Based on the same inventive concept, the present application also provides a computer-readable storage medium, characterized in that it is used to store a computer program, wherein the computer program includes instructions for implementing the method as described above.

[0027] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a communication system provided by an embodiment;

[0029] Figure 2 A schematic diagram of a data transmission method according to an embodiment of the present invention;

[0030] Figure 3 is an exemplary communication flow chart between a sending end and a receiving end;

[0031] Figure 4 is an exemplary frame structure of the QRP protocol;

[0032] Figure 5 A schematic diagram of the structure of a data transmission device according to an embodiment;

[0033] Figure 6 A schematic diagram of the structure of a data transmission device according to an embodiment. DETAILED DESCRIPTION

[0034] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0035] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0037] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0038] It should be understood that the technical solution of the present application can be applied to various communication systems, such as: global system of mobile communication (GSM) system, code division multiple access (CDMA) system, wideband code division multiple access (WCDMA) system, general packet radio service (GPRS), long term evolution (LTE) system, advanced long term evolution (LTE-A) system, universal mobile telecommunication system (UMTS) or next generation communication system (e.g., fifth-generation, 5G) system), etc. Among them, the 5G system can also be called a new generation of radio access technology (NR) system.

[0039] To facilitate understanding of the embodiments of the present application, first Figure 1 A communication system applicable to an embodiment of the present application is introduced in detail.

[0040] See also Figure 1 , which is a schematic diagram of a communication system provided in an embodiment of the present application. Figure 1 As shown, the communication system includes at least two communication devices, for example, a network device 11 and at least one terminal device 12, wherein the network device 11 and the at least one terminal device 12 can communicate data via a wireless connection. Specifically, the network device 11 can send downlink data to the terminal device 12; the terminal device 12 can also send uplink data to the network device 11.

[0041] It should be understood that the network device 11 can also be called an access network device or a wireless access network device, which can be a transmission reception point (TRP), an evolved NodeB (eNB or eNodeB) in an LTE system, a home base station (for example, home evolved NodeB, or home Node B, HNB), a base band unit (BBU), or a wireless controller in a cloud radio access network (CRAN) scenario, or the network device can be a relay station, an access point, a vehicle-mounted device, a wearable device, a network device in a 5G network, or a network device in a future evolved PLMN network, etc., can be an access point (AP) in a WLAN, can be a gNB in ​​a new radio (NR) system, can be a satellite base station in a satellite communication system, etc., and the embodiments of the present application are not limited.

[0042] In a network structure, the network device may include a centralized unit (CU) node, or a distributed unit (DU) node, or a RAN device including a CU node and a DU node, or a RAN device including a control plane CU node (CU-CP node) and a user plane CU node (CU-UP node) and a DU node.

[0043] The network equipment provides services for the cell, and the terminal equipment communicates with the cell through the transmission resources (for example, frequency domain resources, or spectrum resources) allocated by the network equipment. The cell can belong to a macro base station (for example, macro eNB or macro gNB, etc.), or it can belong to a base station corresponding to a small cell. The small cell here may include: metro cell, micro cell, pico cell, femto cell, etc. These small cells have the characteristics of small coverage and low transmission power, and are suitable for providing high-speed data transmission services.

[0044] It should also be understood that the terminal device 12 may also be referred to as: user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.

[0045] The terminal device may be a device that provides voice / data connectivity to users, such as a handheld device or vehicle-mounted device with wireless connection function. At present, some examples of terminals are: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (public land mobile The embodiments of the present application do not limit this.

[0046] As an example but not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.

[0047] In addition, in the embodiments of the present application, the terminal device may also be a terminal device in an Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.

[0048] It should also be understood that Figure 1 This is a simplified schematic diagram for ease of understanding only. The communication system may also include other devices. Figure 1 Not drawn in.

[0049] It should be understood that the embodiments of the present application can be applied to a variety of different scenarios, including Figure 1 The scenario shown is, but not limited to, this scenario. Exemplarily, for uplink transmission, the above-mentioned terminal device can be used as a transmitter, and the above-mentioned network device can be used as a receiver; for downlink transmission, the above-mentioned network device can be used as a transmitter, and the above-mentioned terminal device can be used as a receiver; for other transmission scenarios, for example, data transmission between terminal devices and terminal devices, one of the terminal devices can be used as a transmitter, and the other terminal device can be used as a receiver; for another example, uplink transmission between network devices and network devices, one of the network devices can be used as a transmitter, and the other network device can be used as a receiver. Therefore, the embodiments of the present application are described below according to the transmitter and the receiver.

[0050] It should also be understood that the transmitting end in the embodiments of the present application can be replaced by a device or chip that can implement functions similar to those of the transmitting end, and the receiving end can also be replaced by a device or chip that can implement functions similar to those of the receiving end. The embodiments of the present application are not limited to this.

[0051] See also Figure 2 , which is a flow chart of a data transmission method according to an embodiment. The method comprises the steps of:

[0052] S11: The sender sends a data packet and starts a timer corresponding to each data packet;

[0053] S12: When the receiving end successfully receives the data packet, it returns the reception confirmation information corresponding to the data packet;

[0054] S13: After receiving the reception confirmation information, the sending end marks the corresponding data packet as successfully sent;

[0055] S14: After the timer times out, if the corresponding data packet is not marked as successfully sent, the sending end retransmits the data packet; if the number of data packets between the first data packet and the second data packet is greater than the preset number of retransmission jump packets, the earliest data packet that is not marked as successfully sent is retransmitted. Correspondingly, the receiving end receives the retransmitted data packet, that is, the data packet retransmitted by the sending end.

[0056] Specifically, in step S11, since each communication has an MTU (Maximum Transmission Unit), which is used to specify the maximum size of the data service unit that can be sent / received, that is, the effective load size that the sender can receive. If a single data to be transmitted is larger than the MTU, the sender slices the data to be transmitted into multiple data packets, and then sends the data to be transmitted to the receiver in packets. Each data packet has a corresponding unique identifier, such as a digital number 1, 2, 3... etc.

[0057] Each time the sender sends a data packet, a corresponding timer will be started. The timer is the time the sender waits for the corresponding data packet transmission result, and is also the retransmission delay time, which can reduce the work pressure of the sender.

[0058] The timing duration of the timer can be set according to the general time for obtaining the data packet transmission result under the current network environment. In a preferred embodiment, the timing duration of the timer is set to the sum of the communication time RTT and the retransmission delay RETRY_TIMEOUT, wherein the communication time RTT is the time for a communication to complete the request and response, that is, the difference between the response timestamp T1 of the receiving end and the request timestamp T0 of the sending end; the retransmission delay RETRY_TIMEOUT is a preset fixed value, which can be set according to actual needs. In a specific implementation, the communication time RTT can be obtained when the sending end and the receiving end perform the first handshake, that is, the request timestamp T0 is the timestamp of the time when the sending end sends the connection request, and the response timestamp T1 is the timestamp of the time when the receiving end returns the connection confirmation. As a result, the dynamically adjustable retransmission timing can better adapt to the current network environment of the communication.

[0059] In step S12, the receiving end receives the data packet sent by the sending end, and after successfully receiving the data packet, returns a reception confirmation information, i.e., a reception confirmation (ACK) packet, to notify the sending end that the data packet is successfully received. Each reception confirmation packet is provided with a corresponding unique identifier, such as a digital number 1, 2, 3, etc. The reception confirmation packet has a one-to-one correspondence with the data packet, and the reception confirmation packet can share the same identifier with the corresponding data packet.

[0060] In step S13, after receiving the reception confirmation packet returned by the receiving end, the transmitting end marks the data packet corresponding to the reception confirmation packet as successfully transmitted according to the reception confirmation packet. At the same time, the timer corresponding to the data packet marked as successfully transmitted can be cleared or cancelled.

[0061] In step S14, the first data packet is the data packet corresponding to the latest received confirmation, and the second data packet is the latest sent data packet.

[0062] After the timer times out, the sender checks whether the data packet corresponding to the timeout timer is marked as successfully sent. If it is not marked as successfully sent, it means that the receiver has not received the corresponding data packet within the timed duration, and it can be determined that the data packet has failed to be sent. At this time, the sender can initiate a retransmission request to the receiver and resend the corresponding data packet. At the same time, the sender checks the latest received reception confirmation packet and the latest sent data packet. If the number of data packets between the data packet corresponding to the current latest reception confirmation and the latest sent data packet is greater than the number of retransmission jump packets, it means that the delay of the receiver to successfully receive the data packet is too large, and the possibility of data packet transmission failure is high. At this time, the sender needs to initiate a retransmission request to the receiver and resend the earliest data packet that was not marked as successfully sent.

[0063] In an optional embodiment, the number packetNumberAck of the latest received confirmation packet and the number packetNumber of the latest sent data packet can be checked. If the difference between the number packetNumber of the latest sent data packet and the number packetNumberAck of the current latest received confirmation packet is greater than the number of retransmission jump packets LPN, the earliest data packet that was not marked as successfully sent is retransmitted. Exemplarily, the number of retransmission jump packets LPN is preset to be 2, the sending end sends data packets 1, 2, 3, 4 and 5, the receiving end successfully receives data packets 1 and 2, and after the timer of data packet 5 times out, the number of the latest received confirmation packet received by the sending end is 2. It can be seen from the number packetNumber of the latest sent data packet=5 and the number packetNumberAck of the latest received confirmation packet=2 that at this time packetNumber-packetNumberAck>LPN, and data packet 3 needs to be retransmitted.

[0064] Therefore, when a data packet fails to be transmitted, the failed data packet can be retransmitted without having to transmit it from the beginning, which improves the transmission efficiency of data transmission. In addition, before the timer times out, when a data packet fails to be transmitted or the number of packet jumps is too large, the sender can give priority to sending subsequent data packets without repeated retransmissions, which further improves the speed and efficiency of data transmission.

[0065] In addition, in a preferred embodiment, the method further includes the steps of obtaining the remaining capacity, and when the remaining capacity information indicates that the remaining capacity is 0, the sending end delays sending subsequent data packets, and the receiving end delays receiving subsequent data packets. The remaining capacity information is the receiving buffer margin of the receiving end, that is, the number of data packets that can be received in the current buffer space of the receiving end. Since the receiving end cannot continue to receive data packets and return a reception confirmation when the remaining capacity of the receiving end is 0, the transmission of subsequent data packets will fail. At this time, the sending end suspends sending data packets, which can avoid invalid transmission and retransmission, thereby improving communication efficiency and saving resources.

[0066] In the communication based on the above data transmission method, the sender and the receiver only need to perform one handshake. Compared with the communication method that requires multiple handshakes to successfully connect, it can reduce the handshake failure caused by network instability and cause data transmission delay. The following shows a communication method based on the above data transmission method, please refer to Figure 3 , which is an exemplary communication flow chart between a sending end and a receiving end. The communication method comprises the steps of:

[0067] S21: The sending end sends a connection request to the receiving end, and the receiving end returns a connection response to the sending end in response to the connection request;

[0068] The connection request is a handshake notification sent by the sender to the receiver. The receiver determines whether to return a connection response based on the handshake notification. When the receiver returns a connection response, the handshake between the sender and the receiver is successful and subsequent communication tasks can be performed.

[0069] S22: The sending end and the receiving end execute steps S11 to S14 to perform data transmission;

[0070] The sending end and the receiving end complete data transmission through the data transmission method in the above embodiment.

[0071] S23: The sending end sends a heartbeat request to the receiving end, and the receiving end returns a heartbeat response to the sending end in response to the heartbeat request;

[0072] Among them, the heartbeat request is a request initiated by the sender to maintain a continuous connection with the receiver. When the receiver returns a heartbeat response, the sender and the receiver will maintain a continuous connection. When the sender and the receiver need to continue data transmission, there is no need to re-handshake.

[0073] S24: The sending end sends a disconnection request to the receiving end, and the receiving end returns a disconnection response to the sending end in response to the connection request.

[0074] The disconnect request is a disconnect notification sent by the sender to the receiver after completing all data transmission tasks. When the receiver returns a disconnect response, the sender and the receiver are disconnected and cannot continue to interact.

[0075] Based on the above data transmission method, a communication protocol QRP is introduced below. The QRP protocol is a protocol based on the UDP protocol. The QRP protocol structure includes the application layer, session flow control layer, transport layer and network layer. The application layer is an encapsulation interface provided for user calls. For example, to send a message "hello", the QRP sending interface function can be called; the session flow control layer is used for connection, data packetization, data packetization, response mechanism, heartbeat, memory management and application data callback; the transport layer is used to use the UDP standard interface to send and receive UDP data, and call back QRP for processing after receiving the data; the network layer is used to use the IP standard interface to send and receive network data.

[0076] See also Figure 4 , which is an exemplary frame structure of the QRP protocol. The frame structure of the QRP protocol contains the information transmitted by the sender and the receiver during communication and data transmission. The information fields in the frame structure include the client ID (ClientId), session ID (SessionId), timestamp (Timestamp), status flag (Flag), command code (Command), remaining capacity (RecvWind), data packet number (packetNumber), reception confirmation packet number (packetNumberAck), fragmentation value (Fragment), data to be transmitted (Payload) and length of data to be transmitted (length).

[0077] Among them, the client ID is the unique identifier of the client. The server can identify the user's client through the client ID. When the network ID of the client's client changes due to network jitter, there is no need to re-establish the connection, which can save network resources.

[0078] The session ID is the unique identifier of the session. When the client connects to the server, the client uses the last session ID and the server automatically updates the session ID.

[0079] The timestamp is the time of each message transmission, in milliseconds, and can be used to synchronize the time between the client and the server.

[0080] The status flag is used to indicate the status of the current transmission data. Exemplarily, the status flag can be an 8-bit code, and its format is shown in the following table, wherein, when the second bit (Bit1) is 0, it indicates that the message is sent by the server; when the second bit (Bit1) is 1, it indicates that the message is sent by the client. When the third bit (Bit2) is 0, it indicates that no connection is established between the client and the server; when the third bit (Bit2) is 1, it indicates that a connection has been established between the client and the server. When the fourth bit (Bit3) is 0, it indicates that the communication between the client and the server is normal; when the fourth bit (Bit3) is 1, it indicates that the server requires the client to reconnect. The format of the aforementioned status flag encoding is merely exemplary, and those skilled in the art can select any encoding bit to represent various message states, and arbitrarily set the encoding value to represent the attributes of various states.

[0081]

[0082] The command code is used to indicate the current communication task. Exemplarily, the command code can be any value from 0 to 7, which is represented as shown in the following table, where when the command code is 0, it indicates that the current communication is a connection request sent by the client to the server; when the command code is 1, it indicates that the current communication is a connection request response returned by the server to the client; when the command code is 2, it indicates that the current communication is a disconnection request sent by the client to the server; when the command code is 3, it indicates that the current communication is a disconnection request response returned by the server to the client; when the command code is 4, it indicates that the current communication is a heartbeat sent by the client to the server; when the command code is 5, it indicates that the current communication is a heartbeat response returned by the server to the client; when the command code is 6, it indicates that the current communication is a message publishing request sent by the client to the server; when the command code is 7, it indicates that the current communication is a message publishing request response returned by the server to the client.

[0083]

[0084]

[0085] The remaining capacity is the receiving buffer margin of the server, that is, the number of received data packets. When the remaining capacity is 0, the client can automatically delay sending data packets, such as delaying 100ms to send data packets.

[0086] The data packet number is a unique identifier of the data packet sent by the data sender.

[0087] The reception confirmation packet number is a unique identifier of the reception confirmation packet returned by the data receiving end.

[0088] The split quantity value is the packet sequence number of the data to be transmitted.

[0089] The data to be transmitted is the data to be transmitted between the server and the client.

[0090] The length of the data to be transmitted is the size of the data to be transmitted between the server and the client.

[0091] Based on the same inventive concept, the present application also provides a data transmission device 10. Figure 5 , which is a structural schematic diagram of a data transmission device of an embodiment, the device includes a sending module 11, a marking module 12 and a retransmission module 13, wherein the sending module 11 is used to send a data packet and start a timer corresponding to the data packet; the marking module 12 is used to receive a reception confirmation corresponding to the data packet when the data packet is successfully received, and mark the corresponding data packet as successfully sent; the retransmission module 13 is used to retransmit the data packet if the corresponding data packet is not marked as successfully sent after the timer times out; if the number of data packets between the first data packet and the second data packet is greater than the number of retransmission jump packets, the earliest data packet that is not marked as successfully sent is retransmitted, wherein the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

[0092] In a preferred embodiment, a delay module 14 is further included. The delay module 14 is used to obtain the remaining capacity that can be received by the data packet, and when the remaining capacity is zero, delay the sending of subsequent data packets.

[0093] Based on the same inventive concept, the present application also provides another data transmission device 20. Figure 6 , which is a structural schematic diagram of a data transmission device of an embodiment, the device includes a receiving module 21, a confirmation module 22 and a re-receiving module 23, wherein the receiving module 21 is used to receive data packets and return a reception confirmation corresponding to the data packets one by one, and each of the data packets is provided with a corresponding timer; the confirmation module 22 is used to send a reception confirmation corresponding to the data packets one by one, and the data packet corresponding to the reception confirmation is marked as successfully sent; the re-receiving module 23 is used to receive a retransmitted data packet, and the retransmitted data packet is the data packet that is not marked as successfully sent after the corresponding timer times out; the retransmitted data packet is the earliest data packet that is not marked as successfully sent when the number of data packets between the first data packet and the second data packet is greater than the number of retransmission jump packets after the timer times out, the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

[0094] In a preferred embodiment, a delay module 24 is further included. The delay module 24 is used to obtain the remaining capacity for receiving the data packet, and when the remaining capacity is zero, delay the reception of subsequent data packets.

[0095] Those skilled in the art can understand that the device 10 can be specifically the sending end in the above-mentioned data transmission method embodiment, and the device 10 can be used to execute the various processes and / or steps corresponding to the sending end in the above-mentioned data transmission method; the device 20 can be specifically the receiving end in the above-mentioned data transmission method embodiment, and the device 20 can be used to execute the various processes and / or steps corresponding to the receiving end in the above-mentioned data transmission method. To avoid repetition, it will not be repeated here.

[0096] It should be understood that the apparatus 10 and the apparatus 20 herein are embodied in the form of functional modules. The term "module" herein may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0097] The above-mentioned apparatus 10 and apparatus 20 have the function of implementing the corresponding steps in the above-mentioned method; the above-mentioned functions can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions.

[0098] In the embodiments of the present application, the device 10 and the device 20 may also be a chip or a chip system, such as a system on chip (SoC), which is not limited in the present application.

[0099] Based on the same inventive concept, the present application also provides an electronic device. The electronic device includes a processor, a transceiver and a memory. The processor, the transceiver and the memory communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to send signals and / or receive signals.

[0100] It should be understood that the electronic device can be specifically the transmitting end or receiving end in the above-mentioned embodiment, or the function of the transmitting end or receiving end in the above-mentioned embodiment can be integrated in the electronic device, and the electronic device can be used to execute the various steps and / or processes corresponding to the transmitting end or receiving end in the above-mentioned embodiment. Optionally, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type. The processor can be used to execute instructions stored in the memory, and when the processor executes the instruction, the processor can execute the various steps and / or processes corresponding to the terminal device or network device in the above-mentioned method embodiment.

[0101] It should be understood that in the embodiments of the present application, the processor is a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0102] In the implementation process, each step of the above-mentioned data transmission method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above-mentioned method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0103] The present application provides a computer-readable storage medium, which is used to store a computer program. The computer program is used to implement the data transmission method shown in various possible implementations in the above embodiments.

[0104] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be

[0106] Implemented by other means. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0108] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data transmission method, characterized in that: The steps include: Sending a data packet and starting a timer corresponding to the data packet; Receive reception confirmation information corresponding to the data packets one by one, and mark the corresponding data packets as sent successfully; After the timer times out, if the corresponding data packet is not marked as successfully sent, the data packet is retransmitted; if the number of data packets between the first data packet and the second data packet is greater than the preset number of retransmission jump packets, the earliest data packet that is not marked as successfully sent is retransmitted, wherein the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

2. The method according to claim 1, characterized in that: The timing duration of the timer is the sum of the communication time and the retransmission delay, the communication time is the time it takes for one communication to complete a request and a response, and the retransmission delay is a preset fixed value.

3. The method according to claim 1, characterized in that: The method also includes the steps of: obtaining the remaining capacity for receiving the data packet, and when the remaining capacity is zero, delaying the sending of subsequent data packets.

4. A data transmission method, characterized in that: The steps include: receiving data packets, each of which is provided with a corresponding timer; Sending reception confirmation information corresponding to the data packets one by one, wherein the data packets corresponding to the reception confirmation are marked as being sent successfully; A retransmitted data packet is received, wherein the retransmitted data packet is a data packet that is not marked as successfully sent after the corresponding timer times out; the retransmitted data packet is the earliest data packet that is not marked as successfully sent after the timer times out, when the number of data packets between the first data packet and the second data packet is greater than a preset number of retransmission jump packets, the first data packet is the data packet corresponding to the latest reception confirmation, and the second data packet is the latest sent data packet.

5. The method according to claim 4, characterized in that: The timing duration of the timer is the sum of the communication time and the retransmission delay, the communication time is the time it takes for one communication to complete a request and a response, and the retransmission delay is a preset fixed value.

6. The method according to claim 4, characterized in that: The method also includes the steps of: obtaining the remaining capacity for receiving the data packet, and when the remaining capacity is zero, delaying the reception of subsequent data packets.

7. A data transmission device, characterized in that: include: A sending module, used for sending a data packet and starting a timer corresponding to each data packet; A marking module, used for receiving reception confirmation information corresponding to the data packets one by one, and marking the corresponding data packets as being sent successfully; A retransmission module is used to retransmit the data packet after the timer times out if the corresponding data packet is not marked as successfully sent; if the number of data packets between the first data packet and the second data packet is greater than a preset number of retransmission jump packets, retransmit the earliest data packet that is not marked as successfully sent, wherein the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

8. A data transmission device, characterized in that: include: A receiving module, used for receiving data packets and returning a reception confirmation corresponding to the data packets, each of which is provided with a corresponding timer; A confirmation module, used for sending reception confirmation information corresponding to the data packets one by one, and the data packets corresponding to the reception confirmation are marked as being sent successfully; The re-receiving module is used to receive a retransmitted data packet, wherein the retransmitted data packet is the data packet that is not marked as successfully sent after the corresponding timer times out; the retransmitted data packet is the earliest data packet that is not marked as successfully sent after the timer times out, when the number of data packets between the first data packet and the second data packet is greater than a preset number of retransmission jump packets, the first data packet is the data packet corresponding to the current latest reception confirmation, and the second data packet is the current latest sent data packet.

9. An electronic device, characterized in that: include: A processor, wherein the processor is coupled to a memory, wherein the memory is used to store a computer program, and when the processor calls the computer program, the electronic device executes the method as claimed in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, the computer program comprising instructions for implementing the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data transmitting method, a data sending method and a data receiving method

    CN101645883A

  • Data packet retransmission method, device and equipment

    CN110213024A