CN111740809B - Data transmission method, device and storage medium - Google Patents
Data transmission method, device and storage medium Download PDFInfo
- Publication number
- CN111740809B CN111740809B CN202010420614.0A CN202010420614A CN111740809B CN 111740809 B CN111740809 B CN 111740809B CN 202010420614 A CN202010420614 A CN 202010420614A CN 111740809 B CN111740809 B CN 111740809B
- Authority
- CN
- China
- Prior art keywords
- terminal
- data packet
- packet
- data
- current group
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/003—Arrangements for allocating sub-channels of the transmission path
- H04L5/0053—Allocation of signalling, i.e. of overhead other than pilot signals
- H04L5/0055—Physical resource allocation for ACK/NACK
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1829—Arrangements specially adapted for the receiver end
- H04L1/1858—Transmission or retransmission of more than one copy of acknowledgement message
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1867—Arrangements specially adapted for the transmitter end
- H04L1/189—Transmission or retransmission of more than one copy of a message
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Communication Control (AREA)
Abstract
The embodiment of the invention provides a data transmission method, a data transmission device and a storage medium, wherein the method is applied to a first terminal and comprises the steps of dividing original data into a plurality of group data packets; the method comprises the steps of sending a current group data packet to a second terminal, then sending an end data packet to the second terminal, receiving an end confirmation data packet returned by the second terminal according to the end data packet, and retransmitting a block data packet which is not received by the second terminal to the second terminal according to the end confirmation data packet. The embodiment of the invention avoids waiting for the response returned by the second terminal, namely ending confirmation data packet, after each block data packet is sent to the second terminal, and reduces the time for the first terminal to wait for the response of the second terminal, thereby improving the efficiency of data transmission. And the block data packet which is not received by the second terminal is retransmitted according to the response returned by the second terminal, so that each part of the original data to be transmitted is ensured to be transmitted to the second terminal, and the reliability of data transmission is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data transmission method, apparatus, and storage medium.
Background
At present, the application of the video networking is more and more widespread, and is not limited to the transmission of audio and video data. Application scenarios such as data synchronization have increasingly high demands on the efficiency and reliability of data transmission.
In the existing data transmission scheme based on the internet of view, the response of the opposite terminal needs to be waited after each data packet is sent. When more data packets are transmitted, more time is consumed for waiting for the response of the opposite terminal, and the efficiency of data transmission is lower. In addition, in order to improve the data transmission efficiency, the next data packet may be directly transmitted without waiting for the response of the opposite terminal, which may result in the loss of the data packet and be not perceived, thereby reducing the reliability of data transmission.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention have been made to provide a data transmission method, apparatus, and storage medium that overcome or at least partially solve the foregoing problems.
In order to solve the problems, the embodiment of the invention discloses a data transmission method which is applied to a first terminal and comprises the steps of acquiring original data to be transmitted, dividing the original data into a plurality of group data packets, wherein each group data packet comprises a plurality of block data packets, sending a tail data packet to the second terminal after the current group data packet is sent to the second terminal, receiving a tail acknowledgement data packet returned by the second terminal according to the tail data packet, wherein the tail acknowledgement data packet indicates that the second terminal does not receive one or more block data packets in the current group data packet, resending the one or more block data packets which are not received by the second terminal to the second terminal according to the tail acknowledgement data packet and in the form of the current group data packet, and sending the next group data packet to the second terminal after each block data packet in the current group data packet is received by the second terminal.
Optionally, before the end data packet is sent to the second terminal, the method further includes generating the end data packet according to transmission identification information corresponding to the original data, a number of the current group data packet, a retransmission number, transmission completion identification information and a check code of the current group data packet, where the transmission identification information indicates that the original data is transmitted between the first terminal and the second terminal.
Optionally, the second terminal is configured to generate the end acknowledgement packet according to the transmission identification information, the number, the packet loss status and a packet loss bitmap, where the packet loss bitmap includes a plurality of consecutive bytes, each bit of each byte represents a sequence number of each block packet in the current group packet, and when a value of the bit is a preset value, it indicates that the second terminal does not receive the block packet with the corresponding sequence number.
Optionally, before sending the current group data packet to the second terminal, the method further comprises obtaining a state of the second terminal, and sending the current group data packet to the second terminal comprises sending the current group data packet to the second terminal when the state of the second terminal indicates an idle state.
Optionally, the obtaining the state of the second terminal includes sending a handshake confirmation data packet to the second terminal, and receiving a handshake response data packet returned by the second terminal according to the handshake confirmation data packet, where the handshake response data packet includes the state of the second terminal.
Optionally, the handshake confirmation data packet comprises a first time, the handshake response data packet further comprises a second time, and the method further comprises generating a delay time length according to the first time and the second time, wherein the delay time length is used for judging whether to resend the current group data packet.
Optionally, after the end data packet is sent to the second terminal, the method further includes retransmitting the corresponding end data packet to the second terminal if the end acknowledgement data packet returned by the second terminal is not received within a time period corresponding to one or more of the delay time durations.
The embodiment of the invention also discloses a data transmission device which is applied to a first terminal and comprises an acquisition module, a segmentation module, a transmission module and a receiving module, wherein the acquisition module is used for acquiring original data to be transmitted, the segmentation module is used for segmenting the original data into a plurality of group data packets, each group data packet comprises a plurality of block data packets, the transmission module is used for transmitting an ending data packet to the second terminal after transmitting the current group data packet to the second terminal, the ending data packet represents that the current group data packet is transmitted, the receiving module is used for receiving an ending acknowledgement data packet returned by the second terminal according to the ending data packet, the ending acknowledgement data packet represents that the second terminal does not receive one or more block data packets in the current group data packet, the transmission module is also used for retransmitting one or more block data packets which are not received by the second terminal to the second terminal according to the ending acknowledgement data packet and according to the form of the current group data packet, and the transmission module is also used for transmitting the one or more block data packets which are not received by the second terminal to the second terminal after the current group data packet.
Optionally, the device further comprises a generating module, configured to generate, before the sending module sends an end data packet to the second terminal, the end data packet according to transmission identification information corresponding to the original data, a number of the current group data packet, a retransmission number, transmission completion identification information and a check code of the current group data packet, where the transmission identification information indicates that the original data is transmitted between the first terminal and the second terminal.
Optionally, the second terminal is configured to generate the end acknowledgement packet according to the transmission identification information, the number, the packet loss status and a packet loss bitmap, where the packet loss bitmap includes a plurality of consecutive bytes, each bit of each byte represents a sequence number of each block packet in the current group packet, and when a value of the bit is a preset value, it indicates that the second terminal does not receive the block packet with the corresponding sequence number.
Optionally, the acquiring module is further configured to acquire a state of the second terminal before the transmitting module transmits the current group data packet to the second terminal, and the transmitting module is configured to transmit the current group data packet to the second terminal when the state of the second terminal indicates an idle state.
Optionally, the acquiring module is configured to send a handshake confirmation data packet to the second terminal, and receive a handshake response data packet returned by the second terminal according to the handshake confirmation data packet, where the handshake response data packet includes a state of the second terminal.
Optionally, the handshake confirmation data packet includes a first time, the handshake response data packet further includes a second time, and the generating module is further configured to generate a delay duration according to the first time and the second time, where the delay duration is used to determine whether to resend the current group data packet.
Optionally, the sending module is further configured to, after sending an end data packet to the second terminal, retransmit the corresponding end data packet to the second terminal if the receiving module does not receive the end acknowledgement data packet returned by the second terminal within one or more time periods corresponding to the delay time duration.
The embodiment of the invention also discloses a device comprising one or more processors and one or more machine-readable media with instructions stored thereon, which when executed by the one or more processors, cause the device to perform the method of transmitting data as described above.
The embodiment of the invention also discloses a computer readable storage medium, which stores a computer program for causing a processor to execute the data transmission method.
The embodiment of the invention has the following advantages:
The embodiment of the invention provides a data transmission scheme, which is characterized in that original data to be transmitted is acquired in a first terminal, namely a data sending terminal, and the original data is divided into a plurality of group data packets, wherein each group data packet comprises a plurality of block data packets. And after the current group data packet is sent to the second terminal, sending an ending data packet to the second terminal. The end packet may indicate that the current group packet is sent. The first terminal receives an end acknowledgement packet returned by the second terminal according to the end packet, where the end acknowledgement packet may indicate that the second terminal did not receive one or more block packets in the current group packet. The first terminal then retransmits one or more block data packets not received by the second terminal to the second terminal in accordance with the end acknowledgement data packet and in the form of the current group data packet. After the second terminal receives each block data packet in the current group data packet, the first terminal transmits the next group data packet to the second terminal.
After a group data packet composed of a plurality of block data packets is sent, the embodiment of the invention sends an end data packet to the second terminal to indicate that the group data packet is sent completely, waits for the second terminal to return an end confirmation data packet, and indicates whether the second terminal receives all the block data packets or not through the end confirmation data packet. Avoiding waiting for the response returned by the second terminal, namely, ending confirmation data packet, after each block data packet is sent to the second terminal, reducing the time for the first terminal to wait for the response of the second terminal, thereby improving the efficiency of data transmission. And under the condition that the second terminal does not receive all the block data packets, the block data packets which are not received by the second terminal are retransmitted according to the response returned by the second terminal, so that each part of the original data to be transmitted is ensured to be transmitted to the second terminal, and the reliability of data transmission is improved.
Drawings
FIG. 1 is a flow chart of steps of an embodiment of a data transmission method of the present invention;
FIG. 2 is a flow chart of steps of another embodiment of a data transmission method of the present invention;
FIG. 3 is a flow chart of a data transmission method based on the Internet of view of the present invention;
Fig. 4 is a block diagram of an embodiment of a data transmission device of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
In the data transmission scheme provided by the embodiment of the invention, the first terminal divides the original data to be transmitted into a plurality of group data packets, and each group data packet comprises a plurality of block data packets. And after the current group data packet is sent to the second terminal, sending an ending data packet to the second terminal so as to inform the second terminal that the current group data packet is sent. The second terminal may return an end acknowledgement packet to the first terminal according to the actual receiving situation, where the end acknowledgement packet indicates the block packet that is not received. And the first terminal resends the block data packet which is not received by the second terminal to the second terminal according to the tail confirmation data packet.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a data transmission method according to the present invention may specifically include the steps of:
Step 101, obtaining the original data to be transmitted.
In the embodiment of the present invention, the original data to be transmitted may be data with a certain data amount, such as text data, picture data, audio/video data, and the like. The embodiment of the invention does not limit the type, the data volume and the like of the original data in a specific way.
Step 102, dividing the original data into a plurality of group data packets.
In an embodiment of the present invention, the original data may be divided according to the data packetization information. The data packetization information may represent the fragmentation requirements, fragmentation identifications, etc. of the original data. The specific data packetization information may depend on the type of original data or the amount of data. The data packetization information may include transmission identification information, data identification information of original data, a data amount of the original data, the number of a plurality of group data packets, the number of a plurality of block data packets included in each group data packet, a data amount of each block data packet, and the like. In dividing the original data into a plurality of group data packets, it is possible to allocate, to the original data, how many group data packets (the number of the plurality of group data packets) each of which can specifically contain, and how many block data packets (the number of the plurality of block data packets) each of which can specifically contain, the data amount of each of the block data packets. For example, the original data allocation may be specifically divided into 50 groups of packets, each group of packets may contain 512 block packets, and each block packet may contain 1024 bytes. Furthermore, in order to distinguish different original data, unique transmission identification information may also be set for each original data. And carrying the transmission identification information when each group of data packets are transmitted subsequently.
Step 103, after sending the current group data packet to the second terminal, sending an end data packet to the second terminal.
In the embodiment of the present invention, if the original data is divided into n groups of packets, the first terminal sends n tail packets to at least the second terminal. And, after each group packet is transmitted, a corresponding end packet is transmitted. The second terminal is notified by the end packet following the group packet that the first terminal has sent one group packet preceding the end packet.
And 104, receiving the end confirmation data packet returned by the second terminal according to the end data packet.
In the embodiment of the invention, after receiving the current group data packet and the end data packet after the current group data packet, the second terminal returns the end acknowledgement data packet to the first terminal in combination with the actual block data packet receiving situation. The end acknowledgement packet may indicate whether the second terminal has received all the block packets in the current group packet, and if not, the second terminal may indicate which block packet or blocks the second terminal has not specifically received.
And step 105, retransmitting one or more block data packets which are not received by the second terminal to the second terminal according to the end acknowledgement data packet and in the form of the current group data packet.
In the embodiment of the present invention, if the end acknowledgement packet indicates that the second terminal does not receive all or part of the block packets in the current group packet, the block packets not received by the second terminal are retransmitted to the second terminal. When the block data packet is retransmitted, the block data packet is still transmitted in the form of a current group data packet, that is, the current group data packet including the block data packet which is not received by the second terminal is transmitted to the second terminal, and the retransmitted current group data packet may include only the block data packet which is not received by the second terminal.
If the end acknowledgement packet indicates that the second terminal has received all of the block packets in the current group packet, step 106 is performed.
And step 106, transmitting the next group data packet to the second terminal.
In the embodiment of the invention, after the first terminal sends the next group data packet to the second terminal, the end data packet of the next group data packet is still sent, and the second terminal returns the end confirmation data packet to the first terminal. The first terminal determines whether to send the block data packet in the next group data packet to the second terminal again according to the end acknowledgement data packet, and the specific determining and sending processes may refer to the steps 103 to 105, which are not described herein.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a data transmission method of the present invention is shown, and the method may specifically include the steps of:
Step 201, obtaining the original data to be transmitted and the state of the second terminal.
In the embodiment of the invention, when the state of the second terminal is acquired, a handshake confirmation data packet may be sent to the second terminal, and then a handshake response data packet returned by the second terminal according to the handshake confirmation data packet may be received, where the handshake response data packet may include the state of the second terminal.
In practical application, the packet structure of the handshake confirmation packet is shown in the following table:
After receiving the handshake confirmation data packet, the second terminal can generate a handshake response data packet according to the current state and the current time of the second terminal, and return the handshake response data packet to the first terminal. In practical application, the packet structure of the handshake response packet is shown in the following table:
| transmitting identification information | Status information | First time of | Second time of |
Where "status information" indicates the current status of the second terminal and may include, but is not limited to, idle, busy, etc. The "second time" indicates the current time when the second terminal receives the handshake confirmation packet.
After the first terminal receives the handshake response data packet, a delay time length can be generated according to the second time and the first time. The delay time may be used to determine whether to retransmit the current group packet. In practical applications, the time period obtained by subtracting the first time from the second time may be used as the delay time.
Step 202, dividing the original data into a plurality of group data packets.
In an embodiment of the present invention, the original data is divided into a plurality of group packets, and each packet includes a plurality of block packets. In practical application, the packet structure of the group data packet is as follows:
Step 203, after the current group data packet is sent, an end data packet is sent to the second terminal.
In the embodiment of the invention, each time the first terminal transmits a group data packet to the second terminal, an end data packet is transmitted to the second terminal. An end packet may indicate that a group packet has been sent. The end packet may be sent to the second terminal immediately after the group packet.
In practical application, the first terminal may generate the end packet of the current group packet according to the transmission identification information, the number of the current group packet, the retransmission times, the transmission completion identification information, and the check code of the current group packet. The transmission identification information may represent transmission of the original data between the first terminal and the second terminal. The transmission identification information may be affected by the original data, the first terminal, the second terminal, and factors such as the number of transmissions, the transmission time, and the like. Any of the above factors changes, as does the transmission identification information. The packet structure of the end packet is shown in the following table:
Wherein, in the case that the first terminal does not retransmit the block packet of the current group packet, the number of retransmissions may be 0. The transmission completion identification information can be set according to actual conditions, and the embodiment of the invention does not limit the content, format and the like of the transmission completion identification information.
After receiving the end data packet, the second terminal may generate an end acknowledgement data packet according to the actual receiving situation of the block data packet. In practical application, the second terminal may generate the end acknowledgement packet according to the transmission identification information, the number of the current group packet, the packet loss state and the packet loss bitmap. The packet structure of the end acknowledgment packet is shown in the following table:
The packet loss state may indicate that there is a packet loss or no packet loss. The packet loss bitmap may contain a plurality of consecutive bytes, each bit of each byte representing a sequence number of each block packet in the current group packet. When the value of a certain bit in the byte is 1, the second terminal does not receive the block data packet with the serial number corresponding to the bit. When the value of a certain bit in the byte is 0, the second terminal receives the block data packet with the sequence number corresponding to the bit.
And step 204, receiving the end confirmation data packet returned by the second terminal, and retransmitting the block data packet which is not received by the second terminal according to the end confirmation data packet.
In the embodiment of the invention, the first terminal receives the end confirmation data packet returned by the second terminal, analyzes the end confirmation data packet, and resends the block data packet with the serial number corresponding to the bit if the packet loss state in the end confirmation data packet is that the packet loss exists and the value of the bit of a certain byte in the packet loss bitmap is 1.
In an exemplary embodiment of the present invention, after the first terminal sends the end packet of the current group packet to the second terminal, if the end acknowledgement packet returned by the second terminal is not received within a period corresponding to one or more delay periods, the end packet is retransmitted to the second terminal. The delay time is set to set a time period threshold for the first terminal waiting for the end confirmation data packet, so that the first terminal is prevented from influencing the transmission of the subsequent group data packet due to long waiting time for the end confirmation data packet.
Based on the above description about the data transmission method, a data transmission method based on the internet of vision is described below. Fig. 3 is a schematic flow chart of a data transmission method based on the internet of view according to an embodiment of the present invention. The data transmission method based on the video networking is applied to a data sending terminal and a data receiving terminal. The data transmitting terminal transmits a handshake confirmation packet to the data receiving terminal before transmitting data. The data receiving terminal receives the handshake confirmation packet and returns a handshake response packet to the data sending terminal. The data transmitting terminal transmits handshake confirmation packets to the data receiving terminal for the purpose of a, notifying the data receiving terminal of related information of data to be transmitted, for example, data identification information (file name), transmission identification information (transmission ID), first time (current time stamp), data packetization information, and the like of the data to be transmitted. b. Confirming the state information of the data receiving terminal, and definitely determining that the data receiving terminal can normally receive the data to be transmitted. c. And confirming the time delay duration of data transmission between the data sending terminal and the data receiving terminal, wherein the time delay duration can be used for subsequent data transmission overtime judgment. The data transmitting terminal divides data to be transmitted into a plurality of group data packets (group packet data) according to the preset data packetization information, for example, each group data packet contains 512 block data packets (block packet data), each block data packet contains 1024 bytes. The data transmitting terminal sequentially transmits the group data packets to the data receiving terminal. After each group data packet is transmitted to the data receiving terminal, the data transmitting terminal transmits an end data packet (end-of-group packet) to the data receiving terminal, and the end data packet indicates that the transmission of one group data packet is completed. After receiving the end data packet, the data receiving terminal performs a sorting check on the received block data packet. If a certain or some block data packet is missing, an end acknowledgement data packet (end of packet acknowledgement packet) is returned to the data transmission terminal. The missing block data packet is represented in the form of a packet loss bitmap in the end acknowledgement data packet. For example, the packet loss bitmap is a block of 1024 consecutive bytes, each bit of each byte represents a sequence number of a block packet, 8 bits of the first byte represent block packets with sequence numbers 0-7, 8 bits of the second byte represent block packets with sequence numbers 8-15, and so on, and if the block packet with the sequence number corresponding to the bit is missing, the value of the bit is set to 1. After receiving the end confirmation data packet, if there is a missing block data packet, the data transmitting terminal resends the missing block data packet to the data receiving terminal and resends the end data packet to the data receiving terminal. The data receiving terminal performs sequencing check on the block data packets according to the tail data packets again, returns tail confirmation data packets to the data sending terminal again, and circulates in this way until all the block data packets in the group data packets are received by the data receiving terminal, so that the data sending terminal continues to transmit the next group data packet after the transmission of one group data packet is completed.
If the group data packet is transmitted in the internet of view protocol, the data amount of the internet of view protocol header portion and the payload data portion (block data packet) cannot generally exceed 1500 bytes. The block data packet may conform to format requirements of multiple versions of IEEE802.3, IEEE802.2, etc., for example, ethernet frame format of IEEE802.3 is shown in the following table:
| Preamble code | Frame start delimiter | Destination physical address | Source physical address | Protocol type | Load data | Frame check sequence |
The embodiment of the invention provides a data transmission scheme, which is characterized in that original data to be transmitted is acquired in a first terminal, namely a data sending terminal, and the original data is divided into a plurality of group data packets, wherein each group data packet comprises a plurality of block data packets. And after the current group data packet is sent to the second terminal, sending an ending data packet to the second terminal. The end packet may indicate that the current group packet is sent. The first terminal receives an end acknowledgement packet returned by the second terminal according to the end packet, where the end acknowledgement packet may indicate that the second terminal did not receive one or more block packets in the current group packet. The first terminal then retransmits one or more block data packets not received by the second terminal to the second terminal in accordance with the end acknowledgement data packet and in the form of the current group data packet. After the second terminal receives each block data packet in the current group data packet, the first terminal transmits the next group data packet to the second terminal.
After a group data packet composed of a plurality of block data packets is sent, the embodiment of the invention sends an end data packet to the second terminal to indicate that the group data packet is sent completely, waits for the second terminal to return an end confirmation data packet, and indicates whether the second terminal receives all the block data packets or not through the end confirmation data packet. Avoiding waiting for the response returned by the second terminal, namely, ending confirmation data packet, after each block data packet is sent to the second terminal, reducing the time for the first terminal to wait for the response of the second terminal, thereby improving the efficiency of data transmission. And under the condition that the second terminal does not receive all the block data packets, the block data packets which are not received by the second terminal are retransmitted according to the response returned by the second terminal, so that each part of the original data to be transmitted is ensured to be transmitted to the second terminal, and the reliability of data transmission is improved.
The embodiment of the invention sets the corresponding transmission identification information for the original data, and the transmission identification information plays a unique identification role when the original data is transmitted between the first terminal and the second terminal. That is, a certain transmission of certain original data between a first terminal and a second terminal corresponds to the original data, the first terminal and the second terminal, and the transmission of the certain original data, and the transmission identification information has uniqueness. The transmission identification information can be distinguished from other original data, other first terminals and second terminals, and other transmission times by setting.
According to the embodiment of the invention, the packet loss bitmap in the end confirmation data packet indicates the receiving condition of the second terminal on the block data packet in the current group data packet, so that the block data packet which is not received by the second terminal can be more intuitively indicated, and the first terminal can conveniently master the condition that the second terminal does not receive the block data packet.
The first terminal of the embodiment of the invention determines the delay time according to the handshake confirmation data and the handshake response data packet, and aims to set a time period threshold for the first terminal waiting for the end confirmation data packet, so as to avoid the first terminal from influencing the transmission of the subsequent group data packet due to long-time waiting for the end confirmation data packet.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 4, there is shown a block diagram of an embodiment of a data transmission apparatus of the present invention, which is applied to a first terminal, and which may specifically include the following modules:
an acquisition module 41, configured to acquire original data to be transmitted;
A partitioning module 42, configured to partition the original data into a plurality of group data packets, each of the group data packets including a plurality of block data packets;
A transmitting module 43, configured to transmit an end packet to the second terminal after transmitting the current group packet to the second terminal, where the end packet indicates that the current group packet is transmitted;
A receiving module 44, configured to receive an end acknowledgement packet returned by the second terminal according to the end packet, where the end acknowledgement packet indicates that the second terminal does not receive one or more of the block packets in the current set of packets;
The sending module 43 is further configured to resend, to the second terminal, one or more block data packets not received by the second terminal, according to the end acknowledgement data packet and in the current group data packet.
The sending module 43 is further configured to send a next set of data packets to the second terminal after the second terminal receives each block data packet in the current set of data packets.
In an exemplary embodiment of the present invention, the apparatus further includes a generating module, configured to generate, before the sending module 43 sends an end data packet to the second terminal, the end data packet according to transmission identification information corresponding to the original data, a number of the current group data packet, a retransmission number, transmission completion identification information, and a check code of the current group data packet, where the transmission identification information indicates that the original data is transmitted between the first terminal and the second terminal.
In an exemplary embodiment of the present invention, the second terminal is configured to generate the end acknowledgement packet according to the transmission identification information, the number, a packet loss status, and a packet loss bitmap;
the packet loss bitmap comprises a plurality of continuous bytes, each bit of each byte represents a sequence number of each block data packet in the current group of data packets, and when the numerical value of the bit is a preset value, the second terminal does not receive the block data packet with the corresponding sequence number.
In an exemplary embodiment of the present invention, the obtaining module 41 is further configured to obtain a state of the second terminal before the sending module 43 sends the current group packet to the second terminal;
The sending module 43 is configured to send the current group packet to the second terminal when the state of the second terminal indicates an idle state.
In an exemplary embodiment of the present invention, the obtaining module 41 is configured to send a handshake confirmation data packet to the second terminal, and receive a handshake response data packet returned by the second terminal according to the handshake confirmation data packet, where the handshake response data packet includes a state of the second terminal.
In an exemplary embodiment of the present invention, the handshake confirmation data packet includes a first time, and the handshake reply data packet further includes a second time;
The generating module is further configured to generate a delay duration according to the first time and the second time, where the delay duration is used to determine whether to retransmit the current group of data packets.
In an exemplary embodiment of the present invention, the sending module 43 is further configured to, after sending an end packet to the second terminal, retransmit the corresponding end packet to the second terminal if the receiving module 44 does not receive the end acknowledgement packet returned by the second terminal within one or more time periods corresponding to the delay time periods.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing describes the principles and embodiments of the present invention in detail using specific examples to facilitate understanding of the method and core ideas of the present invention, and meanwhile, the present disclosure should not be construed as being limited to the details of the present invention, since modifications in the detailed description and the application range will be apparent to those skilled in the art based on the ideas of the present invention.
Claims (8)
1. A data transmission method, applied to a first terminal, the method comprising:
Acquiring original data to be transmitted;
Dividing the original data into a plurality of group data packets, wherein each group data packet comprises a plurality of block data packets;
After the current group data packet is sent to a second terminal, an ending data packet is sent to the second terminal, wherein the ending data packet indicates that the current group data packet is sent completely;
Receiving an end confirmation data packet returned by the second terminal according to the end data packet, wherein the end confirmation data packet indicates that the second terminal does not receive one or more block data packets in the current group data packet;
Retransmitting one or more block data packets which are not received by the second terminal to the second terminal according to the end confirmation data packet and in the form of the current group data packet, wherein the method comprises the steps of transmitting the current group data packet containing the block data packets which are not received by the second terminal to the second terminal;
after the second terminal receives each block data packet in the current group data packet, transmitting the next group data packet to the second terminal;
Before the end data packet is sent to the second terminal, the end data packet is generated according to transmission identification information corresponding to the original data, the number of the current group data packet, the retransmission times, the transmission end identification information and the check code of the current group data packet, and the transmission identification information indicates that the original data is transmitted between the first terminal and the second terminal;
after said sending the end data packet to the second terminal, the method further comprises:
And if the ending confirmation data packet returned by the second terminal is not received within one or more time periods corresponding to the time delay time length, retransmitting the ending data packet to the second terminal.
2. The method of claim 1, wherein the second terminal is configured to generate the end acknowledgement packet according to the transmission identification information, the number, a packet loss status, and a packet loss bitmap;
the packet loss bitmap comprises a plurality of continuous bytes, each bit of each byte represents a sequence number of each block data packet in the current group of data packets, and when the numerical value of the bit is a preset value, the second terminal does not receive the block data packet with the corresponding sequence number.
3. The method of claim 1, wherein prior to said transmitting the current set of data packets to the second terminal, the method further comprises:
acquiring the state of the second terminal;
the sending the current group data packet to the second terminal includes:
And when the state of the second terminal represents an idle state, transmitting the current group data packet to the second terminal.
4. A method according to claim 3, wherein said obtaining the state of the second terminal comprises:
Sending a handshake confirmation data packet to the second terminal;
and receiving a handshake response data packet returned by the second terminal according to the handshake confirmation data packet, wherein the handshake response data packet comprises the state of the second terminal.
5. The method of claim 4, wherein the handshake acknowledgement packet includes a first time and the handshake reply packet further includes a second time;
The method further comprises the steps of:
And generating a delay time length according to the first time and the second time, wherein the delay time length is used for judging whether to resend the current group of data packets.
6. A data transmission apparatus for use with a first terminal, the apparatus comprising:
the acquisition module is used for acquiring the original data to be transmitted;
the splitting module is used for splitting the original data into a plurality of group data packets, and each group data packet comprises a plurality of block data packets;
The sending module is used for sending an ending data packet to the second terminal after sending the current group data packet to the second terminal, wherein the ending data packet indicates that the current group data packet is sent completely;
a receiving module, configured to receive an end acknowledgement packet returned by the second terminal according to the end packet, where the end acknowledgement packet indicates that the second terminal does not receive one or more block packets in the current group of packets;
The sending module is further configured to resend, according to the end acknowledgement packet and in the form of the current group packet, one or more block packets that are not received by the second terminal to the second terminal, and the sending module is configured to send, to the second terminal, the current group packet that includes the block packets that are not received by the second terminal;
The sending module is further configured to send a next group data packet to the second terminal after the second terminal receives each block data packet in the current group data packet;
the generating module is used for generating the ending data packet according to the transmission identification information corresponding to the original data, the number of the current group data packet, the retransmission times, the transmission completion identification information and the check code of the current group data packet before the sending module sends the ending data packet to the second terminal, wherein the transmission identification information indicates that the original data is transmitted between the first terminal and the second terminal;
And the sending module is further configured to, after sending an end data packet to the second terminal, retransmit the corresponding end data packet to the second terminal if the receiving module does not receive the end acknowledgement data packet returned by the second terminal within one or more time periods corresponding to the delay time periods.
7. An apparatus, comprising:
one or more processors, and
One or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform the data transmission method of any of claims 1 to 5.
8. A computer-readable storage medium, characterized in that a computer program stored therein causes a processor to execute the data transmission method according to any one of claims 1 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010420614.0A CN111740809B (en) | 2020-05-18 | 2020-05-18 | Data transmission method, device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010420614.0A CN111740809B (en) | 2020-05-18 | 2020-05-18 | Data transmission method, device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111740809A CN111740809A (en) | 2020-10-02 |
| CN111740809B true CN111740809B (en) | 2025-07-01 |
Family
ID=72647378
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010420614.0A Active CN111740809B (en) | 2020-05-18 | 2020-05-18 | Data transmission method, device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111740809B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101594366A (en) * | 2004-08-11 | 2009-12-02 | 株式会社东芝 | Communication device and communication method |
| CN103858373A (en) * | 2011-09-02 | 2014-06-11 | 高通股份有限公司 | Improved fragmentation for long packets in a low-speed wireless network |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4799396B2 (en) * | 2006-12-25 | 2011-10-26 | 株式会社東芝 | Wireless communication device |
-
2020
- 2020-05-18 CN CN202010420614.0A patent/CN111740809B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101594366A (en) * | 2004-08-11 | 2009-12-02 | 株式会社东芝 | Communication device and communication method |
| CN103858373A (en) * | 2011-09-02 | 2014-06-11 | 高通股份有限公司 | Improved fragmentation for long packets in a low-speed wireless network |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111740809A (en) | 2020-10-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104518853B (en) | Method, receiving terminal and the system that a kind of data retransmit | |
| CN107197528B (en) | Method and device for scheduling and allocating resources | |
| CN106330414B (en) | Message transmission method and device | |
| US10284340B2 (en) | Multicast sending apparatus, multicast receiving apparatus, and multicast transmission determining method | |
| CN111769915B (en) | Data transmission method and related equipment | |
| CN103297207A (en) | Method for performing hybrid automatic repeat request on random access response message | |
| CN112088508B (en) | Communication method, device, terminal and readable storage medium of wireless local area network | |
| CN103944880B (en) | A kind of method of ZigBee data transfers | |
| CN1910862A (en) | Method for retransmitting data frames and network equipment using the method | |
| CN101686556B (en) | Method, device and system of resource release | |
| US20180331808A1 (en) | Method for hybrid automatic repeat request process, network device and terminal device | |
| CN114301576A (en) | Method and communication device for generating and transmitting acknowledgement frame in IEEE 802.15.4 network | |
| CN108880760A (en) | A kind of big data quantity reliable communication method based on big-dipper satellite | |
| CN111740809B (en) | Data transmission method, device and storage medium | |
| EP3672189B1 (en) | Data transmission method, device and system | |
| JP2006054897A (en) | Method for reporting packet reception result in mobile communication system | |
| CN111543079B (en) | Radio Link Control (RLC) Acknowledged Mode (AM) data reception | |
| CN108260164A (en) | Manage the method, apparatus and computer readable storage medium of Internet of Things base station | |
| CN120498608A (en) | Communication enhancement method and system based on CAN bus | |
| CN102333337A (en) | Script transmission method, wireless network simulation system (iNES) and server | |
| CN108768598B (en) | Method and device for transmitting downlink control information in ultrahigh-reliability ultralow-time communication | |
| CN117040692A (en) | Method and device for transmitting service data, electronic equipment and storage medium | |
| CN115827266A (en) | Method and system for message forwarding framework in multi-CPU system heterogeneous computer system | |
| CN110690949B (en) | Information configuration method and equipment | |
| CN107204824B (en) | Data transmission method and system for low-speed channel |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |