CN115913474A - Data transmission method, device, equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN115913474A
CN115913474A CN202211301581.3A CN202211301581A CN115913474A CN 115913474 A CN115913474 A CN 115913474A CN 202211301581 A CN202211301581 A CN 202211301581A CN 115913474 A CN115913474 A CN 115913474A
Authority
CN
China
Prior art keywords
data packet
data
timer
packets
receiving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211301581.3A
Other languages
Chinese (zh)
Inventor
薛柯利
曾义
杜其昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Hedong Technology Co ltd
Original Assignee
Guangzhou Hedong Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Hedong Technology Co ltd filed Critical Guangzhou Hedong Technology Co ltd
Priority to CN202211301581.3A priority Critical patent/CN115913474A/en
Publication of CN115913474A publication Critical patent/CN115913474A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Communication Control (AREA)

Abstract

The invention relates to a data transmission method, which comprises the following steps: sending a data packet and starting a timer which corresponds to the data packet one by one; receiving confirmation information corresponding to the data packets one by one, and marking the corresponding data packets as successful sending; after the timer is overtime, if the corresponding data packet is not marked as successful transmission, retransmitting the data packet; and if the number of data packets separated by a first data packet and a second data packet is greater than the preset retransmission skip number, retransmitting the data packet which is not marked as successful transmission at the earliest time, wherein the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is sent latest at present. Compared with the prior art, the method can retransmit the data packet with failed transmission when the data packet fails to be transmitted, and does not need to be transmitted from the beginning, so that the transmission efficiency of data transmission is improved.

Description

Data transmission method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a data transmission method, apparatus, device, and computer-readable storage medium.
Background
With the development of network technology, the data volume demand of people on networks in work and life is increased, and in order to ensure the network communication experience of people, the speed of network communication needs to be increased while the transmission data volume is large. In the existing network communication technology, when a large amount of data is sent at a high speed, a packet loss phenomenon easily occurs, and all data packets need to be retransmitted integrally after the packet loss phenomenon occurs, which causes that the efficiency of data transmission is extremely low, and the network use is influenced.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a data transmission method which can quickly establish network connection and reduce packet loss retransmission time, thereby improving the data transmission efficiency.
The invention is realized by the following technical scheme: a data transmission method, comprising the steps of:
sending a data packet and starting a timer which corresponds to the data packet one by one;
receiving confirmation information corresponding to the data packets one by one, and marking the corresponding data packets as successful sending;
after the timer is overtime, if the corresponding data packet is not marked as successful transmission, retransmitting the data packet; and if the number of data packets separated by a first data packet and a second data packet is greater than the preset retransmission skip number, retransmitting the data packet which is not marked as successful transmission at the earliest time, wherein the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is sent latest at present.
Compared with the prior art, the data transmission method provided by the invention can be used for retransmitting the data packet with failed transmission when the data packet fails to be transmitted, so that the data packet does not need to be transmitted from the beginning, and the transmission efficiency of data transmission is improved. And before the timer is overtime, when the data packet transmission fails or the number of the hop packets is overlarge, the sending end can send the subsequent data packets preferentially without repeated retransmission, thereby further improving the speed and the efficiency of data transmission.
Further, the timing duration of the timer is the sum of communication time and retransmission delay, the communication time is the time for completing a request and a response of one-time communication, and the retransmission delay is a preset fixed value.
Further, the method also comprises the following steps: and acquiring the residual capacity of the data packet which can be received, and when the residual capacity is zero, delaying to send a subsequent data packet.
Based on the same inventive concept, the application also provides a data transmission method, which comprises the following steps:
receiving data packets, wherein each data packet is provided with a corresponding timer;
sending receiving confirmation information corresponding to the data packets one by one, wherein the data packets corresponding to the receiving confirmation are marked as being successfully sent;
receiving a retransmission data packet, wherein the retransmission data packet is the data packet which is not marked as being successfully transmitted after the corresponding timer is overtime; and after the timer is overtime, under the condition that the number of data packets separated by a first data packet and a second data packet is greater than the preset number of retransmission skip packets, the first data packet is not marked as a data packet which is successfully transmitted at the earliest, the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
Further, the timing duration of the timer is the sum of communication time and retransmission delay, the communication time is the time for completing a request and a response of one-time communication, and the retransmission delay is a preset fixed value.
Further, the method also comprises the following steps: and acquiring the residual capacity of the data packet which can be received, and delaying to receive the subsequent data packet when the residual capacity is zero.
Based on the same inventive concept, the present application further provides a data transmission apparatus, comprising:
the sending module is used for sending data packets and starting timers which are in one-to-one correspondence with the data packets;
the marking module is used for receiving the receiving confirmation information corresponding to the data packets one by one and marking the corresponding data packets as successful sending;
the retransmission module is used for retransmitting the data packet if the corresponding data packet is not marked as successful transmission after the timer is overtime; and if the number of data packets separated by a first data packet and a second data packet is greater than the preset retransmission skip number, retransmitting the data packet which is not marked as being successfully transmitted at the earliest time, wherein the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
Based on the same inventive concept, the present application further provides a data transmission apparatus, comprising:
the receiving module is used for receiving data packets and returning receiving confirmation corresponding to the data packets one by one, and each data packet is provided with a corresponding timer;
the confirmation module is used for sending receiving confirmation information corresponding to the data packets one by one, and the data packets corresponding to the receiving confirmation are marked as being successfully sent;
a re-receiving module, configured to receive a re-sent data packet, where the re-sent data packet is the data packet that is not marked as being successfully sent after the corresponding timer expires; and after the timer is overtime, under the condition that the number of data packets separated by a first data packet and a second data packet is greater than the preset number of retransmission skip packets, the first data packet is not marked as a data packet which is successfully transmitted at the earliest, the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
Based on the same inventive concept, the present application further provides an electronic device, comprising: a processor coupled to a memory for storing a computer program that, when invoked by the processor, causes the apparatus to perform the method as described above.
Based on the same inventive concept, the present application also provides a computer-readable storage medium, characterized by storing a computer program comprising instructions for implementing the method as described above.
For a better understanding and practice, the invention is described in detail below with reference to the accompanying drawings.
Drawings
Fig. 1 is a schematic diagram of a communication system provided by an embodiment;
FIG. 2 is a flow diagram illustrating a data transmission method according to an embodiment;
fig. 3 is a flowchart illustrating an exemplary communication between a transmitting end and a receiving end;
fig. 4 is a frame structure of an exemplary QRP protocol;
FIG. 5 is a schematic diagram of a data transmission apparatus according to an embodiment;
fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not necessarily used to describe a particular order or sequence, nor are they to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as the case may be. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
It should be understood that the technical solution of the present application can be applied to various communication systems, for example: a global system for mobile communications (GSM) system, a Code Division Multiple Access (CDMA) system, a Wideband Code Division Multiple Access (WCDMA) system, a General Packet Radio Service (GPRS), a Long Term Evolution (LTE) system, an advanced long term evolution (LTE-a) system, a Universal Mobile Telecommunications System (UMTS), or a next generation communication system (e.g., a fifth-generation communication (5G) system), etc. Among them, the 5G system may also be referred to as a new radio access technology (NR) system.
For the understanding of the embodiments of the present application, a detailed description will be given of a communication system suitable for the embodiments of the present application with reference to fig. 1.
Please refer to fig. 1, which is a diagram illustrating a communication system according to an embodiment of the present application. As shown in fig. 1, the communication system includes at least two communication devices, for example, a network device 11 and at least one terminal device 12, wherein data communication can be performed between the network device 11 and the at least one terminal device 12 through a wireless connection. Specifically, the network device 11 may send downlink data to the terminal device 12; terminal device 12 may also send upstream data to network device 11.
It should be understood that the network device 11 may also be referred to as an access network device or a radio access network device, and may be a Transmission Reception Point (TRP), an evolved Node B (eNB or eNodeB) in an LTE system, a home base station (e.g., home evolved Node B, or home Node B, HNB), a baseband unit (BBU), a wireless controller in a Cloud Radio Access Network (CRAN) scenario, or the network device may 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, or the like, may be an Access Point (AP) in a WLAN, may be a gbb in a New Radio (NR) system, may be a satellite base station in a satellite communication system, and the like, which the present embodiment is not limited.
In one network configuration, a network device may comprise a Centralized Unit (CU) node, or a Distributed Unit (DU) node, or a RAN device comprising CU and DU nodes, or a control plane CU node (CU-CP node) and a user plane CU node (CU-UP node) and a RAN device of a DU node.
The network device provides a service for a cell, and a terminal device communicates with the cell through a transmission resource (for example, a frequency domain resource or a spectrum resource) allocated by the network device, where the cell may belong to a macro base station (for example, a macro eNB or a macro gNB), and may also belong to a base station corresponding to a small cell (small cell), where the small cell may include: urban cells (metro cells), micro cells (pico cells), femto cells (pico cells), and the like, and these small cells have the characteristics of small coverage area and low transmission power, and are suitable for providing high-rate data transmission services.
It should also be understood that terminal device 12 may also be referred to as: user Equipment (UE), mobile Station (MS), mobile Terminal (MT), access terminal, subscriber unit, subscriber station, mobile station, remote terminal, mobile device, user terminal, wireless communication device, user agent, or user device, etc.
The terminal device may be a device providing voice/data connectivity to a user, e.g. a handheld device, a vehicle mounted device, etc. with wireless connectivity. Currently, some examples of terminals are: mobile phone (mobile phone), tablet computer, notebook computer, palm computer, mobile Internet Device (MID), wearable device, virtual Reality (VR) device, augmented Reality (AR) device, wireless terminal in industrial control (industrial control), wireless terminal in unmanned driving (self driving), wireless terminal in remote surgery (remote medical supply), wireless terminal in smart grid (smart grid), wireless terminal in transportation security (transportation security), wireless terminal in city (smart city), wireless terminal in home (smart home), cellular phone, cordless phone, smart session initiation protocol (session initiation protocol), SIP) phone, wireless Local Loop (WLL) station, personal Digital Assistant (PDA), handheld device with wireless communication function, computing device or other processing device connected to wireless modem, vehicle-mounted device, wearable device, terminal device in 5G network or terminal device in Public Land Mobile Network (PLMN) for future evolution, etc., which is not limited by the embodiments of the present application.
By way of example and not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable equipment can also be called wearable intelligent equipment, is the general term of applying wearable technique to carry out intelligent design, develop the equipment that can dress to daily wearing, like glasses, gloves, wrist-watch, dress and shoes etc.. The wearable device may be worn directly on the body or may be a portable device integrated into the user's clothing or accessory. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The generalized wearable smart device includes full functionality, large size, and can implement full or partial functionality without relying on a smart phone, such as: smart watches or smart glasses and the like, and only focus on a certain type of application function, and need to be matched with other equipment such as a smart phone for use, such as various smart bracelets for physical sign monitoring, smart jewelry and the like.
In addition, in the embodiment of the present application, the terminal device may also be a terminal device in an internet of things (IoT) system, where IoT is an important component of future information technology development, and a main technical feature of the present application is to connect an article with a network through a communication technology, so as to implement an intelligent network with interconnected human-computer and interconnected objects.
It should also be understood that fig. 1 is a simplified schematic diagram that is shown only for ease of understanding, and that other devices, not shown in fig. 1, may also be included in the communication system.
It should be understood that the embodiments of the present application may be applied to a plurality of different scenarios, including the scenario shown in fig. 1, but not limited to this scenario. For example, for uplink transmission, the terminal device may serve as a sending end, and the network device may serve as a receiving end; for downlink transmission, the network device may serve as a sending end, and the terminal device may serve as a receiving end; for other transmission scenarios, for example, data transmission between terminal devices, one of the terminal devices may serve as a sending end, and the other terminal device may serve as a receiving end; for another example, in uplink transmission between network devices, one of the network devices may serve as a sending end, and the other network device may serve as a receiving end. Therefore, the following describes the embodiments of the present application in terms of a transmitting end and a receiving end.
It should also be understood that, in this embodiment of the present application, a sending end may be replaced with a device or a chip that can implement a function similar to that of the sending end, and a receiving end may also be replaced with a device or a chip that can implement a function similar to that of the receiving end, which is not limited in this embodiment of the present application.
Please refer to fig. 2, which is a flowchart illustrating a data transmission method according to an embodiment. The method comprises the following steps:
s11: a sending end sends a data packet and starts a timer which corresponds to the data packet one by one;
s12: when the receiving end successfully receives the data packet, returning receiving confirmation information corresponding to the data packet one by one;
s13: after receiving the receiving confirmation information, the sending end marks the corresponding data packet as successful sending;
s14: after the timer is overtime, if the corresponding data packet is not marked as successful, the sending end retransmits the data packet; and if the number of the data packets separated by the first data packet and the second data packet is greater than the preset retransmission skip number, retransmitting the data packet which is not marked as successful transmission at the earliest. Correspondingly, the receiving end receives the retransmitted data packet, namely, the data packet retransmitted by the transmitting end.
Specifically, in step S11, since there is a MTU (Maximum Transmission Unit) for each communication, it is used to specify the Maximum size of the service Unit capable of transmitting/receiving data, i.e., the size of the payload that can be received by the transmitting end. If the single data to be transmitted is larger than the MTU, the transmitting end slices the data to be transmitted into a plurality of data packets, and then transmits the data to be transmitted to the receiving end according to the packets, wherein each data packet is provided with a corresponding unique identifier, such as a numerical number 1,2,3.
When the sending end sends a data packet, a corresponding timer is started, the timer is the time for the sending end to wait for the transmission result of the corresponding data packet, and is also the retransmission delay time, so that the working pressure of the sending end can be relieved.
The timing duration of the timer can be set according to the general time obtained by the data packet transmission result under the current network environment. In a preferred embodiment, the timing duration of the timer is set to be the sum of a communication time RTT and a retransmission delay RETRY _ TIMEOUT, where the communication time RTT is a time when a request and a response are completed for one communication, that is, a difference between a response timestamp T1 of the receiving end and a request timestamp T0 of the transmitting end; the retransmission delay RETRY _ TIMEOUT is a preset fixed value and can be set according to actual requirements. In a specific implementation, the communication time RTT can be obtained when the sending end and the receiving end perform a first handshake, that is, the request timestamp T0 is a timestamp of a time when the sending end sends a connection request, and the response timestamp T1 is a timestamp of a time when the receiving end returns a connection confirmation. Therefore, the dynamically adjustable retransmission timing can be better adapted to the network environment under the condition of communication.
In step S12, the receiving end receives the data packet sent by the sending end, and after the data packet is successfully received, returns a reception acknowledgement message, i.e. an Acknowledgement (ACK) packet, for notifying the sending end that the data packet is successfully received. Each received acknowledgement packet is provided with a corresponding unique identifier, such as the number 1,2,3. The reception acknowledgement packet has a one-to-one correspondence with the data packet, and the reception acknowledgement packet may share the same identifier with the corresponding data packet.
In step S13, after receiving the reception acknowledgement packet returned by the receiving end, the sending end marks the data packet corresponding to the reception acknowledgement packet according to the reception acknowledgement packet, and marks the data packet as a successful sending. Meanwhile, the timer corresponding to the data packet marked as successful transmission can be cleared or cancelled.
In step S14, the first data packet is a data packet corresponding to the current latest reception acknowledgement, and the second data packet is a data packet sent latest currently.
After the timer is overtime, the sending end checks whether the data packet corresponding to the overtime timer is marked as successful sending, if not, the sending end indicates that the receiving end does not receive the corresponding data packet within the timing duration, and can judge that the data packet is failed to be sent, and at the moment, the sending end can initiate a retransmission request to the receiving end to retransmit the corresponding data packet. Meanwhile, the sending end 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 retransmission skip number, it indicates that the delay of the receiving end successfully receiving the data packet is too large, the probability of data packet transmission failure is high, at this moment, the sending end needs to initiate a retransmission request to the receiving end, and retransmit the data packet which is not marked as successful in sending at the earliest.
In an optional embodiment, the check may be performed through the number packetNumberAck of the latest receiving acknowledgment packet and the number packetNumber of the latest sending data packet, and if the difference between the number packetNumber of the latest sending data packet and the number packetNumberAck of the current latest receiving acknowledgment packet is greater than the number LPN of retransmission hop packets, the data packet that is not marked as being successfully sent at the earliest is retransmitted. Illustratively, the number LPN =2 of retransmission hops is preset, the transmitting end transmits a data packet 1, a data packet 2, a data packet 3, a data packet 4, and a data packet 5, the receiving end successfully receives the data packet 1 and the data packet 2, after a timer of the data packet 5 expires, a number of a latest reception acknowledgement packet received by the transmitting end is 2, and as the number packetNumber =5 of the latest transmission data packet, the number packetnumbera =2 of the latest reception acknowledgement packet is known, at this time, packetNumber-packetnumbera > LPN, and the data packet 3 needs to be retransmitted.
Therefore, when the data packet transmission fails, the data packet with the transmission failure can be retransmitted without being transmitted from the beginning, and the transmission efficiency of the data transmission is improved. And before the timer is overtime, when the data packet transmission fails or the number of the hop packets is overlarge, the sending end can send the subsequent data packets preferentially without repeated retransmission, thereby further improving the speed and the efficiency of data transmission.
Furthermore, in a preferred embodiment, the method further comprises the steps of: and acquiring the residual capacity, wherein when the residual capacity information indicates that the residual capacity is 0, the sending end transmits the subsequent data packet in a delayed manner, and the receiving end receives the subsequent data packet in a delayed manner. The remaining capacity information is the receiving buffer margin of the receiving end, that is, the number of the packets that can be received in the current buffer space of the receiving end. When the residual capacity of the receiving end is 0, the receiving end cannot continue to receive the data packet and return a reception confirmation, which causes the transmission failure of the subsequent data packet, and at this time, the transmitting end suspends the transmission of the data packet, so that the invalid transmission and the retransmission can be avoided, thereby improving the communication efficiency and saving the resources.
In the communication based on the data transmission method, the sending end and the receiving end only need to perform one-time handshake, and compared with a communication method which needs multiple handshakes to be successfully connected, the data transmission delay caused by handshake failure due to network instability can be reduced. A communication method based on the above data transmission method is shown below, please refer to fig. 3, which is an exemplary communication flow chart between a transmitting end and a receiving end. The communication method includes the steps of:
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;
the connection request is a handshake notification sent by the sending end to the receiving end, the receiving end determines whether to return a connection response according to the handshake notification, and when the receiving end returns the connection response, the sending end and the receiving end successfully handshake, and a subsequent communication task can be performed.
S22: the sending end and the receiving end execute the steps S11 to S14 to carry out data transmission;
the sending end and the receiving end complete data transmission through the data transmission method in the above embodiment.
S23: the sending end sends a heartbeat request to the receiving end, and the receiving end responds to the heartbeat request and returns a heartbeat response to the sending end;
the heartbeat request is a request initiated by the sending end for maintaining a continuous connection state with the receiving end, when the receiving end returns a heartbeat response, the continuous connection state is maintained between the sending end and the receiving end, and when data transmission needs to be continued between the sending end and the receiving end, re-handshaking is not needed.
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.
The disconnection request is a disconnection notification sent to the receiving end after the sending end completes all data transmission tasks, and when the receiving end returns a disconnection response, the sending end and the receiving end are disconnected and cannot continue to interact.
Based on the above data transmission method, a communication protocol QRP is introduced below. The QRP protocol is a protocol based on UDP, the QRP protocol structure comprises an application layer, a session flow control layer, a transmission layer and a network layer, wherein the application layer is an encapsulation interface for a user to call, such as a message sending message 'hello', and a QRP sending interface function can be called; the session flow control layer is used for connection, data sub-packaging, data packaging, a response mechanism, heartbeat, memory management and application data callback; the transmission layer is used for transmitting and receiving UDP data by using a UDP standard interface and calling back QRP (QRP) processing after receiving the data; the network layer is used for receiving and transmitting network data by using an IP standard interface.
Please refer to fig. 4, which shows an exemplary frame structure of the QRP protocol. The frame structure of the QRP protocol contains information transmitted by a transmitting end and a receiving end in communication data transmission, and information fields in the frame structure include a client ID (ClientId), a session ID (SessionId), a Timestamp (Timestamp), a status Flag (Flag), a Command code (Command), a remaining capacity (RecvWind), a packet number (packetNumber), a reception acknowledgement packet number (packetNumber), a fragmentation value (Fragment), data to be transmitted (Payload), and a data length to be transmitted (length).
The client ID is the unique identification of the client, the server can identify the client of the user through the client ID, and when the network ID of the client where the client is located changes due to network jitter disconnection, connection does not need to be reestablished, so that network resources can be saved.
The session ID is the unique identification of the session, when the client is connected with the server, the client uses the last session ID, and the server automatically updates the session ID.
The timestamp is the time of each transmission of the message, in ms, that can be used to synchronize the client with the server.
The status flag is used to indicate the status of the currently transmitted data. Illustratively, the status flag may be 8-Bit coded, and its format is shown in the following table, where when the second Bit (Bit 1) is 0, it indicates that the message is sent by the server; when the second Bit (Bit 1) is 1, it indicates that the message is sent by the client. When the third Bit (Bit 2) is 0, the connection between the client and the server is not established; when the third Bit (Bit 2) is 1, it indicates that a connection has been established between the client and the server. When the fourth Bit (Bit 3) is 0, the communication between the client and the server is normal; and when the fourth Bit (Bit 3) is 1, the server requires the client to reconnect. The format of the foregoing status flag encoding is merely exemplary, and one skilled in the art can select any encoding bit to represent various message statuses, and set any encoding value to represent the attributes of various types of statuses.
Figure BDA0003904945640000091
The command code is used to indicate the current communication task. Illustratively, the command code may be any one of values from 0 to 7, which is represented in the following table, where when the command code is 0, it represents that the current communication is a connection request sent by the client to the server; when the command code is 1, the current communication is a link request response returned to the client by the server; when the command code is 2, the current communication is that the client sends a disconnection request to the server; when the command code is 3, the current communication is a disconnection request response returned to the client by the server; when the command code is 4, the current communication is the heartbeat sent from the customer service end to the service end; when the command code is 5, the current communication is a heartbeat response returned to the client by the server; when the command code is 6, the current communication is a message issuing request sent by the client to the server; when the command code is 7, the current communication is a published message request response returned to the client by the server.
Figure BDA0003904945640000092
Figure BDA0003904945640000101
The residual capacity is the receiving buffer margin of the service end, namely the receiving data packet number margin. When the remaining capacity is 0, the client may automatically delay sending the data packet, for example, delay sending the data packet by 100 ms.
The data packet number is a unique data packet identifier sent by the data sending end.
The receiving confirmation packet number is the unique identification of the receiving confirmation packet returned by the data receiving end.
The segmentation quantity value is the packet sequence number of the data to be transmitted.
The data to be transmitted is the data to be transmitted between the server and the client.
The length of the data to be transmitted is the size of the data to be transmitted between the server and the client.
Based on the same inventive concept, the application also provides a data transmission device 10. Please refer to fig. 5, which is a schematic structural diagram of a data transmission apparatus according to an embodiment, the apparatus includes a sending module 11, a marking module 12 and a retransmitting module 13, where the sending module 11 is configured to send a data packet and start a timer corresponding to the data packet one to one; the marking module 12 is configured to receive a reception acknowledgement corresponding to a data packet when the data packet is successfully received, and mark the corresponding data packet as a successful transmission; the retransmission module 13 is configured to retransmit the data packet if the corresponding data packet is not marked as being successfully transmitted after the timer expires; and if the number of data packets separated by a first data packet and a second data packet is greater than the number of retransmission skip packets, retransmitting the data packet which is not marked as being successfully transmitted at the earliest time, wherein the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
In a preferred embodiment, the apparatus further includes a delay module 14, where the delay module 14 is configured to obtain a remaining capacity that the data packet can be received, and delay sending a subsequent data packet when the remaining capacity is zero.
Based on the same inventive concept, the present application also provides another data transmission apparatus 20. Please refer to fig. 6, which is a schematic structural diagram of a data transmission apparatus according to an embodiment, the apparatus includes a receiving module 21, a confirmation module 22, and a re-receiving module 23, where the receiving module 21 is configured to receive a data packet and return a reception confirmation corresponding to the data packet one to one, and each of the data packets is provided with a corresponding timer; the confirmation module 22 is configured to send a reception confirmation corresponding to the data packet one to one, where the data packet corresponding to the reception confirmation is marked as being successfully sent; the re-receiving module 23 is configured to receive a re-sending data packet, where the re-sending data packet is the data packet that is not marked as being sent successfully after the corresponding timer expires; and after the timer is overtime, under the condition that the number of data packets separated by a first data packet and a second data packet is greater than the number of retransmission skip packets, the first data packet is not marked as a data packet which is successfully transmitted at the earliest, the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is transmitted at the latest.
In a preferred embodiment, the apparatus further includes a delay module 24, where the delay module 24 is configured to obtain a remaining capacity that the data packet can be received, and delay receiving a subsequent data packet when the remaining capacity is zero.
Those skilled in the art can understand that the apparatus 10 may be specifically a sending end in the foregoing data transmission method embodiment, and the apparatus 10 may be configured to execute each flow and/or step corresponding to the sending end in the foregoing data transmission method; the apparatus 20 may be specifically a receiving end in the above data transmission method embodiment, and the apparatus 20 may be configured to execute each process and/or step corresponding to the receiving end in the above data transmission method, and for avoiding repetition, details are not described here again.
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, dedicated, or group processor) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that support the described functionality.
The above-mentioned apparatus 10 and apparatus 20 have functions to implement the respective steps in the above-mentioned method; the above functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
In the embodiments of the present application, the apparatus 10 and the apparatus 20 may also be a chip or a chip system, for example: system on chip (SoC). The present application is not limited thereto.
Based on the same inventive concept, the application also provides the electronic equipment. The electronic device includes a processor, a transceiver, and a memory. Wherein the processor, the transceiver and the memory are in communication with each other through the internal connection path, the memory is used for storing instructions, and the processor is used for executing the instructions stored by the memory to control the transceiver to transmit and/or receive signals.
It should be understood that the electronic device may be embodied as the sending end or the receiving end in the foregoing embodiment, or functions of the sending end or the receiving end in the foregoing embodiment may be integrated in the electronic device, and the electronic device may be configured to execute each step and/or flow corresponding to the sending end or the receiving end in the foregoing embodiment. The memory may optionally include both read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may perform each step and/or flow corresponding to the terminal device or the network device in the above method embodiments.
It should be understood that, in the embodiment of the present application, the processor may be a Central Processing Unit (CPU), and the processor may also be other general processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In the implementation process, the steps of the data transmission method can be implemented by hardware integrated logic circuits in a processor or instructions in the form of software. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in a processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor executes instructions in the memory, in combination with hardware thereof, to perform the steps of the above-described method. To avoid repetition, it is not described in detail here.
The present application provides a readable computer storage medium for storing a computer program for implementing the data transmission method shown in the various possible implementations in the above embodiments.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented as well
By other means. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A data transmission method, comprising the steps of:
sending a data packet and starting a timer which corresponds to the data packet one by one;
receiving confirmation information corresponding to the data packets one by one, and marking the corresponding data packets as successful sending;
after the timer is overtime, if the corresponding data packet is not marked as successful in transmission, retransmitting the data packet; and if the number of data packets separated by a first data packet and a second data packet is greater than the preset retransmission skip number, retransmitting the data packet which is not marked as successful transmission at the earliest time, wherein the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is sent latest at present.
2. The method of claim 1, wherein: the timing duration of the timer is the sum of communication time and retransmission delay, the communication time is the time for completing a request and a response of one-time communication, and the retransmission delay is a preset fixed value.
3. The method of claim 1, wherein: further comprising the steps of: and acquiring the residual capacity of the data packet which can be received, and when the residual capacity is zero, delaying to send the subsequent data packet.
4. A data transmission method, comprising the steps of:
receiving data packets, wherein each data packet is provided with a corresponding timer;
sending receiving confirmation information corresponding to the data packets one by one, wherein the data packets corresponding to the receiving confirmation are marked as being successfully sent;
receiving a retransmission data packet, wherein the retransmission data packet is the data packet which is not marked as being successfully transmitted after the corresponding timer is overtime; and after the timer is overtime, under the condition that the number of data packets separated by a first data packet and a second data packet is greater than the preset number of retransmission skip packets, the first data packet is not marked as a data packet which is successfully transmitted at the earliest, the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
5. The method of claim 4, wherein: the timing duration of the timer is the sum of communication time and retransmission delay, the communication time is the time for completing a request and a response of one-time communication, and the retransmission delay is a preset fixed value.
6. The method of claim 4, wherein: further comprising the steps of: and acquiring the residual capacity of the data packet which can be received, and delaying to receive the subsequent data packet when the residual capacity is zero.
7. A data transmission apparatus, comprising:
the sending module is used for sending data packets and starting timers which are in one-to-one correspondence with the data packets;
the marking module is used for receiving the receiving confirmation information corresponding to the data packets one by one and marking the corresponding data packets as successful sending;
the retransmission module is used for retransmitting the data packet if the corresponding data packet is not marked as successful transmission after the timer is overtime; and if the number of data packets separated by a first data packet and a second data packet is greater than the preset retransmission skip number, retransmitting the data packet which is not marked as being successfully transmitted at the earliest time, wherein the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
8. A data transmission apparatus, comprising:
the receiving module is used for receiving data packets and returning receiving confirmation corresponding to the data packets one by one, and each data packet is provided with a corresponding timer;
the confirmation module is used for sending receiving confirmation information corresponding to the data packets one by one, and the data packets corresponding to the receiving confirmation are marked as being successfully sent;
a re-receiving module, configured to receive a re-sent data packet, where the re-sent data packet is the data packet that is not marked as being successfully sent after the corresponding timer expires; and after the timer is overtime, under the condition that the number of data packets separated by a first data packet and a second data packet is greater than the preset number of retransmission skip packets, the first data packet is not marked as a data packet which is successfully transmitted at the earliest, the first data packet is a data packet corresponding to the current latest receiving confirmation, and the second data packet is a data packet which is currently transmitted at the latest.
9. An electronic device, comprising: a processor coupled with a memory for storing a computer program that, when invoked by the processor, causes the apparatus to perform the method of any of claims 1 to 6.
10. A computer-readable storage medium for storing a computer program comprising instructions for implementing the method of any one of claims 1 to 6.
CN202211301581.3A 2022-10-24 2022-10-24 Data transmission method, device, equipment and computer readable storage medium Pending CN115913474A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211301581.3A CN115913474A (en) 2022-10-24 2022-10-24 Data transmission method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211301581.3A CN115913474A (en) 2022-10-24 2022-10-24 Data transmission method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115913474A true CN115913474A (en) 2023-04-04

Family

ID=86483225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211301581.3A Pending CN115913474A (en) 2022-10-24 2022-10-24 Data transmission method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115913474A (en)

Similar Documents

Publication Publication Date Title
CN111373809B (en) Uplink signal sending method, uplink signal receiving method, device and system
JP2020511842A (en) Network connection restoration method, device and communication system
CN113728697B (en) Wireless communication method and terminal device
US20230284334A1 (en) Communication configuration method and communication apparatus
EP4187820A1 (en) Methods and devices for indicating and determining sequence number
US10999800B2 (en) Method and device for discontinuous reception
WO2021081696A1 (en) Data transmission method and communication apparatus
WO2022078321A1 (en) Uplink information sending method and related product
US20230337320A1 (en) Wireless communication method and terminal device
CN115843125B (en) Communication method and communication device
US10841963B2 (en) Communication method and communication device
US20240023015A1 (en) Sidelink transmission method and terminal
CN115913474A (en) Data transmission method, device, equipment and computer readable storage medium
WO2022120516A1 (en) Communication method, device and system
WO2022021413A1 (en) Key generation method and apparatus, and terminal device and network device
CN113556792A (en) State report transmission method, terminal equipment and network equipment
TW202007215A (en) Beam failure recovery implementation method, apparatus, chip, and computer program
WO2023131220A1 (en) Communication method, apparatus, and system
WO2022204999A1 (en) Survival time processing method, and terminal device
WO2023005149A1 (en) Data transmission method and apparatus, terminal, and storage medium
CN115277608B (en) Method and apparatus for wireless communication
US20230328825A1 (en) Configuration reset method and apparatus, and terminal device
WO2023123229A1 (en) Wireless communication method, terminal device, and network device
WO2022155926A1 (en) Wireless communication method and terminal device
WO2023060585A1 (en) Wireless communication method, terminal device, and network device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination