CN107948084A - A kind of current-limiting method and device - Google Patents

A kind of current-limiting method and device Download PDF

Info

Publication number
CN107948084A
CN107948084A CN201711352072.2A CN201711352072A CN107948084A CN 107948084 A CN107948084 A CN 107948084A CN 201711352072 A CN201711352072 A CN 201711352072A CN 107948084 A CN107948084 A CN 107948084A
Authority
CN
China
Prior art keywords
filter
message
allocator
historical traffic
cycle
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.)
Granted
Application number
CN201711352072.2A
Other languages
Chinese (zh)
Other versions
CN107948084B (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201711352072.2A priority Critical patent/CN107948084B/en
Publication of CN107948084A publication Critical patent/CN107948084A/en
Application granted granted Critical
Publication of CN107948084B publication Critical patent/CN107948084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present embodiments relate to network technique field, more particularly to a kind of current-limiting method and device, applied in the current limiting unit including allocator and multiple filters, including:Allocator obtains the historical traffic information of each filter in multiple filters, and according to historical traffic information, determines the historical traffic accumulation mean of each filter;Allocator determines that at least history of existence flow accumulation average value exceedes the first filter of first threshold in multiple filters, and historical traffic accumulation mean is less than the second filter of first threshold;Allocator updates the message allocation strategy of first filter and/or the second filter.It can be seen that, allocator can dynamically update the message allocation strategy of first filter and/or the second filter, so as to realize the message allocation strategy of adaptive renewal first filter and/or the second filter, therefore, it can be distributed by the dynamic on-demand for the flow that leaves unused, the utilization rate of flow is lifted, so as to ensure the stability of system.

Description

A kind of current-limiting method and device
Technical field
The present embodiments relate to network technique field, more particularly to a kind of current-limiting method and device.
Background technology
In the prior art, in order to ensure the even running of business, generally require to limit the flow of transaction request, prevent Only external system, which unrestrictedly sends a large amount of transaction requests, causes core system vast resources to take, or even machine of delaying.
Common current-limiting method includes hardware current limliting and software current limliting.Hardware current limliting by buy specialty current limliting instrument come Outside access is limited, it is often costly, and can only be limited mostly based on the 4th layer protocol (TCP/IP), it is not clever enough It is living.Software current limliting is relatively low as cost and more flexible scheme be current industry mainstream.Current software limited current algorithm Mainly include following three kinds:
1st, counter algorithm:Limited by a simple counter it is per second can be by how many a requested services.
2nd, token bucket algorithm:Requested service is flowed out according to fixed speed by the leaky bucket of a fixed capacity.
3rd, token bucket algorithm:The bucket of one fixed capacity token is set, token is added toward bucket the inside according to fixed rate, when When bucket has been expired, token can be dropped, and when business reaches, equivalent amount is taken out from bucket according to the quantity of business Token, allows business to pass through.
However, although above-mentioned software limited current algorithm can be based on business and need to limit flowing of access, but the function of current limliting Relatively simple, the flow threshold for the adjusting different business that in face of complicated business demand when can not adaptively distributes, and reduces The utilization rate of floating resources, so as to reduce the stability of system.
The content of the invention
The embodiment of the present invention provides a kind of current-limiting method and device, can when in face of complicated business demand to realize The flow threshold distribution of adaptive adjusting different business, can lift the utilization rate of floating resources, so as to ensure system Stability.
The embodiment of the present invention provides a kind of current-limiting method, applied to the current limiting unit including allocator and multiple filters, This method includes:
The allocator obtains the historical traffic information of each filter in the multiple filter, and according to the history Flow information, determines the historical traffic accumulation mean of each filter;
The allocator determines that at least history of existence flow accumulation average value exceedes first threshold in the multiple filter First filter, and historical traffic accumulation mean be less than the first threshold the second filter;
The allocator updates the message allocation strategy of the first filter and/or second filter, the report Literary allocation strategy determines corresponding filter for keyword of the allocator in message.
Preferably, further include:
The allocator obtains message and determines the message the corresponding 3rd according to the message allocation strategy of each filter Filter;
The message is sent to the 3rd filter by the allocator;
When 3rd filter determines that current period not yet exceeds flow threshold, the message is sent.
Preferably, the allocator obtains message, including:
The allocator obtains message according to the default strategy that receives from each service queue;The reception plan is slightly different excellent The service queue of first level corresponds to different visitation frequencies, and priority is higher, and visitation frequency is higher.
Preferably, before the allocator obtains message according to default reception strategy from each service queue, further include: According to priority parameters entrained in message, the message is distributed into the service queue of respective priority.
Preferably, the historical traffic that any filter in the multiple filter is obtained by following equation (1) is accumulated Average value;
Formula (1)
Wherein, kiThe ratio of the flowing of access for being jth filter i-th of cycle and the flowing of access the i-th -1 cycle Value, uiFor weighted value of the jth filter i-th of cycle of setting, m is the history cycle sum of statistics, and L (j) is jth filtering Historical traffic accumulation mean of the device within m cycle, i is positive integer and 1≤i≤m, m are positive integer and m >=1, j are just whole Number and j >=1.
Preferably, the current limiting unit at least two, the message allocation strategy of the middle allocator of each current limiting unit is not Together.
The embodiment of the present invention also provides a kind of current-limiting apparatus, applied to the current limliting list for including allocator and multiple filters Member, the device include:
Acquisition module, for obtaining the historical traffic information of each filter in the multiple filter, and according to described Historical traffic information, determines the historical traffic accumulation mean of each filter;
Determining module, for determining that at least history of existence flow accumulation average value is more than the first threshold in the multiple filter The first filter of value, and historical traffic accumulation mean are less than the second filter of the first threshold;
Update module, it is described for updating the message allocation strategy of the first filter and/or second filter Message allocation strategy determines corresponding filter for keyword of the allocator in message.
Preferably, further include:Sending module;
The acquisition module, is additionally operable to obtain message and determines the message pair according to the message allocation strategy of each filter The 3rd filter answered;
The sending module, for the message to be sent to the 3rd filter, so that the 3rd filter is true When determining current period and not yet exceeding flow threshold, the message is sent.
Preferably, the acquisition module, is specifically used for:
Message is obtained from each service queue according to the default strategy that receives, it is described to receive the business that strategy is different priorities Queue corresponds to different visitation frequencies, and priority is higher, and visitation frequency is higher.
Preferably, the acquisition module, is additionally operable to:
Before the allocator obtains message according to default reception strategy from each service queue, taken according in message The priority parameters of band, the message is distributed into the service queue of respective priority.
Preferably, the historical traffic that any filter in the multiple filter is obtained by following equation (1) is accumulated Average value;
Formula (1)
Wherein, kiThe ratio of the flowing of access for being jth filter i-th of cycle and the flowing of access the i-th -1 cycle Value, uiFor weighted value of the jth filter i-th of cycle of setting, m is the history cycle sum of statistics, and L (j) is jth filtering Historical traffic accumulation mean of the device within m cycle, i is positive integer and 1≤i≤m, m are positive integer and m >=1, j are just whole Number and j >=1.
Preferably, the current limiting unit at least two, the message allocation strategy of the middle allocator of each current limiting unit is not Together.
Another embodiment of the present invention provides a kind of computing device, it includes memory and processor, wherein, the storage Device is instructed for storage program, and the processor is used to call the programmed instruction stored in the memory, according to the journey of acquisition Sequence performs any of the above-described kind of method.
Another embodiment of the present invention provides a kind of computer-readable storage medium, and the computer-readable recording medium storage has Computer executable instructions, the computer executable instructions are used to make the computer perform any of the above-described kind of method.
A kind of current-limiting method and device that above-described embodiment provides, applied to the current limliting including allocator and multiple filters In unit, including:The allocator obtains the historical traffic information of each filter in the multiple filter, and according to described Historical traffic information, determines the historical traffic accumulation mean of each filter;The allocator is determined in the multiple filter At least history of existence flow accumulation average value exceedes the first filter of first threshold, and historical traffic accumulation mean is less than institute State the second filter of first threshold;The allocator updates the message of the first filter and/or second filter Allocation strategy, the message allocation strategy determine corresponding filter for keyword of the allocator in message.Can To find out, allocator determines the historical traffic accumulation mean of each filter first according to the historical traffic information of each filter, The historical traffic accumulation mean of each filter is then based on, judges whether historical traffic accumulation mean more than the first threshold The first filter of value, and historical traffic accumulation mean are less than the second filter of the first threshold, if it is present point Device is sent to update the message allocation strategy of the first filter and/or second filter, it is adaptive so as to realize Update the message allocation strategy of first filter and/or second filter.Due to adjusting different business that can be adaptive Flow threshold distribution, therefore, it is possible to by leave unused flow dynamic on-demand distribute, the utilization rate of flow is lifted, so as to ensure The stability of system.
Brief description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced.
Fig. 1 is a kind of flow diagram of current-limiting method provided in an embodiment of the present invention;
Fig. 2 is flowing of access fluctuation tendency schematic diagram provided in an embodiment of the present invention;
Fig. 3 is the structure diagram of two current limiting units provided in an embodiment of the present invention;
Fig. 4 is a kind of structure diagram of current-limiting apparatus provided in an embodiment of the present invention.
Embodiment
In order to which the purpose of the present invention, technical solution and beneficial effect is more clearly understood, below in conjunction with attached drawing and implementation Example, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only explaining this hair It is bright, it is not intended to limit the present invention.
Fig. 1 illustrates a kind of flow diagram of current-limiting method provided in an embodiment of the present invention, this method application In the current limiting unit including allocator and multiple filters, as shown in Figure 1, this method may include:
S101, allocator obtain the historical traffic information of each filter in multiple filters.
S102, allocator according to the historical traffic information of each filter, determine each filter historical traffic add up it is flat Average.
S103, allocator judge whether at least history of existence flow progressive average exceedes first threshold in multiple filters First filter, and historical traffic accumulation mean be less than second threshold the second filter, if it is present going to step S104, otherwise terminates flow.
The message allocation strategy of S104, allocator renewal first filter and/or the second filter, message allocation strategy are used Corresponding filter is determined in keyword of the allocator in message.
In above-mentioned steps S102, allocator can obtain any filter in multiple filters by following equation (1) Historical traffic accumulation mean;
In formula (1), kiFor flowing of access of the jth filter i-th of cycle and the flowing of access the i-th -1 cycle Ratio, uiFor weighted value of the jth filter i-th of cycle of setting, m is the history cycle sum of statistics, and L (j) is jth Historical traffic accumulation mean of the filter within m cycle, i is positive integer and 1≤i≤m, m are positive integer and m >=1, j are Positive integer and j >=1.
Wherein, kiIt can be calculated by following equation (2).
In formula (2), qiFor the flowing of access in i-th of cycle, qi-1For the flowing of access in the i-th -1 cycle, kiFor jth mistake The ratio of flowing of access of the filter i-th of cycle and the flowing of access the i-th -1 cycle.
In the specific implementation, amount of cycles that can also be in a period of time and according to above-mentioned formula (2), when determining this section The flowing of access fluctuation tendency figure of interior filter.
For example, in one embodiment, can be using the cycle as abscissa, with the obtained value of formula (2) for ordinate, really The flowing of access fluctuation tendency figure of the filter in a period of time is determined, referring to Fig. 2.
In fig. 2, using the history flowing of access in i-1, i, i+1, i+2, i+3, i+4, i+5, i+6 totally 8 cycles as horizontal seat Target value, the ratio then calculated using above-mentioned formula (2) between latter cycle and the flowing of access of previous cycle are sat as vertical Target value, then can obtain 7 points, then by the rough connection of 7 point dotted lines, then can obtain filter shown in Fig. 2 Flowing of access fluctuation tendency figure.
If from figure 2 it can be seen that ki> 1, then show flowing of access than previous moment increase, if ki< 1, then table Bright flowing of access is reduced than previous moment.
After the ratio between latter cycle and the flowing of access of previous cycle is obtained according to above-mentioned formula (2), then may be used The historical traffic accumulation mean of filter is calculated using above-mentioned formula (1).
It should be noted that obtained according to above-mentioned formula (2) between latter cycle and the flowing of access of previous cycle After ratio, the historical traffic accumulation mean of filter is calculated before, it is necessary to set i-th of cycle using above-mentioned formula (1) Weighted value, set i-th of cycle weighted value, can will closer to current time cycle set higher weighted value.Example Such as, in above-mentioned Fig. 2, the weighted value in the i-th+6 cycles can be arranged to 1, the weighted value in the i-th+5 cycles is arranged to 0.8, The weighted value in the i-th+4 cycles is arranged to 0.7, the weighted value in the i-th+3 cycles is arranged to 0.6, by the i-th+2 cycles Weighted value is arranged to 0.5, and the weighted value in i+1 cycle is arranged to 0.4, and the weighted value in i-th of cycle is arranged to 0.3.
In the history flowing of access for m cycle, when setting the weighted value in i-th cycle, if what is set is all small In 1 numerical value, then if L (j) > 1, then it represents that short-term history flow be in increasing trend, it is necessary to borrow flowing of access, and with L (j) difference between first threshold determines to need the flow borrowed, if L (j)≤1, then it represents that short-term history flow is basic Balance, the difference between L (j) and second threshold determine to need the flow lent.Optionally, determining to need to borrow flow When, the flow value storage that can borrow the mark for the filter for needing to borrow flow and needs is into a borrowing queue.Phase Answer, when determining to need to lend flow, the flow that the mark for the filter for needing to lend flow and needs can also be lent Value storage is into a lending queue.Then, allocator is stored according in the information and lending queue stored in borrowing queue Information, update message allocation strategy.
Optionally, allocator can also obtain the current traffic information of each filter in multiple filters, if filter Current traffic information be more than filter upper limit flow threshold, it is determined that the filter need borrow flow, it is necessary to borrowing Difference of the flow value between present flow rate and the upper limit flow threshold of the filter.For example, the present flow rate of filter Z is 5000/second, and the upper limit flow threshold of filter Z is 4000/second, then can determine that filter Z is needed from other filters The flow borrowed is 1000/second.Correspondingly, if the current traffic information of filter is less than the upper limit flow threshold of filter Value, it is determined that the filter needs to lend flow, it is necessary to difference of the flow lent between upper limit flow threshold and present flow rate Value, for example, the present flow rate of filter T is 2500/second, and the flow threshold of reaching the standard grade of filter T is 4000/second, then may be used It is 1500/second to determine filter T and can lend the flow that remaining filter uses.
Optionally, in the above example, if filter Z and filter T is in a current limiting unit, will can filter " 1000/second of flow that filter Z " and needs are borrowed is recorded in borrowing queue the identification information of device Z, by filter T's Identification information " 1500/second of flow that filter T " and needs are lent is recorded in lending queue, at this time, the current limiting unit Middle allocator finds that filter Z needs to borrow 1000/second of flow, and filter T can lend 1500/second, then allocator Allocation strategy can be changed, so that the original message for being sent to filter T is revised as being sent to filter Z, and corresponding modification The upper limit flow threshold of filter T and filter Z, for example, the upper limit flow threshold of filter Z is revised as from 4000/second 5000/second, and the upper limit flow threshold of filter T is revised as 3000/second from 4000/second.
In order to provide more accurate flexible flow control policy, current limiting unit at least two, each current limiting unit is using string The mode of connection connects, and the message allocation strategy of the allocator in each current limiting unit is different.
When current limiting unit is two, referring to Fig. 3.Include two current limiting units in figure 3, be respectively 1 He of current limiting unit Current limiting unit 2, wherein, current limiting unit 1 includes allocator and multiple filters, and current limiting unit 2 includes allocator and multiple filterings Device, in order to provide more accurate flexible flow control policy, different keywords pair is respectively adopted in the two current limiting units Message carries out current limliting, and the message for so reaching operation layer can be more accurate.For example, current limiting unit 1 according to the IP address of message to report The current limliting of text, current limiting unit 2 carry out current limliting according to service identifiers to message, then the data for reaching operation layer are both to have met to set in advance Fixed IP address meets the message of service identifiers set in advance again, and therefore, the message for reaching operation layer can be more accurate.
Before above-mentioned steps S101, reception system is after message is received, it is first determined excellent entrained by message First level parameter value, then according to priority parameter value entrained in message, message is placed into corresponding service queue.It Afterwards, allocator obtains message according to the default strategy that receives from each service queue, wherein, default reception plan is slightly different excellent The service queue of first level corresponds to different visitation frequencies, and priority is higher, and visitation frequency is higher, in this way, by setting priority not Same service queue, can avoid other business to high TPS (transaction per second, the things number of execution per second Amount) business seizes problem, improve the stability and quality of service of system.
For example, reception system is after message is received, it is first determined entrained priority parameter value in message, then By packet storage of the priority parameter value more than 0.6 0.5 or not carry excellent into service queue A, by priority parameter value The packet storage of first level parameter value is into service queue B, by packet storage of the priority parameter value less than 0.5 to service queue C In.
Afterwards, stored based on message of the priority parameter value stored in service queue A more than 0.6, in service queue B Priority parameters is 0.5 or do not carry the priority parameter value stored in the message of priority parameter value, service queue C and are less than 0.5 message formulates the reception strategy of allocator.
In one embodiment, the message bar number that allocator takes every time can be set identical, then priority is higher accesses frequency It is secondary higher, for example, stored based on message of the priority parameter value stored in service queue A more than 0.6, in service queue B Priority parameters is 0.5 or do not carry the priority parameter value stored in the message of priority parameter value, service queue C and are less than 0.5 message, the reception strategy for the allocator formulated are:5 messages are taken within 1 second from service queue A, take 20 reports every time Text;3 messages are taken within 1 second from service queue B, take 20 messages every time;1 message is taken within 1 second, takes 20 messages every time.
In another embodiment, the message bar number that allocator takes every time can be set different, then priority is higher takes Message bar number is more, for example, based in message of the priority parameter value stored in service queue A more than 0.6, service queue B The priority parameters of storage are 0.5 or do not carry the priority parameters stored in the message of priority parameter value, service queue C Message of the value less than 0.5, the reception strategy for the allocator formulated are:100 messages are taken within 1 second from service queue A, are obtained employment 70 messages are taken within 1 second in business queue B, take 50 messages within 1 second from service queue C.
Optionally, reception system is after message is received, after priority parameter value entrained in determining message, Different priority parameters can be placed into corresponding priority query.For example, reception system is after message is received, it is first Priority parameter value entrained in message is first determined, then by packet storage that priority parameters are 0.8 to service queue D In, the storage that is 0.5 by priority parameters be 0.4 into service queue D, by priority parameters storage into service queue F.
Message that the priority parameters for being then based on storing in service queue D are 0.8, store in service queue E it is preferential The message that message that level parameter is 0.5, the priority parameters stored in service queue F are 0.4 formulates the reception strategy of allocator.
In one embodiment, the message that allocator takes from service queue D, service queue E, service queue F every time Bar number is identical, and allocator takes the frequency of message to be calculated according to following equation (3) from service queue D.
Similarly, allocator takes the frequency of message to be calculated according to following equation (4) from service queue E, allocator The frequency of message is taken from service queue F to be calculated according to following equation (5).
According to the above as can be seen that allocator determines each filtering first according to the historical traffic information of each filter The historical traffic accumulation mean of device, is then based on the historical traffic accumulation mean of each filter, judges whether history Flow accumulation average value exceedes the first filter of first threshold, and historical traffic accumulation mean is less than the first threshold Second filter, if it is present allocator updates the first filter and/or the message distribution plan of second filter Slightly, so as to realize the message allocation strategy of adaptive renewal first filter and/or second filter.Due to energy The flow threshold distribution of enough adaptive adjusting different business, therefore, it is possible to be distributed by the dynamic on-demand for the flow that leaves unused, lifting The utilization rate of flow, so as to ensure the stability of system.And carry out multilayer flow filtering by multiple keywords, using the teaching of the invention it is possible to provide more For accurate flexible flow control policy.In addition, by setting the different service queue of priority, other business pair can be avoided High TPS business seizes problem, improves the stability and quality of service of system.
Based on identical technical concept, the embodiment of the present invention also provides a kind of current-limiting apparatus, applied to including allocator and The current limiting unit of multiple filters, as shown in figure 4, the device may include:
Acquisition module 401, for obtaining the historical traffic information of each filter in the multiple filter, and according to institute Historical traffic information is stated, determines the historical traffic accumulation mean of each filter;
Determining module 403, for determining that at least history of existence flow accumulation average value is more than in the multiple filter The first filter of one threshold value, and historical traffic accumulation mean are less than the second filter of the first threshold;
Update module 404, for updating the message allocation strategy of the first filter and/or second filter, The message allocation strategy determines corresponding filter for keyword of the allocator in message.
Preferably, further include:Sending module 402;
Acquisition module 401, is additionally operable to obtain message and determines the message pair according to the message allocation strategy of each filter The 3rd filter answered;
Sending module 402, for the message to be sent to the 3rd filter, so that the 3rd filter determines When current period not yet exceeds flow threshold, the message is sent.
Preferably, acquisition module 401, is specifically used for:
Message is obtained from each service queue according to the default strategy that receives, it is described to receive the business that strategy is different priorities Queue corresponds to different visitation frequencies, and priority is higher, and visitation frequency is higher.
Preferably, acquisition module 401, is additionally operable to:
Before the allocator obtains message according to default reception strategy from each service queue, taken according in message The priority parameters of band, the message is distributed into the service queue of respective priority.
Preferably, the historical traffic that any filter in the multiple filter is obtained by following equation (1) is accumulated Average value;
Formula (1)
Wherein, kiThe ratio of the flowing of access for being jth filter i-th of cycle and the flowing of access the i-th -1 cycle Value, uiFor weighted value of the jth filter i-th of cycle of setting, m is the history cycle sum of statistics, and L (j) is jth filtering Historical traffic accumulation mean of the device within m cycle, i is positive integer and 1≤i≤m, m are positive integer and m >=1, j are just whole Number and j >=1.
Preferably, the current limiting unit at least two, the message allocation strategy of the middle allocator of each current limiting unit is not Together.
An embodiment of the present invention provides a kind of computing device, which is specifically as follows desktop computer, portable Computer, smart mobile phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA) etc..The meter Central processing unit (Center Processing Unit, CPU), memory, input-output apparatus etc. can be included by calculating equipment, Input equipment can include keyboard, mouse, touch-screen etc., and output equipment can include display device, such as liquid crystal display (Liquid Crystal Display, LCD), cathode-ray tube (Cathode Ray Tube, CRT) etc..
Memory can include read-only storage (ROM) and random access memory (RAM), and provide storage to processor The programmed instruction and data stored in device.In embodiments of the present invention, memory can be used for the program for storing current-limiting method.
An embodiment of the present invention provides a kind of computer-readable storage medium, for saving as the calculating used in above-mentioned computing device Machine programmed instruction, it includes the program for performing above-mentioned current-limiting method.
The computer-readable storage medium can be any usable medium or data storage device that computer can access, bag Include but be not limited to magnetic storage (such as floppy disk, hard disk, tape, magneto-optic disk (MO) etc.), optical memory (such as CD, DVD, BD, HVD etc.) and semiconductor memory (such as it is ROM, EPROM, EEPROM, nonvolatile memory (NAND FLASH), solid State hard disk (SSD)) etc..
To sum up, a kind of current-limiting method and device provided in an embodiment of the present invention, applied to including allocator and multiple filterings In the current limiting unit of device, including:The allocator obtains the historical traffic information of each filter in the multiple filter, and According to the historical traffic information, the historical traffic accumulation mean of each filter is determined;The allocator determines the multiple At least history of existence flow accumulation average value exceedes the first filter of first threshold, and historical traffic cumulative mean in filter Second filter of the value less than the first threshold;The allocator updates the first filter and/or second filtering The message allocation strategy of device, the message allocation strategy determine corresponding mistake for keyword of the allocator in message Filter.As can be seen that allocator determines the historical traffic accumulation of each filter first according to the historical traffic information of each filter Average value, is then based on the historical traffic accumulation mean of each filter, judges whether that historical traffic accumulation mean surpasses The first filter of first threshold is crossed, and historical traffic accumulation mean is less than the second filter of the first threshold, if In the presence of then allocator updates the message allocation strategy of the first filter and/or second filter, so as to realize Adaptive renewal first filter and/or the message allocation strategy of second filter.Due to adjusting that can be adaptive The flow threshold distribution of different business, therefore, it is possible to be distributed by the dynamic on-demand for the flow that leaves unused, lifts the utilization rate of flow, So as to ensure the stability of system.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method or computer program product. Therefore, the present invention can be using the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Form.Deposited moreover, the present invention can use to can use in one or more computers for wherein including computer usable program code The shape for the computer program product that storage media is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram The combination of flow and/or square frame in journey and/or square frame and flowchart and/or the block diagram.These computer programs can be provided The processors of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices, which produces, to be used in fact The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or The instruction performed on other programmable devices is provided and is used for realization in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a square frame or multiple square frames.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation Property concept, then can make these embodiments other change and modification.So appended claims be intended to be construed to include it is excellent Select embodiment and fall into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art God and scope.In this way, if these modifications and changes of the present invention belongs to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these modification and variations.

Claims (14)

1. a kind of current-limiting method, it is characterised in that applied to the current limiting unit including allocator and multiple filters, this method bag Include:
The allocator obtains the historical traffic information of each filter in the multiple filter, and according to the historical traffic Information, determines the historical traffic accumulation mean of each filter;
The allocator determines in the multiple filter that at least history of existence flow accumulation average value exceedes the of first threshold One filter, and historical traffic accumulation mean are less than the second filter of the first threshold;
The allocator updates the message allocation strategy of the first filter and/or second filter, the message point With strategy corresponding filter is determined for keyword of the allocator in message.
2. the method as described in claim 1, it is characterised in that further include:
The allocator obtains message and determines corresponding 3rd filtering of the message according to the message allocation strategy of each filter Device;
The message is sent to the 3rd filter by the allocator;
When 3rd filter determines that current period not yet exceeds flow threshold, the message is sent.
3. the method as described in claim 1, it is characterised in that the allocator obtains message, including:
The allocator obtains message according to the default strategy that receives from each service queue;The reception strategy is different priorities Service queue correspond to different visitation frequencies, priority is higher, and visitation frequency is higher.
4. method as claimed in claim 3, it is characterised in that in the allocator according to the default strategy that receives from each business Before queue obtains message, further include:According to priority parameters entrained in message, the message is distributed to corresponding preferential In the service queue of level.
5. the method as described in claim 1, it is characterised in that obtained by following equation (1) in the multiple filter The historical traffic accumulation mean of any filter;
Formula (1)
Wherein, kiThe ratio of the flowing of access for being jth filter i-th of cycle and the flowing of access the i-th -1 cycle, ui For weighted value of the jth filter i-th of cycle of setting, m is the history cycle sum of statistics, and L (j) is jth filter in m Historical traffic accumulation mean in a cycle, i is positive integer and 1≤i≤m, m are positive integer and m >=1, j are positive integer and j ≥1。
6. method as claimed in claim 1, it is characterised in that the current limiting unit at least two, in each current limiting unit The message allocation strategy of allocator is different.
7. a kind of current-limiting apparatus, it is characterised in that applied to the current limiting unit including allocator and multiple filters, the device bag Include:
Acquisition module, for obtaining the historical traffic information of each filter in the multiple filter, and according to the history Flow information, determines the historical traffic accumulation mean of each filter;
Determining module, for determining that at least history of existence flow accumulation average value exceedes first threshold in the multiple filter First filter, and historical traffic accumulation mean are less than the second filter of the first threshold;
Update module, for updating the message allocation strategy of the first filter and/or second filter, the message Allocation strategy determines corresponding filter for keyword of the allocator in message.
8. device as claimed in claim 7, it is characterised in that further include:Sending module;
The acquisition module, is additionally operable to obtain message and determines that the message is corresponding according to the message allocation strategy of each filter 3rd filter;
The sending module, for the message to be sent to the 3rd filter, so that the 3rd filter determines to work as When the preceding cycle not yet exceeds flow threshold, the message is sent.
9. device as claimed in claim 7, it is characterised in that the acquisition module, is specifically used for:
Message is obtained from each service queue according to the default strategy that receives, it is described to receive the service queue that strategy is different priorities Corresponding different visitation frequency, priority is higher, and visitation frequency is higher.
10. device as claimed in claim 9, it is characterised in that the acquisition module, is additionally operable to:
Before the allocator obtains message according to default reception strategy from each service queue, according to entrained by message Priority parameters, the message is distributed into the service queue of respective priority.
11. device as claimed in claim 7, it is characterised in that obtained by following equation (1) in the multiple filter The historical traffic accumulation mean of any filter;
Formula (1)
Wherein, kiThe ratio of the flowing of access for being jth filter i-th of cycle and the flowing of access the i-th -1 cycle, ui For weighted value of the jth filter i-th of cycle of setting, m is the history cycle sum of statistics, and L (j) is jth filter in m Historical traffic accumulation mean in a cycle, i is positive integer and 1≤i≤m, m are positive integer and m >=1, j are positive integer and j ≥1。
12. device as claimed in claim 7, it is characterised in that the current limiting unit at least two, each current limiting unit The message allocation strategy of middle allocator is different.
A kind of 13. computing device, it is characterised in that including:
Memory, instructs for storage program;
Processor, for calling the programmed instruction stored in the memory, 1 to 6 is required according to the program execution profit of acquisition Any one of them method.
14. a kind of computer-readable storage medium, it is characterised in that the computer-readable storage medium is stored with computer and can perform finger Order, the computer executable instructions are used to make the computer perform claim require 1 to 6 any one of them method.
CN201711352072.2A 2017-12-15 2017-12-15 Current limiting method and device Active CN107948084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711352072.2A CN107948084B (en) 2017-12-15 2017-12-15 Current limiting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711352072.2A CN107948084B (en) 2017-12-15 2017-12-15 Current limiting method and device

Publications (2)

Publication Number Publication Date
CN107948084A true CN107948084A (en) 2018-04-20
CN107948084B CN107948084B (en) 2021-07-13

Family

ID=61943500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711352072.2A Active CN107948084B (en) 2017-12-15 2017-12-15 Current limiting method and device

Country Status (1)

Country Link
CN (1) CN107948084B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535779A (en) * 2019-08-30 2019-12-03 百度在线网络技术(北京)有限公司 Flow down method and device
CN112398747A (en) * 2020-11-03 2021-02-23 深圳壹账通智能科技有限公司 Current limiting method and device, computer equipment and storage medium
CN113839888A (en) * 2021-09-22 2021-12-24 唯品会(广州)软件有限公司 Current limiting method, device, equipment and readable storage medium
CN114025024A (en) * 2021-10-18 2022-02-08 中国银联股份有限公司 Data transmission method and device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1960306A (en) * 2005-11-02 2007-05-09 日本电气株式会社 Wireless line control system, centralized control apparatus, and wireless line control method
CN101179503A (en) * 2007-12-14 2008-05-14 华为技术有限公司 QoS implementing method and apparatus in wireless access network
CN101466124A (en) * 2007-12-19 2009-06-24 中国移动通信集团公司 Control method and system for network bandwidth
CN101651615A (en) * 2009-09-14 2010-02-17 中兴通讯股份有限公司 Method and device for scheduling messages
CN101790239A (en) * 2010-02-23 2010-07-28 中国电信股份有限公司 Packet dispatching method and forward service dispatcher
CN101997777A (en) * 2010-11-16 2011-03-30 福建星网锐捷网络有限公司 Interruption processing method, device and network equipment
CN103428870A (en) * 2012-05-22 2013-12-04 中兴通讯股份有限公司 Method and device for determining priority of access service
CN105763478A (en) * 2015-12-21 2016-07-13 中国电子科技集团公司第十五研究所 Token bucket algorithm-based satellite data ground transmission network flow control system
CN106559349A (en) * 2015-09-24 2017-04-05 阿里巴巴集团控股有限公司 The control method and device of service transmission rate, system
CN106921584A (en) * 2017-03-31 2017-07-04 武汉绿色网络信息服务有限责任公司 A kind of distributed network flow control method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1960306A (en) * 2005-11-02 2007-05-09 日本电气株式会社 Wireless line control system, centralized control apparatus, and wireless line control method
CN101179503A (en) * 2007-12-14 2008-05-14 华为技术有限公司 QoS implementing method and apparatus in wireless access network
CN101466124A (en) * 2007-12-19 2009-06-24 中国移动通信集团公司 Control method and system for network bandwidth
CN101651615A (en) * 2009-09-14 2010-02-17 中兴通讯股份有限公司 Method and device for scheduling messages
CN101790239A (en) * 2010-02-23 2010-07-28 中国电信股份有限公司 Packet dispatching method and forward service dispatcher
CN101997777A (en) * 2010-11-16 2011-03-30 福建星网锐捷网络有限公司 Interruption processing method, device and network equipment
CN103428870A (en) * 2012-05-22 2013-12-04 中兴通讯股份有限公司 Method and device for determining priority of access service
CN106559349A (en) * 2015-09-24 2017-04-05 阿里巴巴集团控股有限公司 The control method and device of service transmission rate, system
CN105763478A (en) * 2015-12-21 2016-07-13 中国电子科技集团公司第十五研究所 Token bucket algorithm-based satellite data ground transmission network flow control system
CN106921584A (en) * 2017-03-31 2017-07-04 武汉绿色网络信息服务有限责任公司 A kind of distributed network flow control method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535779A (en) * 2019-08-30 2019-12-03 百度在线网络技术(北京)有限公司 Flow down method and device
CN110535779B (en) * 2019-08-30 2020-09-11 百度在线网络技术(北京)有限公司 Traffic degradation method and device
CN112398747A (en) * 2020-11-03 2021-02-23 深圳壹账通智能科技有限公司 Current limiting method and device, computer equipment and storage medium
CN113839888A (en) * 2021-09-22 2021-12-24 唯品会(广州)软件有限公司 Current limiting method, device, equipment and readable storage medium
CN113839888B (en) * 2021-09-22 2024-02-27 唯品会(广州)软件有限公司 Current limiting method, device, equipment and readable storage medium
CN114025024A (en) * 2021-10-18 2022-02-08 中国银联股份有限公司 Data transmission method and device

Also Published As

Publication number Publication date
CN107948084B (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN107948084A (en) A kind of current-limiting method and device
JP6672423B2 (en) Database system and method for sharing resources based on auction
CN106453125B (en) A kind of remote service calling SiteServer LBS based on real time load rate
US9936458B2 (en) Battery power management for a mobile device
US7742961B2 (en) Methods, systems, and computer program products for managing services accounts through electronic budget adjustments based on defined rules
CN103210382B (en) Bus transaction based on bus unit health and fitness information and related power management in mediates communications bus
CN106681835B (en) The method and resource manager of resource allocation
US20110185364A1 (en) Efficient utilization of idle resources in a resource manager
CN111817974B (en) Interface current limiting method, device and system based on token bucket and readable storage medium
CN104168133B (en) The method and gateway and system of a kind of dynamic configuration API Access amount
CN111433745B (en) Dynamic capacity optimization of shared computing resources
CN107295090A (en) A kind of method and apparatus of scheduling of resource
US20160283366A1 (en) Methods and Systems for Managing Memory Allocation
CN110297698B (en) Multi-priority dynamic current limiting method, device, server and storage medium
CN106775990A (en) Request scheduling method and device
CN111614754B (en) Fog-calculation-oriented cost-efficiency optimized dynamic self-adaptive task scheduling method
CN107292741A (en) A kind of resource allocation methods and device
CN107943854A (en) Reference service inquiry method, apparatus and computer-readable recording medium
CN107025138A (en) A kind of method for processing resource and device
CN106817424A (en) Method and system for controlling flowing of access
CN110149603A (en) A kind of policy control method, equipment and system
CN113032233A (en) Distributed service cluster runtime parameter adaptive processing method, device and system
CN110020741A (en) The method, apparatus and electronic equipment of data prediction
CN112799824A (en) Current limiting method, device, equipment and storage medium
WO2022135089A1 (en) Wifi channel allocation method and device

Legal Events

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