Summary of the invention
Embodiment of the present invention technical problem to be solved is, a kind of data transmission method for uplink and data sending device are provided, by detecting current network environment, the change of Sampling network time delay, judge the whether congested of network in advance, achieve and in advance transmission rate is adjusted, thus obtain best result of broadcast.
First aspect, embodiments provides a kind of data transmission method for uplink, comprising:
By adding up the network delay of preset time period, analyze the time delay change of current network;
According to the trend of the time delay mutation analysis network congestion condition of described current network, and whether occur congested according to the Trend judgement current network of described network congestion condition;
When being judged as YES, reduce the transmission rate of current transmission data.
In conjunction with first aspect, in the implementation that the first is possible, the trend of the described time delay mutation analysis network congestion condition according to described current network, and whether there is congested comprising according to the Trend judgement current network of described network congestion condition:
Whether judgment formula y (n) >y (m)+a sets up; Wherein, y (n) is the network delay change in the n-th moment, and y (m) is the network delay change in m moment, and described n-th moment is current time, and n>m, a are default congestion threshold;
When judging that described formula is set up, then judge that current network occurs congested; When judging that described formula is false, then judge that current network does not occur congested.
In conjunction with first aspect, in the implementation that the second is possible, the described network delay by statistics preset time period, the time delay change analyzing current network comprises:
The time delay change of current network is drawn by following formulae discovery:
y(n)=x(n)–x(n-1)+coef*y(n-1)
Wherein, y (n) is the network delay change in the n-th moment, and x (n) is the network delay in the n-th moment, and described n-th moment is current time, coef is default weight, and 0<coef<1.
In conjunction with the first possible implementation of first aspect, in the implementation that the third is possible, the difference of described n and described m is within 25.
In conjunction with first aspect, or the first possible implementation of first aspect, or the implementation that the second of first aspect is possible, or the third possible implementation of first aspect, in the 4th kind of possible implementation,
The transmission rate of the current transmission data of described reduction comprises:
0.5 times of speed of more current transmission rate and the size of current receiving velocity, and choose speed larger in 0.5 times of speed of described current transmission rate and current receiving velocity as up-to-date transmission rate.
In conjunction with the 4th kind of possible implementation of first aspect, in the 5th kind of possible implementation, after congested according to the Trend judgement current network appearance of described network congestion condition, also comprise:
Create the send window for limiting instantaneous transmission rate, the size of described send window is the product of current receiving velocity and current network time delay.
Second aspect, embodiments provides a kind of data sending device, comprising:
Delay Variation analysis module, for the network delay by statistics preset time period, analyzes the time delay change of current network;
Analyze judge module, for the trend of the time delay mutation analysis network congestion condition according to described current network, and whether occur congested according to the Trend judgement current network of described network congestion condition;
Transmission rate reduces module, for when described analysis judge module is judged as YES, reduces the transmission rate of current transmission data.
In conjunction with second aspect, in the implementation that the first is possible, described analysis judge module specifically for:
Whether judgment formula y (n) >y (m)+a sets up; Wherein, y (n) is the network delay change in the n-th moment, and y (m) is the network delay change in m moment, and described n-th moment is current time, and n>m, a are default congestion threshold;
When judging that described formula is set up, then judge that current network occurs congested; When judging that described formula is false, then judge that current network does not occur congested.
In conjunction with second aspect, in the implementation that the second is possible, described Delay Variation analysis module specifically for:
The time delay change of current network is drawn by following formulae discovery:
y(n)=x(n)–x(n-1)+coef*y(n-1)
Wherein, y (n) is the network delay change in the n-th moment, and x (n) is the network delay in the n-th moment, and described n-th moment is current time, coef is default weight, and 0<coef<1.
In conjunction with the first possible implementation of second aspect, in the implementation that the third is possible, the difference of described n and described m is within 25.
In conjunction with second aspect, or the first possible implementation of second aspect, or the implementation that the second of second aspect is possible, or the third possible implementation of second aspect, in the 4th kind of possible implementation, described transmission rate reduce module specifically for:
When described analysis judge module is judged as YES, 0.5 times of speed of more current transmission rate and the size of current receiving velocity, and choose speed larger in 0.5 times of speed of described current transmission rate and current receiving velocity as up-to-date transmission rate.
In conjunction with the 4th kind of possible implementation of second aspect, in the 5th kind of possible implementation, also comprise:
Window creating module, for when described analysis judge module is judged as YES, create the send window for limiting instantaneous transmission rate, the size of described send window is the product of current receiving velocity and current network time delay.
By implementing the embodiment of the present invention, by analyzing the time delay change of current network, according to the trend of the time delay mutation analysis network congestion condition of current network, when occurring congested according to the Trend judgement current network of network congestion condition, reduce the transmission rate of current transmission data, can network occur congested before, judge that network occurs in advance congested, achieve and in advance transmission rate is adjusted, solve prior art long for recovery time for congested network in low-bandwidth network, have a strong impact on the technical problem of video transmission quality, in addition, by creating the send window for limiting instantaneous transmission rate, the network impairment degree in detection process can be controlled further, greatly reduce video playback card, the number of times paused, ensure real-time and the fluency of video playback.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
It should be noted that, the term used in embodiments of the present invention is only for the object describing specific embodiment, and not intended to be limiting the present invention." one ", " described " and " being somebody's turn to do " of the singulative used in the embodiment of the present invention and appended claims is also intended to comprise most form, unless context clearly represents other implications.It is also understood that term "and/or" used herein refer to and comprise one or more project of listing be associated any or all may combine.
See Fig. 1, be the schematic flow sheet of the data transmission method for uplink that the embodiment of the present invention provides, the method comprises:
Step S100: by adding up the network delay of preset time period, analyzes the time delay change of current network;
Particularly, the embodiment of the present invention is for transmitting video data, and network delay refers to and sends to the other side to start a video packets, the time delay between the reply bag receiving the other side.The time delay change of the network of the embodiment of the present invention, refer to network delay sometime, with the situation of change of the network delay in moment before, that is, the time delay change of network can be defined as a kind of filtering and calculate, and embodiment of the present invention data sending terminal can analyze the time delay change of current network by the variation tendency of adding up the network delay in one section of preset time period.
Again in detail, to add up the network delay in two priority moment, the time delay change of current network can be drawn by following formulae discovery:
Y (n)=x (n) – x (n-1)+coef*y (n-1) formula 1
Wherein, y (n) is the network delay change in the n-th moment, and x (n) is the network delay in the n-th moment, and described n-th moment is current time, coef is default weight, and 0<coef<1.Will be understood that, network delay change y (1) in first moment can be 0, so network delay change y (2)=x (2) – x (1)+coef*y (1) in second moment, that is, y (2)=x (2) – x (1).
It should be noted that, the embodiment of the present invention includes but not limited to that formula 1 is to calculate the time delay change of current network, and can also pass through other formula, such as can change formula 1, the embodiment of the present invention is not construed as limiting.
Step S102: according to the trend of the time delay mutation analysis network congestion condition of described current network, and whether occur congested according to the Trend judgement current network of described network congestion condition;
Particularly, the time delay of current network change can change compare analysis with the time delay of moment network before, if the time delay of current Network that latest computed goes out changes more increasing than what add up before, so judge that network occurs congested; Or can check whether the time delay change of current network reaches predetermined threshold value, if reach, illustrates that network occurs that the congested network delay that causes changes suddenly change greatly, namely judge that network occurs congested, etc.
Again in detail, can pass through to judge following formula:
Y (n) >y (m)+a formula 2
Whether set up, judge whether current network occurs congested.Wherein, y (n) is the network delay change in the n-th moment, and y (m) is the network delay change in m moment, and described n-th moment is current time, and n>m, a are default congestion threshold;
Will be understood that, n, m and a in each embodiment of the present invention can be nonnegative integer, namely comprise 0 and natural number; .Preferably, in above-mentioned formula 2, the difference of n and m is within 25, and namely the difference of n and m can be 1, and namely m was a upper moment of n; A can be 160,180,200 or 220 etc., and the present invention is not construed as limiting, and can arrange this congestion threshold for technical staff according to system actual needs.
When judgment formula 2 is set up, namely current time network delay change be greater than before moment m network delay change value, when having exceeded congestion threshold a, then judge current network occur congested, perform step S104; Otherwise, when judgment formula 2 is false, then judge that current network does not occur congested.
Step S104: when being judged as YES, reduces the transmission rate of current transmission data.
Particularly, directly can reduce the speed of current transmission rate 0.5 times, the transmission rate by current transmission data is reduced to original 0.5 times; Or can also 0.5 times of speed of more current transmission rate and the size of current receiving velocity, and choose speed larger in 0.5 times of speed of described current transmission rate and current receiving velocity as up-to-date transmission rate; Or can also comprise the send window created for limiting instantaneous transmission rate, the size of described send window is the product of current receiving velocity and current network time delay, thus can control the network impairment degree in detection process further.
It should be noted that, step S104 can also comprise: when data sending terminal detects that the video packets number of not replying equals current send window size, will not send new video data.When judging that current network does not occur congested in step S102, current data sending strategy can be kept, do not adjust.
Also it should be noted that, the embodiment of the present invention is after the transmission rate reducing current transmission data, the network congestion judgment mode provided by the embodiment of the present invention, according to the trend of the time delay mutation analysis network congestion condition of described current network, and when judging that network does not occur congested, according to original data sending strategy, or can automatically raise the speed sending data by demand.
By implementing the embodiment of the present invention, by analyzing the time delay change of current network, according to the trend of the time delay mutation analysis network congestion condition of current network, when occurring congested according to the Trend judgement current network of network congestion condition, reduce the transmission rate of current transmission data, can network occur congested before, judge that network occurs in advance congested, achieve and in advance transmission rate is adjusted, solve prior art long for recovery time for congested network in low-bandwidth network, have a strong impact on the technical problem of video transmission quality, in addition, by creating the send window for limiting instantaneous transmission rate, the network impairment degree in detection process can be controlled further, greatly reduce video playback card, the number of times paused, ensure real-time and the fluency of video playback.
The above-mentioned method illustrating the embodiment of the present invention, below for the ease of implementing the such scheme of the embodiment of the present invention better, correspondingly, is also provided for coordinating the relevant apparatus implementing such scheme below.
The structural representation of the data sending device that the embodiment of the present invention as shown in Figure 2 provides, data sending device 20 data sending terminal that is method item embodiment is corresponding, data sending device 20 can comprise Delay Variation analysis module 200, analyze judge module 202 and transmission rate reduction module 204, wherein
Delay Variation analysis module 200, for the network delay by statistics preset time period, analyzes the time delay change of current network;
Analyze the trend of judge module 202 for the time delay mutation analysis network congestion condition according to described current network, and whether occur congested according to the Trend judgement current network of described network congestion condition;
Transmission rate reduces module 204 for when analyzing judge module 202 and being judged as YES, and reduces the transmission rate of current transmission data.
Particularly, the analysis judge module 202 in the embodiment of the present invention specifically may be used for:
Whether judgment formula y (n) >y (m)+a sets up; Wherein, y (n) is the network delay change in the n-th moment, and y (m) is the network delay change in m moment, and described n-th moment is current time, and n>m, a are default congestion threshold;
When judging that described formula is set up, then judge that current network occurs congested; When judging that described formula is false, then judge that current network does not occur congested.
Again particularly, the Delay Variation analysis module 200 in the embodiment of the present invention specifically may be used for:
The time delay change of current network is drawn by following formulae discovery:
y(n)=x(n)–x(n-1)+coef*y(n-1)
Wherein, y (n) is the network delay change in the n-th moment, and x (n) is the network delay in the n-th moment, and described n-th moment is current time, coef is default weight, and 0<coef<1.
Transmission rate in the embodiment of the present invention reduces module 204 and specifically may be used for:
When analyzing judge module 202 and being judged as YES, 0.5 times of speed of more current transmission rate and the size of current receiving velocity, and choose speed larger in 0.5 times of speed of described current transmission rate and current receiving velocity as up-to-date transmission rate.
Further, the structural representation of another embodiment of data sending device provided by the invention as shown in Figure 3, data sending device 20 comprises Delay Variation analysis module 200, analyzes outside judge module 202 and transmission rate reduction module 204, window creating module 206 can also be comprised, for when analyzing judge module 202 and being judged as YES, create the send window for limiting instantaneous transmission rate, the size of described send window is the product of current receiving velocity and current network time delay.
The data sending device 20 of the embodiment of the present invention can be such as panel computer, personal digital assistant, intelligent mobile terminal or other can carry out the subscriber equipment of video network transmission.
Will be understood that, the function of each functional module of the data sending device 20 of the present embodiment according to the method specific implementation in said method embodiment, can repeat no more herein.
Refer to Fig. 4, Fig. 4 is the structural representation of another embodiment of data sending device provided by the invention.Wherein, as shown in Figure 4, data sending device 40 can comprise: at least one processor 401, such as CPU, at least one network interface 404, user interface 403, memory 405, at least one communication bus 402 and display screen 406.Wherein, communication bus 402 is for realizing the connection communication between these assemblies.Wherein, user interface 403 can comprise touch-screen, keyboard or mouse etc.Network interface 404 optionally can comprise wireline interface, the wave point (as WI-FI interface) of standard.Memory 405 can be high-speed RAM memory, and also can be non-labile memory (non-volatilememory), such as at least one magnetic disc store, memory 405 comprises the flash in the embodiment of the present invention.Memory 405 can also be optionally that at least one is positioned at the storage system away from aforementioned processor 401.As shown in Figure 4, operating system, network communication module, Subscriber Interface Module SIM and data transmission program can be comprised as in a kind of memory 405 of computer-readable storage medium.
Processor 401 may be used for calling the data transmission program stored in memory 405, and performs following operation:
Added up the network delay of preset time period by network interface 404, analyze the time delay change of current network;
According to the trend of the time delay mutation analysis network congestion condition of described current network, and whether occur congested according to the Trend judgement current network of described network congestion condition;
When being judged as YES, reduce the transmission rate of the current transmission data of network interface 404.
Particularly, whether processor 401 according to the trend of the time delay mutation analysis network congestion condition of described current network, and there is congested can comprising according to the Trend judgement current network of described network congestion condition:
Whether judgment formula y (n) >y (m)+a sets up; Wherein, y (n) is the network delay change in the n-th moment, and y (m) is the network delay change in m moment, and described n-th moment is current time, and n>m, a are default congestion threshold;
When judging that described formula is set up, then judge that current network occurs congested; When judging that described formula is false, then judge that current network does not occur congested.
Particularly, processor 401 adds up the network delay of preset time period by network interface 404, and the time delay change analyzing current network comprises:
The time delay change of current network is drawn by following formulae discovery:
y(n)=x(n)–x(n-1)+coef*y(n-1)
Wherein, y (n) is the network delay change in the n-th moment, and x (n) is the network delay in the n-th moment, and described n-th moment is current time, coef is default weight, and 0<coef<1.
Particularly, the difference of described n and described m is within 25.
Particularly, the transmission rate that processor 401 reduces the current transmission data of network interface 404 can comprise:
0.5 times of speed of more current transmission rate and the size of current receiving velocity, and choose speed larger in 0.5 times of speed of described current transmission rate and current receiving velocity as the up-to-date transmission rate of network interface 404.
Particularly, after processor 401 is congested according to the Trend judgement current network appearance of described network congestion condition, can also perform:
Create the send window for limiting instantaneous transmission rate, the size of described send window is the product of current receiving velocity and current network time delay.
It should be noted that, the function of each functional module of data sending device 40 in the embodiment of the present invention can according to the method specific implementation in said method embodiment, and its specific implementation process with reference to the associated description of said method embodiment, can repeat no more herein.
In sum, by implementing the embodiment of the present invention, by analyzing the time delay change of current network, according to the trend of the time delay mutation analysis network congestion condition of current network, when occurring congested according to the Trend judgement current network of network congestion condition, reduce the transmission rate of current transmission data, can network occur congested before, judge that network occurs in advance congested, achieve and in advance transmission rate is adjusted, solve prior art long for recovery time for congested network in low-bandwidth network, have a strong impact on the technical problem of video transmission quality, in addition, by creating the send window for limiting instantaneous transmission rate, the network impairment degree in detection process can be controlled further, greatly reduce video playback card, the number of times paused, ensure real-time and the fluency of video playback.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.
Above disclosedly be only a kind of preferred embodiment of the present invention, certainly the interest field of the present invention can not be limited with this, one of ordinary skill in the art will appreciate that all or part of flow process realizing above-described embodiment, and according to the equivalent variations that the claims in the present invention are done, still belong to the scope that invention is contained.