CN110299971A - A kind of data message method of reseptance and device - Google Patents

A kind of data message method of reseptance and device Download PDF

Info

Publication number
CN110299971A
CN110299971A CN201810246182.9A CN201810246182A CN110299971A CN 110299971 A CN110299971 A CN 110299971A CN 201810246182 A CN201810246182 A CN 201810246182A CN 110299971 A CN110299971 A CN 110299971A
Authority
CN
China
Prior art keywords
data packet
transmission
packet
verification
data
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.)
Granted
Application number
CN201810246182.9A
Other languages
Chinese (zh)
Other versions
CN110299971B (en
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.)
Tendyron Corp
Tendyron Technology Co Ltd
Original Assignee
Tendyron 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 Tendyron Technology Co Ltd filed Critical Tendyron Technology Co Ltd
Priority to CN201810246182.9A priority Critical patent/CN110299971B/en
Publication of CN110299971A publication Critical patent/CN110299971A/en
Application granted granted Critical
Publication of CN110299971B publication Critical patent/CN110299971B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • 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/1806Go-back-N protocols
    • 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/1835Buffer management
    • 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/187Details of sliding window management
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The present invention provides a kind of data message method of reseptance and devices, this method comprises: presetting S cache unit, and to S cache unit number consecutively;Transmission data packet is received, transmission data packet includes Q data packet, wherein the packet header of each data packet includes at least the number and data packet check value of data packet;The data packet for calculating each data packet one of in the following manner verifies comparison value: number and data to data packet carry out verification and data packet verification comparison value are calculated;Alternatively, carrying out verification to the data of data packet is calculated data packet verification comparison value;Compare the data packet check value and data packet verification comparison value of each data packet, if consistent, then successively judge whether be stored with data packet in the corresponding cache unit of the number of Q data packet, storage numbers corresponding data packet with it in the cache unit of no storing data packet, abandons the corresponding data packet of number for the cache unit for being stored with data packet.

Description

A kind of data message method of reseptance and device
Technical field
The present invention relates to a kind of electronic technology field more particularly to a kind of data message method of reseptances and device.
Background technique
In existing network data transmission, transport layer one data packet of every transmission, receiving end is to the number having had successfully received Corresponding ACK (Acknowledgement confirms a character) response is returned according to packet;If transmitting terminal is when reasonable round-trip Prolong in (Round-Trip Time, be abbreviated as RTT) and do not receive the acknowledgement character response, then corresponding data packet is assumed to lose Mistake will be retransmitted.Under existing communications protocol, required after transmitting terminal one data packet of every transmission etc. waiting The acknowledgement character response that receiving end is sent could continue to send next data packet, transmitting terminal and receiving end will once data interaction, Although reliability is stronger, efficiency of transmission is lower.Moreover, will cause data in the case where network condition is bad and repeatedly retransmit, Use unstable, waste Internet resources.
Summary of the invention
One of present invention seek to address that the above problem/.
The main purpose of the present invention is to provide a kind of data transmission method for uplink.
Another object of the present invention is to provide a kind of data sending devices.
Another object of the present invention is to provide a kind of data message method of reseptances.
Another object of the present invention is to provide a kind of data message reception devices.
In order to achieve the above objectives, technical solution of the present invention is specifically achieved in that
One aspect of the present invention provides a kind of data transmission method for uplink, comprising: obtains message to be transmitted, the message to be transmitted By N number of data packet group at;To N number of data packet number consecutively, and to the number of the data packet and the number of the data packet The data packet check value that each data packet is calculated according to verification is carried out;Alternatively, the data to each data packet carry out master gage Calculation obtains the data packet check value of each data packet, and to N number of data packet number consecutively;Wherein, the packet of each data packet The data packet check value that head includes at least the number for its distribution and is calculated for it;Determine the length of transmission data window Degree, the length of the transmission data window are used to determine the number M for the data packet for including in a transmission data packet, and M, N are positive Integer, M≤N;The message to be transmitted: A.i=1 is sent according to the following steps, wherein i is to send current transmission data packet Number, the value of i are 1,2,3 ..., N-M+1;B. the initial position of the transmission data window is placed in the data numbered as i At packet;I-th transmission data packet to be sent is selected according to the length of the transmission data window, the i-th is to be sent Transmission data packet includes the M data packet that number is i to i+M-1, sends i-th transmission data packet to be sent;C. sentence Whether disconnected i+1 is less than or equal to N-M+1, if it is, i=i+1, return step B;If it is not, then the message to be transmitted It is sent.
Optionally, i-th transmission data packet to be sent further include: what transmission packet check value and kth time received Transmit the number of each data packet of data packet, wherein k is positive integer;I-th transmission number to be sent is sent described Before packet, the method also includes data of: each data packet of the transmission data packet to be sent to the i-th and described The data of each data packet for the transmission data packet that kth time receives carry out verification and the transmission packet check value are calculated.
Optionally, after sending i-th transmission data packet to be sent, the method also includes: receive weight Request is passed, the retransmission request includes at least the number n of data packet to be retransmitted, wherein n≤i;By the transmission data window Initial position be placed in number be n data packet at;According to the selected transmission number to be retransmitted of length of the transmission data window According to packet, n-th transmission data packet to be sent includes the M data packet that number is n to n+M-1, and is sent described to weight The transmission data packet of biography.
Optionally, the message to be transmitted is UDP message, and before the acquisition message to be transmitted, the method is also wrapped It includes: the message to be transmitted is divided by N number of data packet according to preset strategy.
Optionally, i-th transmission data packet to be sent further includes UDP puppet stem and UDP stem;The UDP is first Portion include: verification and;Before transmission i-th transmission data packet to be sent, the method also includes: according to institute The data for stating M data packet of UDP puppet stem and UDP stem and i-th transmission data packet to be sent are calculated It is described verification and.
Another aspect of the present invention provides a kind of data sending device, comprising: module is obtained, for obtaining report to be transmitted Text, the message to be transmitted by N number of data packet group at;Data packet handing module is used for N number of data packet number consecutively, And the data of the number and the data packet to the data packet carry out the data packet verification that each data packet is calculated in verification Value;Alternatively, carrying out the data packet check value that each data packet is calculated in verification to the data of each data packet, and to the N A data packet number consecutively;Wherein, the packet header of each data packet includes at least as the number of its distribution and is calculated for it Data packet check value;Data window configuration module is transmitted, for determining the length of transmission data window, the transmission data window The length of mouth is used to determine that the number M, M, N for the data packet for including in a transmission data packet to be positive integer, M≤N;Send mould Block, for sending the message to be transmitted: A.i=1 according to the following steps, wherein i is time for sending current transmission data packet Number, the value of i are 1,2,3 ..., N-M+1;B. the initial position of the transmission data window is placed in the data packet numbered as i Place;I-th transmission data packet to be sent, i-th biography to be sent are selected according to the length of the transmission data window Transmission of data packet includes the M data packet that number is i to i+M-1;Send i-th transmission data packet to be sent;C. judge i Whether+1 be less than or equal to N-M+1, if it is, i=i+1, return step B;If it is not, then the message to be transmitted is sent It finishes.
Optionally, i-th transmission data packet to be sent further include: what transmission packet check value and kth time received Transmit the number of each data packet of data packet, wherein k is positive integer;The data packet handing module, is also used in the hair Before sending module to send i-th transmission data packet to be sent, the transmission data packet to be sent to the i-th it is each The data of each data packet for the transmission data packet that the data of data packet and the kth time receive carry out verification and institute are calculated State transmission packet check value.
Optionally, device further include: receiving module, in which: the receiving module, it is described for receiving retransmission request Retransmission request includes at least the number n of data packet to be retransmitted, wherein n≤i;The sending module is also used to the transmission The initial position of data window is placed at the data packet that number is n;Length according to the transmission data window is selected wait retransmit Transmission data packet, the transmission data packet to be retransmitted include number be n to n+M-1 M data packet, and send described in The transmission data packet of re-transmission.
Optionally, the device further include: message processing module (MPM), for the message to be transmitted to be drawn according to preset strategy It is divided into N number of data packet.
Optionally, i-th transmission data packet to be sent includes UDP puppet stem and UDP stem;The UDP stem Include: verification and;The data packet handing module is also used to be waited for according to the UDP puppet stem, UDP stem and the i-th The data of M data packet of the transmission data packet of transmission be calculated it is described verification and.
Another aspect of the present invention provides a kind of data message method of reseptance, comprising: S cache unit is preset, and To the S cache unit number consecutively, wherein a cache unit is for storing a data packet;Transmission data packet is received, The transmission data packet includes Q data packet, wherein the packet header of each data packet includes at least the number and data packet of data packet Check value, S, Q are positive integer, Q≤S;The data packet for calculating each data packet one of in the following manner verifies comparison value: to institute The data of the number and the data packet of stating data packet carry out verification and the data packet verification comparison value are calculated;Alternatively, right The data of the data packet carry out verification and the data packet verification comparison value are calculated;Compare the data of each data packet Packet check value and the data packet verify comparison value, if the data packet check value of each data packet and the data packet school It tests that comparison value is consistent, then successively judges whether be stored with number in the corresponding cache unit of number of the Q data packet According to packet, storage numbers corresponding data packet with it in the cache unit of no storing data packet, and discarding has been stored with data The corresponding data packet of the number of the cache unit of packet.
Optionally, in the transmission data packet further include: transmit each of the transmission data packet of packet check value and kth time transmission The number of a data packet;After receiving the transmission data packet, deposited in the cache unit of no storing data packet described Before Chu Yuqi numbers corresponding data packet, the method also includes: according to each data for the transmission data packet that kth time is sent The number of packet obtains each data packet for the transmission data packet that the kth time is sent;Data to the Q data packet and described The data of each data packet for the transmission data packet that kth time is sent carry out the transmission packet that the transmission data packet is calculated in verification Verify comparison value;It compares the transmission packet check value and transmission packet verification comparison value is held if unanimously, verification passes through Row is in described the step of storage numbers corresponding data packet with it in the cache unit of no storing data packet.
Optionally, after receiving transmission data packet, the method also includes: judge whether to meet n1=n2+ 1, wherein n1For the smallest number in the number of the Q data packet, n2It is the smallest in number for the cache unit of no storing data packet Number;It include the number of the data packet of request retransmission in the retransmission request if it is satisfied, then sending retransmission request to transmitting terminal n2
Optionally, the transmission data packet further includes UDP puppet stem and UDP stem;The UDP stem include: verification and; After receiving the transmission data packet, it is described stored in the cache unit of no storing data packet numbered with it is corresponding Before data packet, the method also includes: it is calculated according to the UDP puppet stem, the UDP stem and the Q data packet Obtain it is described transmission data packet Inspection and;Compare it is described transmission data packet verification and with Inspection and, if one It causes, then verification passes through, and executes to store in the cache unit of no storing data packet described and numbers corresponding data packet with it The step of.
Another aspect of the present invention provides a kind of data message reception device, comprising: at S cache unit, cache unit Manage module, receiving module, data packet handing module and control module, in which: the cache unit processing module, for described S cache unit number consecutively a, wherein cache unit is for storing a data packet;The receiving module, for receiving Data packet is transmitted, the transmission data packet includes Q data packet, wherein the packet header of each data packet includes at least data packet Number, S, Q are positive integer, Q≤S;The data packet handing module, for calculating each data packet one of in the following manner Data packet verifies comparison value: the data of number and the data packet to the data packet carry out verification and the data are calculated Packet verification comparison value;Comparison value is verified alternatively, carrying out verification to the data of the data packet and the data packet being calculated;It is described Control module, for comparing the data packet check value and data packet verification comparison value of each data packet, if each The data packet check value of data packet and data packet verification comparison value are consistent, then successively judge the Q data packet The corresponding cache unit of number in whether be stored with data packet, in the cache unit of no storing data packet storage with It numbers corresponding data packet, abandons the corresponding data packet of number for the cache unit for being stored with data packet.
Optionally, in the transmission data packet further include: transmit each of the transmission data packet of packet check value and kth time transmission The number of a data packet;The data packet handing module, each data packet for the transmission data packet for being also used to be sent according to kth time Number obtain each data packet of the transmission data packet that the kth time is sent;Data to the Q data packet and described The data of each data packet of the transmission data packet of k transmission carry out the transmission packet school that the transmission data packet is calculated in verification Test comparison value;The control module is also used to compare the transmission packet check value and transmission packet verification comparison value, if one It causes, then verification passes through, and executes to store in the cache unit of no storing data packet described and numbers corresponding data packet with it Operation.
Optionally, which further includes sending module, in which: the control module is also used to judge whether to meet n1=n2 + 1, retransmission request is sent to transmitting terminal if it is satisfied, then controlling the sending module;Wherein, n1For the volume of the Q data packet The smallest number, n in number2For the smallest number in the number of the cache unit of no storing data packet;The sending module is used It include the number n of the data packet of request retransmission in the retransmission request in sending the retransmission request to the transmitting terminal2
Optionally, the transmission data packet further includes UDP puppet stem and UDP stem;The UDP stem include: verification and; The data packet handing module is also used to be calculated according to the UDP puppet stem, the UDP stem and the Q data packet To it is described transmission data packet Inspection and;The control module is also used to compare the Inspection of the transmission data packet With with verification and, if unanimously, verification passes through, execute described store in the cache unit of no storing data packet and compiled with it The step of number corresponding data packet.
As seen from the above technical solution provided by the invention, the present invention provides a kind of data message method of reseptance and Device, by the way that data packet and cache unit reference numeral, same data packet can repeat to receive repeatedly, by data packet according to volume In number corresponding cache unit of deposit, when some data packet generates error of transmission or packet loss in transmission process the phenomenon that When, due to that can also repeat to receive repeatedly, repeating transmission can be reduced to avoid the packet loss of the data packet to the full extent Probability.In addition, receiving end can not return to acknowledgement character response in transmission process, transmitting terminal also withouts waiting for receiving end return Acknowledgement character response, it is possible to reduce the interaction of transmitting terminal and receiving end, the efficiency of improve data transfer, while can also reduce and not need Interaction feedback and the packet loss risk that may cause.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment Attached drawing be briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the flow chart for the data transmission method for uplink that the embodiment of the present invention 1 provides;
Fig. 2 is the form schematic diagram in the packet header for the data packet that the embodiment of the present invention 1 provides;
Fig. 3 is the schematic diagram that the transmission data window that the embodiment of the present invention 1 provides determines a transmission data packet;
Fig. 4 is the form schematic diagram that the UDP that the embodiment of the present invention 1 provides transmits data packet;
Fig. 5 is the flow chart for the data message method of reseptance that the embodiment of the present invention 2 provides;
Fig. 6 is the structural schematic diagram for the data transmission system that the embodiment of the present invention 3 provides;
Fig. 7 is the structural schematic diagram for the data sending device that the embodiment of the present invention 3 provides;
Fig. 8 is the structural schematic diagram for the data message reception device that the embodiment of the present invention 3 provides.
Specific embodiment
With reference to the attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Based on this The embodiment of invention, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, belongs to protection scope of the present invention.
In the description of the present invention, it is to be understood that, term " center ", " longitudinal direction ", " transverse direction ", "upper", "lower", The orientation or positional relationship of the instructions such as "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outside" is It is based on the orientation or positional relationship shown in the drawings, is merely for convenience of description of the present invention and simplification of the description, rather than instruction or dark Show that signified device or element must have a particular orientation, be constructed and operated in a specific orientation, therefore should not be understood as pair Limitation of the invention.In addition, term " first ", " second " are used for description purposes only, it is not understood to indicate or imply opposite Importance or quantity or position.
In the description of the present invention, it should be noted that unless otherwise clearly defined and limited, term " installation ", " phase Even ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;It can To be mechanical connection, it is also possible to be electrically connected;It can be directly connected, can also can be indirectly connected through an intermediary Connection inside two elements.For the ordinary skill in the art, above-mentioned term can be understood at this with concrete condition Concrete meaning in invention.
The embodiment of the present invention is described in further detail below in conjunction with attached drawing.
Embodiment 1
Present embodiments provide a kind of data transmission method for uplink.As shown in Figure 1, the data transmission method for uplink includes the following steps (S101-S105):
S101, obtain message to be transmitted, message to be transmitted by N number of data packet group at;
In the present embodiment, message to be transmitted can be ICP/IP protocol message, be also possible to User Datagram Protocol (User Datagram Protocol, be abbreviated as UDP) message.Wherein, which can be divided into N number of data Packet, N is positive integer.
In existing UDP transport protocol, udp protocol is open system interconnection (Open System Interconnection is abbreviated as OSI) a kind of connectionless transport layer protocol in reference model, simple insecure letter is provided Breath transmission service.It is used to handle UDP message packet as ICP/IP protocol in a network.But UDP do not provide data packet grouping, Assembling cannot be ranked up data packet, that is to say, that be that can not learn whether it is safe and complete after data packet is sent It reaches.Udp protocol not can guarantee data packet can accurately be sent to receiving end, and receiving end is not needed to receiving yet UDP message is confirmed.In the present embodiment, when message to be transmitted is UDP message, as an alternative embodiment, Before obtaining message to be transmitted, method provided in this embodiment further include: message to be transmitted is divided by N according to preset strategy A data packet.For example, a data package size is arranged in the maximum capacity for the data packet that can be allowed to transmit according to network, this is waited for Transmitting message is divided.In another example the numerical value of N can be set, 100 are such as set as, which is divided into 100 The identical data packet of size.It is carried out in another example treating transmitting message according to preset algorithm in conjunction with the current stability state of network It divides.The division mode that the present embodiment treats transmitting message is not specifically limited, as long as may be implemented to divide message to be transmitted For multiple data packets, the transmission of data message is completed in a manner of sending data packet.
S102, to N number of data packet number consecutively, the packet header of each data packet includes at least the number for its distribution;
In the present embodiment, get by N number of data packet group at message to be transmitted after, to N number of data packet number consecutively, The number of N number of data packet is followed successively by 1,2 ..., N sends in order to carry out the iteration of data packet by number, realizes one The multiple transmission of data packet reduces the probability of repeating transmission, and reduces and do not need interaction feedback in transmission process and may cause Packet loss risk, the efficiency of improve data transfer.
In the present embodiment, when message to be transmitted is UDP message, different and existing UDP transport protocol, the present embodiment will UDP message to be transmitted carries out data packet subpackage, and is each UDP message packet distribution number, using middle step S104 as follows Described in mode send UDP message to be transmitted.In the present embodiment, receiving end do not need to the UDP message packet received into Row confirmation, but since the same UDP message packet can repeat to send repeatedly, it thereby may be ensured that data packet can be accurately sent to Receiving end reduces the probability of repeating transmission.
One data packet includes packet header and data, wherein the number for the allocation of packets, the volume are included at least in packet header Number the data packet can be identified according to the number with the unique identification data packet, transmitting terminal and receiving end, for example, receiving end Can be in the number for carrying the data packet being not received by into the repeating transmission request that transmitting terminal is sent, transmitting terminal can be according to the volume Number retransmit corresponding data packet.As a kind of optional mode, the format in packet header is as shown in Fig. 2, packet header may include: source Mouth, destination port, number, data packet length and check value.Packet header shown in Fig. 2 is a kind of optional embodiment, according to Specifically need packet header that can increase or decrease corresponding contents.
S103, the data packet school that each data packet is calculated in verification is carried out to the number of data packet and the data of data packet Test value;Alternatively, carrying out the data packet check value that each data packet is calculated in verification to the data of each data packet, and to N number of Data packet number consecutively;Wherein, the packet header of each data packet is calculated including at least the number for its distribution and for it Data packet check value;
The mode of a variety of check values for calculating data packet is provided in the present embodiment, it can to the number sum number of data packet According to carrying out verification calculating, can also the data to data packet carry out verification calculating, the data of each data packet are finally calculated Packet check value.Specific verification computational algorithm the present embodiment and with no restrictions, for example, using even-odd check or can recycle superfluous The check value of data packet is calculated in remaining verification (Cyclic Redundancy Check, be abbreviated as CRC) scheduling algorithm.Pass through hair The data packet for carrying the check value is sent, receiving end can use corresponding after receiving the data packet in transmission data packet Algorithm verifies data packet, to guarantee the integrality and safety (being not tampered with) of the data packet received.
S104, the length for determining transmission data window transmit the length of data window for determining a transmission data packet In include the number M, M of data packet be positive integer, M≤N;
In the present embodiment, transmitting terminal once sends a transmission data packet, until the N number of number for the message to be transmitted that will acquire Until all having been sent according to packet.The number M for the data packet that each transmission data packet includes is true by the length of transmission data window Fixed, the data packet of transmission data window covering, i.e. data packet in window are that this needs to wrap in the transmission data packet sent The M data packet contained.The number of M can be needed according to the ability and present data transmission that network capacity can carry Guarantee stability height to determine.M value is bigger, then higher to network transmission requirement, then packet loss is lower.As a kind of optional side Formula, each number for transmitting M data packet in data packet is incremented by successively, for example, M=3, the 1st number transmitted in data packet Number according to packet is that the number of the data packet in the 1,2,3, the 2nd transmission data packet is 2,3,4 ... ... until the last one transmission The number of data packet is N-2, N-1, N.After every primary transmission data packet of transmission, window floats once backward.Fig. 3 is exemplarily only The schematic diagram that transmission data window determines a transmission data packet is given, the packet header of each data packet includes at least data packet Number, message to be transmitted includes the data packet of N number of number consecutively.Certainly, the number of M data packet is also successively successively decreased.Alternatively, every After sending primary transmission data packet, transmission data window can float forward once.As long as iteration, which may be implemented, sends data packet ?.
S105, message to be transmitted is sent according to the following steps:
A.i=1, wherein i is the number for sending current transmission data packet, and the value of i is 1,2,3 ..., N-M+1;
When i=1, indicate currently to transmit data packet for the 1st transmission.Since message to be transmitted has N number of data packet, so, It needs to send N-M+1 transmission data packet in total, n-th data packet could have been sent.
B. the initial position for transmitting data window is placed in and is numbered at the data packet for i;According to the length of transmission data window Selected i-th transmission data packet to be sent is spent, i-th transmission data packet to be sent includes M that number is i to i+M-1 Data packet;Send i-th transmission data packet to be sent;
As shown in figure 3, the initial position for transmitting data window is placed at the data packet that number is 1 as i=1.For example, M =3, then the 1st transmission data packet to be sent includes the data packet that number is 1,2,3.As i=2, data window is transmitted Initial position is placed at the data packet that number is 2, then the 2nd transmission data packet to be sent includes the data that number is 2,3,4 Packet.As i=3, the initial position for transmitting data window is placed at the data packet that number is 3, then the 2nd transmission number to be sent It include the data packet that number is 3,4,5 according to packet.It can be seen that in i=3, the data packet that number is 3 has been transmitted across 3 times, directly To i=N-M+1, that is, data packet of the number from M to N-M+1 is all repeated to be transmitted across M times.So by changing to data packet In generation, sends, when some data packet generates error of transmission or when the phenomenon that packet loss in transmission process, due to can also be again It repeats to send M-1 times, can be reduced to the full extent to avoid the packet loss of the data packet, also there is no need to retransmit the data packet The probability of data packet retransmission.In the present embodiment, receiving end can not return to acknowledgement character response, transmitting terminal in transmission process Without waiting for the acknowledgement character response of receiving end return, it is possible to reduce the interaction of transmitting terminal and receiving end, the effect of improve data transfer Rate, while the packet loss risk that does not need interaction feedback and may cause can also be reduced.
C. judge whether i+1 is less than or equal to N-M+1, if it is, i=i+1, return step B;If it is not, then to Transmitting message is sent.
In the present embodiment, from i=1 until i=N-M+1 sends N-M+1 transmission data packet, every primary transmission of transmission in total Data packet, transmission data window float once backward, and in the N-M+1 times transmission data packet, the data packet that number is N-M+1 is It is transmitted across M times.The data packet that number is N is contained in the N-M+1 times transmission data packet, then it is assumed that message to be transmitted has been sent Finish.
In order to guarantee the integrality and safety of data packet, in the present embodiment, can also be carried in transmission data packet Packet check value is transmitted, so that receiving end carries out integrality and safety school to the data packet received according to transmission packet check value It tests.As another optional embodiment in the present embodiment, in i-th transmission data packet to be sent further include: transmission packet The number of each data packet for the transmission data packet that check value and kth time receive, wherein k is positive integer;The step of step S105 In rapid B before sending i-th transmission data packet to be sent, method provided in this embodiment further include: to be sent to i-th Transmission data packet M data packet data and the data progress of each data packet of transmission data packet that time receives of kth Transmission packet check value is calculated in verification.
In the present embodiment, transmitting terminal equally also can receive the transmission data packet of receiving end (opposite end of transmitting terminal) transmission, For example, the transmission data packet that kth time receives is what receiving end was sent.Therefore, as a kind of optional mode, transmitting terminal can With the number of each data packet of each data packet of transmission data packet and transmission data packet to be sent that are received based on oneself According to being calculated a check value (i.e. transmission packet check value), and receiving end is in the transmission data packet for receiving transmitting terminal transmission It afterwards, can be according to transmission data packet that above-mentioned transmitting terminal kth time receives (and transmission data that receiving end was once transmitted across Packet) the number of each data packet inquire certain transmission data packet for sending of receiving end, then the biography that receives of receiving end utilization The data of transmission of data packet and the transmission data packet itself being transmitted across (i.e. transmitting terminal kth time receive transmission data packet) it is each A transmission packet Inspection value is calculated in the data of a data packet, is compared with the transmission packet check value received.This In embodiment, transmitting terminal, which participates in calculating check value using the data of the transmission data packet received, can increase the stability of verification And accuracy.For example, distorted if the transmitting terminal received transmission data packet of kth time is kidnapped by third party, what transmitting terminal calculated Transmission packet check value and recipient receive the transmission packet Inspection value being calculated after the transmission data packet that transmitting terminal is sent It is different, then verification can not pass through, and thus receiving end is known that packet loss, wrong packet has occurred or is kidnapped by third party and distorts Risk, and then take corresponding safeguard procedures.Likewise, if this transmission data packet sent of transmitting terminal is robbed by third party It holds or distorts, receiving end, which equally verifies, to be passed through.Therefore, transmitting terminal participates in meter using the data of the transmission data packet received The stability and accuracy of verification can be increased by calculating check value, so as to more steadily guarantee the integrality and peace of data packet Quan Xing.Likewise, calculate this implementations of algorithm and with no restrictions of transmission packet check value, for example, can use parity arithmetic or Person's CRC algorithm etc..
In addition, in the present embodiment, although the probability of re-transmission can be substantially reduced using iterative manner transmission data packet, Still there is the case where packet loss or wrong packet, for this purpose, after sending i-th transmission data packet to be sent, this implementation The method that example provides further include: transmitting terminal receives the retransmission request of opposite end transmission, and retransmission request includes at least number to be retransmitted According to the number n of packet, wherein n≤i;The initial position for transmitting data window is placed in and numbers at the data packet for n by transmitting terminal, presses According to the selected transmission data packet to be retransmitted of length of transmission data window, transmission data packet to be retransmitted includes that number is n to n+ The M data packet of M-1, and send transmission data packet to be retransmitted.Herein transmitting terminal send the mode of data packet to be retransmitted with Step B in step S105 be it is similar, be referred to the description of the step B in step S105.
In the present embodiment, as described above, message to be transmitted can be ICP/IP protocol message, it is also possible to UDP message. When message to be transmitted is UDP message, by taking the 1st UDP transmission data packet of transmission as an example, UDP transmits format such as Fig. 4 of data packet It is shown, include M data packet (data packet format refers to Fig. 2) in the data portion of a UDP transmission data packet, is with M=3 Example, M data block are joined together to form the data portion in a UDP transmission data packet messages packet according to numeric order.It removes Except this, a UDP transmission data packet further includes UDP stem and UDP puppet stem, wherein UDP stem occupies 8 bytes, respectively Be occupy 2 bytes source port, destination port, length and verification and, UDP puppet stem occupy 12 bytes.As one kind Optional embodiment, before sending i-th transmission data packet to be sent, method provided in this embodiment further include: root Verification is calculated according to the data of M data packet of UDP puppet stem, UDP stem and i-th transmission data packet to be sent The integrality and safety of UDP transmission data packet can be verified with, the verification and further, improve the stability of verification result And accuracy.
Above-mentioned data transmission method for uplink provided in this embodiment, by package number, to data packet according to number iteration It sends, when some data packet generates error of transmission or when the phenomenon that packet loss in transmission process, due to that can also repeat It sends M-1 times, the probability of repeating transmission can be reduced to the full extent to avoid the packet loss of the data packet.In addition, in transmission process Middle receiving end can not return to acknowledgement character response, and transmitting terminal also withouts waiting for the acknowledgement character response of receiving end return, it is possible to reduce sends The interaction at end and receiving end, the efficiency of improve data transfer, while can also reduce and not need interaction feedback and may cause Packet loss risk.And pass through the transmission of several check values mentioned above, it is ensured that the integrality and safety of data packet.
Embodiment 2
Present embodiments provide a kind of data message method of reseptance.It is provided in the data message method of reseptance and embodiment 1 Data transmission method for uplink it is corresponding.As shown in figure 5, the data message method of reseptance includes the following steps (S201-S205):
S201, S cache unit is preset, and to S cache unit number consecutively, wherein a cache unit is used In one data packet of storage;
In this implementation, for N number of data packet of message to be transmitted in storage implementation example 1, receiving end pre-sets S and delays Memory cell, S are positive integer, and should be greater than or equal to N.Receiving end in advance to S cache unit number consecutively 1,2 ... S, The number of top n cache unit in the S cache unit is corresponded with the number of N number of data packet, and a cache unit is used In one data packet of storage, and data packet can only be stored and be numbered in corresponding cache unit with it.It can guarantee to connect in this way Receiving end only saves the corresponding data packet of number of the cache unit of no storing data packet, for being repeated as many times the data packet received It can abandon, so as to improve the working efficiency of receiving end.
S202, transmission data packet is received, transmission data packet includes Q data packet, wherein the packet header of each data packet is at least Number including data packet, Q are positive integer, Q≤S;
The transmission data packet that receiving end receives is with the format of the transmission data packet of transmitting terminal transmission in embodiment 1 and each The format of data packet be it is identical, specifically may refer to the description in embodiment 1.According to being sent in step S104 in embodiment 1 The mode of message to be transmitted, receiving end also will receive multiple (such as N-M+1 times) transmission data packet, and each transmission data packet includes Q A data packet.For each data packet, can also repeat to receive multipass (such as M times), due to including number in the packet header of each data packet According to the number of packet, therefore, according to the number can identify the data packet whether attach most importance to multiple connection receive, can also be found according to the number Corresponding cache unit, the step of whether data packet being stored in the cache unit in order to subsequent execution.
S203, the data packet for calculating each data packet one of in the following manner verify comparison value: to the number of data packet Verification is carried out with the data of data packet, and data packet verification comparison value is calculated;Alternatively, the data to data packet carry out master gage Calculation obtains data packet verification comparison value;
Corresponding with the transmitting terminal calculating mode of check value, receiving end also calculates verification ratio using mode identical with transmitting terminal To value, for example, transmitting terminal, which carries out verification to the number and data of data packet, is calculated data packet check value, then receiving end Number and data to data packet carry out verification and data packet verification comparison value are calculated.Meanwhile using identical with transmitting terminal Algorithm carries out the data packet verification comparison value that each data packet is calculated in verification to data packet, for example, transmitting terminal uses odd even Checking algorithm calculates, then, receiving end also uses parity arithmetic to calculate.Specifically, it may refer to retouching in embodiment 1 It states.
In the present embodiment, receiving end can use corresponding with transmitting terminal after receiving the data packet in transmission data packet Algorithm data packet is verified, to guarantee that the integrality of data packet received and safety (are not tampered with It crosses).
S204, the data packet check value for comparing each data packet and data packet verify comparison value, if each data packet Data packet check value and data packet verification comparison value are consistent, then follow the steps S205;
If compared unanimously, verification passes through, to guarantee the integrality and safety of the data packet received.
S205, successively judge whether be stored with data packet in the corresponding cache unit of the number of Q data packet, do not having Have to store in the cache unit of storing data packet and number corresponding data packet with it, abandons the caching list for being stored with data packet The corresponding data packet of number of member.
The number of Q data packet transmitted in data packet is serial number, such as 1,2,3,4,5, can according to number according to It is secondary to inquire in corresponding cache unit (number is also 1,2,3,4,5) whether be stored with data packet.Since transmitting terminal is with repeatedly The mode in generation sends data packet, so, the same data packet receiving end can be repeated as many times and received, if in cache unit It has been stored with the data packet, has illustrated to receive, then has abandoned the data packet, if not storing the number in cache unit According to packet, explanation may be the case where receiving for the first time or packet loss has occurred, then to store the data packet, pass through same number as a result, It can repeatedly be received according to packet, can overcome the problems, such as packet loss to the full extent.Moreover, receiving end is receiving in the present embodiment Without returning to acknowledgement character response to transmitting terminal after data packet, reduces the interaction between transmitting terminal and receiving end, data biography can be improved Defeated efficiency.
In the way of sending message to be transmitted in step S105 in embodiment 1, receiving end also will receive multiple (such as N-M+ 1 time) transmission data packet, to receive complete message to be transmitted.Above only to how being grasped after receiving a transmission data packet It is described, but for any one transmission data packet that receiving end receives, receives and the mode of storage all may be used It is operated by according in a manner of described in step S202-S205.
In the present embodiment, transmission packet check value is also carried in the transmission data packet that receiving end receives, and is wrapped using transmission Check value carries out verification comparison, to guarantee the integrality and safety of data packet.It is optional as the another kind in the present embodiment Embodiment transmits data packet further include: the volume of each data packet of transmission packet check value and the transmission data packet of kth time transmission Number, wherein k is positive integer, and k < S, S are the number of cache unit;After step S202 receives transmission data packet, in step It is provided in this embodiment before storage numbers corresponding data packet with it in the cache unit of no storing data packet in S205 Method further include: the number of each data packet of the transmission data packet sent according to kth time obtains the transmission data that kth time is sent Each data packet of packet;The data progress of each data packet for the transmission data packet that data and kth time to Q data packet are sent The transmission packet verification comparison value of transmission data packet is calculated in verification;Transmission packet check value and transmission packet verification comparison value are compared, If consistent, verification passes through, and executes to store in the cache unit in no storing data packet and numbers corresponding data with it The step of packet.
Likewise, calculating with transmitting terminal, the mode of check value is corresponding, and receiving end is also adopted in a like fashion and algorithm meter Verification comparison value is calculated, the concrete mode and algorithm for calculating transmission packet verification comparison value are referred to calculate transmission in embodiment 1 The description of the concrete mode of packet check value.
Wherein, the transmission data packet that kth time is sent can be the transmission data packet of receiving end last time transmission, be also possible to The preceding transmission data packet sent several times, since the data packet that transmitting terminal is the transmission data packet sent based on this k times is calculated Packet check value is transmitted, transmission packet verification is calculated in the data packet for the transmission data packet that receiving end is similarly sent based on this k times Comparison value, in this way verification will pass through, still, if the data or volume of each data packet of the transmission data packet of this k times transmission Number kidnapped and to distort by third party, then receiving end verification can not just pass through, thus receiving end be known that have occurred packet loss, wrong packet or Person is kidnapped the risk distorted by third party, and then takes corresponding safeguard procedures.Therefore, receiving end has been transmitted across using oneself The data of transmission data packet participate in calculating verification comparison value and can increase the stability and accuracy of verification, so as to more Steadily guarantee the integrality and safety of data packet.
In addition, in two kinds of verifications (dual school of the verifying to data packet check value and the verifying to transmission packet check value Test) pass through after, just execute storing data packet the step of, as long as have it is a kind of verification do not pass through, do not execute subsequent step, thus The safety that can more guarantee data transmission, further ensures that the integrality and safety of the data packet for being stored in cache unit Property.
In addition, in the present embodiment, although the probability of re-transmission can be substantially reduced using iterative manner transmission data packet, Still there is the case where packet loss or wrong packet, for this purpose, in the present embodiment, after step S202 receives transmission data packet, It while executing step S203-S205, can also identify whether the data packet of re-transmission in need, initiate to retransmit to transmitting terminal and ask It asks.Specifically, after receiving transmission data packet, method provided in this embodiment further include: judge whether to meet n1=n2+ 1, Wherein, n1The smallest number, n in number for Q data packet2It is minimum in the number of the cache unit of no storing data packet Number;It include the number of the data packet of request retransmission in retransmission request if it is satisfied, then sending retransmission request to transmitting terminal n2.For example, numbering the cache unit (the smallest number) for being 2, there are no storing data packets, but the Q of the transmission data packet received The number of a data packet is 3,4,5.Illustrate that the initial position of the data transmission window mouth of transmitting terminal has floated to the data of number 3 The position of packet, in the way of floating backward, sending transmission data packet next time will send since the data packet of number 4, no The data packet of number 2 can be retransmited.And at this point, number be 2 cache unit again without the data packet for receiving reference numeral, So, such case (n is being identified in receiving end1=n2+ 1) it after, then requests to send the last transmission data sent to transmitting terminal Wrap (number n2), i.e., transmission data window originates determining transmission data packet from number 2, and therefore, receiving end is in retransmission request In carry no storing data packet cache unit number in the smallest number, with indicate transmitting terminal retransmit which transmission number According to packet.This mode for recognizing the need for retransmit provided in this embodiment can reduce the number of re-transmission, that is, simply request re-transmission Once number the smallest data packet, and can when the data transmission window mouth of transmitting terminal floats to the latter of the smallest number, It initiates to retransmit at once, guarantees the integrality of data in time.
Certainly, the mode that above-mentioned initiation provided in this embodiment retransmits is only a kind of preferred mode, and receiving end can also be with Do not judge whether to meet n1=n2+1.For example, as another optional embodiment, it can be determined that whether there is cache unit Number miLess than n1, miFor less than n1Each cache unit number, miValue is positive integer, and then wraps in retransmission request Number m containing each cache uniti(such as m1=1, m2=3 ..., m100=200).Wherein, receiving end can receive Each transmission data packet is judged, or is judged after receiving multiple transmission data packets, these numbers of request retransmission Corresponding data packet.
In the present embodiment, as described in example 1 above, message to be transmitted can be ICP/IP protocol message, be also possible to UDP message.When message to be transmitted is UDP message, the format of a UDP transmission data packet is as shown in figure 4, a UDP transmission In the data portion of data packet include Q data packet (data packet format refers to Fig. 2), for example, Q=3, Q data blocks according to Numeric order is joined together to form the data portion in a UDP transmission data packet messages packet.In addition, transmission data packet is also wrapped Include UDP puppet stem and UDP stem;UDP stem include: verification and.As an alternative embodiment, transmitting data receiving After packet, before storage numbers corresponding data packet with it in the cache unit of no storing data packet, the present embodiment provides Method further include: according to the data of UDP puppet stem, UDP stem and Q data packet be calculated transmission data packet comparison Verification and;It compares the Inspection for transmitting data packet and and verifies and if unanimously, verification passes through, execute and do not storing The step of storage numbers corresponding data packet with it in the cache unit of data packet.Pass through the verifying to the verification sum, Ke Yijin One step demonstrate,proves the integrality and safety of UDP transmission data packet, improves the stability and accuracy of verification result.
In addition, data cached buffer area is stored as an alternative embodiment, can also be arranged in the present embodiment, After transmitting data packet deposit cache unit, performs corresponding processing, be then transferred to buffer area, the data packet in buffer area can be defeated It is out or called (broadcastings of such as audio and video streams).Wherein, as an alternative embodiment, the size of buffer area can It is calculated with the processing time for handling a data packet according to network delay and cache unit, for example, receiving end is to transmitting terminal Network delay detection packet is sent, network delay T1 is calculated according to the response time of transmitting terminal returning response packet;A number will be handled Caching process time delay T2 is calculated multiplied by the number S of cache unit according to the time t of packet;When to network delay T1 and caching process Prolong T2 and sum to obtain delay time T3, and delay time T3 is calculated divided by the time t of one transmission data packet of processing slow Deposit the space size in area.This is only the specific example that the present embodiment provides, and the present embodiment does not limit technology buffer area The mode of size, because that can also have different calculations according to the difference of wire data type.
Above-mentioned data message method of reseptance provided in this embodiment, by data packet and cache unit reference numeral, together One data packet can repeat to receive repeatedly, data packet is stored in corresponding cache unit according to number, when some data packet When the phenomenon that generating error of transmission or packet loss in transmission process, due to that can also repeat to receive repeatedly, in maximum In degree the probability of repeating transmission can be reduced to avoid the packet loss of the data packet.In addition, receiving end can not be returned in transmission process Acknowledgement character response is returned, transmitting terminal also withouts waiting for the acknowledgement character response of receiving end return, it is possible to reduce the interaction of transmitting terminal and receiving end, The efficiency of improve data transfer, while the packet loss risk that does not need interaction feedback and may cause can also be reduced.And pass through Verification to several check values mentioned above, it is ensured that the integrality and safety of data packet.
Embodiment 3
The present embodiment additionally provides a kind of data transmission system.As shown in fig. 6, the system includes data sending device sum number According to message reception device, wherein data sending device can be applied to the data transmission method for uplink of embodiment 1, specific structure such as Fig. 7 Shown, data message reception device can be applied to the data message method of reseptance of embodiment 2, and specific structure is as shown in Figure 8.Number It may refer to the specific descriptions in Examples 1 and 2 according to the concrete function of sending device and reception device.The present embodiment is only done simply Description.
As shown in fig. 7, the data sending device includes:
Obtain module, for obtaining message to be transmitted, message to be transmitted by N number of data packet group at;
Data packet handing module is used for N number of data packet number consecutively, and number and the data to the data packet The data of packet carry out the data packet check value that each data packet is calculated in verification;Alternatively, the data to each data packet carry out The data packet check value of each data packet is calculated in verification, and to N number of data packet number consecutively;Wherein, each data The data packet check value that the packet header of packet includes at least the number for its distribution and is calculated for it;
Data window configuration module is transmitted, for determining the length of transmission data window, the length for transmitting data window is used In the number M for determining the data packet for including in a transmission data packet, M, N are positive integer, M≤N;
Sending module, for sending message to be transmitted: A.i=1 according to the following steps, wherein i is to send current transmission number According to the number of packet, the value of i is 1,2,3 ..., N-M+1;B., the initial position for transmitting data window is placed in the number numbered as i At packet;I-th transmission data packet to be sent, i-th transmission number to be sent are selected according to the length of transmission data window M data packet for being i to i+M-1 comprising number according to packet;Send i-th transmission data packet to be sent;C. judge whether i+1 is small In or be equal to N-M+1, if it is, i=i+1, return step B;If it is not, then message to be transmitted is sent.
As a kind of optional mode, i-th transmission data packet to be sent further include: transmission packet check value and kth time The number of each data packet of the transmission data packet received, wherein k is positive integer;
Data packet handing module is also used to before sending module sends i-th transmission data packet to be sent, to i-th The each data packet for the transmission data packet that the data and kth time of each data packet of secondary transmission data packet to be sent receive Data carry out verification and transmission packet check value are calculated.
As a kind of optional mode, the data sending device further include: receiving module, in which: receiving module, for connecing Retransmission request is received, retransmission request includes at least the number n of data packet to be retransmitted, wherein n≤i;Sending module, be also used to by The initial position of transmission data window is placed at the data packet that number is n;It is selected wait retransmit according to the length of transmission data window Transmission data packet, transmission data packet to be retransmitted includes the M data packet that number is n to n+M-1, and sends biography to be retransmitted Transmission of data packet.
As a kind of optional mode, the data sending device further include: message processing module (MPM), for according to preset plan Message to be transmitted is slightly divided into N number of data packet.
As a kind of optional mode, i-th transmission data packet to be sent includes UDP puppet stem and UDP stem;UDP Stem include: verification and;Data packet handing module is also used to according to UDP puppet stem, UDP stem and i-th biography to be sent The data of M data packet of transmission of data packet be calculated verification and.
As shown in figure 8, the data message reception device includes: S cache unit, cache unit processing module, receives mould Block, data packet handing module and control module, in which:
Processing module, for S cache unit number consecutively a, wherein cache unit is for storing a data Packet;
Receiving module, for receiving transmission data packet, transmission data packet includes Q data packet, wherein each data packet Packet header includes at least the number of data packet, and S, Q are positive integer, Q≤S;
Data packet handing module, the data packet for calculating each data packet one of in the following manner verify comparison value: The data of number and data packet to data packet carry out verification and data packet verification comparison value are calculated;Alternatively, to data packet Data carry out verification and data packet verification comparison value are calculated;
Control module, for comparing the data packet check value and data packet verification comparison value of each data packet, if each The data packet check value of data packet and data packet verification comparison value are consistent, then successively judge that the number of Q data packet is corresponding Whether it is stored with data packet in cache unit, storage is numbered corresponding with it in the cache unit of no storing data packet Data packet abandons the corresponding data packet of number for the cache unit for being stored with data packet.
It as optional mode a kind of in the present embodiment, transmits in data packet further include: transmission packet check value and kth time hair The number of each data packet for the transmission data packet sent;
The number of data packet handing module, each data packet for the transmission data packet for being also used to be sent according to kth time obtains The each data packet for the transmission data packet that kth time is sent;The transmission data packet that data and kth time to Q data packet are sent The data of each data packet carry out the transmission packet verification comparison value that transmission data packet is calculated in verification;
Control module is also used to compare transmission packet check value and transmission packet verification comparison value, if unanimously, verification is logical It crosses, executes the operation that corresponding data packet is numbered in the storage in the cache unit in no storing data packet with it.
As optional mode a kind of in the present embodiment, the data sending device further include: sending module;Wherein: control Module is also used to judge whether to meet n1=n2+ 1, wherein n1The smallest number, n in number for Q data packet2Not have The smallest number in the number of the cache unit of storing data packet;If it is satisfied, then control sending module sends weight to transmitting terminal Pass request;Sending module includes the number of the data packet of request retransmission in retransmission request for sending retransmission request to transmitting terminal n2
As optional mode a kind of in the present embodiment, transmitting data packet further includes UDP puppet stem and UDP stem;UDP is first Portion include: verification and;The data packet handing module is also used to according to the UDP puppet stem, the UDP stem and the Q A data packet be calculated it is described transmission data packet Inspection and;Control module is also used to compare the ratio of transmission data packet To verification and and verification and, if unanimously, verification pass through, execute in the cache unit of no storing data packet storage and its The step of numbering corresponding data packet.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention Embodiment person of ordinary skill in the field understood.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not Centainly refer to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be any One or more embodiment or examples in can be combined in any suitable manner.
Although the embodiments of the present invention has been shown and described above, it is to be understood that above-described embodiment is example Property, it is not considered as limiting the invention, those skilled in the art are not departing from the principle of the present invention and objective In the case where can make changes, modifications, alterations, and variations to the above described embodiments within the scope of the invention.The scope of the present invention By appended claims and its equivalent limit.

Claims (8)

1. a kind of data message method of reseptance characterized by comprising
S cache unit is preset, and to the S cache unit number consecutively, wherein a cache unit is for storing One data packet;
Transmission data packet is received, the transmission data packet includes Q data packet, wherein the packet header of each data packet includes at least The number and data packet check value of data packet, S, Q are positive integer, Q≤S;
The data packet for calculating each data packet one of in the following manner verifies comparison value: number to the data packet and described The data of data packet carry out verification and the data packet verification comparison value are calculated;Alternatively, the data to the data packet carry out The data packet verification comparison value is calculated in verification;
The data packet check value and data packet verification comparison value for comparing each data packet, if the institute of each data packet It states data packet check value and data packet verification comparison value is consistent, then successively judge that the number of the Q data packet is corresponding Cache unit in whether be stored with data packet, in the cache unit of no storing data packet storage numbered with it is corresponding Data packet, abandon be stored with data packet cache unit the corresponding data packet of number.
2. the method as described in claim 1, it is characterised in that:
In the transmission data packet further include: each data packet of transmission packet check value and the transmission data packet of kth time transmission Number;
After receiving the transmission data packet, numbered pair in described stored in the cache unit of no storing data packet with it Before the data packet answered, the method also includes:
The number of each data packet of the transmission data packet sent according to kth time obtains the transmission data packet that the kth time is sent Each data packet;
The data of each data packet for the transmission data packet that data and the kth time to the Q data packet are sent carry out school Test the transmission packet verification comparison value that the transmission data packet is calculated;
It compares the transmission packet check value and transmission packet verification comparison value executes if unanimously, verification passes through described The step of storage numbers corresponding data packet with it in the cache unit of no storing data packet.
3. method according to claim 1 or 2, it is characterised in that: after receiving transmission data packet, the method is also wrapped It includes:
Judge whether to meet n1=n2+ 1, wherein n1For the smallest number in the number of the Q data packet, n2Not store The smallest number in the number of the cache unit of data packet;
It include the number of the data packet of request retransmission in the retransmission request if it is satisfied, then sending retransmission request to transmitting terminal n2
4. method according to any one of claims 1 to 3, it is characterised in that:
The transmission data packet further includes UDP puppet stem and UDP stem;The UDP stem include: verification and;
After receiving the transmission data packet, numbered pair in described stored in the cache unit of no storing data packet with it Before the data packet answered, the method also includes: according to the UDP puppet stem, the UDP stem and the Q data packet Be calculated it is described transmission data packet Inspection and;
Compare it is described transmission data packet verification and with Inspection and, if unanimously, verification pass through, execute do not having described There is the step of storage numbers corresponding data packet with it in the cache unit of storing data packet.
5. a kind of data message reception device characterized by comprising S cache unit, receives cache unit processing module Module, data packet handing module and control module, in which:
The cache unit processing module, for the S cache unit number consecutively, wherein a cache unit is used for Store a data packet;
The receiving module, for receiving transmission data packet, the transmission data packet includes Q data packet, wherein each data The packet header of packet includes at least the number of data packet, and S, Q are positive integer, Q≤S;
The data packet handing module, the data packet for calculating each data packet one of in the following manner verify comparison value: The data of number and the data packet to the data packet carry out verification and the data packet verification comparison value are calculated;Or Person carries out verification to the data of the data packet and the data packet verification comparison value is calculated;
The control module, for comparing the data packet check value and data packet verification comparison value of each data packet, If the data packet check value of each data packet and data packet verification comparison value are consistent, the Q is successively judged Whether it is stored with data packet in the corresponding cache unit of the number of a data packet, in the cache unit of no storing data packet Middle storage numbers corresponding data packet with it, abandons the corresponding data packet of number for the cache unit for being stored with data packet.
6. device as claimed in claim 5, it is characterised in that:
In the transmission data packet further include: each data packet of transmission packet check value and the transmission data packet of kth time transmission Number;
The number of the data packet handing module, each data packet for the transmission data packet for being also used to be sent according to kth time obtains The each data packet for the transmission data packet that the kth time is sent;What data and the kth time to the Q data packet were sent The data for transmitting each data packet of data packet carry out the transmission packet verification comparison value that the transmission data packet is calculated in verification;
The control module is also used to compare the transmission packet check value and transmission packet verification comparison value, if unanimously, Verification passes through, and executes the behaviour for storing in the cache unit of no storing data packet described and numbering corresponding data packet with it Make.
7. such as device described in claim 5 or 6, it is characterised in that: further include sending module, in which:
The control module is also used to judge whether to meet n1=n2+ 1, if it is satisfied, then controlling the sending module to transmission End sends retransmission request;Wherein, n1For the smallest number in the number of the Q data packet, n2For the slow of no storing data packet The smallest number in the number of memory cell;
The sending module includes request retransmission in the retransmission request for sending the retransmission request to the transmitting terminal Data packet number n2
8. such as the described in any item devices of claim 5 to 7, it is characterised in that:
The transmission data packet further includes UDP puppet stem and UDP stem;The UDP stem include: verification and;
The data packet handing module is also used to according to the UDP puppet stem, the UDP stem and the Q data packet meter Calculate obtain it is described transmission data packet Inspection and;
The control module, be also used to compare it is described transmission data packet Inspection and and verification and, if unanimously, verified Pass through, executes described the step of storage numbers corresponding data packet with it in the cache unit of no storing data packet.
CN201810246182.9A 2018-03-23 2018-03-23 Data message receiving method and device Active CN110299971B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810246182.9A CN110299971B (en) 2018-03-23 2018-03-23 Data message receiving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810246182.9A CN110299971B (en) 2018-03-23 2018-03-23 Data message receiving method and device

Publications (2)

Publication Number Publication Date
CN110299971A true CN110299971A (en) 2019-10-01
CN110299971B CN110299971B (en) 2022-04-08

Family

ID=68025956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810246182.9A Active CN110299971B (en) 2018-03-23 2018-03-23 Data message receiving method and device

Country Status (1)

Country Link
CN (1) CN110299971B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110912766A (en) * 2019-10-18 2020-03-24 国家计算机网络与信息安全管理中心 Communication network multi-plane data consistency checking method
CN111277602A (en) * 2020-01-23 2020-06-12 奇安信科技集团股份有限公司 Network data packet identification processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145893A (en) * 2007-10-08 2008-03-19 华为技术有限公司 Receiving method, device and billing gateway for CDR data frame
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
CN106453233A (en) * 2016-08-10 2017-02-22 深圳市中兴物联科技股份有限公司 Data transmission method and apparatus based on UDP

Patent Citations (4)

* Cited by examiner, † Cited by third party
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 华为技术有限公司 Receiving method, device and billing gateway for CDR data frame
CN103957169A (en) * 2014-05-14 2014-07-30 上海复兰信息科技有限公司 Reliable UDP achievement method based on reserve request
CN106453233A (en) * 2016-08-10 2017-02-22 深圳市中兴物联科技股份有限公司 Data transmission method and apparatus based on UDP

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110912766A (en) * 2019-10-18 2020-03-24 国家计算机网络与信息安全管理中心 Communication network multi-plane data consistency checking method
CN111277602A (en) * 2020-01-23 2020-06-12 奇安信科技集团股份有限公司 Network data packet identification processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110299971B (en) 2022-04-08

Similar Documents

Publication Publication Date Title
CN104539739B (en) A kind of system, method and device that file uploads
JP3614907B2 (en) Data retransmission control method and data retransmission control system
CN101621471B (en) System for transmitting and receiving packets
CN110299970A (en) A kind of data message sending method and device
CN109936510A (en) Multipath RDMA transmission
KR101913917B1 (en) Efficient link layer retry protocol utilizing implicit acknowledgements
US9007905B2 (en) System to improve an Ethernet network
KR102046792B1 (en) Method of transporting data from sending node to destination node
CN102317801A (en) Efficient and loss tolerant method and mechanism for measuring available bandwidth
CN103763314A (en) Method and device for processing user layer data in practically deployed tumble detecting system
CN109981385B (en) Method, device and system for realizing packet loss detection
CN110299971A (en) A kind of data message method of reseptance and device
Mo et al. Practical coding-based multi-hop reliable data transfer for underwater acoustic networks
MXPA06004392A (en) Method for lost packet reconstruction and device for carrying out said method.
CN102299777B (en) Data repeating method and device
CN110299973A (en) A kind of method of reseptance and device of data scrolling transmission
CN101631357A (en) Method, device and terminal for selective response packet transmission
CN110299969A (en) A kind of sending method and device of data scrolling transmission
CN110299972A (en) A kind of data transmission method for uplink and device
CN110299974A (en) A kind of data receiver method and device
US10200154B2 (en) System and method for early packet header verification
CN108183767A (en) A kind of method for reliable transmission suitable for space DTN networks
US9306769B2 (en) Cell-based link-level retry scheme
US9762353B2 (en) Data packet for bidirectional transmission of data packets during data transmission between a first and a second communication appliance, and method for transmitting such a data packet
CN108667563A (en) A kind of forward error correction packet number acquisition methods and 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