CN102868770B - A kind of method of distribution interface, equipment and system - Google Patents
A kind of method of distribution interface, equipment and system Download PDFInfo
- Publication number
- CN102868770B CN102868770B CN201110187476.7A CN201110187476A CN102868770B CN 102868770 B CN102868770 B CN 102868770B CN 201110187476 A CN201110187476 A CN 201110187476A CN 102868770 B CN102868770 B CN 102868770B
- Authority
- CN
- China
- Prior art keywords
- service
- type
- frequency
- middle tier
- 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.)
- Active
Links
Abstract
The invention discloses a kind of method of distribution interface, equipment and system, belong to the communications field.Described method includes: receiving the call request that middle tier server sends, described call request at least carries interface identifier and type of service;Obtain described type of service corresponding call frequency and frequency threshold, according to described type of service corresponding call frequency and frequency threshold determines whether described middle tier server has permission calling interface;If it is, give described middle tier server according to the interface that the distribution of described interface identifier is corresponding.Described equipment includes: receiver module, determine module and distribution module.Described system includes: middle tier server and Access Layer server.The present invention is it can be avoided that transship.
Description
Technical field
The present invention relates to the communications field, particularly to method, equipment and the system of a kind of distribution interface.
Background technology
At present, the scene of many Internets background service includes intermediate layer and Access Layer, and intermediate layer is by middle tier server
Composition, Access Layer is made up of Access Layer server;When foreground client is to backstage requested service, middle tier server sends to be adjusted
With request to Access Layer server, request Access Layer server is its distribution interface.
At present, prior art provides a kind of method of distribution interface, particularly as follows: Access Layer server receives intermediate layer clothes
Business device send call request, obtain this middle tier server corresponding call frequency, if calling frequency not less than in the middle of this
The frequency threshold that stratum server is corresponding, then distribute interface corresponding to this interface identifier give this middle tier server, otherwise return mistake
False information gives this middle tier server;After the complete interface of Access Layer server-assignment, middle tier server by this interface to access
The packet of the business that stratum server request foreground client is asked, wherein, technical staff is in advance in Access Layer server
The frequency threshold of correspondence is set for this middle tier server.
During realizing the present invention, inventor finds that prior art at least there is problems in that
As long as middle tier server call the frequency threshold that frequency is corresponding not less than this middle tier server, then Access Layer
Server distribution interface will give this middle tier server, so when having substantial amounts of foreground client to different intermediate layer services
During device requested service, middle tier server can be made big to the business quantitative change of Access Layer server request business so that Access Layer takes
The load of business device becomes big, it is easy to transship.
Summary of the invention
In order to avoid transshipping, the invention provides a kind of method of distribution interface, equipment and system.Described technical side
Case is as follows:
A kind of method of distribution interface, described method includes:
Receiving the call request that middle tier server sends, described call request at least carries interface identifier and service class
Type;
Obtain described type of service corresponding call frequency and frequency threshold, according to described type of service corresponding call frequency
Rate and frequency threshold determine whether described middle tier server has permission calling interface;
If it is, give described middle tier server according to the interface that the distribution of described interface identifier is corresponding.
Obtain described type of service correspondence and call frequency and frequency threshold, according to described type of service corresponding call frequency
Determine whether described middle tier server has permission calling interface with frequency threshold, including:
Type of service, call number and the corresponding relation of timer according to described type of service and stored, obtains institute
State type of service corresponding call frequency;
The type of service according to described type of service and stored and the corresponding relation of frequency threshold, obtain described service class
The frequency threshold that type is corresponding;
According to described type of service corresponding call frequency and frequency threshold, determine whether described middle tier server has the right
Limit calling interface.
Type of service, call number and the corresponding relation of timer according to described type of service and stored, obtains institute
State type of service corresponding call frequency, including:
According to described type of service, search from the type of service stored, the call number corresponding relation with timer
Go out call number and the timer of correspondence;
Increase the call number of described lookup, according to time meter when call number and the described timer of described increase
Calculate described type of service corresponding call frequency.
According to described type of service corresponding call frequency and frequency threshold, determine whether described middle tier server has the right
Limit calling interface, including:
Judge described type of service corresponding call whether frequency exceedes the frequency threshold that described type of service is corresponding, if
Not less than, it is determined that go out described middle tier server and have permission calling interface, if it does, then determine that described intermediate layer services
Device does not has authority calling interface.
Described method also includes:
If the corresponding relation of described type of service, call number and timer existing the record of timer expired, then
Empty the call number in described record, and make the timer of time-out in described record restart timing.
Described call request also carries the mark of described middle tier server;
Correspondingly, according to described type of service corresponding call frequency and frequency threshold, determine described middle tier server
Whether have permission calling interface, including:
Judge described type of service corresponding call whether frequency exceedes the frequency threshold that described type of service is corresponding, if
Exceed, it is determined that going out described middle tier server does not has authority calling interface;
If not less than, then obtain corresponding the calling of described middle tier server according to the mark of described middle tier server
Frequency and frequency threshold, according to described middle tier server corresponding call frequency and frequency threshold determines that described intermediate layer services
Whether device has permission calling interface.
A kind of equipment of distribution interface, described equipment includes:
Receiver module, for receiving the call request that middle tier server sends, described call request at least carries interface
Mark and type of service;
Determine module, for obtain described type of service corresponding call frequency and frequency threshold, according to described service class
What type was corresponding call frequency and frequency threshold determines whether described middle tier server has permission calling interface;
Distribution module is if being yes for the described result determining that module determines, then right according to the distribution of described interface identifier
The interface answered gives described middle tier server.
Described determine that module includes:
First acquiring unit, for the type of service, call number and the timer that according to described type of service and have stored
Corresponding relation, obtain described type of service corresponding call frequency;
Second acquisition unit, for according to described type of service and the type of service that stored pass corresponding with frequency threshold
System, obtains the frequency threshold that described type of service is corresponding;
Determine unit, for according to described type of service corresponding call frequency and frequency threshold, determine described intermediate layer
Whether server has permission calling interface.
Described first acquiring unit includes:
Search subelement, for according to described type of service, from the type of service stored, call number and timer
Corresponding relation finds out call number and the timer of correspondence;
Computation subunit, for increasing the call number of described lookup, according to call number and the described meter of described increase
Time device timing Time Calculation go out described type of service corresponding call frequency.
Described determine unit, specifically for judge described type of service corresponding call whether frequency exceedes described service class
The frequency threshold that type is corresponding, if not less than, it is determined that go out described middle tier server and have permission calling interface, if it does,
Then determine that described middle tier server does not has authority calling interface.
Described equipment also includes:
Empty module, if there is timer in described type of service, the call number corresponding relation with timer
The record of time-out, then empty the call number in described record, and make the timer of time-out in described record restart timing.
Described call request also carries the mark of described middle tier server;
Correspondingly, described determine that unit includes:
Judgment sub-unit, for judging frequency of calling corresponding to described type of service, whether to exceed described type of service corresponding
Frequency threshold, if it does, then determine that described middle tier server does not has authority calling interface;
Determine subelement, if for not less than, then obtain described intermediate layer according to the mark of described middle tier server
What server was corresponding calls frequency and frequency threshold, according to described middle tier server corresponding call frequency and frequency threshold is true
Whether fixed described middle tier server has permission calling interface.
The system of a kind of distribution interface, described system includes middle tier server and Access Layer server;
Described middle tier server, the user profile for sending according to foreground client determines the type of service of correspondence
And the command word sent according to described foreground client determines the interface identifier of correspondence, send call request, described in call
Described type of service and interface identifier are carried in request;
Described Access Layer server, for receiving the call request that middle tier server sends, obtains described type of service
Corresponding calls frequency and frequency threshold, according to described type of service corresponding call frequency and frequency threshold determines described centre
Whether stratum server has permission calling interface, if it is, give described centre according to the interface that the distribution of described interface identifier is corresponding
Stratum server.
Described Access Layer server, by the type of service according to described type of service and stored, call number and based on
Time device corresponding relation, obtain described type of service corresponding call frequency;According to described type of service and the business that stored
Type and the corresponding relation of frequency threshold, obtain the frequency threshold that described type of service is corresponding;Corresponding according to described type of service
Call frequency and frequency threshold, determine whether described middle tier server has permission calling interface.
Described Access Layer server, for according to described type of service, from the type of service stored, call number and meter
Time device corresponding relation in find out correspondence call number and timer;Increase the call number of described lookup, according to described
Increase call number go out with Time Calculation during described timer described type of service corresponding call frequency.
Described Access Layer server, for judge described type of service corresponding call whether frequency exceedes described service class
The frequency threshold that type is corresponding, if not less than, it is determined that go out described middle tier server and have permission calling interface, if it does,
Then determine that described middle tier server does not has authority calling interface.
Described Access Layer server, if be additionally operable in the corresponding relation of described type of service, call number and timer
There is the record of timer expired, then empty the call number in described record, and make the timing of time-out in described record think highly of
Newly start timing.
Described call request also carries the mark of described middle tier server;
Described Access Layer server, for judge described type of service corresponding call whether frequency exceedes described service class
The frequency threshold that type is corresponding, if it does, then determine that described middle tier server does not has authority calling interface;If do not surpassed
Cross, then according to described middle tier server mark obtain described middle tier server corresponding call frequency and frequency threshold,
According to described middle tier server corresponding call frequency and frequency threshold determines whether described middle tier server has permission tune
Use interface.
In the present invention, Access Layer server obtain middle tier server send type of service corresponding call frequency and
Frequency threshold, calls authority to middle tier server control according to call frequency and the frequency threshold that this type of service is corresponding
System, and the kind of type of service is less, so when there being a large amount of foreground client to different middle tier server requested services,
Middle tier server can be called authority to be controlled, such that it is able to prevent the load of Access Layer server from becoming big, it is to avoid
Overload occurs.
Accompanying drawing explanation
Fig. 1 is the network architecture diagram of embodiment of the present invention application;
Fig. 2 is the method flow diagram of a kind of distribution interface that the embodiment of the present invention 1 provides;
Fig. 3 is the method flow diagram of a kind of distribution interface that the embodiment of the present invention 2 provides;
Fig. 4 is the method flow diagram of a kind of distribution interface that the embodiment of the present invention 3 provides;
Fig. 5 is the equipment schematic diagram of a kind of distribution interface that the embodiment of the present invention 4 provides;
Fig. 6 is the system schematic of a kind of distribution interface that the embodiment of the present invention 5 provides.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Seeing Fig. 1, the network architecture of embodiment of the present invention application, including foreground client and background server, backstage takes
Business end is divided into three layers, and including intermediate layer, Access Layer and bottom, intermediate layer includes one or more middle tier server, Access Layer
Include that one or more bottom stores server including one or more Access Layer servers and bottom;Foreground client sends
User asks to background server, and this user request, for the business required for background server request, is positioned at intermediate layer
Middle tier server receives user's request that foreground client sends, and sends for asking the call request of distribution interface to being positioned at
The Access Layer server of Access Layer, Access Layer server utilizes the distribution interface that the present invention provides after receiving this call request
Method is this middle tier server distribution interface, and this user request is sent to by this middle tier server again by the interface of distribution
This Access Layer server, this user request is transmitted to be positioned at the bottom storage server of bottom by this Access Layer server again, should
Bottom storage server obtains the business that this user is asked again, and the packet of this business is sent to this Access Layer service
Device, this Access Layer server forwards the packet of this business to this middle tier server again, and this middle tier server forwards this again
The packet of business is to foreground client.
Embodiment 1
As in figure 2 it is shown, a kind of method embodiments providing distribution interface, including:
Step 101: receive middle tier server send call request, and this call request at least carry interface identifier and
Type of service;
Step 102: obtain this type of service correspondence and call frequency and frequency threshold, according to corresponding the calling of this type of service
Frequency and frequency threshold determine whether middle tier server has permission calling interface;
Step 103: if it is, distribute corresponding interface to middle tier server according to this interface identifier.
In embodiments of the present invention, Access Layer server obtains corresponding the calling of type of service that middle tier server sends
Frequency and frequency threshold, according to this type of service corresponding call frequency and middle tier server is called authority by frequency threshold
It is controlled, and the kind of type of service is less, so when having a large amount of foreground client to different middle tier server requests
During business, middle tier server can be called authority and be controlled, such that it is able to prevent the load of Access Layer server from becoming
Greatly, it is to avoid overload occurs.
Embodiment 2
As it is shown on figure 3, a kind of method embodiments providing distribution interface, including:
Step 201: middle tier server receives user's request that foreground client sends, life is at least carried in this user request
Make word and user profile;
Wherein, foreground client can send user and asks to the business required for middle tier server is asked, and often
The all corresponding a kind of user profile of the business of kind, middle tier server needs to obtain, by interface, the industry that foreground client is asked
Business, then the business of acquisition is returned to foreground client, and the corresponding command word of each interface.
Step 202: middle tier server determines the interface identifier of correspondence according to the command word that this user request is carried, with
And ask the user profile carried to determine the type of service of corresponding business according to this user;
Wherein, in middle tier server, configured in advance has the corresponding relation of command word and interface identifier.Specifically, middle
Stratum server asks the command word carried according to this user, obtains from the command word the stored corresponding relation with interface identifier
Corresponding interface identifier, the user profile carried further according to this user request is determined the business that foreground client is asked, is entered
And determine the type of service of foreground client institute requested service.
Step 203: middle tier server sends call request to Access Layer server, and this call request carries connecing of determining
Mouth mark and type of service;
Wherein, middle tier server asks Access Layer server to be the interface required for its distribution by call request.
It is assumed that the interface identifier determined of middle tier server and type of service are respectively interface and relation chain, then
It is interface and type of service that middle tier server is sent to the interface identifier that the call request of Access Layer server carries
For relation chain.
Step 204: Access Layer server receives this call request, the type of service carried according to this call request and having deposited
The type of service of storage, the corresponding relation of call number and timer, obtain this type of service corresponding call frequency;
Specifically, the type of service carried according to this call request, from the type of service stored, call number and timing
In the corresponding relation of device, find out call number and the timer of correspondence, increase the call number searched, according to the tune after increasing
With the time during timer of number of times and lookup, calculate this type of service corresponding call frequency.
Wherein, in Access Layer server, type of service as shown in table 1, call number are configured in advance right with timer
Should be related to, Access Layer server, all can be corresponding with timer in type of service, call number after receiving call request
Relation increases the call number that type of service that this call request carries is corresponding.It addition, it is permissible to increase the call number searched
Particularly as follows: be the call number increase by 1 or 2 etc. searched, at the present embodiment, the value increased is not specifically limited.
Table 1
Type of service | Call number | Timer |
Relation chain | 29 | Timer 1 |
…… | …… | …… |
Such as, Access Layer server is relation chain according to the type of service that this call request is carried, from industry as shown in table 1
Service type, call number are with to find out corresponding call number in the corresponding relation of timer be 29 and timer is timer
1, to the call number searched increase by 1 to obtain call number is 30, it is assumed that the time of timer 1 timing is 5s, then according to calling
The frequency of calling that number of times 30 calculates type of service relation chain corresponding with the time 5s of timer 1 timing is 6;In addition, it is necessary to say
Bright: after increasing by 1 to the call number searched, the corresponding relation of the type of service, call number and the timer that obtain is such as
Shown in table 2.
Table 2
Type of service | Call number | Timer |
Relation chain | 30 | Timer 1 |
…… | …… | …… |
Wherein, the timer during every in type of service, the call number corresponding relation with timer is recorded, as
Really timer expired, then the call number during Access Layer server empties the timer place record of time-out, and the timing of time-out
Timing is restarted after device time-out.For example, it is assumed that timer 1 is overtime, then Access Layer server is in service class as shown in table 2
Type, call number and the corresponding relation of timer empty the call number in the record of timer 1 place, obtains as shown in table 3
Type of service, the corresponding relation of call number and timer, and in type of service as shown in table 3, call number and timing
Timing is restarted after corresponding relation Timer 1 time-out of device.
Table 3
Type of service | Call number | Timer |
Relation chain | 0 | Timer 1 |
…… | …… | …… |
Step 205: type of service that Access Layer server carries according to this call request and the type of service that stored with
The corresponding relation of frequency threshold, obtains the frequency threshold that this type of service is corresponding;
Specifically, the type of service that Access Layer server carries according to this call request, from the type of service stored with
Obtaining the frequency threshold of correspondence in the corresponding relation of frequency threshold, the frequency threshold of acquisition is the frequency threshold that this type of service is corresponding
Value.
Wherein, technical staff arranges a frequency threshold of correspondence in advance for every kind of type of service, and by every kind of service class
Type and the frequency threshold arranged for every kind of type of service are stored in the type of service corresponding relation with frequency threshold.
Such as, the frequency threshold that technical staff arranges correspondence for type of service relation chain in advance is 10, and by business
Type of relationship chain is stored in the type of service as shown in table 4 corresponding relation with frequency threshold with the frequency threshold 10 of setting;
Correspondingly, Access Layer server is relation chain according to the type of service that call request is carried, from type of service as shown in table 4 with
The frequency threshold obtaining type of service relation chain corresponding in the corresponding relation of frequency threshold is 10.
Table 4
Type of service | Frequency threshold |
Relation chain | 10 |
…… | …… |
Step 206: Access Layer server according to this type of service corresponding call frequency and frequency threshold determines in the middle of this
Whether stratum server has permission calling interface, if it has, then perform step 207;
Specifically, Access Layer server judges frequency of calling corresponding to this type of service whether to exceed this type of service corresponding
Frequency threshold, if not less than, it is determined that go out this middle tier server and have permission calling interface, if it does, then determine
This middle tier server does not has authority calling interface.
Wherein, if it is determined that going out this middle tier server does not has authority calling interface, then Access Layer server returns mistake
Information is to middle tier server, end operation.
Such as, Access Layer server judge relation chain corresponding call the frequency threshold that frequency 5 is corresponding less than relation chain
10, it is determined that go out this middle tier server and have permission calling interface, perform step 207.
Step 207: the interface of the interface identifier distribution correspondence that Access Layer server carries according to call request is in the middle of this
Stratum server.
Such as, interface corresponding to Access Layer server carries according to call request interface identifier interface distribution to
Middle tier server.
Wherein, after middle tier server is assigned to interface, call the interface of distribution, and by the interface of distribution by reception
User's request is sent to Access Layer server, and this user request is transmitted to bottom storage server, the end by Access Layer server again
After layer storage server receives this user request, obtain corresponding business according to the user profile that this user request is carried, will
The packet of this business is sent to Access Layer server, and Access Layer server passes through the interface of distribution again by the packet of this business
Being sent to this middle tier server, the packet of this business is sent to foreground client, foreground visitor by this middle tier server again
Family end receives the packet of this business, thus gets self required business.
In embodiments of the present invention, Access Layer server obtains corresponding the calling of type of service that middle tier server sends
Frequency and frequency threshold, according to this type of service corresponding call frequency and middle tier server is called authority by frequency threshold
It is controlled, and the kind of type of service is less, so when having a large amount of foreground client to different middle tier server requests
During business, middle tier server can be called authority and be controlled, such that it is able to prevent the load of Access Layer server from becoming
Greatly, it is to avoid overload occurs.
Embodiment 3
As shown in Figure 4, a kind of method embodiments providing distribution interface, including:
Step 301: middle tier server receives user's request that foreground client sends, life is at least carried in this user request
Make word and user profile;
Step 302: middle tier server determines the interface identifier of correspondence according to the command word that this user request is carried, with
And ask the user profile carried to determine the type of service of corresponding business according to this user;
Specifically, middle tier server asks the command word carried according to this user, from the command word stored and interface
Obtaining the interface identifier of correspondence in the corresponding relation of mark, the user profile carried further according to this user request determines foreground visitor
The business that family end is asked, and then determine the type of service of foreground client institute requested service.
Step 303: middle tier server sends call request to Access Layer server, and this call request carries connecing of determining
Mouth mark and type of service and the mark of self;
Wherein, middle tier server asks the interface required for Access Layer server-assignment by call request, when connecing
After entering the interface required for stratum server distribution middle tier server, middle tier server just can call the interface of distribution and lead to
The interface crossing distribution obtains the business required for foreground client to Access Layer server request.It addition, be positioned at the every of intermediate layer
Individual middle tier server has the mark of oneself, and the mark of middle tier server can be the IP of middle tier server
(Internet Protocol, the agreement of interconnection between network) address or URL (Uniform/Universal Resource
Locator, URL) etc. information.
It is assumed that the interface identifier determined of middle tier server and type of service are respectively interface and relation chain, with
And middle tier server be designated IP1, then middle tier server is issued the call request of Access Layer server and is carried interface mark
Know for interface, type of service be relation chain and middle tier server be designated IP1.
Step 304: Access Layer server receives this call request, the type of service carried according to this call request and having deposited
The type of service of storage, the corresponding relation of call number and timer, obtain this type of service corresponding call frequency;
Specifically, the type of service carried according to this call request, from the type of service stored, call number and timing
In the corresponding relation of device, find out call number and the timer of correspondence, increase the call number searched, according to the tune after increasing
With the time during timer of number of times and lookup, calculating and call frequency, the frequency of calling calculated is this type of service pair
That answers calls frequency.
Wherein, Access Layer server whenever receive call request all can be at type of service, call number and timer
Corresponding relation increases the call number that type of service that this call request carries is corresponding;It addition, for type of service, call time
Number and the timer in every record in the corresponding relation of timer, if timer expired, then Access Layer server empties
Call number in the timer place record of time-out, and after the timer expired of time-out, restart timing.
Such as, Access Layer server is relation chain according to the type of service that this call request is carried, from industry as shown in table 1
Service type, call number are with to find out corresponding call number in the corresponding relation of timer be 29 and timer is timer
1, to the call number searched increase by 1 to obtain call number is 30, it is assumed that the time of timer 1 timing is 5s, then according to calling
The frequency of calling that number of times 30 calculates type of service relation chain corresponding with the time 5s of timer 1 timing is 6.
Step 305: type of service that Access Layer server carries according to this call request and the type of service that stored with
The corresponding relation of frequency threshold, obtains the frequency threshold that this type of service is corresponding;
Specifically, the type of service that Access Layer server carries according to this call request, from the type of service stored with
Obtaining the frequency threshold of correspondence in the corresponding relation of frequency threshold, the frequency threshold of acquisition is the frequency threshold that this type of service is corresponding
Value.
Wherein, technical staff arranges a frequency threshold of correspondence in advance for every kind of type of service, and by every kind of service class
Type and the frequency threshold arranged for every kind of type of service are stored in the type of service corresponding relation with frequency threshold.
Such as, Access Layer server is relation chain according to the type of service that call request is carried, from business as shown in table 4
Type is 10 with the frequency threshold obtaining type of service relation chain corresponding in the corresponding relation of frequency threshold.
Step 306: Access Layer server judge this type of service corresponding call whether frequency exceedes this type of service pair
The frequency threshold answered, if not less than, then perform step 307;
Wherein, if it is judged that frequency of calling corresponding to this type of service exceedes the frequency threshold that this type of service is corresponding,
Then Access Layer server determines that this middle tier server does not has authority calling interface, and returns error message to intermediate layer service
Device, end operation.
Such as, Access Layer server judge relation chain corresponding call the frequency threshold that frequency 5 is corresponding less than relation chain
10, then perform step 307.
Step 307: the mark of middle tier server that Access Layer server carries according to this call request and having stored
Mark, call number obtain with the corresponding relation of timer this middle tier server corresponding call frequency;
Specifically, according to the mark of this middle tier server that this call request is carried, from the intermediate layer service stored
The mark of device, call number, with the corresponding relation of timer, find out call number and the timer of correspondence, increase lookup
Call number, according to the time when call number after increasing and the timer of lookup, calculates this middle tier server pair
That answers calls frequency.
Wherein, configure in Access Layer server in advance the mark of middle tier server as shown in table 5, call number with
The corresponding relation of timer, Access Layer server, all can be at the mark of middle tier server, tune after receiving call request
With number of times corresponding with the mark increasing the middle tier server that this call request carries in the corresponding relation of timer call secondary
Number;It addition, for the timing in every record in the corresponding relation of mark, call number and the timer of middle tier server
Device, if timer expired, the then call number during Access Layer server empties the timer place record of time-out, and time-out
Timing is restarted after timer expired.
Table 5
The mark of middle tier server | Call number | Timer |
IP1 | 39 | Timer 2 |
…… | …… | …… |
Such as, mark IP1 of the middle tier server that Access Layer server carries according to this call request, from such as table 5 institute
The mark of the middle tier server shown, call number with the corresponding relation of timer finds out corresponding call number be 39 with
And timer is timer 2, to the call number searched increase by 1 to obtain call number is 40, it is assumed that the time of timer 2 timing
For 8s, then according to call number 40 calculate with the time 8s of timer 2 timing this middle tier server corresponding call frequency
It is 5;In addition, it is necessary to explanation is to increase after 1 to the call number searched, the mark of the middle tier server obtained, call time
Number is as shown in table 6 with the corresponding relation of timer.
Table 6
The mark of middle tier server | Call number | Timer |
IP1 | 40 | Timer 2 |
…… | …… | …… |
Assume timer 2 time-out, then Access Layer server middle tier server as shown in table 6 mark, call time
Number and the corresponding relation of timer empty the call number in the record of timer 2 place, obtains intermediate layer clothes as shown in table 7
The business mark of device, the corresponding relation of call number and timer, and middle tier server as shown in table 7 mark, call
Number of times restarts timing after corresponding relation Timer 2 time-out of timer.
Table 7
Type of service | Call number | Timer |
Relation chain | 0 | Timer 1 |
…… | …… | …… |
Step 308: the mark of middle tier server that Access Layer server carries according to this call request and having stored
The mark of middle tier server and the corresponding relation of frequency threshold, obtain the frequency threshold that this middle tier server is corresponding;
Specifically, the mark of the middle tier server that Access Layer server carries according to this call request, from stored
The mark of middle tier server with the corresponding relation of frequency threshold obtains corresponding frequency threshold, the frequency threshold of acquisition for should
The frequency threshold that middle tier server is corresponding.
Wherein, technical staff arranges a frequency threshold of correspondence in advance for each middle tier server, and by each
Between the mark of stratum server and the frequency threshold that arranges for each middle tier server be stored in the mark of middle tier server
With in the corresponding relation of frequency threshold.
Such as, the frequency threshold that technical staff arranges correspondence for this middle tier server in advance is 9, and by the middle of this
The mark IP1 of stratum server and the frequency threshold 10 of setting are stored in mark and the frequency of middle tier server as shown in table 8
In the corresponding relation of threshold value;Correspondingly, mark IP1 of the middle tier server that Access Layer server carries according to call request,
From the mark of middle tier server as shown in table 8 with the corresponding relation of frequency threshold, obtain this middle tier server corresponding
Frequency threshold be 9.
Table 8
The mark of middle tier server | Frequency threshold |
IP1 | 9 |
…… | …… |
Step 309: Access Layer server according to this middle tier server corresponding call frequency and frequency threshold determines this
Whether middle tier server has permission calling interface, if it has, then perform step 310;
Specifically, Access Layer server judge this middle tier server corresponding call frequency whether exceed this intermediate layer clothes
The frequency threshold that business device is corresponding, if not less than, it is determined that go out this middle tier server and have permission calling interface, if it does,
Then determine that this middle tier server does not has authority calling interface.
Wherein, if it is determined that going out this middle tier server does not has authority calling interface, then Access Layer server returns mistake
Information is to middle tier server, end operation.
Such as, Access Layer server judges that the frequency 8 of calling that this middle tier server is corresponding services less than this intermediate layer
The frequency threshold 9 that device is corresponding, it is determined that go out this middle tier server and have permission calling interface, perform step 310.
Step 310: the interface of the interface identifier distribution correspondence that Access Layer server carries according to call request is in the middle of this
Stratum server.
Such as, interface corresponding to Access Layer server carries according to call request interface identifier interface distribution to
Middle tier server.
Wherein, after middle tier server is assigned to interface, calls the interface of distribution, and the interface passing through to call is by reception
User's request is sent to Access Layer server, and this user request is transmitted to bottom storage server, the end by Access Layer server again
After layer storage server receives this user request, obtain corresponding business according to the user profile that this user request is carried, will
The packet of this business is sent to Access Layer server, and the interface that Access Layer server is called by this middle tier server again will
The packet of this business is sent to this middle tier server, and the packet of this business is sent to foreground by this middle tier server again
Client, foreground client receives the packet of this business, thus gets self required business.
In embodiments of the present invention, Access Layer server obtains corresponding the calling of type of service that middle tier server sends
Frequency and frequency threshold, according to this type of service corresponding call frequency and middle tier server is called authority by frequency threshold
It is controlled, and the kind of type of service is less, so when having a large amount of foreground client to different middle tier server requests
During business, middle tier server can be called authority and be controlled, such that it is able to prevent the load of Access Layer server from becoming
Greatly, it is to avoid overload occurs.
Embodiment 4
As it is shown in figure 5, embodiments provide the equipment of a kind of distribution interface, including:
Receiver module 401, for receiving the call request that middle tier server sends, and this call request is at least carried and is connect
Mouth mark and type of service;
Determine module 402, for obtain this type of service corresponding call frequency and frequency threshold, according to this type of service
Corresponding call frequency and frequency threshold determines whether this middle tier server has permission calling interface;
Distribution module 403 is for if it is determined that the result that module 402 determines is yes, then right according to the distribution of this interface identifier
The interface answered gives this middle tier server.
Wherein it is determined that module 402 includes:
First acquiring unit, for the type of service according to this type of service and stored, call number and timer
Corresponding relation, obtain this type of service corresponding call frequency;
Second acquisition unit, for according to this type of service and the type of service that stored pass corresponding with frequency threshold
System, obtains the frequency threshold that this type of service is corresponding;
Determine unit, for according to this type of service corresponding call frequency and frequency threshold, determine that this intermediate layer services
Whether device has permission calling interface.
Wherein, the first acquiring unit includes:
Search subelement, for according to this type of service, right with timer from the type of service stored, call number
Call number and the timer of correspondence should be found out in being related to;
Computation subunit, for increasing the call number of lookup, according to the call number increased and the timer of lookup
Time Time Calculation go out this type of service corresponding call frequency.
Wherein it is determined that unit, specifically for judge this type of service corresponding call whether frequency exceedes this type of service
Corresponding frequency threshold, if not less than, it is determined that go out this middle tier server and have permission calling interface, if it does, the most true
Make this middle tier server and there is no authority calling interface.
Further, this equipment also includes:
Empty module, if there is timer expired in type of service, the call number corresponding relation with timer
Record, then empty the call number in this record, and make the timer of time-out in this record restart timing.
Further, call request also carries the mark of this middle tier server;
Correspondingly, determine that unit includes:
Judgment sub-unit, for judge this type of service corresponding call whether frequency exceedes the frequency that this type of service is corresponding
Rate threshold value, if it does, then determine that this middle tier server does not has authority calling interface;
Determine subelement, if for not less than, then according to the mark of this middle tier server obtain this intermediate layer service
What device was corresponding calls frequency and frequency threshold, according to this middle tier server corresponding call frequency and frequency threshold determines in this
Between stratum server whether have permission calling interface.
In embodiments of the present invention, Access Layer server obtains corresponding the calling of type of service that middle tier server sends
Frequency and frequency threshold, according to this type of service corresponding call frequency and middle tier server is called authority by frequency threshold
It is controlled, and the kind of type of service is less, so when having a large amount of foreground client to different middle tier server requests
During business, middle tier server can be called authority and be controlled, such that it is able to prevent the load of Access Layer server from becoming
Greatly, it is to avoid overload occurs.
Embodiment 5
As shown in Figure 6, the system of a kind of distribution interface of the embodiment of the present invention, including middle tier server 501 and Access Layer
Server 502;
Middle tier server 501, the user profile for sending according to foreground client determines the type of service of correspondence
And determine corresponding interface identifier according to the command word of foreground client transmission, and sending call request, this call request is taken
Type of service that band determines and interface identifier;
Access Layer server 502, for receiving the call request that middle tier server 501 sends, obtains this type of service
Correspondence calls frequency and frequency threshold, according to this type of service corresponding call frequency and frequency threshold determines middle tier server
Whether 501 have permission calling interface, if it is, distribute corresponding interface to middle tier server 501 according to this interface identifier.
In embodiments of the present invention, Access Layer server obtains corresponding the calling of type of service that middle tier server sends
Frequency and frequency threshold, according to this type of service corresponding call frequency and middle tier server is called authority by frequency threshold
It is controlled, and the kind of type of service is less, so when having a large amount of foreground client to different middle tier server requests
During business, middle tier server can be called authority and be controlled, such that it is able to prevent the load of Access Layer server from becoming
Greatly, it is to avoid overload occurs.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can pass through hardware
Completing, it is also possible to instruct relevant hardware by program and complete, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read only memory, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all spirit in the present invention and
Within principle, any modification, equivalent substitution and improvement etc. made, should be included within the scope of the present invention.
Claims (11)
1. the method for a distribution interface, it is characterised in that described method includes:
Receiving the call request that middle tier server sends, described call request at least carries interface identifier and type of service;
Obtain described type of service corresponding call frequency and frequency threshold, according to described type of service corresponding call frequency and
Frequency threshold determines whether described middle tier server has permission calling interface;
If it is, give described middle tier server according to the interface that the distribution of described interface identifier is corresponding;
If described call request also carries the mark of described middle tier server, the most described corresponding according to described type of service
Call frequency and frequency threshold determines whether described middle tier server has permission calling interface, including: judge described service class
What type was corresponding calls whether frequency exceedes the frequency threshold that described type of service is corresponding, if it does, then determine described centre
Stratum server does not has authority calling interface;If not less than, then obtain described centre according to the mark of described middle tier server
What stratum server was corresponding calls frequency and frequency threshold, according to described middle tier server corresponding call frequency and frequency threshold
Determine whether described middle tier server has permission calling interface.
2. the method for claim 1, it is characterised in that obtain described type of service corresponding call frequency and frequency threshold
Value, according to described type of service corresponding call frequency and frequency threshold determines whether described middle tier server has permission and calls
Interface, including:
Type of service, call number and the corresponding relation of timer according to described type of service and stored, obtains described industry
What service type was corresponding calls frequency;
The type of service according to described type of service and stored and the corresponding relation of frequency threshold, obtain described type of service pair
The frequency threshold answered;
According to described type of service corresponding call frequency and frequency threshold, determine whether described middle tier server has permission tune
Use interface.
3. method as claimed in claim 2, it is characterised in that the type of service that according to described type of service and stored, tune
With the corresponding relation of number of times Yu timer, obtain described type of service corresponding call frequency, including:
According to described type of service, it is right to find out from the type of service stored, call number and the corresponding relation of timer
The call number answered and timer;
Increase the call number of described lookup, go out according to Time Calculation when call number and the described timer of described increase
What described type of service was corresponding calls frequency.
4. method as claimed in claim 2, it is characterised in that according to described type of service corresponding call frequency and frequency threshold
Value, determines whether described middle tier server has permission calling interface, including:
Judge described type of service corresponding call whether frequency exceedes the frequency threshold that described type of service is corresponding, if do not surpassed
Cross, it is determined that go out described middle tier server and have permission calling interface, if it does, then determine that described middle tier server does not has
Have permission calling interface.
5. the method as described in claim 2-4 any one claim, it is characterised in that described method also includes:
If the corresponding relation of described type of service, call number and timer exists the record of timer expired, then empty
Call number in described record, and make the timer of time-out in described record restart timing.
6. the equipment of a distribution interface, it is characterised in that described equipment includes:
Receiver module, for receiving the call request that middle tier server sends, described call request at least carries interface identifier
And type of service;
Determine module, for obtain described type of service corresponding call frequency and frequency threshold, according to described type of service pair
Answer call frequency and frequency threshold determines whether described middle tier server has permission calling interface;
Distribution module, if being yes for the described result determining that module determines, then according to described interface identifier distribution correspondence
Interface gives described middle tier server;
If described call request also carries the mark of described middle tier server;Described determine that unit includes: judgment sub-unit,
For judge described type of service corresponding call whether frequency exceedes the frequency threshold that described type of service is corresponding, if super
Cross, it is determined that going out described middle tier server does not has authority calling interface;Determine subelement, if for not less than, then basis
Described middle tier server mark obtain described middle tier server corresponding call frequency and frequency threshold, in described
Between stratum server corresponding call frequency and frequency threshold determines whether described middle tier server has permission calling interface.
7. equipment as claimed in claim 6, it is characterised in that described determine that module includes:
First acquiring unit, right with timer for type of service, the call number according to described type of service and stored
Should be related to, obtain described type of service corresponding call frequency;
Second acquisition unit, for the type of service according to described type of service and stored and the corresponding relation of frequency threshold,
Obtain the frequency threshold that described type of service is corresponding;
Determine unit, for according to described type of service corresponding call frequency and frequency threshold, determine that described intermediate layer services
Whether device has permission calling interface.
8. equipment as claimed in claim 7, it is characterised in that described first acquiring unit includes:
Search subelement, for according to described type of service, corresponding with timer from the type of service stored, call number
Relation finds out call number and the timer of correspondence;
Computation subunit, for increasing the call number of described lookup, according to call number and the described timer of described increase
The Time Calculation of timing go out described type of service corresponding call frequency.
9. equipment as claimed in claim 7, it is characterised in that
Described determine unit, specifically for judge described type of service corresponding call whether frequency exceedes described type of service pair
The frequency threshold answered, if not less than, it is determined that go out described middle tier server and have permission calling interface, if it does, the most true
Make described middle tier server and there is no authority calling interface.
10. the equipment as described in claim 8-9 any one claim, it is characterised in that described equipment also includes:
Empty module, if there is timer expired in described type of service, the call number corresponding relation with timer
Record, then empty the call number in described record, and make the timer of time-out in described record restart timing.
The system of 11. 1 kinds of distribution interface, it is characterised in that described system includes middle tier server and Access Layer server;
Described middle tier server, for according to foreground client send user profile determine correspondence type of service and
The command word sent according to described foreground client determines the interface identifier of correspondence, sends call request, described call request
Carry described type of service and interface identifier;
Described Access Layer server, for receiving the call request that middle tier server sends, obtains described type of service corresponding
Call frequency and frequency threshold, according to described type of service corresponding call frequency and frequency threshold determines that described intermediate layer takes
Whether business device has permission calling interface, if it is, take to described intermediate layer according to the interface that the distribution of described interface identifier is corresponding
Business device;If the most described call request also carries the mark of described middle tier server, the most described according to described type of service
Corresponding call frequency and frequency threshold determines whether described middle tier server has permission calling interface, including: judge described
What type of service was corresponding calls whether frequency exceedes the frequency threshold that described type of service is corresponding, if it does, then determine institute
State middle tier server and there is no authority calling interface;If not less than, then obtain institute according to the mark of described middle tier server
State middle tier server corresponding call frequency and frequency threshold, according to described middle tier server corresponding call frequency and frequency
Rate threshold value determines whether described middle tier server has permission calling interface.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110187476.7A CN102868770B (en) | 2011-07-05 | 2011-07-05 | A kind of method of distribution interface, equipment and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110187476.7A CN102868770B (en) | 2011-07-05 | 2011-07-05 | A kind of method of distribution interface, equipment and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102868770A CN102868770A (en) | 2013-01-09 |
CN102868770B true CN102868770B (en) | 2016-12-28 |
Family
ID=47447356
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110187476.7A Active CN102868770B (en) | 2011-07-05 | 2011-07-05 | A kind of method of distribution interface, equipment and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102868770B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105099766B (en) * | 2015-06-29 | 2019-03-05 | 北京奇虎科技有限公司 | Prevent interface from excessively occupying the method and device of resource |
CN105893150B (en) * | 2016-03-31 | 2021-04-20 | 腾讯科技(深圳)有限公司 | Interface calling frequency control method and device and interface calling request processing method and device |
CN106550010A (en) * | 2016-09-21 | 2017-03-29 | 南京途牛科技有限公司 | A kind of real-time control distributed system calls external system to service the method and system of the frequency |
CN111142960B (en) * | 2018-11-02 | 2023-11-14 | 中国电信股份有限公司 | Interface providing method, device and system |
CN110505273B (en) * | 2019-07-12 | 2022-04-22 | 苏州浪潮智能科技有限公司 | Service capability limitation using method, device and readable medium |
CN111064677A (en) * | 2019-11-11 | 2020-04-24 | 福建天泉教育科技有限公司 | Flow control method based on back-end access quantity and storage medium |
CN113760398A (en) * | 2020-09-29 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Interface calling method, server, system and storage medium |
CN113434228A (en) * | 2021-06-21 | 2021-09-24 | 青岛海尔科技有限公司 | Page request method and device, storage medium and electronic device |
CN113742084A (en) * | 2021-09-13 | 2021-12-03 | 城云科技(中国)有限公司 | Method and apparatus for allocating computing resources based on interface characteristics |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6594667B2 (en) * | 1999-08-23 | 2003-07-15 | International Business Machines Corporation | Method, system and program products for modifying coupling facility structures |
CN1578212A (en) * | 2003-07-25 | 2005-02-09 | 富士全錄株式会社 | Illegal communication detector |
CN101068149A (en) * | 2007-06-04 | 2007-11-07 | 中国移动通信集团公司 | Method for raising business identification effect |
CN101848365A (en) * | 2009-03-24 | 2010-09-29 | 汤姆逊许可公司 | Methods for delivering and receiving interactive multimedia data attached to an audio video content |
-
2011
- 2011-07-05 CN CN201110187476.7A patent/CN102868770B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6594667B2 (en) * | 1999-08-23 | 2003-07-15 | International Business Machines Corporation | Method, system and program products for modifying coupling facility structures |
CN1578212A (en) * | 2003-07-25 | 2005-02-09 | 富士全錄株式会社 | Illegal communication detector |
CN101068149A (en) * | 2007-06-04 | 2007-11-07 | 中国移动通信集团公司 | Method for raising business identification effect |
CN101848365A (en) * | 2009-03-24 | 2010-09-29 | 汤姆逊许可公司 | Methods for delivering and receiving interactive multimedia data attached to an audio video content |
Also Published As
Publication number | Publication date |
---|---|
CN102868770A (en) | 2013-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102868770B (en) | A kind of method of distribution interface, equipment and system | |
CN109040259B (en) | CDN node distribution method and system based on MEC | |
CN106302434B (en) | Server adaptation method, device and system | |
CN102281190B (en) | Networking method for load balancing apparatus, server and client access method | |
US9444759B2 (en) | Service provider registration by a content broker | |
EP3629521B1 (en) | Rating method for service node, domain name system (dns) scheduling method and server | |
CN109151009B (en) | CDN node distribution method and system based on MEC | |
CN109005085B (en) | Service availability monitoring system, method, device and equipment | |
US20150110077A1 (en) | Method and apparatus for causing information related to mutual communication property between a terminal and access points of a wireless network to be used in connecting to the wireless network | |
CN104219069B (en) | access frequency control method, device and control system | |
CN104243609B (en) | A kind of information service method for pushing and device | |
CN101459836B (en) | Service processing method and system for content distributing network of interactive network television | |
CN109246078B (en) | Data interaction method and server | |
CN112825527A (en) | Service node distribution method and device based on MEC and related server | |
CN110417595B (en) | Business service disaster tolerance method, device, system, management server and electronic equipment | |
CN113242297B (en) | Service system and service state adjusting method | |
CN112491719A (en) | Network node selection method, equipment and storage medium | |
JP3487425B2 (en) | Congestion control method and method | |
JP2020502957A (en) | Online charging mechanism while OCS is non-responsive | |
CN110855424B (en) | Method and device for synthesizing asymmetric flow xDR in DPI field | |
US20150149629A1 (en) | User online state querying method and apparatus | |
US9374710B2 (en) | Mediation server, control method therefor, communication device, control method therefor, communication system, and computer program | |
CN102970391B (en) | Inquiry of the domain name processing method, server and system | |
CN106792895B (en) | method and equipment for determining size of data packet | |
CN108353352B (en) | Network element selection method and network element selector |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |