CN103929366B - Flow control methods, device and equipment - Google Patents

Flow control methods, device and equipment Download PDF

Info

Publication number
CN103929366B
CN103929366B CN201410132180.9A CN201410132180A CN103929366B CN 103929366 B CN103929366 B CN 103929366B CN 201410132180 A CN201410132180 A CN 201410132180A CN 103929366 B CN103929366 B CN 103929366B
Authority
CN
China
Prior art keywords
token
formation speed
interval
adjustment
node
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
CN201410132180.9A
Other languages
Chinese (zh)
Other versions
CN103929366A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410132180.9A priority Critical patent/CN103929366B/en
Publication of CN103929366A publication Critical patent/CN103929366A/en
Application granted granted Critical
Publication of CN103929366B publication Critical patent/CN103929366B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The invention discloses a kind of flow control methods, device and equipment, belong to network technology and technical field of memory.Methods described includes:Obtain the i-th 1 token formation speeds and the i-th 1 total token depletion rates;Determine that i-th adjustment is interval according to the i-th 1 token formation speeds, the i-th 1 total token depletion rates and default stream control target, according to i-th adjustment i-th token formation speed of interval generation;I-th token formation speed is sent to each node that object is accessed, the i-th 1 token formation speeds are updated to i-th token formation speed by each node accessed so as to object, and flow control is carried out according to i-th token formation speed.Described device includes:First acquisition module, the first generation module and the first sending module.The request that the present invention solves the larger node processing of token formation speed is more, causes the problem of the load imbalance between each node, has reached guiding and has been supported between node effect in a balanced way.

Description

Flow control methods, device and equipment
Technical field
The present invention relates to network technology and technical field of memory, more particularly to a kind of flow control methods, device and equipment.
Background technology
In a distributed system, a user can simultaneously pass through different node visit Internet resources, different users Can also be by identical node visit Internet resources, and the disposal ability of the request that Internet resources send to user is limited, because This to the flowing of access of user, it is necessary to be controlled.Because user is, by node visit Internet resources, to therefore, it can For the user of each access sets a limiter of speed on node, the limiter of speed is used to enter the user in the flowing of access of the node Row control.When user accesses multiple nodes simultaneously, in addition it is also necessary to coordinate the user's to set global coordination device in node The work of each limiter of speed, to ensure that user will not be exceeded in the total flow of all nodes.One global coordination device manages one Limiter of speed on all nodes of user.
When flow control is carried out, limiter of speed is that user sets a token bucket, and the token bucket is generated with certain speed and made Board, node is processed the request that user sends after token is got, therefore, limiter of speed can be generated by controlling token Speed come control to ask processing speed, reach control flow purpose.Specifically, global coordination device can be retrieved as user The performance parameter of the user in the stream control target of setting and each node, calculates respectively according to stream control target and each performance parameter Go out the token formation speed of each node, the token formation speed of each node is sent respectively to corresponding node, so as to each Individual node controls flow according to the token formation speed for receiving.Wherein, stream control target is user on all nodes for accessing Maximum token formation speed sum;The token formation speed of performance parameter including node, token depletion rate, request queue Historical data of queue depth and the node etc..
At least there is following defect in the prior art:
The request of the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each Load imbalance between individual node.
The content of the invention
In order to the request for solving the larger node processing of token formation speed is generally more so that the load of the node compared with Weight, cause the problem of the load imbalance between each node, the embodiment of the invention provides a kind of flow control methods, device and Equipment.The technical scheme is as follows:
In a first aspect, the embodiment of the invention provides a kind of flow control methods, methods described includes:
The i-th -1 token formation speed and the i-th -1 total token depletion rate are obtained, the token formation speed is for right Token of all nodes that the formation speed and the object of the token set as the node that is accessed are accessed in synchronization Formation speed is identical, and total token depletion rate is that all nodes that the object is accessed are processing what the object sent The speed sum of token, i >=2, and i are consumed during request for natural number;
According to the i-th -1 token formation speed, described the i-th -1 total token depletion rate and default stream control target Determine that i-th adjustment is interval, according to described i-th adjustment i-th token formation speed of interval generation;
I-th token formation speed is sent to each node that the object is accessed, so as to the object institute The i-th -1 token formation speed is updated to i-th token formation speed by each node for accessing, according to described the I token formation speed carries out flow control.
It is described according to the i-th -1 token formation speed, institute in the first possible implementation of first aspect State the i-th -1 total token depletion rate and default stream control target determines that i-th adjustment is interval, according to described i-th adjustment area Between generate i-th token formation speed, including:
Described the i-th -1 total token depletion rate is subtracted into the stream control target and obtains the i-th -1 difference, by described i-th - 1 difference obtains the i-th -1 ratio, relatively more described the i-th -1 ratio and default change threshold divided by the stream control target;
If the absolute value of the i-th -1 ratio is more than the change threshold and the i-th -1 ratio is just basis The i-th -1 token formation speed determines that i-th adjustment is interval, generates i-th token formation speed.
With reference to the first possible implementation of first aspect, in second possible implementation of first aspect In, after comparing the i-th -1 ratio and default change threshold, also include:
If the absolute value of the i-th -1 ratio is more than the change threshold and the i-th -1 ratio is negative, by institute The numerical value for stating i-th token formation speed is set to the maximum token formation speed of node configuration that the object accessed Numerical value;
If the absolute value of the i-th -1 ratio is less than the change threshold, by i-th token formation speed Numerical value is arranged to the numerical value of the i-th -1 token formation speed.
With reference to the first possible implementation of first aspect, in the third possible implementation of first aspect In, it is described to determine that i-th adjustment is interval according to the i-th -1 token formation speed, generate i-th token generation Speed, including:
The numerical value of the minimum token formation speed of the node configuration that will be accessed by the object is defined as i-th tune Minimum value between main plot, the interval maximum of i-th adjustment is defined as by the numerical value of the i-th -1 token formation speed Value;
I-th token formation speed will be set to from described i-th adjustment interval by an optional numerical value Numerical value.
With reference to the third possible implementation of first aspect, in the 4th kind of possible implementation of first aspect In, it is described that i-th token formation speed is sent to after each node that the object is accessed, also include:
Obtain i-th token formation speed and i-th total token depletion rate;
Described i-th total token depletion rate is subtracted into the stream control target and obtains i-th difference, it is poor by described i-th Value obtains i-th ratio, relatively more described i-th ratio and the change threshold divided by the stream control target;
If the absolute value of i-th ratio more than the change threshold and i-th ratio for just, by described the The i interval minimum value of adjustment is defined as the interval minimum value of i+1 adjustment, by the number of i-th token formation speed Value is defined as the interval maximum of the i+1 adjustment;If i-th ratio is more than the change threshold and described i-th Individual ratio is negative, then the numerical value of i-th token formation speed is defined as into the interval minimum value of i+1 adjustment, by institute State the interval maximum of i-th adjustment and be defined as the interval maximum of the i+1 adjustment;
I+1 token formation speed will be set to from the i+1 adjustment interval by an optional numerical value Numerical value;
The i+1 token formation speed is sent to each node that the object is accessed, so as to the object I-th token formation speed is updated to the i+1 token formation speed by each node for being accessed, according to described I+1 token number formation speed carries out flow control.
It is possible with reference to the first possible implementation of first aspect or first aspect or second of first aspect The third possible implementation of implementation or first aspect or the 4th kind of possible implementation of first aspect, In 5th kind of possible implementation of one side, the i-th -1 token formation speed of the acquisition and the i-th -1 total token are consumed Before speed, also include:
The minimum token formation speed and maximum token of the node that the object is accessed are set according to the stream control target Formation speed;
The numerical value of the minimum token formation speed is defined as the i-th -1 interval minimum value of adjustment, by the maximum The numerical value of token formation speed is defined as the interval maximum of the i-th -1 adjustment;
The i-th -1 token generation will be set to from described the i-th -1 adjustment interval by an optional numerical value The numerical value of speed;
The i-th -1 token formation speed is sent to each node that the object is accessed, so as to the object Each node for being accessed carries out flow control according to the i-th -1 token formation speed.
Second aspect, the embodiment of the invention provides a kind of volume control device, and described device includes:
First acquisition module, it is described for obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate Token formation speed is all sections for being accessed of formation speed and the object of the token that the node accessed by object is set Point is identical in the token formation speed of synchronization, and total token depletion rate is that all nodes that the object is accessed exist The speed sum of token, i >=2 are consumed during the request for processing the object transmission, and i is natural number;
First generation module, for got according to first acquisition module the i-th -1 token formation speed, Described the i-th -1 total token depletion rate and default stream control target determine that i-th adjustment is interval, according to described i-th adjustment I-th token formation speed of interval generation;
First sending module, for i-th token formation speed that first generation module is generated to be sent to Each node that the object is accessed, so that each node that the object is accessed generates the i-th -1 token Speed is updated to i-th token formation speed, and flow control is carried out according to i-th token formation speed.
In the first possible implementation of second aspect, first generation module, including:
Data comparing unit, i-th -1 is obtained for described the i-th -1 total token depletion rate to be subtracted into the stream control target Individual difference, the i-th -1 ratio is obtained by the i-th -1 difference divided by the stream control target, relatively more described the i-th -1 ratio with Default change threshold;
First generation unit, the absolute value for relatively drawing the i-th -1 ratio in the data comparing unit is big It is timing in the change threshold and the i-th -1 ratio, described i-th is determined according to the i-th -1 token formation speed Individual adjustment is interval, generates i-th token formation speed.
With reference to the first possible implementation of second aspect, in second possible implementation of second aspect In, first generation module also includes:
Second generation unit, the absolute value for relatively drawing the i-th -1 ratio in the data comparing unit is big In the change threshold and the i-th -1 ratio for it is negative when, the numerical value of i-th token formation speed is set to institute State the numerical value of the maximum token formation speed of the node configuration that object is accessed;
3rd generation unit, the absolute value for relatively drawing the i-th -1 ratio in the data comparing unit is small When the change threshold, the numerical value of i-th token formation speed is arranged to the i-th -1 token formation speed Numerical value.
With reference to the first possible implementation of second aspect, in the third possible implementation of second aspect In, first generation unit, the minimum token formation speed that the node specifically for will be accessed by the object is configured Numerical value is defined as the interval minimum value of i-th adjustment, the numerical value of the i-th -1 token formation speed is defined as described The interval maximum of i-th adjustment;Described i-th will be set to from described i-th adjustment interval by an optional numerical value The numerical value of individual token formation speed.
With reference to the third possible implementation of second aspect, in the 4th kind of possible implementation of second aspect In, described device also includes:
Second acquisition module, it is described right to be sent to i-th token formation speed for first sending module As after each node for being accessed, obtaining i-th token formation speed and i-th total token depletion rate;
Data comparison module, described i-th total token depletion rate for second acquisition module to be got subtracts Go the stream control target to obtain i-th difference, i-th difference is obtained into i-th ratio divided by the stream control target, compare I-th ratio and the change threshold;
Interval determination module, the absolute value for relatively drawing i-th ratio in the data comparison module is more than The change threshold and i-th ratio are timing, and the described i-th interval minimum value of adjustment is defined as into i+1 tune Minimum value between main plot, the interval maximum of the i+1 adjustment is defined as by the numerical value of i-th token formation speed Value;Relatively draw the absolute value of i-th ratio more than the change threshold and described i-th in the data comparison module When ratio is to bear, the numerical value of i-th token formation speed is defined as the interval minimum value of i+1 adjustment, will be described I-th interval maximum of adjustment is defined as the interval maximum of the i+1 adjustment;
Second generation module, for any in the i+1 adjustment interval that will determine from the interval determination module One numerical value of selection is set to the numerical value of the i+1 token formation speed;
Second sending module, the i+1 token formation speed for second generation module to be generated sends To each node that the object is accessed, so that i-th token is generated speed by each node that the object is accessed Degree is updated to the i+1 token formation speed, and flow control is carried out according to the i+1 token number formation speed.
It is possible with reference to the first possible implementation of second aspect or second aspect or second of second aspect The third possible implementation of implementation or second aspect or the 4th kind of possible implementation of second aspect, In 5th kind of possible implementation of two aspects, described device also includes:
Speed setup module, the i-th -1 token formation speed and the i-th -1 total order are obtained for first acquisition module Before board depletion rate, according to the minimum token formation speed for flowing the node that the control target setting object is accessed and most Big token formation speed;
Interval setup module, the numerical value of the described minimum token formation speed for the speed setup module to be set is true It is set to the i-th -1 interval minimum value of adjustment, the numerical value of the maximum token formation speed is defined as the i-th -1 adjustment Interval maximum;
3rd generation module, for from described the i-th -1 adjustment interval institute will to be set to by an optional numerical value State the i-th -1 numerical value of token formation speed;
3rd sending module, the i-th -1 token formation speed for the 3rd generation module to be generated sends To each node that the object is accessed, so that each node that the object is accessed is given birth to according to the i-th -1 token Flow control is carried out into speed.
The third aspect, the embodiment of the invention provides a kind of global coordination device, and the global coordination device includes such as second party Volume control device described in face.
By obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate;According to the i-th -1 token life Determine that i-th adjustment is interval into speed, the i-th -1 total token depletion rate and default stream control target, i, base area adjustment area Between generate i-th token formation speed;I-th token formation speed is sent to each node that object is accessed, so as to right As the i-th -1 token formation speed is updated to i-th token formation speed by each node for being accessed, according to i-th token Formation speed carries out flow control, by i-th token formation speed for being sent to each node that object is accessed is identical, because This, the number of request of each node processing that object is accessed is identical, solves asking for the larger node processing of token formation speed Ask generally more so that the heavier loads of the node, cause the problem of the load imbalance between each node, reached guiding negative Effect in a balanced way is loaded between node.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be to that will make needed for embodiment description Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is the method flow diagram of the flow control methods that one embodiment of the invention is provided;
Fig. 2 is the method flow diagram of the flow control methods that another embodiment of the present invention is provided;
Fig. 3 is the structural framing figure of the volume control device that one embodiment of the invention is provided;
Fig. 4 is the structural framing figure of the volume control device that yet another embodiment of the invention is provided;
Fig. 5 is the structural framing figure of the volume control device that one embodiment of the invention is provided;
Fig. 6 is the structural framing figure of the volume control device that yet another embodiment of the invention is provided.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1 is refer to, the method flow diagram of the flow control methods provided it illustrates one embodiment of the invention, the stream Amount control device can apply in global coordination device.The flow control methods, including:
Step 101, obtains the i-th -1 token formation speed and the i-th -1 total token depletion rate, the token formation speed It is all nodes for being accessed of formation speed and the object of the token that the node accessed by object is set in synchronization Token formation speed is identical, and total token depletion rate is all nodes for being accessed of object in the request that process object sends The speed sum of consumed token, i >=2, and i are natural number;
In the present embodiment, object refers to the main body that can carry stream control, can be user, using, single LUN(Logical Unit Number.LUN), one group of LUN, catalogue and file etc., the present embodiment is not defined to object.
By the node that object is accessed includes a limiter of speed corresponding with the object, the limiter of speed can record a certain Token formation speed and token depletion rate that section time interior nodes process the request of object transmission and produce, therefore, it is global Telegon can collect the token formation speed and token depletion rate of each nodes records the i-th -1 time period Nei, and root Determine that the i-th -1 token formation speed and the i-th -1 total token disappear according to the token formation speed and token depletion rate that are collected into Consumption speed.Wherein, token formation speed refers to the speed of the token bucket generation token that the node accessed by object is set, token Depletion rate refers to the speed that the request that the token bucket process object in the node that object is accessed sends consumes token.
The token formation speed of each node accessed by same target in the present embodiment is identical, therefore, overall situation association Adjusting device can obtain the token formation speed of each node that object accessed within the i-th -1 time period, and arbitrarily select Select a token formation speed and be defined as the i-th -1 token formation speed;Or, global coordination device can only collect some node Token formation speed within the i-th -1 time period, and the token formation speed is defined as the i-th -1 token formation speed. In addition, token depletion rate of the global coordination device all nodes that are also accessed object within the i-th -1 time period is added, will The token depletion rate sum obtained after addition is defined as the i-th -1 total token depletion rate.
Step 102, according to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream control target Determine that i-th adjustment is interval, according to i-th adjustment i-th token formation speed of interval generation;
Wherein, stream control target is used for the maximum token formation speed sum of all nodes that denoted object is accessed.I-th Adjustment interval refers to for generating i-th interval of token formation speed.
Step 103, is sent to each node that object is accessed, so that object is accessed by i-th token formation speed Each node the i-th -1 token formation speed is updated to i-th token formation speed, according to i-th token formation speed Carry out flow control.
I-th token formation speed is sent to each node that object is accessed by global coordination device, what object was accessed The token formation speed of token bucket is set to i-th token by the limiter of speed in each node by the i-th -1 token formation speed Formation speed, according to i-th token formation speed generation token, and is carried out according to the token of generation to the request that object sends Treatment, so as to realize being controlled the flow of object by i-th token formation speed.
In sum, flow control methods provided in an embodiment of the present invention, by obtain the i-th -1 token formation speed and The i-th -1 total token depletion rate;According to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream Control target determines that i-th adjustment is interval, i, base area adjustment i-th token formation speed of interval generation;I-th token is given birth to Each node that object is accessed is sent into speed, so that each node that object is accessed is fast by the i-th -1 token generation Degree is updated to i-th token formation speed, flow control is carried out according to i-th token formation speed, by being sent to object institute I-th token formation speed of each node for accessing is identical, therefore, the number of request phase of each node processing that object is accessed Together, the request for solving the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each The problem of the load imbalance between individual node, has reached guiding and has been supported between node effect in a balanced way.
Fig. 2 is refer to, the method flow diagram of the flow control methods provided it illustrates another embodiment of the present invention, the stream Amount control device can apply in global coordination device.The flow control methods, including:
Step 201, the minimum token formation speed and maximum token of the node that object is accessed are set according to stream control target Formation speed;The numerical value of minimum token formation speed is defined as the i-th -1 interval minimum value of adjustment, maximum token is generated The numerical value of speed is defined as the i-th -1 interval maximum of adjustment;Will from the i-th -1 adjustment interval in an optional number Value is set to the i-th -1 numerical value of token formation speed;The i-th -1 token formation speed is sent to each that object accessed Node, so that each node that object is accessed carries out flow control according to the i-th -1 token formation speed;
When a token represents a request, node needs to be obtained from token bucket from a token carries out to the request Reason, token formation speed now is equal to IOPS(Input/Output Per Second, request number per second);When an order When board represents predetermined bite, node needs to be obtained from token bucket " request word joint number/predetermined byte number " individual token to the request Processed, token formation speed now is equal to MBPS(Mega Bytes Per Second, request byte number per second)/ Predetermined byte number.Generally, predetermined byte number is 512 bytes, to ensure that a token allows the request of a minimum byte number to lead to Cross.
Because Internet resources are limited to the disposal ability asked, therefore, in order to avoid the burst request mistake of some object Take a large amount of Internet resources more, cause other objects to use the problem of the Internet resources, stream control target can be set and come The maximum burst number of request or maximum burst request word joint number of object are limited, and please by the maximum burst number of request or maximum burst Byte number is asked to be set to the maximum token formation speed of node.Wherein, object refers to the main body that can carry stream control, can use Family, using, single LUN, one group of LUN, catalogue and file etc., the present embodiment is not defined to object.Stream control target is used to refer to Show the maximum token formation speed sum of all nodes that object is accessed.
Such as, the stream control target of object is 100IOPS, then the maximum token formation speed that can set each node is 100IOPS/ seconds.In the minimum token formation speed of calculate node, a kind of calculation is the number of minimum token formation speed Value is equal to the numerical value of stream control target divided by nodes.Such as, the number of the node that object is accessed is 5, the stream control target of object Be 100IOPS, then minimum token formation speed=100/5=20IOPS/ seconds.It is, of course, also possible to minimum token formation speed is set 0 grade other numerical value are set to, the present embodiment is not construed as limiting.
Because global coordination device is to generate the i-th -1 token formation speed and the i-th -1 token formation speed for the first time Numerical value needs the numerical value more than minimum token formation speed and less than the numerical value of maximum token formation speed, therefore, global coordination The numerical value of minimum token formation speed can be defined as the i-th -1 interval minimum value of adjustment by device, and maximum token is generated into speed The numerical value of degree is defined as the i-th -1 interval maximum of adjustment, and will from the i-th -1 adjustment interval an optional number Value is set to the i-th -1 numerical value of token formation speed.Wherein, the i-th -1 adjustment interval in the present embodiment refers to for giving birth to Into the i-th -1 interval of token formation speed.Such as, the i-th -1 adjustment interval is(20,100), then global coordination device set The i-th -1 numerical value of token formation speed can be 21,35,98 etc..
When global coordination device selects numerical value in the i-th -1 adjustment interval, can randomly in the i-th -1 adjustment interval One numerical value of selection, it is also possible to perform pre-defined algorithm and be calculated a numerical value by the i-th -1 adjustment is interval, can be with Perform pre-defined algorithm to obtain belonging to the i-th -1 interval numerical value of adjustment, the present embodiment does not limit interval to the i-th -1 adjustment The selection mode of middle numerical value.The selection mode for exchanging middle numerical value between main plot being hereinafter related to can be with the selecting party in this step Formula is identical, it is also possible to different, and the present embodiment does not remake and repeats.
Further, global coordination device the i-th -1 token formation speed for generating is sent to that object accessed each The token formation speed of token bucket is set to the i-th -1 token life by node, the limiter of speed in each node that object is accessed Into speed, according to the i-th -1 token formation speed generation token, at the request that the token according to generation sends to object Reason.
Step 202, obtains the i-th -1 token formation speed and the i-th -1 total token depletion rate, the token formation speed It is the order of all nodes that are accessed of formation speed and object in synchronization of the token that the node accessed by object is set Board formation speed is identical, and total token depletion rate is the request when institute that all nodes that object is accessed send in process object It is natural number to consume the speed sum of token, i >=2, and i;
By the node that object is accessed includes a limiter of speed corresponding with the object, the limiter of speed can record a certain Token formation speed and token depletion rate that section time interior nodes process the request of object transmission and produce, therefore, it is global Telegon can collect the token formation speed and token depletion rate of each nodes records the i-th -1 time period Nei, and root Determine that the i-th -1 token formation speed and the i-th -1 total token disappear according to the token formation speed and token depletion rate that are collected into Consumption speed.Wherein, token formation speed refers to the speed of the token bucket generation token that the node accessed by object is set, token Depletion rate refers to the speed that the request that the token bucket process object in the node that object is accessed sends consumes token.
The token formation speed of each node accessed by same target in the present embodiment is identical, therefore, overall situation association Adjusting device can obtain the token formation speed of each node that object accessed within the i-th -1 time period, and arbitrarily select Select a token formation speed and be defined as the i-th -1 token formation speed;Or, global coordination device can only collect some node Token formation speed within the i-th -1 time period, and the token formation speed is defined as the i-th -1 token formation speed. In addition, token depletion rate of the global coordination device all nodes that are also accessed object within the i-th -1 time period is added, will The token depletion rate sum obtained after addition is defined as the i-th -1 total token depletion rate.
Step 203, according to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream control target Determine that i-th adjustment is interval, according to i-th adjustment i-th token formation speed of interval generation;
Specifically, according to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream control target Determine that i-th adjustment is interval, according to i-th adjustment i-th token formation speed of interval generation, including:
By the i-th -1 total token depletion rate subtract stream control target obtain the i-th -1 difference, by the i-th -1 difference divided by Stream control target obtains the i-th -1 ratio, compares the i-th -1 ratio with default change threshold;
If the i-th -1 absolute value of ratio is more than change threshold and the i-th -1 ratio is just, according to the i-th -1 token Formation speed determines that i-th adjustment is interval, generates i-th token formation speed.
In the present embodiment, the adjustment target of global coordination device is to be adjusted to the numerical value of total token depletion rate to be similar to stream The numerical value of target is controlled, the request of transmission so both can be at utmost dealt with objects, to improve throughput of system, it is also possible to avoid The wasting of resources that the unnecessary token of generation is caused.And total token depletion rate is real-time change, therefore, global coordination device can be with Repeatedly total token depletion rate is counted, the mean change scope of total token depletion rate is drawn, is consumed according to total token The mean change scope generation change threshold of speed.
Therefore, global coordination device can calculate the difference of the i-th -1 total token depletion rate and stream control target, obtain i-th -1 Individual difference;Ratio of the i-th -1 difference relative to stream control target is calculated again, obtains the i-th -1 ratio;And compare this i-th -1 Value is compared with change threshold.Specifically, when the i-th -1 ratio is calculated, it is assumed that stream control target is 100IOPS, if i-th -1 Individual total token depletion rate is 110IOPS, then the i-th -1 ratio=(110-100)/100=10%.
If the i-th -1 absolute value of ratio is more than change threshold, it is considered that the i-th -1 total token depletion rate and stream Control target difference is larger, now needs to calculate i-th token formation speed.Further, when the absolute value of the i-th -1 ratio is big When change threshold, in addition it is also necessary to determine whether the i-th -1 ratio is positive number.If the i-th -1 ratio is positive number, the i-th one -1 total The numerical value of token depletion rate is less than the i-th -1 token more than the numerical value of stream control target, it is necessary to set i-th token formation speed Formation speed so that i-th total token depletion rate is less than the i-th -1 total token depletion rate.
In the present embodiment, global coordination device can make i-th token by reducing i-th interval span of adjustment Formation speed is less than the i-th -1 token formation speed.Wherein, i-th adjustment area is determined according to the i-th -1 token formation speed Between, i-th token formation speed is generated, including:
1)It is interval that the numerical value of the minimum token formation speed of the node configuration that will be accessed by object is defined as i-th adjustment Minimum value, the numerical value of the i-th -1 token formation speed is defined as the interval maximum of i-th adjustment;
2)An optional numerical value from i-th adjustment interval is set to i-th numerical value of token formation speed.
Because i-th token formation speed is less than the i-th -1 token formation speed, therefore, global coordination device can be by the The numerical value of i-1 token formation speed is set to the interval maximum of i-th adjustment;In addition, i-th number of token formation speed Value needs the numerical value more than or equal to minimum token formation speed, therefore, global coordination device can be by minimum token formation speed Numerical value is set to the interval minimum value of i-th adjustment, determines that i-th adjustment is interval, and global coordination device again will be from i-th adjustment area Between in an optional numerical value be set to i-th numerical value of token formation speed.
In the present embodiment, compare after the i-th -1 ratio and default change threshold, also include:
1)If the i-th -1 absolute value of ratio is more than change threshold and the i-th -1 ratio is negative, i-th token is given birth to Into speed numerical value be set to the node configuration that object accessed maximum token formation speed numerical value;
2)If the i-th -1 absolute value of ratio is less than change threshold, the numerical value of i-th token formation speed is arranged to The i-th -1 numerical value of token formation speed.
First, if the i-th -1 absolute value of ratio is more than change threshold and the i-th -1 ratio is negative, the i-th one -1 total The numerical value of token depletion rate controls the numerical value of target less than stream, and the number of request that now object sends is less, it is not necessary to object Flow is controlled, and the numerical value of i-th token formation speed can be set to the maximum token of the node that object is accessed The numerical value of formation speed.
Second, if the i-th -1 absolute value of ratio is less than change threshold, it is considered that the i-th -1 total token consumption speed The numerical value of i-th token formation speed is set to the by the numerical approximation of degree in the numerical value of stream control target, now global coordination device The i-1 numerical value of token formation speed, terminates flow.
Step 204, is sent to each node that object is accessed, so that object is accessed by i-th token formation speed Each node the i-th -1 token formation speed is updated to i-th token formation speed, according to i-th token formation speed Carry out flow control.
I-th token formation speed is sent to each node that object is accessed by global coordination device, what object was accessed The token formation speed of token bucket is set to i-th token by the limiter of speed in each node by the i-th -1 token formation speed Formation speed, according to i-th token formation speed generation token, and is carried out according to the token of generation to the request that object sends Treatment, so as to realize being controlled the flow of object by i-th token formation speed.
It should be added that, the node that object is accessed is sending according to i-th token formation speed to object When request is processed, i-th numerical value of total token depletion rate or may differ larger with the numerical value of stream control target, because This, global coordination device can also generate i+1 token formation speed so that the numerical value energy of the total token depletion rate of i+1 I-th token formation speed is then sent to object by token depletion rate enough more total than i-th closer to the numerical value of stream control target After each node for being accessed, also include:
1)Obtain i-th token formation speed and i-th total token depletion rate;
2)I-th total token depletion rate is subtracted into stream control target and obtains i-th difference, i-th difference is controlled divided by stream Target obtains i-th ratio, compares i-th ratio and change threshold;
3)If i-th absolute value of ratio is more than change threshold and i-th ratio is just, interval to be adjusted by i-th Minimum value is defined as the interval minimum value of i+1 adjustment, and the numerical value of i-th token formation speed is defined as into i+1 adjusts Maximum between main plot;If i-th ratio is negative more than change threshold and i-th ratio, by i-th token formation speed Numerical value is defined as the interval minimum value of i+1 adjustment, and i-th interval maximum of adjustment is defined as into i+1 adjustment area Between maximum;
4)An optional numerical value from i+1 adjustment interval is set to i+1 token formation speed Numerical value;
5)I+1 token formation speed is sent to each node that object is accessed, so as to object accessed it is each I-th token formation speed is updated to i+1 token formation speed by individual node, according to i+1 token number formation speed Carry out flow control.
The node that object is accessed is carried out after flow control according to i-th token formation speed, and global coordination device is pre- Fix time and i-th token formation speed and i-th total token depletion rate of the record within i-th time period obtained after being spaced, I+1 adjustment interval is determined according to i-th token formation speed, i-th total token depletion rate and stream control target, according to the The i+1 interval generation i+1 token formation speed of adjustment, and i+1 token formation speed is sent to object is accessed Each node, each node that object is accessed carries out flow control according to i+1 token formation speed.
When it is determined that i+1 adjustment is interval, global coordination device needs i-th ratio and change threshold that will be calculated It is compared, if i-th absolute value of ratio is more than change threshold and i-th ratio is just, it is determined that i-th total token consumption Speed can now set i+1 token formation speed less than i-th token formation speed more than stream control target;If i-th The absolute value of ratio is more than change threshold and i-th ratio is negative, it is determined that i-th total token depletion rate is less than stream control mesh Mark, can now set i+1 token formation speed more than i-th token formation speed.
When i+1 token formation speed is set less than i-th token formation speed, due to i-th token generation speed The numerical value of the degree minimum value interval more than i-th adjustment and the maximum interval less than i-th adjustment, now global coordination device can It is defined as the interval minimum value of i+1 adjustment with by i-th interval minimum value of adjustment, i-th token formation speed is true It is set to the interval maximum of i+1 adjustment, obtains i+1 adjustment interval, will be optional from i-th adjustment interval One numerical value is set to the numerical value of i+1 token formation speed.Such as, i-th token formation speed is 76IOPS, i-th Adjustment interval is(20,100), then the i+1 adjustment interval that global coordination device determines is(20,76).
When i+1 token formation speed is set more than i-th token formation speed, due to i-th token generation speed The numerical value of the degree minimum value interval more than i-th adjustment and the maximum interval less than i-th adjustment, now global coordination device can It is defined as the interval minimum value of i+1 adjustment with by i-th token formation speed, i-th interval maximum of adjustment is true It is set to the interval maximum of i+1 adjustment, obtains i+1 adjustment interval, will be optional from i-th adjustment interval One numerical value is set to the numerical value of i+1 token formation speed.Such as, i-th token formation speed is 50IOPS, i-th Adjustment interval is(20,100), then the i+1 adjustment interval that global coordination device determines is(50,100).
In the present embodiment, the total token depletion rate of i+1 or may differ larger with stream control target, therefore, it is global Telegon is also based on i+1 token formation speed and repeatedly generates token formation speed so that with token formation speed pair The numerical value of the total token depletion rate answered can be similar to the numerical value of stream control target.Specifically, global coordination device is every pre- timing Between i is updated to i+1, i-th token formation speed of above-mentioned acquisition and i-th the i-th -1 total token depletion rates are performed again The step of, until when i-th absolute value of ratio is less than change threshold, the numerical value of i-th token formation speed is set to the The i-1 numerical value of token formation speed, end loop.
It should be added that, if the number of request that object sends is less, global coordination device can also again to object The number of request of transmission is verified, to further determine whether to need to be controlled the flow of object, is then given birth to i-th token After being sent to each node that object is accessed into speed, also include:
1)Obtain i-th token formation speed and i-th total token depletion rate;
2)I-th total token depletion rate is subtracted into stream control target and obtains i-th difference, i-th difference is controlled divided by stream Target obtains i-th ratio, compares i-th ratio and change threshold;
3)If i-th numerical value of token formation speed is equal to the exhausted of the numerical value of maximum token formation speed and i-th ratio To value is more than change threshold and i-th ratio is negative, then the numerical value of i-th token formation speed is remained set into maximum token The numerical value of formation speed.
The node that object is accessed is carried out after flow control according to i-th token formation speed, and global coordination device is pre- The i-th token formation speed and i-th total token depletion rate recorded within i-th time period, root are obtained after section of fixing time I-th ratio is calculated according to i-th total token depletion rate and stream control target.If i-th numerical value of token formation speed is equal to most The numerical value of big token formation speed and i-th absolute value of ratio is more than change threshold and i-th ratio be negative, it is determined that verify Result is that the flow of object need not be controlled, and is now still set to most the numerical value of i+1 token formation speed The numerical value of big token formation speed, terminates flow.
In the present embodiment, global coordination device can by dichotomy, etc. than method scheduling algorithm adjust interval in generate token Formation speed, in order to make it easy to understand, calculating process of the present embodiment to token formation speed by taking dichotomy as an example is illustrated.It is false If object has accessed 5 nodes, stream control target is 100IOPS, and change threshold is 10%, then idiographic flow is as follows:
First, it is assumed that the object of load operation token depletion rate on each node is fixed as 120IOPS, due to 120IOPS is more than 100IOPS, therefore, the token depletion rate in flow control process is subsequently carried out to object and is consistently equal to order Board formation speed;
The 1st, minimum token formation speed and maximum token the generation speed of the node that object is accessed is set according to stream control target Degree, it is assumed that minimum token speed is 0, and maximum token formation speed is 100IOPS;
2nd, according to minimum token formation speed numerical value and the numerical value of maximum token formation speed determines that the 1st adjustment is interval For(0,100), the 1st token formation speed=(0+100)/ 2=50IOPS, each section that object is accessed is sent to by 50IOPS 1st token formation speed of token bucket is set to 50IOPS by point, each node that object is accessed;
3rd, it is 505=250IOPS to obtain the 1st total token depletion rate, the 1st ratio=(250-100)/100= 150%, because the 1st ratio 150% is more than change threshold 10% and the 1st ratio is just, minimum token formation speed 0 to be determined It is the minimum value that the 2nd adjustment is interval, the 1st token formation speed 50 is defined as the 2nd interval maximum of adjustment, obtains 2nd adjustment is interval(0,50), the 2nd token formation speed=(0+50)/ 2=25IOPS, is sent to 25IOPS object and is connect 2nd token formation speed of token bucket is set to 25IOPS by each node for entering, each node that object is accessed;
4th, it is 255=125IOPS to obtain the 2nd total token depletion rate, the 2nd ratio=(125-100)/100= 12.5%, it is due to the 2nd ratio 12.5% more than change threshold 10% and the 2nd ratio for just, minimum token formation speed 0 is true It is set to the 3rd interval minimum value of adjustment, the 2nd token formation speed 25 is defined as the 3rd interval maximum of adjustment, obtains It is interval to the 3rd adjustment(0,25), the 3rd token formation speed=(0+25)/ 2=12.5IOPS, it is right that 12.5IOPS is sent to As each node for being accessed, be set to for the 3rd token formation speed of token bucket by each node that object is accessed 12.5IOPS;
5th, it is 12.55=62.5IOPS to obtain the 3rd total token depletion rate, the 3rd ratio=(62.5-100)/100 =-37.5%, because the 3rd absolute value of ratio -37.5% is more than change threshold 10% and the 3rd ratio is negative, by the 3rd token Formation speed 12.5 is defined as the 4th interval minimum value of adjustment, and the 3rd interval maximum 25 of adjustment is set into the 4th Interval maximum is adjusted, the 4th adjustment is obtained interval(12.5,25), the 4th token formation speed=(12.5+25)/2= 18.75IOPS, each node that object is accessed is sent to by 18.75IOPS, and each node that object is accessed is by token bucket The 4th token formation speed be set to 18.75IOPS;
6th, it is 18.755=93.75IOPS to obtain the 4th total token depletion rate, the 4th ratio=(93.75-100)/ 100=-6.25%, because the 4th absolute value of ratio -6.25% is less than change threshold 10%, terminates flow.
Second, it is assumed that the object of load operation token depletion rate on each node is fixed as 12IOPS;
The 1st, minimum token formation speed and maximum token the generation speed of the node that object is accessed is set according to stream control target Degree, it is assumed that minimum token speed is 0, and maximum token formation speed is 100IOPS;
2nd, according to minimum token formation speed numerical value and the numerical value of maximum token formation speed determines the adjustment area of the 1st Between be(0,100), the 1st token formation speed=(0+100)/ 2=50IOPS, each that object accessed is sent to by 50IOPS 1st token formation speed of token bucket is set to 50IOPS by node, each node that object is accessed;
3rd, it is 125=60IOPS to obtain the 1st total token depletion rate, the 1st ratio=(60-100)/ 100=-40%, It is negative more than change threshold 10% and the 1st ratio due to the 1st absolute value of ratio -40%, by the 2nd token formation speed Numerical value is set to the numerical value of maximum token formation speed, i.e., the 2nd token formation speed=100IOPS, and 100IOPS is sent to Be set to for 2nd token formation speed of token bucket by each node that object is accessed, each node that object is accessed 100IOPS;
4th, obtain the 2nd total token depletion rate be 125=60IOPS, the 2nd ratio=(60-100)/ 100=-40%, Because the 2nd token formation speed is that 100IOPS and the 2nd absolute value of ratio -40% is more than change threshold 10% and the 2nd ratio It is negative to be worth, and terminates flow.
In sum, flow control methods provided in an embodiment of the present invention, by obtain the i-th -1 token formation speed and The i-th -1 total token depletion rate;According to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream Control target determines that i-th adjustment is interval, i, base area adjustment i-th token formation speed of interval generation;I-th token is given birth to Each node that object is accessed is sent into speed, so that each node that object is accessed is fast by the i-th -1 token generation Degree is updated to i-th token formation speed, flow control is carried out according to i-th token formation speed, by being sent to object institute I-th token formation speed of each node for accessing is identical, therefore, the number of request phase of each node processing that object is accessed Together, the request for solving the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each The problem of the load imbalance between individual node, has reached guiding and has been supported between node effect in a balanced way.
In addition, interval minimum value is adjusted by the way that i-th interval minimum value of adjustment is defined as into i+1, by i-th The numerical value of token formation speed is defined as the interval maximum of i+1 adjustment;Or, by i-th numerical value of token formation speed It is defined as i+1 and adjusts interval minimum value, i-th interval maximum of adjustment is defined as i+1 adjustment interval Maximum, an optional numerical value from i+1 adjustment interval is set to the number of i+1 token formation speed Value, can make i-th token formation speed be similar to the i-th -1 total token and consume according to the i-th adjustment interval for progressively reducing Speed, improves the control efficiency of flow control.
Fig. 3 is refer to, the structural framing figure of the volume control device provided it illustrates one embodiment of the invention, the stream Amount control device can apply in global coordination device.The volume control device, including:
First acquisition module 301, for obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate, order Board formation speed is all nodes for being accessed of formation speed and object of the token that the node accessed by object is set same The token formation speed at one moment is identical, and total token depletion rate is that all nodes that object is accessed send in process object The speed sum of token, i >=2, and i are consumed during request for natural number;
First generation module 302, for the i-th -1 token formation speed, that are got according to the first acquisition module 301 I-1 total token depletion rate and default stream control target determine that i-th adjustment is interval, according to the interval generation i-th of i-th adjustment Individual token formation speed;
First sending module 303, it is right that i-th token formation speed for the first generation module 302 to be generated is sent to As each node for being accessed, so that be updated to the i-th -1 token formation speed i-th by each node that object is accessed Token formation speed, flow control is carried out according to i-th token formation speed.
In sum, volume control device provided in an embodiment of the present invention, by obtain the i-th -1 token formation speed and The i-th -1 total token depletion rate;According to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream Control target determines that i-th adjustment is interval, i, base area adjustment i-th token formation speed of interval generation;I-th token is given birth to Each node that object is accessed is sent into speed, so that each node that object is accessed is fast by the i-th -1 token generation Degree is updated to i-th token formation speed, flow control is carried out according to i-th token formation speed, by being sent to object institute I-th token formation speed of each node for accessing is identical, therefore, the number of request phase of each node processing that object is accessed Together, the request for solving the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each The problem of the load imbalance between individual node, has reached guiding and has been supported between node effect in a balanced way.
Fig. 4 is refer to, the structural framing figure of the volume control device provided it illustrates yet another embodiment of the invention, the stream Amount control device can apply in global coordination device.The volume control device, including:First acquisition module 301, first is generated The sending module 303 of module 302 and first.
First acquisition module 301, for obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate, order Board formation speed is all nodes for being accessed of formation speed and object of the token that the node accessed by object is set same The token formation speed at one moment is identical, and total token depletion rate is that all nodes that object is accessed send in process object The speed sum of token, i >=2, and i are consumed during request for natural number;
First generation module 302, for the i-th -1 token formation speed, that are got according to the first acquisition module 301 I-1 total token depletion rate and default stream control target determine that i-th adjustment is interval, according to the interval generation i-th of i-th adjustment Individual token formation speed;
First sending module 303, it is right that i-th token formation speed for the first generation module 302 to be generated is sent to As each node for being accessed, so that be updated to the i-th -1 token formation speed i-th by each node that object is accessed Token formation speed, flow control is carried out according to i-th token formation speed.
Optionally, the first generation module 302, including:
Data comparing unit 3021, the i-th -1 difference is obtained for the i-th -1 total token depletion rate to be subtracted into stream control target Value, the i-th -1 ratio is obtained by the i-th -1 difference divided by stream control target, compares the i-th -1 ratio with default change threshold Value;
First generation unit 3022, show that the absolute value of the i-th -1 ratio is big for comparing in data comparing unit 3021 In change threshold and the i-th -1 ratio is timing, determine that i-th adjustment is interval according to the i-th -1 token formation speed, generation the I token formation speed.
Optionally, the first generation module 302, also includes:
Second generation unit 3023, show that the absolute value of the i-th -1 ratio is big for comparing in data comparing unit 3021 In change threshold and the i-th -1 ratio for it is negative when, the numerical value of i-th token formation speed is set to the section that object is accessed The numerical value of the maximum token formation speed of point configuration;
3rd generation unit 3024, show that the absolute value of the i-th -1 ratio is small for comparing in data comparing unit 3021 When change threshold, the numerical value of i-th token formation speed is arranged to the i-th -1 numerical value of token formation speed.
Optionally, the first generation unit 3022, the minimum token life of the node configuration specifically for will be accessed by object Numerical value into speed is defined as the interval minimum value of i-th adjustment, and the numerical value of the i-th -1 token formation speed is defined as into i-th The interval maximum of individual adjustment;I-th token generation speed will be set to from i-th adjustment interval by an optional numerical value The numerical value of degree.
Optionally, device, also includes:
Second acquisition module 304, is sent to object and is connect for the first sending module 303 by i-th token formation speed After each node for entering, i-th token formation speed and i-th total token depletion rate are obtained;
Data comparison module 305, i-th total token depletion rate for the second acquisition module 304 to be got is subtracted Default stream control target obtains i-th difference, and i-th difference is obtained into i-th ratio divided by stream control target, compares i-th ratio Value and change threshold;
Interval determination module 306, draws i-th absolute value of ratio more than change for comparing in data comparison module 305 Change threshold value and i-th ratio be timing, i-th interval minimum value of adjustment is defined as the interval minimum value of i+1 adjustment, The numerical value of i-th token formation speed is defined as the interval maximum of i+1 adjustment;Compare in data comparison module 305 I-th absolute value of ratio is drawn more than change threshold and i-th ratio is when bearing, by i-th numerical value of token formation speed It is defined as i+1 and adjusts interval minimum value, i-th interval maximum of adjustment is defined as i+1 adjustment interval Maximum;
Second generation module 307, for will arbitrarily be selected in the i+1 determined from interval determination module 306 adjustment interval The numerical value selected is set to the numerical value of i+1 token formation speed;
Second sending module 308, the i+1 token formation speed for the second generation module 307 to be generated is sent to Each node that object is accessed, so that i-th token formation speed is updated to i+1 by each node that object is accessed Token formation speed, flow control is carried out according to i+1 token number formation speed.
Optionally, device, also includes:
Speed setup module 309, obtains the i-th -1 token formation speed and the i-th one -1 total for the first acquisition module 301 Before token depletion rate, the minimum token formation speed and maximum token of the node that object is accessed are set according to stream control target Formation speed;
Interval setup module 310, the numerical value of the minimum token formation speed for speed setup module 309 to be set determines It is the minimum value that the i-th -1 adjustment is interval, the numerical value of maximum token formation speed is defined as the i-th -1 interval maximum of adjustment Value;
3rd generation module 311, for will from the i-th -1 adjustment interval an optional numerical value be set to i-th - 1 numerical value of token formation speed;
3rd sending module 312, the i-th -1 token formation speed for the 3rd generation module 311 to be generated is sent to Each node that object is accessed, so that each node that object is accessed carries out flow according to the i-th -1 token formation speed Control.
In sum, volume control device provided in an embodiment of the present invention, by obtain the i-th -1 token formation speed and The i-th -1 total token depletion rate;According to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream Control target determines that i-th adjustment is interval, i, base area adjustment i-th token formation speed of interval generation;I-th token is given birth to Each node that object is accessed is sent into speed, so that each node that object is accessed is fast by the i-th -1 token generation Degree is updated to i-th token formation speed, flow control is carried out according to i-th token formation speed, by being sent to object institute I-th token formation speed of each node for accessing is identical, therefore, the number of request phase of each node processing that object is accessed Together, the request for solving the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each The problem of the load imbalance between individual node, has reached guiding and has been supported between node effect in a balanced way.
In addition, interval minimum value is adjusted by the way that i-th interval minimum value of adjustment is defined as into i+1, by i-th The numerical value of token formation speed is defined as the interval maximum of i+1 adjustment;Or, by i-th numerical value of token formation speed It is defined as i+1 and adjusts interval minimum value, i-th interval maximum of adjustment is defined as i+1 adjustment interval Maximum, an optional numerical value from i+1 adjustment interval is set to the number of i+1 token formation speed Value, can make i-th token formation speed be similar to the i-th -1 total token and consume according to the i-th adjustment interval for progressively reducing Speed, improves the control efficiency of flow control.
Fig. 5 is refer to, the structural framing figure of the volume control device provided it illustrates one embodiment of the invention.The stream Amount control device, can include:Receiver 501, processor 502, emitter 503 and memory 504.Receiver 501, treatment Coupled two-by-two between device 502, emitter 503 and memory 504.
Computer program is stored in memory 504, processor 502 can be as follows by accessing the computer program execution Operation:
Receiver 501, for obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate, token generation Speed is all nodes for being accessed of formation speed and object of the token that the node accessed by object is set in synchronization Token formation speed it is identical, total token depletion rate is all nodes for being accessed of object in the request that process object sends The speed sum of consumed token, i >=2, and i are natural number;
Processor 502, for the i-th -1 token formation speed, the i-th -1 total token that are got according to receiver 501 Depletion rate and default stream control target determine that i-th adjustment is interval, according to i-th token generation of the interval generation of i-th adjustment Speed;
Emitter 503, it is each that i-th token formation speed for processor 502 to be generated is sent to that object accessed Individual node, so that the i-th -1 token formation speed is updated to i-th token formation speed by each node that object is accessed, Flow control is carried out according to i-th token formation speed.
In sum, volume control device provided in an embodiment of the present invention, by obtain the i-th -1 token formation speed and The i-th -1 total token depletion rate;According to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream Control target determines that i-th adjustment is interval, i, base area adjustment i-th token formation speed of interval generation;I-th token is given birth to Each node that object is accessed is sent into speed, so that each node that object is accessed is fast by the i-th -1 token generation Degree is updated to i-th token formation speed, flow control is carried out according to i-th token formation speed, by being sent to object institute I-th token formation speed of each node for accessing is identical, therefore, the number of request phase of each node processing that object is accessed Together, the request for solving the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each The problem of the load imbalance between individual node, has reached guiding and has been supported between node effect in a balanced way.
Fig. 6 is refer to, the structural framing figure of the volume control device provided it illustrates yet another embodiment of the invention.The stream Amount control device, can include:Receiver 501, processor 502, emitter 503 and memory 504.Receiver 501, treatment Coupled two-by-two between device 502, emitter 503 and memory 504.
Computer program is stored in memory 504, processor 502 can perform following behaviour by accessing computer program Make:
Receiver 501, for obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate, token generation Speed is all nodes for being accessed of formation speed and object of the token that the node accessed by object is set in synchronization Token formation speed it is identical, total token depletion rate is all nodes for being accessed of object in the request that process object sends The speed sum of consumed token, i >=2, and i are natural number;
Processor 502, for the i-th -1 token formation speed, the i-th -1 total token that are got according to receiver 501 Depletion rate and default stream control target determine that i-th adjustment is interval, according to i-th token generation of the interval generation of i-th adjustment Speed;
Emitter 503, it is each that i-th token formation speed for processor 502 to be generated is sent to that object accessed Individual node, so that the i-th -1 token formation speed is updated to i-th token formation speed by each node that object is accessed, Flow control is carried out according to i-th token formation speed.
Optionally, processor 502, the i-th -1 difference is obtained for the i-th -1 total token depletion rate to be subtracted into stream control target Value, the i-th -1 ratio is obtained by the i-th -1 difference divided by stream control target, compares the i-th -1 ratio with default change threshold Value;If the i-th -1 absolute value of ratio is more than change threshold and the i-th -1 ratio is just, according to the i-th -1 token generation speed Degree determines that i-th adjustment is interval, generates i-th token formation speed.
Optionally, processor 502, if being additionally operable to the i-th -1 absolute value of ratio more than change threshold and the i-th -1 ratio It is negative, then the maximum token that the numerical value of i-th token formation speed is set to the node configuration that object is accessed is generated into speed The numerical value of degree;If the i-th -1 absolute value of ratio is less than change threshold, the numerical value of i-th token formation speed is arranged to The i-th -1 numerical value of token formation speed.
Optionally, processor 502, the minimum token formation speed that the node specifically for will be accessed by object is configured Numerical value is defined as the interval minimum value of i-th adjustment, and the numerical value of the i-th -1 token formation speed is defined as into i-th adjustment area Between maximum;An optional numerical value from i-th adjustment interval is set to i-th number of token formation speed Value.
Optionally, receiver 501, are additionally operable to emitter 503 and i-th token formation speed are sent into what object was accessed After each node, i-th token formation speed and i-th total token depletion rate are obtained;
Processor 502, i-th total token depletion rate for being additionally operable to get receiver 501 subtracts stream control target and obtains To i-th difference, i-th difference is obtained into i-th ratio divided by stream control target, compare i-th ratio and change threshold;If the The i absolute value of ratio is more than change threshold and i-th ratio is just, then i-th interval minimum value of adjustment to be defined as into i-th The interval maximum of+1 adjustment, the interval maximum of i+1 adjustment is defined as by the numerical value of i-th token formation speed; If i-th ratio is more than change threshold and i-th ratio is negative, the numerical value of i-th token formation speed is defined as i+1 The interval minimum value of individual adjustment, the interval maximum of i+1 adjustment is defined as by the interval maximum of i-th adjustment;Will be from i-th An optional numerical value is set to the numerical value of i+1 token formation speed in individual adjustment interval;
Emitter 503, the i+1 token formation speed for being additionally operable to generate processor 502 is sent to object and is accessed Each node, i-th token formation speed be updated to i+1 token generation speed by each node accessed so as to object Degree, flow control is carried out according to i+1 token number formation speed.
Optionally, processor 502, are additionally operable to receiver 501 and obtain the i-th -1 token formation speed and the i-th -1 total order Before board depletion rate, the minimum token formation speed and maximum token formation speed of node are set according to stream control target;Will most The numerical value of small token formation speed is defined as the i-th -1 interval minimum value of adjustment, and the numerical value of maximum token formation speed is true Fixed the i-th -1 is the interval maximum of adjustment;Will from the i-th -1 adjustment interval an optional numerical value be set to i-th - 1 numerical value of token formation speed;
Emitter 503, the i-th -1 token formation speed for being additionally operable to generate processor 502 is sent to object and is accessed Each node, so that each node that object is accessed carries out flow control according to the i-th -1 token formation speed.
In sum, volume control device provided in an embodiment of the present invention, by obtain the i-th -1 token formation speed and The i-th -1 total token depletion rate;According to the i-th -1 token formation speed, the i-th -1 total token depletion rate and default stream Control target determines that i-th adjustment is interval, i, base area adjustment i-th token formation speed of interval generation;I-th token is given birth to Each node that object is accessed is sent into speed, so that each node that object is accessed is fast by the i-th -1 token generation Degree is updated to i-th token formation speed, flow control is carried out according to i-th token formation speed, by being sent to object institute I-th token formation speed of each node for accessing is identical, therefore, the number of request phase of each node processing that object is accessed Together, the request for solving the larger node processing of token formation speed is generally more so that the heavier loads of the node, causes each The problem of the load imbalance between individual node, has reached guiding and has been supported between node effect in a balanced way.
In addition, interval minimum value is adjusted by the way that i-th interval minimum value of adjustment is defined as into i+1, by i-th The numerical value of token formation speed is defined as the interval maximum of i+1 adjustment;Or, by i-th numerical value of token formation speed It is defined as i+1 and adjusts interval minimum value, i-th interval maximum of adjustment is defined as i+1 adjustment interval Maximum, an optional numerical value from i+1 adjustment interval is set to the number of i+1 token formation speed Value, can make i-th token formation speed be similar to the i-th -1 total token and consume according to the i-th adjustment interval for progressively reducing Speed, improves the control efficiency of flow control.
It should be noted that:The volume control device that above-described embodiment is provided when carrying out flow and controlling, only with above-mentioned each The division of functional module is carried out for example, in practical application, as needed can distribute by different work(above-mentioned functions Can module complete, will the internal structure of volume control device be divided into different functional modules, it is described above complete to complete Portion or partial function.In addition, the volume control device that above-described embodiment is provided belongs to same with flow control methods embodiment Design, it implements process and refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware To complete, it is also possible to instruct the hardware of correlation to complete by program, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all it is of the invention spirit and Within principle, any modification, equivalent substitution and improvements made etc. should be included within the scope of the present invention.

Claims (13)

1. a kind of flow control methods, it is characterised in that methods described includes:
The i-th -1 token formation speed and the i-th -1 total token depletion rate are obtained, it is object institute that the token formation speed is All nodes that the formation speed and the object of the token that the node of access is set are accessed are generated in the token of synchronization Speed is identical, and total token depletion rate is that all nodes that the object is accessed are processing the request that the object sends When to consume the speed sum of token, i >=2, and i be natural number;
Determined according to the i-th -1 token formation speed, described the i-th -1 total token depletion rate and default stream control target I-th adjustment is interval, according to described i-th adjustment i-th token formation speed of interval generation;
I-th token formation speed is sent to each node that the object is accessed, so that the object is accessed Each node the i-th -1 token formation speed is updated to i-th token formation speed, according to described i-th Token formation speed carries out flow control.
2. method according to claim 1, it is characterised in that it is described according to the i-th -1 token formation speed, it is described The i-th -1 total token depletion rate and default stream control target determine that i-th adjustment is interval, interval according to described i-th adjustment I-th token formation speed is generated, including:
Described the i-th -1 total token depletion rate is subtracted into the stream control target and obtains the i-th -1 difference, by described the i-th -1 Difference obtains the i-th -1 ratio, relatively more described the i-th -1 ratio and default change threshold divided by the stream control target;
If the absolute value of the i-th -1 ratio is more than the change threshold and the i-th -1 ratio is just, according to described The i-th -1 token formation speed determines that i-th adjustment is interval, generates i-th token formation speed.
3. method according to claim 2, it is characterised in that comparing the i-th -1 ratio and default change After threshold value, also include:
If the absolute value of the i-th -1 ratio is negative more than the change threshold and the i-th -1 ratio, by described the The numerical value of i token formation speed is set to the number of the maximum token formation speed of the node configuration that the object is accessed Value;
If the absolute value of the i-th -1 ratio is less than the change threshold, by the numerical value of i-th token formation speed It is arranged to the numerical value of the i-th -1 token formation speed.
4. method according to claim 2, it is characterised in that described to be determined according to the i-th -1 token formation speed I-th adjustment is interval, generates i-th token formation speed, including:
The numerical value of the minimum token formation speed of the node configuration that will be accessed by the object is defined as i-th adjustment area Between minimum value, the numerical value of the i-th -1 token formation speed is defined as the interval maximum of i-th adjustment;
An optional numerical value from described i-th adjustment interval is set to the number of i-th token formation speed Value.
5. method according to claim 4, it is characterised in that described that i-th token formation speed is sent to institute State after each node that object is accessed, also include:
Obtain i-th token formation speed and i-th total token depletion rate;
Described i-th total token depletion rate is subtracted into the stream control target and obtains i-th difference, i-th difference is removed Target is controlled with the stream and obtains i-th ratio, relatively more described i-th ratio and the change threshold;
If the absolute value of i-th ratio is more than the change threshold and i-th ratio is just, by described i-th Adjust interval minimum value and be defined as the interval minimum value of i+1 adjustment, the numerical value of i-th token formation speed is true It is set to the interval maximum of the i+1 adjustment;If i-th ratio is more than the change threshold and compares for described i-th It is negative to be worth, then the numerical value of i-th token formation speed is defined as into the interval minimum value of i+1 adjustment, by described i-th The interval maximum of individual adjustment is defined as the interval maximum of the i+1 adjustment;
An optional numerical value from the i+1 adjustment interval is set to the number of i+1 token formation speed Value;
The i+1 token formation speed is sent to each node that the object is accessed, so that the object is connect I-th token formation speed is updated to the i+1 token formation speed by each node for entering, according to described i-th+ 1 token number formation speed carries out flow control.
6. the method according to any one of claim 1 to 5, it is characterised in that the i-th -1 token formation speed of the acquisition Before the i-th -1 total token depletion rate, also include:
Minimum token formation speed and the maximum token generation of the node that the object is accessed are set according to the stream control target Speed;
The numerical value of the minimum token formation speed is defined as the i-th -1 interval minimum value of adjustment, by the maximum token The numerical value of formation speed is defined as the interval maximum of the i-th -1 adjustment;
The i-th -1 token formation speed will be set to from described the i-th -1 adjustment interval by an optional numerical value Numerical value;
The i-th -1 token formation speed is sent to each node that the object is accessed, so that the object is connect Each node for entering carries out flow control according to the i-th -1 token formation speed.
7. a kind of volume control device, it is characterised in that described device includes:
First acquisition module, for obtaining the i-th -1 token formation speed and the i-th -1 total token depletion rate, the token Formation speed is that all nodes for being accessed of formation speed and the object of the token that the node accessed by object is set exist The token formation speed of synchronization is identical, and total token depletion rate is that all nodes that the object is accessed are being processed It is natural number that the speed sum of token, i >=2, and i are consumed during the request that the object sends;
First generation module, for the i-th -1 token formation speed, described got according to first acquisition module The i-th -1 total token depletion rate and default stream control target determine that i-th adjustment is interval, interval according to described i-th adjustment Generate i-th token formation speed;
First sending module, it is described for i-th token formation speed that first generation module is generated to be sent to Each node that object is accessed, each node accessed so as to the object is by the i-th -1 token formation speed I-th token formation speed is updated to, flow control is carried out according to i-th token formation speed.
8. device according to claim 7, it is characterised in that first generation module, including:
Data comparing unit, the i-th -1 difference is obtained for described the i-th -1 total token depletion rate to be subtracted into the stream control target Value, the i-th -1 ratio is obtained by the i-th -1 difference divided by the stream control target, is compared the i-th -1 ratio and is preset Change threshold;
First generation unit, the absolute value for relatively drawing the i-th -1 ratio in the data comparing unit is more than institute State change threshold and the i-th -1 ratio is timing, i-th tune is determined according to the i-th -1 token formation speed Between main plot, i-th token formation speed is generated.
9. device according to claim 8, it is characterised in that first generation module, also includes:
Second generation unit, the absolute value for relatively drawing the i-th -1 ratio in the data comparing unit is more than institute State change threshold and the i-th -1 ratio is that it is described right to be set to the numerical value of i-th token formation speed when bearing As the numerical value of the maximum token formation speed that the node for being accessed is configured;
3rd generation unit, the absolute value for relatively drawing the i-th -1 ratio in the data comparing unit is less than institute When stating change threshold, the numerical value of i-th token formation speed is arranged to the number of the i-th -1 token formation speed Value.
10. device according to claim 8, it is characterised in that first generation unit, specifically for that will be described right As the numerical value of the minimum token formation speed of the node configuration for being accessed is defined as the interval minimum value of i-th adjustment, will The numerical value of the i-th -1 token formation speed is defined as the interval maximum of i-th adjustment;Will be from described i-th tune An optional numerical value is set to the numerical value of i-th token formation speed between main plot.
11. devices according to claim 10, it is characterised in that described device, also include:
Second acquisition module, the object institute is sent to for first sending module by i-th token formation speed After each node for accessing, i-th token formation speed and i-th total token depletion rate are obtained;
Data comparison module, described i-th total token depletion rate for second acquisition module to be got subtracts institute State stream control target and obtain i-th difference, i-th difference is obtained into i-th ratio divided by the stream control target, it is relatively more described I-th ratio and the change threshold;
Interval determination module, for relatively drawing the absolute value of i-th ratio more than described in the data comparison module Change threshold and i-th ratio are timing, and the described i-th interval minimum value of adjustment is defined as into i+1 adjusts area Between minimum value, the numerical value of i-th token formation speed is defined as the interval maximum of the i+1 adjustment; The data comparison module relatively show that the absolute value of i-th ratio is more than the change threshold and i-th ratio During to bear, the numerical value of i-th token formation speed is defined as the interval minimum value of i+1 adjustment, by described i-th Adjust interval maximum and be defined as the interval maximum of the i+1 adjustment;
Second generation module, for will arbitrarily be selected in the i+1 determined from interval determination module adjustment interval A numerical value be set to the numerical value of the i+1 token formation speed;
Second sending module, for the i+1 token formation speed that second generation module is generated to be sent into institute State each node that object is accessed, each node accessed so as to the object by i-th token formation speed more It is newly the i+1 token formation speed, flow control is carried out according to the i+1 token number formation speed.
12. device according to any one of claim 7 to 11, it is characterised in that described device, also includes:
Speed setup module, obtains the i-th -1 token formation speed and the i-th -1 total token disappears for first acquisition module Before consumption speed, the minimum token formation speed of the node that the object is accessed is set according to the stream control target and is made with maximum Board formation speed;
Interval setup module, the numerical value of the described minimum token formation speed for the speed setup module to be set is defined as The interval minimum value of the i-th -1 adjustment, is defined as the i-th -1 adjustment interval by the numerical value of the maximum token formation speed Maximum;
3rd generation module, for from described the i-th -1 adjustment interval described the will to be set to by an optional numerical value The i-1 numerical value of token formation speed;
3rd sending module, for the i-th -1 token formation speed that the 3rd generation module is generated to be sent into institute Each node that object is accessed is stated, so that each node that the object is accessed generates speed according to the i-th -1 token Degree carries out flow control.
13. a kind of global coordination devices, it is characterised in that the global coordination device is included as described in any one of claim 7 to 12 Volume control device.
CN201410132180.9A 2014-04-02 2014-04-02 Flow control methods, device and equipment Active CN103929366B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410132180.9A CN103929366B (en) 2014-04-02 2014-04-02 Flow control methods, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410132180.9A CN103929366B (en) 2014-04-02 2014-04-02 Flow control methods, device and equipment

Publications (2)

Publication Number Publication Date
CN103929366A CN103929366A (en) 2014-07-16
CN103929366B true CN103929366B (en) 2017-07-07

Family

ID=51147449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410132180.9A Active CN103929366B (en) 2014-04-02 2014-04-02 Flow control methods, device and equipment

Country Status (1)

Country Link
CN (1) CN103929366B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740076B (en) * 2016-01-30 2019-06-21 华为技术有限公司 A kind of load-balancing method and device
US10374986B2 (en) * 2016-08-23 2019-08-06 Satori Worldwide, Llc Scalable, real-time messaging system
CN108270810B (en) * 2016-12-30 2021-08-13 北京国双科技有限公司 Media data access method and device
CN108270744B (en) * 2016-12-30 2021-05-07 北京国双科技有限公司 Media data access method and device
CN107547433B (en) * 2017-07-03 2020-12-22 创新先进技术有限公司 Method, device and equipment for current limiting based on token leaky bucket
CN107276827B (en) * 2017-07-25 2021-04-23 郑州云海信息技术有限公司 Method and device for realizing Qos in distributed storage system
CN109471713B (en) * 2017-09-07 2022-11-08 北京京东尚科信息技术有限公司 Method and device for inquiring information
CN108540557A (en) * 2018-04-16 2018-09-14 江苏润和软件股份有限公司 A kind of cloud application load dispatching method based on dynamic speed limit
CN109254726A (en) * 2018-08-16 2019-01-22 华为技术有限公司 QoS guarantee method, control node and system in distributed memory system
CN111078391A (en) * 2018-10-22 2020-04-28 阿里巴巴集团控股有限公司 Service request processing method, device and equipment
CN110753005A (en) * 2019-10-17 2020-02-04 腾讯科技(深圳)有限公司 Speed limiting method, device and system, electronic equipment and computer readable storage medium
CN112003795B (en) * 2020-07-17 2022-12-20 苏州浪潮智能科技有限公司 Method, system, equipment and storage medium for dynamically preventing traffic attack
CN112363673A (en) * 2020-11-12 2021-02-12 深圳大普微电子科技有限公司 Flow management method and system, solid state disk controller and solid state disk
CN114793216B (en) * 2022-06-22 2022-09-23 北京轻网科技有限公司 Token management and information sending method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101026561A (en) * 2007-02-09 2007-08-29 中兴通讯股份有限公司 Token bucket fill rate configuration method and device
CN101282305A (en) * 2008-05-22 2008-10-08 杭州华三通信技术有限公司 Bandwidth control method for distributed system as well as service plate
CN101778043A (en) * 2010-01-19 2010-07-14 华为技术有限公司 Method and device for dividing filling rate interval based on token bucket algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101026561A (en) * 2007-02-09 2007-08-29 中兴通讯股份有限公司 Token bucket fill rate configuration method and device
CN101282305A (en) * 2008-05-22 2008-10-08 杭州华三通信技术有限公司 Bandwidth control method for distributed system as well as service plate
CN101778043A (en) * 2010-01-19 2010-07-14 华为技术有限公司 Method and device for dividing filling rate interval based on token bucket algorithm

Also Published As

Publication number Publication date
CN103929366A (en) 2014-07-16

Similar Documents

Publication Publication Date Title
CN103929366B (en) Flow control methods, device and equipment
TWI628969B (en) Joint user clustering and power allocation method and base station using the same
CN106488289B (en) Audio sync playback method, apparatus and system
CN107729147A (en) Data processing method, control node and stream calculation system in stream calculation system
CN104980367A (en) Token bucket limiting speed method and apparatus
CN115412497B (en) Performance optimization method of BBR congestion control algorithm
WO2016197458A1 (en) Traffic control method and apparatus
CN108322487A (en) P2p nodes selection method and device and node updating method and device
CN105553827B (en) The message forwarding method of anonymity and communication delay is taken into account in a kind of Anonymizing networks
CN102387219B (en) Multi-network-card load balancing system and method
CN106911740A (en) A kind of method and apparatus of cache management
TW200818781A (en) A processor and a method for a processor
CN105094944B (en) A kind of virtual machine migration method and device
WO2017045640A1 (en) Associated stream bandwidth scheduling method and apparatus in data center
CN111897659B (en) Method, system and device for controlling service processing frequency and electronic equipment
CN104298556A (en) Allocation method and device for steam processing units
CN110753101B (en) Low-energy-consumption computing node selection and computing task allocation method in edge computing
CN107295103A (en) Node administration method based on centralized P2P system
CN108073445A (en) The back pressure processing method and system calculated based on distributed stream
CN106294445B (en) The method and device of data storage based on across computer room Hadoop cluster
CN108039717B (en) Capacity configuration method and device for converter station in multi-terminal flexible direct-current power grid
CN110636471A (en) Monitoring system based on WSN technology
CN104365158B (en) Data block length determines method, apparatus and user equipment
CN105516994A (en) Bandwidth distribution method and device
CN112600869B (en) Calculation unloading distribution method and device based on TD3 algorithm

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant