CN110162409A - Control method and device - Google Patents

Control method and device Download PDF

Info

Publication number
CN110162409A
CN110162409A CN201810141995.1A CN201810141995A CN110162409A CN 110162409 A CN110162409 A CN 110162409A CN 201810141995 A CN201810141995 A CN 201810141995A CN 110162409 A CN110162409 A CN 110162409A
Authority
CN
China
Prior art keywords
service
amount
calling
caller
service call
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
CN201810141995.1A
Other languages
Chinese (zh)
Other versions
CN110162409B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810141995.1A priority Critical patent/CN110162409B/en
Publication of CN110162409A publication Critical patent/CN110162409A/en
Application granted granted Critical
Publication of CN110162409B publication Critical patent/CN110162409B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the present application discloses control method and device.One specific embodiment of this method comprises determining that whether the service call total amount in the current calling period is greater than preset first threshold;If so, determining the destination service caller of pending service call amount control and the destination service calling amount of the destination service caller based on current important index, the service call total amount and the preset calling safety value for calling the service caller in the period;Call the ratio of requested service call amount in the period as destination service calling rate in this prior the destination service calling amount and the destination service caller, in next calling period, controlled according to service call amount of the destination service calling rate to the destination service caller.This embodiment improves the flexibilities of the control to service call amount.

Description

Control method and device
Technical field
The invention relates to field of computer technology, and in particular to Internet technical field more particularly to controlling party Method and device.
Background technique
RPC (Remote Procedure Call, remote procedure call) is that one kind passes through network from remote computer program Upper request service, the agreement without understanding underlying network technology.It is the important hand interacted between multi-process that RPC, which is called, Section.For infrastructure service, it usually needs calling interface is provided to multiple service callers, to meet service caller to clothes The calling of business.Thus, in order to keep the availability of whole system or multiple systems, need to ensure that the RPC high of infrastructure service can With.However the bearing capacity of infrastructure service is limited, when the calling amount of infrastructure service is excessive (such as e-commerce platform exists During the big rush of product), can infrastructure service be collapsed, it is therefore desirable to control service call amount.
Existing mode is usually the calling amount threshold value being arranged in a period of time, after being more than the calling amount threshold value then no longer Receive service invocation request, until service call amount is less than the calling amount threshold value, to control service call amount.
Summary of the invention
The embodiment of the present application proposes control method and device.
In a first aspect, the embodiment of the present application provides a kind of control method, this method comprises: determining current call in the period Service call total amount whether be greater than preset first threshold;If so, based on the current weight for calling the service caller in the period Index, service call total amount and preset calling safety value are wanted, determines that the destination service of pending service call amount control is called The destination service calling amount of person and destination service caller;Destination service calling amount is called with destination service caller currently The ratio of requested service call amount is as destination service calling rate in period, in next calling period, according to target Service call rate controls the service call amount of destination service caller.
In some embodiments, determining whether the service call total amount in the current calling period is greater than preset first threshold After value, this method further include: in response to determining that service call total amount is not more than first threshold, whether determine service call total amount Less than preset second threshold;In response to determining that service call total amount is less than second threshold, based on it is current call it is in the period, Important index, service call total amount and the preset calling safety value of the service caller of controlled service call amount processed, determine The destination service caller of service call amount control in the service caller of controlled service call amount processed, to be released, releasing pair The control of the service call amount of destination service caller.
In some embodiments, first threshold and the difference of calling safety value are equal to the difference for calling safety value and second threshold.
In some embodiments, based on current important index, the service call total amount for calling the service caller in the period With preset calling safety value, the destination service caller and destination service caller of pending service call amount control are determined Destination service calling amount, comprising: service call total amount and the preset difference for calling safety value are determined as the limitation for needing to limit Service call total amount;Using the minimum service caller of significance level indicated by the current important index called in the period as mesh Service caller is marked, following calling amount rate-determining steps are executed: being requested in the currently calling period based on destination service caller Service call amount, the maximum of the lowest service calling rate of preset destination service caller and the destination service caller prestored Service call amount determines the value range of the destination service calling amount of destination service caller;Based on value range and limitation clothes Total amount is called in business, determines the destination service calling amount of destination service caller.
In some embodiments, based on current important index, the service call total amount for calling the service caller in the period With preset calling safety value, the destination service caller and destination service caller of pending service call amount control are determined Destination service calling amount, further includes: destination service caller is currently being called into requested service call amount and mesh in the period The difference of service call amount is marked as current limitation service call amount, in response to determining that current limitation service call amount is less than limitation clothes Total amount is called in business, and limitation service call total amount is used as with the currently difference of limitation service call amount and limits service call total amount, with Limitation service call total amount is updated, and according to indicated by the current important index for calling the service caller in the period The order of significance level from low to high chooses the service caller of next important index as destination service caller, continues to hold Row calling amount rate-determining steps.
In some embodiments, maximum service calling amount is asked in target histories call the period by destination service caller The service call amount asked, it is that the current upper service call total amount for calling the period is not more than the first threshold that target histories, which call the period, The history of value calls the period.
Second aspect, the embodiment of the present application provide a kind of control device, which includes: the first determination unit, configuration For determining whether the service call total amount in the current calling period is greater than preset first threshold;Second determination unit, configuration For if so, based on the current important index for calling the service caller in the period, service call total amount and preset calling peace The destination service of total head, the destination service caller and destination service caller that determine pending service call amount control is called Amount;Control unit is configured to destination service calling amount is requested in the currently calling period with destination service caller The ratio of service call amount is as destination service calling rate, in next calling period, according to destination service calling rate to mesh The service call amount of mark service caller is controlled.
In some embodiments, device further include: third determination unit is configured in response to determining that service call is total Amount is not more than first threshold, determines whether service call total amount is less than preset second threshold;4th determination unit, is configured to In response to determining that service call total amount is less than second threshold, based on it is current call it is in the period, be controlled service call amount processed Important index, service call total amount and the preset calling safety value of service caller, determination have been controlled service call amount processed The destination service caller of service call amount control in service caller, to be released, releases the clothes to destination service caller The control for calling amount of being engaged in.
In some embodiments, first threshold and the difference of calling safety value are equal to the difference for calling safety value and second threshold.
In some embodiments, the second determination unit includes: the first determining module, be configured to service call total amount and The preset difference for calling safety value is determined as the limitation service call total amount for needing to limit;First control module, be configured to by The minimum service caller of significance level indicated by the current important index called in the period is held as destination service caller The following calling amount rate-determining steps of row: requested service call amount in the period, pre- is currently being called based on destination service caller If destination service caller lowest service calling rate and the maximum service calling amount of destination service caller that prestores, determine The value range of the destination service calling amount of destination service caller;Based on value range and limitation service call total amount, determine The destination service calling amount of destination service caller.
In some embodiments, the second determination unit further include: the second control module is configured to call destination service Person's difference of requested service call amount and destination service calling amount in the currently calling period limits service call as current Amount, in response to determining that the current service call amount that limits is less than limitation service call total amount, by limitation service call total amount and currently The difference of service call amount is limited as limitation service call total amount, to be updated to limitation service call total amount, and according to working as The order of significance level from low to high indicated by the preceding important index for calling the service caller in the period is chosen next heavy It wants the service caller of index as destination service caller, continues to execute calling amount rate-determining steps.
In some embodiments, maximum service calling amount is asked in target histories call the period by destination service caller The service call amount asked, it is that the current upper service call total amount for calling the period is not more than the first threshold that target histories, which call the period, The history of value calls the period.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: one or more processors;Storage dress It sets, for storing one or more programs, when one or more programs are executed by one or more processors, so that one or more A processor realizes the method such as any embodiment in control method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence realizes the method such as any embodiment in control method when the program is executed by processor.
Control method provided by the embodiments of the present application and device, by determining that the service call in the current calling period is total It is total based on the current important index for calling the service caller in the period, the service call after amount is greater than preset first threshold Amount and preset calling safety value determine that the destination service caller of pending service call amount control and the destination service call The destination service calling amount of person then calls the destination service calling amount and the destination service caller in the period in this prior The ratio of requested service call amount is as destination service calling rate, in next calling period, according to the destination service Calling rate controls the service call amount of the destination service caller, so as to the significance level based on service caller Dynamic limitation service call amount, point for making the control to service call amount make a difference, so that important service caller has There is higher service availability, improves the flexibility of the control to service call amount.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart according to one embodiment of the control method of the application;
Fig. 3 is the flow chart according to another embodiment of the control method of the application;
Fig. 4 is the decomposition process figure of the calling amount rate-determining steps in the flow chart to Fig. 3;
Fig. 5 is the structural schematic diagram according to one embodiment of the control device of the application;
Fig. 6 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the control method of the application or the exemplary system architecture 100 of control device.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various telecommunication customer end applications can be installed, such as web browser is answered on terminal device 101,102,103 With, shopping class application, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 101,102,103 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, E-book reader, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services.Server 105 can be terminal device based on RPC agreement 101,102,103 service is provided.Server 105 can related data to service call it is (such as service call total amount, preset Threshold value, important index of service caller etc. carry out analytical calculation, finally to the service call amount of terminal device 101,102,103 It is controlled.
It should be noted that control method provided by the embodiment of the present application is generally executed by server 105, correspondingly, Control device is generally positioned in server 105.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, the process 200 of one embodiment of the control method according to the application is shown.The control Method processed, comprising the following steps:
Step 201, determine whether the service call total amount in the current calling period is greater than preset first threshold.
In the present embodiment, control method operation electronic equipment (such as server 105 shown in FIG. 1) thereon can be with The current service call total amount called in the period is determined first.It, can be with some preset duration of technical staff in practice (such as 10 seconds, 1 minute or 5 minutes etc.) are a calling period, when each end cycle can count primary service Total amount is called, the above-mentioned current service call total amount called in the period is the current service for calling the end cycle moment to be counted Call total amount.It should be noted that above-mentioned control method can call the end cycle moment to execute at each.
It is called provided by the electronic equipment it should be noted that service call total amount can be each service caller Service the summation of flow used in (such as function, program, method etc.).Each service caller calls the electronic equipment Flow used in provided service is the service call amount of the service caller.Wherein, above-mentioned service caller can be Call the client (such as terminal device shown in FIG. 1 101,102,103) serviced provided by the electronic equipment.
After determining currently to call the service call total amount in the period, above-mentioned electronic equipment can determine identified clothes Business calls whether total amount is greater than preset first threshold.Wherein, above-mentioned first threshold can be the preset number of technical staff Value, above-mentioned first threshold can serve to indicate that after service call total amount is greater than or equal to the first threshold, automatic starting is under The control of service call amount in one period.In practice, first threshold is higher, then the unstable risk of system is higher, meanwhile, it is right A possibility that service call amount is limited is lower.
Step 202, if so, based on the current important index for calling the service caller in the period, service call total amount and Preset calling safety value determines the destination service caller of pending service call amount control and the mesh of destination service caller Mark service call amount.
In the present embodiment, above-mentioned electronic equipment is in response to determining that it is upper that the current service call total amount called in the period is greater than First threshold is stated, it can be based on the current important index for calling the service caller in the period, above-mentioned service call total amount and pre- If calling safety value, determine the destination service caller of pending service call amount control and the target of destination service caller Service call amount.Wherein, the important index of above-mentioned service caller can be the significance level for being in advance based on service caller and Preset numerical value (such as numerical value not less than 1), significance level is higher, then important index is lower.Different service calls Person can have different important indexes.It is based on leading in advance it should be noted that above-mentioned calling safety value can be technical staff Excess pressure is tested the service call amount that maximum obtained can be born and is pre-established.For example, being fluctuated for service call amount Lesser system, safety value can will be called to be determined as the maximum service call amount that can be born 90%;It is biggish for fluctuating System, safety value can will be called to be determined as the maximum service call amount that can be born 70%.
Herein, above-mentioned electronic equipment is based on the current important index for calling the service caller in the period, above-mentioned service tune With total amount and preset calling safety value, the destination service tune that various modes determine pending service call amount control can use The destination service calling amount of user and above-mentioned destination service caller.As an example, above-mentioned electronic equipment can be by important index The service caller of indicated significance level minimum (i.e. the numerical value highest of important index) is determined as destination service caller, drop The service call amount of low above-mentioned object invocation person will drop until the service call total amount after reducing is equal to above-mentioned calling safety value The service call amount of destination service caller after low is determined as destination service calling amount.Herein, each destination service caller Reduced service call amount can be it is identical, be also possible to it is different (such as it is random determine calling amount, or be reduced to Service call threshold value corresponding with each destination service caller etc.).As another example, above-mentioned electronic equipment can also be by weight The service caller for wanting index to be greater than some default value is determined as destination service caller, reduces the service tune of object invocation person Dosage, until the service call total amount after reducing is equal to above-mentioned calling safety value, by the clothes of the destination service caller after reduction Business calling amount is determined as destination service calling amount.As another example, above-mentioned electronic equipment can also will be according to important index institute The number of the significance level of instruction from low to high is successively determined as object invocation server, and successively reduces and determine each time The service call amount of object invocation person, until the service call total amount after reducing is equal to above-mentioned calling safety value, after reduction The service call amount of destination service caller is determined as destination service calling amount.
In some optional implementations of the present embodiment, above-mentioned first threshold be can be based on above-mentioned calling safety value And it is pre-set.As an example, the product of above-mentioned calling safety value and a certain default value (such as 120%) can be determined For first threshold.As another example, can by above-mentioned calling safety value and a certain default value and (such as 200) be determined as First threshold.
Step 203, destination service calling amount and destination service caller are currently being called into requested service in the period The ratio of calling amount is as destination service calling rate, in next calling period, takes according to destination service calling rate to target The service call amount of business caller is controlled.
In the present embodiment, above-mentioned electronic equipment can be by above-mentioned destination service calling amount and above-mentioned destination service caller Call the ratio of requested service call amount in the period as destination service calling rate currently, in next calling period In, it is controlled according to service call amount of the above-mentioned destination service calling rate to above-mentioned destination service caller.It is above-mentioned in practice Electronic equipment can be using above-mentioned destination service calling rate as next service tune for calling period above-mentioned destination service caller With rate, the service call amount of above-mentioned destination service caller is controlled in next calling period.As an example, next The requested service call amount of above-mentioned destination service caller in a period is 1000, if destination service calling rate is 90%, It is 900 that then above-mentioned destination service caller, which calls successful service call amount,.
It should be noted that since different destination service callers can correspond to different destination service calling amounts, because And the destination service calling rate of different destination service callers can be different, it, can be by next calling period According to the corresponding destination service calling rate of each destination service caller respectively to the service call of each destination service caller Amount is controlled.
The method provided by the above embodiment of the application, by determining that the service call total amount in the current calling period is big After preset first threshold, based on the current important index for calling the service caller in the period, the service call total amount and Preset calling safety value determines the destination service caller and the destination service caller of pending service call amount control The destination service calling amount is then called in the period in this prior with the destination service caller and is asked by destination service calling amount The ratio for the service call amount asked is as destination service calling rate, in next calling period, calls according to the destination service Rate controls the service call amount of the destination service caller, so as to the significance level dynamic based on service caller Limitation service call amount, make point that the control to service call amount makes a difference, so that important service caller has more High service availability;Meanwhile calling the period, first threshold, calling safety value equivalence that can be adjusted, it is mentioned convenient for service The manager of supplier improves the flexibility of the control to service call amount according to calling status to be adjusted.
With further reference to Fig. 3, it illustrates the processes 300 of another embodiment of control method.The stream of the control method Journey 300, comprising the following steps:
Step 301, determine whether the service call total amount in the current calling period is greater than preset first threshold.
In the present embodiment, control method operation electronic equipment (such as server 105 shown in FIG. 1) thereon can be with The current service call total amount called in the period is determined first;Then, whether service call total amount determined by can determining is big In preset first threshold.In response to determining that service call total amount is greater than above-mentioned first threshold, step 302- step can be executed 305;In response to determining that service call total amount is not more than above-mentioned first threshold, step 306- step 307 can be executed.
In the present embodiment, it is obtained most based on pressure test is first passed through in advance to can be technical staff for above-mentioned first threshold The service call amount that can bear greatly and pre-establish.Specifically, it can be primarily based on that pre- to first pass through pressure test obtained Safety value is called in the service call amount that maximum can be born, setting.It, can be with for example, fluctuate lesser system for service call amount Safety value will be called to be determined as the maximum service call amount that can be born 90%;For fluctuating biggish system, can will call Safety value is determined as the 70% of the maximum service call amount that can be born.It then, can be based on above-mentioned calling safety value setting first Threshold value.As an example, the product of above-mentioned calling safety value and a certain default value (such as 120%) can be determined as the first threshold Value.As another example, can by above-mentioned calling safety value and a certain default value and (such as 200) be determined as the first threshold Value.Above-mentioned first threshold can serve to indicate that after service call total amount is greater than or equal to the first threshold, automatic starting is under The control of service call amount in one period.
Step 302, in response to determining that service call total amount is greater than first threshold, by service call total amount and preset calling The difference of safety value is determined as the limitation service call total amount for needing to limit.
In the present embodiment, in response to determining that service call total amount is greater than first threshold, above-mentioned electronic equipment can will be taken Business calls total amount and the preset difference for calling safety value to be determined as the limitation service call total amount for needing to limit.
Step 303, the minimum service caller of significance level indicated by the current important index called in the period is made For destination service caller, calling amount rate-determining steps are executed.
In the present embodiment, above-mentioned electronic equipment can be by important journey indicated by the current important index called in the period The service caller of minimum (i.e. important index highest) is spent as destination service caller, executes calling amount rate-determining steps.
In the present embodiment, calling amount rate-determining steps are executed, can be to above-mentioned calling amount control with further reference to Fig. 4, Fig. 4 The decomposition process figure of step processed.In Fig. 4, step 303 is resolved into 2 following sub-steps, it may be assumed that step 3031 and step 3032。
Step 3031, requested service call amount, preset in the period is currently being called based on destination service caller The maximum service calling amount of the lowest service calling rate of destination service caller and the destination service caller prestored, determines target The value range of the destination service calling amount of service caller.
In the present embodiment, above-mentioned electronic equipment can determine above-mentioned destination service caller in the above-mentioned current calling period In requested service call amount and preset above-mentioned destination service caller lowest service calling rate product, by the product The minimum value of the value range of destination service calling amount as above-mentioned destination service caller, by above-mentioned destination service caller Maximum value of the maximum service calling amount as value range, to obtain the value range of destination service calling amount.In practice, no Maximum service calling amount, the lowest service calling rate of same destination service caller can be different respectively, thus, it is different Destination service caller can have different value ranges.
In some optional implementations of the present embodiment, maximum service calling amount can be destination service caller and exist Target histories call requested service call amount in the period, and above-mentioned target histories call the period to can be above-mentioned current calling week The upper service call total amount of phase calls the period no more than the history of above-mentioned first threshold.In practice, different destination services Caller can have different maximum service calling amounts.Destination service caller is requested in target histories call the period Service call amount as maximum service calling amount, can control the service call amount of malicious attacker, avoid malicious attacker A large amount of service call is carried out, the stability of operation system is improved.
Step 3032, based on value range and limitation service call total amount, the destination service of destination service caller is determined Calling amount.
In the present embodiment, above-mentioned electronic equipment can be based on above-mentioned value range and above-mentioned limitation service call total amount, Determine the destination service calling amount of above-mentioned destination service caller.It herein, can be using above-mentioned value range as constraint condition, benefit Each mesh when determining to meet the constraint condition with various problem solving methods (such as greedy algorithm, dynamic programming method etc.) Mark the destination service calling amount of service caller.
As an example, above-mentioned electronic equipment, which can use greedy algorithm, executes above-mentioned calling amount rate-determining steps.In practice, covet Center algorithm (also known as greedy algorithm), refers to when to problem solving, always makes and is currently appearing to be best selection.Greed selection Refer to that the total optimization solution of required problem can be by a series of selection of local optimums, i.e. greed selection is to reach.This is greedy Feasible first fundamental of center algorithm.Greed selection be use it is downward from top, made in the method for iteration it is successively selected, often Primary greed is done to select just to be a smaller subproblem of scale by required problem reduction.For a particular problem, to determine The property whether it there is greed to select, we have to prove that the selection of greed made by each step can finally obtain the optimal of problem Solution.The total optimization solution that can usually prove problem first is and to have made greedy selection since greed selection Afterwards, former problem reduction is the smaller similar subproblem of a scale.Then, it is proved with mathematical induction, passes through each step greed Selection, finally can be obtained a total optimization solution of problem.It should be noted that above-mentioned greedy algorithm be at present extensively research and The well-known technique of application, details are not described herein.
Step 304, destination service caller is currently being called into requested service call amount and destination service in the period The difference of calling amount is as current limitation service call amount, in response to determining that current limitation service call amount is less than limitation service call Total amount will limit service call total amount and the current difference for limiting service call amount as limitation service call total amount, to limitation Service call total amount is updated, and according to important journey indicated by the current important index for calling the service caller in the period The service caller that the order of degree from low to high chooses next important index continues to execute calling as destination service caller Measure rate-determining steps.
In the present embodiment, above-mentioned electronic equipment, can be by above-mentioned destination service after determining destination service calling amount Caller is used as currently in the above-mentioned current difference for calling requested service call amount and above-mentioned destination service calling amount in the period Service call amount is limited, determines whether above-mentioned current limitation service call amount is less than above-mentioned limitation service call total amount.In response to Determine that above-mentioned current limitation service call amount is less than above-mentioned limitation service call total amount, it can be by above-mentioned limitation service call total amount Difference with above-mentioned current limitation service call amount is as limitation service call total amount, to carry out more to limitation service call total amount Newly, and according to time of significance level from low to high indicated by the above-mentioned current important index for calling the service caller in the period Sequence chooses the service caller of next important index as destination service caller, continues to execute above-mentioned calling amount control step Suddenly.
Step 305, destination service calling amount and destination service caller are currently being called into requested service in the period The ratio of calling amount is as destination service calling rate, in next calling period, takes according to destination service calling rate to target The service call amount of business caller is controlled.
In the present embodiment, above-mentioned electronic equipment can be by above-mentioned destination service calling amount and above-mentioned destination service caller Call the ratio of requested service call amount in the period as destination service calling rate currently, in next calling period In, it is controlled according to service call amount of the above-mentioned destination service calling rate to above-mentioned destination service caller.
Step 306, in response to determining that service call total amount is not more than first threshold, determine whether service call total amount is less than Preset second threshold.
In the present embodiment, in response to determining that service call total amount is not more than above-mentioned first threshold, above-mentioned electronic equipment can Whether it is less than preset second threshold with the above-mentioned service call total amount of determination.
It should be noted that above-mentioned second threshold can be based on above-mentioned calling safety value setting and it is pre-set.Make For example, the product of above-mentioned calling safety value and a certain default value (such as 80%) can be determined as second threshold.As The difference (such as 200) of above-mentioned calling safety value and a certain default value can be determined as second threshold by another example.Above-mentioned Two threshold values can serve to indicate that after service call total amount is less than or equal to the second threshold, execute to the service in next period The release operation of the control of calling amount.Herein, it should be noted that above-mentioned first threshold is greater than above-mentioned second threshold.
In some optional implementations of the present embodiment, the difference of above-mentioned first threshold and above-mentioned calling safety value can be with Equal to the difference of above-mentioned calling safety value and above-mentioned second threshold.
Step 307, it is less than above-mentioned second threshold in response to the above-mentioned service call total amount of determination, is called in the period based on current , important index, service call total amount and the preset calling safety value of service caller that be controlled service call amount processed, really The fixed destination service caller for being controlled service call amount control in the service caller of service call amount processed, to be released, solution Except the control of the service call amount to destination service caller.
In the present embodiment, it is less than above-mentioned second threshold, above-mentioned electronic equipment in response to the above-mentioned service call total amount of determination Each service caller in the current calling period, being controlled service call amount processed can be obtained first is currently calling the period In requested service call amount.Then, each clothes in the period, being controlled service call amount processed can be called by current The requested service call amount of caller of being engaged in and the above-mentioned service caller are currently calling practical processed service in the period To be restored calling amount of the difference of calling amount as the service caller.Later, it can use greedy algorithm, currently to call the period In service call total amount and the sum of the calling amount to be restored of destination service caller to be less than above-mentioned calling safety value be constraint item Part, according to important indicated by the current important index for calling service caller in the period, being controlled service call amount processed The sequence of degree from high to low, successively determination has been controlled in the service caller of service call amount processed, service call to be released Measure the destination service caller of control.Then, the control of the service call amount to above-mentioned destination service caller can be released, with Realize that prior service caller is preferentially released the control of service call amount.
It should be noted that if current period can only release the portion being controlled in the service caller of service call amount processed The control for dividing service caller, can be to continue to execute the step 307 in next cycle, until being controlled service call amount processed The service call amount of all service callers is released from control.
If being pointed out that the service call total amount of current period no more than above-mentioned first threshold and not less than above-mentioned the Two threshold values do not execute calling amount rate-determining steps then and release control operation, directly carry out next calling period.
From figure 3, it can be seen that the process 300 of the control method in the present embodiment is prominent compared with the corresponding embodiment of Fig. 2 The step of releasing the control to the service call amount of service caller is gone out.The scheme of the present embodiment description not only can be with as a result, Significance level based on service caller, dynamic control the service call amount of service caller, can also dynamically release to service The control of the service call amount of caller, to further improve the flexibility of the control to service call amount.In addition, calling Period, first threshold, it is second preset, call safety value equivalence that can be adjusted, convenient for manager's root of service provider According to calling status to be adjusted, the flexibility of the control to service call amount is further improved.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides a kind of control devices One embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to various electricity In sub- equipment.
As shown in figure 5, control device 500 described in the present embodiment includes: the first determination unit 501, it is configured to determine It is current to call whether the service call total amount in the period is greater than preset first threshold;Second determination unit 502, if being configured to It is, based on above-mentioned current important index, above-mentioned service call total amount and the preset calling for calling the service caller in the period Safety value determines the destination service caller of pending service call amount control and the destination service of above-mentioned destination service caller Calling amount;Control unit 503 is configured to above-mentioned destination service calling amount and above-mentioned destination service caller above-mentioned current Call the ratio of requested service call amount in the period as destination service calling rate, in next calling period, according to Above-mentioned destination service calling rate controls the service call amount of above-mentioned destination service caller.
In some optional implementations of the present embodiment, which can also include that third determination unit and the 4th are true Order member (not shown).Wherein, above-mentioned third determination unit may be configured to total in response to the above-mentioned service call of determination Amount is not more than above-mentioned first threshold, determines whether above-mentioned service call total amount is less than preset second threshold.Above-mentioned 4th determines Unit may be configured to be less than above-mentioned second threshold in response to the above-mentioned service call total amount of determination, based on above-mentioned current calling week Important index, above-mentioned service call total amount and the preset calling of service caller that is interim, being controlled service call amount processed Safety value determines the target of service call amount control in the above-mentioned service caller for being controlled service call amount processed, to be released Service caller releases the control to the service call amount of above-mentioned destination service caller.
In some optional implementations of the present embodiment, the difference of above-mentioned first threshold and above-mentioned calling safety value can be with Equal to the difference of above-mentioned calling safety value and above-mentioned second threshold.
In some optional implementations of the present embodiment, above-mentioned second determination unit 502 may include first determining Module and the first control module (not shown).Wherein, above-mentioned first determining module may be configured to adjust above-mentioned service It is determined as the limitation service call total amount for needing to limit with total amount and the preset difference for calling safety value.Above-mentioned first control module It may be configured to make the minimum service caller of significance level indicated by the above-mentioned current important index called in the period For destination service caller, following calling amount rate-determining steps are executed: based on above-mentioned destination service caller in above-mentioned current calling It requested service call amount, the lowest service calling rate of preset above-mentioned destination service caller and is prestored above-mentioned in period The maximum service calling amount of destination service caller determines the value model of the destination service calling amount of above-mentioned destination service caller It encloses;Based on above-mentioned value range and above-mentioned limitation service call total amount, the destination service tune of above-mentioned destination service caller is determined Dosage.
In some optional implementations of the present embodiment, above-mentioned second determination unit can also include the second control mould Block (not shown).Wherein, above-mentioned second control module may be configured to work as above-mentioned destination service caller above-mentioned It is preceding that the difference of requested service call amount and above-mentioned destination service calling amount in the period is called to be used as current limitation service call amount, It is less than above-mentioned limitation service call total amount in response to the above-mentioned current limitation service call amount of determination, above-mentioned limitation service call is total The difference of amount and above-mentioned current limitation service call amount is used as limitation service call total amount, and according in the above-mentioned current calling period The order of significance level indicated by the important index of service caller from low to high chooses the service tune of next important index User continues to execute above-mentioned calling amount rate-determining steps as destination service caller.
In some optional implementations of the present embodiment, above-mentioned maximum service calling amount can be above-mentioned destination service Caller calls requested service call amount in the period in target histories, and above-mentioned target histories call the period that can work as to be above-mentioned The preceding upper service call total amount for calling the period calls the period no more than the history of above-mentioned first threshold.
The device provided by the above embodiment of the application is determining current call in the period by the first determination unit 501 Service call total amount be greater than preset first threshold after, the second determination unit 502 is based on the current service tune called in the period The important index of user, the service call total amount and preset calling safety value determine the mesh of pending service call amount control The destination service calling amount of service caller and the destination service caller is marked, then control unit 503 is by the destination service tune Dosage and the destination service caller call the ratio of requested service call amount in the period as destination service in this prior Calling rate, in next calling period, according to the destination service calling rate to the service call amount of the destination service caller It is controlled, dynamically limits service call amount so as to the significance level based on service caller, make to service call amount Control make a difference point so that important service caller have higher service availability;Meanwhile calling period, the One threshold value calls safety value equivalence that can be adjusted, and is adjusted convenient for the manager of service provider according to calling status It is whole, improve the flexibility of the control to service call amount.
Below with reference to Fig. 6, it illustrates the computer systems 600 for the electronic equipment for being suitable for being used to realize the embodiment of the present application Structural schematic diagram.Electronic equipment shown in Fig. 6 is only an example, function to the embodiment of the present application and should not use model Shroud carrys out any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and Execute various movements appropriate and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data. CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always Line 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.; And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon Computer program be mounted into storage section 608 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communications portion 609, and/or from detachable media 611 are mounted.When the computer program is executed by central processing unit (CPU) 601, limited in execution the present processes Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- but Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination. The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires electrical connection, Portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only deposit Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory Part or above-mentioned any appropriate combination.In this application, computer readable storage medium, which can be, any include or stores The tangible medium of program, the program can be commanded execution system, device or device use or in connection.And In the application, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use In by the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc., Huo Zheshang Any appropriate combination stated.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include the first determination unit, the second determination unit and control unit.Wherein, the title of these units is not constituted under certain conditions Restriction to the unit itself, for example, the first determination unit is also described as " determining the current service tune called in the period Whether it is greater than the unit of preset first threshold with total amount ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in device described in above-described embodiment;It is also possible to individualism, and without in the supplying device.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the device, so that should Device: determine whether the service call total amount in the current calling period is greater than preset first threshold;If so, being based on the current tune With the important index of the service caller in the period, the service call total amount and preset calling safety value, pending clothes are determined The destination service caller of calling amount of being engaged in control and the destination service calling amount of the destination service caller;By the destination service tune Dosage and the destination service caller call the ratio of requested service call amount in the period as destination service in this prior Calling rate, in next calling period, according to the destination service calling rate to the service call amount of the destination service caller It is controlled.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (14)

1. a kind of control method, comprising:
Determine whether the service call total amount in the current calling period is greater than preset first threshold;
If so, based on the current important index for calling the service caller in the period, the service call total amount and presetting Calling safety value, determine the destination service caller of pending service call amount control and the mesh of the destination service caller Mark service call amount;
By the destination service calling amount and the destination service caller requested service in the current calling period The ratio of calling amount is as destination service calling rate, in next calling period, according to the destination service calling rate to institute The service call amount for stating destination service caller is controlled.
2. control method according to claim 1, wherein currently call the service call total amount in the period in the determination Whether it is greater than after preset first threshold, the method also includes:
It is not more than the first threshold in response to the determination service call total amount, determines whether the service call total amount is less than Preset second threshold;
In response to the determination service call total amount be less than the second threshold, based on it is described it is current call the period in, by Important index, the service call total amount and the preset calling safety value of the service caller of service call amount are controlled, is determined The destination service caller of service call amount control in the service caller for being controlled service call amount processed, to be released, Release the control to the service call amount of the destination service caller.
3. control method according to claim 2, wherein the first threshold and the difference for calling safety value are equal to institute State the difference for calling safety value and the second threshold.
4. control method according to claim 1, wherein described based on the current service caller called in the period Important index, the service call total amount and preset calling safety value, determine the target of pending service call amount control The destination service calling amount of service caller and the destination service caller, comprising:
The service call total amount and the preset difference for calling safety value are determined as the limitation service call total amount for needing to limit;
The minimum service caller of significance level indicated by the current important index called in the period is taken as target Business caller, executes following calling amount rate-determining steps: based on destination service caller institute in the current calling period The service call amount of request, the lowest service calling rate of the preset destination service caller and the destination service prestored The maximum service calling amount of caller determines the value range of the destination service calling amount of the destination service caller;It is based on The value range and the limitation service call total amount, determine the destination service calling amount of the destination service caller.
5. control method according to claim 4, wherein described based on the current service caller called in the period Important index, the service call total amount and preset calling safety value, determine the target of pending service call amount control The destination service calling amount of service caller and the destination service caller, further includes:
By the destination service caller in the current calling period requested service call amount and the destination service The difference of calling amount is less than the limitation in response to the determination current limitation service call amount as current limitation service call amount Service call total amount adjusts the difference of the limitation service call total amount and the current limitation service call amount as limitation service With total amount, to be updated to the limitation service call total amount, and according to the current service caller called in the period Important index indicated by the order of significance level from low to high choose the service caller of next important index as mesh Service caller is marked, the calling amount rate-determining steps are continued to execute.
6. control method according to claim 4 or 5, wherein the maximum service calling amount is the destination service tune User calls requested service call amount in the period in target histories, and it is the current calling that the target histories, which call the period, A upper service call total amount in period calls the period no more than the history of the first threshold.
7. a kind of control device, comprising:
First determination unit is configured to determine whether the service call total amount in the current calling period is greater than preset first threshold Value;
Second determination unit is configured to if so, based on the current important index for calling the service caller in the period, institute Service call total amount and preset calling safety value are stated, determines destination service caller and the institute of pending service call amount control State the destination service calling amount of destination service caller;
Control unit was configured to the destination service calling amount and the destination service caller in the current calling week The ratio of interim requested service call amount is as destination service calling rate, in next calling period, according to the mesh Mark service call rate controls the service call amount of the destination service caller.
8. control device according to claim 7, wherein described device further include:
Third determination unit is configured to determine institute no more than the first threshold in response to the determination service call total amount State whether service call total amount is less than preset second threshold;
4th determination unit is configured to be less than the second threshold in response to the determination service call total amount, based on described The current important index for calling service caller in the period, being controlled service call amount processed, the service call total amount and Preset calling safety value, determination is described to be controlled in the service caller of service call amount processed, to be released service call amount The destination service caller of control releases the control to the service call amount of the destination service caller.
9. control device according to claim 8, wherein the first threshold and the difference for calling safety value are equal to institute State the difference for calling safety value and the second threshold.
10. control device according to claim 7, wherein second determination unit includes:
First determining module is configured to be determined as needing to limit by the service call total amount and the preset difference for calling safety value The limitation service call total amount of system;
First control module is configured to significance level indicated by the current important index called in the period is minimum Service caller executes following calling amount rate-determining steps as destination service caller: being existed based on the destination service caller Requested service call amount, the lowest service calling rate of the preset destination service caller in the current calling period With the maximum service calling amount of the destination service caller prestored, the destination service tune of the destination service caller is determined The value range of dosage;Based on the value range and the limitation service call total amount, the destination service caller is determined Destination service calling amount.
11. control device according to claim 10, wherein second determination unit further include:
Second control module is configured to the destination service caller requested service in the current calling period The difference of calling amount and the destination service calling amount takes as current limitation service call amount in response to the determination current limitation Calling amount of being engaged in is less than the limitation service call total amount, by the limitation service call total amount and the current limitation service call The difference of amount is as limitation service call total amount, to be updated to the limitation service call total amount, and according to the current tune The order of significance level indicated by important index with the service caller in the period from low to high chooses next important finger Several service callers continues to execute the calling amount rate-determining steps as destination service caller.
12. control device described in 0 or 11 according to claim 1, wherein the maximum service calling amount is the destination service Caller calls requested service call amount in the period in target histories, and it is the current tune that the target histories, which call the period, The period is called no more than the history of the first threshold with a upper service call total amount in period.
13. a kind of electronic equipment, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer readable storage medium, is stored thereon with computer program, wherein when the program is executed by processor Realize such as method as claimed in any one of claims 1 to 6.
CN201810141995.1A 2018-02-11 2018-02-11 Control method and device Active CN110162409B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810141995.1A CN110162409B (en) 2018-02-11 2018-02-11 Control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810141995.1A CN110162409B (en) 2018-02-11 2018-02-11 Control method and device

Publications (2)

Publication Number Publication Date
CN110162409A true CN110162409A (en) 2019-08-23
CN110162409B CN110162409B (en) 2024-06-18

Family

ID=67635044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810141995.1A Active CN110162409B (en) 2018-02-11 2018-02-11 Control method and device

Country Status (1)

Country Link
CN (1) CN110162409B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701794A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Identification method and device for denial of service attack
US20160094611A1 (en) * 2014-09-30 2016-03-31 International Business Machines Corporation Managing requests to a high utilization website
CN105656962A (en) * 2014-11-11 2016-06-08 阿里巴巴集团控股有限公司 Service calling method and device
CN106131187A (en) * 2016-07-13 2016-11-16 杭州华三通信技术有限公司 The control method of a kind of mandate and device
CN107645476A (en) * 2016-07-22 2018-01-30 百度在线网络技术(北京)有限公司 Request processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701794A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Identification method and device for denial of service attack
US20160094611A1 (en) * 2014-09-30 2016-03-31 International Business Machines Corporation Managing requests to a high utilization website
CN105656962A (en) * 2014-11-11 2016-06-08 阿里巴巴集团控股有限公司 Service calling method and device
CN106131187A (en) * 2016-07-13 2016-11-16 杭州华三通信技术有限公司 The control method of a kind of mandate and device
CN107645476A (en) * 2016-07-22 2018-01-30 百度在线网络技术(北京)有限公司 Request processing method and device

Also Published As

Publication number Publication date
CN110162409B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
CN110545246B (en) Token bucket-based current limiting method, device and computer readable medium
CN106201661B (en) Method and apparatus for elastic telescopic cluster virtual machine
CN111817974B (en) Interface current limiting method, device and system based on token bucket and readable storage medium
CN108346028A (en) A kind of business approval processing method, apparatus and system
CN110198244A (en) Resource allocation method and device towards isomery cloud service
CN109408205A (en) Method for scheduling task and device based on hadoop cluster
CN110473036B (en) Method and device for generating order number
CN108933822B (en) Method and apparatus for handling information
CN109936635A (en) Load-balancing method and device
CN111047243A (en) Method and device for determining logistics distribution cost
CN110738436B (en) Method and device for determining available inventory
CN109525855A (en) Method and apparatus for handling information
CN109491721A (en) Method and apparatus for load information
CN109597912A (en) Method for handling picture
CN112685481B (en) Data processing method and device
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN109150928A (en) Method and apparatus for handling request
CN110113176A (en) Information synchronization method and device for configuration server
CN108985673A (en) It makes an inventory single generation method and device
CN110162409A (en) Control method and device
CN109684059A (en) Method and device for monitoring data
CN109413212A (en) Method and apparatus for handling request
CN113096295B (en) Numbering method, numbering device, electronic equipment and computer readable storage medium
CN108984770A (en) Method and apparatus for handling data
CN113760487B (en) Service processing 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