CN109861920A - A kind of method and device of elasticity current limliting - Google Patents

A kind of method and device of elasticity current limliting Download PDF

Info

Publication number
CN109861920A
CN109861920A CN201910041286.0A CN201910041286A CN109861920A CN 109861920 A CN109861920 A CN 109861920A CN 201910041286 A CN201910041286 A CN 201910041286A CN 109861920 A CN109861920 A CN 109861920A
Authority
CN
China
Prior art keywords
token
rate
request
current
token bucket
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.)
Pending
Application number
CN201910041286.0A
Other languages
Chinese (zh)
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.)
Shenzhen Ronghui Tongjin Technology Co Ltd
Original Assignee
Shenzhen Ronghui Tongjin Technology 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 Shenzhen Ronghui Tongjin Technology Co Ltd filed Critical Shenzhen Ronghui Tongjin Technology Co Ltd
Priority to CN201910041286.0A priority Critical patent/CN109861920A/en
Publication of CN109861920A publication Critical patent/CN109861920A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention is suitable for the technical field of network-control, provide a kind of method and device of elastic current limliting, it include: token to be launched to token bucket according to scheduled rate, and count the request response abnormality rate in first preset duration every the first preset duration during launching token to token bucket;The current dispensing rate of the token and the current capacities of the token bucket are adjusted according to the request response abnormality rate dynamic.The present invention is by request response abnormality rate and requests the granting rate of failure rate dynamic adjustment token and the capacity of token bucket, realizes the mode of elasticity limitation request flow, the flexibility with higher compared with traditional token bucket algorithm.

Description

A kind of method and device of elasticity current limliting
Technical field
The invention belongs to network control technology field more particularly to a kind of method and device of elastic current limliting, terminal device, Computer readable storage medium.
Background technique
Token bucket algorithm is originally derived from computer network, and in transmitted data on network, network congestion in order to prevent needs to limit The flow of system outflow network, is sent out flow with relatively uniform speed.Token bucket algorithm is achieved that this function, can Control is sent to the number of data on network, and allows the transmission of bursty data.Token bucket algorithm is shaping network flow Most-often used a kind of algorithm in (Traffic Shaping) and rate limit (Rate Limiting).In typical case, it enables Board bucket algorithm is used to control the number for the data being sent on network, and allows the transmission of bursty data.Fixed-size token Bucket voluntarily can be constantly be generated token with constant rate in a steady stream.If token is not consumed, or the speed being consumed is less than The speed of generation, token will constantly increase, fill up until bucket.The token generated again below will be overflowed from bucket.Most The highest number of tokens that can be saved in bucket afterwards is never more than the size of bucket.The data packet for being transmitted to token bucket, which needs to consume, to be enabled Board.The token quantity of different size of data packet, consumption is different.This controlling mechanism of token bucket is based on whether depositing in token bucket In token come indicate when can be with transmitted traffic.If there are tokens in token bucket, allow transmitted traffic;And if enabled Token is not present in board bucket, then does not allow transmitted traffic.Therefore, if burst thresholding is reasonably configured and had in token bucket Enough tokens, then flow can be sent with peak rate.
Although traditional token bucket algorithm can effectively limit message transmission rate, the transmission rate within the set time Maximum can only be the upper limit of token bucket size.Adjust automatically token bucket size or token speed cannot be provided according to the actual situation, Cause current limliting flexibility poor.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method and devices of elastic current limliting, to solve in the prior art The poor technical problem of current limliting flexibility.
The first aspect of the embodiment of the present invention provides a kind of method of elastic current limliting, comprising:
Token is launched to token bucket according to scheduled rate, and default every first during launching token to token bucket Duration counts the request response abnormality rate in first preset duration;
According to the request response abnormality rate dynamic adjust the token current dispensing rate and the token bucket Current capacities.
The second aspect of the embodiment of the present invention provides a kind of device of elastic current limliting, comprising:
Statistic unit, for pre- every the first preset duration statistics described first during launching token to token bucket If the request response abnormality rate in duration;
Control unit, for launching token to token bucket according to scheduled rate;According to the request response abnormality rate dynamic Adjust the current dispensing rate of the token and the current capacities of the token bucket.
The third aspect of the embodiment of the present invention provides a kind of terminal device of elastic current limliting, including memory, processor And the computer program that can be run in the memory and on the processor is stored, the processor executes the meter The step of above-mentioned first aspect and/or second aspect the method are realized when calculation machine program.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program realizes above-mentioned first aspect and/or second party when being executed by processor The step of face the method.
Existing beneficial effect is the embodiment of the present invention compared with prior art: in the present invention, firstly, being rung according to request It answers abnormal rate dynamic to reduce the granting rate of token and the capacity of token bucket, prevents overload.Secondly, according to request failure rate Dynamic promotes the granting rate of token and the capacity of token bucket, and then amplified flow entrance.Pass through above-mentioned request response abnormality rate Controller perturbation flow is realized in feedback regulation with request failure rate, with higher flexible compared with traditional token bucket algorithm Property.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art, can also be according to these attached drawings under the premise of not paying creative labor Obtain other attached drawings.
Fig. 1 is a kind of method implementation flow chart of elastic current limliting provided in an embodiment of the present invention;
Fig. 2 is step S102 specific implementation flow signal in a kind of method of elastic current limliting provided in an embodiment of the present invention Figure;
Fig. 3 is step S203 specific implementation flow signal in a kind of method of elastic current limliting provided in an embodiment of the present invention Figure;
Fig. 4 is the implementation process signal of the feedback regulation in a kind of method of elastic current limliting provided in an embodiment of the present invention Figure;
Fig. 5 is a kind of schematic diagram of the device of elastic current limliting provided in an embodiment of the present invention;
Fig. 6 is a kind of schematic diagram of the terminal device of elastic current limliting provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
With the development of network technology, the continuous rapid growth of IP operation.Improving the quality that information is transmitted on ip networks is The developing key point of IP network.The exploitation of IP QoS technology, purpose are exactly to provide to service end to end for user's request Quality assurance, by packet classification, congestion management, it is crowded avoid, rate limit and flow shape technique realize Service Quality Amount control has used token bucket algorithm mainly in its rate limit and traffic shaping to assess the logical of unit time interior request Whether excessive be more than specified value.And the dispensing rate of token bucket capacity and token in traditional token bucket algorithm is fixed number Value, this token bucket processing mode just seem weaker in the processing capacity of burst flow, that is to say, that when there are biggish prominent When sending out flow, token bucket may can not handle request due to not enough tokens, and request processing flow is discontinuous, sometimes Request is caused to abandon because of token lazy weight.Just seem when in face of a large amount of network request and extremely limit to, flexibility is poor. In order to solve the poor technical problem of conventional token bucket algorithm flexibility, the invention proposes a kind of methods of elastic current limliting, ask It is a kind of method implementation flow chart of elastic current limliting provided in an embodiment of the present invention referring to Fig. 1, Fig. 1.A kind of bullet as shown in Figure 1 The method of property current limliting includes:
S101 launches token to token bucket according to scheduled rate, and every the during launching token to token bucket One preset duration counts the request response abnormality rate in first preset duration.
The token bucket is the storage inside pond of the network equipment, and for accommodating the token, the token is then with default Rate pad to the token bucket virtual information packet.And the token that each request requires matching respective numbers could be sent out It send to server.The length of time that the token bucket fills up is total to by the dispensing rate of the token bucket capacity and the token With decision.
The scheduled rate, which refers to, launches token to token bucket with preset constant rate of speed.Such as: by the pre- of the token It is if rate is set as 8000bit/s, i.e., per second that 8000 tokens are put into bucket, it just need to be from the order when often passing through a request The token of corresponding number is removed in board bucket.When the token described in the token bucket exhausts, subsequent request is considered as surpassing Outflow limitation, and the flow exceeded will take additional processing, the processing includes delay or discarding etc..
The request response abnormality is to cause server response abnormality since server access amount is excessive.And request is caused to ring The reason of answering abnormal reason very much, response abnormality requested described in the embodiment of the present invention including but not limited to response timeout, HTTP500 mistake etc..The request response abnormality need to be controlled by flow of the token bucket algorithm to request, and then alleviated and asked The problem of seeking response abnormality.
In the present embodiment before adjusting the token and launching rate and the token bucket capacity, the request need to be responded different Normal rate is counted, as the benchmark for adjusting the current dispensing rate of the token and the token bucket current capacities.It is described Requesting response abnormality rate is the accounting of response abnormality quantity in the request number of responses in the first preset duration, wherein every section Preset duration is continuous, and every section of preset duration requires respectively to the current dispensing rate of the token and the token Bucket current capacities are adjusted, and first preset duration is exactly one section therein.
S102, according to the current dispensing rate for requesting response abnormality rate dynamic to adjust the token and the token The current capacities of bucket.
Wherein, the dispensing rate of the token is adjusted for being requested in Units of Limitation duration through quantity, and adjusts institute State token bucket capacity be used for limit momentary request by quantity, to guarantee that the load of server is in reasonable range. The token launches rate and the capacity of the token bucket adjusts correlation.The same of rate is launched in dynamic adjustment token When, token bucket capacity is limited.
Specifically, the current dispensing of the token is adjusted described in step S102 according to the request response abnormality rate dynamic The current capacities of rate and the token bucket, specifically include: reducing working as the token according to the request response abnormality rate The preceding current capacities for launching rate and the token bucket.
The request response abnormality rate is to generate such exception since the quantity requested in the unit time is too high.Therefore, When can reduce unit by reducing the current dispensing rate of the token and the current capacities of the token bucket, and then passing through The quantity of interior request alleviates response abnormality rate.And according to the response abnormality rate adjust the token dispensing rate and The range of the capacity of the token bucket depending on needing according to actual needs, reduces request percent of pass, it is also possible to cause net simply Network blocking.
Specifically, the current dispensing rate and the order that the token is reduced according to the request response abnormality rate The current capacities of board bucket, specifically include: reducing the percentage of the current dispensing rate of the token and reduce the token bucket Current capacities percentage, be equal to or be greater than the request response abnormality rate.
It, can be according to the current capacities for the percentage and the token bucket for launching rate in order to accurately adjust network flow Percentage is accurately adjusted, such as: if first preset duration is 60s, count the total quantity of request response in 60s with And the quantity of request response abnormality, calculate the request response abnormality rate.It is requested if one shares 6000 times, 1000 time-out, 1000 return 500 mistakes of http, then request response abnormality rate=(the 1000+1000)/6000=33%, according to described It requests response abnormality rate to reduce the token and provides rate.If current 1s provides 100 tokens, by the throwing of the token Putting speed adjust is 100 × (1-0.33)=67, that is, is adjusted to 67 tokens of granting per second, while the token bucket being held Amount reduces by 2000.And the token is reduced in order to guarantee server in a normal loading range in actually adjustment The percentage of the current capacities of the current percentage for launching rate and the token bucket is equal to or is greater than the request and responds Abnormal rate.
Wherein, when a request is received, only when having enough tokens in the token bucket, request just allows to send out It send to server.Token in the token bucket can be not only removed, and can also equally be added inward.Therefore, in order to protect Card request can be transmitted to server, it is necessary to ceaselessly toward in bucket plus token.It can be seen that the dispensing speed of the token and The token bucket capacity just determines that requests in the unit time passes through quantity.By adjusting the token and the token bucket Capacity limits the use of flow and its resource, guarantees better network service.
In the present embodiment, response abnormality rate is requested in preset duration by counting, the dispensing speed of feedback regulation token The capacity of rate and token bucket, and then control request in the unit time and pass through quantity, it prevents server overload and request is caused to ring Should be abnormal, guarantee network service quality, compared with traditional token bucket algorithm, the present invention passes through the feedback regulation control unit time Interior request realizes elasticity limitation request flow, improves the flexibility of token bucket algorithm by quantity.
Specifically, in the present embodiment, it is contemplated that reduce the throwing of the token by response abnormality rate in step s 102 The capacity of rate and the token bucket is put, and then controls request in the unit time and passes through quantity, although can prevent server from going out The risk now overloaded.But when in face of burst big flow request, it may result in network blockage or request lost.Therefore this reality It applies example and provides a kind of concrete implementation mode of step S102.It is counted in first preset duration every the first preset duration Response abnormality rate is requested, after the request response abnormality rate in each section of the first preset duration that obtains, the request is rung It answers the value of abnormal rate to be judged, when the response abnormality rate is greater than preset threshold, thens follow the steps S201, otherwise, execute Step S202.Fig. 2 is referred to, Fig. 2 is that step S102 is specifically real in a kind of method of elastic current limliting provided in an embodiment of the present invention Existing flow diagram.As shown in Fig. 2, step S102 in above-mentioned embodiment illustrated in fig. 1, especially by following steps S201 to S203 It realizes:
S201 reduces the order according to the request response abnormality rate when the response abnormality rate is greater than preset threshold The current dispensing rate of board and the current capacities of the token bucket.
The threshold value can be arranged according to real network demand.When the response abnormality rate is greater than preset threshold, clothes are indicated Device amount of access of being engaged in is excessive.It can be according to the current dispensing rate for requesting response abnormality rate reduce the token and the token The current capacities of bucket, and then request is mitigated server burden, is made the response abnormality rate, reached by quantity in the unit time In normal range (NR), i.e., the described response abnormality rate is less than or equal to the preset threshold.
S202 is then counted in the second preset duration when the response abnormality rate is less than or equal to the preset threshold Request failure rate.
When the response abnormality rate is less than or equal to the preset threshold, indicate that current server request amount is in normal Or reduced levels.If continuing according to the dispensing rate of the token at this time and the capacity of the token bucket in the unit time When number of requests is limited, when number of requests increases suddenly in the unit time, then it may cause a large amount of requests and lost It abandons or postpones, cause network blockage.In order to cope with the problem of causing network blockage when number of requests increases suddenly.Therefore this implementation Example by the response abnormality rate be less than or equal to the preset threshold when, according to the request failure rate in the second preset duration Judge whether to need to adjust the dispensing rate of the token and the capacity of the token bucket, adaptively control to the unit time Interior request causes network blockage by quantity, to solve the problems, such as in the unit time that number of requests increases suddenly.
Specifically, the request failure rate in the second preset duration is counted described in step S202, is specifically included: pre- second If in duration when a request is received, if the token quantity in the token bucket be unsatisfactory for the request needed for token quantity, Then suspend or abandon the request, and labeled as request failure, request failure quantity is added 1.
A certain number of tokens are stored in the token bucket, are asked when the quantity of the token meets one or more When asking, request continues to forward, while the token for corresponding number being deleted in the token bucket.Do not have when in the token bucket When enough tokens, any request all can be dropped or postpone, and labeled as request failure, request failure quantity is added 1.
As an embodiment of the present invention, in the capacity for the dispensing rate and the token bucket for adjusting the token Afterwards.When a request is received, token quantity of the token quantity in the token bucket needed for request is compared, if having foot Enough tokens then request to be sent to server, abandon or cache if without enough tokens.Make the flow restriction of request one It is a it is reasonable within the scope of.
As another embodiment of the invention, when receiving request, if there is token in the token bucket, no matter quantity is No enough, the request all can be transmitted to server and can owe that is, when token quantity is less than the required token quantity of request Debt forwarding.The debt forwarding refers to that after time forwarding is requested, token number is negative in the token bucket, adds token when next time When, debt due is first paid off, forwarding request is further continued for.This processing method has compared with the former when handling burst request excellent Gesture can guarantee the continuity that request is sent.
S203, according to the request failure rate dynamic adjust the token current dispensing rate and the token bucket Current capacities.
Specifically, the current dispensing speed of the token is adjusted according to the request failure rate dynamic described in step S203 The current capacities of rate and the token bucket, specifically include: the current dispensing of the token is improved according to the request failure rate The current capacities of rate and the token bucket.
Such as: second preset duration be 60s, then count do not have in 60s application arrive token number of requests, than if any 60.If current 1s provides 100 tokens, it is 100+ (60/60)=101 that token, which is provided speed adjust, i.e. 1s provides 101 A token.Token bucket capacity is increased by 60 simultaneously.
Specifically, described according to the current dispensing rate for requesting failure rate to improve the token and the token bucket Current capacities, especially by following steps S301 to S302 realize, refer to Fig. 3, Fig. 3 is provided in an embodiment of the present invention one Step S203 specific implementation flow schematic diagram in the method for the elastic current limliting of kind.As shown in figure 3, described according to the request failure rate The current dispensing rate of the token and the current capacities of the token bucket are improved, are specifically included:
S301 improves the current of the token according to the default dispensing rate peak value of the token and the request failure rate Launch rate.
The current dispensing rate of the token and the current appearance of the token bucket are being improved according to the request failure rate When amount, in order to guarantee that the amount of access of server is in zone of reasonableness, it need to be limited by presetting the dispensing rate peak value of the token It makes the maximum of the token and launches rate.
S302 improves the current of the token bucket according to the preset capacity peak value of the token bucket and the request failure rate Capacity.
The current dispensing rate of the token and the current appearance of the token bucket are being improved according to the request failure rate When amount, in order to guarantee that the amount of access of server is in zone of reasonableness, it need to be limited by presetting the capacity peak value of the token bucket The maximum capacity of the token bucket, further control unit time interior request passes through quantity.
It in the present embodiment, is the current dispensing rate and the order for promoting the token according to the request failure rate The current capacities of board bucket.Adaptive faculty when burst data request increases is not only increased, and request percent of pass control is existed In reasonable range, the mode of elastic current limliting is realized, improves the flexibility of token bucket algorithm.
Preferably, on the one hand the embodiment of the present invention passes through the dispensing speed for counting the request response abnormality rate reduction token Rate, to guarantee network service quality.On the other hand, in order to which the request of data for adapting to network burst increases, by being asked described in statistics Failure rate is asked to improve the dispensing rate of token.The two is the relationship adjusted jointly, and specific implementation refers to Fig. 4, and Fig. 4 is the present invention The implementation process schematic diagram of feedback regulation in a kind of method for elastic current limliting that embodiment provides.As shown in figure 4, by described Response abnormality rate and the request failure rate feedback regulation token is requested to provide rate, comprising:
S401 launches token to token bucket according to scheduled rate.
The scheduled rate includes the dispensing rate of initial setting up and is lost by the request response abnormality rate, the request It loses and launches rate made of rate feedback regulation.After the token launches token to token bucket according to scheduled rate, when receiving number Token quantity needed for whether meeting the request according to the token quantity judged in token bucket when requesting, if meeting the request institute The request is then sent to server by the token quantity needed, is abandoned or is prolonged if the token quantity needed for being unsatisfactory for the request The slow request, and labeled as request failure.
S402, statistics is every request response abnormality rate in the first preset duration.
Step S401, S402 corresponds to current-limiting method as shown in Figure 1.By counting every asking in the first preset duration Ask response abnormality rate, the dispensing speed of feedback regulation token.Especially by the dispensing speed for reducing token, and then when control unit Interior request mitigates server stress by quantity, reduces the request response abnormality rate, guarantees network service quality.
S403 judges to request whether response abnormality rate is higher than threshold value.
When the request response abnormality rate is too low, indicate that server is in the state of low-load, if in face of a large amount of number According to request, it may result in network blockage and cause the waste of hardware resource.So needing by judging that the request is abnormal loud Should rate size, be further processed, to prevent network blockage.
S404, the second preset duration of statistics is interior to request failure rate.
Step S403, S404, corresponding to current-limiting method as shown in Figure 2.By too low in the request response abnormality rate In the case where count and request failure rate in the second preset duration, improve the dispensing speed of token, and then increase and ask in the unit time It asks through quantity, prevents the phenomenon that network blockage is led to by the request response abnormality rate feedback regulation.
The embodiment of the present invention adjusts token according to the request failure rate and the request response abnormality rate common feedback Launch rate.It is shifting by the two, in face of different network transmission pressure states, the request in the unit time is passed through into number Amount control realizes the mode of elastic current limliting in reasonable range.
It should be noted that the method for elasticity current limliting provided by the present invention is suitable for all kinds of token bucket algorithms, including color Algorithm under blind mode: the algorithm under single speed list bucket algorithm, single speed twin-tub algorithm, double speed twin-tub algorithm and sense color state: single Single barrel of double-colored algorithm of rate, single-rate twin-tub three color algorithm, dual rate twin-tub three color algorithm.In all kinds of twin-tub algorithms, each The speed adjust of token bucket can unanimously can also be different, need to be depending on real network demand.
If the present invention provides a kind of devices 5 of elastic current limliting by Fig. 5, Fig. 5 is referred to, Fig. 5 is that the embodiment of the present invention provides A kind of elastic current limliting device schematic diagram, as shown in Figure 5 a kind of device of elastic current limliting include:
Statistic unit 51, for counting described first every the first preset duration during launching token to token bucket Request response abnormality rate in preset duration;
Control unit 52, for launching token to token bucket according to scheduled rate;It is dynamic according to the request response abnormality rate State adjusts the current dispensing rate of the token and the current capacities of the token bucket.
A kind of device of elastic current limliting provided by the invention, requests response abnormality rate by counting, instead in preset duration Feedback adjusts the dispensing rate of token and the capacity of token bucket, and then controls and request to prevent from servicing by quantity in the unit time Device overloads and leads to request response abnormality, guarantees network service quality, and compared with traditional token bucket algorithm, the present invention passes through anti- Feedback, which is adjusted, requests percent of pass in the control unit time, improve the flexibility of token bucket algorithm.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Fig. 6 is a kind of schematic diagram of the terminal device for elastic current limliting that one embodiment of the invention provides.As shown in fig. 6, should A kind of terminal device 6 of elastic current limliting of embodiment includes: processor 60, memory 61 and is stored in the memory 61 And the computer program 62 that can be run on the processor 60, such as a kind of program of elastic current limliting.The processor 60 is held The step in a kind of above-mentioned each embodiment of the method for elastic current limliting is realized when the row computer program 62, such as shown in Fig. 1 Step S101 to S102.Alternatively, the processor 60 realizes above-mentioned each Installation practice when executing the computer program 62 The function of middle each unit, such as the function of unit 51 to 52 shown in Fig. 5.
Illustratively, the computer program 62 can be divided into one or more units, one or more of Unit is stored in the memory 61, and is executed by the processor 60, to complete the present invention.One or more of lists Member can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 62 in a kind of terminal device 6 of elastic current limliting.For example, the computer program 62 can be divided It is as follows at acquiring unit and computing unit each unit concrete function:
Statistic unit, for pre- every the first preset duration statistics described first during launching token to token bucket If the request response abnormality rate in duration;
Control unit, for launching token to token bucket according to scheduled rate;According to the request response abnormality rate dynamic Adjust the current dispensing rate of the token and the current capacities of the token bucket.
A kind of terminal device 6 of elastic current limliting can be desktop PC, notebook, palm PC and cloud clothes Business device etc. calculates equipment.A kind of terminal device of elastic current limliting may include, but be not limited only to, processor 60, memory 61. It will be understood by those skilled in the art that Fig. 6 is only a kind of example of the terminal device 6 of elastic current limliting, do not constitute to one kind The restriction of the terminal device 6 of elastic current limliting may include components more more or fewer than diagram, or combine certain components, or The different component of person, such as a kind of terminal device of elastic current limliting can also be set including input-output equipment, network insertion Standby, bus etc..
Alleged processor 60 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 61 can be a kind of internal storage unit of the terminal device 6 of elastic current limliting, such as a kind of The hard disk or memory of the terminal device 6 of elastic current limliting.The terminal that the memory 61 is also possible to a kind of elastic current limliting is set The plug-in type hard disk being equipped on standby 6 External memory equipment, such as a kind of terminal device 6 of elastic current limliting, intelligent storage Block (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc.. Further, the memory 61 can also both include a kind of terminal device 6 of elastic current limliting internal storage unit or Including External memory equipment.The memory 61 is used to store the terminal of the computer program and a kind of elastic current limliting Other programs and data needed for equipment.The memory 61, which can be also used for temporarily storing, have been exported or will export Data.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed terminal device and method can pass through it Its mode is realized.For example, terminal device embodiment described above is only schematical, for example, the module or list Member division, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or Component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point is shown The mutual coupling or direct-coupling or communication connection shown or discussed can be through some interfaces, between device or unit Coupling or communication connection are connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment side All or part of the process in method can also instruct relevant hardware to complete, the computer by computer program Program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each The step of a embodiment of the method.Wherein, the computer program includes computer program code, the computer program code It can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can With include: can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the meter The content that calculation machine readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, It such as does not include electric carrier signal and telecommunications according to legislation and patent practice, computer-readable medium in certain jurisdictions Signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all Between protection scope of the present invention.

Claims (10)

1. a kind of method of elasticity current limliting, which is characterized in that the described method includes:
Token is launched to token bucket according to scheduled rate, and every the first preset duration during launching token to token bucket Count the request response abnormality rate in first preset duration;
According to it is described request response abnormality rate dynamic adjust the token current dispensing rate and the token bucket it is current Capacity.
2. the method as described in claim 1, which is characterized in that described according to the request response abnormality rate dynamic adjustment The dispensing rate and the token bucket capacity of token, comprising:
The current dispensing rate of the token and the current capacities of the token bucket are reduced according to the request response abnormality rate.
3. method according to claim 2, which is characterized in that described to reduce the token according to the request response abnormality rate Dispensing rate and the token bucket capacity, comprising:
It reduces the percentage of the current dispensing rate of the token and reduces the percentage of the current capacities of the token bucket, Equal to or more than the request response abnormality rate.
4. the method as described in claim 1, which is characterized in that described according to the request response abnormality rate dynamic adjustment The current dispensing rate of token and the current capacities of the token bucket, comprising:
When the response abnormality rate is greater than preset threshold, the current throwing of the token is reduced according to the request response abnormality rate Put the current capacities of rate and the token bucket;
When the response abnormality rate is less than or equal to the preset threshold, then the request failure in the second preset duration is counted Rate;
The current dispensing rate of the token and the current capacities of the token bucket are adjusted according to the request failure rate dynamic.
5. method as claimed in claim 4, which is characterized in that described to adjust the token according to the request failure rate dynamic Current dispensing rate and the token bucket current capacities, comprising:
The current dispensing rate of the token and the current capacities of the token bucket are improved according to the request failure rate.
6. method as claimed in claim 5, which is characterized in that described to improve working as the token according to the request failure rate The preceding current capacities for launching rate and the token bucket, comprising:
The current dispensing rate of the token is improved according to the default dispensing rate peak value of the token and the request failure rate;
The current capacities of the token bucket are improved according to the preset capacity peak value of the token bucket and the request failure rate.
7. method as claimed in claim 4, which is characterized in that the request failure rate in the second preset duration of the statistics, packet It includes:
In the second preset duration when a request is received, if the token quantity in the token bucket is unsatisfactory for needed for the request Token quantity, then suspend or abandon the request, and labeled as request failure, request failure quantity is added 1.
8. a kind of device of elasticity current limliting characterized by comprising
Statistic unit is used for during launching token to token bucket when the first preset duration statistics described first is default Request response abnormality rate in length;
Control unit, for launching token to token bucket according to scheduled rate;It is adjusted according to the request response abnormality rate dynamic The current dispensing rate of the token and the current capacities of the token bucket.
9. a kind of terminal device of elasticity current limliting, including memory, processor and storage are in the memory and can be in institute State the computer program run on processor, which is characterized in that the processor is realized when executing the computer program as weighed Benefit requires the step of any one of 1 to 7 the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 7 of realization the method.
CN201910041286.0A 2019-01-16 2019-01-16 A kind of method and device of elasticity current limliting Pending CN109861920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910041286.0A CN109861920A (en) 2019-01-16 2019-01-16 A kind of method and device of elasticity current limliting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910041286.0A CN109861920A (en) 2019-01-16 2019-01-16 A kind of method and device of elasticity current limliting

Publications (1)

Publication Number Publication Date
CN109861920A true CN109861920A (en) 2019-06-07

Family

ID=66895036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910041286.0A Pending CN109861920A (en) 2019-01-16 2019-01-16 A kind of method and device of elasticity current limliting

Country Status (1)

Country Link
CN (1) CN109861920A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110493213A (en) * 2019-08-13 2019-11-22 北京奇艺世纪科技有限公司 Access control method, device and electronic equipment based on the response time
CN110572329A (en) * 2019-07-08 2019-12-13 紫光云技术有限公司 network adaptive traffic shaping method and system
CN110730136A (en) * 2019-10-10 2020-01-24 腾讯科技(深圳)有限公司 Method, device, server and storage medium for realizing flow control
CN111404824A (en) * 2020-03-06 2020-07-10 北京字节跳动网络技术有限公司 Method, apparatus, electronic device and computer readable medium for forwarding a request
CN111817974A (en) * 2020-06-09 2020-10-23 平安科技(深圳)有限公司 Interface current limiting method, device and system based on token bucket and readable storage medium
CN112242959A (en) * 2019-07-16 2021-01-19 中国移动通信集团浙江有限公司 Micro-service current-limiting control method, device, equipment and computer storage medium
CN112312165A (en) * 2020-10-19 2021-02-02 中移(杭州)信息技术有限公司 Video distribution method and device and computer readable storage medium
CN113163236A (en) * 2020-01-22 2021-07-23 武汉瓯越网视有限公司 Data transmission method, device, equipment and storage medium based on frequency control
CN113422737A (en) * 2021-08-25 2021-09-21 阿里云计算有限公司 Flow control method, flow control equipment and storage medium
CN114172848A (en) * 2021-11-18 2022-03-11 新华三技术有限公司合肥分公司 Communication method and device
CN114760327A (en) * 2022-03-30 2022-07-15 阿里巴巴(中国)有限公司 Method and device for adjusting cloud disk resource allocation
CN115080657A (en) * 2021-03-10 2022-09-20 中国移动通信集团山东有限公司 Operation token distribution method, system and equipment applied to distributed storage
CN115277577A (en) * 2022-09-28 2022-11-01 平安银行股份有限公司 Data processing method, data processing device, computer equipment and computer readable storage medium
CN115277575A (en) * 2021-04-29 2022-11-01 中国移动通信集团浙江有限公司 Token bucket control method, device and storage medium
CN115297064A (en) * 2022-09-28 2022-11-04 武汉思创易控科技有限公司 Elastic bandwidth regulation and control method, storage medium and terminal
CN115460153A (en) * 2022-07-26 2022-12-09 青岛海尔科技有限公司 Dynamic adjustment method for token bucket capacity, storage medium and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1209861A1 (en) * 2000-11-22 2002-05-29 Telefonaktiebolaget L M Ericsson (Publ) Monitoring traffic in packet networks
US20030069970A1 (en) * 2001-10-04 2003-04-10 Kt Corporation Method for controlling traffic flow using token bucket
US6560195B1 (en) * 1998-08-27 2003-05-06 Marconi Communications, Inc. Method and apparatus for leaky bucket based out-bound shaping in an ATM scheduler
CN1835447A (en) * 2005-03-16 2006-09-20 华为技术有限公司 Realizing method of data stream constraint control
US20060268719A1 (en) * 2005-05-26 2006-11-30 Hitachi Communication Technologies, Ltd. Packet forwarding apparatus using token bucket algorithm and leaky bucket algorithm
CN102082693A (en) * 2011-02-15 2011-06-01 中兴通讯股份有限公司 Method and device for monitoring network traffic
CN107483351A (en) * 2017-07-13 2017-12-15 中国银联股份有限公司 A kind of current-limiting method and device
CN107623641A (en) * 2017-11-03 2018-01-23 湖南天冠电子信息技术有限公司 Method for limiting speed and device
CN109039937A (en) * 2018-09-26 2018-12-18 深圳壹账通智能科技有限公司 Dynamic current limiting method, apparatus, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6560195B1 (en) * 1998-08-27 2003-05-06 Marconi Communications, Inc. Method and apparatus for leaky bucket based out-bound shaping in an ATM scheduler
EP1209861A1 (en) * 2000-11-22 2002-05-29 Telefonaktiebolaget L M Ericsson (Publ) Monitoring traffic in packet networks
US20030069970A1 (en) * 2001-10-04 2003-04-10 Kt Corporation Method for controlling traffic flow using token bucket
CN1835447A (en) * 2005-03-16 2006-09-20 华为技术有限公司 Realizing method of data stream constraint control
US20060268719A1 (en) * 2005-05-26 2006-11-30 Hitachi Communication Technologies, Ltd. Packet forwarding apparatus using token bucket algorithm and leaky bucket algorithm
CN102082693A (en) * 2011-02-15 2011-06-01 中兴通讯股份有限公司 Method and device for monitoring network traffic
CN107483351A (en) * 2017-07-13 2017-12-15 中国银联股份有限公司 A kind of current-limiting method and device
CN107623641A (en) * 2017-11-03 2018-01-23 湖南天冠电子信息技术有限公司 Method for limiting speed and device
CN109039937A (en) * 2018-09-26 2018-12-18 深圳壹账通智能科技有限公司 Dynamic current limiting method, apparatus, computer equipment and storage medium

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572329A (en) * 2019-07-08 2019-12-13 紫光云技术有限公司 network adaptive traffic shaping method and system
CN110572329B (en) * 2019-07-08 2022-07-01 紫光云技术有限公司 Network adaptive traffic shaping method and system
CN112242959A (en) * 2019-07-16 2021-01-19 中国移动通信集团浙江有限公司 Micro-service current-limiting control method, device, equipment and computer storage medium
CN112242959B (en) * 2019-07-16 2022-10-14 中国移动通信集团浙江有限公司 Micro-service current-limiting control method, device, equipment and computer storage medium
CN110493213A (en) * 2019-08-13 2019-11-22 北京奇艺世纪科技有限公司 Access control method, device and electronic equipment based on the response time
CN110730136B (en) * 2019-10-10 2022-05-20 腾讯科技(深圳)有限公司 Method, device, server and storage medium for realizing flow control
CN110730136A (en) * 2019-10-10 2020-01-24 腾讯科技(深圳)有限公司 Method, device, server and storage medium for realizing flow control
CN113163236A (en) * 2020-01-22 2021-07-23 武汉瓯越网视有限公司 Data transmission method, device, equipment and storage medium based on frequency control
CN111404824A (en) * 2020-03-06 2020-07-10 北京字节跳动网络技术有限公司 Method, apparatus, electronic device and computer readable medium for forwarding a request
CN111817974A (en) * 2020-06-09 2020-10-23 平安科技(深圳)有限公司 Interface current limiting method, device and system based on token bucket and readable storage medium
CN111817974B (en) * 2020-06-09 2022-11-15 平安科技(深圳)有限公司 Interface current limiting method, device and system based on token bucket and readable storage medium
CN112312165A (en) * 2020-10-19 2021-02-02 中移(杭州)信息技术有限公司 Video distribution method and device and computer readable storage medium
CN115080657A (en) * 2021-03-10 2022-09-20 中国移动通信集团山东有限公司 Operation token distribution method, system and equipment applied to distributed storage
CN115277575A (en) * 2021-04-29 2022-11-01 中国移动通信集团浙江有限公司 Token bucket control method, device and storage medium
CN115277575B (en) * 2021-04-29 2023-09-05 中国移动通信集团浙江有限公司 Token bucket control method, device and storage medium
CN113422737B (en) * 2021-08-25 2022-01-11 阿里云计算有限公司 Flow control method, flow control equipment and storage medium
CN113422737A (en) * 2021-08-25 2021-09-21 阿里云计算有限公司 Flow control method, flow control equipment and storage medium
CN114172848B (en) * 2021-11-18 2024-02-09 新华三技术有限公司合肥分公司 Communication method and device
CN114172848A (en) * 2021-11-18 2022-03-11 新华三技术有限公司合肥分公司 Communication method and device
CN114760327A (en) * 2022-03-30 2022-07-15 阿里巴巴(中国)有限公司 Method and device for adjusting cloud disk resource allocation
CN114760327B (en) * 2022-03-30 2024-03-26 阿里巴巴(中国)有限公司 Cloud disk resource allocation adjusting method and device
CN115460153A (en) * 2022-07-26 2022-12-09 青岛海尔科技有限公司 Dynamic adjustment method for token bucket capacity, storage medium and electronic device
CN115460153B (en) * 2022-07-26 2024-03-22 青岛海尔科技有限公司 Dynamic adjustment method and device for token bucket capacity, storage medium and electronic device
CN115297064A (en) * 2022-09-28 2022-11-04 武汉思创易控科技有限公司 Elastic bandwidth regulation and control method, storage medium and terminal
CN115297064B (en) * 2022-09-28 2023-02-28 武汉思创易控科技有限公司 Elastic bandwidth regulation and control method, storage medium and terminal
CN115277577A (en) * 2022-09-28 2022-11-01 平安银行股份有限公司 Data processing method, data processing device, computer equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109861920A (en) A kind of method and device of elasticity current limliting
CN110276182B (en) API distributed current limiting realization method
USRE42726E1 (en) Dynamically modifying the resources of a virtual server
CN110830391A (en) Resource allocation method and device and cluster system
EP2466824B1 (en) Service scheduling method and device
CN102282546B (en) Resources control
US8542586B2 (en) Proportional bandwidth sharing of the excess part in a MEF traffic profile
CN107404443B (en) Queue cache resource control method and device, server and storage medium
CN102934403A (en) Controlling data transmission over a network
CN110572329B (en) Network adaptive traffic shaping method and system
CN111181873A (en) Data transmission method, data transmission device, storage medium and electronic equipment
WO2004004249A1 (en) Method and apparatus for load estimation and call admission control in a call processing environment
Mehra et al. Resource management for real-time communication: Making theory meet practice
CN112825511A (en) Switching network congestion management method, device, equipment and storage medium
US7933283B1 (en) Shared memory management
CN1988684B (en) Network process managing method and device
CN112995058B (en) Token adjusting method and device
EP2965562B1 (en) User equipment for mobile telecommunications and method for accessing a telecommunications network
CN109670932A (en) Credit data calculate method, apparatus, system and computer storage medium
JP6185562B2 (en) Duty cycle control in wireless networks
CN112492635B (en) Determination method and device for scheduling priority
CN114024913A (en) Network performance optimization method, device, equipment and storage medium
CN111314163A (en) Data packet transmission method and system
EP3363174B1 (en) A transmitting entity and method performed thereby for transmitting one or more data packets to a receiving entity
CN115242727B (en) User request processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Qianhai Shenzhen Hong Kong cooperation zone before Bay Road No. 1 building 201 room A (located in Shenzhen Qianhai business secretary Co. Ltd.)

Applicant after: Gangrong Technology Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Qianhai Shenzhen Hong Kong cooperation zone before Bay Road No. 1 building 201 room A (located in Shenzhen Qianhai business secretary Co. Ltd.)

Applicant before: SHENZHEN RONGHUI TONGJIN TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20190607

RJ01 Rejection of invention patent application after publication