CN107196863B - Code rate adjusting method and electronic equipment - Google Patents

Code rate adjusting method and electronic equipment Download PDF

Info

Publication number
CN107196863B
CN107196863B CN201610147261.5A CN201610147261A CN107196863B CN 107196863 B CN107196863 B CN 107196863B CN 201610147261 A CN201610147261 A CN 201610147261A CN 107196863 B CN107196863 B CN 107196863B
Authority
CN
China
Prior art keywords
difference
code rate
value
round
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610147261.5A
Other languages
Chinese (zh)
Other versions
CN107196863A (en
Inventor
周超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiao Feng
Original Assignee
Palmwin Information Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Palmwin Information Technology Shanghai Co ltd filed Critical Palmwin Information Technology Shanghai Co ltd
Priority to CN201610147261.5A priority Critical patent/CN107196863B/en
Publication of CN107196863A publication Critical patent/CN107196863A/en
Application granted granted Critical
Publication of CN107196863B publication Critical patent/CN107196863B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays

Abstract

The invention discloses a code rate adjusting method and electronic equipment, and belongs to the technical field of network transmission. The method comprises the following steps: periodically detecting the round trip delay of the network and adding the detected round trip delay into a window queue; calculating and storing a first difference between the detected round trip delay and the adjacent historical round trip delay; calculating and storing a second difference value between the first difference value and the adjacent historical first difference value; and adjusting the data transmission code rate according to the calculated second difference and the historical second difference. Therefore, the data transmission code rate is adjusted according to the calculated second difference and the historical second difference, the problem that adjustment strategies are difficult to decide due to the fact that packet loss reasons cannot be distinguished is solved, and meanwhile, the network state can be quickly and accurately estimated according to the calculated second difference and the historical second difference, so that the data transmission code rate is adjusted in time, the code rate adjustment efficiency is improved, the occurrence rate of network congestion is reduced, and user experience is improved.

Description

Code rate adjusting method and electronic equipment
Technical Field
The present invention relates to the field of network transmission technologies, and in particular, to a code rate adjustment method and an electronic device.
Background
In the real-time transmission process of network data, the network congestion situation is quickly detected, and the control of the data transmission code rate is particularly important in the adjustment of a network congestion strategy. In the existing congestion control strategy, rate control is generally performed based on the packet loss rate.
However, in a wireless channel, factors causing packet loss of data transmission are various, such as network congestion, channel fading, and the like. When packet loss is caused by channel fading, the packet loss is judged to be network congestion, and an adjustment strategy for reducing the code rate is adopted, so that the media communication quality is further reduced, the condition of wrong network state estimation occurs, and the data transmission code rate cannot be accurately adjusted. Therefore, when the prior art is used, on one hand, the problem that the adjustment strategy is difficult to decide due to the fact that packet loss cannot be distinguished is solved, and on the other hand, due to the fact that congestion is difficult to distinguish, the code rate cannot be adjusted timely and accurately due to the fact that an incorrect code rate adjustment strategy is adopted, and user experience is poor.
Disclosure of Invention
In order to avoid the problem that adjustment strategies are difficult to decide due to the fact that packet loss reasons cannot be distinguished, the network state is quickly and accurately estimated, the rate adjustment efficiency is improved, the occurrence rate of network congestion conditions is reduced, and user experience is improved, the embodiment of the invention provides a rate adjustment method and electronic equipment. The technical scheme is as follows:
in a first aspect, a method for adjusting a code rate is provided, where the method includes:
periodically detecting the round trip delay of a network and adding the detected round trip delay into a window queue;
calculating and storing a first difference between the detected round trip delay and the adjacent historical round trip delay;
calculating and storing a second difference value between the first difference value and the adjacent historical first difference values; and
and adjusting the data transmission code rate according to the calculated second difference and the historical second difference.
With reference to the first aspect, in a first possible implementation manner, the adding the detected round trip delay to a window queue includes:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the adjusting, according to the calculated second difference and the historical second difference, a data transmission code rate includes:
and adjusting the data transmission code rate according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the adjusting, according to the ratio of the calculated second difference to a mean of a plurality of historical second differences, a data transmission code rate includes:
obtaining a value range in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the adjusting a data transmission code rate according to the value interval where the ratio is located includes:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
With reference to the first aspect, in a fifth possible implementation manner, the method further includes:
and setting the grade of the data transmission code rate according to the discrete value of the code rate in a preset range.
In a second aspect, an electronic device is provided, the device comprising:
a round trip delay detection module for periodically detecting the round trip delay of the network;
round-trip delay adding window queue module, which is used to add the detected round-trip delay into window queue;
a first difference calculating and storing module, configured to calculate and store a first difference between the detected round trip delay and an adjacent historical round trip delay;
the second difference calculating and storing module is used for calculating and storing a second difference between the first difference and the adjacent historical first differences; and
and the code rate adjusting module is used for adjusting the data transmission code rate according to the calculated second difference value and the historical second difference value.
With reference to the second aspect, in a first possible implementation manner, the round trip delay adding window queue module is specifically configured to:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner, the code rate adjustment module is specifically configured to:
and adjusting the data transmission code rate according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the code rate adjusting module includes:
the value interval obtaining submodule is used for obtaining a value interval in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
the code rate adjusting submodule is used for adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner, the code rate adjustment submodule is specifically configured to:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
With reference to the second aspect, in a fifth possible implementation manner, the apparatus further includes:
and the code rate grade setting module is used for setting the grade of the data transmission code rate according to the discrete value of the code rate in the preset range.
In a third aspect, an electronic device is provided, which includes a network interface module, a memory, and a processor connected to the network interface module and the memory, wherein the memory is configured to store a set of program codes, and the processor calls the program codes stored in the memory to perform the following operations:
periodically detecting the round trip delay of a network and adding the detected round trip delay into a window queue;
calculating and storing a first difference between the detected round trip delay and the adjacent historical round trip delay;
calculating and storing a second difference value between the first difference value and the adjacent historical first difference values; and
adjusting the data transmission code rate according to the calculated second difference and the historical second difference;
wherein the network interface module is configured to perform an operation of periodically detecting a round trip delay of the network.
With reference to the third aspect, in a first possible implementation manner, the processor calls the program code stored in the memory to perform the following operations:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner, the processor calls the program code stored in the memory to perform the following operations:
and adjusting the data transmission code rate according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
With reference to the second possible implementation manner of the third aspect, in a third possible implementation manner, the processor calls the program code stored in the memory to perform the following operations:
obtaining a value range in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
With reference to the third possible implementation manner of the third aspect, in a fourth possible implementation manner, the processor calls the program code stored in the memory to perform the following operations:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
With reference to the third aspect, in a fifth possible implementation manner, the processor calls the program code stored in the memory to perform the following operations:
and setting the grade of the data transmission code rate according to the discrete value of the code rate in a preset range.
The invention discloses a code rate adjusting method and electronic equipment. The method comprises the following steps: periodically detecting the round trip delay of the network and adding the detected round trip delay into a window queue; calculating and storing a first difference between the detected round trip delay and the adjacent historical round trip delay; calculating and storing a second difference value between the first difference value and the adjacent historical first difference value; and adjusting the data transmission code rate according to the calculated second difference and the historical second difference. The data transmission code rate is adjusted according to the calculated second difference and the historical second difference, the problem that adjustment strategies are difficult to decide due to the fact that packet loss reasons cannot be distinguished is solved, and meanwhile, the network state can be quickly and accurately estimated according to the calculated second difference and the historical second difference, so that the data transmission code rate is adjusted in time, the code rate adjustment efficiency is improved, the occurrence rate of network congestion conditions is reduced, and user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a code rate adjustment method according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for adjusting a code rate according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for adjusting a code rate according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
An embodiment of the present invention provides a code rate adjustment method, and as shown in fig. 1, the method includes:
101. the round trip delay of the network is periodically detected and added to the window queue.
Specifically, the adding the detected round trip delay into the window queue includes:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
The network involved in the embodiments of the present invention includes a wireless network.
102. A first difference between the detected round trip delay and its neighboring historical round trip delay is calculated and stored.
103. Calculating and storing a second difference between the first difference and its neighboring historical first differences.
104. And adjusting the data transmission code rate according to the calculated second difference and the historical second difference.
Specifically, the data transmission code rate is adjusted according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
The process of adjusting the data transmission code rate according to the ratio of the calculated second difference to the mean of the plurality of historical second differences may specifically include:
obtaining a value range in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
The process of adjusting the data transmission code rate according to the value interval of the ratio may include:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
Optionally, the method further comprises:
setting the ratio according to at least one of the detected round trip delay, the first difference and the second difference.
Optionally, the method further comprises:
and setting the grade of the data transmission code rate according to the discrete value of the code rate in a preset range.
The embodiment of the invention provides a code rate adjusting method, which is characterized in that a data transmission code rate is adjusted according to a calculated second difference value and a historical second difference value, so that the problem that adjustment strategies are difficult to decide due to the fact that packet loss can not be distinguished is solved, and meanwhile, a network state can be quickly and accurately estimated according to the calculated second difference value and the historical second difference value, so that the data transmission code rate is adjusted in time, the code rate adjusting efficiency is improved, the occurrence rate of network congestion is reduced, and the user experience is improved.
Example two
An embodiment of the present invention provides a code rate adjustment method, and as shown in fig. 2, the method includes:
201. the round trip delay of the network is periodically detected and added to the window queue.
The period of periodically detecting the round trip delay of the network may be a preset time interval, for example, the preset time interval may be an empirical value of 200ms, that is, the round trip delay of the network may be detected every 200 ms.
The window queue is configured to maintain a preset number of round trip delays, for example, the preset number may be an empirical value of 32, that is, the window queue maintains 32 round trip delays.
The period and the preset number may be preset, and the specific period and the preset number are not limited in the embodiment of the present invention.
Specifically, adding the detected round trip delay to the window queue includes:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
and if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue.
Illustratively, a window queue maintains 32 round trip delays, and if the number of existing round trip delays in the window queue is less than 32, the detected round trip delay is placed at the end of the window queue; and if the number of the existing round-trip delays in the window queue is equal to 32, deleting the round-trip delay at the front end of the window queue, and placing the detected round-trip delay at the tail end of the window queue.
The queue can be realized by the technologies of linked list or dynamic array, etc.
Specifically, the queue may be performed by allocating a queue table and/or a stack in advance in a computer storage device, and dynamically allocating a storage space for each round-trip delay in a storage process, where the number of round-trip delays is 32, which is described as an example, and the process may specifically be:
dynamically allocating 32 storage spaces, and if the number of the existing round-trip delays in the window queue is less than 32, placing the detected round-trip delay in the storage space at the tail end; and if the number of the existing round-trip time delays in the window queue is equal to 32, deleting the round-trip time delay stored in the memory space at the forefront of the window queue, and placing the detected round-trip time delay in the memory space.
In addition, the storage manner of the round trip delay, the first difference value and the second difference value in the embodiment of the present invention includes:
the round trip delay, the first difference value and the second difference value are stored in the same window queue, and each storage space in the window queue stores the detected round trip delay and the corresponding calculated and stored first difference value and second difference value;
different window queues are respectively allocated for the round trip delay, the first difference value and the second difference value, the round trip delay, the first difference value and the second difference value respectively correspond to the independent window queues, and the position of the detected round trip delay in the window queues and the positions of the calculated and stored first difference value and second difference value in the window queues can or can not correspond to each other;
and distributing a window queue for the round trip delay, and distributing the same window queue for the first difference value and the second difference value, wherein the position of the detected round trip delay in the window queue may or may not correspond to the positions of the calculated and stored first difference value and second difference value in the window queue.
In the above three ways, along with the update of the round trip delay in each storage space in the window queue, the first difference value and the second difference value stored in each storage space in the window queue are also updated.
In addition, the round trip delay, the first difference value and the second difference value may be stored in other manners, which is not limited in this embodiment of the present invention, and the storage manner is specifically set according to actual needs.
The cycle of the round trip delay detection and the preset number of the round trip delay maintained by the window queue are preset through the empirical value, so that the round trip delay detection and the round trip delay of the historical preset number can reflect the network state more accurately, the efficiency of network state detection is improved, and the accuracy of network state estimation is further improved.
202. A first difference between the detected round trip delay and its neighboring historical round trip delay is calculated and stored.
Illustratively, if the detected round trip delay is the 32 th round trip delay in the window queue, it may be denoted as T32And the history round trip delay adjacent to the history round trip delay is the 31 st round trip delay of the window queue, which can be recorded as T31Calculating and storing a first difference between said detected round trip delay and its neighboring historical round trip delay as a first difference between said 32 th round trip delay and said 31 st round trip delay, which can be represented by J, and said first difference of said detected round trip delay can be represented by J32=T32-T31
It should be noted that, at the beginning of detection, since there is no historical round-trip delay, there is no corresponding first difference in the first round-trip delay; when the number of the round trip delays in the queue is the same as the preset number and the total number of the historical round trip delays is larger than the preset number, when the round trip delay is detected, a first difference value corresponding to the round trip delay is a first difference value between the round trip delay and the last-but-one round trip delay in the queue, and the first difference value of the first round trip delay in the queue is a first difference value between the stored round trip delay and the deleted adjacent round trip delay.
203. Calculating and storing a second difference between the first difference and its neighboring historical first differences.
Taking the example in step 202 as an illustration, the first difference is the difference between the 32 nd round trip delay and the 31 st round trip delay in the window queue, i.e. J32Then the historical first difference adjacent to the first difference is the difference between the 31 st and 30 th round trip delay in the window queue, i.e. J31Calculating and storing a second difference between the first difference and its neighboring historical first difference, i.e. calculating the J32And said J31The difference between can be represented as J'32=J32-J31Wherein, the J 'may be'32Referred to as the second derivative of the 32 th round trip delay.
It should be noted that, at the beginning of the detection, since there is no first difference, there is no corresponding second difference between the first round-trip delay and the second round-trip delay; and at the stage that the number of the round trip delays in the queue is the same as the preset number and the total number of the historical round trip delays is less than or equal to 2, the round trip delay is detected, a second difference value corresponding to the round trip delay is a second difference value between a first difference value corresponding to the round trip delay and a first difference value adjacent to the first difference value, and a second difference value corresponding to a first round trip delay in the queue is a second difference value between a stored first difference value corresponding to the round trip delay and a deleted first difference value adjacent to the first difference value.
And the corresponding calculated and stored first difference value and second difference value are continuously updated as the detected round-trip delay is updated in the window queue, so that the first difference value and the second difference value corresponding to the oldest round-trip delay are deleted from the corresponding queues.
It should be noted that, the method for calculating the first difference and the second difference of other round-trip delays in the window queue is similar to that illustrated in step 202 and step 203, and details are not repeated here, and besides, the first difference and the second difference may be calculated in other manners, which is not limited in this embodiment of the present invention.
204. And adjusting the data transmission code rate according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
Specifically, the process comprises the following steps:
a. and obtaining a value range in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located.
Wherein the obtaining of the ratio of the calculated second difference to the mean of the plurality of historical second differences may include:
the illustration is made with the corresponding 32 round trip delays in the window queue.
When the calculated second difference value is a second difference value of a 32 nd round trip delay in the window queue and the total number of the historical round trip delays minus the preset number is greater than or equal to 2, the calculated second difference value is J'32And the second difference value of the oldest historical round trip delay is the stored corresponding second difference value and is recorded as J'1If there are 32 round-trip delays in the window queue corresponding to 32 second differences, the ratio of the calculated second difference to the average of the plurality of historical second differences may be expressed as follows:
Figure BDA0000941934890000111
when the detection is started, the first round trip delay and the second round trip delay have no corresponding second difference, the calculated second difference is the second difference of the 32 th round trip delay in the window queue, and the calculated second difference is J'32The second difference value of the oldest historical round trip delay is J'3Wherein, J'3=J3-J2,J3=T3-T2,J2=T2-T1Then, the plurality of historical second differences for 32 round-trip delays in the window queue may be 30, and the ratio of the calculated second difference to the average of the plurality of historical second differences may be expressed as follows:
Figure BDA0000941934890000112
wherein, the number of the value intervals is a plurality.
Specifically, the value range may be determined according to an empirical ratio, where the empirical ratio may be a first ratio, a second ratio, and a third ratio, and the value range may be a first value range, a second value range, a third value range, and a fourth value range.
The first value interval is an interval less than or equal to a first ratio, the second value interval is an interval greater than the first ratio and less than or equal to a second ratio, the third value interval is an interval greater than the second ratio and less than or equal to a third ratio, and the fourth value interval is an interval greater than the third ratio.
If the ratio of the calculated second difference to the mean of the plurality of historical second differences is represented by m, the preset first ratio is 1.0, the second ratio is 1.6, and the third ratio is 2.5, then the first to fourth value intervals may be represented as: m is less than or equal to 1.0, m is more than 1.0 and less than or equal to 1.6, m is more than 1.6 and less than or equal to 2.5, and m is more than 2.5.
Obtaining the value range of the ratio of the calculated second difference value to the average value of the plurality of historical second difference values, namely obtaining the calculated ratio
Figure BDA0000941934890000121
Or
Figure BDA0000941934890000122
The value interval in which the position is located.
It should be noted that, in addition to the number of the value intervals being four, the number of the value intervals may be other, the number of the specific value intervals is not limited in the embodiment of the present invention, and may be specifically set according to actual needs, and in addition, the experience ratio for setting the value intervals may also include other values.
b. And adjusting the data transmission code rate according to the value interval of the ratio.
Specifically, the level of the data transmission code rate is reduced or increased according to the value interval of the ratio.
And reducing or increasing one or more levels of the data transmission code rate according to the value interval of the ratio.
For example, if the value interval in which the ratio is located is a first value interval, the data transmission code rate is increased by one level, if the value interval in which the ratio is located is a second value interval, the data transmission code rate is decreased by one level, if the value interval in which the ratio is located is a third value interval, the data transmission code rate is decreased by two levels, if the value interval in which the ratio is located is a fourth value interval, the data transmission code rate is decreased by three levels, and in addition, other numbers of data transmission code rate levels can be decreased or increased, which is only exemplary here.
It should be noted that, in step 204, a process of adjusting a data transmission code rate according to the calculated second difference and the historical second difference is implemented, and besides the foregoing manners, the process may also be implemented in other manners, and the specific manner is not limited in the embodiment of the present invention.
Optionally, the ratio may also be obtained by:
setting the ratio according to at least one of the detected round trip delay, the first difference and the second difference.
Specifically, if the calculated second difference is smaller than the first preset value, the ratio is set as a fourth ratio, which may be the same as or different from the first ratio in step a of step 204, for example, the first preset value may be 5, and the fourth ratio may be 1.0;
if the detected round-trip delay is less than or equal to the preset time and the calculated first difference value of the detected round-trip delay is a negative value, setting the value as a fifth ratio, where the fifth ratio may be the same as or different from the fourth ratio, and exemplarily, the preset time may be 500ms, and the fifth ratio may be 1.0;
if the round-trip delays of the preset number in the round-trip delays of the last preset number of times are greater than the second preset value, the ratio is set to be a sixth ratio, for example, the preset number may be 5 times, the second preset value may be 1500ms, and the sixth ratio may be 3.0.
In addition, other ratios are correspondingly set in other situations of the detected round trip delay, the first difference, and the second difference, which is not limited in this embodiment of the present invention.
And performing special setting on the ratio according to at least one special condition of the detected round trip delay, the first difference and the second difference, so that the condition that the data transmission code rate is not accurately adjusted through the calculated ratio of the second difference to the mean value of a plurality of historical second differences under some special conditions is avoided, or the condition that the data transmission code rate is not accurately adjusted through the calculated ratio of the second difference to the mean value of a plurality of historical second differences under some special conditions is avoided, thereby further improving the code rate adjustment efficiency, further quickly and accurately estimating the network state and providing user experience.
Optionally, as shown in fig. 3, before step 204, the method further includes:
301. and setting the grade of the data transmission code rate according to the discrete value of the code rate in a preset range.
Specifically, the discrete value of each code rate in the preset range is set as the level of one data transmission code rate.
For example, the discrete values of the code rates in the preset range are [32kbps,64kbps,128kbps,192kbps,256kbps,384kbps ], and each code rate in the range is a level, i.e., each discrete value in [32kbps,64kbps,128kbps,192kbps,256kbps,384kbps ] is a level of one code rate.
The procedure of performing the decreasing or increasing level of the data transmission code rate in step 204 after step 301 may be:
for example, if the current code rate is 32kbps, increasing one level to obtain a code rate of 64kbps, or if the current code rate is 384kbps, decreasing two levels to obtain a code rate of 192 kbps.
It should be noted that step 301 may be executed before step 204, may also be executed before step 201, and may also be preset, and the specific execution order of step 301 is not limited in the embodiment of the present invention.
The embodiment of the invention provides a code rate adjusting method, which is characterized in that a data transmission code rate is adjusted according to a calculated second difference value and a historical second difference value, so that the problem that adjustment strategies are difficult to decide due to the fact that packet loss can not be distinguished is solved, and meanwhile, a network state can be quickly and accurately estimated according to the calculated second difference value and the historical second difference value, so that the data transmission code rate is adjusted in time, the code rate adjusting efficiency is improved, the occurrence rate of network congestion is reduced, and the user experience is improved.
EXAMPLE III
An embodiment of the present invention provides an electronic device 4, and as shown in fig. 4, the electronic device includes:
a round trip delay detection module 41, configured to periodically detect a round trip delay of the network;
a round trip delay adding window queue module 42, configured to add the detected round trip delay into a window queue;
a first difference calculating and storing module 43, configured to calculate and store a first difference between the detected round trip delay and the adjacent historical round trip delay;
a second difference calculation and storage module 44, configured to calculate and store a second difference between the first difference and an adjacent historical first difference; and
and a code rate adjusting module 45, configured to adjust a data transmission code rate according to the calculated second difference and the historical second difference.
Optionally, the round trip delay adding window queue module 42 is specifically configured to:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
Optionally, the code rate adjusting module 45 is specifically configured to:
and adjusting the data transmission code rate according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
Optionally, the code rate adjusting module 45 includes:
a value section obtaining sub-module 451, configured to obtain a value section where a ratio of the calculated second difference to a mean value of the plurality of historical second differences is located;
a code rate adjusting submodule 452, configured to adjust a data transmission code rate according to the value interval where the ratio is located;
wherein, the number of the value intervals is a plurality.
Optionally, the value interval obtaining submodule 451 is further configured to obtain the ratio set according to at least one of the detected round trip delay, the first difference, and the second difference.
Optionally, the code rate adjusting sub-module 452 is specifically configured to:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
Optionally, the apparatus 4 further includes:
and a code rate level setting module 46, configured to set a level of the data transmission code rate according to the discrete value of the code rate within the preset range.
The embodiment of the invention provides electronic equipment, which adjusts the data transmission code rate according to the calculated second difference and the historical second difference, so that the problem that adjustment strategies are difficult to decide due to the fact that packet loss reasons cannot be distinguished is solved, and meanwhile, the network state can be quickly and accurately estimated according to the calculated second difference and the historical second difference, so that the data transmission code rate is adjusted in time, the code rate adjustment efficiency is improved, the occurrence rate of network congestion is reduced, and the user experience is improved.
Example four
An embodiment of the present invention provides an electronic device 5, which is shown in fig. 5 and includes a network interface module 51, a memory 52, and a processor 53 connected to the network interface module 51 and the memory 52, where the memory 52 is used to store a set of program codes, and the processor 53 calls the program codes stored in the memory 52 to perform the following operations:
periodically detecting the round trip delay of a network and adding the detected round trip delay into a window queue;
calculating and storing a first difference between the detected round trip delay and the adjacent historical round trip delay;
calculating and storing a second difference value between the first difference value and the adjacent historical first difference values; and
and adjusting the data transmission code rate according to the calculated second difference and the historical second difference.
Wherein the network interface module 51 is configured to perform an operation of periodically detecting a round trip delay of the network.
Optionally, the processor 53 calls the program code stored in the memory 52 to perform the following operations:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
Optionally, the processor 53 calls the program code stored in the memory 52 to perform the following operations:
and adjusting the data transmission code rate according to the ratio of the calculated second difference value to the average value of the plurality of historical second difference values.
Optionally, the processor 53 calls the program code stored in the memory 52 to perform the following operations:
obtaining a value range in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
Optionally, the processor 53 calls the program code stored in the memory 52 to perform the following operations:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
Optionally, the processor 53 calls the program code stored in the memory 52 to perform the following operations:
setting the ratio according to at least one of the detected round trip delay, the first difference and the second difference.
Optionally, the processor 53 calls the program code stored in the memory 52 to perform the following operations:
and setting the grade of the data transmission code rate according to the discrete value of the code rate in a preset range.
The embodiment of the invention provides electronic equipment, which adjusts the data transmission code rate according to the calculated second difference and the historical second difference, so that the problem that adjustment strategies are difficult to decide due to the fact that packet loss reasons cannot be distinguished is solved, and meanwhile, the network state can be quickly and accurately estimated according to the calculated second difference and the historical second difference, so that the data transmission code rate is adjusted in time, the code rate adjustment efficiency is improved, the occurrence rate of network congestion is reduced, and the user experience is improved.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
It should be noted that the first, second, third, fourth, fifth and sixth embodiments of the present invention are only for distinguishing different values, and are not intended to be characteristic.
It should be noted that: in the above embodiment, when the electronic device executes the code rate adjustment method, only the division of the functional modules is taken as an example, and in practical application, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above-described functions. In addition, the electronic device and the code rate adjustment method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A method for rate adjustment, the method comprising:
periodically detecting the round trip delay of a network and adding the detected round trip delay into a window queue;
calculating and storing a first difference between the detected round trip delay and the adjacent historical round trip delay;
calculating and storing a second difference value between the first difference value and the adjacent historical first difference values; and
and adjusting the data transmission code rate according to the value interval in which the ratio of the calculated second difference value to the mean value of the plurality of historical second difference values is located.
2. The method of claim 1, wherein said adding the detected round trip delay to a window queue comprises:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
3. The method of claim 1, wherein the adjusting the data transmission code rate according to the value interval in which the ratio of the calculated second difference to the mean of the plurality of historical second differences is located comprises:
obtaining a value range in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
4. The method of claim 3, wherein the adjusting the data transmission code rate according to the value interval of the ratio comprises:
and reducing or increasing the grade of the data transmission code rate according to the value interval of the ratio.
5. The method of claim 1, further comprising:
and setting the grade of the data transmission code rate according to the discrete value of the code rate in a preset range.
6. An electronic device, characterized in that the device comprises:
a round trip delay detection module for periodically detecting the round trip delay of the network;
round-trip delay adding window queue module, which is used to add the detected round-trip delay into window queue;
a first difference calculating and storing module, configured to calculate and store a first difference between the detected round trip delay and an adjacent historical round trip delay;
the second difference calculating and storing module is used for calculating and storing a second difference between the first difference and the adjacent historical first differences; and
and the code rate adjusting module is used for adjusting the data transmission code rate according to the value interval in which the ratio of the calculated second difference value to the mean value of the plurality of historical second difference values is located.
7. The device of claim 6, wherein the round trip delay add window queue module is specifically configured to:
if the number of the round-trip time delays in the window queue is smaller than the preset number, placing the detected round-trip time delay at the tail end of the window queue;
if the number of the round-trip time delays in the window queue is equal to the preset number, deleting the round-trip time delay at the front end of the window queue, and placing the detected round-trip time delay at the tail end of the window queue;
the window queue is used for maintaining a preset number of round trip delays.
8. The apparatus of claim 6 or 7, wherein the code rate adjustment module comprises:
the value interval obtaining submodule is used for obtaining a value interval in which the ratio of the calculated second difference value to the average value of the plurality of historical second difference values is located;
the code rate adjusting submodule is used for adjusting the data transmission code rate according to the value interval of the ratio;
wherein, the number of the value intervals is a plurality.
CN201610147261.5A 2016-03-15 2016-03-15 Code rate adjusting method and electronic equipment Active CN107196863B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610147261.5A CN107196863B (en) 2016-03-15 2016-03-15 Code rate adjusting method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610147261.5A CN107196863B (en) 2016-03-15 2016-03-15 Code rate adjusting method and electronic equipment

Publications (2)

Publication Number Publication Date
CN107196863A CN107196863A (en) 2017-09-22
CN107196863B true CN107196863B (en) 2020-09-08

Family

ID=59870715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610147261.5A Active CN107196863B (en) 2016-03-15 2016-03-15 Code rate adjusting method and electronic equipment

Country Status (1)

Country Link
CN (1) CN107196863B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE542531C2 (en) 2017-12-22 2020-06-02 Epiroc Rock Drills Ab Controlling communication of a mining and/or construction machine
CN110191060A (en) * 2018-02-22 2019-08-30 中兴通讯股份有限公司 A kind of adjustment data packet sends method, apparatus, equipment and the system of code rate
CN109257252B (en) * 2018-09-12 2021-10-26 复旦大学 Method for judging network congestion state
CN110290428B (en) * 2019-06-26 2021-08-20 腾讯科技(深圳)有限公司 Congestion control method, device, terminal and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369980A (en) * 2008-09-26 2009-02-18 北京航空航天大学 Band width estimation method based on self-adapting sampling
CN101404622A (en) * 2008-11-07 2009-04-08 重庆邮电大学 Wireless internet congestion control method based on multi-path load balancing and controller thereof
CN102065468A (en) * 2009-11-13 2011-05-18 华为技术有限公司 Code rate adjustment method and server
CN102388584A (en) * 2011-09-22 2012-03-21 华为技术有限公司 Method and device for controlling congestion

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI353762B (en) * 2008-04-01 2011-12-01 Arcadyan Technology Corp Method for network transmission

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369980A (en) * 2008-09-26 2009-02-18 北京航空航天大学 Band width estimation method based on self-adapting sampling
CN101404622A (en) * 2008-11-07 2009-04-08 重庆邮电大学 Wireless internet congestion control method based on multi-path load balancing and controller thereof
CN102065468A (en) * 2009-11-13 2011-05-18 华为技术有限公司 Code rate adjustment method and server
CN102388584A (en) * 2011-09-22 2012-03-21 华为技术有限公司 Method and device for controlling congestion

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
TIMELY: RTT-based congestion control for the;Radhika Mittal,et al.;《ACM SIGCOMM Computer Communication Review》;20150821;第537-550页 *
基于自适应滤波的带宽测量方法研究;李国栋 等;《高技术通讯》;20111231;第21卷(第5期);第478-481页 *

Also Published As

Publication number Publication date
CN107196863A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
CN107196863B (en) Code rate adjusting method and electronic equipment
CN106330757B (en) Flow control method and device
CN102265543B (en) Method and device for correcting channel quality indication value
US20130034012A1 (en) Available bandwidth measurement system, transmission device, available bandwidth measurement method and recording medium
CN107920031B (en) Adaptive adjustment method and device for access bandwidth
EP3206426B1 (en) Inter-cell interference processing method, device and computer program product
EP3073686B1 (en) Rerouting sequence planning method and system
EP3200505B1 (en) Method and device for estimating uplink service waiting delay
EP2728812A1 (en) Method and device for leaky bucket speed-limitation
EP3148130B1 (en) Traffic flow switching method and device
CN103476074A (en) Method and equipment for resource preemption
CN104467939B (en) A kind of method and device for optimizing multiple antennas and receiving
CN114205266A (en) Network delay calculation method and device, electronic equipment and storage medium
CN111682975B (en) Network state prediction method, device, electronic equipment and storage medium
US20150312961A1 (en) Method and Apparatus for Determining Dormancy Timer Value
CN103458520A (en) Allocation method and device of uplink frequency domain resources
CN107645356B (en) Method and device for determining control channel unit aggregation level of PDCCH
CN110620939B (en) Network state determination method and device, electronic equipment and storage medium
CN107155192B (en) User experience quality assessment method and device
CN114698008A (en) Method, communication equipment, device and storage medium for determining queuing priority
US20150181456A1 (en) Frame transmission method and apparatus for controlling one-way delay
CN108271212B (en) Resource selection mechanism determination method and device
CN107295667B (en) Access resource adjusting method and device
WO2011100888A2 (en) Method and apparatus for scheduling transmission of data streams over a common communication link
JP2015050714A (en) Radio base station, control method of radio base station, and control program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210420

Address after: 2503, building 15, Longhai home, 5246 Yihai Avenue, Nanshan District, Shenzhen, Guangdong 518051

Patentee after: Xiao Feng

Address before: 200063, Shanghai, Putuo District, home on the first floor of the cross road, No. 28

Patentee before: Palmwin Information Technology (Shanghai) Co.,Ltd.