CN104168133B - The method and gateway and system of a kind of dynamic configuration API Access amount - Google Patents
The method and gateway and system of a kind of dynamic configuration API Access amount Download PDFInfo
- Publication number
- CN104168133B CN104168133B CN201410331882.XA CN201410331882A CN104168133B CN 104168133 B CN104168133 B CN 104168133B CN 201410331882 A CN201410331882 A CN 201410331882A CN 104168133 B CN104168133 B CN 104168133B
- Authority
- CN
- China
- Prior art keywords
- visit capacity
- api
- theoretical
- amendment
- next time
- 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.)
- Expired - Fee Related
Links
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Telephonic Communication Services (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a kind of method of dynamic configuration API Access amount and gateway and system, wherein method includes:Weights shared by each application programming interfaces API are calculated, and each API history visit capacity weights in the API set are calculated according to history visit capacity;Theoretical visit capacity after amendment is calculated according to the actual access amount of history visit capacity and resource;The magnitude relationship of theoretical visit capacity next time and last theoretical visit capacity is judged based on theoretical visit capacity after calculating amendment;If it is determined that theoretical visit capacity is more than or equal to last theoretical visit capacity next time, then last theoretical visit capacity is configured to API Access amount;If it is determined that theoretical visit capacity is less than last theoretical visit capacity next time, then reconfigures constraint set and calculated.By the embodiment of the present invention, original services configuration protocol file is substituted using Dynamic Programming optimization strategy, United Dispatching to server resource, reasonable distribution is realized.
Description
Technical field
The present invention relates to areas of information technology, and in particular to the method and gateway of a kind of dynamic configuration API Access amount and is
System.
Background technology
Conventional application programming interface (Application Programming Interface, the API) peace of industrial quarters
Be with management platform entirely it is a set of operate in data center, the application software of cloud service center, for the API producer, API consume
There is provided API gateway, API doors, API life cycle managements, API monitoring, API key managements by the roles such as person, API managers
And the assembly function such as the practical situation analysis of API, Fig. 1 shows the structural representation of API safety and management platform.API safety with
The system environments of management platform operation includes:Meet the middleware of J2EE specifications (for example:Tomcat, Weblogic etc.),
Oracle or Mysql databases.Application programming interfaces API is directly invoked from traditional application program different, information centre needs
API safety and management software are first enabled, application program can pass through one before the application programming interfaces (API) in resource are called
Individual API gateway, the gateway can realize the safe access control and dynamic call, i.e. API nets to API according to certain scheduling strategy
Module is closed to be responsible for carrying out whole API resources route agent, performance distribution.
As shown in Fig. 2 API gateway is operated between application program and server A PI resources as intermediate node, play
API scheduling of resource and the important function of control.Such as assume 1 API background system, 100 concurrent requests of maximum support per second,
More than this numerical value, system will collapse, therefore request be limited.If there are 20 consumer's subscription at present, average 1 second please
Ask 1, peak value request 10 per second, then the request each subscribed to will be limited below 10.Current industry is generally used
A kind of " air throttle " technology, by service-level agreement (Service-Level Agreement, SLA), sets every layer of service association
Discuss maximum available request number.For example, one-level service maximum 5000 requests per hour, secondary service is maximum 50 per hour
Request.Such as set some API maximum can call number be 50, each Connection Time is 60000 milliseconds.Therefore work as and apply
When the routine call API is more than 50 times, do not allow for recalling, this application journey to some specific transactions frequent operations
It is inappropriate for sequence.
In existing API gateway technology, " air throttle " technology is a kind of static file configuration method.The technology for
The resource allocation of API request is set by service configuration protocol file.If as shown in figure 4, some consumer belongs to API
Certain service agreement, this consumer getable API total number resources be just to determine.However, in actual applications, resource
Sum is limited, and request is also various.Sometimes system API request is extremely busy, it is necessary to dynamically reduce each consumer
API request;Sometimes system API request is very not busy, it is also desirable to dynamically expand the API request limitation of each consumer.This is just
It is required that in the case where API total resources is certain, dynamically can adjust and control to greatest extent each API consumer demands, together
When ensure system can normally run.Static " air throttle " technology as a kind of relatively easy but underaction collocation method,
Obviously dynamic adjustment API consumption demands can not be met.
The content of the invention
Technical scheme primarily directed to current static service profiles technical disadvantages, using Dynamic Programming
Method dynamically distributes are carried out to API resources, realize load balancing, improve server resource utilization rate, enable API user
Rationally utilize server resource.
The invention provides a kind of method of dynamic configuration API Access amount, methods described includes:
Weights shared by each application programming interfaces API are calculated, and are calculated according to history visit capacity in the API set respectively
API history visit capacity weights;
Theoretical visit capacity after amendment is calculated according to the actual access amount of history visit capacity and resource;
The size of theoretical visit capacity next time and last theoretical visit capacity is judged based on theoretical visit capacity after calculating amendment
Relation;
If it is determined that theoretical visit capacity is more than or equal to last theoretical visit capacity next time, then by last theoretical visit capacity
It is configured to API Access amount;If it is determined that theoretical visit capacity is less than last theoretical visit capacity next time, then next time theoretical it will visit
Component after the amount of asking reconfigures constraint set conjunction and calculated.
It is described to judge theoretical visit capacity next time and last theoretical visit capacity based on calculating theoretical visit capacity after amendment
Also include before magnitude relationship:
Judge that resource service condition is whether within load after amendment, if resource service condition is within load, base
Judge the magnitude relationship of theoretical visit capacity next time and last theoretical visit capacity in theoretical visit capacity after calculating amendment;
If resource service condition is beyond load, computational load introduces parameter so that theoretical visit capacity exists after amendment
In loading range, then theoretical visit capacity after parameter and calculating amendment is introduced based on load and judge theoretical visit capacity and upper one next time
The magnitude relationship of secondary theoretical visit capacity.
It is described if it is determined that theoretical visit capacity is less than last theoretical visit capacity next time, then will theoretical visit capacity next time
Component afterwards, which is reconfigured during constraint set conjunction is calculated, also to be included:
When next time, theoretical visit capacity is less than last theoretical visit capacity, then by the component after theoretical visit capacity next time
A constraint set is re-configured to, weights and API history visit capacity weight computings shared by progress API are finally completed API visits
The configuration for the amount of asking.
Methods described also includes:
When the access request amount increased newly in some period is more than the threshold parameter that client is pre-configured with, triggering carries out API
Shared weights and API history visit capacity weight computing, is finally completed the configuration of API Access amount.
Accordingly, present invention also offers a kind of API gateway, the API gateway includes:
API takes weights computing module, for calculating weights shared by each application programming interfaces API;
History visit capacity weight computing module, is visited for calculating each API history in the API set according to history visit capacity
The amount of asking weights;
Visit capacity computing module is corrected, for calculating theoretical after amendment according to the actual access amount of history visit capacity and resource
Visit capacity;
Revised theory visit capacity comparison module, for theory to be accessed next time based on theoretical visit capacity judgement after amendment is calculated
The magnitude relationship of amount and last theoretical visit capacity;
API Access amount configuration module, for judging that theoretical visit capacity is more than or equal to upper once theoretical visit capacity next time
When, then last theoretical visit capacity is configured to API Access amount;And judging that theoretical visit capacity is once managed less than upper next time
By visit capacity, then the component after theoretical visit capacity next time is reconfigured into constraint set conjunction and calculated.
The API gateway also includes:
Load balancing module, for judging that resource service condition is whether within load after amendment, if resource uses feelings
Condition entered within load, then revised theory visit capacity comparison module be used for judge theoretical visit capacity and last reason next time
By the magnitude relationship of visit capacity;If resource service condition is beyond load, computational load introduces parameter so that managed after amendment
By visit capacity in loading range, then enter revised theory visit capacity comparison module be used for judge next time theory visit capacity
With the magnitude relationship of last theoretical visit capacity.
The API Access amount configuration module is additionally operable to when theoretical visit capacity is less than last theoretical visit capacity next time,
The component after theoretical visit capacity next time is then re-configured to a constraint set, API is fed back to and takes weight computing mould
Carry out carrying out API history visit capacity weights meters in weight computing shared by API and history visit capacity weight computing module in block
Calculate, the configuration of API Access amount is completed again.
The API gateway also includes:Threshold triggers module, for judging when the access request amount increased newly in some period is big
When the threshold parameter that client is pre-configured with, triggering carries out weights and API history visit capacity weight computings shared by API, finally
Complete the configuration of API Access amount.
Accordingly, present invention also offers a kind of system of dynamic configuration API Access amount, the system includes:
Multiple api interfaces, are connected with multiple applications clients, for receiving calling for API application programs;
Multiple API servers, for storing API resources;
API gateway, is connected to multiple api interfaces, and is connected to multiple API servers, for calculating each application program
Weights shared by interface API, and each API history visit capacity weights in the API set are calculated according to history visit capacity;According to
The actual access amount of history visit capacity and resource calculates theoretical visit capacity after amendment;Judged based on theoretical visit capacity after amendment is calculated
The magnitude relationship of theoretical visit capacity and last theoretical visit capacity next time;If it is determined that theoretical visit capacity is more than or equal to next time
Last theory visit capacity, then be configured to API Access amount by last theoretical visit capacity;If it is determined that theoretical visit capacity next time
Less than last theoretical visit capacity, then the component after theoretical visit capacity next time is reconfigured into constraint set conjunction and calculated.
Technical solution of the present invention substitutes original services configuration protocol file using Dynamic Programming optimization strategy, real
United Dispatching now to server resource, reasonable distribution.Situation, each API are accessed according to Dynamic Programming strategy to each API history to provide
Source occupancy situation, call API required service device resource situations etc. to be allocated, coordinate application to the frequencies of API Calls and
Access control.Also the called efficiency of API is improved.No parameter of calling to API is limited, with the changes in demand of application program
Change with aggregate resource service condition.That is, API is flexible by calling for different application.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is API safety of the prior art and management platform structural representation;
Fig. 2 is the system structure diagram of the prior art based on SAL provisioning API visit capacities;
Fig. 3 is the system structure diagram of the dynamic configuration API Access amount in the embodiment of the present invention;
Fig. 4 is the method flow diagram of the dynamic configuration API Access amount in the embodiment of the present invention;
Fig. 5 is the API gateway structural representation in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is all other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
The system of dynamic configuration API Access amount as shown in Figure 3, API gateway manages multiple servers and multiple applications, often
Multiple API are stored on individual server.The system includes multiple api interfaces, is connected with multiple applications clients, for receiving
API application programs are called;Multiple API servers, for storing API resources;API gateway, is connected to multiple api interfaces, with
And multiple API servers are connected to, for calculating weights shared by each application programming interfaces API, and according to history visit capacity
Calculate each API history visit capacity weights in the API set;Calculated and corrected according to the actual access amount of history visit capacity and resource
Theoretical visit capacity afterwards;Judge theoretical visit capacity next time and last theoretical visit capacity based on theoretical visit capacity after amendment is calculated
Magnitude relationship;If it is determined that theoretical visit capacity is more than last theoretical visit capacity next time, then last theoretical visit capacity is matched somebody with somebody
It is set to API Access amount;If it is determined that theoretical visit capacity is less than last theoretical visit capacity next time, then next time theoretical it will access
Component after amount reconfigures constraint set conjunction and calculated.
Application program calls the API being deployed on different server by API gateway.The technical scheme is that
In API gateway management, using Dynamic Programming optimization strategy, original services configuration protocol file is substituted.It is of the invention real
Apply made in example API gateway record each server workable for resource, server maximum load capability, the API on server, each
Individual API history calls the server resource amount etc. needed for the frequency, operation API, and these data participate in Dynamic Programming optimization side
The calculating of method, and obtain API on each server it is optimal can call number, so as to realize the dynamic control to API Calls, together
When set dynamic calculation to perform triggering threshold values, it is automatic when access request reaches threshold values to carry out dynamic calculation, distribution.
Dynamic Programming is a kind of method for solving multistage decision process optimization problem, graceful by U.S. mathematician Bel
Et al. (Ballman) proposed in 1950s.Multistage decision process refers to the special active procedure of such class, and it can
To resolve into some sub-stages connected each other in chronological order, will be made a policy in each sub-stage, all processes certainly
Plan is a sequence of decisions, so multistage decision problem is also referred to as sequential decision problem.Bel is graceful et al. to determine for the multistage
The characteristics of question and answer on politics is inscribed, it is proposed that " principle of optimality " such issues that solution, and successfully solve production management, engineering technology
In terms of many practical problems.Graceful (Bellman) principle of optimality of Bel has characteristics that:No matter original state and just
How is beginning decision-making, for the state that first decision-making is formed, and remaining decision-making must be configured into an optimal policy.Should
Following two conditions must are fulfilled for Bellman principle of optimality:1. the separability of object function;2. the separability of state.Its
The separability of middle object function refers to that, for all K, the object function of the last K sub-stage of a process only depends on
In current state and last K decision-making.The separability of state refers to that after a decision-making next state, which is dependent only on, to be worked as
Preceding state and decision-making, and it is unrelated with state above.
In this paper technologies, using server system resources service condition as optimal policy target, analyze and set up corresponding
Dynamic Programming Mathematical Modeling.The load capacity for making server is, server operation ability, networked environments are stablized relatively.Obtain
To the optimization strategy of system resource allocation, i.e., in the case of dynamic access amount, it is ensured that the visit capacity of API resources is reasonable, load
Balanced, dynamic adjustment, resource make full use of and allow visit capacity to reach maximum, while setting dynamic calculation to perform trigger valve
Value, it is automatic when access request reaches threshold values to carry out dynamic calculation, distribution.
Symbol description:
Ai:I-th of application request;
:Server maximum load-carrying capacity is represented, 90% is normally used no more than;
Xi,j:Represent the server resource amount that i-th of application requests calls j-th of API to consume;
εi,j:Represent the request amount of j-th of API actual access;
ε’i,j:Represent j-th of API revised request amount;
:To allow the theoretical visit capacity for accessing j-th of API after the r times amendment.
:Represent the weights of j-th of API history visit capacity statistics during the r times amendment;
λj:Represent resource weights shared by j-th of API;
:Represent resource weights shared by j-th of API during the r times amendment;
φk:Represent that user can customize configuration triggering dynamic calculation parameter.
φ’k:Represent server in Δ TkThe shared resource percentage of newly-increased API Access request;
Δεi,j:Represent Δ TkJ-th of API newly-increased request amount in time.
According to API scheduling of resource rule, to be maximally utilized server resource, while API Access amount is lifted,
Sometime node, solves following optimization problem:
(ε’I, j∈N)
And constraints is:
Solve after the optimization problem, ε 'i,jOptimal access value during for i-th of request call, j-th of API resource.Should
The solution of model is the Dynamic Programming optimization problem comprehensive with integer programming.This optimization method considers following factor:
Situation is accessed according to each API history, API Access situation weights are calculated;
According to each API occupation condition, API resource occupation weights are counted;
Overall goal is that the link of visit capacity resources occupation amount greatly is as far as possible small in the case of ensureing that API history is accessed.
Weights shared by each application programming interfaces API are calculated during the embodiment of the present invention first, and according to history
Visit capacity calculates each API history visit capacity weights in the API set;According to the actual access gauge of history visit capacity and resource
Calculate theoretical visit capacity after amendment;Judge that theoretical visit capacity is visited with last theory next time based on theory visit capacity after amendment is calculated
The magnitude relationship for the amount of asking;If it is determined that theoretical visit capacity is more than last theoretical visit capacity next time, then by last theoretical visit
The amount of asking is configured to API Access amount;If it is determined that theoretical visit capacity is less than last theoretical visit capacity next time, then structure constraint collection
Conjunction is calculated.
Specifically, Fig. 4 shows the method flow diagram of the dynamic configuration API Access amount in the embodiment of the present invention, including such as
Lower step:
Weights shared by S401, each application programming interfaces API of calculating;
Calculate involved by access request in the set of API resources, each API resource occupation weightsAccording to request institute Shen
API resources { A pleasej| 1≤j≤L, j ∈ N } shared by server resource duration set { κj| 1≤j≤L, j ∈ N }, calculate each
API resource occupation weights
S402, each API history visit capacity weights in the set can be calculated according to history visit capacity;
According to εi,jThe API resources access collection { A that access request is related to can be goti| 1≤i≤K, i ∈ N } and history visit
Ask duration set { ρi| 1≤i≤K, i ∈ N }, each API history visit capacity weights in the set can be calculated according to history visit capacity
Calculate involved by access request in the set of API resources, each API history visit capacity weights.
S403, theoretical visit capacity after amendment calculated according to the actual access amount of history visit capacity and resource;
Theoretical visit capacity after amendment is calculated, the theoretical visit capacity for accessing j-th of API is allowed after as correcting
The actual access amount of situation and resource is accessed according to history, actual access amount is repeatedly corrected, it is ensured that history
Upper visit capacity is big, it is allowed to which visit capacity is also larger.
S404, judge amendment after resource service condition whether within load, S406 is entered if within load,
Otherwise S405 is entered;
FoundationIf so, it is whole
Resource service condition can be then entered in S406 within load after the implication amendment of formula expression
IfIt is invalid, then need
Enter in S405.
S405, computational load introduce parameter so that theoretical visit capacity is in loading range after amendment;
WhenWhen, then introduce parameterDuring the maximum occupation value for making request allow beyond resource, a coefficient is uniformly multiplied by, allows it to cause within resource allows
AndThis
In make
S406, judge theoretical visit capacity next time and last theoretical visit capacity size, it is no if greater than S407 is then carried out
Then enter S408;
If S407, next time theoretical visit capacity are more than or equal to last theoretical visit capacity, last theoretical access is taken
Amount;
Meet(1≤j≤Sr) part, the theoretical visit capacity of the theoretical visit capacity more than the r times of the r+1 times
Situation, then it is last amendment visit capacity to allow this actual access amount, i.e., j-th API revised request amount is the r times
Allow the theoretical visit capacity for accessing j-th of API after amendmentε’i,jJth is called for i-th of application requests
The visit capacity allowed during individual API resources.
, will be next time after theoretical visit capacity if S408, next time theoretical visit capacity are less than last theoretical visit capacity
Component be re-configured to one constraint set;
For(Sr≤ j≤L) part, reconstitute set { Ai|Sr≤ j≤L, i ∈ N }, constraints
Become:
It should be noted that method of the constraints re-enter of step implementation to dynamic configuration API Access amount
During, that is, enter in S401 until API Access amount configuration successful.
It should be noted that when the access request amount increased newly in some period is more than the threshold parameter that client is pre-configured with
Triggering carries out the configuration that weights and API history visit capacity weight computings shared by API are finally completed API Access amount, that is, works asWhen, start S401 and start to calculate.
When the access request increased newly in some period is more than the threshold parameter that client configures, calculating process is inspired.
Accordingly, Fig. 5 also show the API gateway structural representation in the embodiment of the present invention, and the API gateway includes:
API takes weights computing module, for calculating weights shared by each application programming interfaces API;
History visit capacity weight computing module, is visited for calculating each API history in the API set according to history visit capacity
The amount of asking weights;
Visit capacity computing module is corrected, for calculating theoretical after amendment according to the actual access amount of history visit capacity and resource
Visit capacity;
Revised theory visit capacity comparison module, for theory to be accessed next time based on theoretical visit capacity judgement after amendment is calculated
The magnitude relationship of amount and last theoretical visit capacity;
API Access amount configuration module, for when judging that theoretical visit capacity is more than upper once theoretical visit capacity next time, then
Last theoretical visit capacity is configured to API Access amount;And judging that theoretical visit capacity is less than upper once theoretical visit next time
The amount of asking, then reconfigure constraint set conjunction by the component after theoretical visit capacity next time and calculated.
It should be further stated that, the API gateway also includes:Load balancing module, for judging that resource makes after amendment
With situation whether within load, if resource service condition is within load, enters revised theory visit capacity and compare mould
Block is used to judge the magnitude relationship of theoretical visit capacity and last theoretical visit capacity next time;If resource service condition is in load
In addition, then computational load introduces parameter so that theoretical visit capacity enters revised theory access in loading range, then after amendment
Measuring comparison module is used to judge the magnitude relationship of theoretical visit capacity and last theoretical visit capacity next time.
It should be noted that the API Access amount configuration module is additionally operable to that theoretical visit capacity last manage ought be less than next time
During by visit capacity, then the component after theoretical visit capacity next time is re-configured to a constraint set, feeds back to API occupancy
Carry out carrying out API history visits in weight computing shared by API and history visit capacity weight computing module in weight computing module
The amount of asking weight computing, completes the configuration of API Access amount again.
It should be further stated that, the API gateway also includes:Threshold triggers module, for judging when in some period
When newly-increased access request amount is more than the threshold parameter that client is pre-configured with, triggering carries out weights shared by API and API history is visited
The amount of asking weight computing, is finally completed the configuration of API Access amount.
To sum up, technical solution of the present invention substitutes original services configuration protocol text using Dynamic Programming optimization strategy
Part, realizes United Dispatching to server resource, reasonable distribution.Situation is accessed each API history according to Dynamic Programming strategy, it is each
API occupation conditions, API required service device resource situations etc. are called to be allocated, frequency of the coordinate application to API Calls
Rate and access control.Also the called efficiency of API is improved.No parameter of calling to API is limited, with the demand of application program
Change and aggregate resource service condition and change.That is, API is flexible by calling for different application.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can
To instruct the hardware of correlation to complete by program, the program can be stored in a computer-readable recording medium, storage
Medium can include:Read-only storage (ROM, Read Only Memory), random access memory (RAM, Random
Access Memory), disk or CD etc..
The method and gateway and system of the dynamic configuration API Access amount provided above the embodiment of the present invention have been carried out in detail
Thin to introduce, specific case used herein is set forth to the principle and embodiment of the present invention, and above example is said
It is bright to be only intended to help and understand the method for the present invention and its core concept;Simultaneously for those of ordinary skill in the art, foundation
The thought of the present invention, will change, in summary, this specification content is not in specific embodiments and applications
It is interpreted as limitation of the present invention.
Claims (9)
1. a kind of method of dynamic configuration API Access amount, it is characterised in that methods described includes:
Weights shared by each application programming interfaces API are calculated, and each API in the API set is calculated according to history visit capacity
History visit capacity weights
Theoretical visit capacity after amendment is calculated according to the actual access amount of history visit capacity and resource, calculate allows to access after amendment,
Allow after amendment access j-th of API theoretical visit capacity publicity be:
Wherein:The weights of j-th of API history visit capacity statistics during the r times amendment are represented,To allow the theoretical visit capacity for accessing j-th of API after the r times amendment, i represents i-th of application requests;
The magnitude relationship of theoretical visit capacity next time and last theoretical visit capacity is judged based on theoretical visit capacity after calculating amendment;
If it is determined that theoretical visit capacity is more than or equal to last theoretical visit capacity next time, then last theoretical visit capacity is configured
For API Access amount;, then will theoretical visit capacity next time if it is determined that theoretical visit capacity is less than last theoretical visit capacity next time
Component afterwards reconfigures constraint set conjunction and calculated.
2. the method for dynamic configuration API Access amount as claimed in claim 1, it is characterised in that after the amendment based on calculating
Theoretical visit capacity judges that theoretical visit capacity before the magnitude relationship of last theoretical visit capacity with also including next time:
Judge that resource service condition is whether within load after amendment, if resource service condition is within load, based on meter
Calculate the magnitude relationship that theoretical visit capacity after amendment judges theoretical visit capacity and last theoretical visit capacity next time;
If resource service condition is beyond load, computational load introduces parameter so that theoretical visit capacity is in load after amendment
In the range of, then theory visit capacity after parameter and calculating amendment is introduced based on load and judge theoretical visit capacity next time and last reason
By the magnitude relationship of visit capacity.
3. the method for dynamic configuration API Access amount as claimed in claim 2, it is characterised in that described if it is determined that next time
Theoretical visit capacity is less than last theoretical visit capacity, then the component after theoretical visit capacity next time is reconfigured into constraint set closes
Also include in being calculated:
When next time, theoretical visit capacity is less than last theoretical visit capacity, then by the component after theoretical visit capacity next time again
A constraint set is configured to, weights and API history visit capacity weight computings shared by progress API are finally completed API Access amount
Configuration.
4. the method for the dynamic configuration API Access amount as described in any one of claims 1 to 3, it is characterised in that methods described is also
Including:
When the access request amount increased newly in some period is more than the threshold parameter that client is pre-configured with, triggering is carried out shared by API
With weights and API history visit capacity weight computings, the configuration of API Access amount is finally completed.
5. a kind of API gateway, it is characterised in that the API gateway includes:
API takes weights computing module, for calculating weights shared by each application programming interfaces API;
History visit capacity weight computing module, for calculating each API history visit capacity in the API set according to history visit capacity
Weights
Visit capacity computing module is corrected, for calculating theoretical after amendment access according to the actual access amount of history visit capacity and resource
Amount, calculate allows to access after amendment, and the theoretical visit capacity publicity that j-th of API of access is allowed after amendment is:
Wherein:The weights of j-th of API history visit capacity statistics during the r times amendment are represented,To allow the theoretical visit capacity for accessing j-th of API after the r times amendment, i represents i-th of application requests;
Revised theory visit capacity comparison module, for based on calculate theoretical visit capacity after amendment judge next time theoretical visit capacity with
The magnitude relationship of last theory visit capacity;
API Access amount configuration module, for when judging that theoretical visit capacity is more than or equal to upper once theoretical visit capacity next time, then
Last theoretical visit capacity is configured to API Access amount;And judging that theoretical visit capacity is less than upper once theoretical visit next time
The amount of asking, then reconfigure constraint set conjunction by the component after theoretical visit capacity next time and calculated.
6. API gateway as claimed in claim 5, it is characterised in that the API gateway also includes:
Load balancing module, for judging that resource service condition is whether within load after amendment, if resource service condition exists
Within load, then enter revised theory visit capacity comparison module be used for judge theoretical visit capacity and last theoretical visit next time
The magnitude relationship for the amount of asking;If resource service condition is beyond load, computational load introduces parameter so that theoretical after amendment to visit
The amount of asking entered in loading range, then revised theory visit capacity comparison module be used for judge theoretical visit capacity and upper one next time
The magnitude relationship of secondary theoretical visit capacity.
7. API gateway as claimed in claim 6, it is characterised in that the API Access amount configuration module is additionally operable to ought be next time
When theoretical visit capacity is less than last theoretical visit capacity, then the component after theoretical visit capacity next time is re-configured to one
Constraint set, feeds back to API and takes weight computing and history visit capacity weights meter shared by progress API in weights computing module
Calculate and API history visit capacity weight computings are carried out in module, the configuration of API Access amount is completed again.
8. the API gateway as described in any one of claim 5 to 7, it is characterised in that the API gateway also includes:Threshold triggers
Module, for judge when in some period increase newly access request amount more than the threshold parameter that client is pre-configured with when, trigger into
Weights shared by row API and API history visit capacity weight computings, are finally completed the configuration of API Access amount.
9. a kind of system of dynamic configuration API Access amount, it is characterised in that the system includes:
Multiple api interfaces, are connected with multiple applications clients, for receiving calling for API application programs;
Multiple API servers, for storing API resources;
API gateway, is connected to multiple api interfaces, and is connected to multiple API servers, for calculating each application programming interfaces
Weights shared by API, and each API history visit capacity weights in the API set are calculated according to history visit capacityAccording to going through
The actual access amount of history visit capacity and resource calculates theoretical visit capacity after amendment and calculated to be allowed to access after amendment, allows to visit after amendment
The theoretical visit capacity publicity for asking j-th of API is:
Wherein:The weights of j-th of API history visit capacity statistics during the r times amendment are represented,To allow the theoretical visit capacity for accessing j-th of API after the r times amendment, i represents i-th of application requests;Based on calculating
Theoretical visit capacity judges the magnitude relationship of theoretical visit capacity and last theoretical visit capacity next time after amendment;If it is determined that next
Secondary theoretical visit capacity is more than or equal to last theoretical visit capacity, then last theoretical visit capacity is configured into API Access amount;If
Judge that theoretical visit capacity is less than last theoretical visit capacity next time, then by the component after theoretical visit capacity next time again structure
Constraint set is made to be calculated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410331882.XA CN104168133B (en) | 2014-07-11 | 2014-07-11 | The method and gateway and system of a kind of dynamic configuration API Access amount |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410331882.XA CN104168133B (en) | 2014-07-11 | 2014-07-11 | The method and gateway and system of a kind of dynamic configuration API Access amount |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104168133A CN104168133A (en) | 2014-11-26 |
CN104168133B true CN104168133B (en) | 2017-07-18 |
Family
ID=51911780
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410331882.XA Expired - Fee Related CN104168133B (en) | 2014-07-11 | 2014-07-11 | The method and gateway and system of a kind of dynamic configuration API Access amount |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104168133B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106803815B (en) * | 2015-11-26 | 2020-03-24 | 阿里巴巴集团控股有限公司 | Flow control method and device |
CN107026877B (en) * | 2016-01-29 | 2020-07-07 | 华为技术有限公司 | Method and device for managing resources in cloud platform |
JP6957194B2 (en) | 2016-12-13 | 2021-11-02 | キヤノン株式会社 | Service system, its control method, and its program |
CN108023958B (en) * | 2017-12-08 | 2020-06-23 | 中电莱斯信息系统有限公司 | Resource scheduling system based on cloud platform resource monitoring |
CN109936589B (en) * | 2017-12-15 | 2021-09-03 | 中国移动通信集团浙江有限公司 | Dynamic load balancing method, device and platform based on API (application program interface) heat value |
CN108388475B (en) * | 2018-02-27 | 2021-06-29 | 周翠敏 | Method and system for configuring API (application program interface) resources based on terminal type |
EP3761560B1 (en) | 2018-03-21 | 2023-07-05 | Huawei Cloud Computing Technologies Co., Ltd. | Control method for application programming interface (api) gateway cluster, and api gateway cluster |
CN108845869B (en) * | 2018-05-31 | 2023-04-07 | 中国平安人寿保险股份有限公司 | Concurrent request control method, device, computer equipment and storage medium |
CN112788099A (en) * | 2020-11-11 | 2021-05-11 | 中移雄安信息通信科技有限公司 | Method, device and equipment for loading back-end service and computer storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060126086A (en) * | 2005-06-03 | 2006-12-07 | 주식회사 케이티프리텔 | System and method for full and interactive mobile communication service of parlay gateway-based |
CN1968134A (en) * | 2006-04-03 | 2007-05-23 | 华为技术有限公司 | Middleware-based multimedia consolidation service realizing method and system |
CN101997746A (en) * | 2009-12-18 | 2011-03-30 | 中国科学院声学研究所 | Dynamic service quality strategy method and system of home network |
CN102281311A (en) * | 2010-06-10 | 2011-12-14 | 阿里巴巴集团控股有限公司 | Method, system and device for implementing network service based on open application programming interface |
-
2014
- 2014-07-11 CN CN201410331882.XA patent/CN104168133B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060126086A (en) * | 2005-06-03 | 2006-12-07 | 주식회사 케이티프리텔 | System and method for full and interactive mobile communication service of parlay gateway-based |
CN1968134A (en) * | 2006-04-03 | 2007-05-23 | 华为技术有限公司 | Middleware-based multimedia consolidation service realizing method and system |
CN101997746A (en) * | 2009-12-18 | 2011-03-30 | 中国科学院声学研究所 | Dynamic service quality strategy method and system of home network |
CN102281311A (en) * | 2010-06-10 | 2011-12-14 | 阿里巴巴集团控股有限公司 | Method, system and device for implementing network service based on open application programming interface |
Also Published As
Publication number | Publication date |
---|---|
CN104168133A (en) | 2014-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104168133B (en) | The method and gateway and system of a kind of dynamic configuration API Access amount | |
DE102020203877A1 (en) | PROCEDURES AND EQUIPMENT FOR CONTROLLING THE PROCESSING OF TELEMETRY DATA ON AN EDGE PLATFORM | |
US7664847B2 (en) | Managing workload by service | |
CN109995669B (en) | Distributed current limiting method, device, equipment and readable storage medium | |
WO2009144822A1 (en) | Device configuration information management program, device configuration information management device, and device configuration information management method | |
US11178065B2 (en) | System and methods for optimal allocation of multi-tenant platform infrastructure resources | |
US20170235606A1 (en) | System and methods for implementing control of use of shared resource in a multi-tenant system | |
CN102495758A (en) | Scheduling method of real-time tasks in distributing type high performance calculation environment | |
CN102835067A (en) | Method and apparatus for hierarchical management of system resources | |
CN107977763A (en) | Resource allocation method and related device | |
CN106911592A (en) | A kind of adaptive resource allocation method and device | |
CN102938790A (en) | Resource allocation method of cloud computing system | |
CN109962855A (en) | A kind of current-limiting method of WEB server, current-limiting apparatus and terminal device | |
CN107659460A (en) | A kind of method of provisioning API visit capacity | |
CN115297112A (en) | Dynamic resource quota and scheduling component based on Kubernetes | |
CN106210129A (en) | The current-limiting method of a kind of sing on web server configures and system | |
CN109062739A (en) | Dispatch server, load-balancing method, system and readable storage medium storing program for executing | |
CN110535670B (en) | NFV capacity planning method and electronic equipment | |
CN108228346A (en) | service system and its control method | |
CN107277143A (en) | A kind of resource matched management method and device | |
CN111813524A (en) | Task execution method and device, electronic equipment and storage medium | |
CN110365743A (en) | A kind of a variety of load balancer implementation methods that can customize loading algorithm of support realized based on Zookeeper | |
CN114443293A (en) | Deployment system and method for big data platform | |
CN113159751A (en) | Bank transfer amount sharing method and device | |
Yang et al. | Optimal admission control under premature discharge decisions for operational effectiveness |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170718 Termination date: 20200711 |
|
CF01 | Termination of patent right due to non-payment of annual fee |