CN110299973B - Receiving method and device for data rolling transmission - Google Patents
Receiving method and device for data rolling transmission Download PDFInfo
- Publication number
- CN110299973B CN110299973B CN201810246777.4A CN201810246777A CN110299973B CN 110299973 B CN110299973 B CN 110299973B CN 201810246777 A CN201810246777 A CN 201810246777A CN 110299973 B CN110299973 B CN 110299973B
- Authority
- CN
- China
- Prior art keywords
- transmission
- packet
- data packet
- data
- data packets
- 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
- 230000005540 biological transmission Effects 0.000 title claims abstract description 372
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000005096 rolling process Methods 0.000 title claims abstract description 36
- 238000012795 verification Methods 0.000 claims abstract description 26
- 238000004364 calculation method Methods 0.000 claims abstract description 22
- 238000012545 processing Methods 0.000 claims description 20
- 238000004422 calculation algorithm Methods 0.000 description 16
- 230000002829 reductive effect Effects 0.000 description 14
- 230000004044 response Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 7
- 230000003993 interaction Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 4
- 230000002452 interceptive effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 230000001681 protective effect Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- 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/1607—Details of the supervisory signal
- H04L1/1642—Formats specially adapted for sequence numbers
-
- 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/1832—Details of sliding window management
-
- 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/1835—Buffer management
-
- 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/1864—ARQ related signaling
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Communication Control (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a receiving method and a device for data rolling transmission, wherein the method comprises the following steps: presetting S cache units, and numbering the S cache units in sequence; receiving transmission data packets, wherein the transmission data packets comprise Q data packets, transmission packet check values and the serial numbers of all data packets of the transmission data packets sent at the kth time, and the packet head of each data packet at least comprises the serial numbers of the data packets; acquiring each data packet of the transmission data packet sent at the kth time; carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value; and comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check value and the transmission packet check comparison value are consistent, sequentially judging whether the data packets exist in the cache units corresponding to the numbers of the Q data packets, storing the data packets corresponding to the numbers in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
Description
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a method and an apparatus for receiving rolling data transmission.
Background
In the existing network data transmission, each time a transmission layer transmits a data packet, a receiving end returns a corresponding ACK (Acknowledgement) response to the successfully received data packet; if the sender does not receive the ACK response within a reasonable Round-Trip Time (RTT), the corresponding packet is assumed to be lost and will be retransmitted. Under the existing communication protocol, after a sending end sends a data packet, the sending end needs to wait for an ACK response sent by a receiving end before continuing to send the next data packet, and the sending end and the receiving end need to have data interaction once, although the reliability is strong, the transmission efficiency is low. Moreover, under the condition of poor network conditions, the data can be retransmitted for many times, the use is unstable, and network resources are wasted.
Disclosure of Invention
The present invention aims to solve one of the above problems.
The invention mainly aims to provide a method for transmitting data rolling transmission.
Another object of the present invention is to provide a transmitting apparatus for scrolling data.
Another object of the present invention is to provide a receiving method for rolling data transmission.
Another object of the present invention is to provide a receiving device for rolling data transmission.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
one aspect of the present invention provides a method for transmitting data rolling transmission, including: acquiring a message to be transmitted, wherein the message to be transmitted consists of N data packets; the N data packets are numbered in sequence, and the packet head of each data packet at least comprises a number distributed to the data packet; determining the length of a transmission data window, wherein the length of the transmission data window is used for determining the number M of data packets contained in one transmission data packet, M, N is a positive integer, and M is less than or equal to N; sending the message to be transmitted according to the following steps: a.i is 1, wherein i is the number of times of sending the current transmission data packet, and the value of i is 1,2,3 … …, N-M + 1; B. placing the initial position of the transmission data window at a data packet with the number i; selecting an ith transmission data packet to be sent according to the length of the transmission data window, wherein the ith transmission data packet to be sent comprises M data packets numbered from i to i + M-1; C. performing check calculation on data of M data packets of an ith to-be-transmitted transmission data packet and data of each data packet of a kth received transmission data packet to obtain a transmission packet check value, and transmitting the ith to-be-transmitted transmission data packet, wherein the ith to-be-transmitted transmission data packet further includes: the transmission packet check value and the number of each data packet of the transmission data packet received at the kth time, wherein k is a positive integer; D. judging whether i +1 is less than or equal to N-M +1, if so, changing i to i +1, and returning to the step B; and if not, finishing sending the message to be transmitted.
Optionally, after sending the transmission data packet to be sent for the ith time, the method further includes: receiving a retransmission request, wherein the retransmission request at least comprises the number n of a data packet to be retransmitted, and n is not more than i; placing the initial position of the transmission data window at a data packet with the number of n; and selecting a transmission data packet to be retransmitted according to the length of the transmission data window, wherein the transmission data packet to be retransmitted for the nth time comprises M data packets numbered from n to n + M-1, and transmitting the transmission data packet to be retransmitted.
Optionally, the message to be transmitted is a UDP message, and before the obtaining of the message to be transmitted, the method further includes: and dividing the message to be transmitted into the N data packets according to a preset strategy.
Optionally, the ith transmission data packet to be sent further includes: a UDP pseudo header and a UDP header; the UDP header includes: checking the sum; before the sending of the transmission data packet to be sent for the ith time, the method further includes: and calculating to obtain the checksum according to the UDP pseudo header, the UDP header and the data of the M data packets in the ith transmission data packet to be sent.
Another aspect of the present invention provides a transmitting apparatus for rolling data transmission, including: the device comprises an acquisition module, a transmission module and a transmission module, wherein the acquisition module is used for acquiring a message to be transmitted, and the message to be transmitted consists of N data packets; the data packet processing module is used for numbering the N data packets in sequence, and the packet head of each data packet at least comprises a number distributed to the data packet; a transmission data window configuration module, configured to determine a length of a transmission data window, where the length of the transmission data window is used to determine the number M of data packets included in one transmission data packet, M, N is a positive integer, and M is less than or equal to N; a sending module, configured to send the packet to be transmitted according to the following steps: a.i is 1, wherein i is the number of times of sending the current transmission data packet, and the value of i is 1,2,3 … …, N-M + 1; B. placing the initial position of the transmission data window at a data packet with the number i; selecting an ith transmission data packet to be sent according to the length of the transmission data window, wherein the ith transmission data packet to be sent comprises M data packets numbered from i to i + M-1; C. performing check calculation on data of M data packets of an ith to-be-transmitted transmission data packet and data of each data packet of a kth received transmission data packet to obtain a transmission packet check value, and transmitting the ith to-be-transmitted transmission data packet, wherein the ith to-be-transmitted transmission data packet further includes: the transmission packet check value and the number of each data packet of the transmission data packet received at the kth time, wherein k is a positive integer; D. judging whether i +1 is less than or equal to N-M +1, if so, changing i to i +1, and returning to the step B; and if not, finishing sending the message to be transmitted.
Optionally, the apparatus further comprises: a receiving module, wherein: the receiving module is used for receiving a retransmission request, wherein the retransmission request at least comprises the number n of a data packet to be retransmitted, and n is less than or equal to i; the sending module is further configured to place the start position of the transmission data window at the data packet numbered n; and selecting the transmission data packets to be retransmitted according to the length of the transmission data window, wherein the transmission data packets to be retransmitted comprise M data packets numbered from n to n + M-1, and sending the transmission data packets to be retransmitted.
Optionally, the apparatus further comprises: and the message processing module is used for dividing the message to be transmitted into the N data packets according to a preset strategy.
Optionally, the ith transmission data packet to be sent further includes: a UDP pseudo header and a UDP header; the UDP header includes: checking the sum; the data packet processing module is further configured to calculate the checksum according to the UDP pseudo header, the UDP header, and the data of the M data packets of the ith to-be-transmitted transmission data packet.
Another aspect of the present invention provides a method for receiving rolling data transmission, including: presetting S cache units, and numbering the S cache units in sequence, wherein one cache unit is used for storing one data packet; receiving transmission data packets, wherein the transmission data packets comprise Q data packets, transmission packet check values and the serial numbers of all data packets of the transmission data packets sent at the kth time, the packet head of each data packet at least comprises the serial numbers of the data packets, k, S and Q are positive integers, Q is less than or equal to S, and k is less than S; acquiring each data packet of the transmission data packet sent at the kth time according to the number of each data packet of the transmission data packet sent at the kth time; carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value of the transmission data packet; and comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check comparison value is consistent with the transmission packet check comparison value, passing the check, sequentially judging whether the cache units corresponding to the numbers of the Q data packets store the data packets, storing the data packets corresponding to the numbers of the cache units in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
Optionally, after receiving the transmission data packet, the method further includes: judging whether n is satisfied1=n2+1, where n1 is the smallest number among the numbers of the Q packets, n2The number is the minimum number in the numbers of the cache units which do not store the data packets; if yes, sending a retransmission request to a sending end, wherein the retransmission request comprises the number n of the data packet requesting retransmission2。
Optionally, the transmitting the data packet further includes: a UDP pseudo header and a UDP header; the UDP header includes: checking the sum; after receiving the transmission data packet, before storing the data packet corresponding to the number thereof in the buffer unit which does not store the data packet, the method further comprises: calculating to obtain a comparison check sum of the transmission data packet according to the UDP pseudo header, the UDP header and the Q data packets; and comparing the checksum of the transmission data packet with the comparison checksum, if the checksum is consistent with the comparison checksum, passing the verification, and executing the step of storing the data packet corresponding to the serial number in the cache unit which does not store the data packet.
Another aspect of the present invention provides a receiving apparatus for rolling data transmission, including: s buffer memory cell, processing module, receiving module and control module, wherein: the processing module is used for numbering the S cache units in sequence, wherein one cache unit is used for storing one data packet; the receiving module is used for receiving transmission data packets, wherein the transmission data packets comprise Q data packets, transmission packet check values and serial numbers of all data packets of the transmission data packets sent for the kth time, the packet head of each data packet at least comprises the serial numbers of the data packets, k, S and Q are positive integers, Q is less than or equal to S, and k is less than S; the control module is used for acquiring each data packet of the transmission data packet sent at the kth time according to the number of each data packet of the transmission data packet sent at the kth time; carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value of the transmission data packet; and comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check comparison value is consistent with the transmission packet check comparison value, passing the check, sequentially judging whether the cache units corresponding to the numbers of the Q data packets store the data packets, storing the data packets corresponding to the numbers of the cache units in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
Optionally, the apparatus further comprises: a sending module, wherein: the control module is also used for judging whether n is satisfied1=n2+1, wherein n1Is the smallest number, n, of the numbers of the Q data packets2The number is the minimum number in the numbers of the cache units which do not store the data packets; if yes, controlling the sending module to send a retransmission request to the sending end; the sending module is configured to send the retransmission request to the sending end, where the retransmission request includes a number n of a data packet requested to be retransmitted2。
Optionally, the transport packet further includes a UDP dummy header and a UDP header; the UDP header includes: checking the sum; the control module is further configured to calculate a comparison checksum of the transmission data packet according to the UDP pseudo header, the UDP header, and the Q data packets; and comparing the comparison check sum and the check sum of the transmission data packet, if the comparison check sum and the check sum are consistent, passing the check, and executing the step of storing the data packet corresponding to the serial number in the cache unit which does not store the data packet.
According to the technical scheme provided by the invention, the data packet and the cache unit are correspondingly numbered, the same data packet can be repeatedly received for many times, the data packet is stored in the corresponding cache unit according to the number, and when a certain data packet generates transmission errors or packet loss in the transmission process, the data packet can be repeatedly received for many times, so that the packet loss of the data packet can be avoided to the greatest extent, and the retransmission probability is reduced. In addition, the receiving end does not need to return an ACK response in the transmission process, and the sending end does not need to wait for the ACK response returned by the receiving end, so that the interaction between the sending end and the receiving end can be reduced, the efficiency of data transmission is improved, and the risk of packet loss possibly caused by the fact that interactive feedback is not needed can be reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a method for transmitting data rolling transmission according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram of a format of a packet header of a data packet according to embodiment 1 of the present invention;
fig. 3 is a schematic diagram of determining a transmission data packet in a transmission data window according to embodiment 1 of the present invention;
fig. 4 is a schematic diagram of a format of a UDP transport packet according to embodiment 1 of the present invention;
fig. 5 is a flowchart of a receiving method for rolling data transmission according to embodiment 2 of the present invention;
fig. 6 is a schematic structural diagram of a data transmission system according to embodiment 3 of the present invention;
fig. 7 is a schematic structural diagram of a transmitting apparatus for scrolling data transmission according to embodiment 3 of the present invention;
fig. 8 is a schematic structural diagram of a receiving apparatus for rolling data transmission according to embodiment 3 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or quantity or location.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
Example 1
The embodiment provides a method for transmitting data rolling transmission. As shown in fig. 1, the method for transmitting the data rolling transmission includes the following steps (S101-S104):
s101, obtaining a message to be transmitted, wherein the message to be transmitted consists of N data packets;
in this embodiment, the message to be transmitted may be a TCP/IP Protocol message, or may also be a User Datagram Protocol (UDP) message. The message to be transmitted can be divided into N data packets, where N is a positive integer.
Among existing UDP transport protocols, the UDP protocol is a connectionless transport layer protocol in an Open System Interconnection (OSI) reference model, and provides a simple and unreliable information transfer service. In the network it is used to process UDP packets as well as the TCP/IP protocol. However, UDP does not provide for packet grouping, packing, and packet ordering, i.e., after a packet is sent, it cannot be known whether it arrives safely and completely. The UDP protocol cannot guarantee that the data packet can be accurately transmitted to the receiving end, and the receiving end does not need to confirm the received UDP packet. In this embodiment, when the message to be transmitted is a UDP message, as an optional implementation manner, before obtaining the message to be transmitted, the method provided in this embodiment further includes: and dividing the message to be transmitted into N data packets according to a preset strategy. For example, the packet size may be set according to the maximum capacity of the packets allowed to be transmitted by the network, and the packet to be transmitted may be divided. For another example, the value of N may be set, for example, to 100, and the message to be transmitted is divided into 100 data packets with the same size. For another example, the packet to be transmitted is divided according to a preset algorithm in combination with the current stable state of the network. The dividing method of the packet to be transmitted in this embodiment is not particularly limited, as long as the packet to be transmitted can be divided into a plurality of data packets, and the transmission of the data packet is completed in a manner of sending the data packets.
S102, numbering N data packets in sequence, wherein the packet head of each data packet at least comprises a number distributed to the packet head;
in this embodiment, after a packet to be transmitted, which is composed of N data packets, is obtained, the N data packets are numbered sequentially, and the number of the N data packets is 1,2, … …, N in order to perform iterative sending of the data packets according to the numbers, thereby implementing multiple sending of one data packet, reducing the probability of retransmission, reducing the risk of packet loss that may be caused by no need of interactive feedback in the transmission process, and improving the efficiency of data transmission.
In this embodiment, when the packet to be transmitted is a UDP packet, different from the existing UDP transmission protocol, the embodiment performs packet packetization on the UDP packet to be transmitted, allocates a number to each UDP packet, and sends the UDP packet to be transmitted in a manner as described in step S104 below. In this embodiment, the receiving end does not need to confirm the received UDP data packet, but the same UDP data packet is repeatedly transmitted many times, so that the data packet can be accurately transmitted to the receiving end, and the probability of retransmission is reduced.
A data packet includes a packet header and data, where the packet header at least includes a number allocated to the data packet, and the number can uniquely identify the data packet, and both the sending end and the receiving end can identify the data packet according to the number, for example, the receiving end can carry the number of the data packet that has not been received in a retransmission request sent to the sending end, and the sending end can retransmit the corresponding data packet according to the number. As an alternative, the format of the packet header is shown in fig. 2, and the packet header may include: source port, destination port, number, packet length, and check value. The packet header shown in fig. 2 is only an optional embodiment, and the packet header may be added or subtracted according to specific needs.
S103, determining the length of a transmission data window, wherein the length of the transmission data window is used for determining the number M of data packets contained in one transmission data packet, M is a positive integer and is less than or equal to N;
in this embodiment, the sending end sends one transmission data packet at a time until all the N data packets of the obtained message to be transmitted are sent. The number M of data packets included in each transmission data packet is determined by the length of the transmission data window, and the data packets covered by the transmission data window, that is, the data packets in the window are the M data packets included in the transmission data packet that needs to be sent this time. The number of M may be determined according to the carrying capacity of the network transmission capability and the stability of the current data transmission. The larger the value of M is, the higher the requirement on network transmission is, and the lower the packet loss rate is. As an alternative, the numbers of M packets in each transport packet are sequentially incremented, for example, M is 3, the numbers of the packets in the 1 st transport packet are 1,2 and 3, the numbers of the packets in the 2 nd transport packet are 2,3, 4 and … … until the number of the last transport packet is N-2, N-1 and N. The window floats back once after each transmission of a transmission packet. Fig. 3 only exemplarily shows a schematic diagram that a transmission data window determines one transmission data packet, where a header of each data packet at least includes a number of the data packet, and a packet to be transmitted includes N data packets numbered in sequence. Of course, the numbers of the M packets are also sequentially decremented. Alternatively, the transmission data window may be floated forward once after each transmission of a transmission data packet. As long as iterative transmission of data packets can be achieved.
S104, sending the message to be transmitted according to the following steps:
a.i is 1, wherein i is the number of times of sending the current transmission data packet, and the value of i is 1,2,3 … …, N-M + 1;
when i is 1, it indicates that the transmission packet is currently transmitted for the 1 st time. Because the message to be transmitted has N data packets, the Nth data packet can be transmitted only by transmitting the data packets for N-M +1 times in total.
B. Placing the initial position of a transmission data window at a data packet with the number i; selecting an ith transmission data packet to be sent according to the length of a transmission data window, wherein the ith transmission data packet to be sent comprises M data packets numbered from i to i + M-1;
C. performing check calculation on data of M data packets of the ith to-be-transmitted transmission data packet and data of each data packet of the kth received transmission data packet to obtain a transmission packet check value, and transmitting the ith to-be-transmitted transmission data packet, wherein the ith to-be-transmitted transmission data packet further comprises: a transmission packet check value and the number of each data packet of a transmission data packet received at the kth time, wherein k is a positive integer;
as shown in fig. 3, when i is 1, the start position of the transmission data window is placed at the packet numbered 1. For example, if M is 3, the transmission packet to be transmitted 1 st time includes packets numbered 1,2, and 3. When i is 2, the start position of the transmission data window is placed at the data packet numbered 2, and the transmission data packet to be sent for the 2 nd time includes the data packets numbered 2,3, and 4. When i is 3, the start position of the transmission data window is placed at the data packet numbered 3, and the transmission data packets to be transmitted for the 2 nd time include the data packets numbered 3, 4, and 5. It can be seen that when i is 3, the packet numbered 3 has been transmitted 3 times until i is N-M +1, i.e., the packets numbered from M to N-M +1 have been repeatedly transmitted M times. Therefore, by means of iterative sending of the data packets, when a certain data packet generates transmission errors or packet loss in the transmission process, the data packet can be repeatedly sent for M-1 times, so that the packet loss of the data packet can be avoided to the greatest extent, the data packet does not need to be retransmitted, and the probability of retransmitting the data packet is reduced. In this embodiment, the receiving end may not return an ACK response in the transmission process, and the sending end does not need to wait for the ACK response returned by the receiving end, so that interaction between the sending end and the receiving end can be reduced, the efficiency of data transmission is improved, and the risk of packet loss possibly caused by no interaction feedback can be reduced.
In this embodiment, the sending end may also receive a transmission data packet sent by a receiving end (an opposite end of the sending end), for example, the transmission data packet received the kth time is sent by the receiving end. Therefore, as an optional manner, the sending end may calculate a check value (i.e., a transmission packet check value) based on data of each data packet of a transmission data packet received by the sending end and data of each data packet of a transmission data packet to be sent, and after receiving the transmission data packet sent by the sending end, the receiving end may query the transmission data packet sent by the receiving end at a certain time according to the number of each data packet of the transmission data packet received by the sending end at the kth time (also the transmission data packet that the receiving end has sent once), and then the receiving end calculates a transmission packet comparison check value by using the data of the received transmission data packet and data of each data packet of the transmission data packet sent by the receiving end (i.e., the transmission data packet received by the sending end at the kth time), and compares the transmission packet comparison check value with the received transmission packet check value. In this embodiment, the sending end may use the received data of the transmission data packet to participate in calculating the check value, so as to increase the stability and accuracy of the check. For example, if the transmission data packet received by the transmitting end for the kth time is hijacked and tampered by the third party, the check value of the transmission packet calculated by the transmitting end is different from the comparison check value of the transmission packet calculated by the receiving end after receiving the transmission data packet sent by the transmitting end, and the check cannot pass, so that the receiving end can know the risk of packet loss, packet error or hijacked and tampered by the third party, and further take corresponding protective measures. Similarly, if the transmission data packet sent by the sending end this time is hijacked or tampered by a third party, the receiving end also checks that the transmission data packet cannot pass. Therefore, the sending end can increase the stability and accuracy of the verification by using the received data of the transmission data packet to participate in the calculation of the verification value, so that the integrity and the safety of the data packet can be more stably ensured. The specific Check calculation algorithm is not limited in this embodiment, and for example, the Check value of the transmission packet may be calculated by using an algorithm such as parity Check or Cyclic Redundancy Check (CRC). By sending the transmission data packet carrying the transmission packet check value, the receiving end can check the transmission data packet by adopting a corresponding algorithm after receiving the transmission data packet, so as to ensure the integrity and the safety (which are not tampered) of the received transmission data packet. The algorithm for calculating the check value of the transport packet is not limited in this embodiment, and for example, a parity check algorithm or a CRC algorithm, etc. may be used.
D. Judging whether i +1 is less than or equal to N-M + 1, if so, changing i to i +1, and returning to the step B; if not, the message to be transmitted is sent completely.
In this embodiment, N-M +1 transmission packets are transmitted in total from i-1 to i-N-M +1, the transmission data window floats back once every time a transmission packet is transmitted, and in the N-M +1 transmission packet, a packet numbered N-M +1 has been transmitted M times. And if the data packet with the number of N is contained in the (N-M +1) th transmission data packet, the message to be transmitted is considered to be sent completely.
In this embodiment, a data packet check value may also be carried in the packet header of each data packet, so that the receiving end performs integrity and security check on the received data packet according to the check value. As an optional implementation manner in this embodiment, the check value in the header of each data packet (as shown in fig. 2) may include: a data packet check value; before sending the message to be transmitted in step S104, the method provided in this embodiment further includes: calculating a packet check value for each packet by one of: carrying out check calculation on the serial number of the data packet and the data of the data packet to obtain a data packet check value; or, carrying out check calculation on the data of the data packet to obtain a data packet check value.
In this embodiment, a plurality of ways of calculating the check value of the data packet are provided, that is, the number and the data of the data packet may be subjected to check calculation, and the data of the data packet may also be subjected to check calculation, so that the check value of the data packet of each data packet is finally calculated. The specific Check calculation algorithm is not limited in this embodiment, and for example, the Check value of the data packet may be calculated by using an algorithm such as parity Check or Cyclic Redundancy Check (CRC). By sending the data packet carrying the check value, the receiving end can adopt a corresponding algorithm to check the data packet after receiving the data packet in the transmission data packet, so as to ensure the integrity and the safety (which are not tampered) of the received data packet.
In addition, in this embodiment, although the probability of retransmission can be greatly reduced by transmitting the data packet in an iterative manner, there is still a case of packet loss or packet error, for this reason, after the transmission data packet to be transmitted for the ith time is transmitted, the method provided in this embodiment further includes: a sending end receives a retransmission request sent by an opposite end, wherein the retransmission request at least comprises the number n of a data packet to be retransmitted, and n is less than or equal to i; the method comprises the steps that a sending end places the initial position of a transmission data window at a data packet with the number of n, selects a transmission data packet to be retransmitted according to the length of the transmission data window, the transmission data packet to be retransmitted comprises M data packets with the number of n to n + M-1, and sends the transmission data packet to be retransmitted. Here, the manner in which the transmitting end transmits the packet to be retransmitted is similar to that of step B, C in step S104, and reference may be made to the description of step B, C in step S104.
In this embodiment, as described above, the message to be transmitted may be a TCP/IP protocol message or a UDP message. When the message to be transmitted is a UDP message, taking transmission of the 1 st UDP transmission data packet as an example, the format of the UDP transmission data packet is shown in fig. 4, where a data portion of one UDP transmission data packet includes M data packets (see fig. 2 for data packet format), and taking M ═ 3 as an example, the M data blocks are sequentially connected together according to sequence numbers to form a data portion in the UDP transmission data packet. In addition, a UDP transport packet includes a UDP header and a UDP dummy header, wherein the UDP header occupies 8 bytes, which are a source port, a destination port, a length and a checksum, each of which occupies 2 bytes, and the UDP dummy header occupies 12 bytes. As an optional implementation manner, before sending the transmission data packet to be sent for the ith time, the method provided in this embodiment further includes: and calculating to obtain a checksum according to the UDP pseudo header, the UDP header and the data of the M data packets of the transmission data packet to be sent for the ith time, wherein the checksum can further verify the integrity and the safety of the UDP transmission data packet, and the stability and the accuracy of a verification result are improved.
In the method for transmitting the rolling data transmission provided by this embodiment, the data packets are numbered, and the data packets are iteratively transmitted according to the numbers, and when a transmission error or packet loss occurs in a transmission process of a certain data packet, the data packet can be repeatedly transmitted M-1 times, so that the packet loss of the data packet can be avoided to the greatest extent, and the probability of retransmission is reduced. In addition, the receiving end does not need to return an ACK response in the transmission process, and the sending end does not need to wait for the ACK response returned by the receiving end, so that the interaction between the sending end and the receiving end can be reduced, the efficiency of data transmission is improved, and the risk of packet loss possibly caused by the fact that interactive feedback is not needed can be reduced. And the integrity and the safety of the data packet can be ensured through the transmission of the plurality of check values mentioned above.
Example 2
The embodiment provides a receiving method for data rolling transmission. The receiving method of the data rolling transmission corresponds to the transmitting method of the data rolling transmission provided in embodiment 1. As shown in fig. 5, the receiving method of the data rolling transmission includes the following steps (S201 to S205):
s201, presetting S cache units, and numbering the S cache units in sequence, wherein one cache unit is used for storing one data packet;
in this embodiment, in order to store N data packets of the packet to be transmitted in embodiment 1, S cache units are preset at the receiving end, where S is a positive integer and should be greater than or equal to N. The receiving end numbers S cache units 1,2 and … … S in advance, the numbers of the first N cache units in the S cache units correspond to the numbers of the N data packets one by one, one cache unit is used for storing one data packet, and the data packet can only be stored in the cache unit corresponding to the number of the data packet. Therefore, the receiving end can only store the data packet corresponding to the serial number of the cache unit which does not store the data packet, and the data packet which is repeatedly received for many times can be discarded, so that the working efficiency of the receiving end is improved.
S202, receiving transmission data packets, wherein the transmission data packets comprise Q data packets, transmission packet check values and numbers of all data packets of the transmission data packets sent for the kth time, the packet head of each data packet at least comprises the numbers of the data packets, k, S and Q are positive integers, Q is less than or equal to S, and k is less than S;
the format of the transmission data packet received by the receiving end is the same as the format of the transmission data packet sent by the sending end in embodiment 1 and the format of each data packet, which may be specifically referred to the description in embodiment 1. According to the method of sending the packet to be transmitted in step S104 in embodiment 1, the receiving end also receives multiple (e.g., N-M +1) transmission data packets, where each transmission data packet includes Q data packets. For each data packet, the data packet is received repeatedly for multiple times (for example, M times), and since the header of each data packet includes the number of the data packet, it can be identified whether the data packet is received repeatedly according to the number, and a corresponding cache unit can also be found according to the number, so as to facilitate the subsequent step of whether the data packet is stored in the cache unit.
S203, acquiring each data packet of the transmission data packet sent for the kth time according to the number of each data packet of the transmission data packet sent for the kth time;
s204, carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value of the transmission data packet;
in this embodiment, similarly, corresponding to the manner of calculating the check value by the sending end, the receiving end also calculates the check comparison value by the same manner and algorithm, and the specific manner and algorithm for calculating the check comparison value of the transmission packet may refer to the description of calculating the check value of the transmission packet in embodiment 1.
The transmission data packet sent for the kth time can be a transmission data packet sent by the receiving end last time or a transmission data packet sent for the previous times, because the sending end calculates a transmission packet check value based on the data packet of the transmission data packet sent for the kth time, and the receiving end also calculates a transmission packet check comparison value based on the data packet of the transmission data packet sent for the kth time, the check will pass, but if the data or the number of each data packet of the transmission data packet sent for the kth time is hijacked and tampered by a third party, the check of the receiving end cannot pass, so that the receiving end can know the risk of packet loss, packet error or hijacked and tampered by the third party, and further take corresponding protection measures. Therefore, the receiving end can utilize the data of the transmitted data packet sent by the receiving end to participate in calculating the check comparison value, so that the stability and the accuracy of the check can be improved, and the integrity and the safety of the data packet can be ensured more stably.
S205, comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check value is consistent with the transmission packet check comparison value, passing the check, sequentially judging whether the data packets are stored in the cache units corresponding to the numbers of the Q data packets, storing the data packets corresponding to the numbers of the cache units in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
The numbers of Q data packets in the transmission data packets are sequentially numbered, such as 1,2,3, 4, and 5, and whether the corresponding buffer units (the numbers are also 1,2,3, 4, and 5) have stored data packets may be sequentially queried according to the numbers. The sending end sends the data packet in an iterative mode, so that the receiving end of the same data packet can receive the data packet repeatedly, if the data packet is stored in the cache unit, the data packet is discarded if the data packet is received, and if the data packet is not stored in the cache unit, the data packet is stored if the data packet is possibly received for the first time or the packet loss occurs. In addition, in this embodiment, the receiving end does not need to return an ACK response to the sending end after receiving the data packet, which reduces interaction between the sending end and the receiving end and can improve data transmission efficiency.
According to the method of sending the message to be transmitted in step S104 in embodiment 1, the receiving end also receives the multiple (e.g., N-M +1) transmission data packets, so as to receive the complete message to be transmitted. In the above, only how to operate after receiving one transmission data packet is described, but for any transmission data packet received by the receiving end, the receiving and storing modes can operate in the manners described in steps S202 to S205.
In this embodiment, the header of each data packet may also carry a data packet check value, and the data packet check value is used to perform a check comparison, so as to ensure the integrity and security of the data packet. As an optional implementation manner in this embodiment, the header of each data packet further includes a data packet check value; after receiving the transmission data packet in step S202, before storing the data packet corresponding to the number thereof in the cache unit that does not store the data packet in step S205, the method provided in this embodiment further includes: calculating the packet check comparison value of each data packet by one of the following methods: carrying out check calculation on the serial number of the data packet and the data of the data packet to obtain a data packet check comparison value; or, carrying out check calculation on the data of the data packet to obtain a data packet check comparison value; and comparing the data packet check value of each data packet with the data packet check comparison value, if the data packet check value of each data packet is consistent with the data packet check comparison value, passing the check, and executing the step of storing the data packet corresponding to the serial number in the cache unit which does not store the data packet.
Corresponding to the way of calculating the check value by the sending end, the receiving end also calculates the check comparison value in the same way as the sending end, for example, the sending end performs check calculation on the number and data of the data packet to obtain the check value of the data packet, and then the receiving end also performs check calculation on the number and data of the data packet to obtain the check comparison value of the data packet. Meanwhile, the same algorithm as that of the sending end is adopted to carry out check calculation on the data packets to obtain the data packet check comparison value of each data packet, for example, the sending end adopts the parity check algorithm to calculate, and then the receiving end also adopts the parity check algorithm to calculate. Specifically, the description in embodiment 1 may be referred to.
In this embodiment, after receiving a data packet in a transmission data packet, a receiving end may verify the data packet by using an algorithm corresponding to the sending end, so as to ensure integrity and security (without being tampered) of the received data packet.
In addition, the step of storing the data packet is executed after both checks (the double check of the verification value of the data packet and the verification of the verification value of the transmission packet) pass, and the subsequent steps are not executed as long as one check does not pass, so that the safety of data transmission can be ensured, and the integrity and the safety of the data packet stored in the cache unit are further ensured.
In addition, in this embodiment, although the probability of retransmission can be greatly reduced by transmitting the data packet in an iterative manner, there is still a case of packet loss or packet error, for this reason, in this embodiment, after the transmission data packet is received in step S202, while steps S203 to S205 are executed, it may also be identified whether there is a data packet that needs to be retransmitted, and a retransmission request is initiated to the transmitting end. Specifically, after receiving the transmission data packet, the method provided in this embodiment further includes: judging whether n is satisfied1=n2+1, wherein n1Is the smallest number, n, of the Q packet numbers2The number is the minimum number in the numbers of the cache units which do not store the data packets; if yes, sending a retransmission request to the sending end, wherein the retransmission request comprises the number n of the data packet requesting retransmission2. For example, the buffer unit with number 2 (the smallest number) has not stored a packet, but Q packets of the received transmission packets have numbers 3, 4, and 5. The starting position of the data transmission window of the sending end is already floated to the position of the data packet with the number 3, and according to the backward floating mode, the next sending transmission data packet starts to be sent from the data packet with the number 4, and the data packet with the number 2 cannot be sent any more. At this time, the buffer unit with number 2 still does not receive the data packet with corresponding number, and the receiving end recognizes this condition (n1=n2+1), then request the transmitting end to transmit the last transmitted transmission data packet (number n)2) I.e. the transmission data packet determined by the transmission data window starting from number 2, therefore, the receiving end carries the smallest number of the numbers of the buffer units which do not store the data packet in the retransmission request to indicate which transmission data packet is retransmitted by the transmitting end. The method for identifying whether retransmission is needed can reduce the number of retransmission, that is, only request retransmission of the data packet with the smallest number once, and can immediately initiate retransmission when the data transmission window of the sending end floats to the next of the smallest number, thereby ensuring the integrity of data in time.
Of course, the above-mentioned retransmission initiation manner provided in this embodiment is only an optimal manner, and the receiving end may not determine whether n is satisfied or not1=n2+1. For example, as another alternative, it may be determined whether there is a number m of a cache unitiLess than n1,miIs less than n1Number of each buffer unit of (1), miThe value is positive integer, and then the retransmission request contains the number m of each cache uniti(for example, m1 ═ 1, m2 ═ 3, … …, and m100 ═ 200). The receiving end may perform the determination after receiving each transmission data packet, or perform the determination after receiving a plurality of transmission data packets, and request to retransmit the data packets corresponding to the numbers.
In this embodiment, as described in embodiment 1, the message to be transmitted may be a TCP/IP protocol message or a UDP message. When the packet to be transmitted is a UDP packet, a format of a UDP transport packet is shown in fig. 4, where a data portion of the UDP transport packet includes Q packets (see fig. 2 for packet format), for example, Q is 3, and Q data blocks are sequentially connected together according to sequence numbers to form the data portion in the UDP transport packet. In addition, the transmission data packet further includes a UDP pseudo header and a UDP header; the UDP header includes: and (6) checking the sum. As an optional implementation manner, after receiving the transmission data packet, before storing the data packet corresponding to the number of the transmission data packet in the cache unit that does not store the data packet, the method provided in this embodiment further includes: calculating to obtain a comparison check sum of the transmission data packets according to the UDP pseudo-header, the UDP header and the data of the Q data packets; and comparing the comparison check sum and the check sum of the transmitted data packets, if the comparison check sum and the check sum are consistent, passing the check, and executing the step of storing the data packets corresponding to the serial numbers in the cache unit which does not store the data packets. Through the verification of the checksum, the integrity and the safety of the UDP transmission data packet can be further verified, and the stability and the accuracy of a verification result are improved.
In addition, as an optional implementation manner, a buffer area for storing buffer data may be further provided in this embodiment, after the transmission data packet is stored in the buffer unit, corresponding processing is performed, and then the transmission data packet is transferred to the buffer area, where the data packet in the buffer area may be output or called (e.g., playing of an audio video stream, etc.). As an optional implementation manner, the size of the buffer area may be calculated according to the network delay and the processing time of the buffer unit for processing a data packet, for example, the receiving end sends a network delay detection packet to the sending end, and calculates the network delay T1 according to the response time of a response packet returned by the sending end; the time T for processing a data packet is multiplied by the number S of the buffer units to obtain a buffer processing time delay T2; the network delay T1 and the buffer processing delay T2 are summed to obtain the delay time T3, and the space size of the buffer is calculated by dividing the delay time T3 by the time T for processing a transmission data packet. This is only a specific example given in this embodiment, and this embodiment does not limit the way of the size of the technology buffer, because there may be different calculation ways according to the type of the transmission data.
In the receiving method for the rolling data transmission provided in this embodiment, by correspondingly numbering the data packets and the cache units, the same data packet may be repeatedly received for a plurality of times, and the data packets are stored in the corresponding cache units according to the numbers. In addition, the receiving end does not need to return an ACK response in the transmission process, and the sending end does not need to wait for the ACK response returned by the receiving end, so that the interaction between the sending end and the receiving end can be reduced, the efficiency of data transmission is improved, and the risk of packet loss possibly caused by the fact that interactive feedback is not needed can be reduced. And the integrity and the safety of the data packet can be ensured through the verification of the plurality of verification values mentioned above.
Example 3
The embodiment also provides a data transmission system. As shown in fig. 6, the system includes a transmitting apparatus for data rolling transmission and a receiving apparatus for data rolling transmission, wherein the transmitting apparatus for data rolling transmission can be applied to the transmitting method for data rolling transmission in embodiment 1, the specific structure is shown in fig. 7, and the receiving apparatus for data rolling transmission can be applied to the receiving method for data rolling transmission in embodiment 2, the specific structure is shown in fig. 8. The specific functions of the transmitting apparatus and the receiving apparatus for the rolling transmission of data can be referred to the specific descriptions in embodiments 1 and 2. This embodiment is described only briefly.
As shown in fig. 7, the transmitting apparatus for the rolling data transmission includes:
the device comprises an acquisition module, a transmission module and a transmission module, wherein the acquisition module is used for acquiring a message to be transmitted, and the message to be transmitted consists of N data packets;
the data packet processing module is used for numbering the N data packets in sequence, and the packet head of each data packet at least comprises a number distributed to the data packet;
a transmission data window configuration module, configured to determine the length of a transmission data window, where the length of the transmission data window is used to determine the number M of data packets included in one transmission data packet, M, N is a positive integer, and M is less than or equal to N;
the sending module is used for sending the message to be transmitted according to the following steps: a.i is 1, wherein i is the number of times of sending the current transmission data packet, and the value of i is 1,2,3 … …, N-M + 1; B. placing the initial position of a transmission data window at a data packet with the number i; selecting an ith transmission data packet to be sent according to the length of a transmission data window, wherein the ith transmission data packet to be sent comprises M data packets numbered from i to i + M-1; C. performing check calculation on data of M data packets of the ith to-be-transmitted transmission data packet and data of each data packet of the kth received transmission data packet to obtain a transmission packet check value, and transmitting the ith to-be-transmitted transmission data packet, wherein the ith to-be-transmitted transmission data packet further comprises: a transmission packet check value and the number of each data packet of a transmission data packet received at the kth time, wherein k is a positive integer; D. judging whether i +1 is less than or equal to N-M + 1, if so, changing i to i +1, and returning to the step B; if not, the message to be transmitted is sent completely.
As an optional mode, the sending apparatus for rolling data transmission further includes: a receiving module, wherein: a receiving module, configured to receive a retransmission request, where the retransmission request at least includes a number n of a data packet to be retransmitted, where n is greater than or equal to i; the sending module is also used for placing the initial position of the transmission data window at the data packet with the number of n; and selecting a transmission data packet to be retransmitted according to the length of the transmission data window, wherein the transmission data packet to be retransmitted comprises M data packets numbered from n to n + M-1, and sending the transmission data packet to be retransmitted.
As an optional mode, the sending apparatus for rolling data transmission further includes: and the message processing module is used for dividing the message to be transmitted into N data packets according to a preset strategy.
As an optional manner, the transmission data packet to be sent for the ith time includes a UDP pseudo header and a UDP header; the UDP header includes: checking the sum; and the data packet processing module is further used for calculating and obtaining a checksum according to the UDP pseudo header, the UDP header and the data of the M data packets of the transmission data packet to be sent for the ith time.
As shown in fig. 8, the receiving apparatus for the rolling data transmission includes: s buffer memory cell, processing module, receiving module and control module, wherein:
the processing module is used for numbering the S cache units in sequence, wherein one cache unit is used for storing one data packet;
the receiving module is used for receiving transmission data packets, each transmission data packet comprises Q data packets, a transmission packet check value and the number of each data packet of the transmission data packet sent for the kth time, wherein the packet head of each data packet at least comprises the number of the data packet, k, S and Q are positive integers, Q is less than or equal to S, and k is less than S;
the control module is used for acquiring each data packet of the transmission data packet sent for the kth time according to the number of each data packet of the transmission data packet sent for the kth time; carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value of the transmission data packet; and comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check value is consistent with the transmission packet check comparison value, passing the check, sequentially judging whether the cache units corresponding to the numbers of the Q data packets store the data packets, storing the data packets corresponding to the numbers of the cache units in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
As an optional mode in this embodiment, the sending apparatus for rolling data transmission further includes: a sending module; wherein: a control module for judging whether n is satisfied1=n2+1, wherein n1Is the smallest number, n, of the Q packet numbers2The number is the minimum number in the numbers of the cache units which do not store the data packets; if yes, controlling the sending module to send a retransmission request to the sending end; a sending module, configured to send a retransmission request to a sending end, where the retransmission request includes a number n of a data packet requested to be retransmitted2。
As an optional manner in this embodiment, the transmission data packet further includes a UDP dummy header and a UDP header; the UDP header includes: checking the sum; the control module is also used for calculating to obtain a comparison check sum of the transmission data packets according to the UDP pseudo header, the UDP header and the Q data packets; and comparing the comparison check sum and the check sum of the transmitted data packets, if the comparison check sum and the check sum are consistent, passing the check, and executing the step of storing the data packets corresponding to the serial numbers in the cache unit which does not store the data packets.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof.
Claims (6)
1. A method for receiving a rolling data transmission, comprising:
presetting S cache units, and numbering the S cache units in sequence, wherein one cache unit is used for storing one data packet;
receiving transmission data packets, wherein the transmission data packets comprise Q data packets, transmission packet check values and the serial numbers of all data packets of the transmission data packets sent at the kth time, the packet head of each data packet at least comprises the serial numbers of the data packets, k, S and Q are positive integers, Q is less than or equal to S, and k is less than S;
acquiring each data packet of the transmission data packet sent at the kth time according to the number of each data packet of the transmission data packet sent at the kth time;
carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value of the transmission data packet;
and comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check comparison value is consistent with the transmission packet check comparison value, passing the check, sequentially judging whether the cache units corresponding to the numbers of the Q data packets store the data packets, storing the data packets corresponding to the numbers of the cache units in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
2. The method of claim 1, wherein: after receiving the transmission data packet, the method further comprises:
judging whether n is satisfied1=n2+1, where n1 is the smallest number among the numbers of the Q packets, n2The number is the minimum number in the numbers of the cache units which do not store the data packets;
if yes, sending a retransmission request to a sending end, wherein the retransmission request comprises the number n of the data packet requesting retransmission2。
3. The method of claim 1 or 2, wherein:
the transmitting the data packet further comprises: a UDP pseudo header and a UDP header; the UDP header includes: checking the sum;
after receiving the transmission data packet, before storing the data packet corresponding to the number thereof in the buffer unit which does not store the data packet, the method further comprises: calculating to obtain a comparison check sum of the transmission data packet according to the UDP pseudo header, the UDP header and the Q data packets;
and comparing the checksum of the transmission data packet with the comparison checksum, if the checksum is consistent with the comparison checksum, passing the verification, and executing the step of storing the data packet corresponding to the serial number in the cache unit which does not store the data packet.
4. A receiving device for rolling data transmission, comprising: s buffer memory cell, processing module, receiving module and control module, wherein:
the processing module is used for numbering the S cache units in sequence, wherein one cache unit is used for storing one data packet;
the receiving module is used for receiving transmission data packets, wherein the transmission data packets comprise Q data packets, transmission packet check values and serial numbers of all data packets of the transmission data packets sent for the kth time, the packet head of each data packet at least comprises the serial numbers of the data packets, k, S and Q are positive integers, Q is less than or equal to S, and k is less than S;
the control module is used for acquiring each data packet of the transmission data packet sent at the kth time according to the number of each data packet of the transmission data packet sent at the kth time; carrying out verification calculation on the data of the Q data packets and the data of each data packet of the transmission data packet sent at the kth time to obtain a transmission packet verification comparison value of the transmission data packet; and comparing the transmission packet check value with the transmission packet check comparison value, if the transmission packet check comparison value is consistent with the transmission packet check comparison value, passing the check, sequentially judging whether the cache units corresponding to the numbers of the Q data packets store the data packets, storing the data packets corresponding to the numbers of the cache units in the cache units which do not store the data packets, and discarding the data packets corresponding to the numbers of the cache units which store the data packets.
5. The apparatus of claim 4, wherein: further comprising: a sending module, wherein:
the control module is also used for judging whether n is satisfied1=n2+1, wherein n1Is the smallest number, n, of the numbers of the Q data packets2The number is the minimum number in the numbers of the cache units which do not store the data packets; if yes, controlling the sending module to send a retransmission request to the sending end;
the sending module is configured to send the retransmission request to the sending end, where the retransmission request includes a number n of a data packet requested to be retransmitted2。
6. The apparatus of claim 4 or 5, wherein:
the transmission data packet further comprises a UDP pseudo-header and a UDP header; the UDP header includes: checking the sum;
the control module is further configured to calculate a comparison checksum of the transmission data packet according to the UDP pseudo header, the UDP header, and the Q data packets; and comparing the comparison check sum and the check sum of the transmission data packet, if the comparison check sum and the check sum are consistent, passing the check, and executing the step of storing the data packet corresponding to the serial number in the cache unit which does not store the data packet.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810246777.4A CN110299973B (en) | 2018-03-23 | 2018-03-23 | Receiving method and device for data rolling transmission |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810246777.4A CN110299973B (en) | 2018-03-23 | 2018-03-23 | Receiving method and device for data rolling transmission |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110299973A CN110299973A (en) | 2019-10-01 |
| CN110299973B true CN110299973B (en) | 2022-04-05 |
Family
ID=68026092
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810246777.4A Active CN110299973B (en) | 2018-03-23 | 2018-03-23 | Receiving method and device for data rolling transmission |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110299973B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111835871A (en) * | 2020-08-06 | 2020-10-27 | 腾讯科技(深圳)有限公司 | Method and device for transmitting data file, method and device for receiving data file |
| CN113595685A (en) * | 2021-07-15 | 2021-11-02 | 上海晶赞融宣科技有限公司 | Data transmission method and device, storage medium and terminal |
| CN115734421B (en) * | 2021-09-01 | 2025-09-26 | 可赛尔内存股份有限公司 | Method for detecting the number of light-emitting modules |
| CN119628789A (en) * | 2024-11-15 | 2025-03-14 | 珠海格力电器股份有限公司 | Data transmission method, device, equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101145893A (en) * | 2007-10-08 | 2008-03-19 | 华为技术有限公司 | Data frame receiving method and device for call bill data, and billing gateway |
| CN101834700A (en) * | 2010-05-12 | 2010-09-15 | 北京邮电大学 | One-way reliable transmission method and transceiver device based on data packet |
| CN102185676A (en) * | 2004-01-16 | 2011-09-14 | Zih公司 | Method and system for calculating and verifying the integrity of data in a data transmission system |
| CN103957169A (en) * | 2014-05-14 | 2014-07-30 | 上海复兰信息科技有限公司 | Reliable UDP achievement method based on reserve request |
| CN105262746A (en) * | 2015-10-12 | 2016-01-20 | 国家电网公司 | Method for guaranteeing reliable data transmission on the basis of UDP protocol |
-
2018
- 2018-03-23 CN CN201810246777.4A patent/CN110299973B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102185676A (en) * | 2004-01-16 | 2011-09-14 | Zih公司 | Method and system for calculating and verifying the integrity of data in a data transmission system |
| CN101145893A (en) * | 2007-10-08 | 2008-03-19 | 华为技术有限公司 | Data frame receiving method and device for call bill data, and billing gateway |
| CN101834700A (en) * | 2010-05-12 | 2010-09-15 | 北京邮电大学 | One-way reliable transmission method and transceiver device based on data packet |
| CN103957169A (en) * | 2014-05-14 | 2014-07-30 | 上海复兰信息科技有限公司 | Reliable UDP achievement method based on reserve request |
| CN105262746A (en) * | 2015-10-12 | 2016-01-20 | 国家电网公司 | Method for guaranteeing reliable data transmission on the basis of UDP protocol |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110299973A (en) | 2019-10-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110299973B (en) | Receiving method and device for data rolling transmission | |
| CN101621471B (en) | System for transmitting and receiving packets | |
| KR100458878B1 (en) | Method for transmitting and receiving a variable size packet based on foward error correction coding | |
| US8386901B2 (en) | Method, device and software application for transmitting data packets in a communication system | |
| US20080195912A1 (en) | Method of communicatoin | |
| JP6148459B2 (en) | How to transport data from a source node to a destination node | |
| US9007904B2 (en) | System to improve an ethernet network | |
| CN110299970B (en) | Data message sending method and device | |
| CN110299971B (en) | Data message receiving method and device | |
| CN103078707B (en) | File transmission method in deep space communication | |
| CN101895372A (en) | Data transmission method in radio link control layer acknowledged mode | |
| CN107257270A (en) | Data transmission method and system based on hybrid automatic repeat-request | |
| KR101118194B1 (en) | Method for lost packet reconstruction and device for carrying out said method | |
| CN110299969B (en) | Method and device for transmitting data in rolling mode | |
| CN105871512A (en) | Data transmission method and device | |
| JP6064593B2 (en) | Program, information processing apparatus, and communication method | |
| CN103534973B (en) | A kind of methods, devices and systems reducing transmission control layer confirmation message | |
| WO2015006908A1 (en) | Processing method, device and system for idle block (idle) in burst data block | |
| WO2022042543A1 (en) | Retransmission method for ethernet error frame and related apparatus | |
| CN110299974A (en) | A kind of data receiver method and device | |
| CN106100797B (en) | A kind of method for transmitting deep space file based on the asynchronous acceleration re-transmission policy of LTP | |
| CN114285528A (en) | Method and communication device for transmitting message | |
| Bansal et al. | Analysis of Sliding Window Protocol for Connected Node | |
| ES2349189T3 (en) | SYSTEM AND METHOD FOR IMPROVED DATA TRANSFER IN COMMUNICATION NETWORKS BY PACKAGE SWITCHING. | |
| US20090164679A1 (en) | Data transmission method and corresponding device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |