CN106533639A - Data retransmission method and device - Google Patents
Data retransmission method and device Download PDFInfo
- Publication number
- CN106533639A CN106533639A CN201611106737.7A CN201611106737A CN106533639A CN 106533639 A CN106533639 A CN 106533639A CN 201611106737 A CN201611106737 A CN 201611106737A CN 106533639 A CN106533639 A CN 106533639A
- Authority
- CN
- China
- Prior art keywords
- real time
- buffer area
- time data
- bag
- data bag
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1867—Arrangements specially adapted for the transmitter end
- H04L1/1874—Buffer management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1867—Arrangements specially adapted for the transmitter end
- H04L1/188—Time-out mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention, which relates to the communication field, provides a data retransmission method and device. The method comprises: after a real-time data packet is sent to a server, the real-time data packet carrying a packet serial number to a first cache region; and when response information that is returned by the server and corresponds to the packet serial number of the real-time data packet is not received within a first time threshold, the real-time data packet corresponding to the packet serial number in the first cache region is retransmitted to the server by a retransmission thread. In the prior art, the data transmission success can not be guaranteed and the packet loss probability is high according to the TCP protocol retransmission mechanism. However, according to the data retransmission method provided by the invention, a retransmission work mechanism asynchronous with the TCP transmission protocol is employed; and thus the response information for first-time data packet sending and receiving is in an asynchronous working process, so that next data can be sent without the need to wait for receiving the response information of the last data packet. Therefore, a phenomenon of data sending waiting caused by data packet and response information delay due to network congestion can be avoided, so that the real-time and rapid properties of data are enhanced.
Description
Technical field
The present invention relates to communication technical field, in particular to a kind of data repeating method and device.
Background technology
TCP (Transmission Control Protocol, transmission control protocol) is a kind of connection-oriented, reliable
, transport layer communication protocol based on byte stream, defined by the RFC 793 of IETF, which is a kind of standard of network service, mesh
Before, Transmission Control Protocol is all based on by the data major part of network transmission and is transmitted.
When actually carrying out data transmission, it will usually have a large amount of real time datas to need wireless network to upload using Transmission Control Protocol
To server, the real time data of transmission is per second to have several to tens, in order to ensure data transmission credibility, is passing through
After Transmission Control Protocol is by these data is activations to server, if the ACK reports of server feedback are not being received more than the predetermined time
Text, then start TCP Retransmission timeout mechanism, i.e., retransmitted by Transmission Control Protocol and do not send successful data.
But, existing TCP Retransmission timeouts mechanism, its retransmit number of times and the time it is very short, once run into GPRS
(General Packet Radio Service, general packet radio service), 3G (3rd-Generation, third generation movement
Communication technology), (the 4th Generation mobile communication technology, forth generation movement are logical for 4G
Letter technology) etc. network congestion or poor signal situation, very maximum probability can lose the data of several seconds or more than ten seconds, and
The retransmission mechanism of TCP itself does not guarantee that data transfer success, has 20% by the retransmission mechanism of TCP itself through early stage test
Packet loss above.And when current network conditions are severe, cannot more ensure the accuracy of data.
The content of the invention
In view of this, the purpose of the embodiment of the present invention is to provide a kind of data repeating method and device, adopts and passes with TCP
The asynchronous re-transmission working mechanism of defeated agreement, increased the real-time and rapidity of data is activation.
In a first aspect, embodiments providing a kind of data repeating method, real time data bag is being sent to server
Afterwards, including:
The real time data bag is transferred to into the first buffer area, in the real time data bag, bag sequence number is carried;
The corresponding with the bag sequence number of the real time data bag of the server return is not received in very first time threshold value
During response message, in first buffer area with the bag sequence number corresponding reality is retransmitted to the server by retransmitting thread
When packet.
With reference in a first aspect, embodiments provide the first possible embodiment of first aspect, wherein,
Receive in the very first time threshold value that the server returns with first buffer area in the real time data bag bag
During the corresponding response message of sequence number, also include:
Real time data bag corresponding with the bag sequence number is deleted from first buffer area.
With reference in a first aspect, embodiments provide second possible embodiment of first aspect, wherein,
After the real time data bag is transferred to the first buffer area, also include:
Do not receive that the server returns in the second time threshold with first buffer area in described real-time number
During response message corresponding according to the bag sequence number of bag, the real time data bag is transferred to into the second buffer area, wherein, when described second
Between threshold value be more than the very first time threshold value.
With reference to second possible embodiment of first aspect, embodiments provide first aspect the third
Possible embodiment, wherein, after the real time data bag is transferred to the second buffer area, also include:
Determine storage time of the real time data bag in second buffer area, when the storage time is more than the 3rd
During time threshold, the real time data bag in second buffer area is transferred to into first buffer area;
And/or,
Determine the occupancy and current network condition of second buffer area, when it is determined that the occupancy is more than default
Occupancy threshold value and the network condition for it is normal when, the real time data bag in second buffer area is transferred to described
In first buffer area.
With reference to the third possible embodiment of first aspect, the 4th kind of first aspect is embodiments provided
Possible embodiment, wherein it is determined that the occupancy and current network condition of second buffer area, including:
The occupancy of the second buffer area described in monitor in real time, and it is determined that the occupancy exceedes the occupancy threshold value
When, monitor whether to receive the response message that the server sends;
When the response message that the server sends is received, it is determined that current network condition is normal.
With reference in a first aspect, embodiments provide the 5th kind of possible embodiment of first aspect, wherein,
After the real time data bag is transferred to the first buffer area, also include:
Using the number of retransmissions of the real time data bag in the first buffer area described in counter records;
When the number of retransmissions of the real time data bag is more than given threshold, the real time data bag is dumped to into second and is delayed
Deposit area.
With reference to first aspect, with reference to first aspect the first possible embodiment to first aspect the 5th kind of possibility
Embodiment in any one possible embodiment, embodiments provide the 6th kind of possible reality of first aspect
Mode is applied, wherein, after the real time data bag is transferred to the first buffer area, also include:
The real time data bag to storing in first buffer area adds a cover timestamp.
With reference to the 6th kind of possible embodiment of first aspect, the 7th kind of first aspect is embodiments provided
Possible embodiment, wherein, the server is not received in the very first time threshold value returning with the real time data
During the corresponding response message of the bag sequence number of bag, retransmitted in first buffer area to the server by the re-transmission thread
Real time data bag corresponding with the bag sequence number, including:
The timestamp of the real time data bag in first buffer area is read in timing;
Timestamp corresponding with the real time data bag in first buffer area is contrasted with current time, really
Fix time difference;
Judge that whether the time difference exceedes the very first time threshold value, it is determined that the time difference exceedes described the
During one time threshold, judge currently whether receive the corresponding with the bag sequence number of the real time data bag of the server return
Response message, when it is determined that currently not receiving the response message that the server is returned, by the re-transmission thread to
The server retransmits the real time data bag.
Second aspect, the embodiment of the present invention additionally provide a kind of data retransmission device, including:
First unloading module, for after the real time data bag is sent to server, by the real time data bag unloading
To the first buffer area, in the real time data bag, bag sequence number is carried;
Retransmission module, for not receiving in very first time threshold value that the server returns and the real time data bag
During the corresponding response message of bag sequence number, by retransmit thread to the server retransmit in first buffer area with the bag
The corresponding real time data bag of sequence number.
With reference to second aspect, the first possible embodiment of second aspect is embodiments provided, wherein, institute
Data retransmission device is stated, is also included:
Removing module is returning with first buffer area for the server is received in the very first time threshold value
In the real time data bag bag sequence number corresponding response message when, delete from first buffer area and the bag sequence number
Corresponding real time data bag.
A kind of data repeating method and device are embodiments provided, using to server transmission real time data bag
Afterwards, the real time data bag for carrying bag sequence number is transferred to into the first buffer area, and server is not received in very first time threshold value
During the response message corresponding with the bag sequence number of real time data bag for returning, retransmitted in the first caching to server by retransmitting thread
The asynchronous retransmission mechanism of the corresponding real time data bag of Qu Zhongyu bag sequence numbers, with the retransmission mechanism of Transmission Control Protocol of the prior art without
Method ensures data transfer success, and packet loss is higher to be compared, and which adopts the re-transmission working mechanism asynchronous each other with TCP transmission agreement,
The response message for sending packet and receiving data bag first is made to be in asynchronous working process, i.e., without when receiving data
The response message of bag could continue to send next data, it is to avoid as network congestion causes packet and response message to postpone
The caused situation for sending data latency, increased real-time property and rapidity afterwards.
Further, a kind of data repeating method provided in an embodiment of the present invention and device, are additionally provided with for storage the
The real time data of retransmission time out in one buffer area, and the occupancy and corresponding network condition of the second buffer area of monitor in real time,
And when it is determined that the occupancy of the second buffer area exceedes given threshold and determines that corresponding transmission network is normal, will count in real time again
According to being transferred to the first buffer area to start retransmission mechanism;Said method is applied to the poor situation of network communications quality, can in case
Only as the data packet number for needing to retransmit is excessive, the situation for causing buffer overflow or producing data jamming occurs, and greatly
Reduce power consumption.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate
Appended accompanying drawing, is described in detail below.
Description of the drawings
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, below by to be used attached needed for embodiment
Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, thus be not construed as it is right
The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can be with according to this
A little accompanying drawings obtain other related accompanying drawings.
The flow chart that Fig. 1 shows a kind of data repeating method that the embodiment of the present invention is provided;
The flow chart that Fig. 2 shows another kind of data repeating method provided by the embodiment of the present invention;
The flow chart that Fig. 3 shows another kind of data repeating method provided by the embodiment of the present invention;
Fig. 4 shows a kind of structural representation of data retransmission device that the embodiment of the present invention is provided;
Fig. 5 shows a kind of overall structure diagram of data retransmission device that the embodiment of the present invention is provided;
Fig. 6 shows the structural representation of determining module in the data retransmission device provided by the embodiment of the present invention;
Fig. 7 shows the structural representation of retransmission module in the data retransmission device provided by the embodiment of the present invention.
Major Symbol explanation:
11st, the first unloading module;12nd, retransmission module;13rd, removing module;14th, the second unloading module;15th, determining module;
16th, the 3rd unloading module;17th, logging modle;18th, the 4th unloading module;19th, time stamp setting module;151st, the second monitoring is single
Unit;152nd, determining unit;121st, reading unit;122nd, comparison unit;123rd, judging unit;124th, retransmission unit.
Specific embodiment
To make purpose, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
Middle accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only
It is a part of embodiment of the invention, rather than the embodiment of whole.The present invention generally described and illustrated in accompanying drawing herein is real
The component for applying example can be arranged and be designed with a variety of configurations.Therefore, below to the present invention's that provides in the accompanying drawings
The detailed description of embodiment is not intended to limit the scope of claimed invention, but is merely representative of the selected reality of the present invention
Apply example.Based on embodiments of the invention, the institute obtained on the premise of creative work is not made by those skilled in the art
There is other embodiment, belong to the scope of protection of the invention.
Existing TCP (Transmission Control Protocol, transmission control protocol) transmission data, re-transmission
Number of times and time are very short, once running into the network congestions such as GPRS, 3G, 4G or poor signal, have very maximum probability lose several seconds
Or the data of more than ten seconds, and the retransmission mechanism of TCP itself does not guarantee that data transfer success, relies on through early stage test
The retransmission mechanism of TCP itself, the packet loss for having general more than 20%.
The number of times and time retransmitted in view of the retransmission mechanism of TCP in prior art is very short, and cannot ensure data transfer
Success, the larger problem of drop probabilities embodiments provide a kind of data repeating method and device, and which is existing heavy
Add one layer of retransmission mechanism in biography mechanism again, for guaranteeing that each bag data can be uploaded onto the server.Enter below by embodiment
Row description.
Flow chart shown in Figure 1, embodiments provides a kind of data repeating method, including:
S101, to server send real time data bag after, the real time data bag is transferred to into the first buffer area, it is described
Bag sequence number is carried in real time data bag.
Method provided in an embodiment of the present invention can be performed by transmitting terminal, and specifically, transmitting terminal is receiving real time data bag
Afterwards, the transmission function in the first thread comprising Transmission Control Protocol is called, first time transmission is carried out to real time data bag, and will be passed through
The real time data bag for sending for the first time dumps to the first buffer area;Wherein, bag sequence number is carried in real time data bag.
When real time data bag is more, this is sent successively according to the sequencing of receiving real-time data bag by first thread
A little real time data bags, while the corresponding real time data bag through sending for the first time is dumped to the first buffer area.
Wherein, real time data bag can be transferred to the first buffer area by first thread by transmitting terminal, it is also possible to by
Real time data bag is transferred to the first buffer area by two threads (retransmitting thread).Wherein, the second thread (retransmitting thread) and the
One thread is two asynchronous transmission mechanism.
S102, the bag sequence number pair with the real time data bag that the server is returned is not received in very first time threshold value
It is during the response message answered, corresponding with the bag sequence number in first buffer area to server re-transmission by retransmitting thread
Real time data bag.
In the embodiment of the present invention by the second thread monitor in real time whether have received server return with the first buffer area
The corresponding response message of bag sequence number of the real time data bag of middle storage, if receiving response message in very first time threshold value, sentences
The fixed real time data bag transmission success sent by first thread, will be stored in corresponding with the response message in the first buffer area
Real time data bag is deleted;If response message is not received in very first time threshold value, judge the real-time number sent by first thread
According to bag bust thiss, now, the corresponding real time data bag of bag sequence number is retransmitted to server by the second thread.Wherein, it is above-mentioned to answer
The information of answering can be the ACK (Acknowledgement confirms character) of server feedback.Above-mentioned very first time threshold value can be with root
According to needing to be configured, 2 milliseconds are such as arranged to 20 seconds, be preferably arranged to 20 milliseconds, 40 milliseconds.Meanwhile, the very first time threshold value
Can be a threshold value, or a threshold range.
As a kind of optional embodiment, if not receiving response message more than very first time threshold value, judge by first
The real time data bag bust thiss that thread sends.Now the second thread is circulated with the predetermined time cycle to being stored in first
Real time data bag in buffer area is retransmitted.Certainly, circulated to being stored in the first buffer area with the predetermined time cycle
The action retransmitted by real time data bag, can be not specifically limited herein with being performed by another thread.
In the embodiment of the present invention, user can arrange the second thread with TCP Retransmission timeouts mechanism while enabling, specifically,
User can pre-set the priority of the second thread and TCP Retransmission timeout mechanism, and the priority for such as arranging the second thread is higher than
TCP Retransmission timeout mechanism, now, after real time data bag is sent to server by first thread, starts the second thread first
Work.In addition, user can also be arranged only enables the second thread, and close TCP Retransmission timeout mechanism.
Embodiments provide a kind of data repeating method, with the retransmission mechanism of Transmission Control Protocol of the prior art without
Method ensures data transfer success, and packet loss is higher to be compared, and which adopts the re-transmission working mechanism asynchronous each other with TCP transmission agreement,
The response message for sending packet and receiving data bag first is made to be in asynchronous working process, i.e., without when receiving data
The response message of bag could continue to send next data, it is to avoid as network congestion causes packet and response message to postpone
The caused situation for sending data latency, increased real-time property and rapidity afterwards.
Data repeating method in the embodiment of the present invention, also includes:If receiving the clothes in the very first time threshold value
The response message corresponding with the bag sequence number of the real time data bag in first buffer area that business device is returned, then from described the
Real time data bag corresponding with the bag sequence number is deleted in one buffer area.
Specifically, in the first buffer area of correspondence that server is returned, the response message of the bag sequence number of real time data bag can be
Carry the response message of ACK;After transmitting terminal receives the ACK of the bag sequence number of the real time data bag of server transmission, it is determined that
The corresponding real time data bag transmission success of the bag sequence number, now, transmitting terminal can pass through first thread will from the first buffer area
Packet corresponding with ACK is deleted, it is also possible to deleted packet corresponding with ACK from the first buffer area by the second thread
Remove.Method by successful packet is sent in the first buffer area of cleaning in real time, can quickly search and confirm overtime transmission
Packet, start retransmission mechanism in order to follow-up, it is ensured that packet sends successfully.
Data repeating method in the embodiment of the present invention, after the real time data bag is transferred to the first buffer area, also
Including:The real time data bag to storing in first buffer area adds a cover timestamp.Wherein, the timestamp added a cover is first
Thread sends the temporal information of real time data for the first time.
With reference to Fig. 2, in above-mentioned steps 102, do not receive that the server returns in the very first time threshold value with institute
When stating the corresponding response message of bag sequence number of real time data bag, retransmitted described the to the server by the re-transmission thread
Real time data bag corresponding with the bag sequence number in one buffer area, implementing step includes:
The timestamp of S1021, the real time data bag regularly read in first buffer area.
In the embodiment of the present invention, each real time data stored during the first buffer area is read in the timing of the second thread can be passed through
The timestamp of bag;The work of above-mentioned read access time stamp can also be performed by another thread.
S1022, timestamp corresponding with the real time data bag in first buffer area and current time are carried out
Contrast, determines time difference.
Second thread (or another thread) by the timestamp of each real time data bag read in previous step respectively with
Current time is contrasted, and obtains the time difference of each real time data bag matching.
S1023, judge that whether the time difference exceedes the very first time threshold value;
S1024, it is determined that the time difference exceed the very first time threshold value when, continue judge currently whether receive
The response message corresponding with the bag sequence number of the real time data bag that the server is returned;
S1025, when it is determined that currently not receiving the response message that the server is returned, by the re-transmission line
Journey retransmits the real time data bag to the server.
Specifically, the bag sequence number of the real time data bag that the second thread (or another thread) monitoring server is returned is corresponding
Whether the method for time-out includes response message:First determine whether whether the time difference of each real time data bag exceedes very first time threshold
Value;Judge that time difference exceedes very first time threshold value and currently do not receive server return with the first buffer area in reality
When packet bag sequence number corresponding response message when, retransmit corresponding real time data bag to server.
Above-mentioned very first time threshold value can be configured as needed, such as arrange 2 milliseconds to 20 seconds, be preferably arranged to 20 millis
Second, 40 milliseconds.Meanwhile, the very first time threshold value can be a threshold value, or a threshold range.
Further, the real time data bag is being transferred to first by data repeating method provided in an embodiment of the present invention
After buffer area, also include:
Do not receive that the server returns in the second time threshold with first buffer area in described real-time number
During response message corresponding according to the bag sequence number of bag, the real time data bag is transferred to into the second buffer area, wherein, when described second
Between threshold value be more than the very first time threshold value.
Specifically, the timestamp of real time data bag in the first buffer area and the time difference of current time are more than second
After time threshold, these real time data bags are dumped to into the second buffer area, it is therefore an objective to will repeatedly retransmit unsuccessful real time data
Bag is removed from the second buffer area, is prevented the phenomenons such as obstruction and is occurred.
Under normal circumstances, when real time data bag is if there is repeatedly retransmitting all unsuccessful, illustrate that now network connection occurs
It is abnormal, therefore, these datagrams are transferred to into the second buffer area, after waiting for a period of time or wait network connection normal, again
Send.
Above-mentioned the second time threshold for pre-setting is generally higher than very first time threshold value, for example, could be arranged to the very first time
The integral multiple of threshold value, such as 3 to 20 times, depending on which can be according to data volume, the embodiment of the present invention is not especially limited to which.
With reference to Fig. 3, data repeating method provided in an embodiment of the present invention delays the real time data bag is transferred to first
After depositing area, also include:
S201, using the number of retransmissions of the real time data bag in the first buffer area described in counter records.
Specifically, transmitting terminal also starts enumerator while the asynchronous retransmission mechanism of the second thread is started, by counting
Device records the number of retransmissions of each real time data bag of the storage in the first buffer area.
S202, when the real time data bag number of retransmissions be more than given threshold when, the real time data bag is dumped to
Second buffer area.
Specifically, in the first buffer area by the second thread by counter records each real time data bag number of retransmissions
Contrasted with given threshold, if number of retransmissions has exceeded given threshold, judged these real time data bag retransmission time outs, this
When, corresponding these real time data bags are dumped in the second buffer area.
Further, the real time data bag is being transferred to second by data repeating method provided in an embodiment of the present invention
After buffer area, the real time data (i.e. the real time data of retransmission time out) of the second buffer area is entered again by following two methods
Row is retransmitted:
First, determine storage time of the real time data bag in second buffer area, when the storage time surpasses
When crossing three time thresholds, the real time data bag in second buffer area is transferred to into first buffer area, so as to
Again the real time data is retransmitted by retransmitting thread (i.e. the second thread).
Above-mentioned the 3rd time threshold for pre-setting is preferably greater than or equal to above-mentioned second time threshold, for example, can arrange 5
Second, 10 seconds, 15 seconds etc., depending on which can be according to data volume, the embodiment of the present invention is not especially limited to which.
Second, determine the occupancy and current network condition of second buffer area, when it is determined that the occupancy exceedes
Default occupancy threshold value and the network condition for it is normal when, by the real time data bag unloading in second buffer area
Into first buffer area.
Wherein, the mode of the occupancy and current network condition of above-mentioned determination second buffer area includes, transmitting terminal
First by the occupancy situation of second the second buffer area of thread monitor in real time, it is determined that the occupancy of second buffer area surpasses
When crossing occupancy threshold value, further monitor whether to receive the response message of server transmission (as received server transmission
Arbitrarily response message, illustrates that now network connection is recovered), when the response message that the server sends is received, really
Network condition before settled is normal, at this point it is possible to real time data bag is transferred in the first buffer area, to start re-transmission line
Cheng Jinhang retransmission operations.
Wherein, above two is retransmitted again to the real time data (i.e. the real time data of retransmission time out) of the second buffer area
Method can use simultaneously, it is also possible to individually use.
Further, a kind of data repeating method provided in an embodiment of the present invention, is additionally provided with and caches for storage first
The real time data of retransmission time out in area, and the occupancy and corresponding network condition of the second buffer area of monitor in real time, and true
When the occupancy of fixed second buffer area exceedes given threshold and determines that corresponding transmission network is normal, again by real time data unloading
To the first buffer area starting retransmission mechanism;Said method is applied to the poor situation of network communications quality, can prevent due to
Need the data packet number for retransmitting excessive, the situation for causing buffer overflow or producing data jamming occurs, and greatly reduces
Power consumption.
With reference to Fig. 4, the embodiment of the present invention additionally provides a kind of data retransmission device, and the data retransmission device is used to perform
Above-mentioned data repeating method, described device include:
First unloading module 11, for, after real time data bag is sent to server, real time data bag being transferred to first
Buffer area, carries bag sequence number in real time data bag;
Retransmission module 12, for the bag sequence number with real time data bag of server return is not received in very first time threshold value
During corresponding response message, in first buffer area with bag sequence number corresponding real time data is retransmitted to server by retransmitting thread
Bag.
Further, with reference to Fig. 5, data retransmission device provided in an embodiment of the present invention also includes:
Removing module 13, for receive in the very first time threshold value server return with the first buffer area in real-time number
During response message corresponding according to the bag sequence number of bag, real time data bag corresponding with bag sequence number is deleted from the first buffer area.
Further, with reference to Fig. 5, data retransmission device provided in an embodiment of the present invention also includes:
Second unloading module 14, for do not receive in the second time threshold server return with the first buffer area in
During the corresponding response message of the bag sequence number of real time data bag, real time data bag is transferred to into the second buffer area, wherein, the second time
Threshold value is more than very first time threshold value.
Further, with reference to Fig. 5, data retransmission device provided in an embodiment of the present invention also includes:
Determining module 15, for determining storage time of the real time data bag in the second buffer area;
3rd unloading module 16, during between when stored more than three time thresholds, will be real-time in the second buffer area
Packet is transferred to the first buffer area;
And/or,
The determining module 15 is additionally operable to, and determines the occupancy and current network condition of the second buffer area;
The 3rd unloading module 16 is additionally operable to, when it is determined that occupancy exceedes default occupancy threshold value and network condition is
When normal, the real time data bag in the second buffer area is transferred in the first buffer area.
Further, with reference to Fig. 6, data retransmission device provided in an embodiment of the present invention, determining module 15 include:
Second monitoring unit 151, for the occupancy of the second buffer area of monitor in real time, and it is determined that occupancy exceedes occupancy
During amount threshold value, monitor whether to receive the response message of server transmission;
Determining unit 152, for when the response message of server transmission is received, it is determined that current network condition is for just
Often.
Further, with reference to Fig. 5, data retransmission device provided in an embodiment of the present invention also includes:
Logging modle 17, for the number of retransmissions using the real time data bag in the first buffer area of counter records;
4th unloading module 18, for when the number of retransmissions of real time data bag is more than given threshold, by real time data bag
Dump to the second buffer area.
Further, with reference to Fig. 5, data retransmission device provided in an embodiment of the present invention also includes:
Time stamp setting module 19, adds a cover timestamp for the real time data bag to storing in the first buffer area.
Further, with reference to Fig. 7, data retransmission device provided in an embodiment of the present invention, retransmission module 12, including:
Reading unit 121, for regularly reading the timestamp of the real time data bag in the first buffer area;
Comparison unit 122, for timestamp corresponding with the real time data bag in the first buffer area is entered with current time
Row contrast, determines time difference;
Judging unit 123, for judging whether the time difference that comparison unit 122 determines exceedes very first time threshold value,
When determining that above-mentioned time difference exceedes very first time threshold value, judge currently whether to receive server return with real time data bag
The corresponding response message of bag sequence number;
Retransmission unit 124, for, when it is determined that currently not receiving the response message that the server is returned, passing through
The re-transmission thread retransmits the real time data bag to the server.
Embodiments provide a kind of data retransmission device, with the retransmission mechanism of Transmission Control Protocol of the prior art without
Method ensures data transfer success, and packet loss is higher to be compared, and which adopts the re-transmission working mechanism asynchronous each other with TCP transmission agreement,
The response message for sending packet and receiving data bag first is made to be in asynchronous working process, i.e., without when receiving data
The response message of bag could continue to send next data, it is to avoid as network congestion causes packet and response message to postpone
The caused situation for sending data latency, increased real-time property and rapidity afterwards.
Further, a kind of data retransmission device provided in an embodiment of the present invention, is additionally provided with and caches for storage first
The real time data of retransmission time out in area, and the occupancy and corresponding network condition of the second buffer area of monitor in real time, and true
When the occupancy of fixed second buffer area exceedes given threshold and determines that corresponding transmission network is normal, again by real time data unloading
To the first buffer area starting retransmission mechanism;Said method is applied to the poor situation of network communications quality, can prevent due to
Need the data packet number for retransmitting excessive, the situation for causing buffer overflow or producing data jamming occurs, and greatly reduces
Power consumption.
The device that data that the embodiment of the present invention is provided are retransmitted can be that the specific hardware on equipment or be installed on sets
Standby upper software or firmware etc..The device provided by the embodiment of the present invention, which realizes the technique effect of principle and generation and aforementioned
Embodiment of the method is identical, is brief description, and device embodiment part does not refer to part, refers to corresponding in preceding method embodiment
Content.Those skilled in the art can be understood that, for convenience and simplicity of description, system described above, dress
The specific work process with unit is put, the corresponding process in said method embodiment is may be referred to, be will not be described here.
In embodiment provided by the present invention, it should be understood that disclosed apparatus and method, other sides can be passed through
Formula is realized.Device embodiment described above is only schematic, and for example, the division of the unit, only one kind are patrolled
Volume function is divided, and can have other dividing mode when actually realizing, and for example, multiple units or component can with reference to or can
To be integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or discussed each other
Coupling or direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, device or unit
Connect, can be electrical, mechanical or other forms.
The unit as separating component explanation can be or may not be it is physically separate, it is aobvious as unit
The part for showing can be or may not be physical location, you can local to be located at one, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in the embodiment that the present invention is provided can be integrated in a processing unit, also may be used
Being that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.
If the function is realized using in the form of SFU software functional unit and as independent production marketing or when using, can be with
It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words
The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, is used including some instructions so that a computer equipment (can be individual
People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the invention.
And aforesaid storage medium includes:USB flash disk, portable hard drive, read only memory (ROM, Read-OnlyMemory), random access memory are deposited
Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
It should be noted that:Similar label and letter represent similar terms in following accompanying drawing, therefore, once a certain Xiang Yi
It is defined in individual accompanying drawing, then in subsequent accompanying drawing which further need not be defined and is explained, additionally, term " the
One ", " second ", " the 3rd " etc. are only used for distinguishing description, and it is not intended that indicating or implying relative importance.
Finally it should be noted that:Embodiment described above, specific embodiment only of the invention, to illustrate the present invention
Technical scheme, rather than a limitation, protection scope of the present invention is not limited thereto, although with reference to the foregoing embodiments to this
It is bright to be described in detail, it will be understood by those within the art that:Any those familiar with the art
The invention discloses technical scope in, which still can be modified to the technical scheme described in previous embodiment or can be light
Change is readily conceivable that, or equivalent is carried out to which part technical characteristic;And these modifications, change or replacement, do not make
The essence of appropriate technical solution departs from the spirit and scope of embodiment of the present invention technical scheme.The protection in the present invention should all be covered
Within the scope of.Therefore, protection scope of the present invention described should be defined by scope of the claims.
Claims (10)
1. a kind of data repeating method, it is characterised in that after real time data bag is sent to server, including:
The real time data bag is transferred to into the first buffer area, in the real time data bag, bag sequence number is carried;
The response corresponding with the bag sequence number of the real time data bag that the server is returned is not received in very first time threshold value
During information, in first buffer area with the bag sequence number corresponding real-time number is retransmitted to the server by retransmitting thread
According to bag.
2. data repeating method according to claim 1, it is characterised in that receive in the very first time threshold value described
What server was returned, is also wrapped during corresponding response message with the bag sequence number of the real time data bag in first buffer area
Include:
Real time data bag corresponding with the bag sequence number is deleted from first buffer area.
3. data repeating method according to claim 1, it is characterised in that the real time data bag is being transferred to into first
After buffer area, also include:
Do not receive that the server returns in the second time threshold with first buffer area in the real time data bag
Bag sequence number corresponding response message when, the real time data bag is transferred to into the second buffer area, wherein, the second time threshold
Value is more than the very first time threshold value.
4. data repeating method according to claim 3, it is characterised in that the real time data bag is being transferred to into second
After buffer area, also include:
Determine storage time of the real time data bag in second buffer area, when the storage time is more than the 3rd time
During threshold value, the real time data bag in second buffer area is transferred to into first buffer area;
And/or,
Determine the occupancy and current network condition of second buffer area, when it is determined that the occupancy exceedes default occupancy
Amount threshold value and the network condition for it is normal when, the real time data bag in second buffer area is transferred to into described first
In buffer area.
5. data repeating method according to claim 4, it is characterised in that determine second buffer area occupancy and
Current network condition, including:
The occupancy of the second buffer area described in monitor in real time, and when it is determined that the occupancy exceedes the occupancy threshold value, prison
Whether control receives the response message that the server sends;
When the response message that the server sends is received, it is determined that current network condition is normal.
6. data repeating method according to claim 1, it is characterised in that the real time data bag is being transferred to into first
After buffer area, also include:
Using the number of retransmissions of the real time data bag in the first buffer area described in counter records;
When the number of retransmissions of the real time data bag is more than given threshold, the real time data bag is dumped to into the second caching
Area.
7. data repeating method as claimed in any of claims 1 to 6, it is characterised in that by the real-time number
It is transferred to after the first buffer area according to bag, also includes:
The real time data bag to storing in first buffer area adds a cover timestamp.
8. data repeating method according to claim 7, it is characterised in that do not receive institute in the very first time threshold value
State server return with the bag sequence number of the real time data bag during corresponding response message, by the re-transmission thread to described
Server retransmits the real time data bag corresponding with the bag sequence number in first buffer area, including:
The timestamp of the real time data bag in first buffer area is read in timing;
Timestamp corresponding with the real time data bag in first buffer area is contrasted with current time, when determining
Between difference;
Judge whether the time difference exceedes the very first time threshold value, when it is determined that the time difference exceedes described first
Between threshold value when, judge currently whether receives the response corresponding with the bag sequence number of the real time data bag that the server is returned
Information, when it is determined that currently not receiving the response message that the server is returned, by the re-transmission thread to described
Server retransmits the real time data bag.
9. a kind of data retransmission device, it is characterised in that include:
The real time data bag for after the real time data bag is sent to server, is transferred to the by the first unloading module
One buffer area, carries bag sequence number in the real time data bag;
Retransmission module, for the Bao Xu with the real time data bag that the server is returned is not received in very first time threshold value
During number corresponding response message, by retransmit thread to the server retransmit in first buffer area with the bag sequence number
Corresponding real time data bag.
10. data retransmission device according to claim 9, it is characterised in that also include:
Removing module, for receive that the server returns in the very first time threshold value with first buffer area in
During the corresponding response message of the bag sequence number of the real time data bag, delete corresponding with the bag sequence number from first buffer area
Real time data bag.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611106737.7A CN106533639B (en) | 2016-12-06 | 2016-12-06 | A kind of data repeating method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611106737.7A CN106533639B (en) | 2016-12-06 | 2016-12-06 | A kind of data repeating method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106533639A true CN106533639A (en) | 2017-03-22 |
CN106533639B CN106533639B (en) | 2019-09-17 |
Family
ID=58341357
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611106737.7A Active CN106533639B (en) | 2016-12-06 | 2016-12-06 | A kind of data repeating method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106533639B (en) |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108038679A (en) * | 2017-12-05 | 2018-05-15 | 苏州比可网络科技有限公司 | Send the method and polymerization payment platform of payment message |
CN108572874A (en) * | 2018-04-26 | 2018-09-25 | 掌阅科技股份有限公司 | Data re-transmitting method, electronic equipment based on ordered set and storage medium |
CN108964844A (en) * | 2018-06-29 | 2018-12-07 | 沈阳东软医疗系统有限公司 | Data transmission method, device, electronic equipment and CT rack |
CN109120383A (en) * | 2017-06-26 | 2019-01-01 | 深圳市道通智能航空技术有限公司 | Unmanned plane and its earth station, data transmission method |
CN109743242A (en) * | 2018-12-28 | 2019-05-10 | 联创汽车电子有限公司 | CAN bus message control system and its control method |
CN109743143A (en) * | 2018-11-16 | 2019-05-10 | 深圳证券交易所 | Repeating method, device and the computer readable storage medium of data |
CN110086772A (en) * | 2019-03-19 | 2019-08-02 | 视联动力信息技术股份有限公司 | A kind of acquisition methods and system of monitor video |
CN110213024A (en) * | 2018-04-26 | 2019-09-06 | 腾讯科技(深圳)有限公司 | Data package retransmission method, device and equipment |
CN110311847A (en) * | 2019-06-26 | 2019-10-08 | 北京和利时系统工程有限公司 | A kind of bulk data transmission method and device |
CN110677221A (en) * | 2018-07-02 | 2020-01-10 | 华为技术有限公司 | Retransmission control method, communication interface and electronic equipment |
CN110858930A (en) * | 2018-08-23 | 2020-03-03 | 慧与发展有限责任合伙企业 | Data frame transmission |
CN110971350A (en) * | 2018-09-28 | 2020-04-07 | 华为技术有限公司 | Data transmission method, equipment and system |
CN111698176A (en) * | 2020-06-09 | 2020-09-22 | 北京大米科技有限公司 | Data transmission method and device, electronic equipment and computer readable storage medium |
CN112019305A (en) * | 2019-05-28 | 2020-12-01 | 阿里巴巴集团控股有限公司 | Data transmission method, device, equipment and storage medium |
CN112134657A (en) * | 2020-09-12 | 2020-12-25 | 安阳师范学院 | Two-way asynchronous message transmission method based on perception and retransmission |
CN112910983A (en) * | 2021-01-27 | 2021-06-04 | 北京百度网讯科技有限公司 | Message pushing method, device, equipment and medium |
CN113014547A (en) * | 2021-01-29 | 2021-06-22 | 深圳市风云实业有限公司 | Sequencing mapping-based direct data transmission system and method |
CN113286000A (en) * | 2021-05-21 | 2021-08-20 | 国网河北省电力有限公司 | Data receiving and transmitting method and device applied to power unidirectional transmission system |
CN113501396A (en) * | 2021-07-14 | 2021-10-15 | 上海三菱电梯有限公司 | Elevator communication system |
CN114375019A (en) * | 2022-01-18 | 2022-04-19 | 北京智联安科技有限公司 | NB-IoT mobile state data retransmission method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101645883A (en) * | 2008-08-08 | 2010-02-10 | 比亚迪股份有限公司 | Data transmitting method, a data sending method and a data receiving method |
US7834904B2 (en) * | 2003-10-22 | 2010-11-16 | Sam Systems, Inc. | Video surveillance system |
CN104869461A (en) * | 2015-05-22 | 2015-08-26 | 南京创维信息技术研究院有限公司 | Video data processing system and method |
CN106059718A (en) * | 2016-05-05 | 2016-10-26 | 浙江宇视科技有限公司 | Data retransmission method and device |
-
2016
- 2016-12-06 CN CN201611106737.7A patent/CN106533639B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7834904B2 (en) * | 2003-10-22 | 2010-11-16 | Sam Systems, Inc. | Video surveillance system |
CN101645883A (en) * | 2008-08-08 | 2010-02-10 | 比亚迪股份有限公司 | Data transmitting method, a data sending method and a data receiving method |
CN104869461A (en) * | 2015-05-22 | 2015-08-26 | 南京创维信息技术研究院有限公司 | Video data processing system and method |
CN106059718A (en) * | 2016-05-05 | 2016-10-26 | 浙江宇视科技有限公司 | Data retransmission method and device |
Cited By (30)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109120383A (en) * | 2017-06-26 | 2019-01-01 | 深圳市道通智能航空技术有限公司 | Unmanned plane and its earth station, data transmission method |
CN108038679A (en) * | 2017-12-05 | 2018-05-15 | 苏州比可网络科技有限公司 | Send the method and polymerization payment platform of payment message |
CN108572874A (en) * | 2018-04-26 | 2018-09-25 | 掌阅科技股份有限公司 | Data re-transmitting method, electronic equipment based on ordered set and storage medium |
CN110213024A (en) * | 2018-04-26 | 2019-09-06 | 腾讯科技(深圳)有限公司 | Data package retransmission method, device and equipment |
CN110213024B (en) * | 2018-04-26 | 2021-12-31 | 腾讯科技(深圳)有限公司 | Data packet retransmission method, device and equipment |
CN108964844A (en) * | 2018-06-29 | 2018-12-07 | 沈阳东软医疗系统有限公司 | Data transmission method, device, electronic equipment and CT rack |
CN108964844B (en) * | 2018-06-29 | 2021-08-31 | 东软医疗系统股份有限公司 | Data transmission method and device, electronic equipment and CT (computed tomography) rack |
CN110677221A (en) * | 2018-07-02 | 2020-01-10 | 华为技术有限公司 | Retransmission control method, communication interface and electronic equipment |
US11671210B2 (en) | 2018-07-02 | 2023-06-06 | Huawei Technologies Co., Ltd. | Retransmission control method, communications interface, and electronic device |
CN110858930B (en) * | 2018-08-23 | 2022-03-18 | 慧与发展有限责任合伙企业 | Data frame transmission |
CN110858930A (en) * | 2018-08-23 | 2020-03-03 | 慧与发展有限责任合伙企业 | Data frame transmission |
CN110971350A (en) * | 2018-09-28 | 2020-04-07 | 华为技术有限公司 | Data transmission method, equipment and system |
CN110971350B (en) * | 2018-09-28 | 2021-10-26 | 华为技术有限公司 | Data transmission method, equipment and system |
CN109743143B (en) * | 2018-11-16 | 2021-07-30 | 深圳证券交易所 | Data retransmission method, device and computer readable storage medium |
CN109743143A (en) * | 2018-11-16 | 2019-05-10 | 深圳证券交易所 | Repeating method, device and the computer readable storage medium of data |
CN109743242A (en) * | 2018-12-28 | 2019-05-10 | 联创汽车电子有限公司 | CAN bus message control system and its control method |
CN109743242B (en) * | 2018-12-28 | 2021-06-08 | 联创汽车电子有限公司 | CAN bus message control system and control method thereof |
CN110086772B (en) * | 2019-03-19 | 2021-10-08 | 视联动力信息技术股份有限公司 | Method and system for acquiring monitoring video |
CN110086772A (en) * | 2019-03-19 | 2019-08-02 | 视联动力信息技术股份有限公司 | A kind of acquisition methods and system of monitor video |
CN112019305A (en) * | 2019-05-28 | 2020-12-01 | 阿里巴巴集团控股有限公司 | Data transmission method, device, equipment and storage medium |
CN112019305B (en) * | 2019-05-28 | 2023-04-18 | 阿里巴巴集团控股有限公司 | Data transmission method, device, equipment and storage medium |
CN110311847A (en) * | 2019-06-26 | 2019-10-08 | 北京和利时系统工程有限公司 | A kind of bulk data transmission method and device |
CN110311847B (en) * | 2019-06-26 | 2022-08-05 | 北京和利时系统集成有限公司 | Batch data transmission method and device |
CN111698176A (en) * | 2020-06-09 | 2020-09-22 | 北京大米科技有限公司 | Data transmission method and device, electronic equipment and computer readable storage medium |
CN112134657A (en) * | 2020-09-12 | 2020-12-25 | 安阳师范学院 | Two-way asynchronous message transmission method based on perception and retransmission |
CN112910983A (en) * | 2021-01-27 | 2021-06-04 | 北京百度网讯科技有限公司 | Message pushing method, device, equipment and medium |
CN113014547A (en) * | 2021-01-29 | 2021-06-22 | 深圳市风云实业有限公司 | Sequencing mapping-based direct data transmission system and method |
CN113286000A (en) * | 2021-05-21 | 2021-08-20 | 国网河北省电力有限公司 | Data receiving and transmitting method and device applied to power unidirectional transmission system |
CN113501396A (en) * | 2021-07-14 | 2021-10-15 | 上海三菱电梯有限公司 | Elevator communication system |
CN114375019A (en) * | 2022-01-18 | 2022-04-19 | 北京智联安科技有限公司 | NB-IoT mobile state data retransmission method and system |
Also Published As
Publication number | Publication date |
---|---|
CN106533639B (en) | 2019-09-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106533639A (en) | Data retransmission method and device | |
CN101047484B (en) | Transmission layer retransmission method and system | |
EP2611057A1 (en) | Mobile communication system and mobile station device | |
CN101888544B (en) | Low-bandwidth video data transmission method and hard disk video recorder | |
CN103141050B (en) | Data packet retransmission method and node in quick path interconnect system | |
CN110460412B (en) | Method and RDMA network card for data transmission | |
CN106656431A (en) | Message transmission method and user equipment | |
CN102833119B (en) | Method for synchronously receiving and processing real-time data under dual-network redundancy mechanism | |
CN103188059A (en) | Method, device and system for data packet retransmission in quick path interconnect system | |
CN106506124B (en) | It retransmits message and determines method and device | |
CN109787722A (en) | Data transmission method, device and server | |
CN104579601A (en) | Retransmission request processing method and device | |
CN110247736A (en) | A kind of data transmission method and device | |
CN102217249A (en) | Communication apparatus and communication method | |
CN105933453A (en) | Data transmission method and system | |
CN101369879A (en) | Method and apparatus for requesting data retransmission | |
CN111404872A (en) | Message processing method, device and system | |
CN107172181B (en) | File transmission method based on double threads | |
EP3961947B1 (en) | Data retransmission method and apparatus | |
CN110022218B (en) | Multicast communication method, terminal device and storage medium | |
CN103442091A (en) | Data transmission method and device | |
US20080095099A1 (en) | Apparatus, system and method adapted to filter out redundant TCP ACKs in wireless networks | |
CN112351049B (en) | Data transmission method, device, equipment and storage medium | |
CN106900017B (en) | Data back transmission method and device | |
CN101494569B (en) | Method and apparatus for processing message |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |