Two, background technology
In computer network, data owner will carry with TCP (transmission control protocol) or UDP (User Datagram Protoco (UDP)).
When using TCP, the end of collecting mail utilizes ACK (affirmation) mechanism, notifies transmitting end, and which data block it correctly receives from transmitting end, and transmitting end determines that with this sequence number of the data block that next will send maybe needs the sequence number of the data block that resends.When data were lost, TCP guaranteed the reliable transmission of data just by the mechanism of this detection packet loss re-transmission.Yet the packet loss retransmission mechanism of TCP can cause extra network delay, and in transfer files, the result of time delay accumulation needs the flower more time just can finish file transfer; Streaming media on demand or live in, the result of time delay accumulation is that clearly image pauses.
UDP is a kind of host-host protocol that does not guarantee reliability, usually, in transfer files, needs to increase mistake controlling mechanisms such as acknowledged sequence number, ensures that data are not lost; Streaming media on demand or live in, often abandon error control mechanism for guaranteeing that data can in time be transmitted, if there are data to be lost, then cause the image blank screen or mosaic occurs.
No matter be the reliable transmission of TCP, still on UDP, increase the error control that needs acknowledged sequence number, even the network bandwidth is enough rich, when network has certain packet loss, still will cause the uncertain propagation delay time of time span, the result causes the file transfer time elongated, streaming media on demand or when live, image pause, blank screen or mosaic occurs.
Three, summary of the invention
1, goal of the invention: the purpose of this invention is to provide a kind of error control method of transfer of data, in that network packet loss rate is higher but under the situation that bandwidth is enough, it can ensure effectively data fast, reliable transmission.
2, technical scheme: a kind of error control method of transfer of data is characterized in that: it may further comprise the steps:
(A) end of collecting mail sends request to transmitting end, and this request comprises the sign of the data set that the end of collecting mail is asked for to transmitting end and the speed that the end of collecting mail can receive data;
(B) transmitting end carries out holographic encoding to data set, and not to be higher than the speed that the end of collecting mail can receive data, end sends the coded data that is doubled in the needed amount of decoding at least to collecting mail then;
Carry out the holography decoding when (C) collection of letters termination receives the breath coded data,, send immediately and stop paying out request to transmitting end in case decoding finishes;
(D) transmitting end is received stopping paying out after the request of the end of collecting mail, and stops to send coded data to the end of collecting mail.
In said method, can also comprise following following steps:
(E) transmitting end is sent to the amount of coded data of the end of collecting mail, and after many one times of the required data volume of ratio decoder, if also do not receive the request of stopping paying out of the end of collecting mail, then stops to continue to send;
(F) collecting mail end can't decode because the amount of coded data that receives is not enough, if when still not receiving the coded data that comes from transmitting end after the wait official hour, the request that then sends once more is to transmitting end, and this request comprises the sign of the data set that the end of collecting mail is asked for to transmitting end and the speed that the end of collecting mail can receive data.
In above-mentioned steps (B), (C), described coding, coding/decoding method, No. 200510094180.5 related method of patent of invention can using the applicant to propose.
3, beneficial effect: the present invention compared with prior art, its remarkable advantage is: utilize error control method of the present invention, in that network packet loss rate is higher but under the situation that bandwidth is enough, it can ensure effectively data fast, reliable transmission, shorten the time of file transfer or reduce streaming media on demand and pause, blank screen or mosaic appear in image when live phenomenon.
Five, specific implementation method
In conjunction with the accompanying drawings, describe concrete implementation method in detail:
(A) end of collecting mail sends request to transmitting end, and this request comprises the sign of the data set that the end of collecting mail is asked for to transmitting end and the speed that the end of collecting mail can receive data.
(B) that data set is carried out holographic encoding is as follows for transmitting end:
The raw data set that the end of supposing to collect mail is asked for to transmitting end by data block X1, X2, X3 ..., Xm constitutes, small letter English alphabet m, n, k, s etc. are the symbol subscript, are natural numbers.
Generate random vector Ak=<Ak1, Ak2, Ak3 ..., Akm, wherein each Akn is a random number; Generation intermediate object program Pk=(Ak1*X1)+(Ak2*X2)+(Ak3*X3)+... + (Akm*Xm); Output holographic encoding Yk as a result is the combination of Ak and Pk, and for example, Ak is<1,2,3,4 〉, Pk is abcdefg after converting character string to, one-tenth coding result Yk then capable of being combined is character string 1_2_3_4_abcdefg.
Transmitting end carries out holographic encoding on one side, on one side not to be higher than the speed that the end of collecting mail can receive data, sends at least one times (for example 1-10 doubly) in the coded data of the needed amount of decoding to the end of collecting mail.Usually, the piece number of the required coded data of decoding is counted m a little more than the piece of the data of raw data set.
Be to accelerate the encoding and decoding speed, can allow each the value Akn among the random vector Ak be 0 or 1 at random, and coding or the add operation when decoding, all change XOR into.
It is as follows to carry out the holography decoding when (C) collection of letters termination receives the breath coded data:
By the method for holographic encoding as can be known, each holographic encoding data all contains the raw information amount of some, so, as long as collection of letters termination receives that the piece number of coded data is enough, just can decode complete initial data, its reason is to be critical chunks without any block encoding data, and the end of collecting mail can can't not decoded because lacking critical chunk.As long as the network bandwidth is enough, even if higher packet loss is arranged, the end of collecting mail still can be received enough coded datas, thereby can effectively decode.
With the s that receives (s must more than or equal to m) coded data Y1, Y2, Y3 ..., Ys splits, and obtains following matrix equality:
Separate above-mentioned system of linear equations, try to achieve initial data X1, X2, X3 ..., Xm, in case decoding finishes, send immediately and stop paying out request to transmitting end.
(D) transmitting end is received stopping paying out after the request of the end of collecting mail, and stops immediately sending coded data toward the end of collecting mail again.By accompanying drawing as can be known, transmitting end might send out than the required more coded data of data volume of end decoding of collecting mail, still, in case transmitting end is received the request of stopping paying out of the end of collecting mail, transmitting end can stop to send immediately, guarantees amount of coded data that the transmitting end pilosity send seldom, with the network bandwidth that avoids waste.
By under the situation of losing, transmitting end still ceaselessly sends coded data and wastes the network bandwidth toward the end of collecting mail in network in the request of stopping paying out that is sent for the end that prevents to collect mail, and transmitting end need make the following judgment processing:
(E) transmitting end mails to the amount of coded data of the end of collecting mail, and after many one times of the required data volume of ratio decoder, if also do not receive the request of stopping paying out of the end of collecting mail, then stops to continue to send.
Hold and can't decode for preventing that network from losing to collect mail under the data conditions in enormous quantities continuously, the end of collecting mail need make the following judgment processing:
(F) collecting mail end can't decode because the amount of coded data that receives is not enough, still do not receive the coded data that comes from transmitting end afterwards if wait for official hour (for example 1 microsecond to 9 second), the request that then sends once more is to transmitting end, and this request comprises the sign of the data set that the end of collecting mail is asked for to transmitting end and the speed that the end of collecting mail can receive data.No matter which time be coded data be is received that the end of collecting mail can be decoded with it.
From above-mentioned detailed realization method as can be known, though the error control method of this transfer of data, may cause transmitting end to send the data volume of slightly Duoing than actual needs, but under the situation that bandwidth is enough in that network packet loss rate is higher, it still can ensure the reliable transmission of data, simultaneously, because this error control method need not the sequence number affirmation mechanism, it can also ensure the quick transmission of data.For example, in computer network, above-mentioned request and data all adopt UDP message to offer transmission, then utilize this error control method, can be easily on UDP, increase quick, reliable Data Transmission Controlling mechanism, be particularly suitable for streaming media on demand and utilize the P2P technology to carry out application such as live streaming media.