The request amount control method of a kind of Internet resources and device
Technical field
Embodiments of the present invention relate to network access technology field, more specifically, embodiments of the present invention relate to one
Plant request amount control method and the device of Internet resources.
Background technology
This part is it is intended that the embodiments of the present invention stated in claims provide background or context.Herein
Describe not because being included in this part just recognize it is prior art.
Server cluster technology refers to get up a lot of server centered carry out same service together, in client
It it similarly is only one of which server.Cluster can utilize multiple computer to carry out parallel computation thus obtain the highest calculating speed
Degree, it is also possible to backup with multiple computers, so that any one computer glitch whole system can also be properly functioning.
Owing to server cluster technology has incomparable advantage, therefore, server compared to individual server in Business Processing
Clustering is used for providing Business Processing service by increasing main stream website particularly e-commerce website.
At present, most of Website servers when facing a large number of users and concurrently accessing, by the access of user is accessed into
The method of row flow restriction avoids the too high problems such as machine of delaying that may cause of server load.Existing flow access control scheme
It is typically to arrange stream control threshold value by the experience of configuration personnel, but if stream control threshold value arranges too low, then has the wasting of resources;
If stream control threshold value arranges too high, when user's flowing of access is uprushed, it is too high that background server there will be system load, time serious
Server even can be caused to delay machine, bring impact to user.Such as, in e-commerce website, certain hot product is being entered by user
When the row second kills activity, if user accesses the access amount stream control threshold value beyond server, then will be considered that server load is higher,
Refuse user's request.
Summary of the invention
In the existing technical scheme carrying out stream control for individual server, stream control threshold value can be stored in needs and carry out
It is local that flow accesses the service server controlled, and service server is in local business processing logic, according to the stream control stored
Threshold value conducts interviews flow-control, and for service server cluster, it is generally made up of multiple service servers, cluster
In a certain server traffic exceed stream control threshold value, whole server cluster load too high can not be described, if therefore refused
User absolutely accesses, then can reduce the service quality of server cluster, affect Consumer's Experience, and therefore, existing stream prosecutor case cannot
It is applicable to the stream control of server cluster;Additionally, according to existing stream control implementation, it is by going to sentence in business processing logic
Whether disconnected current accessed exceedes stream control threshold value, if it exceeds then refusal business processing logic performs, needs to revise Business Processing and patrols
Volume, this implementation is bigger to business processing logic invasive.Therefore, the feelings of Business Processing are carried out for server cluster
Condition, inventor finds, stream control threshold value and flow control logic can be stored in other independent of service server cluster
Individual stream control server on, this stream control server be used for complete flow control function for service server cluster, thus can gram
Take existing carrying out for individual server and flow the problem produced when the technical scheme controlled is applied to server cluster flow-control;
But, technological invention people finds in project development, takes above-mentioned processing mode, can face again problem, i.e. a business service
Device cluster is after having processed service request, and the resource need notification streams its service request of control server to be disposed, taking is
Release, and in network communications, may there are some reasons causes announcement information to transmit unsuccessfully, so ties up at stream control server
The resource occupation information protected may be inaccurate, thereby results in flow-control series of problems such as inaccurate grade, impact for service
The flow control function of device cluster, also can affect the service quality of server cluster.
To this end, be highly desirable to the request amount control method of the Internet resources of a kind of improvement, to provide for server cluster
Flow accesses and controls, it is ensured that the service quality of server cluster.
In the present context, embodiments of the present invention expectation provides request amount control method and the dress of a kind of Internet resources
Put.
In the first aspect of embodiment of the present invention, it is provided that the request amount control method of a kind of Internet resources, for can
Internet resources the first numerical parameter and second value parameter, described first numerical parameter and described second value parameter are set
Initial value according to preset stream control threshold value determine;And
Described method, including:
Receive network resource request;
To currently answering the operation that subtracts 1 of operand value parameter, wherein, described currently answer operand value parameter according to preset
The resource switch cycle determine, described currently answer the operand value parameter to include described first numerical parameter and/or described
Two numerical parameters;
Obtain Internet resources so that described net resource request to be processed.
In the second aspect of embodiment of the present invention, it is provided that the request amount control device of a kind of Internet resources, including:
Dispensing unit, for arranging the first numerical parameter and second value parameter for available Internet resources, described first
The initial value of numerical parameter and described second value parameter determines according to the stream control threshold value preset;
Receive unit, be used for receiving network resource request;
Operating unit, for currently answering the operation that subtracts 1 of operand value parameter, wherein, described currently answers operand value
The resource switch cycle preset according to parameter is determined, described currently answers operand value parameter to include described first numerical value ginseng
Several and/or described second value parameter;
Acquiring unit, is used for obtaining Internet resources to process described net resource request.
In the third aspect of embodiment of the present invention, it is provided that the request amount control method of a kind of Internet resources, such as,
Can include memorizer and processor, wherein, processor may be used for reading the program in memorizer, performs following process: connect
Receive network resource request;To currently answering the operation that subtracts 1 of operand value parameter, wherein, described the operand value parameter is currently answered to be
Determine according to the default resource switch cycle, described currently answer operand value parameter include described first numerical parameter and/
Or described second value parameter;Obtain Internet resources so that described net resource request to be processed.
In the fourth aspect of embodiment of the present invention, it is provided that a kind of program product, it includes program code, when described
When program product runs, described program code is used for performing procedure below: receive network resource request;To currently answering operand value
Operation that parameter carries out subtracting 1, wherein, described currently answers the resource switch cycle preset according to operand value parameter to determine,
Described operand value parameter is currently answered to include described first numerical parameter and/or described second value parameter;Obtain Internet resources
So that described net resource request is processed.
The request amount control method of the Internet resources according to embodiment of the present invention and device, by filling in special stream control
It is set to server cluster and carries out flow-control, and two numerical parameters are set for available Internet resources, and according to default
Two numerical parameters are operated by the resource switch cycle in turn, solve in the flow control process of server cluster,
The resource caused due to HP M etc. gives back the problem that failure makes actual available network resource reduce, and improves service
The service quality of device cluster, brings preferably experience for user.
Accompanying drawing explanation
By reading detailed description below, above-mentioned and other mesh of exemplary embodiment of the invention with reference to accompanying drawing
, feature and advantage will become prone to understand.In the accompanying drawings, if showing the present invention's by way of example, and not by way of limitation
Dry embodiment, wherein:
Fig. 1 schematically shows the application scenarios schematic diagram according to embodiment of the present invention;
Fig. 2 schematically shows the request amount control method implementing procedure of the Internet resources according to embodiment of the present invention
Schematic diagram;
Fig. 3 schematically shows the resource switch cycle schematic diagram according to embodiment of the present invention;
Fig. 4 schematically shows the request amount control apparatus structure of Internet resources according to another embodiment of the present invention and shows
It is intended to;
Fig. 5 schematically shows the request amount control apparatus structure of the Internet resources according to further embodiment of this invention and shows
It is intended to;
Fig. 6 schematically shows the program product that the request amount of Internet resources according to yet another embodiment of the invention very controls
Product schematic diagram;
In the accompanying drawings, identical or corresponding label represents identical or corresponding part.
Detailed description of the invention
Principle and the spirit of the present invention are described below with reference to some illustrative embodiments.Should be appreciated that and provide this
A little embodiments are only used to make those skilled in the art better understood when and then realize the present invention, and not with any
Mode limits the scope of the present invention.On the contrary, it is provided that these embodiments are to make the disclosure more thorough and complete, and energy
Enough the scope of the present disclosure is intactly conveyed to those skilled in the art.
One skilled in the art will appreciate that embodiments of the present invention can be implemented as a kind of system, device, equipment, method
Or computer program.Therefore, the disclosure can be to be implemented as following form, it may be assumed that hardware, completely software completely
(including firmware, resident software, microcode etc.), or the form that hardware and software combines.
According to the embodiment of the present invention, it is proposed that the method and apparatus that the visit capacity of a kind of Internet resources controls.
In this article, it is to be understood that in involved term:
Stream control: system visit capacity controls, it is to avoid the system low-response caused owing to instantaneous delivery is excessive, the problems such as machine of delaying.
Stream control threshold value: system visit capacity higher limit, the access after exceeding this value can be rejected.
Unit stream control: for the flow-control of single server, after single server flowing of access exceedes threshold value, after
Continuous access can be rejected.
Cluster stream control: for the flow-control of certain server cluster, when whole server cluster flowing of access exceedes threshold
After value, follow-up access can be rejected.
Dynamically flow control: stream control threshold value can adjust the most in real time.
Resource pool: a kind of abstract concept, it is assumed that the threshold value for a certain class request stream control top limit is 100, then
Can by its abstract be a resource pool having 100 resources, a request starts first to obtain a resource from resource pool, please
Ask end to give back 1 resource again, if inadequate resource, refuse request.
Resource is lost: in resource pool, total resources is then referred to as resource loss (for example, it is assumed that one opens less than initial resource value
Begin have 100 resources, requested 1, also remain 99, requested 1 after request terminates, this 1 money should be given back
Source, but because network failure reason, give back signal and arrive background server side the most smoothly, then background server side will be considered that currently
Available resources are to have 99, less than initial set value 100, are now resource loss).
Resource exceeds the quata: in resource pool total resources more than initial resource value then be referred to as resource exceed the quata (by compensation mechanism,
When there is resource loss, the quantity of resource is reset to top limit threshold value.And likely the loss of this resource is not due to
Network failure reason causes, but truly have request also use resource, also there is no returned resource, by the quantity weight of resource
After being set to top limit threshold value, if this request returned resource, then the total resources in resource pool may be more than initial money
Source value, at this moment exceeds the quata for resource).
Additionally, any number of elements in accompanying drawing is used to example and unrestricted, and any name is only used for distinguishing,
And not there is any limitation.
Principle and spirit below with reference to some representative embodiments of the present invention, in detail the explaination present invention.
Summary of the invention
The inventors discovered that, the existing stream prosecutor case for single service server, fluid logic and service logic are equal
Being performed by service server, service server needs to carry out flow-control in business procession, and this stream prosecutor formula is to industry
Business logic invasive is relatively big, and if service logic is separated with fluid logic, service server is released having processed service request
After putting the Internet resources taken, need to give back Internet resources to stream control server so that stream controls server amendment resource occupying
Situation, but in actual application, inevitably there is situations below: owing to the reasons such as network communication failure cause the information of giving back
Transmitting unsuccessfully, so, the network resource conditions of stream control server storage does not conforms to the actual conditions so that actual available Internet resources subtract
Few, reduce the service quality of service server.
In order to solve the problems referred to above, in the present invention, business processing logic is separated with fluid logic, special stream control is set
Server carries out flow-control to service server cluster, and the arbitrary service server in service server cluster is receiving industry
After business request, to stream control server request Internet resources to carry out Business Processing, and after Business Processing completes, to stream control service
Internet resources given back by device, according to the situation of service server request resource or returned resource, stream control server safeguards that self stores
Resource occupation information, in order to avoid the resource caused due to the communication failure between service server and stream control server gives back mistake
Lose so that the inaccurate situation of resource occupation information of stream control server maintenance, in the embodiment of the present invention, for available network money
Source arranges two numerical parameters, operates two numerical parameters in turn according to the default resource switch cycle, so, right
When one numerical parameter operates, another numerical parameter can be verified, if it is determined that occur resource loss then to enter
Row supplements, to ensure available resources quantity;If it occur that resource exceeds the quata, revert to initial value, to avoid access amount to exceed
Stream control threshold value, causes system load too high.
After the ultimate principle describing the present invention, introduce the various non-limiting embodiment party of the present invention in detail below
Formula.
Application scenarios overview
With reference first to Fig. 1, the application scenarios of the request amount control method of its Internet resources provided for the embodiment of the present invention
Schematic diagram.Stream control server 11 performs fluid logic, and service server cluster 12 performs business processing logic.Stream control server root
According to the stream control threshold value being pre-configured with, the flowing of access of service server is controlled, in the embodiment of the present invention, a stream control threshold
Corresponding two numerical parameters of value, the respectively first numerical parameter and second value parameter, wherein, the first numerical parameter and the second number
The initial value of value parameter can determine according to stream control threshold value, and such as, the initial value of the first numerical parameter and second value parameter can
With identical with stream control threshold value, if i.e. stream control threshold value is 100, then the initial value of the first numerical parameter and second value parameter is also
100。
Stream control server 11 determines the numerical parameter that currently should operate, service server according to default resource switch algorithm
Arbitrary service server in cluster 12, when receiving Business Processing request, asks Internet resources with right to stream control server 11
Service request processes.Stream control server 11 receive Service Process Server send Internet resources obtain request after,
To currently answering operand value parameter to subtract 1, net resource request is processed obtaining Internet resources.
Illustrative methods
Below in conjunction with the application scenarios of Fig. 1, referring to figs. 2 and 3 describing the net according to exemplary embodiment of the invention
The method that the request amount of network resource controls.It should be noted that above-mentioned application scenarios is for only for ease of the essence understanding the present invention
God and principle and illustrate, embodiments of the present invention are the most unrestricted.On the contrary, embodiments of the present invention are permissible
It is applied to any scene being suitable for.
As indicated with 2, the implementing procedure signal of the request amount control method of its Internet resources provided for the embodiment of the present invention
Figure, may include that
S21, reception network resource request.
S22, to currently answering the operation that subtracts 1 of operand value parameter.
Wherein, described currently answer the resource switch cycle preset according to operand value parameter to determine, described currently
Operand value parameter is answered to include described first numerical parameter and/or described second value parameter.
S23, acquisition Internet resources are to process the net resource request received.
Any server in service server cluster 12 is after receiving Business Processing request, to stream control server 11
SCN Space Cable Network resource acquisition request is to process Business Processing request, and stream control server 11 is receiving network resource request
After, to currently answering the operating parameter operation that subtracts 1.Wherein, the Internet resources switching week preset according to currently answering operating parameter
Phase is determined.
It should be noted that above-mentioned steps S22 and step S23 do not have certain priority execution sequence, step S22 can be with
Step S23 performs simultaneously, it is also possible to when currently answering operand value parameter to be not 0, first carry out step S23, is performing step
S22, these are all the embodiments of equivalent, and this is not defined by the embodiment of the present invention.
When being embodied as, currently answer operating parameter can be receive net resource request after determine in real time, it is also possible to
For predefine out, introduce it individually below:
First kind of way, determine the numerical parameter that currently should operate in real time
Internet resources switching cycle includes that very first time interval and the second time interval, stream control server are receiving network
After resource request, according to current time or receive network resource request time belonging to time interval, currently should determine
The numerical parameter of operation.
When being embodied as, if current time or receive time of network resource request to belong to the very first time interval,
Then determine that currently answering operand value parameter is the first numerical parameter, if the time receiving network resource request belongs to second
Between interval, it is determined that currently answering operand value parameter is second value parameter.
Assume that the resource switch cycle preset is the 2M use of each numerical parameter (time a length of M), as it is shown on figure 3, it is
The first resource switch schematic diagram, transverse axis is timeline, it is assumed that current time or receive time of network resource request and be
T1, use T1Mould 2M, then can be according to determining current time with method or receiving the time T of network resource request1The affiliated time
Interval: t1=T1Mod2M, if t1∈ [0, M), it is determined that current time or receive time of network resource request and belong to
The very first time is interval;If t1∈ [M, 2M), it is determined that current time or receive time of network resource request and belong to
Two time intervals.
If it is determined that current time or receive time of network resource request to belong to the very first time interval, then to first
Operation that numerical parameter carries out subtracting 1, if it is determined that current time or receive time of network resource request and belonged to for the second time
Interval, then the operation that second value parameter subtracted 1.It should be noted that to the first numerical parameter and second value parameter from
Initial value proceeds by the operation that subtracts 1, it is assumed that current time interval is that the very first time is interval, and the first numerical parameter initial value is 100,
Then first request operation that subtracts 1 to the initial value of the first numerical parameter, the first numerical parameter currency becomes 99, second
The request operation that subtracts 1 to the first numerical value (if before first ask not yet returned resource), then the second request is to the first number
After operation that value carries out subtracting 1, the first numerical parameter currency becomes 98, by that analogy;If there being request returned resource, then first
Numerical parameter carries out adding 1 operation from currency.If the value of the first numerical parameter is 0 when receiving network resource request, then say
Bright now without available network resource, by this network resource request of refusal.
In the embodiment of the present invention, the reason of two numerical parameters is used to be, if simply using a numerical parameter, because of
For can ceaselessly there be acquisition request resource, take resource;So will be unable to judge when resource loss or resource
Exceed the quata, if resource exceeds the quata the resource causing the actual releasing of system to exceed stream control threshold value, in that way it is possible to cause system load
Height, is also possible to cause server to delay machine time serious.If resource loss will cause the actual available resource of system less than stream control
Threshold value, causes the wasting of resources, reduces resource utilization.And use two numerical parameters, then can use the two numerical value in turn
Parameter, such as, first uses the first numerical parameter, after some cycles, re-uses second value parameter, is using second value parameter
Period, using the continuous returned resource of request of the first numerical parameter, after certain time, the resource of these acquisition request is big before
The complete restitution of probability is complete, at this point it is possible to verify the first numerical parameter, if the numerical value of the first numerical parameter is more than
Initial value, it is determined that occur resource to exceed the quata.If the numerical value of the first numerical parameter is less than initial value, it is determined that occur resource to lose
Damage.After determining that generation resource loss or resource exceed the quata, the first numerical parameter is reverted to initial value.Equally, first is being used
During numerical parameter, second value parameter can be verified.Due to the first numerical parameter or second value parameter
When verifying, need using second value parameter or carrying out after the first numerical parameter certain time (to ensure using
Obtain resource during first numerical parameter or second value parameter asks the giving back of big probability complete), therefore, the present invention is real
Execute example and resource recovery buffering interval, the duration in resource recovery buffering interval are set in very first time interval and the second time-switching
Can preset based on experience value.
Based on this, the request amount control method of Internet resources that the embodiment of the present invention provides, it is also possible to comprise the following steps:
In current time interval, operand value parameter is answered to carry out school a upper time interval according to default resource recovery buffering duration
Test;If determining that the value that a upper time interval answers operand value parameter is different from initial value according to check results, then recover upper one
Time interval answers the value of operand value parameter to be initial value.
As it is shown on figure 3, in the time interval using the first numerical parameter, to second value parameter after certain time
Recover, in the time interval using second value parameter, after certain time, the first numerical parameter is recovered.
Assume that current time is T2, a length of Q during the resource recovery buffering preset, according to embodiments of the present invention, the most interval in current time
In, operand value parameter can be answered to verify a upper time interval in accordance with the following methods: t2=T2Mod2M, if t2∈
[Q, M), then second value parameter is verified;If t2∈ [M+Q, 2M), then the first numerical parameter is verified.
When being embodied as, after utilizing the Internet resources obtained that network resource request process is terminated, concrete, Ke Yi
Receive that the service server of request Internet resources sends give back signal after determine and network resource request process terminated, to place
The numerical parameter of the operation that carries out subtracting 1 when managing this network resource request carries out adding 1 operation, to give back Internet resources.
Above-mentioned first numerical parameter and second value parameter are not provided with overlapping use interval, in resource switch moment, and can
Can occur that component requests uses the first numerical parameter, component requests uses second value parameter, so, will appear from the network of request
The problem that resource exceedes stream control threshold value.For example, it is assumed that stream control threshold value is 100, the first numerical parameter initial value is 100, the second number
Value parameter initial value is also 100.Receiving for use the first numerical parameter, i.e. stream control server in assuming current time interval
After network resource request, the first numerical parameter is subtracted 1 operation, after use, the first numerical parameter is added 1 operation.
If when receiving network resource request, according to current time or receive time of request the first numerical parameter is carried out
The operation that subtracts 1, now system can surplus resources be 99, but according to resource switch before giving back the Internet resources of acquisition
Cycle switches to operate second value parameter, so, will join second value when hereafter receiving network resource request
Operation that number carries out subtracting 1, and the initial value of second value parameter is 100, i.e. when receiving network resource request to second value
Parameter proceeds by the operation that subtracts 1 from initial value 100, if network is given back in the request in the operation that subtracts 1 to the first numerical parameter
Before resource, second value parameter receives 100 requests (assuming all not give back), the most now, the network of the actual releasing of system
Resource has 101, has i.e. exceeded stream control threshold value, so, has caused system load too high, be also possible to cause server to delay time serious
Machine.
Optimize further, in order to solve this problem, the request amount controlling party of the Internet resources that the embodiment of the present invention provides
In method, additionally provide the embodiment optimized further below: the default resource switch cycle also includes that resource is interval for overlapping time,
In resource interval overlapping time, use the first numerical parameter and second value parameter, to reach Item Smoothing switching simultaneously
Purpose.When i.e. receiving network resource request in resource interval overlapping time, respectively to the first numerical parameter and second value
Operation that parameter carries out subtracting 1, accordingly, when giving back Internet resources, needs respectively to the first numerical parameter and second value parameter
Carry out adding 1 operation.
During it is also preferred that the left be embodied as, according to current time or time of receiving network resource request, can according to
Lower method determines current time or the time interval belonging to time receiving network resource request: t3=T1Mod2M, ifThen determine that the time receiving network resource request belongs to very first time interval;IfThen determine that the time receiving network resource request belongs to resource interval overlapping time;IfThen determine that the time receiving network resource request belongs to the second time interval, wherein, T1For time current
Between or receive time of network resource request, 2M is the default resource switch cycle, and P is default resource district's overlapping time
Between duration.If current time or receive time of network resource request to belong to resource interval for overlapping time, it is determined that when
Before to answer operand value parameter be the first numerical parameter and second value parameter.In resource interval overlapping time, receive network
During resource request, before the operation that respectively the first numerical parameter and second value parameter subtracted 1, it is judged that the first numerical parameter or
The value of two numerical parameters, as long as one of them value is 0, then refuses this network resource request, so can ensure that available network provides
The logical judgment of source quantity exceedes stream control threshold value, causes the problem that resource occupation is excessive.It addition, resource length of an interval overlapping time
Degree can determine according to statistical result or empirical value, as long as ensure that in resource interval overlapping time, at this resource weight
The Internet resources being issued in time interval before folded time interval, an only numerical parameter is subtracted 1 operation, probably
Rate is by complete restitution.So can ensure that at the end of this resource interval overlapping time, the first numerical parameter and the second number
The value of value parameter equal or very close to, so next just can enter the time of the operation that only a numerical parameter subtracted 1
Interval.
If it is interval for overlapping time to arrange resource, then when being embodied as, can be in accordance with the following methods to the first numerical parameter
Or second value parameter verifies: t4=T2Mod2M, ifThen described second value parameter is entered
Row verification;IfThen verifying described first numerical parameter, wherein, Q is default resource
Recover buffering duration, T2For current time.
The second way, predetermined currently answer operating parameter.
Under this embodiment, stream control server 11 predefines according to the default resource switch cycle and currently answers operand
Value parameter is currently answered operand value parameter list and is stored, when stream control server receives network resource request, according to
Storage currently answer operand value parameter list to determine currently to answer operand value parameter.
Same as a example by Fig. 3, it is assumed that the resource switch cycle preset is 2M, then it is T for the time, stream control server 12 can
In order to determining the time interval belonging to current time: t by below equation1=Tmod2M, if t1∈ [0, M), it is determined that time T
Belong to the very first time interval;If t1∈ [M, 2M), it is determined that time T belongs to the second time interval.
If it is interval for overlapping time to be provided with resource in the resource switch cycle preset, it is assumed that P is that default resource is overlapping
Time interval duration, then stream control server can determine the time interval belonging to time T: t according to below equation2=Tmod2M,
IfThen determine that time T belongs to the very first time interval;IfThen determine the time
It is interval for overlapping time that T belongs to resource;IfThen determine that time T belongs to the second time interval.
In very first time interval, stream control server determines currently to answer and includes the first numerical value in operand value parameter list
Parameter, in the second time interval, stream control server determine currently answer operand value parameter list includes second value ginseng
Number, in resource interval overlapping time, stream control server determines currently answers in operand value parameter list containing the first numerical value ginseng
Number and second value parameter.Under this embodiment, stream control server also needs to according to the resource switch cycle preset the
One numerical parameter and second value parameter verify.Due to concrete verification mode and a pair first numerical value of above-mentioned embodiment
The embodiment that parameter carries out verifying with second value parameter is identical, repeats no more here.
The present invention implements the request amount control method of the Internet resources provided, by arranging special stream control server by industry
Business processes logic and separates with fluid logic, and arranges two numerical parameters by available network resource, cuts according to default resource
Two numerical parameters are operated by the cycle of changing in turn, when one of them numerical parameter is operated, and can be to another
Parameter verifies, it is to avoid the system load that may cause owing to cannot verify available resources is too high or system
The problem that resource utilization reduces, improves server service quality.
Example devices
After the method describing exemplary embodiment of the invention, it follows that with reference to Fig. 4 reality exemplary to the present invention
Execute mode, Internet resources request amount control device.
As shown in Figure 4, the request amount of its Internet resources provided for the embodiment of the present invention controls apparatus structure schematic diagram, can
To include:
Dispensing unit 41, for arranging the first numerical parameter and second value parameter for available Internet resources pond, described
The initial value of the first numerical parameter and described second value parameter determines according to the stream control threshold value preset;
Receive unit 42, be used for receiving network resource request;
Operating unit 43, for currently answering the operation that subtracts 1 of operand value parameter, wherein, described currently answers operand
The resource switch cycle preset according to value parameter is determined, described currently answers the operand value parameter to include described first numerical value
Parameter and/or described second value parameter.
Acquiring unit 44, is used for obtaining Internet resources to process described net resource request.
Wherein, the resource switch cycle includes very first time interval and the second time interval.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides, it is also possible to including:
First determines unit 45, for determining the time interval belonging to the time receiving network resource request;
Second determines unit 46, if belonging to interval of the described very first time for receiving the time of network resource request,
Then determine that currently answering operand value parameter is described first numerical parameter;If the time receiving network resource request belongs to institute
State the second time interval, it is determined that currently answering operand value parameter is described second value parameter.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides, it is also possible to including:
Obtain unit 47, for before described reception unit 42 receives network resource request, it is thus achieved that currently answer operand
Value parameter list, described currently answering comprises described first numerical parameter and/or second value parameter in operand value parameter list;
3rd determines unit 48, for determining that first numerical value comprised in operand value parameter list of currently answering of acquisition is joined
Number and/or second value parameter are for currently answering operand value parameter.
It is preferred that operating unit 43, if specifically for currently answering operand value parameter to include described first numerical parameter
With described second value parameter, the operation that the most described first numerical parameter and described second value parameter subtracted 1.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides, it is also possible to including:
Response unit 49, if being 0 for the described value currently answering operand value parameter, then refusing described Internet resources please
Ask.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides,
Described operating unit 43, is additionally operable to utilizing the Internet resources obtained to terminate described network resource request process
After, the numerical parameter of the operation that subtracts 1 when processing this network resource request is added 1 operation.
Wherein, described operating unit 43, if the numerical value of the operation that carries out subtracting 1 during specifically for processing this network resource request
Parameter includes described first numerical parameter and described second value parameter, the most respectively to described first numerical parameter and described second
Numerical parameter carries out adding 1 operation.
When being embodied as, first determines unit 45, specifically for determining current time in accordance with the following methods or receiving net
Time interval belonging to the time of network resource request: t1=T1Mod2M, if t1∈ [0, M), it is determined that current time or reception
It is interval that time to network resource request belongs to the very first time;If t1∈ [M, 2M), it is determined that current time or receive net
The time of network resource request belongs to the second time interval, wherein, T1For current time or receive network resource request time
Between, 2M is the default resource switch cycle.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides, it is also possible to including:
First verification unit 410, in current time interval, according to default resource recovery buffering duration to upper one
Time interval answers operand value parameter to verify;And
Recovery unit 411, if for according to check results determine a upper time interval answer operand value parameter value and
Described initial value is different, then the upper time interval of recovery answers the value of operand value parameter to be described initial value.
Wherein, the first verification unit 410, specifically in current time interval, in accordance with the following methods to the upper time
Interval answers operand value parameter to verify: t2=T2Mod2M, if t2∈ [Q, M), then described second value parameter is carried out
Verification;If t2∈ [M+Q, 2M), then described first numerical parameter is verified, wherein, Q is default resource recovery buffering
Duration, T2For current time.
It is preferred that the described default resource switch cycle also includes that resource is interval for overlapping time;And
Described first determines unit 45, specifically for determine in accordance with the following methods current time or receive Internet resources please
The time interval belonging to time asked: t3=T1Mod2M, ifThen determine current time or receive net
It is interval that the time of network resource request belongs to the very first time;IfThen determine current time or receive
It is interval for overlapping time that the time of network resource request belongs to resource;IfThen determine current time or connect
The time receiving network resource request belongs to the second time interval, wherein, T1For current time or receive Internet resources please
The time asked, 2M is the default resource switch cycle, and P is default resource interval overlapping time duration.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides, it is also possible to including:
4th determines unit 412, if belonging to resource interval overlapping time for receiving the time of network resource request,
Then determine that currently answering operand value parameter is described first numerical parameter and described second value parameter.
Alternatively, the request amount control device of the Internet resources that the embodiment of the present invention provides, it is also possible to including: the second verification
Unit 413, for verifying the first numerical parameter or second value parameter in accordance with the following methods: t4=T2Mod2M, as
ReallyThen described second value parameter is verified;IfThen to described
One numerical parameter verifies, and wherein, Q is default resource recovery buffering duration, T2For current time.
After the method and apparatus describing exemplary embodiment of the invention, it follows that introduce according to the present invention's
The request amount control device of the Internet resources of another exemplary embodiment.
Person of ordinary skill in the field it is understood that various aspects of the invention can be implemented as system, method or
Program product.Therefore, various aspects of the invention can be to be implemented as following form, it may be assumed that hardware embodiment, complete completely
Full Software Implementation (including firmware, microcode etc.), or the embodiment that hardware and software aspect combines, can unite here
It is referred to as " circuit ", " module " or " system ".
In the embodiment that some are possible, the request amount control device of the network according to the invention resource can include to
A few processing unit and at least one memory element.Wherein, described memory element has program stored therein code, when described journey
When sequence code is performed by described processing unit so that described processing unit performs in this specification above-mentioned " illustrative methods " part
Various steps in the request amount control method of the Internet resources according to the various illustrative embodiments of the present invention described.Example
As, described processing unit can perform step S21 as shown in Figure 2, receives network resource request, and step S22, to currently should
Operation that operand value parameter carries out subtracting 1, wherein, described currently answers the resource switch cycle preset according to operand value parameter true
Make, described currently answer operand value parameter to include described first numerical parameter and/or described second value parameter;And step
Rapid S23, obtains Internet resources to process described net resource request.
The request amount control device of the Internet resources according to the embodiment of the invention is described referring to Fig. 5
50.The request amount control device of the Internet resources that Fig. 5 shows is only an example, not should to the function of the embodiment of the present invention and
Range brings any restriction.
As it is shown in figure 5, the request amount control device 50 of Internet resources can show with the form of universal computing device, such as
It can be server apparatus.Internet resources request amount control device 50 assembly can include but not limited to: above-mentioned at least
One processing unit 51, at least one memory element 52 above-mentioned, connection different system assembly (include memory element 52 and process single
First 51) bus 53.
Bus 53 represents one or more in a few class bus structures, including memory bus or Memory Controller,
Peripheral bus, processor or use any bus-structured local bus in multiple bus structures.
Memory element 52 can include the computer-readable recording medium of form of volatile memory, such as random access memory (RAM)
521 and/or cache memory 522, it is also possible to farther include read only memory (ROM) 523.
Memory element 52 can also include the program/utility 525 with one group of (at least one) program module 524,
Such program module 524 includes but not limited to: operating system, one or more application program, other program module and
Routine data, potentially includes the realization of network environment in each or certain combination in these examples.
The request amount control device 50 of Internet resources can also be with one or more external equipment 54 (such as keyboards, sensing
Equipment etc.) communication, also can enable a user to mutual with the request amount control device 50 of these Internet resources with one or more
Equipment communicates, and/or can enter with other calculating equipment one or more with the request amount control device 50 making these Internet resources
Any equipment (such as router, modem etc.) communication of row communication.This communication can pass through input/output (I/
O) interface 55 is carried out.Further, the request amount control device 50 of Internet resources can also by network adapter 56 and one or
Multiple networks (such as LAN (LAN), wide area network (WAN) and/or public network, such as the Internet) communicate.As it can be seen, net
Network adapter 56 is communicated by other module of bus 53 with the request amount control device 50 of Internet resources.Although it should be understood that
Not shown in figure, other hardware and/or software module can be used in conjunction with the request amount control device 50 of Internet resources, including but
Be not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive with
And data backup storage system etc..
Exemplary process product
In the embodiment that some are possible, various aspects of the invention are also implemented as the shape of a kind of program product
Formula, it includes program code, and when described program product runs on server apparatus, described program code is used for making described clothes
Business device equipment perform described in this specification above-mentioned " illustrative methods " part according to the various illustrative embodiments of the present invention
Method in step, such as, described server apparatus can perform step S21 as shown in Figure 2, receive Internet resources please
Ask, and step S22, to currently answering the operation that subtracts 1 of operand value parameter, wherein, described currently to answer operand value parameter be root
Determine according to the default resource switch cycle, described currently answer operand value parameter include described first numerical parameter and/or
Described second value parameter;And step S23, acquisition Internet resources are to process described net resource request.
Described program product can use the combination in any of one or more computer-readable recording medium.Computer-readable recording medium can be readable letter
Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing such as can be but not limited to electricity, magnetic, optical, electromagnetic, red
Outside line or the system of quasiconductor, device or device, or above combination.The more specifically example of readable storage medium storing program for executing
(non exhaustive list) including: has the electrical connection of one or more wire, portable disc, hard disk, random access memory
(RAM), read only memory (ROM), erasable type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc are only
Read memorizer (CD-ROM), light storage device, magnetic memory device or the combination of above-mentioned any appropriate.
As shown in Figure 6, the program that the request for Internet resources according to the embodiment of the present invention that describes controls is produced
Product 60, it can use portable compact disc read only memory (CD-ROM) and include program code, it is possible to set at server
Standby upper operation.But, the program product of the present invention is not limited to this, and in this document, readable storage medium storing program for executing can be any comprising
Or the tangible medium of storage program, this program can be commanded execution system, device or device use or in connection makes
With.
The data signal that readable signal medium can include in a base band or propagate as a carrier wave part, wherein carries
Readable program code.The data signal of this propagation can take various forms, and includes but not limited to that electromagnetism is believed
Number, optical signal or the combination of above-mentioned any appropriate.Readable signal medium can also is that beyond readable storage medium storing program for executing any can
Read medium, this computer-readable recording medium can send, propagate or transmit for being used by instruction execution system, device or device or
Program in connection.
The program code comprised on computer-readable recording medium can include but not limited to any suitable medium transmission
Wireless, wired, optical cable, RF etc., or the combination of above-mentioned any appropriate.
The program for performing present invention operation can be write with the combination in any of one or more programming languages
Code, described programming language includes object oriented program language such as Java, C++ etc., also includes routine
Process type programming language such as " C " language or similar programming language.Program code can be fully user
Perform on calculating equipment, perform the most on a user device, perform as an independent software kit, partly calculate user
Its upper side is divided execution on a remote computing or performs in remote computing device or server completely.Relating to far
Journey calculates in the situation of equipment, and remote computing device can include LAN (LAN) or wide by the network of any kind
Territory net (WAN) is connected to user and calculates equipment, or, it may be connected to external computing device (such as utilizes Internet service
Provider passes through Internet connection).
Although it should be noted that, in above-detailed, be referred to some unit or the subelement of device, but this stroke
Point be merely exemplary is the most enforceable.It practice, according to the embodiment of the present invention, above-described two or more
The feature of unit and function can embody in a unit.Otherwise, feature and the function of an above-described unit can
Embody with Further Division for by multiple unit.
Although additionally, describe the operation of the inventive method in the accompanying drawings with particular order, but, this do not require that or
Hint must perform these operations according to this particular order, or having to carry out the most shown operation could realize desired
Result.Additionally or alternatively, it is convenient to omit some step, multiple steps are merged into a step and performs, and/or by one
Step is decomposed into multiple step and performs.
Although describing spirit and principles of the present invention by reference to some detailed description of the invention, it should be appreciated that, this
Invention is not limited to disclosed detailed description of the invention, and the division to each side does not means that the feature in these aspects can not yet
Combination to be benefited, this division merely to statement convenience.It is contemplated that contain claims spirit and
Various amendments included by the range of and equivalent arrangements.