Summary of the invention
For the user who makes different stage obtains the service of different brackets, the purpose of this invention is to provide a kind of novel Web service QoS processor and method.This processor solves service classification and load control problem by effective resource optimization algorithm, makes the user of different stage obtain the service of different brackets, makes the user and serve the supplier to obtain the high availability and the service performance of expection.
For achieving the above object, the present invention by the following technical solutions: a kind of Web service QoS processor is characterized in that: it is made of three parts: control section, service level subscription management part and object time T setting section during operation;
Control section comprises during operation: request queue manager, request scheduling device and resource optimization device; The request queue manager is responsible for operation and performance statisticses such as the classification insertion, deletion of request message; The request scheduling device is according to certain dispatching algorithm scheduling queue request; The resource optimization device is according to a performance majorized function, and the most rational Resources allocation is given different classification of service; Network Performance Monitor obtains the performance metric data dynamically in real time;
The service level subscription management partly provides a service negotiation template, and it comprises the service level subscription manager and consults file repository two parts; When the service level document that service level subscription management part is selected the user passes to operation in the negotiation file repository of control section, so that control section is being used when classification is carried out in request being used for during operation;
Object time T setting section comprises Network Performance Monitor and behavioral simulator, its effect provides a graphically managing interface, according to resource allocation and the response time under the parameter dynamic calculation different loads condition of input, for the keeper provides one the target negotiate time method conveniently is set.
Control section is divided into inside and outside double-layer structure during described operation; Described request queue management device and request scheduling device constitute internal layer, are responsible for request queue management and scheduling, finish the once implementation status of request; Described resource optimization device constitutes outer as the feedback cycle layer, periodically carries out resource allocation, and the result is fed back to the request scheduling device, as the foundation of scheduler.
The described request queue management device comprises negotiation access control device, separation controller, queue controller, distribution controller, returns controller, resource recovery controller and graded queues unit;
Consult the access control device: judge whether the user consults current call service actions, negotiation information leaves in consults in the file repository;
Separation controller:,, service, operation according to<user if consult to pass through〉obtain the service level of subscribing to;
Queue controller: be responsible for request is inserted in the formation of respective horizontal. and be blocked in this. just wake this request up execution in case satisfy condition simultaneously;
Distribution controller: according to the request sequence call Web service of queue controller control;
Return controller: Web service is oppositely returned after calling and finishing, and carries out the releasing operation of resource together with " resource recovery controller ", as with this request deletion from formation, carry out performance inventory etc.Graded queues unit: the formation of classifying according to user class.
The described request scheduler adopts the execution sequence based on each classification request of tournament algorithm decision of weight, makes the stand-by period difference of the request in the different queue in the request queue manager.
Described resource optimization device distributes system resource according to the contribution of each classification in the objective optimization function U tolerance described request queue management device to system's importance, and its result is as the weight of described request scheduler schedules.
Described objective optimization function U influences resource allocation to the capabilities map to of a Web service request concrete data by changing the U function;
Wherein subscript c representative classification, T
cObject time, t are consulted in expression
cExpression predicated response time next stage, μ
cExpression service execution speed, α, β are coordination parameters.
A kind of Web service prioritized QoS processing method, it may further comprise the steps:
(1), receives the Web service request that the user sends according to http protocol;
(2), the SOAP packet parsing unit of control section receives the soap message request when moving, and soap message is resolved, and obtains information such as Service name, operation name; Simultaneously, the authentication unit carries out authentication to the user, obtains subscriber identity information;
(3), according to subscriber identity information, retrieval is consulted library and is obtained the grade of service that the active user subscribes to;
(4), obtain the grade of service after, request controller judges according to the situation of each priority query in the queue management device whether current queue full, if exceed the disposal ability of server, will abandon this request, otherwise is inserted in this queue management device;
(5), the utilization of request scheduling device is selected request based on what the tournament algorithm of weight did not stop from queue management device;
(6), carry out calling of Web service.
Web service QoS processor provided by the invention is compared with correlative study in the past, has following characteristics:
1, the present invention with the maximum concurrent number that can handle as the resource measurement standard, in running, for the user of different priorities distributes different thread resources, this method has following benefit: do not need to revise hardware resource, improve the transparency and portable, reduced the complexity of control.
2, designed the inside and outside double-deck processing architecture of system, internal layer is paid close attention to the queuing and the scheduling of request message, the management of carrying out resource and the distribution of outer cyclic periodicity, and the result fed back to internal layer, as the weight of request scheduling device scheduling.
3, utilize WRR dispatching algorithm and resource optimization algorithm, well realized the service grading effect, for same service, different priority users can be distributed different resources, spends the discrepant response time.When user concurrent request number was a lot, system can realize access control, had reduced the possibility of system crash.
Embodiment
In the Web service environment, the ISP may provide multiple Web service, and each all has a plurality of grades of service, the corresponding many different users of each grade.So-called service classification is exactly the operation at each Web service, is divided into several grades according to its response time, and the user of different priorities selects the service of different stage.In addition,, when existing a large amount of concurrent users to ask to serve, can cause system overload to occur because the handling property of system is limited, even the machine phenomenon of delaying, therefore, also need to consider load control problem.
In order to solve service classification and load control problem, as shown in Figure 1, Web service prioritized QoS of the present invention (being called for short WSDiffQos) processor mainly is made of three parts: control section, service level subscription management part and object time T setting section during operation.
Control section mainly comprises during operation: request queue manager, request scheduling device, resource optimization device.Behind Soap packet parsing unit in the Web service system, authentication unit, negotiation request stage unit and the Soap message parse of request controller with the client transmission, user identity is authenticated, classification is carried out in user's request, and the service level agreement of finishing client requests message is the preliminary treatment of QoS.Afterwards, the request queue manager is responsible for the operation and the performance statistics such as classification insertion, deletion of request message.The request scheduling device is according to certain dispatching algorithm scheduling queue request, and the dispatching algorithm here adopts the priority scheduling based on weight, and algorithm is described in detail subsequently.The resource optimization device is according to a performance majorized function, and the most rational Resources allocation is given different classification of service.Network Performance Monitor dynamic (approaching) in real time obtain the performance metric data, the keeper can see obviously whether current system breaks a contract.
Control section is divided into inside and outside double-layer structure again during operation.Request queue manager and request scheduling device constitute internal layer, are responsible for request queue management and scheduling, finish the once implementation status of request.The resource optimization device constitutes outer as the feedback cycle layer, periodically carries out resource allocation, and the result is fed back to the request scheduling device, as the foundation of scheduler.Ectonexine intercoms mutually, reaches in resource under the situation of optimal utilization to finish the service classification.
The service level subscription management partly provides a service negotiation template, and it comprises the service level subscription manager and consults file repository two parts, allows the user therefrom select the service level of own needs.This template provides some service levels, such as corresponding time, service pricing etc.When the service level document that service level subscription management part is selected the user passes to operation in the negotiation file repository of control section, so that control section is being used when classification is carried out in request being used for during operation.
Object time T setting section comprises Network Performance Monitor and behavioral simulator, its effect provides a graphically managing interface, according to resource allocation and the response time under the parameter dynamic calculation different loads condition of input, for the keeper provides one the target negotiate time method conveniently is set.
Control section is the core of Web service prioritized QoS treatment system of the present invention during above-mentioned operation, and wherein, the request queue manager is again the essential elements that realizes QoS.
The request queue manager comprises the number of formation, the degree of depth of each formation and some algorithms of administration queue.It mainly is responsible for the queuing and the scheduling of request message, and the management of formation, as:
(1) safeguards the formation of a plurality of classification, limited the request that each formation holds at most and counted N, when the request number reaches N in the formation, no longer receive new request.
(2) operations such as the insertion of responsible request, deletion.
(3) performance data of maintenance request formation, as the number of responses of record a period of time, average response time, not processed data such as request number in the formation.
Fig. 2 is a queue management device internal structure schematic diagram.As shown in the figure, it comprises negotiation access control device, separation controller, queue controller, distribution controller, returns controller, resource recovery controller and graded queues unit.
Consult the access control device: judge whether the user consults current call service actions, negotiation information leaves in consults in the file repository.
Separation controller:,, service, operation according to<user if consult to pass through〉obtain the service level of subscribing to.
Queue controller: be responsible for request is inserted in the formation of respective horizontal. and be blocked in this. just wake this request up execution in case satisfy condition simultaneously.
Distribution controller: according to the request sequence call Web service of queue controller control.
Return controller: Web service is oppositely returned after calling and finishing, and carries out the releasing operation of resource together with " resource recovery controller ", as with this request deletion from formation, carry out performance inventory etc.
Graded queues unit: the formation of classifying according to user class.
When a plurality of requests arrive simultaneously, need rank and transmit them.May there be a plurality of priority classifications, so just need a more than formation.The stand-by period of request in formation is queue delay.Congested for what prevent to occur, scheduler can be scheduled in the time of must be enough succinctly with convenient request comes fast.In addition, scheduler also needs to provide fairness.
From to the research of operating system to network bandwidth allocation, all be unable to do without scheduling.Therefore to the research comparative maturity of scheduler algorithms, below be several the most frequently used, relative efficient scheduling algorithm.
(1) First Come First Serve (FCFS): classification is not distinguished, and does not have speed yet and postpone to guarantee.Adopt fifo queue.
(2) Priority Scheduling is based on the scheduling of priority: the one's own formation of each classification of service, the high priority classification has precedence over the low priority classification and handles.Cause low priority hungry to death easily, unfairness.
(3) Weighted Fair Queueing (WFQ): based on the Fair Queue of weight.Do not resemble priority scheduling, phenomenon hungry to death can not take place because each formation is assigned a weight.Comprise two kinds: i)
Per-flow queueing, and (ii)
Weighted round-robin Scheduling..
(4) Weighted Round-Robin (WRR):, be a special case of said method based on the championship of weight.For each classification (formation), safeguard one " urgency counter ", based on " uergency counter ", we carry out the tournament algorithm based on weight in a plurality of classification.
(5) Earlist Deadline First: each asks a designated deadline.This time limit be the time of advent and delay and.
Scheduler of the present invention adopts the execution sequence of each the classification request of tournament algorithm (being called for short WRR) decision based on weight, thereby makes the stand-by period difference of the request in the different queue, and then embodies the service classification.
Basic thought based on the tournament algorithm of weight is:
(1) each request has a weights W c, and i calculates the weight and the Wk=∑ Wc of this request place formation, i, and later calculating all is based on Wk.
(2) calculate the weight and the W=∑ Wk of all formations
(3) each formation safeguards that a class heavily is worth Uc, and its initial value is Wk, decides according to the value of Uc and how to dispatch.
(4) at first select the formation request of Uc maximum to carry out, when being finished, the heavy Uc=Wk-W of its class.Simultaneously its class of all formations (comprising that formation of just having dispatched) is reset to: Uc=Uc+Wk
When (5) dispatching, select weight Wc from one or more values of Uc>=0, that formation request of i maximum is carried out next time, and purpose is to the high Request Priority scheduling power of weight.Continue to carry out with (4).
(6) a large amount of result of the tests show: this method has embodied a kind of fairness, the weight of the ratio of each formation request number and each classification and in direct ratio in a period of time.
The resource optimization device is as outer feedback cycle, and the periodic server resource of adjusting classification weight and inner level distributes.So-called resource just is meant the maximum throughput of system here, and just maximum processing capability can be regarded maximum concurrent number of threads in realization as.The purpose of resource optimization device is exactly when the system load dynamic change, can the dynamic allocation system resource.The resource optimization device has been introduced the objective optimization function U and has been measured the contribution of each classification to system's importance, thereby carry out resource allocation, be about to maximum thread resource allocation and classify, make finally system resource reach maximum and utilize that its result is as the weight of scheduler schedules to each.
The objective optimization function U influences resource allocation to the capabilities map to of a Web service request concrete data by changing the U function.
Be formulated and be exactly:
Ω=∑(U(wc)) (1)
Wherein subscript c representative classification, Tc represents to consult the object time, and tc represents predicated response time next stage, μ
cExpression service execution speed, α, β are coordination parameters.
The U function has been portrayed server preferably and has been responded the contribution of each class service request to overall system availability (contract is satisfied in assurance), is exactly best performance point to the maximum after the U function summation of each classification.
The maximum of Ω is the target of pursuing.
uc=1/ tc+ λc/ wc (3)
Constraint is arranged simultaneously: w=∑ wc, wc>=1 and be integer (5)
For the theoretical foundation of (3) from three hypothesis:
At first t=t formation stand-by period+t time of implementation, suppose t formation stand-by period=n * t time of implementation, so just have t=(λ * t/w+1)/u
Second hypothesis: suppose that the service execution time is constant.Be that u equates.
The 3rd hypothesis is exactly: arrival rate is constant, and promptly l a m b d a is constant.
By (1), (2), (3), (4), how (5) try to achieve the Wc of distribution, make the Ω maximum? clearly, for a plurality of classification, it is impossible directly finding the solution.Therefore, we are converted to and find the solution dynamic programming problems and find the solution.
By (3),
So, thinking is as follows:
(note: require Wc now, 1<=wc<=W for first classification, obtains the U value when distributing wc weight respectively, is kept at A[1] and [n] (0=<n<=w-1)
We ask the weight of preceding two classification and are the Wc (maximum of U during 1<=wc<=W) so now.
Distribute Wi (1<=i<=wc) for one of them, another one is assigned as Wj (wj=Wc-Wi) so, substitution (6), and we can obtain Ui and Uj (2), can obtain Max (Ui+Uc-i) like this, deposit A[2 in the array in] [Wc-1]=Max (Ui+Uc-i)
In like manner, we can get A[k-2] value.
At last, when calculating last classification K, utilize the value of front K-1 classification.
That is U (Wc)+A[K-1 ,] [W-Wc]=U (1<=Wc<=W), calculate the maximum of U, the Wc that can distribute, the value that last classification just distributes.Then, recursion can obtain the weights that each classification distributes forward.)
As shown in Figure 4, the method for utilizing above-mentioned Web service prioritized QoS treatment system that the Web service prioritized QoS is handled:
1, receives the Web service request that the user sends according to http protocol;
The SOAP packet parsing unit of control section receives the soap message request when 2, moving, and soap message is resolved, and obtains information such as Service name, operation name; Simultaneously, the authentication unit carries out authentication to the user, obtains subscriber identity information;
3, according to subscriber identity information, retrieval is consulted library and is obtained the grade of service that the active user subscribes to;
4, after the acquisition grade of service, request controller judges according to the situation of each priority query in the queue management device whether current queue is full, if exceed the disposal ability of server, will abandon this request, otherwise is inserted in this queue management device;
5, the utilization of request scheduling device is selected request based on what the tournament algorithm of weight did not stop from queue management device;
6, carry out calling of Web service.
Resource optimization device and Network Performance Monitor are as the significant components of skin circulation: the resource optimization device utilizes the U function to carry out the optimized distribution of resource, and allocation result is fed back in the WRR dispatching algorithm, as the weight of scheduling; Network Performance Monitor obtains the runnability data in last cycle at set intervals at interval from queue management device, as average response time, request quantity etc., and utilize graph tool dynamically to show and refresh, and can judge with this whether service breaks a contract.
We utilize above-mentioned Web service QoS processor to develop the service QoS processor for Joint Production power (UP).The main function of Joint Production power (UP) is to provide various software services (as the office automation system, mailing system is paid information service etc.) for medium-sized and small enterprises.Joint Production power center provides an information integration and exhibition platform, and these information and data come from each local productivity center.The data at each local productivity center are packed by Web Service, are deployed in the Web Service operation platform.
Before increasing service quality control, the user is when the local productivity data of visit, and platform can not provide any type of differentiation, and the response time that VIP user can occur exceeds the situation of domestic consumer, and this is very inequitable to VIP user.On the other hand, when number of users is a lot of, can cause the overload of system, even make system's machine of delaying, have a strong impact on performance.Therefore the application demand of hierarchical QoS has been proposed.
Increase the hierarchical QoS support at the local productivity of UP center, not only, also controlled load, improved the performance of system greatly for different priority users provides discrepant service.
The Web service QoS processor that is based upon Joint Production power center provides the different stage service method as follows to different priority users:
The first step, the QoS preliminary treatment receives the SOAP request, carry out the parsing of message, the extraction of active user's identity by the chain type processing node, request object is passed to " consulting the request classification " by message context, obtain the grade of service that the user consults, and be inserted in the formation of queue management device corresponding priority level this request and obstruction according to consulting grade;
In second step, the request scheduling device is selected request according to certain dispatching algorithm from formation, and the request thread that wakes obstruction up calls Web Service and return results.After arriving " request control " node, carry out some performance data records, whenever time-optimized all after date, refresh the result in the mode of graphical interfaces.
In the 3rd step, optimizer is optimized at set intervals, recomputates the resource that next stage need distribute, with the weight of resource allocation result as scheduler schedules.