CN111740809A - Data transmission method, device and storage medium - Google Patents

Data transmission method, device and storage medium Download PDF

Info

Publication number
CN111740809A
CN111740809A CN202010420614.0A CN202010420614A CN111740809A CN 111740809 A CN111740809 A CN 111740809A CN 202010420614 A CN202010420614 A CN 202010420614A CN 111740809 A CN111740809 A CN 111740809A
Authority
CN
China
Prior art keywords
terminal
data
data packet
data packets
packet
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
CN202010420614.0A
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.)
Visionvera Information Technology Co Ltd
Original Assignee
Visionvera Information 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 Visionvera Information Technology Co Ltd filed Critical Visionvera Information Technology Co Ltd
Priority to CN202010420614.0A priority Critical patent/CN111740809A/en
Publication of CN111740809A publication Critical patent/CN111740809A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/003Arrangements for allocating sub-channels of the transmission path
    • H04L5/0053Allocation of signaling, i.e. of overhead other than pilot signals
    • H04L5/0055Physical resource allocation for ACK/NACK
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements 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/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1858Transmission or retransmission of more than one copy of acknowledgement message
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements 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/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/189Transmission or retransmission of more than one copy of a message

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 following steps: dividing original data into a plurality of group data packets; sending the current group data packet to the second terminal and then sending the ending data packet to the second terminal; receiving an ending confirmation data packet returned by the second terminal according to the ending data packet; and retransmitting the data packets which are not received by the second terminal to the second terminal according to the ending confirmation data packets. The embodiment of the invention avoids waiting for the response returned by the second terminal, namely the ending confirmation data packet after sending one block data packet to the second terminal, reduces the time for the first terminal to wait for the response of the second terminal, and thus improves the efficiency of data transmission. And the 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

Data transmission method, device and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data transmission method, an apparatus, and a storage medium.
Background
At present, the application of the video network is more and more extensive, and the video network is not limited to the transmission of audio and video data any more. Application scenarios such as data synchronization are increasingly demanding on the efficiency and reliability of data transmission.
In the existing data transmission scheme based on the video network, after each data packet is sent, a response of the opposite terminal needs to be waited. 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 low. Moreover, sometimes, in order to improve the data transmission efficiency, the next data packet is not sent directly without waiting for the response of the opposite end, which may cause the data packet to be lost and be imperceptible, thereby reducing the reliability of data transmission.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a data transmission method, apparatus and storage medium that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a data transmission method, which is applied to a first terminal, and the method includes: acquiring original data to be transmitted; dividing the raw data into a plurality of group data packets, each of the group data packets containing a plurality of block data packets; after the current group of data packets are sent to a second terminal, sending an ending data packet to the second terminal, wherein the ending data packet represents that the current group of data packets are 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 of the current data packets in the group of data packets; according to the ending confirmation data packet and according to the form of the current group of data packets, retransmitting one or more 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 of data packets, sending the next group of data packets to the second terminal.
Optionally, before the sending the end data packet to the second terminal, the method further includes: and generating the ending data packet according to transmission identification information corresponding to the original data, the number of the current group of data packets, the retransmission times, transmission completion identification information and the check code of the current group of data packets, wherein 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 identifier information, the number, the packet loss state, and a packet loss bitmap; the packet loss bitmap comprises a plurality of continuous bytes, each bit of each byte represents the 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.
Optionally, before sending the current set of data packets to the second terminal, the method further includes: acquiring the state of the second terminal; the sending the current group of data packets to the second terminal includes: and when the state of the second terminal represents an idle state, sending the current group of data packets to the second terminal.
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, wherein the handshake response data packet comprises the state of the second terminal.
Optionally, the handshake acknowledgement packet includes a first time, and the handshake response packet further includes a second time; the method further comprises the following steps: 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.
Optionally, after the sending the end data packet to the second terminal, the method further includes: and if the ending confirmation data packet returned by the second terminal is not received within a time period corresponding to one or more delay time lengths, retransmitting the corresponding ending data packet to the second terminal.
The embodiment of the invention also discloses a data transmission device, which is applied to the first terminal and comprises: the acquisition module is used for acquiring original data to be transmitted; a dividing module for dividing the original data into a plurality of group data packets, each of the group data packets including a plurality of block data packets; a sending module, configured to send an end data packet to a second terminal after sending the current group of data packets to the second terminal, where the end data packet indicates that the sending of the current group of data packets is completed; a receiving module, configured to receive an end acknowledgement data packet returned by the second terminal according to the end data packet, where the end acknowledgement data packet indicates that the second terminal does not receive one or more of the current group of data packets; the sending module is further configured to resend one or more of the block data packets that 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 block data packet; the sending module is further configured to send the next group of data packets to the second terminal after the second terminal receives each of the current group of data packets.
Optionally, the apparatus further comprises: a generating module, configured to generate an ending data packet according to transmission identifier information corresponding to the original data, a number of the current group of data packets, retransmission times, transmission completion identifier information, and a check code of the current group of data packets before the sending module sends the ending data packet to the second terminal, where the transmission identifier 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 identifier information, the number, the packet loss state, and a packet loss bitmap; the packet loss bitmap comprises a plurality of continuous bytes, each bit of each byte represents the 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.
Optionally, the obtaining module is further configured to obtain a state of the second terminal before the sending module sends the current set of data packets to the second terminal; the sending module is configured to send the current group of data packets to the second terminal when the state of the second terminal indicates an idle state.
Optionally, the obtaining module is configured to send 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.
Optionally, the handshake acknowledgement packet includes a first time, and the handshake response 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 resend the current group of data packets.
Optionally, the sending module is further configured to, after sending the ending data packet to the second terminal, if the receiving module does not receive the ending confirmation data packet returned by the second terminal within a time period corresponding to one or more delay time periods, resend the corresponding ending data packet to the second terminal.
The embodiment of the invention also discloses a device, which comprises: 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 a 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 enabling 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 a first terminal, namely a data sending terminal, acquires original data to be transmitted, and divides the original data into a plurality of group data packets, wherein each group data packet comprises a plurality of block data packets. And after sending the current group of data packets to the second terminal, sending the ending data packet to the second terminal. The end data packet may indicate that the current group data packet is sent. And the first terminal receives an ending confirmation data packet returned by the second terminal according to the ending data packet, wherein the ending confirmation data packet can indicate that the second terminal does not receive one or more block data packets in the current block data packet. And the first terminal retransmits one or more data packets which are not received by the second terminal to the second terminal according to the ending confirmation data packet and the form of the current group of data packets. After the second terminal receives each block data packet in the current group data packet, the first terminal sends the next group data packet to the second terminal.
After sending a group data packet composed of a plurality of block data packets, sending an end data packet to the second terminal to indicate that the group data packet is sent completely, waiting for the second terminal to return an end confirmation data packet, and indicating whether the second terminal receives all the block data packets through the end confirmation data packet. The method and the device avoid waiting for the response returned by the second terminal, namely the end confirmation data packet after sending one block data packet to the second terminal every time, reduce the time for the first terminal to wait for the response of the second terminal, and improve the efficiency of data transmission. And in addition, 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 the steps of one embodiment of a data transmission method of the present invention;
FIG. 2 is a flow chart of steps in another data transmission method embodiment of the present invention;
FIG. 3 is a flow chart of a data transmission method based on video network according to the present invention;
fig. 4 is a block diagram of a data transmission apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
In the data transmission scheme provided by the embodiment of the invention, the first terminal divides 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 of finishing sending the current group data packet. The second terminal may return an end acknowledgement packet to the first terminal according to the actual reception condition, where the end acknowledgement packet indicates that the block data packet is not received. And the first terminal retransmits the data packet which is not received by the second terminal to the second terminal according to the end confirmation data packet.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a data transmission method of the present invention is shown, where the method may specifically include the following steps:
step 101, obtaining original data to be transmitted.
In the embodiment of the present invention, the original data to be transmitted may be data of a certain data amount, such as text data, picture data, audio/video data, and the like. The embodiment of the present invention does not specifically limit the type, data amount, and the like of the original data.
At step 102, the original data is divided into a plurality of groups of data packets.
In an embodiment of the present invention, the original data may be segmented according to the data packetization information. The data packetization information may represent the segmentation requirements, segmentation identification, etc. of the original data. The specific data packetization information may be determined according to the type or amount of the original data. The data packetizing information may contain transmission identification information, data identification information of the original data, the data amount of the original data, the number of a plurality of packet data packets, the number of a plurality of block data packets contained per packet data packet, the data amount per block data packet, and the like. In the process of dividing the original data into a plurality of group data packets, how many group data packets (the number of a plurality of group data packets) the original data can be divided into, how many block data packets (the number of a plurality of block data packets) each group data packet can contain, and the data amount of each block data packet can be allocated to the original data. For example, the original data allocation may be divided into 50 groups of data packets, each group of data packets may contain 512 block data packets, and each block data packet may contain 1024 bytes. Furthermore, in order to distinguish different raw data, unique transmission identification information may also be set for each raw data. When each group of data packet is sent subsequently, the data packet carries the upper transmission identification information.
And 103, after sending the current group data packet to the second terminal, sending the ending data packet to the second terminal.
In the embodiment of the present invention, if the original data is divided into n groups of data packets, the first terminal sends at least n end data packets to the second terminal. And, after each transmission of a group of data packets, a corresponding end data packet is transmitted. And informing the second terminal through the ending data packet after the group of data packets, wherein the first terminal has sent a group of data packets before an ending data packet.
And 104, receiving an ending confirmation data packet returned by the second terminal according to the ending data packet.
In the embodiment of the invention, after receiving the current group data packet and the ending data packet after the current group data packet, the second terminal returns an ending confirmation data packet to the first terminal according to the actual receiving condition of the block data packet. The end confirmation data packet may indicate whether the second terminal receives all the data packets in the current group of data packets, and if not, may indicate which one or more data packets the second terminal did not receive specifically.
And 105, retransmitting one or more data packets which are not received by the second terminal to the second terminal according to the ending confirmation data packet and the form of the current group of data packets.
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 data packets in the current group of data packets, the block data packets that are not received by the second terminal are retransmitted to the second terminal. Moreover, when the block data packets are retransmitted, the block data packets are still transmitted in the form of current block data packets, that is, the current block data packets including the block data packets which are not received by the second terminal are transmitted to the second terminal, and the current block data packets which are retransmitted may only include the block data packets which are not received by the second terminal.
If the end acknowledgement packet indicates that the second terminal received all the block data packets in the current group of data packets, step 106 is executed.
Step 106, sending the next group of data packets to the second terminal.
In the embodiment of the invention, after the first terminal sends the next group of data packets to the second terminal, the second terminal still sends the ending data packets of the next group of data packets, and then the second terminal returns the ending confirmation data packets to the first terminal. The first terminal determines whether to send the block data packet in the next group of data packets to the second terminal again according to the end confirmation data packet, and the specific determination, sending and other processes may refer to the above steps 103 to 105, which is not described herein again.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a data transmission method according to the present invention is shown, where the method may specifically include the following steps:
step 201, obtaining original data to be transmitted and the state of the second terminal.
In the embodiment of the present invention, when the state of the second terminal is obtained, 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 is received, where the handshake response data packet may include the state of the second terminal.
In practical application, the packet structure of the handshake acknowledgement packet is shown in the following table:
Figure BDA0002496839360000071
after receiving the handshake confirmation data packet, the second terminal may 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 The second time
Wherein, the "state information" represents the current state of the second terminal, and may include but is not limited to: free, busy, etc. The "second time" represents the current time when the handshake acknowledgement packet is received by the second terminal.
After receiving the handshake response packet, the first terminal may generate a delay duration according to the second time and the first time. The delay time may be used to determine whether to resend the current group of data packets. In practical application, the time period obtained by subtracting the first time from the second time may be used as the delay time.
At step 202, the original data is divided into a plurality of groups of data packets.
In an embodiment of the invention, the original data is divided into a plurality of data packets, each data packet comprising a plurality of data packets. In practical applications, the packet structure of a group packet is shown in the following table:
Figure BDA0002496839360000081
and step 203, after the current group of data packets are sent, sending the ending data packet to the second terminal.
In the embodiment of the invention, after the first terminal sends one group of data packets to the second terminal, the first terminal sends one ending data packet to the second terminal. An end packet may indicate that a group of packets has been sent. The end data packet may be sent to the second terminal immediately after the group data packet.
In practical application, the first terminal may generate an end data packet of the current group data packet according to the transmission identifier information, the number of the current group data packet, the number of retransmissions, the identifier information of the end of transmission, and the check code of the current group data packet. The transmission identification information may indicate that the original data is transmitted 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 the number of transmissions, the transmission time, and the like. Any one of the above factors is changed, and the transmission identification information is also changed accordingly. The packet structure of the trailing data packet is shown in the following table:
Figure BDA0002496839360000082
wherein, in case that the first terminal does not retransmit the block data packet of the current group of data packets, the number of retransmissions may be 0. The transmission completion identification information may be set according to actual conditions, and the embodiment of the present invention does not specifically 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 confirmation data packet according to the actual reception condition of the block data packet. In practical application, the second terminal may generate the end confirmation data packet according to the transmission identifier information, the number of the current group data packet, the packet loss state, and the packet loss bitmap. The packet structure of the end acknowledgement packet is shown in the following table:
Figure BDA0002496839360000083
the packet loss state may indicate that there is packet loss or there is no packet loss. The packet loss bitmap may include a plurality of consecutive bytes, and each bit of each byte indicates a sequence number of each block data packet in the current block data packet. And when the value of a certain bit in the byte is 1, the second terminal does not receive the block data packet of the sequence number corresponding to the bit. And when the value of a certain bit in the byte is 0, the second terminal receives the block data packet of the sequence number corresponding to the bit.
And step 204, receiving a tail confirmation data packet returned by the second terminal, and resending the block data packet which is not received by the second terminal according to the tail confirmation data packet.
In the embodiment of the invention, the first terminal receives an end confirmation data packet returned by the second terminal, analyzes the end confirmation data packet, and retransmits the block data packet of the sequence number corresponding to a bit if the packet loss state in the end confirmation data packet is that packet loss exists and the value of a bit of a byte in a packet loss bitmap is 1.
In an exemplary embodiment of the present invention, after the first terminal sends the end data packet of the current group of data packets to the second terminal, if the end confirmation data packet returned by the second terminal is not received within a time period corresponding to one or more delay time lengths, the end data packet is sent to the second terminal again. The purpose of setting the delay time length is to set a time period threshold for the first terminal to wait for the end confirmation data packet, so that the first terminal is prevented from influencing the transmission of the subsequent group of data packets due to the long-time end confirmation data packet waiting.
Based on the above-mentioned related description about the data transmission method, a data transmission method based on the video network is described below. Fig. 3 is a schematic flow chart illustrating a data transmission method based on a video network according to an embodiment of the present invention. The data transmission method based on the video network is applied to a data sending terminal and a data receiving terminal. Before transmitting data, the data transmitting terminal transmits a handshake acknowledgement packet to the data receiving terminal. And the data receiving terminal receives the handshake confirmation packet and returns a handshake response packet to the data sending terminal. The purpose of the data sending terminal sending the handshake confirmation packet to the data receiving terminal is as follows: a. notifying the data receiving terminal of the relevant information of the 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 data to be transmitted. b. And confirming the state information of the data receiving terminal, and determining that the data receiving terminal can normally receive the data to be transmitted. c. And confirming the delay time of data transmission between the data sending terminal and the data receiving terminal, wherein the delay time can be used for subsequent data transmission overtime judgment. The data transmission terminal divides data to be transmitted into a plurality of group data packets (group packet data) according to data packetization information set in advance, for example, each group data packet contains 512 block data packets (block packet data), and each block data packet contains 1024 bytes. And the data sending terminal sends the group data packets to the data receiving terminal in sequence. After each group of data packets is sent to the data receiving terminal, the data sending terminal sends an ending data packet (a group packet ending packet) to the data receiving terminal, and the ending data packet indicates that one group of data packets is sent. And after the data receiving terminal receives the ending data packet, sequencing and checking the received block data packet. If some or some of the block data packets are missing, an end acknowledgement data packet (a group packet end acknowledgement packet) is returned to the data transmission terminal. And the missing block data packet is represented in the form of a packet loss bitmap in the ending confirmation data packet. For example: the packet loss bitmap is a block of 1024 continuous bytes, each bit of each byte represents the sequence number of one block data packet, 8 bits of the first byte represent the block data packets with the sequence numbers of 0-7, 8 bits of the second byte represent the block data packets with the sequence numbers of 8-15, and so on, if the block data packets with the sequence numbers corresponding to the bits are missing, the value of the bit is set to 1. And after the data sending terminal receives the ending confirmation data packet, if the missing block data packet exists, the missing block data packet is sent to the data receiving terminal again, and the ending data packet is sent to the data receiving terminal again. And the data receiving terminal performs sequencing check on the block data packets according to the ending data packets again, returns ending confirmation data packets to the data sending terminal again, and circulates in such a way until all the block data packets in the group of data packets are received by the data receiving terminal, so that the data sending terminal continues to transmit the next group of data packets after the transmission of one group of data packets is finished.
It should be noted that, if the group of data packets are transmitted by the video networking protocol, the data amount of the video networking protocol header and the payload data portion (block data packet) usually cannot exceed 1500 bytes. The block data packet may conform to format requirements of multiple versions such as IEEE802.3, IEEE802.2, etc., for example, the ethernet frame format of IEEE802.3 is as shown in the following table:
lead code Start of frame delimiter Destination physical address Source physical address Type of protocol Load data Frame check sequence
The embodiment of the invention provides a data transmission scheme, which is characterized in that a first terminal, namely a data sending terminal, acquires original data to be transmitted, and divides the original data into a plurality of group data packets, wherein each group data packet comprises a plurality of block data packets. And after sending the current group of data packets to the second terminal, sending the ending data packet to the second terminal. The end data packet may indicate that the current group data packet is sent. And the first terminal receives an ending confirmation data packet returned by the second terminal according to the ending data packet, wherein the ending confirmation data packet can indicate that the second terminal does not receive one or more block data packets in the current block data packet. And the first terminal retransmits one or more data packets which are not received by the second terminal to the second terminal according to the ending confirmation data packet and the form of the current group of data packets. After the second terminal receives each block data packet in the current group data packet, the first terminal sends the next group data packet to the second terminal.
After sending a group data packet composed of a plurality of block data packets, sending an end data packet to the second terminal to indicate that the group data packet is sent completely, waiting for the second terminal to return an end confirmation data packet, and indicating whether the second terminal receives all the block data packets through the end confirmation data packet. The method and the device avoid waiting for the response returned by the second terminal, namely the end confirmation data packet after sending one block data packet to the second terminal every time, reduce the time for the first terminal to wait for the response of the second terminal, and improve the efficiency of data transmission. And in addition, 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 role of unique identification when the original data is transmitted between the first terminal and the second terminal. That is, a certain transmission of a certain original data between a first terminal and a second terminal, the transmission identification information has uniqueness corresponding to the original data, the first terminal and the second terminal, and the transmission. The transmission identification information can be distinguished from other original data, other first terminals and second terminals, and other transmission times by setting the transmission identification information.
According to the embodiment of the invention, the receiving condition of the second terminal to the block data packet in the current group of data packets is represented by the packet loss bitmap in the end confirmation data packet, so that the block data packet which is not received by the second terminal can be more intuitively represented, and the first terminal can conveniently master the condition that the second terminal does not receive the block data packet.
The first terminal determines the delay time length according to the handshake confirmation data and the handshake response data packet, and aims to set a time period threshold value for the first terminal to wait for the end confirmation data packet, so that the first terminal is prevented from influencing the transmission of the subsequent group of data packets due to the long-time waiting of the end confirmation data packet.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 4, a block diagram of a data transmission apparatus according to an embodiment of the present invention is shown, where the apparatus is applied to a first terminal, and the apparatus may specifically include the following modules:
an obtaining module 41, configured to obtain original data to be transmitted;
a dividing module 42 for dividing the original data into a plurality of group data packets, each of the group data packets including a plurality of block data packets;
a sending module 43, configured to send an end data packet to the second terminal after sending the current group of data packets to the second terminal, where the end data packet indicates that the sending of the current group of data packets is completed;
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 current group of data packets;
the sending module 43 is further configured to resend one or more of the block data packets that 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 block data packet.
The sending module 43 is further configured to send the next group of data packets to the second terminal after the second terminal receives each of the current group of data packets.
In an exemplary embodiment of the invention, the apparatus further comprises: a generating module, configured to generate an ending data packet according to transmission identifier information corresponding to the original data, a number of the current group of data packets, a retransmission frequency, transmission completion identifier information, and a check code of the current group of data packets before the sending module 43 sends the ending data packet to the second terminal, where the transmission identifier 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 identifier information, the number, the packet loss status, and a packet loss bitmap;
the packet loss bitmap comprises a plurality of continuous bytes, each bit of each byte represents the 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 status of the second terminal before the sending module 43 sends the current set of data packets to the second terminal;
the sending module 43 is configured to send the current group of data packets 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 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.
In an exemplary embodiment of the present invention, the handshake confirmation packet includes a first time, and the handshake response 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 resend the current group of data packets.
In an exemplary embodiment of the present invention, the sending module 43 is further configured to, after sending a tail data packet to the second terminal, if the receiving module 44 does not receive the tail confirmation data packet returned by the second terminal within a time period corresponding to one or more of the delay time lengths, resend the corresponding tail data packet to the second terminal.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, 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 present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, 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 terminal 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 terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal 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 of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The data transmission method, the data transmission device and the storage medium provided by the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data transmission method, applied to a first terminal, the method comprising:
acquiring original data to be transmitted;
dividing the raw data into a plurality of group data packets, each of the group data packets containing a plurality of block data packets;
after the current group of data packets are sent to a second terminal, sending an ending data packet to the second terminal, wherein the ending data packet represents that the current group of data packets are 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 of the current data packets in the group of data packets;
according to the ending confirmation data packet and according to the form of the current group of data packets, retransmitting one or more 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 of data packets, sending the next group of data packets to the second terminal.
2. The method of claim 1, wherein before said sending the end packet to the second terminal, the method further comprises:
and generating the ending data packet according to transmission identification information corresponding to the original data, the number of the current group of data packets, the retransmission times, transmission completion identification information and the check code of the current group of data packets, wherein the transmission identification information indicates that the original data is transmitted between the first terminal and the second terminal.
3. The method according to claim 2, wherein the second terminal is configured to generate the end acknowledgement packet according to the transmission identifier information, the number, the packet loss status, and a packet loss bitmap;
the packet loss bitmap comprises a plurality of continuous bytes, each bit of each byte represents the 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.
4. The method of claim 1, wherein before the sending 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 of data packets to the second terminal includes:
and when the state of the second terminal represents an idle state, sending the current group of data packets to the second terminal.
5. The method of claim 4, wherein the 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.
6. The method of claim 5, wherein the handshake acknowledgement packet comprises a first time, and the handshake response packet further comprises a second time;
the method further comprises the following steps:
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.
7. The method of claim 6, wherein after the 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 the time period corresponding to one or more delay time lengths, retransmitting the ending data packet to the second terminal.
8. A data transmission apparatus, applied to a first terminal, the apparatus comprising:
the acquisition module is used for acquiring original data to be transmitted;
a dividing module for dividing the original data into a plurality of group data packets, each of the group data packets including a plurality of block data packets;
a sending module, configured to send an end data packet to a second terminal after sending the current group of data packets to the second terminal, where the end data packet indicates that the sending of the current group of data packets is completed;
a receiving module, configured to receive an end acknowledgement data packet returned by the second terminal according to the end data packet, where the end acknowledgement data packet indicates that the second terminal does not receive one or more of the current group of data packets;
the sending module is further configured to resend one or more of the block data packets that 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 block data packet;
the sending module is further configured to send the next group of data packets to the second terminal after the second terminal receives each of the current group of data packets.
9. An apparatus, comprising:
one or more processors; and
one or more machine-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the data transmission method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that it stores a computer program that causes a processor to execute the data transmission method according to any one of claims 1 to 7.
CN202010420614.0A 2020-05-18 2020-05-18 Data transmission method, device and storage medium Pending CN111740809A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010420614.0A CN111740809A (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 CN111740809A (en) 2020-05-18 2020-05-18 Data transmission method, device and storage medium

Publications (1)

Publication Number Publication Date
CN111740809A true CN111740809A (en) 2020-10-02

Family

ID=72647378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010420614.0A Pending CN111740809A (en) 2020-05-18 2020-05-18 Data transmission method, device and storage medium

Country Status (1)

Country Link
CN (1) CN111740809A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080159205A1 (en) * 2006-12-25 2008-07-03 Masahiro Sekiya Wireless communication apparatus
CN101594366A (en) * 2004-08-11 2009-12-02 株式会社东芝 Communication equipment and communication means
CN103858373A (en) * 2011-09-02 2014-06-11 高通股份有限公司 Improved fragmentation for long packets in a low-speed wireless network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594366A (en) * 2004-08-11 2009-12-02 株式会社东芝 Communication equipment and communication means
US20080159205A1 (en) * 2006-12-25 2008-07-03 Masahiro Sekiya Wireless communication apparatus
CN103858373A (en) * 2011-09-02 2014-06-11 高通股份有限公司 Improved fragmentation for long packets in a low-speed wireless network

Similar Documents

Publication Publication Date Title
CN106793091A (en) Base station, user equipment and data transmission method
CN109152071B (en) Data transmission indication and data transmission method, base station, terminal and storage medium
EP2140622B1 (en) Token bus communication system
CN108900433B (en) Method, terminal and server for transmitting lora message
CN111769915B (en) Data transmission method and related equipment
US10313083B2 (en) Method for hybrid automatic repeat request process, network device and terminal device
CN111431672A (en) Data retransmission method and device, storage medium and electronic device
CN103944880B (en) A kind of method of ZigBee data transfers
CN111209240A (en) Data transmission method, electronic equipment and storage medium
CN108347788B (en) Data concurrent transmission method based on Slotted-FAMA protocol and utilizing propagation delay
CN107548104B (en) Data transmission method, access point and station
CN101030841B (en) Method and apparatus for notifying protocol unit length variation
CN111740809A (en) Data transmission method, device and storage medium
CN113541874A (en) Data transmission method and network equipment
CN111543079B (en) Radio Link Control (RLC) Acknowledged Mode (AM) data reception
CN101989896B (en) Feedback method and device for ARQ connection
CN113055131B (en) Data processing method, data segmentation method, computing device and medium
CN110690949B (en) Information configuration method and equipment
JPWO2003028314A1 (en) COMMUNICATION METHOD, TRANSMISSION DEVICE, RECEPTION DEVICE, COMMUNICATION PROGRAM, COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE COMMUNICATION PROGRAM, AND NETWORK SYSTEM
CN104581978A (en) User terminal and channel access method
CN111756482B (en) Acknowledgement feedback method, device and computer readable storage medium
CN110545266B (en) GIS system-based data transmission method with variable priority
US20230133896A1 (en) Data Transmission Method, Primary Apparatus, Wireless Network Communication Technology Chip
CN111404645B (en) Data transmission method, device, medium and equipment
CN108768598B (en) Method and device for transmitting downlink control information in ultrahigh-reliability ultralow-time communication

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