CN102137027B - Reliable data transmission method and device thereof - Google Patents

Reliable data transmission method and device thereof Download PDF

Info

Publication number
CN102137027B
CN102137027B CN2011101123109A CN201110112310A CN102137027B CN 102137027 B CN102137027 B CN 102137027B CN 2011101123109 A CN2011101123109 A CN 2011101123109A CN 201110112310 A CN201110112310 A CN 201110112310A CN 102137027 B CN102137027 B CN 102137027B
Authority
CN
China
Prior art keywords
packet
data
buffering area
sequence number
transmission
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
Application number
CN2011101123109A
Other languages
Chinese (zh)
Other versions
CN102137027A (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.)
Xiamen Information Security Research Institute Co., Ltd.
Original Assignee
Xiamen Meiya Pico Information 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 Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN2011101123109A priority Critical patent/CN102137027B/en
Publication of CN102137027A publication Critical patent/CN102137027A/en
Application granted granted Critical
Publication of CN102137027B publication Critical patent/CN102137027B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The invention provides a reliable data transmission method and a device thereof. The method comprises the following steps: a data transmitting end divides a file to be transmitted into a data packets with serial numbers; according to a preset buffer data packet format, the data packets are packaged into data packets to be transmitted, and then are added to a transmission buffer area: the data packets to be transmitted in the transmission buffer area are transmitted in sequence; the data packets confirmed at a data receiving end in the transmission buffer area are deleted; whether the stopping time of the data packets in the transmission buffer area is over a preset time threshold or not is judged, and if so, the data packets are reset to be the data packets to be transmitted; and the transmission process is repeated. In the scheme of the invention, as only the data format and the transmission process at the transmitting end and the receiving of the data packets are controlled, no special data packets are needed to be transmitted between the transmitting end and the receiving end to carry out handshake connection operation, and under the condition that the system expense is less and the data transmission efficiency is high, the problem that the existing UDP (User Datagram Protocol) can not reliably transmit the data can be solved.

Description

The method for reliable transmission of data and device
Technical field
The present invention relates to the network communications technology field, particularly relate to a kind of method for reliable transmission and device of data.
Background technology
Transmission control protocol (TCP, Transmission Control Protocol) and User Datagram Protoco (UDP) (UDP, User Datagram Protocol) are the communications protocol commonly used of present network data transmission.Transmission Control Protocol be a kind of connection-oriented, reliable, based on the transport layer communication protocol of byte stream, after data successfully sent to target machine, TCP can require to send an affirmation, to guarantee the reliable transmission of data; The operation principle of Transmission Control Protocol is to need to set up a virtual connection between the main frame of swap data, to realize the packet exchange of high reliability.Udp protocol is a kind of connectionless transport layer protocol, and the simple unreliable formation transfer service of oriented manipulation is provided; UDP is applicable to the situation that does not need the TCP reliable mechanism, compares with TCP, and the speed of its transmission data is fast, overhead is few.But because the unreliability of UDP transmission data makes and utilizes its shared resource to become very difficult.
As reliable data transmission scheme, TCP is first-selected Data Transport Protocol, owing to be provided with network firewall and/or network address conversion gateway (NAT at present a lot of network environment, Network Address Translation), need sometimes can not adopt Transmission Control Protocol to carry out exchanges data between two main frames of transmission data; In addition, the Transmission Control Protocol overhead is big, and setting up and discharging all has certain restriction.By contrast, udp protocol not only efficiency of transmission is higher, and the restriction of passing through network fire compartment wall and NAT gateway easily realizes the exchanges data between the outdoor main unit in network firewall and the NAT gateway.But, use udp protocol transmission data, the drawback of its unreliable transmission data is also arranged: on the one hand, be easy to generate the packet loss phenomenon; On the other hand, the phenomenon that data packet disorder arrives easily takes place.Prior art is for addressing the above problem, generally need the foundation of imitation Transmission Control Protocol to shake hands, carry out transfer of data and confirm, consult to close operations such as connection, therefore, though this method has effectively solved some drawbacks of udp protocol, can realize reliable transfer of data, but because each transmission data are all wanted the three-way handshake operation, data transmission efficiency is low.
Summary of the invention
Technical problem to be solved by this invention provides a kind of method for reliable transmission of data, can guarantee on the basis of efficient transfer data, solves the problem that existing udp protocol can not reliable transmitting data.
The present invention also provides a kind of reliable transmission device of data, to guarantee said method application in practice.
In order to address the above problem, the invention discloses a kind of method for reliable transmission of data, comprising: the file that data sending terminal will send splits into packet, and for each packet is provided with sequence number, organizes the foundation of bag again as data receiver; By default buffered data packet format the above-mentioned data envelope that is provided with sequence number is dressed up packet to be sent, and be added into the transmission buffering area; Send the packet to be sent in the described transmission buffering area in order; Delete the packet that data receiver has been confirmed in the described transmission buffering area; Whether the time of staying of judging packet in the described transmission buffering area surpasses default time threshold, if, then this packet is reset to packet to be sent, repeat above-mentioned process of transmitting.
Preferably, before the packet to be sent in sending described transmission buffering area, also comprise: data envelope to be sent is dressed up the transmission packet by default protocol header form.
Preferably, also comprise: when the sending order of described transmission buffering area when increasing progressively from small to large by sequence number, if the packet that described data receiver receives is the expectation packet, then the packet in the described reception buffering area is pressed the sequence number ordering, and the maximum sequence number that the expected data packet number changes the continuous packet of sequence number into added 1, and, by default protocol header form this maximum sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets that are less than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of;
When the sending order of described transmission buffering area when successively decreasing from big to small by sequence number, if the packet that described data receiver receives is the expectation packet, then the packet in the described reception buffering area is pressed the sequence number ordering, and the minmal sequence that the expected data packet number changes the continuous packet of sequence number into number subtracted 1, and, by default protocol header form this minmal sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets more than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of.
Preferably, also comprise: when the packet that will need to retransmit resets to packet to be sent, write down its number of retransmissions; If the number of retransmissions of retransmission data packet may is all greater than default number of retransmissions higher limit in the described transmission buffering area, then be that described default time threshold increases a fixed value; If the number of retransmissions of retransmission data packet may is all less than default number of retransmissions lower limit in the described transmission buffering area, then be that described default time threshold reduces by a fixed value.
Preferably, the data item of described default buffered data packet comprises: sequence number, timestamp and the number of retransmissions of the data that transmit, data length, transmission packet.
Preferably, the data item of described default protocol header comprises: the command word of bag sign, upper-layer protocol, send sequence number, sequence number, the data length of reply data bag and the data that will transmit of packet.
Preferably, before being added into described transmission buffering area, described packet to be sent also comprises: judge whether described transmission buffering area fills up, if then abandon this packet to be sent.
According to another preferred embodiment of the present invention, a kind of reliable transmission device of data is also disclosed, comprise data sending terminal and data receiver, described data sending terminal is connected by network with data receiver, described data sending terminal comprises data split cells, buffered data packet encapsulation unit, data transmission unit, response confirmation unit, packet reset cell and sends buffering area, wherein: the file that described data split cells is used for sending splits into packet, and, organize the foundation of bag again as described data receiver for each packet is provided with sequence number; Described buffered data encapsulation unit is used for by default buffered data packet format the data envelope that is provided with sequence number that described data split cells generates being dressed up packet to be sent, and is added into described transmission buffering area; Described data transmission unit is used in order the packet to be sent of described transmission buffering area is sent to described data receiver by described network; The packet that described response confirmation unit is used for described data receiver has been confirmed is deleted from described transmission buffering area; Described packet reset cell is used for judging that whether the time of staying of described transmission buffering area packet is above default time threshold, if then this packet is reset to packet to be sent; Described transmission buffering area is used to preserve the packet to be sent that described buffered data packet encapsulation unit generates, and the packet that described data transmission unit sends, described response confirmation unit does not also have deletion.
Preferably, described data sending terminal also comprises the protocol package encapsulation unit, is used to described data transmission unit by default protocol header form the data envelope to be sent in the described transmission buffering area to be dressed up the transmission packet.
Preferably, described data receiver is provided with and receives buffering area and Data Receiving processing unit, and wherein: described reception buffering area is used to preserve the packet that described Data Receiving processing unit receives;
Described Data Receiving processing unit is used for, when the sending order of described data sending terminal when increasing progressively from small to large by sequence number, judge whether the packet that described data receiver receives is the expectation packet, if, then the packet in the described reception buffering area is pressed the sequence number ordering, and the maximum sequence number that the expected data packet number changes the continuous packet of sequence number into added 1, and, by default protocol header form this maximum sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into described reception buffering area; Wherein, all packets that are less than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of;
When the sending order of described data sending terminal when successively decreasing from big to small by sequence number, judge whether the packet that described data receiver receives is the expectation packet, if, then the packet in the described reception buffering area is pressed the sequence number ordering, and the minmal sequence that the expected data packet number changes the continuous packet of sequence number into number subtracted 1, and, by default protocol header form this minmal sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets more than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of.
Preferably, described data sending terminal also comprises the parameter adjustment unit, is used for writing down its number of retransmissions when the packet that described packet reset cell will need to retransmit resets to packet to be sent; And whether the number of retransmissions of judging retransmission data packet may in the described transmission buffering area is all greater than default number of retransmissions higher limit, if then be that described default time threshold increases a fixed value; And whether the number of retransmissions of judging retransmission data packet may in the described transmission buffering area is all less than default number of retransmissions lower limit, if then be that described default time threshold reduces by a fixed value.
Preferably, described data sending terminal also comprises transmission buffering area control unit, is used to described buffered data encapsulation unit before described packet to be sent is added into described transmission buffering area, judges whether described transmission buffering area fills up, if then abandon this packet to be sent.
Compared with prior art, the present invention has the following advantages:
In the preferred embodiment of the present invention scheme, only whether the data format of data transmitting terminal and process of transmitting and data receiver being acknowledged receipt of packet controls, need not to send the attended operation of shaking hands of special packet between data sending terminal and the data receiver, keeping under the situation that the udp protocol overhead is few, data transmission efficiency is higher than Transmission Control Protocol, solved being easy to of existing in the existing udp protocol transmission mechanism produce packet loss phenomenon and data packet disorder arrive phenomenon and cause can not reliable transmitting data problem.
In the further preferred embodiment of the present invention, data receiver need not each packet that receives is all sent response data packet, only the expected data bag is sent response data packet, after data sending terminal receives this response data packet, all transmission packets that will be not more than sequence number in (or being not less than) this response data packet are all from sending buffer block deletion, can further reduce both sides' interaction times and communication data amount, improve communication efficiency.
In the further preferred embodiment of the present invention, number of retransmissions by supervision packet is judged the network environment situation, and adjust the time of staying of packet successively automatically at buffering area, thereby, can further improve data transmission efficiency between data sending terminal and the data receiver according to the network environment situation.
Description of drawings
Fig. 1 is the method for reliable transmission first embodiment flow chart of data of the present invention;
Fig. 2-the 1st, the method for reliable transmission second embodiment data transmission flow figure of data of the present invention;
Fig. 2-the 2nd, the method for reliable transmission second embodiment Data Receiving flow chart of data of the present invention;
Fig. 3 is the structured flowchart of reliable transmission device one embodiment of data of the present invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Method embodiment one:
With reference to Fig. 1, show the flow process of method for reliable transmission first embodiment of data of the present invention, specifically may further comprise the steps:
Step S101: the file that data sending terminal will send splits into and is provided with the serial number data bag;
After data receiver is received all packets, can be reassembled into data file according to the sequence number of each packet.
Step S102: by default buffered data packet format the above-mentioned data envelope that is provided with sequence number is dressed up packet to be sent, and be added into the transmission buffering area;
In this default buffered data packet format, the data (data) that should comprise sequence number (Sq_no) at least and will transmit if the data length that will transmit is unfixing, also should comprise data length (len); In addition, judge and record data bag re-transmission situation, can also comprise timestamp (time) and number of retransmissions (times) for convenient.
For preventing that sending buffering area overflows, before packet to be sent being added into the transmission buffering area, should judge that also whether send buffering area also has clearance spaces, if it is full to send buffering area, can select to abandon this packet to be sent.
Step S103: the packet to be sent that will send in order in the buffering area sends;
In this preferred embodiment, send packet to be sent by sequence number order from small to large.
In addition,, data envelope to be sent is dressed up the transmission packet, data that this protocol header form comprises package identification symbol, data length, will transmit etc. by the protocol header form of mutual agreement sending before packet to be sent in the buffering area sends.
Step S104: deletion sends the packet that data receiver has been confirmed in the buffering area;
Being needs the reliability guarantee that data send data receiver to reply and confirms to reply, and has only and confirms locally to receive or confirms under the obstructed situation of network that the packet that data sending terminal just will send in the buffering area is deleted.In this preferred embodiment, for reducing both sides' interaction times and transinformation content, data receiver is only replied answer to the packet of the sequence number maximum that acknowledges receipt of, after data sending terminal is received this answer, all delete sending the packet that in the buffering area all are less than or equal to this sequence number.
Step S105: judge that whether the time of staying that sends packet in the buffering area is above default time threshold, if then change step S106; Otherwise, do not do any processing;
In this preferred embodiment, the time of staying threshold value of packet in sending buffering area at first is decided to be 500 milliseconds.When monitor thread finds that the time of staying of certain packet surpasses this threshold value, then it is retransmitted, and the record of increase number of retransmissions, when the accumulative total number of retransmissions of all retransmission data packet may reaches certain certain value (as 5 times), illustrate that network environment is relatively poor, can select increases a fixed value (as 1000 milliseconds) with time of staying threshold value, increase along with the accumulative total number of retransmissions, time of staying maximum also increases discretely, reach certain value (as 10 times) up to the packet that reaches maximum retransmission, it is obstructed then can to regard as network.When network environment preferably the time, the accumulative total number of retransmissions of retransmission data packet may reduces, and time of staying threshold value is also correspondingly discrete to be reduced, but minimum can not be less than 500 milliseconds.
Step S106: this packet is reset to packet to be sent, change step S103 and repeat above-mentioned process of transmitting;
When the number of retransmissions of a packet during greater than certain number of times (as 5 times), it is obstructed to regard as network, no longer sends packet, can select to send buffering area and empty; When receiving the respond packet of data receiver once more, can regard as network recovery, recover to send the process of packet again.
Method embodiment two:
In this preferred embodiment, communication two party is data sending terminal and data receiver each other, when sending data, can also receive the data from the other side, and communication two party adopts the common protocols head, and the form of protocol header is as shown in table 1:
The form of table 1, protocol header
?Begin_tag Cmd Sq_no ?Ack_seq datalen data
Wherein, Begin_tag has only the bag of this sign just to take bag to be processed as for the bag sign; Cmd is the command word of upper-layer protocol; The sequence number that Sq_no wraps for this reason; Ack_seq wraps the reply data packet number of opposite end when replying for this reason; Datalen wraps the data length that will transmit for this reason; Data wraps the data that will transmit for this reason.
Each data terminal is provided with and sends buffering area and receive buffering area, be convenient management, buffering area adopts the queue structure of going in ring, and the packet that each data terminal will send is put into the transmission buffering area, the data that receive are put into the reception buffering area, and the form of buffering area bag is as shown in table 2:
The form of table 2, buffering area bag
buffer len Sq_no time times
Wherein, the data of buffer for transmitting; Len is a data length; Sq_no is packet number for this reason; The timestamp that time wraps for this reason; The number of retransmissions that times wraps for this reason.
In addition, this preferred embodiment is not only controlled the data process of transmitting, also data receiving course and acknowledgement mechanism thereof are improved, with from small to large sending order is example, when replying, the mode that each packet is all replied, be improved to the reply data bag of only replying the sequence number maximum, after data receiver is received this response packet, all packets that sequence number in the buffering area are not more than this response packet sequence number are all deleted, significantly reduce the network interaction data volume, improved data transmission efficiency.
With reference to Fig. 2-1, show the flow process of the method for reliable transmission second embodiment Data Receiving of data of the present invention, specifically may further comprise the steps:
Step S201: the file that will send splits into the packet that is composed of sequence number;
Step S202: judge whether the transmission buffering area full? if change step S203; Otherwise, change step S204;
Step S203: abandon this packet;
Step S204: after data encryption, data envelope is dressed up packet to be sent, and be added into the transmission buffering area by the buffering area packet format shown in the table 2;
In this preferred embodiment, before encapsulation of data, earlier data are encrypted; In specific implementation process, can select as required whether to encrypt.
Step S205: judge to send buffering area go in ring packet in the formation sequence number (Sq_no) whether≤sequence number (Ack_seq) that data receiver is confirmed? if change step S206; Otherwise, change step S207;
In this preferred embodiment, for guaranteeing data transmission efficiency, communication two party can add response message when sending packet, therefore, can further reduce interaction times, improve data transmission efficiency.
Step S206: this packet is deleted in formation from going in ring;
Step S207: send this packet to be sent;
Step S208: judge that this packet needs to retransmit? if change step S205; Otherwise, change step S206.
By the timestamp (time) and the current time in system of comparing data bag, the time of staying of finding certain packet is during the overtime threshold value, increase the value of number of retransmissions (times), and the timestamp (time) and the number of retransmissions parameters such as (times) of this packet reset, change judgement, the process of transmitting of step S205 repetitive data packet then.
In the specific implementation, can be by the transmit status of packet in dedicated process or the dedicated thread monitoring transmission buffering area, the transmit status of the packet in also can the cycle criterion circle queue, the present invention is not limited this.
With reference to Fig. 2-2, show the flow process of the method for reliable transmission second embodiment data transmission of data of the present invention, specifically may further comprise the steps:
Step S221: receive the packet that data sending terminal sends;
Step S222: judge that this packet is the packet of expectation? if change step S226; Otherwise, change step S223;
After data receiver receives packet, judge at first whether this reception sequence of data packet number is the expectation receive sequence number, if the sequence number of expectation will expect that then sequence number increases progressively, and handles this packet; Otherwise, this packet is added in the formation of reception buffering area.
Step S223: judge that this is the packet of repetition? if change step S224; Otherwise change step S225;
The sequence number of packet sequence number that receives and the packet that receives the buffering area preservation is compared judgement, if the packet (packet that has promptly received) that repeats then abandons it; If it is full to receive buffering area, then empty buffering area, this packet is handled, then, the expectation sequence number is provided with the next packet of packet for this reason.
Step S224: the packet that abandons this repetition;
Step S225: this packet is added the reception buffering area;
Step S226: to receiving data packet sequencing in the buffering area;
Whenever receive an expected data bag, all to check and receive the packet of having preserved in the buffering area, according to its sequence number it is sorted, from small to large, if just, expect that then sequence number increases progressively, and this packet handled for the expectation packet, from receive buffering area, this packet bag is deleted then, till non-expected data bag; Expect that sequence number has increased progressively and be continuous data bag maximum sequence number+1 that has received this moment, send ordering back maximum sequence number to data sending terminal and wrap in response.
Step S227: will expect that sequence number is incremented to the continuous data bag maximum sequence number that has received and adds 1;
Step S228: handle above-mentioned expected data bag, then from receiving buffer block deletion;
For treated packet, promptly have the packet of continuous sequence number, can be from receiving buffer block deletion, for the follow-up data bag provides spatial cache.
Need to prove that in the above preferred embodiment, data sending terminal is that to send packet in proper order with from small to large sequence number be that example describes.If data sending terminal sends packet in proper order with sequence number from big to small, then the processing mode of above-mentioned data receiver is just in time opposite, that is: if the packet that data receiver receives is the expectation packet, the packet that then will receive in the buffering area is pressed the sequence number ordering, and the minmal sequence that the expected data packet number changes the continuous packet of sequence number into number subtracted 1, and, by default protocol header form this minmal sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets more than or equal to sequence number in the response data packet are the packet that data receiver acknowledges receipt of.
In addition, when sending response data packet, can in sending packet, add this response message, thereby further reduce both sides' interaction times, raising communication efficiency according to the protocol header form of this preferred embodiment.
For aforesaid each method embodiment, simple in order to describe, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously; Secondly, those skilled in the art should know that also said method embodiment all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
Device embodiment:
With reference to Fig. 3, show the structured flowchart of reliable transmission device one embodiment of data of the present invention, comprise data sending terminal 31, data receiver 32 and network 33, data sending terminal 31 is connected by network 33 with data receiver 32, data sending terminal 31 specifically comprises data split cells 311, buffered data packet encapsulation unit 312, data transmission unit 313, protocol package encapsulation unit 314, response confirmation unit 315, packet reset cell 316, parameter adjustment unit 317, send buffering area control unit 318 and send buffering area 310, data receiver 32 specifically comprises reception buffering area 320 and Data Receiving processing unit 321, wherein:
The data file that data split cells 311 is used for sending splits into several packets, and for each packet is provided with a sequence number, organizes the foundation of bag spanned file again as data receiver 32;
Buffered data encapsulation unit 312 is used for by default buffered data packet format the data envelope that disposes sequence number that data split cells 311 generates being dressed up packet to be sent, and is added into transmission buffering area 310;
Send buffering area control unit 318 and be used to buffered data encapsulation unit 312 before packet to be sent being added into transmission buffering area 310, judge whether send buffering area 310 fills up, if then abandon this packet to be sent;
The packet to be sent that data transmission unit 313 is used for will sending in order buffering area 310 is sent to data receiver 32 by network 33;
Protocol package encapsulation unit 314 is used to data transmission unit 313 to dress up the transmission packet by the data envelope to be sent that default protocol header form will send in the buffering area 310;
The packet that response confirmation unit 315 is used for data receiver 32 has been confirmed is from sending buffering area 310 deletions;
Packet reset cell 316 is used for judging that whether the time of staying that sends buffering area 310 packets is above default time threshold, if then this packet is reset to packet to be sent;
Parameter adjustment unit 317 is used for writing down its number of retransmissions when the packet that packet reset cell 316 will need to retransmit resets to packet to be sent; And, judge that whether the number of retransmissions that sends retransmission data packet may in the buffering area 310 is all greater than default number of retransmissions higher limit, if then increase a fixed value for default time threshold; And judge that whether the number of retransmissions that sends retransmission data packet may in the buffering area 310 is all less than default number of retransmissions lower limit, if then reduce by a fixed value for default time threshold;
Send buffering area 310 and be used to preserve the packet to be sent that buffered data packet encapsulation unit 312 generates, and the packet that data transmission unit 313 has sent, response confirmation unit 315 does not also have deletion.
Data Receiving processing unit 321 is used for whether the packet that judgment data receiving terminal 32 receives is the expectation packet, if, the packet that then will receive in the buffering area 320 is pressed the sequence number ordering, and the maximum sequence number that the expected data packet number changes the continuous packet of sequence number into added 1, and, by default protocol header form this maximum sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into reception buffering area 320; Wherein, all are less than or equal to that the packet of sequence number is the packet that data receiver 32 acknowledges receipt of in the response data packet.
Need to prove that said apparatus embodiment belongs to preferred embodiment, related unit and module might not be that the present invention is necessary.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device embodiment of the present invention, because it is similar substantially to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than the method for reliable transmission and the device of a kind of data provided by the present invention is described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. the method for reliable transmission of data is characterized in that, comprising:
The file that data sending terminal will send splits into packet, and for each packet is provided with sequence number, organizes the foundation of bag again as data receiver;
By default buffered data packet format the above-mentioned data envelope that is provided with sequence number is dressed up packet to be sent, and be added into the transmission buffering area;
Send the packet to be sent in the described transmission buffering area in order;
Delete the packet that data receiver has been confirmed in the described transmission buffering area;
Whether the time of staying of judging packet in the described transmission buffering area surpasses default time threshold, if, then this packet is reset to packet to be sent, repeat above-mentioned process of transmitting;
When the sending order of described transmission buffering area when increasing progressively from small to large by sequence number, if the packet that described data receiver receives is the expectation packet, then the packet in the described reception buffering area is pressed the sequence number ordering, and the maximum sequence number that the expected data packet number changes the continuous packet of sequence number into added 1, and, by default protocol header form this maximum sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets that are less than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of;
When the sending order of described transmission buffering area when successively decreasing from big to small by sequence number, if the packet that described data receiver receives is the expectation packet, then the packet in the described reception buffering area is pressed the sequence number ordering, and the minmal sequence that the expected data packet number changes the continuous packet of sequence number into number subtracted 1, and, by default protocol header form this minmal sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets more than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of.
2. the method for claim 1 is characterized in that, before the packet to be sent in sending described transmission buffering area, also comprises: by default protocol header form data envelope to be sent is dressed up the transmission packet.
3. the method for claim 1 is characterized in that, also comprises:
When the packet that will need to retransmit resets to packet to be sent, write down its number of retransmissions;
If the number of retransmissions of retransmission data packet may is all greater than default number of retransmissions higher limit in the described transmission buffering area, then be that described default time threshold increases a fixed value; If the number of retransmissions of retransmission data packet may is all less than default number of retransmissions lower limit in the described transmission buffering area, then be that described default time threshold reduces by a fixed value.
4. the method for claim 1 is characterized in that, the data item of described default buffered data packet comprises: sequence number, timestamp and the number of retransmissions of the data that transmit, data length, transmission packet.
5. method as claimed in claim 1 or 2 is characterized in that, the data item of described default protocol header comprises: the command word of bag sign, upper-layer protocol, send sequence number, sequence number, the data length of reply data bag and the data that will transmit of packet.
6. the method for claim 1 is characterized in that, also comprises before described packet to be sent is added into described transmission buffering area: judge whether described transmission buffering area fills up, if then abandon this packet to be sent.
7. the reliable transmission device of data, comprise data sending terminal and data receiver, described data sending terminal is connected by network with data receiver, it is characterized in that, described data sending terminal comprises data split cells, buffered data packet encapsulation unit, data transmission unit, response confirmation unit, packet reset cell and sends buffering area, described data receiver is provided with and receives buffering area and Data Receiving processing unit, wherein:
The file that described data split cells is used for sending splits into packet, and for each packet is provided with sequence number, organizes the foundation of bag again as described data receiver;
Described buffered data encapsulation unit is used for by default buffered data packet format the data envelope that is provided with sequence number that described data split cells generates being dressed up packet to be sent, and is added into described transmission buffering area;
Described data transmission unit is used in order the packet to be sent of described transmission buffering area is sent to described data receiver by described network;
The packet that described response confirmation unit is used for described data receiver has been confirmed is deleted from described transmission buffering area;
Described packet reset cell is used for judging that whether the time of staying of described transmission buffering area packet is above default time threshold, if then this packet is reset to packet to be sent;
Described transmission buffering area is used to preserve the packet to be sent that described buffered data packet encapsulation unit generates, and the packet that described data transmission unit sends, described response confirmation unit does not also have deletion;
Described reception buffering area is used to preserve the packet that described Data Receiving processing unit receives;
Described Data Receiving processing unit is used for, when the sending order of described data sending terminal when increasing progressively from small to large by sequence number, judge whether the packet that described data receiver receives is the expectation packet, if, then the packet in the described reception buffering area is pressed the sequence number ordering, and the maximum sequence number that the expected data packet number changes the continuous packet of sequence number into added 1, and, by default protocol header form this maximum sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into described reception buffering area; Wherein, all packets that are less than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of;
When the sending order of described data sending terminal when successively decreasing from big to small by sequence number, judge whether the packet that described data receiver receives is the expectation packet, if, then the packet in the described reception buffering area is pressed the sequence number ordering, and the minmal sequence that the expected data packet number changes the continuous packet of sequence number into number subtracted 1, and, by default protocol header form this minmal sequence number is packaged into response data packet and sends; Otherwise, this packet that receives is put into the reception buffering area; Wherein, all packets more than or equal to sequence number in the described response data packet are the packet that described data receiver acknowledges receipt of.
8. device as claimed in claim 7, it is characterized in that, described data sending terminal also comprises the protocol package encapsulation unit, is used to described data transmission unit by default protocol header form the data envelope to be sent in the described transmission buffering area to be dressed up the transmission packet.
9. device as claimed in claim 7 is characterized in that described data sending terminal also comprises the parameter adjustment unit, is used for writing down its number of retransmissions when the packet that described packet reset cell will need to retransmit resets to packet to be sent; And whether the number of retransmissions of judging retransmission data packet may in the described transmission buffering area is all greater than default number of retransmissions higher limit, if then be that described default time threshold increases a fixed value; And whether the number of retransmissions of judging retransmission data packet may in the described transmission buffering area is all less than default number of retransmissions lower limit, if then be that described default time threshold reduces by a fixed value.
10. device as claimed in claim 7, it is characterized in that, described data sending terminal also comprises transmission buffering area control unit, be used to described buffered data encapsulation unit before described packet to be sent is added into described transmission buffering area, judge whether described transmission buffering area fills up, if then abandon this packet to be sent.
CN2011101123109A 2011-05-03 2011-05-03 Reliable data transmission method and device thereof Active CN102137027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011101123109A CN102137027B (en) 2011-05-03 2011-05-03 Reliable data transmission method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011101123109A CN102137027B (en) 2011-05-03 2011-05-03 Reliable data transmission method and device thereof

Publications (2)

Publication Number Publication Date
CN102137027A CN102137027A (en) 2011-07-27
CN102137027B true CN102137027B (en) 2013-07-31

Family

ID=44296686

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011101123109A Active CN102137027B (en) 2011-05-03 2011-05-03 Reliable data transmission method and device thereof

Country Status (1)

Country Link
CN (1) CN102137027B (en)

Families Citing this family (49)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103368680B (en) * 2012-03-27 2017-11-24 深圳富泰宏精密工业有限公司 Mitigate the system and method for AT channel loads
CN102970142B (en) * 2012-12-11 2016-03-02 成都卫士通信息产业股份有限公司 A kind of VPN device is adding the method and system of concurrent encryption and decryption under close snap ring border
CN103002049A (en) * 2012-12-20 2013-03-27 北京思特奇信息技术股份有限公司 Network transmission system of large quantities of data
CN103036904B (en) * 2012-12-27 2015-10-21 东方通信股份有限公司 A kind of udp protocol that uses in a communication network carries out the method for reliable data transmission
CN103078921B (en) * 2012-12-28 2016-08-17 Tcl集团股份有限公司 A kind of transmission, the method and device of reception message
CN103078811B (en) * 2013-01-31 2015-12-09 北京金和软件股份有限公司 A kind of based on multi-thread environment network packet out-of-order control method
CN104184546B (en) * 2013-05-27 2019-04-02 百度在线网络技术(北京)有限公司 The method and system of message retransmission are reduced in a kind of mobile communications network
CN103825873A (en) * 2013-08-30 2014-05-28 天地融科技股份有限公司 Intelligent secret key equipment, mobile terminal and transmission method and system for audio data
CN103986647A (en) * 2014-05-21 2014-08-13 大唐移动通信设备有限公司 Message transmission method and device
CN104135488B (en) * 2014-08-13 2018-04-27 上海申腾信息技术有限公司 A kind of data transmission system and transmission method and application in relation to Telemedicine System
CN104363248B (en) * 2014-11-27 2018-01-09 广州杰赛科技股份有限公司 Radio data transmission method and user terminal
CN105846968A (en) * 2015-01-14 2016-08-10 中兴通讯股份有限公司 Retransmission realization methods and apparatus, transmitting device and receiving device
CN104780401B (en) * 2015-03-25 2017-12-22 腾讯科技(深圳)有限公司 The sending method and device of video data
CN104768081B (en) * 2015-04-17 2017-08-08 武汉兴图新科电子股份有限公司 A kind of packet loss repeating method for realizing flow control
CN104901889A (en) * 2015-05-15 2015-09-09 嘉兴市稠江光电仪器技术有限公司 Remote data collection and control method based on improved-type UDP/IP protocol
CN105187949B (en) * 2015-08-21 2019-06-25 广州市百果园网络科技有限公司 A kind of transmission method and client of video
CN105554054A (en) * 2015-09-29 2016-05-04 深圳市美贝壳科技有限公司 Method for file transmission saving between terminals
CN106561014A (en) * 2015-11-18 2017-04-12 天地融科技股份有限公司 Data transmission method and system, main communication equipment, and slave communication equipment
CN106559186A (en) * 2016-03-21 2017-04-05 天地融科技股份有限公司 Data transmission method and system, main communication apparatus and from communication apparatus
CN106685908B (en) * 2016-07-11 2019-06-28 南京兜秘网络科技有限公司 The support method of audio data integrality during voice broadcast
CN106130695A (en) * 2016-08-24 2016-11-16 桂林信通科技有限公司 A kind of data transmission method and system
CN106455133B (en) * 2016-10-31 2019-11-29 华为技术有限公司 A kind of link keeping method and user equipment
CN106789916A (en) * 2016-11-21 2017-05-31 广州视源电子科技股份有限公司 Network transfer method and device, network transfer method and device based on UDP
CN108173895A (en) * 2016-12-07 2018-06-15 北京视联动力国际信息技术有限公司 A kind of communication means and device
CN107276787A (en) * 2017-05-05 2017-10-20 广东网金控股股份有限公司 A kind of data communications method and system
CN107341125A (en) * 2017-07-15 2017-11-10 深圳市华琥技术有限公司 Data transmission method and system and usb controller
CN109286863B (en) * 2017-07-21 2021-08-17 深圳市中兴微电子技术有限公司 Method for establishing link, ONU and computer readable storage medium
CN107360177B (en) * 2017-07-31 2019-09-17 杭州迪普科技股份有限公司 A kind of message transmitting method and device based on UDP
CN107707640A (en) * 2017-09-25 2018-02-16 深圳市盛路物联通讯技术有限公司 A kind of Point-to-Point Data Transmission method and apparatus
CN107579920B (en) * 2017-09-25 2021-06-01 盛科网络(苏州)有限公司 Data stream transmission method and device, storage medium and processor
CN107967150B (en) * 2017-12-19 2021-10-15 郑州云海信息技术有限公司 Method, device, equipment and storage medium for determining thread execution sequence
CN109617945A (en) * 2018-11-02 2019-04-12 北京达佳互联信息技术有限公司 Sending method, sending device, electronic equipment and the readable medium of file transmission
CN109379386A (en) * 2018-12-13 2019-02-22 广州市百果园信息技术有限公司 A kind of method for message transmission, device, equipment and medium
CN110198203A (en) * 2019-06-14 2019-09-03 中国人民解放军陆军工程大学 A method of control message transmission rate
CN110430025B (en) * 2019-08-01 2021-12-14 青岛海信宽带多媒体技术有限公司 Data sending method and device and optical module
CN110830472B (en) * 2019-11-07 2021-09-24 西北工业大学 Flexible data transmission method of flexible data transmission protocol based on TCP/IP protocol
CN110928955B (en) * 2019-12-09 2022-11-15 北京锐安科技有限公司 Data interaction method and device, computer equipment and storage medium
CN111147564B (en) * 2019-12-20 2022-07-26 国久大数据有限公司 Data file transmission method, system and communication terminal
CN111049857A (en) * 2019-12-26 2020-04-21 山东方寸微电子科技有限公司 Network storage system and method based on UDP protocol
CN113590254A (en) * 2020-04-30 2021-11-02 深信服科技股份有限公司 Virtual machine communication method, device, system and medium
CN111654505B (en) * 2020-06-15 2022-06-21 深圳市景阳科技股份有限公司 UDP data packet reliable transmission method, system, computer equipment and storage medium
CN111818063A (en) * 2020-07-10 2020-10-23 陕西领航软件技术有限公司 Novel data transmission protocol for construction vehicle positioning equipment
CN112713969B (en) * 2020-12-30 2022-11-29 北京字跳网络技术有限公司 Data transmission method and device and system using same
CN113055081B (en) * 2021-04-06 2022-09-27 北京控制工程研究所 Cross-cycle data processing method with high reliability and low overhead
CN115733577A (en) * 2021-08-27 2023-03-03 北京希姆计算科技有限公司 Data transmission method, system, integrated circuit, multi-chip structure and electronic device
CN113992766A (en) * 2021-10-25 2022-01-28 浙江吉利控股集团有限公司 Data transmission system, method, equipment and storage medium based on UDP
CN114138700B (en) * 2021-12-03 2023-11-24 西安广和通无线软件有限公司 Flow control method, device, equipment and storage medium for serial port data transmission
CN114598754A (en) * 2022-01-14 2022-06-07 许继电气股份有限公司 Real-time data one-way transmission method and device
CN115378556A (en) * 2022-10-27 2022-11-22 北京超摩科技有限公司 Data retransmission method and equipment based on timeout

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1905531A (en) * 2006-08-11 2007-01-31 白杰 Method for processing data being transmitted and method and apparatus for transmitting data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1905531A (en) * 2006-08-11 2007-01-31 白杰 Method for processing data being transmitted and method and apparatus for transmitting data

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
基于DMA实现高速数据包收发;黄宗和等;《计算机应用研究》;20061231;219页第一段至220页最后一段 *
基于嵌入式系统的TCP/IP协议栈的实现;李立清等;《计算机工程》;20041031;84页第三段至最后一段 *
李立清等.基于嵌入式系统的TCP/IP协议栈的实现.《计算机工程》.2004,84页第三段至最后一段.
黄宗和等.基于DMA实现高速数据包收发.《计算机应用研究》.2006,219页第一段至220页最后一段.

Also Published As

Publication number Publication date
CN102137027A (en) 2011-07-27

Similar Documents

Publication Publication Date Title
CN102137027B (en) Reliable data transmission method and device thereof
KR100785293B1 (en) System and Method for TCP Congestion Control Using Multiple TCP ACKs
JP6522855B2 (en) Packet transmission method and user equipment
US8843654B2 (en) Data packet transfer over wide area network in fast and reliable manner
CN104202414B (en) Method for reliable transmission based on UDP
EP1568180B1 (en) A method for enhancing transmission quality of streaming media
US6621799B1 (en) Semi-reliable data transport
CN102217258B (en) Detection processing method, data sending terminal, data receiver and communication system
CN106559739A (en) It is suitable to the lightweight data transmission method of Bluetooth Low Energy wireless communication system
CN107204834A (en) A kind of control method of the express network transmitting based on UDT agreements
CN112436994B (en) Data transmission method and electronic equipment
CN104093170A (en) TCP-based data transmission method and TCP agent apparatus
CN103346963A (en) MPTCP data scheduling method based on forecast arrival time
CA2296423A1 (en) Communication method and system
CN112911638B (en) Reliable communication method for optimizing wireless network load congestion by using UDP (user Datagram protocol)
US8607114B2 (en) Communication device and communication method
CN102801508A (en) Control method for processing network packet loss
CN107801211A (en) A kind of non-sequential of message submits method and RLC entities, base station
JP2013175850A (en) Communication device and communication system
JP7067544B2 (en) Communication systems, communication devices, methods and programs
JP4229807B2 (en) Data transfer method, TCP proxy device, and network system using the same
CN109451524A (en) A kind of data processing method and device
CN108432287A (en) A kind of data transmission method and network side equipment
CN116074401B (en) Method for realizing transmission layer protocol on programmable exchanger
CN102325146A (en) Universal data exchange (UDX) protocol stack, and UDX-protocol-based data transmission system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20110727

Assignee: Xiamen Information Security Research Institute Co., Ltd.

Assignor: Xiamen Meiya Pico Information Co., Ltd.

Contract record no.: 2014350000060

Denomination of invention: Reliable data transmission method and device thereof

Granted publication date: 20130731

License type: Exclusive License

Record date: 20140610

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170406

Address after: View of the road Xiamen city Fujian province 361000 Software Park No. 14

Patentee after: Xiamen Information Security Research Institute Co., Ltd.

Address before: AIU Cupressaceae No. 12 building, 361008 Fujian province Xiamen software park two sunrise Road

Patentee before: Xiamen Meiya Pico Information Co., Ltd.