CN104601725B - The response method and device of service request - Google Patents
The response method and device of service request Download PDFInfo
- Publication number
- CN104601725B CN104601725B CN201510057182.0A CN201510057182A CN104601725B CN 104601725 B CN104601725 B CN 104601725B CN 201510057182 A CN201510057182 A CN 201510057182A CN 104601725 B CN104601725 B CN 104601725B
- Authority
- CN
- China
- Prior art keywords
- priority
- service
- user
- service request
- request
- 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
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000004044 response Effects 0.000 title claims abstract description 17
- 230000000977 initiatory effect Effects 0.000 claims description 33
- 238000012216 screening Methods 0.000 claims description 7
- 238000001514 detection method Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 abstract description 19
- 238000013507 mapping Methods 0.000 description 13
- 238000003860 storage Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012886 linear function Methods 0.000 description 2
- 230000014759 maintenance of location Effects 0.000 description 2
- 230000000737 periodic effect Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000010267 cellular communication Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012913 prioritisation Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Abstract
The present invention relates to the response methods and device of a kind of service request.It the described method comprises the following steps:Receive service request;Obtain service priority and User Priority in the service request;By the service priority in the service request compared with the service priority of system, if the service priority in the service request is higher than the service priority of system, the service request is responded;If the service priority in the service request is less than the service priority of system, refuse the service request;If the service priority in the service request is equal to the service priority of system, by User Priority compared with the User Priority of system;If User Priority is greater than or equal to the User Priority of system, the service request is responded, if User Priority is less than the User Priority of system, refuses the service request.Ensure the high preferential answering of priority, ensure that server can preferably processing business ask, improve the service quality of server.
Description
Technical field
The present invention relates to data processing field, more particularly to the response method and device of a kind of service request.
Background technology
With the development of network technology, more and more users are engaged in vairious activities using network.Various data are stored in
On server or data interaction needs to be transferred by server, and user transfers from server pull data or reliance server
, it is necessary to send a request to server during data, waiting for server is responded.
For server, the request that resource is limited, normally can handle and return within the unit interval is limited by
Quantity is there are one maximum, and more than after maximum, the processing capacity of server can overload the number of request to come in client,
In this case, component requests will be unable to be handled or called side, server can not be returned within normal processing time
Maximum processing capability may be also lower than normal condition or even can not normally handle request completely.
For called side, usually after a request call is initiated, before the return of waiting for server, set
One time-out time, if not obtaining returning the result for server in time-out time, then it is assumed that request processing failure is adjusted simultaneously
It may initiate to retry with side, these number of requests for retrying and server may being caused currently processed increase, so that service
The first-class pending number of request of device further increases, and overall condition is caused to deteriorate or even occur snowslide.
The content of the invention
Based on this, it is necessary to it is more for service request number, server can not normally handle request cause it is in poor service
Problem provides a kind of response method and device of the service request that can improve server service quality.
A kind of response method of service request, comprises the following steps:
Receive service request;
Obtain service priority and the User Priority of the initiation service request in the service request;
By the service priority in the service request compared with the service priority of system, if in the service request
Service priority is higher than the service priority of system, then responds the service request;If the business in the service request is preferential
Grade is less than the service priority of system, then refuses the service request;It is if the service priority in the service request is equal to
The service priority of system will then initiate the User Priority of the service request compared with the User Priority of system;If
The User Priority for initiating the service request is greater than or equal to the User Priority of system, then responds the service request, if
The User Priority for initiating the service request is less than the User Priority of system, then refuses the service request.
A kind of responding device of service request, including:
Receiving module, for receiving service request;
Acquisition module, it is preferential for obtaining the user of service priority and the initiation service request in the service request
Grade;
Respond module, for by the service priority in the service request compared with the service priority of system, if institute
The service priority that the service priority in service request is higher than system is stated, then responds the service request;If the business please
Service priority in asking is less than the service priority of system, then refuses the service request;If the industry in the service request
Be engaged in priority be equal to system service priority, then by initiate the service request User Priority and system user it is preferential
Grade is compared;If the User Priority for initiating the service request is greater than or equal to the User Priority of system, institute is responded
Service request is stated, if the User Priority for initiating the service request is less than the User Priority of system, refuses the business
Request.
The response method and device of above-mentioned service request, it is preferential by obtaining service priority in service request and user
Grade responds request of the service priority in service request higher than the service priority of system, to being less than the industry of system
The request of business priority is refused, and the request of the service priority of system is equal to the service priority in service request, than
Compared with User Priority, request of the User Priority higher than the User Priority of system of initiating business request is responded, to industry
Business request is responded according to the priority, ensures the high preferential answering of priority, ensures that server can preferably handle industry
Business request improves the service quality of server.
Description of the drawings
Fig. 1 is the flow chart of the response method of service request in one embodiment;
Fig. 2 is the relation schematic diagram of service priority and User Priority;
Fig. 3 is the structure diagram of the responding device of service request in one embodiment;
Fig. 4 is the structure diagram of the responding device of service request in another embodiment;
Fig. 5 is the module map for the computer system that can realize the embodiment of the present invention.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, it is right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
Service request number increases so that the first-class pending service request number increase of server, causes server in order to prevent
There is the situation of snowslide, in the case where request overflow occurs in server, it is necessary to which server is allowed to remain able to maximize at output
Reason ability, while can quickly refuse the request that can not be handled.The present invention passes through to delineation of activities priority and to user
Prioritization, and the service priority and User Priority of response processing are preset on the server, by the service request of reception
In service priority compared with the service priority of system, to service priority higher than system service priority industry
Business request is responded, and the service request equal with the service priority of system to service priority compares initiating business request
User Priority and system User Priority, if User Priority higher than system User Priority service request carry out
Response keeps preferentially handling the service request that service priority is high and User Priority is high, improves server as far as possible
Service quality.
Fig. 1 is the flow chart of the response method of service request in one embodiment.As shown in Figure 1, the sound of the service request
Induction method comprises the following steps:
Step 102, service request is received.
Specifically, the service request that server receiving terminal is sent.
Step 104, the User Priority of service priority and the initiation service request in the service request is obtained.
First, the mapping relations between default type of service and service priority are stored on the server.Type of service
It can be classified according to specific business, such as business can be to send message, downloading data, delete data, modification data etc..
Different types of service corresponds to different service priority.Mapping relations between type of service and service priority can be according to industry
The importance configuration service priority of service type, importance information is higher, and service priority is higher.
After obtaining service request, type of service is obtained from service request, according to type of service from default type of service
Mapping relations between service priority draw corresponding service priority.
Business may include multiple dimensions, and each dimension includes multiple service priority, and the importance of each dimension is divided
Grade, a service priority of the high dimension of importance information include all service priority of the low dimension of importance information;
The total number of service priority is the priority number purpose product of each dimension.
Specifically, such as service priority is determined by called side, two dimensions of interface of called server, if adjusting
There are 10 with the priority of side, the priority of the interface for the side that is called there are 10, then total service priority number is 100.
After obtaining service request, the dimensional information of business in service request is obtained, service request is obtained according to dimensional information
Service priority.
In one embodiment, the step of obtaining the User Priority for initiating the service request includes:Acquisition is pre-configured with
Initiation the service request User Priority.
Specifically, setting the priority of designated user on the server, establish between user identifier and User Priority
Mapping relations.The user identifier of initiating business request is obtained, according to the user's mark reflecting from user identifier and User Priority
It penetrates in relation and draws corresponding User Priority.User identifier can be user's name or Customs Assigned Number etc..For example, Customs Assigned Number is got over
Small, User Priority is higher.
In one embodiment, the step of obtaining the User Priority for initiating the service request includes:It obtains and initiates the industry
The user identifier of business request identifies the User Priority calculated corresponding to the user's mark according to the user.
Specifically, the mapping relations between the cryptographic Hash of user identifier and User Priority are stored on the server.Hash
It is worth smaller, the priority of user is higher, and cryptographic Hash is bigger, and the priority of user is lower.Ask for user identifier in service request
Cryptographic Hash is drawn according to the cryptographic Hash of user identifier from the mapping relations between the cryptographic Hash of user identifier and User Priority
Corresponding User Priority.Other calculations can also be used, such as calculate the linear function of Customs Assigned Number etc., linear function value
Smaller, then User Priority is higher.It can also regular transformation calculations mode.
Step 106, by the service priority in the service request compared with the service priority of system.
Specifically, the service priority of system refers to the service priority of server settings, by the industry to being less than the setting
The service request refusal respond for priority of being engaged in.
Step 108, if the service priority in the service request is higher than the service priority of system, responding the business please
It asks;If the service priority in the service request is less than the service priority of system, refuse the service request;If the business please
Service priority in asking is equal to the service priority of system, the then User Priority and the use of system that will initiate the service request
Family priority is compared;If the User Priority for initiating the service request is greater than or equal to the User Priority of system, ring
Should service request, if initiate the service request User Priority be less than system User Priority, refuse the business please
It asks.
The User Priority of system refers to the User Priority of server settings, by the User Priority to being less than the setting
Service request refusal respond.
The rank of user includes all User Priorities under each service priority.Such as service priority is 1 to 10 grade,
User Priority is 1 to 1000 grade.Service priority 1 is superior to service priority 2, and service priority 2 is superior to industry
Business priority 3, and so on, service priority 9 is superior to service priority 10.1 time user's of service priority is preferential
Grade is divided into 1 to 1000 grade;The priority of 2 times users of service priority is divided into 1 to 1000 grade etc..The rank of User Priority 1 is high
In service priority 2, User Priority 2 is superior to service priority 3, and so on, User Priority 9 is superior to
Service priority 10.
The response method of above-mentioned service request, it is right by obtaining service priority and User Priority in service request
The request of service priority in service request higher than the service priority of system is responded, preferential to the business that is less than system
The request of grade is refused, and the request of the service priority of system is equal to the service priority in service request, compares user
Priority, request of the User Priority higher than the User Priority of system of initiating business request is responded, excellent according to business
First grade and User Priority judge which service request should be rejected, which service request is responded so that service request is pressed
It is responded according to priority height, ensures the high preferential answering of priority, ensured the preferable processing business request of server energy, carry
The high service quality of server.
In one embodiment, by the service priority ratio of the service priority in the service request and system compared with
Before, whether the User Priority that the service request is initiated in detection is highest User Priority, if so,
And when the service priority of system and the User Priority difference of system be highest priority when, respond the business
Request.
Specifically, the User Priority of initiating business request is highest User Priority, even if then service priority is low
In the service priority of system, service request still allows for being handled.The height to high-priority users can be kept as far as possible
Priority request is handled, and ensure that service quality.
In one embodiment, if the service priority of system and the User Priority of system are highest priority,
Judge whether the service request number is more than maximum traffic number of request, if so, screen fraction business please from total service request
It asks, the service request filtered out is responded.
The screen fraction service request from total service request, the step of being responded to the service request filtered out, wrap
It includes:Service request is proportionally screened from total service request, the service request filtered out is responded.
Specifically, ratio refers to the ratio for accounting for total service request, such as account for two one thousandths of total service request, four
One thousandth, 8 one thousandths etc. are arranged as required to the value of ratio.In addition, can also cryptographic Hash be done to user identifier, according to Kazakhstan
Uncommon value carries out the user that screening can be responded, and gradually reduces the 2000 of the ratio for the user that can be responded, such as total number of users
/ mono-, four one thousandths, 8 one thousandths etc..
In one embodiment, the response method of the service request further includes:Judge server currently whether in overload
State;According to the current overload of the server, the service priority of system and the User Priority of system are adjusted.
Specifically, the indices of server periodic statistical reflection own serving capabilities, judge to take according to the indices
Device be engaged in currently whether in overload.Indices may include what the accumulative time-consuming, service request of processing business request waited
Average time-consuming, CPU (Central Processing Unit, central processing unit) utilization rate etc..When adding up for processing business request
It takes when being more than accumulative threshold value, then determining server is currently at overload, and not less than accumulative threshold value, then determining server is currently located
In not overloading;Or average take that service request waits is more than when waiting threshold value, then determining server is currently at overload, not
More than threshold value is waited, then determining server, which is currently at, does not overload;Or CPU usage is more than utilization rate threshold value, then judges to take
Business device is currently at overload, and not less than utilization rate threshold value, then determining server, which is currently at, does not overload.Wherein, accumulative threshold value is
Refer to and add up time-consuming threshold value.Threshold value is waited to refer to the averagely time-consuming threshold value waited.Utilization rate threshold value refers to the threshold of CPU usage
Value.
According to the current overload of the server, the step of the service priority of system and the User Priority of system is adjusted
Suddenly include:
If server present overload first steps up the User Priority of system, until the User Priority of system is
After highest User Priority, detect that server currently still overloads, then the service priority of lifting system again, and by system
User Priority be adjusted to minimum User Priority;
If server does not overload currently, the User Priority of system is first gradually reduced, until the User Priority of system
It after lowest priority, detects that server does not still overload currently, then reduces the service priority of system again, and by system
User Priority is adjusted to highest User Priority.
For example, service priority has 1 to 10 grade, 1 grade of highest, 10 grades minimum;User Priority has 1 to 1000 grade, and 1 grade most
Height, 1000 grades minimum.The service priority of server current system is 10, and the User Priority of system is 10 grades, works as server
During present overload, the User Priority of first lifting system is 9 grades, then judges server currently whether in overload, if clothes
Whether business device is still within overloading, then the User Priority of lifting system is 8 grades, then judge server currently in overload shape
State if server is still within overloading, continues to lift up the User Priority of system as 7 grades, so steps up the use of system
Family priority, until the User Priority of system is 1 grade, server is still within overloading, then the service priority of lifting system
For 9 grades, and the User Priority of system is become 1000 grades, then judge server again currently whether in overload, if
It is then to continue to step up the User Priority of system again.
When server does not overload currently, the User Priority of system is first reduced as 11 grades, then judges that server is currently
It is no to be in overload, if server is still within not overloading, the User Priority of system is reduced as 12 grades, then judges to service
Whether device is currently in overload, if server is still within not overloading, the User Priority for continuing reduction system is 13
Grade so gradually reduces the User Priority of system, and until the User Priority of system is 1000 grades, server is still within not
Overload then reduces the service priority of system as 12 grades, and the User Priority of system is become 1 grade, then judges to service again
Whether device currently in overload, if in not overloading, continues to gradually reduce the User Priority of system again.
By adjusting the service priority of system and the User Priority of system so that server in the event of overloading,
It maximizes the processing capacity of export server and in the case where not overloading, improves the utilization rate of server.
Fig. 2 is the relation schematic diagram of service priority and User Priority.As shown in Fig. 2, service priority has 2 dimensions
Degree, each dimension have 2 priority, and 2 dimensions include dimension 1 and dimension 2, and dimension 1 includes service priority 11 and business is excellent
First grade 12, dimension 2 include service priority 21 and service priority 22.The importance information of dimension 1 is higher than the importance of dimension 2
Rank.Each dimension includes all User Priorities 1 to 1000, and User Priority 1 is higher than User Priority 1000.It is assuming that current
The service priority of system is 21, User Priority 996, when server is in overload, is stepped up from low to high
The User Priority of system, i.e., from 1000 to 1 direction progressively adjust, and 1 are progressively adjusted to from 996, if server is still within
The service priority 21 of system is then become 12 by overload, and the User Priority of system is adjusted to 1000, then from 1000 to 1
Direction progressively adjusts User Priority.When server, which is in, not to be overloaded, then the user for gradually reducing system from high to low is preferential
Grade, i.e., from 1 to 1000 direction progressively adjust, and 1000 are progressively adjusted to from 996, will if server is still within not overloading
The service priority 21 of system becomes 22, and the User Priority of system is adjusted to 1.
If the service priority of system is 11, the User Priority of system is 1, and server still can not handle all business
It asks, then server starts to refuse the service request of highest priority user, can use 1/2000 business of total service request
Request, if 1/2000 service request, server still can not be handled, then take 1/4000 business of total service request please
Ask, if 1/4000 service request, server still can not be handled, then take 1/8000 service request of total service request into
Row processing, and so on, it can progressively adjust ratio.
Fig. 3 is the structure diagram of the responding device of service request in one embodiment.As shown in figure 3, the service request
Responding device, including receiving module 310, acquisition module 320 and respond module 330.Wherein:
Receiving module 310 is used to receive service request.
Specifically, the receiving module 310 on server receives the service request that terminal is sent.
The user that acquisition module 320 is used to obtain service priority and the initiation service request in the service request is preferential
Grade.
First, the mapping relations between default type of service and service priority are stored on the server.Type of service
It can be classified according to specific business, such as business can be to send message, downloading data, delete data, modification data etc..
Different types of service corresponds to different service priority.Mapping relations between type of service and service priority can be according to industry
The importance configuration service priority of service type, importance information is higher, and service priority is higher.
After obtaining service request, type of service is obtained from service request, according to type of service from default type of service
Mapping relations between service priority draw corresponding service priority.
Business may include multiple dimensions, and each dimension includes multiple service priority, and the importance of each dimension is divided
Grade, a service priority of the high dimension of importance information include all service priority of the low dimension of importance information;
The total number of service priority is the priority number purpose product of each dimension.
Specifically, such as service priority is determined by called side, two dimensions of interface of called server, if adjusting
There are 10 with the priority of side, the priority of the interface for the side that is called there are 10, then total service priority number is 100.
After obtaining service request, the dimensional information of business in service request is obtained, service request is obtained according to dimensional information
Service priority.
In one embodiment, acquisition module 320 be additionally operable to obtain the preconfigured initiation service request user it is excellent
First grade.
Specifically, setting the priority of designated user on the server, establish between user identifier and User Priority
Mapping relations.Acquisition module 320 obtains the user identifier of initiating business request, is identified according to the user from user identifier and user
Corresponding User Priority is drawn in the mapping relations of priority.User identifier can be user's name or Customs Assigned Number etc..For example,
Customs Assigned Number is smaller, and User Priority is higher.
In one embodiment, acquisition module 320 is additionally operable to obtain the user identifier for initiating the service request, according to the use
Family mark calculates the corresponding User Priority of the user's mark.
Specifically, the mapping relations between the cryptographic Hash of user identifier and User Priority are stored on the server.Hash
It is worth smaller, the priority of user is higher, and cryptographic Hash is bigger, and the priority of user is lower.Ask for user identifier in service request
Cryptographic Hash is drawn according to the cryptographic Hash of user identifier from the mapping relations between the cryptographic Hash of user identifier and User Priority
Corresponding User Priority.
Respond module 330 is used for by the service priority in the service request compared with the service priority of system, if should
Service priority in service request is higher than the service priority of system, then responds the service request;If in the service request
Service priority is less than the service priority of system, then refuses the service request;If service priority in the service request etc.
In the service priority of system, then the User Priority of the service request will be initiated compared with the User Priority of system;
If the User Priority for initiating the service request is greater than or equal to the User Priority of system, the service request is responded, if hair
The User Priority for playing the service request is less than the User Priority of system, then refuses the service request.
The User Priority of system refers to the User Priority of server settings, by the User Priority to being less than the setting
Service request refusal respond.
The rank of user includes all User Priorities under each service priority.Such as service priority is 1 to 10 grade,
User Priority is 1 to 1000 grade.Service priority 1 is superior to service priority 2, and service priority 2 is superior to industry
Business priority 3, and so on, service priority 9 is superior to service priority 10.1 time user's of service priority is preferential
Grade is divided into 1 to 1000 grade;The priority of 2 times users of service priority is divided into 1 to 1000 grade etc..The rank of User Priority 1 is high
In service priority 2, User Priority 2 is superior to service priority 3, and so on, User Priority 9 is superior to
Service priority 10.
The responding device of above-mentioned service request, it is right by obtaining service priority and User Priority in service request
The request of service priority in service request higher than the service priority of system is responded, preferential to the business that is less than system
The request of grade is refused, and the request of the service priority of system is equal to the service priority in service request, compares user
Priority, request of the User Priority higher than the User Priority of system of initiating business request is responded, to service request
It is responded according to the priority, ensures the high preferential answering of priority, ensure that server can preferably processing business ask,
Improve the service quality of server.
In one embodiment, respond module 330 is additionally operable to by the service priority in the service request and system
Before service priority compares, whether the User Priority that the service request is initiated in detection is highest User Priority, if so,
And when the service priority of system and the User Priority difference of system be highest priority when, respond the service request.
Specifically, the User Priority of initiating business request is highest User Priority, even if then service priority is low
In the service priority of system, service request still allows for being handled.
Fig. 4 is the structure diagram of the responding device of service request in another embodiment.As shown in figure 4, the service request
Responding device except including receiving module 310, acquisition module 320, respond module 330, further include largest request number and judge mould
Block 340, screening module 350, overload judgment module 360, adjustment module 370.Wherein:
If largest request number judgment module 340 is highest for the service priority of system and the User Priority of system
Priority, judge the service request number whether be more than maximum traffic number of request.
Screening module 350 is used for when judging that the service request number is more than maximum traffic number of request, please from total business
Seek middle screen fraction service request.
The respond module 330 is additionally operable to respond the service request filtered out.
The screening module 350 is additionally operable to proportionally screen service request from total service request.
Specifically, ratio refers to the ratio for accounting for total service request, such as account for two one thousandths of total service request, four
One thousandth, 8 one thousandths etc. are arranged as required to the value of ratio.In addition, can also cryptographic Hash be done to user identifier, according to Kazakhstan
Uncommon value carries out the user that screening can be responded, and gradually reduces the 2000 of the ratio for the user that can be responded, such as total number of users
/ mono-, four one thousandths, 8 one thousandths etc..
Whether overload judgment module 360 is used to judge server currently in overload.
Specifically, the indices of server periodic statistical reflection own serving capabilities, judge to take according to the indices
Device be engaged in currently whether in overload.Indices may include what the accumulative time-consuming, service request of processing business request waited
Average time-consuming, CPU usage etc..When processing business request is when adding up to take more than accumulative threshold value, then determining server is current
In overload, not less than accumulative threshold value, then determining server, which is currently at, does not overload;Or the average of service request wait takes
During more than waiting threshold value, then determining server is currently at overload, and not less than threshold value is waited, then determining server is currently at not
Overload;Or CPU usage is more than utilization rate threshold value, then determining server is currently at overload, not less than utilization rate threshold value, then
Determining server, which is currently at, does not overload.Wherein, accumulative threshold value refers to add up time-consuming threshold value.Threshold value is waited to refer to the flat of wait
Time-consuming threshold value.Utilization rate threshold value refers to the threshold value of CPU usage.
Adjust service priority and system that module 370 is used to, according to the current overload of the server, adjust system
User Priority.
If the adjustment module 370 is additionally operable to server present overload, the User Priority of system is first stepped up, until
After the User Priority of system is highest User Priority, detect that server currently still overloads, then lifting system again
Service priority, and the User Priority of system is adjusted to minimum User Priority;
If server does not overload currently, the User Priority of system is first gradually reduced, until the User Priority of system
It after lowest priority, detects that server does not still overload currently, then reduces the service priority of system again, and by system
User Priority is adjusted to highest User Priority.
For example, service priority has 1 to 10 grade, 1 grade of highest, 10 grades minimum;User Priority has 1 to 1000 grade, and 1 grade most
Height, 1000 grades minimum.The service priority of server current system is 10, and the User Priority of system is 10 grades, works as server
During present overload, the User Priority of first lifting system is 9 grades, then judges server currently whether in overload, if clothes
Whether business device is still within overloading, then the User Priority of lifting system is 8 grades, then judge server currently in overload shape
State if server is still within overloading, continues to lift up the User Priority of system as 7 grades, so steps up the use of system
Family priority, until the User Priority of system is 1 grade, server is still within overloading, then the service priority of lifting system
For 9 grades, and the User Priority of system is become 1000 grades, then judge server again currently whether in overload, if
It is then to continue to step up the User Priority of system again.
When server does not overload currently, the User Priority of system is first reduced as 11 grades, then judges that server is currently
It is no to be in overload, if server is still within not overloading, the User Priority of system is reduced as 12 grades, then judges to service
Whether device is currently in overload, if server is still within not overloading, the User Priority for continuing reduction system is 13
Grade so gradually reduces the User Priority of system, and until the User Priority of system is 1000 grades, server is still within not
Overload then reduces the service priority of system as 12 grades, and the User Priority of system is become 1 grade, then judges to service again
Whether device currently in overload, if in not overloading, continues to gradually reduce the User Priority of system again.
By adjusting the service priority of system and the User Priority of system so that server in the event of overloading,
It maximizes the processing capacity of export server and in the case where not overloading, improves the utilization rate of server.
Fig. 5 is the module map for the computer system 1000 that can realize the embodiment of the present invention.The computer system 1000
A simply example for being suitable for the invention computer environment, it is impossible to be considered to propose appointing to the use scope of the present invention
What is limited.Computer system 1000 can not be construed to need to rely on or the illustrative computer system 1000 with diagram
One or more of component combination.
The computer system 1000 shown in Fig. 5 is the example of a computer system for being suitable for the present invention.Have
Other frameworks of different sub-systems configuration can also use.Such as there are big well known desktop computer, notebook, individual digital to help
The similar devices such as reason, smart phone, tablet computer, portable media player, set-top box can be adapted for some of the present invention
Embodiment.But it is not limited to equipment enumerated above.
As shown in figure 5, computer system 1000 includes processor 1010, memory 1020 and system bus 1022.Including
Various system components including memory 1020 and processor 1010 are connected on system bus 1022.Processor 1010 is one
For performing the hardware of computer program instructions by arithmetic sum logical operation basic in computer system.Memory 1020
It is one to be used to temporarily or permanently store calculation procedure or the physical equipment of data (for example, program state information).System is total
Line 1020 can be any one in the bus structures of following several types, including memory bus or storage control, outer
If bus and local bus.Processor 1010 and memory 1020 can be by system bus 1022 into row data communication.Wherein
Memory 1020 includes read-only memory (ROM) or flash memory (being all not shown in figure) and random access memory (RAM), RAM
Typically refer to be loaded with the main storage of operating system and application program.
Computer system 1000 further includes display interface 1030 (for example, graphics processing unit), 1040 (example of display device
Such as, liquid crystal display), audio interface 1050 (for example, sound card) and audio frequency apparatus 1060 (for example, loud speaker).Display device
1040 and audio frequency apparatus 1060 be for experiencing the media device of multimedia content.
Computer system 1000 generally comprises a storage device 1070.Storage device 1070 can from a variety of computers
It reads to select in medium, computer-readable medium refers to any available medium that can be accessed by computer system 1000,
Including mobile and fixed two media.For example, computer-readable medium includes but not limited to, flash memory (miniature SD
Card), CD-ROM, digital versatile disc (DVD) or other optical disc storages, cassette, tape, disk storage or other magnetic storages are set
Any other medium that is standby or can simultaneously being accessed available for storage information needed by computer system 1000.
Computer system 1000 further includes input unit 1080 and input interface 1090 (for example, I/O controller).User can
With by input unit 1080, such as the touch panel equipment in keyboard, mouse, display device 1040, input instruction and information arrive
In computer system 1000.Input unit 1080 is typically to be connected to by input interface 1090 on system bus 1022, but
It can also be connected by other interfaces or bus structures, such as universal serial bus (USB).
Computer system 1000 can carry out logical connection with one or more network equipment in a network environment.Network is set
Standby can be PC, server, router, smart phone, tablet computer or other common network nodes.Department of computer science
System 1000 is connected by LAN (LAN) interface 1100 or mobile comm unit 1110 with the network equipment.LAN (LAN)
Refer in finite region, for example, family, school, computer laboratory or the office building using the network media, interconnection composition
Computer network.WiFi and twisted-pair feeder wiring Ethernet are two kinds of technologies of most common structure LAN.WiFi is a kind of
It can make 1000 swapping data of computer system or the technology of wireless network is connected to by radio wave.Mobile comm unit
1110 are answered and are called by radio communication diagram while being moved in a wide geographic area.Except logical
Beyond words, mobile comm unit 1110 is also supported to carry out in 2G, 3G or the 4G cellular communication system for providing mobile data service
Internet access.
It should be pointed out that other computer systems including than 1000 more or fewer subsystems of computer system
It can be suitably used for inventing.For example, computer system 1000 can include the bluetooth unit that data can be exchanged in short distance, for shining
The imaging sensor of phase and the accelerometer for measuring acceleration.
As detailed above, the response method of service request can be performed by being suitable for the invention computer system 1000
Specified operation.Computer system 1000 operates in the form of the software instruction in computer-readable medium by processor 1010
To perform these operations.These software instructions can be from storage device 1070 or by lan interfaces 1100 from another equipment
It is read into memory 1020.The software instruction being stored in memory 1020 is so that processor 1010 performs above-mentioned business and asks
The response method asked.In addition, the present invention also can equally be realized by hardware circuit or hardware circuit combination software instruction.Cause
This, realizes the combination the present invention is not limited to any specific hardware circuit and software.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read
In memory carrier, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage carries
Body can be magnetic disc, CD, read-only memory (Read-OnlyMemory, ROM) etc..
Embodiment described above only expresses the several embodiments of the present invention, and description is more specific and detailed, but simultaneously
Cannot the limitation to the scope of the claims of the present invention therefore be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention
Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (14)
1. a kind of response method of service request, comprises the following steps:
Judge server currently whether in overload;
According to the current overload of the server, the service priority of system and the User Priority of system are adjusted;
Receive service request;
Obtain service priority and the User Priority of the initiation service request in the service request;
By the service priority in the service request compared with the service priority of system, if the business in the service request
Priority is higher than the service priority of system, then responds the service request;If the service priority in the service request is low
In the service priority of system, then refuse the service request;If the service priority in the service request is equal to system
Service priority then obtains the user identifier for initiating the service request, is identified and is calculated corresponding to the user's mark according to the user
User Priority, and the User Priority of the service request will be initiated compared with the User Priority of system;If hair
The User Priority for playing the service request is greater than or equal to the User Priority of system, then responds the service request, if hair
The User Priority for playing the service request is less than the User Priority of system, then refuses the service request.
2. according to the method described in claim 1, it is characterized in that, the method further includes:
Before by the service priority in the service request compared with the service priority of system, the business is initiated in detection
Whether the User Priority of request is highest User Priority, if so, and the service priority of system and the user of system it is excellent
When being highest priority during first grade difference, the service request is responded.
3. according to the method described in claim 1, it is characterized in that, the method further includes:
If the service priority of system and the User Priority of system are highest priority, judge that the service request number is
No is more than maximum traffic number of request, if so, the screen fraction service request from total service request, it please to the business filtered out
It asks and is responded.
4. according to the method described in claim 3, it is characterized in that, the screen fraction business from total service request please
The step of asking, being responded to the service request filtered out includes:
Service request is proportionally screened from total service request, the service request filtered out is responded.
5. according to the method described in claim 1, it is characterized in that, according to the current overload of the server, adjustment system
The step of service priority of system and the User Priority of system, includes:
If server present overload first steps up the User Priority of system, until the User Priority of system is highest
User Priority after, detect that server currently still overloads, then the service priority of lifting system again, and by the use of system
Family priority is adjusted to minimum User Priority;
If server does not overload currently, the User Priority of system is first gradually reduced, until the User Priority of system is most
It after low priority, detects that server does not still overload currently, then reduces the service priority of system again, and by the user of system
Priority is adjusted to highest User Priority.
6. according to the method described in claim 1, it is characterized in that, obtain the step for the User Priority for initiating the service request
Suddenly include:
Obtain the preconfigured User Priority for initiating the service request;
Alternatively, obtaining the user identifier for initiating the service request, it is right to calculate the user identifier institute according to the user identifier
The User Priority answered.
7. according to the method described in claim 1, it is characterized in that, each business includes multiple dimensions, each dimension includes more
A service priority, the importance of each dimension are classified, and a service priority of the high dimension of importance information includes
All service priority of the low dimension of importance information;The total number of service priority is the priority number purpose of each dimension
Product.
8. a kind of responding device of service request, which is characterized in that including:
Judgment module is overloaded, for judging server currently whether in overload;
Module is adjusted, for according to the current overload of the server, adjusting the service priority of system and the user of system
Priority;
Receiving module, for receiving service request;
Acquisition module, for obtaining service priority and the User Priority of the initiation service request in the service request;
Respond module, for by the service priority in the service request compared with the service priority of system, if the industry
Service priority in business request is higher than the service priority of system, then responds the service request;If in the service request
Service priority be less than system service priority, then refuse the service request;If the business in the service request is excellent
First grade is equal to the service priority of system, then obtains the user identifier for initiating the service request, is identified to calculate according to the user and is somebody's turn to do
User Priority corresponding to user identifier, and the User Priority and the User Priority of system that the service request will be initiated
It is compared;If initiating User Priority of the User Priority greater than or equal to system of the service request, described in response
Service request, if the User Priority for initiating the service request is less than the User Priority of system, refusing the business please
It asks.
9. device according to claim 8, which is characterized in that
The respond module be additionally operable to by the service priority ratio of the service priority in the service request and system compared with
Before, whether the User Priority that the service request is initiated in detection is highest User Priority, if so, and system business it is excellent
When being highest priority during the User Priority difference of first grade and system, the service request is responded.
10. device according to claim 8, which is characterized in that described device further includes:
Largest request number judgment module, if being highest preferential for the service priority of system and the User Priority of system
Grade judges whether the service request number is more than maximum traffic number of request;
Screening module, for when judge the service request number be more than maximum traffic number of request when, from total service request
Screen fraction service request;
The respond module is additionally operable to respond the service request filtered out.
11. device according to claim 10, which is characterized in that the screening module is additionally operable to from total service request
Proportionally screen service request.
12. device according to claim 8, which is characterized in that if the adjustment module is additionally operable to server present overload,
The User Priority of system is then first stepped up, after the User Priority of system is highest User Priority, is detected
Server currently still overloads, then the service priority of lifting system again, and the User Priority of system is adjusted to minimum
User Priority;
If server does not overload currently, the User Priority of system is first gradually reduced, until the User Priority of system is most
It after low priority, detects that server does not still overload currently, then reduces the service priority of system again, and by the user of system
Priority is adjusted to highest User Priority.
13. device according to claim 8, which is characterized in that the acquisition module is additionally operable to obtain preconfigured hair
Play the User Priority of the service request;Alternatively, the acquisition module is additionally operable to obtain the user for initiating the service request
Mark, the User Priority according to corresponding to the user identifier calculates the user identifier.
14. device according to claim 8, which is characterized in that each business includes multiple dimensions, and each dimension includes more
A service priority, the importance of each dimension are classified, and a service priority of the high dimension of importance information includes
All service priority of the low dimension of importance information;The total number of service priority is the priority number purpose of each dimension
Product.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510057182.0A CN104601725B (en) | 2015-02-03 | 2015-02-03 | The response method and device of service request |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510057182.0A CN104601725B (en) | 2015-02-03 | 2015-02-03 | The response method and device of service request |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104601725A CN104601725A (en) | 2015-05-06 |
CN104601725B true CN104601725B (en) | 2018-05-22 |
Family
ID=53127218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510057182.0A Active CN104601725B (en) | 2015-02-03 | 2015-02-03 | The response method and device of service request |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104601725B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106341400B (en) * | 2016-08-29 | 2019-06-18 | 联动优势科技有限公司 | A kind of method and device of processing business request |
CN106357789B (en) * | 2016-09-30 | 2020-01-10 | 腾讯科技(北京)有限公司 | Information access control method, server and computer readable storage medium |
WO2020219064A1 (en) * | 2019-04-26 | 2020-10-29 | Google Llc | Efficient use of computing resources in responding to content requests |
CN112291718B (en) * | 2020-10-16 | 2022-08-23 | 精伦电子股份有限公司 | Service scheduling method and system based on low-power-consumption Bluetooth broadcast |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1747434A (en) * | 2004-09-10 | 2006-03-15 | 华为技术有限公司 | Flow control for pipeline distributing system |
CN1801819A (en) * | 2005-01-04 | 2006-07-12 | 国际商业机器公司 | Confirming apparatus of priority, service treating and allocating device, and control method |
CN101778039A (en) * | 2009-12-31 | 2010-07-14 | 华为技术有限公司 | Overload control method and system thereof |
CN101959260A (en) * | 2009-07-14 | 2011-01-26 | 中兴通讯股份有限公司 | Method and device for realizing admission control in WiMAX (Worldwide Interoperability for Microwave Access) system |
-
2015
- 2015-02-03 CN CN201510057182.0A patent/CN104601725B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1747434A (en) * | 2004-09-10 | 2006-03-15 | 华为技术有限公司 | Flow control for pipeline distributing system |
CN1801819A (en) * | 2005-01-04 | 2006-07-12 | 国际商业机器公司 | Confirming apparatus of priority, service treating and allocating device, and control method |
CN101959260A (en) * | 2009-07-14 | 2011-01-26 | 中兴通讯股份有限公司 | Method and device for realizing admission control in WiMAX (Worldwide Interoperability for Microwave Access) system |
CN101778039A (en) * | 2009-12-31 | 2010-07-14 | 华为技术有限公司 | Overload control method and system thereof |
Also Published As
Publication number | Publication date |
---|---|
CN104601725A (en) | 2015-05-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109359118B (en) | Data writing method and device | |
US11537304B2 (en) | Data verification method and apparatus, and storage medium | |
CN104601725B (en) | The response method and device of service request | |
CN107463437B (en) | Application control method, device, storage medium and electronic device | |
US20150163280A1 (en) | Method and device for downloading file | |
CN108345594A (en) | Control method, control device and the control system of database access request | |
CN113037795B (en) | Thin terminal system and processing method thereof | |
WO2020057178A1 (en) | Method and apparatus for adjusting resources of intelligent analysis devices | |
US20190196917A1 (en) | Data backup method, storage medium, and terminal | |
CN114116231A (en) | Data loading method and device, computer equipment and storage medium | |
CN110650209A (en) | Method and device for realizing load balance | |
US11455196B2 (en) | Adaptive prioritization of USB traffic | |
CN104753825B (en) | The delivery method and system of login status when instant messaging multiple terminals logs in | |
CN115190180A (en) | Network resource request scheduling method and device when network resource request increases sharply | |
KR20090083067A (en) | Method and device for data transmission and method and device for performing work | |
CN111262794B (en) | Gateway flow control method and device | |
US11509717B2 (en) | Cross datacenter read-write consistency in a distributed cloud computing platform | |
WO2025044384A1 (en) | Data transmission method and apparatus, storage medium, and computer device | |
CN110839166A (en) | A data sharing method and device | |
CN116225685A (en) | Method and device for scheduling physical cores | |
CN114528110A (en) | Task processing method, device and system | |
CN113660699A (en) | A kind of intelligent cluster networking method, device and electronic equipment | |
CN108111431A (en) | Business datum sending method and device | |
CN115150399A (en) | Load balancing method, load balancing device, processing system and storage medium | |
CN116955271A (en) | Method and device for storing data copy, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |