CN111970204B - Network flow control method and device - Google Patents
Network flow control method and device Download PDFInfo
- Publication number
- CN111970204B CN111970204B CN202010796293.4A CN202010796293A CN111970204B CN 111970204 B CN111970204 B CN 111970204B CN 202010796293 A CN202010796293 A CN 202010796293A CN 111970204 B CN111970204 B CN 111970204B
- Authority
- CN
- China
- Prior art keywords
- adjustment
- upper limit
- state
- sending rate
- messages
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 230000005540 biological transmission Effects 0.000 claims abstract description 41
- 230000003827 upregulation Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 8
- 230000001105 regulatory effect Effects 0.000 claims description 6
- 230000003828 downregulation Effects 0.000 claims description 5
- 230000001276 controlling effect Effects 0.000 claims description 2
- 238000004891 communication Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
- H04L47/2433—Allocation of priorities to traffic types
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides a network flow control method and a device, wherein the method comprises the following steps: acquiring the number of the buffer memory messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein, different adjustment states correspond to different adjustment amplitudes of the upper limit of the sending rate; according to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state; and transmitting the message according to the adjusted upper limit of the transmission rate. On one hand, the embodiment of the invention avoids air interface congestion, and the messages with high priority are maximally and preferentially passed through when the messages with multiple priority coexist, so as to ensure the QOS requirement of the messages with high priority; on the other hand, smooth transmission of the traffic is ensured.
Description
Technical Field
The present invention relates to the field of wireless communications technologies, and in particular, to a method and an apparatus for controlling network traffic.
Background
In wireless communication, when the traffic is too large, the actual network bandwidth cannot meet the demand. Because the priorities of various services are different, network smoothness during high-priority message transmission needs to be ensured at the moment, and unnecessary packet loss caused by congestion of an actual network is avoided.
Currently, there are many network flow control algorithms, such as a token-pass algorithm or a fair queuing algorithm. However, the existing network flow control algorithm has a certain limitation, and cannot well solve the problems, and cannot guarantee that the high-priority message passes through to the maximum extent.
Disclosure of Invention
The embodiment of the invention provides a network flow control method and device, which are used for solving the defects that packet loss is easily caused by network congestion in the prior art and the QOS requirement of a high-priority message cannot be ensured, and realizing the maximum passing of the high-priority message.
The embodiment of the invention provides a network flow control method, which comprises the following steps:
acquiring the number of the buffer memory messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit;
According to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state;
and transmitting the message according to the adjusted upper limit of the transmission rate.
According to the network flow control method of one embodiment of the present invention, the step of adjusting the upper limit of the sending rate and updating the adjustment state according to the number of the messages in the current period and the adjustment state includes:
Dividing the number of buffer memory messages in a drive queue which is received for many times in the current period into a plurality of groups according to the receiving time of the number of the messages, and calculating the average value of each group;
And adjusting the upper limit of the sending rate according to the average value of each group and the adjustment state, and updating the adjustment state.
According to one embodiment of the present invention, the step of adjusting the upper limit of the sending rate and updating the adjustment state according to the average value of each group and the adjustment state includes:
Comparing the average value of each group with the upper limit of the preset message number and the lower limit of the preset message number; wherein, the upper limit of the number of the preset messages is larger than the lower limit of the number of the preset messages;
Updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate; wherein the adjustment direction includes up-regulation and down-regulation, and when the adjustment direction is up-regulation, the upper limit of the sending rate is increased; when the adjustment direction is downward adjustment, the upper limit of the sending rate is reduced;
And adjusting the upper limit of the sending rate according to the adjusting amplitude corresponding to the updated adjusting state and the set adjusting direction.
According to the network flow control method of an embodiment of the present invention, the step of updating the adjustment state and setting the adjustment direction of the upper limit of the transmission rate according to the comparison result and the adjustment state includes:
If the adjustment state is a first state and the average value of each group is larger than the upper limit of the number of preset messages, updating the adjustment state into a second state, and setting the adjustment direction of the upper limit of the sending rate to be down-regulated;
If the adjustment state is the first state and the average value of each group is smaller than the lower limit of the preset message number, the adjustment state is updated to the second state, and the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
According to the network flow control method of an embodiment of the present invention, the step of updating the adjustment state and setting the adjustment direction of the upper limit of the transmission rate according to the comparison result and the adjustment state includes:
if the adjustment state is the second state and the average value of each group is larger than the upper limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as down-adjustment;
If the adjustment state is a big adjustment state and the average value of each group is smaller than the lower limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as up adjustment;
if the adjustment state is the second state, and the average value of each group is larger than or equal to the lower limit of the preset message number and smaller than or equal to the upper limit of the preset message number, updating the adjustment state into the third state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation; the adjustment amplitude corresponding to the third state is smaller than the adjustment amplitude corresponding to the second state.
According to the network flow control method of an embodiment of the present invention, the step of updating the adjustment state and setting the adjustment direction of the upper limit of the transmission rate according to the comparison result and the adjustment state includes:
If the adjustment state is a third state and the average value of all groups is larger than the upper limit of the number of preset messages, updating the adjustment state into the first state, and simultaneously adjusting the upper limit of the sending rate to be the average value of the upper limit of the sending rate adjusted by the latest preset times;
If the adjustment state is the third state and no average value exists in the average values of all the groups, which is greater than the preset upper limit of the number of messages, the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
According to the network flow control method of one embodiment of the present invention, the step of adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjustment state specifically includes:
Comparing the number of messages in the current period with a preset message number bottom limit; wherein, the preset message number bottom limit is smaller than or equal to the preset message number bottom limit;
and if the number of the messages in the current period is not smaller than the preset message number bottom limit, adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjustment state.
The embodiment of the invention also provides a network flow control device, which comprises:
the acquisition module is used for acquiring the number of the buffer messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit;
The adjusting module is used for adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjusting state and updating the adjusting state;
and the sending module is used for sending the message according to the adjusted upper limit of the sending rate.
The embodiment of the invention also provides electronic equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of any one of the network flow control methods when executing the program.
The embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the network flow control methods described above.
According to the network flow control method and device provided by the embodiment of the invention, the adjustment state of the upper limit of the sending rate and the number of the received messages are analyzed in real time, so that the upper limit of the sending rate is dynamically adjusted in real time, the adjustment state of the upper limit of the sending rate and the number of the received messages are simultaneously used as influencing factors for adjusting the upper limit of the sending rate, on one hand, air interface congestion is avoided, and when multiple priority messages exist simultaneously, the high priority messages are passed through to the greatest extent, and the QOS requirement of the high priority messages is ensured; on the other hand, smooth transmission of the traffic is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a network flow control method according to an embodiment of the present invention;
Fig. 2 is a complete flow diagram of a network flow control method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a network flow control device 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.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of 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 apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The following describes a network flow control method provided by an embodiment of the present invention with reference to fig. 1, where the method includes: s101, acquiring the number of cache messages in a drive queue in a current period and the adjustment state of the upper limit of the sending rate of the messages after updating in a previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit;
The embodiment comprises three modules, namely a drive monitoring module, a kernel data transmission module and a user data processing module. The drive monitoring module is responsible for storing the number of the messages cached in the drive queue and the sending rate of the current message at fixed time and then sending the messages to the virtual network interface. The kernel data transmission module receives data sent from the driver at intervals of preset time intervals through the virtual network interface, and then sends the data to the user data processing module of the user layer for further processing through internal communication. The user data processing module dynamically adjusts the upper limit of the sending rate according to the data received in real time. The virtual network interface obtains the relevant parameters of the driving packet at fixed time, and transmits the parameters to the user data processing module of the user layer, and the user data processing module analyzes and processes the data to further dynamically adjust the upper limit of the sending rate.
The adjustment state of the upper limit of the sending rate in the current period is the adjustment state of the upper limit of the sending rate updated in the previous period. The adjustment state reflects the adjustment amplitude of the upper limit of the transmission rate, and the adjustment amplitudes corresponding to different adjustment states are different.
S102, according to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state;
And updating and acquiring the adjustment state of the upper limit of the sending rate according to the number of messages in the current period and the adjustment state updated in the previous period, wherein the adjustment state comprises a first state, a second state and a third state. The first state is to adjust the upper limit of the sending rate so that the upper limit of the sending rate is in a stable state, which is also called a stable state, for example, the adjustment amplitude corresponding to the first state is determined according to the average value of the upper limit of the sending rate of the last times. The second state is a state in which the transmission speed upper limit is greatly adjusted, which is also called a large adjustment state, and therefore the adjustment amplitude corresponding to the second state is a large value set in advance. The third state is a state in which the transmission speed upper limit is adjusted by a small amount, which is also called a fine adjustment state, and therefore the adjustment range corresponding to the third state is a small value set in advance.
In this embodiment, the adjustment state of the upper limit of the sending rate and the number of received messages are used as the influencing factors for adjusting the upper limit of the sending rate. Even if the number of received messages is the same, the adjustment state is different, and the adjustment of the upper limit of the transmission rate and the update of the adjustment state are different. Under the condition that the adjustment states are the same, the number of received messages is different, and the adjustment of the upper limit of the sending rate and the update of the adjustment states are also different. Because the upper limit of the sending rate is adjusted by considering the number of the buffer messages, when the network is congested and the bandwidth of the high-priority message is smaller than the actual bandwidth, the packet loss of the high-priority message can not occur, thereby ensuring the QOS (Quality of Service ) requirement of the high-priority message. And the upper limit of the sending rate is adjusted by considering the adjustment state of the upper limit of the sending rate, so that smooth sending of the flow is ensured.
And S103, transmitting the message according to the adjusted upper limit of the transmission rate.
According to the embodiment, the message is sent according to the adjusted upper limit of the sending rate, when the service messages with different priorities are sent, the message with high priority is sent first, and the message with high priority can be sent at a faster sending rate according to the adjusted upper limit of the sending rate, so that QOS requirements of the message with high priority are guaranteed. And dynamically adjusting the upper limit of the sending rate under different flow sending environments by taking the updated adjusting state as the adjusting state of the upper limit of the sending rate of the next period, thereby realizing the control of the network flow.
According to the method, the device and the system, the adjustment state of the upper limit of the sending rate and the number of the received messages are analyzed in real time, so that the upper limit of the sending rate is dynamically adjusted in real time, the adjustment state of the upper limit of the sending rate and the number of the received messages are used as influence factors for adjusting the upper limit of the sending rate, on one hand, air interface congestion is avoided, and when multi-priority messages coexist, the high-priority messages pass through the high-priority messages to the greatest extent, and QOS requirements of the high-priority messages are guaranteed; on the other hand, smooth transmission of the traffic is ensured.
Based on the above embodiment, in this embodiment, the step of adjusting the upper limit of the sending rate and updating the adjustment state according to the number of the messages in the current period and the adjustment state includes: dividing the number of buffer memory messages in a drive queue which is received for many times in the current period into a plurality of groups according to the receiving time of the number of the messages, and calculating the average value of each group;
Specifically, the number of the buffer messages received every preset times is taken as a group in the current period, the average value of the buffer messages is calculated, and the average value of the preset group number is continuously calculated. For example, when the preset number of times is 3 and the preset number of groups is 3, the number of buffer messages received for the 1 st, 2 nd and 3 rd times is taken as a group, the number of buffer messages received for the 4 th, 5 th and 6 th times is taken as a group, the number of buffer messages received for the 7 th, 8 th and 9 th times is taken as a group, and the average value of each group is calculated. The present embodiment is not limited to the set values of the preset number of times and the preset number of groups.
And adjusting the upper limit of the sending rate according to the average value of each group and the adjustment state, and updating the adjustment state.
According to the method, the average value of the number of each group of buffer messages in the current period is calculated, the upper limit of the sending rate is adjusted according to the average value of the number of each group of buffer messages and the adjustment state, the adjustment state is updated, the upper limit of the sending rate is not greatly adjusted due to the fact that the number of the buffer messages is suddenly increased or reduced at one moment, the adjustment of the upper limit of the sending rate is more stable, and smooth sending of flow is guaranteed.
Based on the above embodiment, in this embodiment, the step of adjusting the upper limit of the sending rate and updating the adjustment state according to the average value of each group and the adjustment state includes: comparing the average value of each group with the upper limit of the preset message number and the lower limit of the preset message number; wherein, the upper limit of the number of the preset messages is larger than the lower limit of the number of the preset messages; updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate; wherein the adjustment direction includes up-regulation and down-regulation, and when the adjustment direction is up-regulation, the upper limit of the sending rate is increased; when the adjustment direction is downward adjustment, the upper limit of the sending rate is reduced; and adjusting the upper limit of the sending rate according to the adjusting amplitude corresponding to the updated adjusting state and the set adjusting direction.
The adjusting direction comprises up-adjustment and down-adjustment, and the adjusting state comprises a stable state, a big adjusting state and a fine adjusting state. And if the adjustment state is not updated, adjusting the upper limit of the sending rate according to the adjustment state of the current period and the set adjustment direction. The comparison results are different, and the adjustment directions are different. The updated adjustment state is different, and even if the adjustment direction is the same, the adjustment value may be different. Therefore, in this embodiment, the updated adjustment state and the set adjustment direction are integrated to adjust the upper limit of the sending rate, so that smooth sending of the traffic is ensured while air interface congestion is avoided.
On the basis of the above embodiment, as shown in fig. 2, in this embodiment, the step of updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the transmission rate upper limit includes: if the adjustment state is a first state and the average value of each group is larger than the upper limit of the number of preset messages, updating the adjustment state into a second state, and setting the adjustment direction of the upper limit of the sending rate to be down-regulated;
When the updated adjustment state is the first state and the set adjustment direction is the down adjustment, the upper limit of the sending rate is greatly reduced.
If the adjustment state is the first state and the average value of each group is smaller than the lower limit of the preset message number, the adjustment state is updated to the second state, and the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
When the updated adjustment state is the second state and the set adjustment direction is up-regulated, the upper limit of the sending rate is greatly increased.
If the adjustment state is the first state and the average value of each group is between the lower limit of the preset number of messages and the upper limit of the preset number of messages, the upper limit of the sending rate is not processed. Returning to the step of receiving the number of the buffer messages, and iteratively adjusting the upper limit of the sending rate according to the number of the buffer messages which are newly received and the adjustment state.
On the basis of the above embodiment, as shown in fig. 2, in this embodiment, the step of updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the transmission rate upper limit includes: if the adjustment state is the second state and the average value of each group is larger than the upper limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as down-adjustment;
The average value of each group is larger than the upper limit of the preset number of messages, so that the upper limit of the sending rate needs to be greatly adjusted, the adjusting state is kept unchanged as the second state, the adjusting direction is set to be downwards adjusted, and the upper limit of the sending rate is greatly reduced.
If the adjustment state is the second state and the average value of each group is smaller than the lower limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as up-adjustment;
The average value of each group is smaller than the upper limit of the preset number of messages, so that the upper limit of the sending rate needs to be greatly adjusted, the adjusting state is kept unchanged as the second state, the adjusting direction is set to be adjusted upwards, and the upper limit of the sending rate is greatly improved.
If the adjustment state is the second state, and the average value of each group is larger than or equal to the lower limit of the preset message number and smaller than or equal to the upper limit of the preset message number, updating the adjustment state into the third state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation; the adjustment amplitude corresponding to the third state is smaller than the adjustment amplitude corresponding to the second state.
Since the adjustment state is updated to the third state and the adjustment direction is set to be adjusted upward, the upper limit of the transmission rate is increased by a small margin.
On the basis of the above embodiment, as shown in fig. 2, in this embodiment, the step of updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the transmission rate upper limit includes: if the adjustment state is a third state and the average value of all groups is larger than the upper limit of the number of preset messages, updating the adjustment state into the first state, and simultaneously adjusting the upper limit of the sending rate to be the average value of the upper limit of the sending rate adjusted by the latest preset times; such as the average of the last two adjusted transmit rate upper limits;
If the adjustment state is the third state and no average value exists in the average values of all the groups, which is greater than the preset upper limit of the number of messages, the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
Since the adjustment state is updated to the third state and the adjustment direction is set to be adjusted upward, the upper limit of the transmission rate is increased by a small margin.
Based on the above embodiment, in this embodiment, the step of adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjustment state specifically includes: comparing the number of messages in the current period with a preset message number bottom limit; wherein, the preset message number bottom limit is smaller than or equal to the preset message number bottom limit; and if the number of all the messages in the current period is not less than the preset message number bottom limit, adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjustment state.
Specifically, as shown in fig. 2, when the user data processing module is started, configuration information including a start value of a transmission rate upper limit, an adjustment state, an adjustment direction, and state information to be stored in an adjustment process is initialized. Then a timer is started to detect the wireless connection state and the real-time data message sending rate at regular time. When a disconnection of the wireless connection is detected, configuration information is initialized. And initializing configuration information when the message sending rate is detected to be lower than the lower limit.
When the user data processing module receives the number of messages, judging whether the number of the received queue buffer messages is always lower than the preset message number bottom limit from the beginning. If yes, indicating that the current link is idle, and setting a sending rate upper limit initial value according to the current connection rate. If the number of the queue buffer messages is higher than the preset message number bottom limit, the current sending rate upper limit is adjusted according to the number of the queue buffer messages and the adjustment state.
The network flow control device provided by the embodiment of the present invention is described below, and the network flow control device described below and the network flow control method described above may be referred to correspondingly.
As shown in fig. 3, the network flow control device provided in this embodiment includes an obtaining module 301, an adjusting module 302, and a sending module 303, where:
the obtaining module 301 is configured to obtain the number of buffered packets in the drive queue in the current period and an adjustment state of an upper limit of a sending rate of the packets after updating in a previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit;
The adjustment state of the upper limit of the sending rate in the current period is the adjustment state of the upper limit of the sending rate updated in the previous period. The adjustment states of the transmission rate upper limit include a steady state, a macro-adjustment state, and a fine-adjustment state. The adjustment state reflects the adjustment amplitude of the upper limit of the transmission rate, and the adjustment amplitudes corresponding to different adjustment states are different.
The adjustment module 302 is configured to adjust the upper limit of the sending rate according to the number of the messages in the current period and an adjustment state, and update the adjustment state;
In this embodiment, the adjustment state of the upper limit of the sending rate and the number of received messages are used as the influencing factors for adjusting the upper limit of the sending rate. Even if the number of received messages is the same, the adjustment state is different, and the adjustment of the upper limit of the transmission rate and the update of the adjustment state are different. Under the condition that the adjustment states are the same, the number of received messages is different, and the adjustment of the upper limit of the sending rate and the update of the adjustment states are also different.
The sending module 303 is configured to send the message according to the adjusted upper limit of the sending rate.
And updating and acquiring the adjustment state of the upper limit of the sending rate according to the number of messages in the current period and the adjustment state updated in the previous period, wherein the adjustment state comprises a first state, a second state and a third state. The first state is to adjust the upper limit of the sending rate so that the upper limit of the sending rate is in a stable state, which is also called a stable state, for example, the adjustment amplitude corresponding to the first state is determined according to the average value of the upper limit of the sending rate of the last times. The second state is a state in which the transmission speed upper limit is greatly adjusted, which is also called a large adjustment state, and therefore the adjustment amplitude corresponding to the second state is a large value set in advance. The third state is a state in which the transmission speed upper limit is adjusted by a small amount, which is also called a fine adjustment state, and therefore the adjustment range corresponding to the third state is a small value set in advance.
The sending module 303 sends the message according to the adjusted sending rate upper limit, when sending the service messages with different priorities, the message with high priority is sent first, and the message with high priority can be sent at a faster sending rate according to the adjusted sending rate upper limit, so as to ensure the QOS requirement of the message with high priority. And dynamically adjusting the upper limit of the sending rate under different flow sending environments by taking the updated adjusting state as the adjusting state of the upper limit of the sending rate of the next period, thereby realizing the control of the network flow.
According to the method, the device and the system, the adjustment state of the upper limit of the sending rate and the number of the received messages are analyzed in real time, so that the upper limit of the sending rate is dynamically adjusted in real time, the adjustment state of the upper limit of the sending rate and the number of the received messages are used as influence factors for adjusting the upper limit of the sending rate, on one hand, air interface congestion is avoided, and when multi-priority messages coexist, the high-priority messages pass through the high-priority messages to the greatest extent, and QOS requirements of the high-priority messages are guaranteed; on the other hand, smooth transmission of the traffic is ensured.
On the basis of the above embodiment, the adjustment module in this embodiment includes a calculation sub-module and an adjustment sub-module; the calculation submodule is used for dividing the number of the buffer messages in the drive queue which are received for many times in the current period into a plurality of groups according to the receiving time of the number of the messages, and calculating the average value of each group; and the adjustment submodule is used for adjusting the upper limit of the sending rate according to the average value of each group and the adjustment state and updating the adjustment state.
On the basis of the above embodiment, the adjusting submodule in this embodiment is specifically configured to: comparing the average value of each group with the upper limit of the preset message number and the lower limit of the preset message number; wherein, the upper limit of the number of the preset messages is larger than the lower limit of the number of the preset messages; updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate; wherein the adjustment direction includes up-regulation and down-regulation, and when the adjustment direction is up-regulation, the upper limit of the sending rate is increased; when the adjustment direction is downward adjustment, the upper limit of the sending rate is reduced; and adjusting the upper limit of the sending rate according to the adjusting amplitude corresponding to the updated adjusting state and the set adjusting direction.
On the basis of the above embodiment, the adjusting submodule in this embodiment is specifically configured to: if the adjustment state is a first state and the average value of each group is larger than the upper limit of the number of preset messages, updating the adjustment state into a second state, and setting the adjustment direction of the upper limit of the sending rate to be down-regulated; if the adjustment state is the first state and the average value of each group is smaller than the lower limit of the preset message number, the adjustment state is updated to the second state, and the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
On the basis of the above embodiment, the adjusting submodule in this embodiment is specifically configured to: if the adjustment state is a first state and the average value of each group is larger than the upper limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as down-adjustment; if the adjustment state is the second state and the average value of each group is smaller than the lower limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as up-adjustment; if the adjustment state is the second state, and the average value of each group is larger than or equal to the lower limit of the preset message number and smaller than or equal to the upper limit of the preset message number, updating the adjustment state into the third state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation; the adjustment amplitude corresponding to the third state is smaller than the adjustment amplitude corresponding to the second state.
On the basis of the above embodiment, the adjusting submodule in this embodiment is specifically configured to: if the adjustment state is a third state and the average value of all groups is larger than the upper limit of the number of preset messages, updating the adjustment state into the first state, and simultaneously adjusting the upper limit of the sending rate to be the average value of the upper limit of the sending rate adjusted by the latest preset times; if the adjustment state is the third state and no average value exists in the average values of all the groups, which is greater than the preset upper limit of the number of messages, the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
On the basis of the above embodiment, the adjusting module in this embodiment is specifically configured to: comparing the number of messages in the current period with a preset message number bottom limit; wherein, the preset message number bottom limit is smaller than or equal to the preset message number bottom limit; and if the number of all the messages in the current period is not less than the preset message number bottom limit, adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjustment state.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: processor 401, communication interface (Communications Interface) 402, memory 403 and communication bus 404, wherein processor 401, communication interface 402 and memory 403 complete communication with each other through communication bus 404. The processor 401 may invoke logic instructions in the memory 403 to perform a network flow control method comprising: acquiring the number of the buffer memory messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein, different adjustment states correspond to different adjustment amplitudes of the upper limit of the sending rate; according to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state; and transmitting the message according to the adjusted upper limit of the transmission rate.
Further, the logic instructions in the memory 403 may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention further provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the network flow control method provided by the above-described method embodiments, the method comprising: acquiring the number of the buffer memory messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit; according to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state; and transmitting the message according to the adjusted upper limit of the transmission rate.
In yet another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, is implemented to perform the network traffic control method provided in the above embodiments, the method comprising: acquiring the number of the buffer memory messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit; according to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state; and transmitting the message according to the adjusted upper limit of the transmission rate.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (5)
1. A method for controlling network traffic, comprising:
Acquiring the number of messages cached in a drive queue in a current period and the adjustment state of the upper limit of the sending rate of the messages after updating in a previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit;
According to the number of messages in the current period and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state;
Transmitting the message according to the adjusted upper limit of the transmission rate;
The step of adjusting the upper limit of the sending rate and updating the adjustment state according to the number of the messages in the current period and the adjustment state comprises the following steps:
Dividing the number of buffer memory messages in a drive queue which is received for many times in the current period into a plurality of groups according to the receiving time of the number of the messages, and calculating the average value of each group;
According to the average value of each group and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state;
the step of adjusting the upper limit of the sending rate and updating the adjustment state according to the average value of each group and the adjustment state comprises the following steps:
Comparing the average value of each group with the upper limit of the preset message number and the lower limit of the preset message number; wherein, the upper limit of the number of the preset messages is larger than the lower limit of the number of the preset messages;
Updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate; wherein the adjustment direction includes up-regulation and down-regulation, and when the adjustment direction is up-regulation, the upper limit of the sending rate is increased; when the adjustment direction is downward adjustment, the upper limit of the sending rate is reduced;
adjusting the upper limit of the sending rate according to the adjusting amplitude corresponding to the updated adjusting state and the set adjusting direction;
Updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate comprises the following steps:
If the adjustment state is a first state and the average value of each group is larger than the upper limit of the number of preset messages, updating the adjustment state into a second state, and setting the adjustment direction of the upper limit of the sending rate to be down-regulated;
If the adjustment state is a first state and the average value of each group is smaller than the lower limit of the preset message number, updating the adjustment state to a second state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation;
if the adjustment state is the second state and the average value of each group is larger than the upper limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as down-adjustment;
If the adjustment state is the second state and the average value of each group is smaller than the lower limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as up-adjustment;
If the adjustment state is the second state, and the average value of each group is larger than or equal to the lower limit of the preset message number and smaller than or equal to the upper limit of the preset message number, updating the adjustment state into the third state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation; wherein, the adjustment amplitude corresponding to the third state is smaller than the adjustment amplitude corresponding to the second state;
If the adjustment state is a third state and the average value of all groups is larger than the upper limit of the number of preset messages, updating the adjustment state into the first state, and simultaneously adjusting the upper limit of the sending rate to be the average value of the upper limit of the sending rate adjusted by the latest preset times;
If the adjustment state is the third state and no average value exists in the average values of all the groups, which is greater than the preset upper limit of the number of messages, the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
2. The network traffic control method according to claim 1, wherein the step of adjusting the upper limit of the transmission rate according to the number of messages in the current period and the adjustment state specifically includes:
Comparing the number of messages in the current period with a preset message number bottom limit; wherein, the preset message number bottom limit is smaller than or equal to the preset message number bottom limit;
and if the number of the messages in the current period is not smaller than the preset message number bottom limit, adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjustment state.
3. A network flow control device, comprising:
the acquisition module is used for acquiring the number of the buffer messages in the drive queue in the current period and the adjustment state of the upper limit of the sending rate of the messages after the update in the previous period; wherein different adjustment states correspond to different adjustment amplitudes of the transmission rate upper limit;
The adjusting module is used for adjusting the upper limit of the sending rate according to the number of the messages in the current period and the adjusting state and updating the adjusting state;
the sending module is used for sending the message according to the adjusted upper limit of the sending rate;
The step of adjusting the upper limit of the sending rate and updating the adjustment state according to the number of the messages in the current period and the adjustment state comprises the following steps:
Dividing the number of buffer memory messages in a drive queue which is received for many times in the current period into a plurality of groups according to the receiving time of the number of the messages, and calculating the average value of each group;
According to the average value of each group and the adjustment state, adjusting the upper limit of the sending rate, and updating the adjustment state;
the step of adjusting the upper limit of the sending rate and updating the adjustment state according to the average value of each group and the adjustment state comprises the following steps:
Comparing the average value of each group with the upper limit of the preset message number and the lower limit of the preset message number; wherein, the upper limit of the number of the preset messages is larger than the lower limit of the number of the preset messages;
Updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate; wherein the adjustment direction includes up-regulation and down-regulation, and when the adjustment direction is up-regulation, the upper limit of the sending rate is increased; when the adjustment direction is downward adjustment, the upper limit of the sending rate is reduced;
adjusting the upper limit of the sending rate according to the adjusting amplitude corresponding to the updated adjusting state and the set adjusting direction;
Updating the adjustment state according to the comparison result and the adjustment state, and setting the adjustment direction of the upper limit of the sending rate comprises the following steps:
If the adjustment state is a first state and the average value of each group is larger than the upper limit of the number of preset messages, updating the adjustment state into a second state, and setting the adjustment direction of the upper limit of the sending rate to be down-regulated;
If the adjustment state is a first state and the average value of each group is smaller than the lower limit of the preset message number, updating the adjustment state to a second state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation;
if the adjustment state is the second state and the average value of each group is larger than the upper limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as down-adjustment;
If the adjustment state is the second state and the average value of each group is smaller than the lower limit of the preset message number, setting the adjustment direction of the upper limit of the sending rate as up-adjustment;
If the adjustment state is the second state, and the average value of each group is larger than or equal to the lower limit of the preset message number and smaller than or equal to the upper limit of the preset message number, updating the adjustment state into the third state, and setting the adjustment direction of the upper limit of the sending rate to be up-regulation; wherein, the adjustment amplitude corresponding to the third state is smaller than the adjustment amplitude corresponding to the second state;
If the adjustment state is a third state and the average value of all groups is larger than the upper limit of the number of preset messages, updating the adjustment state into the first state, and simultaneously adjusting the upper limit of the sending rate to be the average value of the upper limit of the sending rate adjusted by the latest preset times;
If the adjustment state is the third state and no average value exists in the average values of all the groups, which is greater than the preset upper limit of the number of messages, the adjustment direction of the upper limit of the sending rate is set to be up-adjusted.
4. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the network flow control method according to claim 1 or 2 when executing the program.
5. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the network flow control method according to claim 1 or 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010796293.4A CN111970204B (en) | 2020-08-10 | 2020-08-10 | Network flow control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010796293.4A CN111970204B (en) | 2020-08-10 | 2020-08-10 | Network flow control method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111970204A CN111970204A (en) | 2020-11-20 |
CN111970204B true CN111970204B (en) | 2024-07-12 |
Family
ID=73365379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010796293.4A Active CN111970204B (en) | 2020-08-10 | 2020-08-10 | Network flow control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111970204B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113098785B (en) * | 2021-03-31 | 2022-05-27 | 新华三信息安全技术有限公司 | Message processing method and device |
CN113543209B (en) * | 2021-06-24 | 2022-05-06 | 北京邮电大学 | Token scheduling-based congestion control method and device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101674242A (en) * | 2009-10-13 | 2010-03-17 | 福建星网锐捷网络有限公司 | Service message sending control method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7500009B2 (en) * | 2004-02-11 | 2009-03-03 | Cisco Technology, Inc. | Rate computations of particular use in scheduling activities or items such as the sending of packets |
CN101277253B (en) * | 2007-03-30 | 2011-06-08 | 迈普通信技术股份有限公司 | Method for controlling packet channel of master-slave mode multiprocessor system |
-
2020
- 2020-08-10 CN CN202010796293.4A patent/CN111970204B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101674242A (en) * | 2009-10-13 | 2010-03-17 | 福建星网锐捷网络有限公司 | Service message sending control method and device |
Also Published As
Publication number | Publication date |
---|---|
CN111970204A (en) | 2020-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8081569B2 (en) | Dynamic adjustment of connection setup request parameters | |
CN111970204B (en) | Network flow control method and device | |
EP3961981A1 (en) | Method and device for congestion control, communication network, and computer storage medium | |
US9264377B2 (en) | Controlling data transmission over a network | |
CN110784418B (en) | Data sending method and system based on time delay constraint | |
CN112995048B (en) | Blocking control and scheduling fusion method of data center network and terminal equipment | |
CN113315720B (en) | Data flow control method, system and equipment | |
US11729241B2 (en) | Maximum sustainable encoding bit rates for video downloads | |
CN111343097B (en) | Link load balancing method and device, electronic equipment and storage medium | |
CN111835649A (en) | Data sending method, device and related components | |
WO2020090474A1 (en) | Packet forwarding apparatus, method and program | |
WO2018072551A1 (en) | Method and device for service processing | |
CN103974443B (en) | Distributed channel connection control method and equipment | |
US10819582B2 (en) | Traffic optimization device and traffic optimization method | |
JP2020022023A (en) | Packet transfer device, method, and program | |
CN115514710B (en) | Weak connection flow management and control method based on self-adaptive sliding window | |
CN115175245A (en) | Method, device and equipment for adjusting data throughput and storage medium | |
CN105490964A (en) | Service quality processing method and apparatus | |
CN112437494A (en) | Resource allocation method and device | |
CN114567566B (en) | Message processing method, device, terminal equipment and storage medium | |
US20220053373A1 (en) | Communication apparatus, communication method, and program | |
CN118138530A (en) | Network active congestion control method and device, electronic equipment and storage medium | |
CN117579576A (en) | Data transmission method, device, electronic equipment and computer storage medium | |
CN118158164A (en) | Control method, device and medium for network service quality | |
CN116112733A (en) | Screen projection method, device, electronic equipment and storage medium |
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 |