CN102780753B - A kind of service recovery method based on constraint rule - Google Patents

A kind of service recovery method based on constraint rule Download PDF

Info

Publication number
CN102780753B
CN102780753B CN201110349574.6A CN201110349574A CN102780753B CN 102780753 B CN102780753 B CN 102780753B CN 201110349574 A CN201110349574 A CN 201110349574A CN 102780753 B CN102780753 B CN 102780753B
Authority
CN
China
Prior art keywords
service
turn
abnormal
compensation
constraint
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201110349574.6A
Other languages
Chinese (zh)
Other versions
CN102780753A (en
Inventor
曹玖新
罗军舟
杨婧
刘波
东方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southeast University
Original Assignee
Southeast University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Southeast University filed Critical Southeast University
Priority to CN201110349574.6A priority Critical patent/CN102780753B/en
Publication of CN102780753A publication Critical patent/CN102780753A/en
Application granted granted Critical
Publication of CN102780753B publication Critical patent/CN102780753B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to field of service calculation, particularly relate to a kind of service recovery method based on constraint rule.Be captured to when abnormal in business transaction, first by determining rational recovery policy to the assessment of constraint rule, forward direction recovered to combine with backward recovery, and adds the step with user interactions, making user participate in the recovery process of business transaction; Secondly in order to make full use of service real time status information during abnormal appearance, the present invention gives chapter and verse abnormal attribute constraint and context to the sorting technique of business transaction exception, according to classification to determine to recover starting point; The present invention proposes the concept of compensating for path, and selects feasible compensating for path example according to the precondition and context compensating service; Last the present invention utilizes the responsive weights of user to different expense to select optimum compensating for path example.Experimental analysis shows to utilize constraint rule to improve success rate and the efficiency of recovery policy.

Description

A kind of service recovery method based on constraint rule
Technical field
The present invention relates to field of service calculation, particularly based on the abnormal restoring mechanism of the business transaction of constraint rule.
Background technology
Along with the development of information technology, Web service is used for miscellaneous service by enterprise more and more and applies, and getting up to form composite services according to certain path combination by multiple Web service, is the principal mode realizing operation flow with Web service.In service compute, the Web service that business transaction is provided by multiple enterprise forms, and therefore business transaction is deployed in the environment of loose coupling, isomery and autonomy.Business transaction recovers to be solve a kind of important method that operation flow implementation is abnormal, ensure operation flow transaction attributes and successful execution.
Existing service recovery method is mainly divided into following two classes:
1. forward direction recovers: solve exception by certain mode, for business transaction continues to perform according to flow process, finally makes business transaction complete set objective.
2. to recovery after: due to factors such as the change of business transaction target, the unreachable of target or constraints cannot be satisfied, compensated business transaction by certain mode [16], the impact that the part that " erasing " business transaction has performed causes.
Above method Shortcomings.Pure forward direction recovers infeasible often, because in many cases, the forward direction such as retry, replacement restoration methods can not make abnormal recovery.The alternative service etc. occurring abnormal Web service can be replaced as can not find.Pure backward recovery lacks the performance of business transaction and the consideration of efficiency.When last subtransaction occurs abnormal, then whole affairs must be compensated.The impact that this not only allows many subtransactions submitted to produce by " rollback ", and is the significant wastage to resource, does not also complete set objective simultaneously.In addition, the recovery policy formulated according to functional attributes and the nonfunctional space of service of existing Restoration Mechanism likely with other property contradictories of exception and cause inapplicable.And existing Restoration Mechanism lacks real-time.Existing Restoration Mechanism great majority have ignored the real-time status for business transaction exception, and the information that the recovery policy formulated relies on may can not reflect abnormal current state, causes inapplicable.
Summary of the invention
Technical problem: service recovery problem ensures the transaction attributes of business transaction, the key issue of raising business transaction service quality, the present invention is based on the Restoration Mechanism that constraint rule is determined for specific exceptions, overcome the fixing reforestation practices of conventional method, do not consider service logic, recovery policy and abnormal when occurring the state of business transaction the shortcoming such as not mate.The present invention proposes a kind of business transaction method based on constraint rule, utilizes the service logic of constraint rule to business transaction to represent, when an anomaly occurs, formulates recovery policy by the assessment result of related constraint rule; Utilize context to classify to abnormal simultaneously, determine to recover starting point according to classification, omit insignificant recovering step; When needs compensate business transaction, by context and user, optimal compensation strategy is selected to the sensitivity of various expense.
Technical scheme: a kind of service recovery method based on constraint rule, there is abnormal e in the service s in certain territory in business transaction, after this is extremely captured, utilizes constraint rule to formulate through following steps and carry out service recovery:
(1) assess completing property constraints (ICCC) corresponding to s, if assessment result is true, then represent that this can be left in the basket extremely, business transaction continues to perform, and forwards to; Forward to (2) if assessment result is false;
(2) based on context the abnormal attribute constraint of attribute information and service s is classified to abnormal e, determines to recover starting point according to classification: retry (turn (3)), replace service (turning (4)), with user interactions (turning (5)) or compensates (turn (6));
(3) if service s is atomic service, and be less than the maximum reattempt times MaxinumRetryTimes set by this service to the number of retries RetryTimes of this service, then re invocation service s; If retry success, then business transaction continues to perform; Otherwise turn (4);
(4) if the alternative services set S of presence service s, then therefrom select one and serve s ' as an alternative; First compensate service s, cancel the impact that it causes, then call service s ', and s ' is removed from S; If the alternative services set S of service s is empty, then turn (5).If s ' runs succeeded, then business transaction continues to perform; Otherwise turn (5);
(5) if service s is set to and user interactions service, then offer suggestions to user.This suggestion comprises and occurs that abnormal service s has identity function attribute and nonfunctional space, but has exceeded the service of the tolerance interval that user proposes when business transaction performs.If user selects one of them service or abandons this exception service, then the CCC about this territory in higher one-level territory is assessed.If CCC does not meet, then illustrate that this territory needs to be compensated, the territory UnatomicException that dishes out to higher one-level territory is abnormal, and waits for the compensation order from coordinator in more the advanced field, and turn (6), then business transaction continues to perform; If CCC meets, directly turn (5), and assessed (using optimistic expectation strategy under default situations) ICCC by optimistic expectation strategy in the process, then business transaction continues to perform.If user does not accept suggestion, then turn (5);
(6), after receiving the compensation order from coordinator in more the advanced field, enter into and process is compensated to this territory.
Based on context the abnormal attribute constraint of attribute information and service s is classified to abnormal e; Determine that the concrete grammar recovering starting point is as follows according to classification:
(1) establish for serving the abnormal attribute constraint set of s, recovery starting point StartOfRecovry is initialized as sky; If Exception Type t ∈ < δ is a, δ b, ρ a, ρ b, ω a, ω b, μ >, element wherein represents the temporary transient unavailable abnormal attribute constraint of the network equipment, the permanent unavailable abnormal attribute constraint of the network equipment, the constraint of alternative physics abnormal attribute, the constraint of irreplaceable physics abnormal attribute, the constraint of service restriction abnormal attribute, the constraint of service describing abnormal attribute and the constraint of user's abnormal attribute according to the order of sequence respectively; For in correspond respectively to seven kinds of exceptions above seven kinds of abnormal attributes constraints according to the order of sequence its assignment is given and represent what a certain concrete abnormal attribute retrained carry out (2) operation to (12) step;
(2) π is initialized as the context type corresponding to type vector, turn (3);
(3) one are labeled as a predicate or operation.Initialization predicate stack predicateStack is empty, and operand stack operaterStack is empty, and current markers curToken is empty, and assessment result result is initialized as true;
(4) obtain next mark, assignment is to curToken.If curToken is not sky, turn (5), otherwise turn (9);
(5) if curToken is predicate, turn (6), otherwise operaterStack is stacked by curToken;
(6) if this predicate is " & & ", turn (7), otherwise predicateStack is stacked by curToken;
(7) operaterStack pops, and predicateStack stack top element assignment is to topPredicate.Assess topPredicate according to π, if topPredicate does not meet, then predicateStack incites somebody to action " false " stacked; Otherwise predicateStack is stacked by curToken;
(8) turn (4);
(9) if predictStack non-NULL, then turn (10);
(10) predicateStack stack top element assignment is popped to topPredicate, predicateStack.According to π, topPredicate is assessed, if topPredicate is satisfied, then turn (12);
(11) by false assignment to result;
(12) abnormal attribute constraint assessment terminates.If result is true, by t assignment be then corresponding Exception Type, turns (13), otherwise turns (1);
(14) if t is ∈, { StartOfRecovery assignment is then RETRY by δ a, ρ a, ω a}, if otherwise t ∈ { StartOfRecovery assignment is then REPLACE by ρ b, ω a, ω b}, if otherwise t ∈ { δ b, μ }, be then INTERACTORCOMPENSATE by StartOfRecovery assignment.RETRY represents retry, REPLACE represents alternative service, INTERACTORCOMPENSATE represents and user interactions or compensation.
The compensation method in territory is as follows:
(1) set SS as the set of service completed in territory and performing, cSS is a copy of SS, needs the service compS compensated to be initialized as sky;
(2) if cSS is empty, turn (7);
(3) obtain the compensation the ignored constraints set rs of service s, turn (4);
(4) to each compensation the ignored constraints ic in rs, if ic is satisfied, then carry out record, then continue to judge next ic;
(5) tempSS is initialized as and compensates the relevant set of service in cSS but not in compS of constraints ic to can ignore, and added compS, tempSS is removed from cSS;
(6) to each service ts in tempSS, the operation of (2) to (5) is carried out;
(7) to each service css in cSS, obtain it and can ignore compensation constraints set rs, turn (8);
(8) constraints r is compensated to each the ignoring in rs, if r is satisfied, turn (9); Otherwise css is joined in set compS, turn (6);
(9) according to the logic rules LR in territory, the service in compS is compensated.
Based on context the concrete grammar be optimized compensation process is as follows:
(1) the compensating for path instantiation set Ψ that initialization exception context mates is empty set;
(2) P is established 1, P 2..., P n-1, P npossible compensating for path, for each paths P wherein i, below execution, (3) arrive the operation of (6).
(3) for P ieach instantiation perform the operation of (4) to (6);
(4) initialization Completed is true, right in each specifically compensate service C k, perform the operation in (5);
(5) based on context attribute to C kprerequisite assess, if it is not satisfied, then putting Completed is false, turns (3);
Here defining a prerequisite specifically compensating service C is:
Requirement C=(p 1,rel,v 1)op(p 2,rel,v 2)op…op(p n-1,rel,v n-1)
Wherein rel ∈ <gt, lt, eq, ne>, op ∈ < & &, ‖ >.Gt, lt, eq, ne represent the property value restriction relation being greater than, being less than, equaling, be not equal to respectively, and & & and ‖ be presentation logic and the logical relation with logic OR respectively;
(6) if Completed is true, then will join in compensating for path instantiation set Ψ;
(7) initialization compensating for path instantiation minimal-overhead value MinimumCost is infinitely great, and initialization optimal compensation path examples Instance is empty;
(8) for each the compensating for path example I in Ψ p, perform the operation of (9);
(9) basis calculate its overhead value;
User can weigh with weights the sensitivity of dissimilar expense, weights large expression user is comparatively responsive to corresponding expense, the sensitivity of weights little expression user to corresponding expense is lower, and the expense therefore for the instantiation I of compensating for path P can be expressed as:
Cost P , I P = &Sigma; t &Element; T Cost P , I P , t &times; w t
Wherein T is the set of overhead type; The sensitivity value of wt to be user to type the be expense of t; here VC, t are the concrete types compensating service C is the expense of t, X be due to service between the overhead value deducted of interaction and needing, Y be due to service between the overhead value that increases of interaction and needing;
If then will assignment is IP to MinimumCost, Instance assignment.
Beneficial effect: in existing business transaction Restoration Mechanism, pure forward direction recovers infeasible often, and pure backward recovery lacks the performance of business transaction and the consideration of efficiency., in addition, the recovery policy formulated according to functional attributes and the nonfunctional space of service of existing Restoration Mechanism likely with other property contradictories of exception and cause inapplicable.And existing Restoration Mechanism great majority have ignored the real-time status for business transaction exception, and the information that the recovery policy formulated relies on may can not reflect abnormal current state, causes inapplicable.For Existing methods Problems existing, we have proposed the business transaction Restoration Mechanism of the context aware based on tied mechanism.Advantage of the present invention is: (1) if corresponding constraints is satisfied, then extremely can be left in the basket, have skipped unnecessary recovery process, saved resource, time, also can meet the demand of business transaction simultaneously; (2) classify to abnormal, the recovery policy starting point different according to the dissimilar selection of exception, makes recovery operation shoot the arrow at the target, more rationally; (3) enable user participate in the process of abnormal restoring according to the demand of self with the process of user interactions, the expectation strategy of the optimism adopted therebetween eliminates unnecessary compensation service; (4) determine the compensation order of serving according to logic rules, not only reduce the service needing to compensate, and compensation order is more reasonable, compensation efficiency is also higher; (5) select the instantiation in optimal compensation path according to the expense of feasible compensating for path instantiation and the tendency degree of user to various expense, make the abnormal restoring process of business transaction determine to be more suitable for the recovery policy of situation at that time according to context during exception.
Accompanying drawing explanation
Fig. 1: various abnormal recovery starting point schematic diagram.
Fig. 2: business transaction recovers flow chart.
Embodiment
Method of the present invention further describe into:
Business transaction has the hierarchical structure of iteration.A business transaction multiple territories composition again, territory occurs with the form of composite services usually, certain sub-function module of finishing service affairs, may have one or more subdomain in a territory.Usually, a territory in business transaction is managed participant by its coordinator, carrys out a certain specific task in finishing service affairs.A participant is an ISP or service consumer (user), but is usually conceptualized as a Web service (atomic service or territory).Coordinator is the participant of special shape, and carry out alternately with the person of participating in directly in territory belonging to it, namely coordinator is not mutual with the participant in its subdomain.
Constraint rule is defined as follows:
A business transaction is made up of territory (generally existing with the form of composite services), may comprise less subdomain or atomic service in each territory.Each service has himself specific function, and as the part of business transaction, also also exists and influence each other and contact between service; These contacts and the demand of user and the policy of ISP are the important component parts of business transaction service logic.Service logic can describe with constraint rule.Constraint rule is divided into two types by us: constraints and logic rules.When losing efficacy or extremely occur, constraint rule can be utilized generate more appropriate recovery policy.
1. constraints
Constraints is the foundation whether certain service judged in certain business transaction example logically completes.The definition of correctness
(1) completing property constraints (CCC)
Completing property constraints is the basis for estimation to the whether successful execution of the service in business transaction.When a service failure, assess the completing property constraints corresponding to it, if met, then this inefficacy is considered to insignificant.Because business transaction is Users ' Need-oriented, the inefficacy of wherein certain service might not cause the inefficacy of whole business transaction.
(2) compensation constraints (ICCC) can be ignored
In the process compensated, if certain compensation ignored constraints compensating service is satisfied, then this compensation service need not be performed.Due to compensate in compensation process service have its specific semantic and it and other serve between restriction relation, if constraint satisfaction, some compensation service can be left in the basket and not perform.
2. logic rules
Logic rules are the descriptions to the execution sequence compensating service, namely represent the order between the service of compensation or executed in parallel relation.Under normal circumstances, a service has the compensation service corresponding with it, and the impact that the successful execution of former service causes can partially or fully be cancelled by the execution compensating service.Although the service that generally compensates has contrary function compared with former service, if it is not necessarily reasonable also not necessarily efficient to perform with the backward of former service execution order the service of compensation.
Business transaction is actually composite services.In the process of Services Composition, Web service is arranged to the some positions in flow process according to its function.The execution sequence employing compensating service might not be desirable with the antipodal method of former service execution order.Therefore in the process of Services Composition, design the logic rules of business transaction, in order to using in its recovery process simultaneously.
Logic rules represent the execution sequence of the service of compensation.Can specify in the <compensationHandler> label of BPEL the compensating operation of business transaction.<sequence>, <flow> in BPEL are order, parallel two kinds of execution relations provide support.
It is as follows that business transaction of the present invention recovers concrete steps:
(1) assess completing property constraints (ICCC) corresponding to s, if assessment result is true, then represent that this can be left in the basket extremely, business transaction continues to perform, and forwards to; Forward to (2) if assessment result is false;
(2) based on context the abnormal attribute constraint of attribute information and service s is classified to abnormal e, determines to recover starting point according to classification: retry (turn (3)), replace service (turning (4)), with user interactions (turning (5)) or compensates (turn (6));
(3) if service s is atomic service, and be less than the maximum reattempt times MaxinumRetryTimes set by this service to the number of retries RetryTimes of this service, then re invocation service s.If retry success, then business transaction continues to perform; Otherwise turn (4);
(4) serve according to the specific semanteme and it and other that compensate service between restriction relation, if the alternative services set S of presence service s, then therefrom select one and serve s ' as an alternative.First compensate service s, cancel the impact that it causes, then call service s ', and s ' is removed from S; If the alternative services set S of service s is empty, then turn (5).If s ' runs succeeded, then business transaction continues to perform; Otherwise turn (5); The classification of abnormal e and the corresponding relation of Restoration Mechanism are as shown in Figure 1.
(5) if service s is set to and user interactions service, then offer suggestions to user.This suggestion comprises and occurs that abnormal service s has identity function attribute and nonfunctional space, but has exceeded the service of the tolerance interval that user proposes when business transaction performs.If user selects one of them service or abandons this exception service, then the CCC about this territory in higher one-level territory is assessed.If CCC does not meet, then illustrate that this territory needs to be compensated, the territory UnatomicException that dishes out to higher one-level territory is abnormal, and waits for the compensation order from coordinator in more the advanced field, and turn (6), then business transaction continues to perform; If CCC meets, directly turn (6), and assessed (not using optimistic expectation strategy under default situations) ICCC by optimistic expectation strategy in the process, then business transaction continues to perform.If user does not accept suggestion, then turn (6).
(6), after receiving the compensation order from coordinator in more the advanced field, on the basis that the ICCC of executed service assesses in this territory, this territory is compensated.
Wherein, context is any information that can be used for portraying entity situation.Entity can be that in user and application program reciprocal process, any relevant people, position or object, also include user and application program self.Context involved in business transaction is divided into four classes: (1) computational resource context: as network connectivty, communication overhead, bandwidth, neighbouring resource category and state thereof etc.; (2) physically hereafter: as noise grade, traffic conditions, temperature etc.; (3) service context: serve the maximum instance number of permission, serve existing instance number, serve start and end time etc.; (4) user's context: as the people etc. of the basic document of user, geographical position, periphery.
Optimistic expectation strategy embodiment is as follows:
During with user interactions, first offer suggestions to user, comprise alternative information on services and inquiry user whether neglected discount service that failure service is provided to user.
If user accepts suggestion, then therefore completing property constraints can change, whether alternative service can cause compensating needs further assessment to this territory, this is by having the CCC about this territory to come in the higher one-level territory of assessment, if desired this territory is compensated, then the coordinator in this territory dishes out to higher one-level territory " UnatomicException ", and wait for the compensation order sent from the coordinator in high one-level territory; Carrying out the compensation in territory if do not need, only in territory, service being compensated by carrying out assessment to the ICCC in territory, under these circumstances, compensate and only carry out in the abnormal territory occurred, coordinator does not dish out to last layer coordinator " UnatomicException ", because alternative service does not represent this territory occurred exception.
When assessing the compensation the ignored constraints of service a before compensation, the compensation the ignored constraints that service a is corresponding may relate to the multiple services except a, and some in these services may also not be called.Under these circumstances, we for these also not invoked service take optimistic expectation, the involved compensation ignored constraints assessment result is true.This is because occur that the territory of failure service can be merely re-executed at once, compensation now be only used to by the service be replaced impact the inconsistency caused and eliminate.The assessment strategy of this optimism makes to compensate that constraints does not meet and the service that must compensate is less because can ignore.After the compensation, must be re-executed by the service compensated, be performed to make alternative service.
As shown in Figure 2, based on context the abnormal attribute constraint of attribute information and service s is classified to abnormal e, determines that the concrete grammar recovering starting point is as follows according to classification:
(1) establish for serving the abnormal attribute constraint set of s, recovery starting point StartOfRecovry is initialized as sky.If Exception Type t ∈ < δ is a, δ b, ρ a, ρ b, ω a, ω b, μ >, element wherein represents the temporary transient unavailable abnormal attribute constraint of the network equipment, the permanent unavailable abnormal attribute constraint of the network equipment, the constraint of alternative physics abnormal attribute, the constraint of irreplaceable physics abnormal attribute, the constraint of service restriction abnormal attribute, the constraint of service describing abnormal attribute and the constraint of user's abnormal attribute according to the order of sequence respectively.For in correspond respectively to seven kinds of exceptions above seven kinds of abnormal attributes constraints according to the order of sequence its assignment is given carry out (2) operation to (12) step.
(2) π is initialized as the context type corresponding to type vector, turn (3).
(3) one is established to be labeled as a predicate or operation.Initialization predicate stack predicateStack is empty, and operand stack operaterStack is empty, and current markers curToken is empty, and assessment result result is initialized as true.
(4) obtain next mark, assignment is to curToken.If curToken is not sky, turn (5), otherwise turn (9).
(5) if curToken is predicate, turn (6), otherwise operaterStack is stacked by curToken.
(6) if this predicate is " & & ", turn (7), otherwise predicateStack is stacked by curToken.
(7) operaterStack pops, and predicateStack stack top element assignment is to topPredicate.Assess topPredicate according to π, if topPredicate does not meet, then predicateStack incites somebody to action " false " stacked; Otherwise predicateStack is stacked by curToken.
(8) turn (4)
(9) if predictStack non-NULL, then turn (10).
(10) predicateStack stack top element assignment is popped to topPredicate, predicateStack.
According to π, topPredicate is assessed, if topPredicate is satisfied, then turn (12).
(11) by false assignment to result.
(12) abnormal attribute constraint assessment terminates.If result is true, by t assignment be then corresponding Exception Type, turns (13), otherwise turns (1).
(13) if t is ∈, { StartOfRecovery assignment is then RETRY by δ a, ρ a, ω a}, if otherwise t ∈ { StartOfRecovery assignment is then REPLACE by ρ b, ω a, ω b}, if otherwise t ∈ { δ b, μ }, be then INTERACTORCOMPENSATE by StartOfRecovery assignment.RETRY represents retry, REPLACE represents alternative service, INTERACTORCOMPENSATE represents and user interactions or compensation.
The compensation method in territory is as follows:
(1) set SS as the set of service completed in territory and performing, cSS is a copy of SS, needs the service compS compensated to be initialized as sky.
(2) if cSS is empty, turn (8).
(3) obtain the compensation the ignored constraints set rs of service s, turn (4).
(4) to each compensation the ignored constraints ic in rs.
(5) if ic is satisfied, turn (4), otherwise turn (6).
(6) tempSS is initialized as the set of service among cSSs but not among compSs relevant to ic, and is added compS, tempSS is removed from cSS.
(7) to each ts in tempSS, the operation of (2) to (6) is carried out.
(8) to each service css in cSS, obtain it and can ignore compensation constraints set rs, turn (9).
(9) constraints r is compensated to each the ignoring in rs, if r is satisfied, turn (9), otherwise css is joined in set compS, turn (7).
(10) according to the logic rules LR in territory, the service in compS is compensated.
A territory is compensated, object is to make territory return to some states by performing compensation service, and meet certain constraints, obtain certain consistency, in the process terminated to compensation from compensating, need to compensate several atomic service and territory, we claim the process compensated an atomic service or territory to be a compensation process.For a compensation process, have and compensate starting point and and Compensation Objectives.Compensating an atomic service or territory is exactly process from the compensation starting point of its correspondence to Compensation Objectives; Compensating a business transaction is exactly the implementation of some compensation process wherein.
An atomic service is compensated, needs " compensating service " of performing its correspondence.The object of the execution of " compensate for service " cancels the impact that former service execution causes, and the service that can reach this object unnecessary be an atomic service.The operation that completes of the service of compensation and former service are compared may be more complicated or have more demands, therefore multiple service may be needed to have got up to the compensation of this atomic service according to certain path combination, namely not necessarily atomic service is served in the compensation of an atomic service, and may be composite services.In like manner the compensation in a territory is also not necessarily needed to the atomic service of as much, and only an atomic service just may can meet its compensation demand.
In order to reach the Compensation Objectives of certain compensation process, certain compensation task must be completed, and completing of these compensation task must be realized by concrete compensation service.Compensation task is the sub-step from the compensation starting point of certain compensation process to its Compensation Objectives, each compensation task has its corresponding sub-goal, the process completing certain compensation process is exactly arrive each sub-goal by compensation task successively from compensation starting point, the process of final arrival Compensation Objectives, we become compensating for path this process.From compensation starting point to Compensation Objectives, may there are many compensating for path, the compensation task on every paths is different, and the quantity of compensation task is also likely different, but all compensating for path all end at Compensation Objectives from abnormality.The realization of compensation task depends on and specifically compensates service, but the concrete compensation service more than usually of some compensation task can be realized, because reaching of sub-goal can be represented by some qualitative or quantitative mark, but the mode that the mark making these qualitative or quantitative is satisfied can be various.We are shown as an abstract compensation service the possible concrete compensation agent list corresponding to some compensation task.
Defining a prerequisite specifically compensating service C is:
Requirement C=(p 1,rel,v 1)op(p 2,rel,v 2)op…op(p n-1,rel,v n-1)
Wherein rel ∈ <gt, lt, eq, ne>, op ∈ < & &, ‖ >.It meets decision method see (3) in claim 3 to (11) step.
Article one, compensating for path there is one or more abstract compensation service, become after these services are instantiated and specifically compensate service, article one, the instantiation of compensating for path refers to all abstract instantiation compensating service that it comprises, and namely all abstract compensation services are all bound to concrete service.Each execution specifically compensating service needs certain expense.For user, be different to the sensitivity of these expenses.
It is that the expense of t can represent as follows that compensating for path P corresponds to the type of instantiation I:
Cost P , I , t = &Sigma; C in P V C , t - X + Y
Wherein V c,tbe the concrete type compensating service C be the expense of t, X be due to service between the overhead value deducted of interaction and needing, Y be due to service between the overhead value that increases of interaction and needing.
Expense for the instantiation I of compensating for path P can be expressed as:
Cost P , I = &Sigma; t &Element; T Cost P , I , t &times; w t
Wherein T represents the set of all overhead type, w tthe sensitivity weights of the expense of t that to be user to type be.
Based on context the concrete grammar be optimized compensation process is as follows:
(1) the compensating for path instantiation set Ψ that initialization exception context mates is empty set.
(2) P1 is established, P2 ..., Pn-1, Pn are possible compensating for path, for each paths Pi wherein, perform the operation of (3) to (6).
(3) for each instantiation of Pi perform the operation of (4) to (6).
(4) initialization Completed is true, right in each specifically compensate service C k, perform the operation in (5).
(5) based on context attribute to C kprerequisite assess, if it is not satisfied, then putting Completed is false, turns (3).
(6) if Completed is true, then will join in Ψ.
(7) initialization compensating for path instantiation minimal-overhead value MinimumCost is infinitely great, and initialization optimal compensation path examples Instance is empty.
(8) for each the compensating for path example I in Ψ p, perform the operation of (9).
(9) basis calculate its overhead value, wherein T is the set of overhead type, w tit for user is the sensitivity value of the expense of t to type.If then will assignment is I to MinimumCost, Instance assignment p.
1. in the process of Services Composition, according to service logic and user's request, the classifying rationally in territory is carried out to business transaction, and formulate the constraints corresponding to each specific service in the logic rules in each territory and territory.
2. each service s in pair business transaction, formulates seven kinds of abnormal attribute constraints that it corresponds to wherein Exception Type correspond respectively to the temporary transient unavailable abnormal attribute constraint of the network equipment, the permanent unavailable abnormal attribute constraint of the network equipment, the constraint of alternative physics abnormal attribute, the constraint of irreplaceable physics abnormal attribute, the constraint of service restriction abnormal attribute, the constraint of service describing abnormal attribute and the constraint of user's abnormal attribute.The about intrafascicular involved contextual information of abnormal attribute of the service in business transaction is obtained by transducer or software etc., and provides related data in real time when needed.
3. start the execution of business transaction, and the participant coordinated in territory by the coordinator in each territory carries out alternately.The abnormal conditions of each service in coordinator's charge of overseeing territory, if certain service occurs abnormal, enter into the recovery process of business transaction.
First the integrity constraint of its correspondence is assessed when an exception is captured, if assessment result is true, ignore this extremely; Otherwise the abnormal attribute constraint corresponding to this service and contextual information are classified extremely to this, determine abnormal starting point according to classification.Carry out with user alternately if need in recovery process, then upgrade related constraint condition according to the feedback of user.If desired compensate certain territory in business transaction, then first assess the compensation the ignored constraints of executed service in territory, assessment result is that the service of false becomes service to be compensated, and to higher one-level territory throw exception; More higher leveled territory is according to the territory transmission compensation order of the compensation service execution order of the logic rules defined in territory to required compensation; After receiving the compensation order in higher one-level territory, prerequisite and contextual information according to compensating service draw feasible compensating for path example, again according to the responsive Weight selected optimal compensation strategy of user to different expense, implement to compensate according to optimal compensation strategy.

Claims (3)

1. based on a service recovery method for constraint rule, it is characterized in that: abnormal e appears in the service s in certain territory in business transaction, after this is extremely captured, utilizes constraint rule to formulate through following steps and carry out service recovery:
(1.1) assess completing property constraints (CCC) corresponding to s, if assessment result is true, then represent that this can be left in the basket extremely, business transaction continues to perform, and forwards to (1.2) if assessment result is false;
(1.2) based on context the abnormal attribute constraint of attribute information and service s is classified to abnormal e, determines to recover starting point according to classification: namely retry turns (1.3), namely the service of replacement turns (1.4), namely turns (1.5) or compensate namely turn (1.6) with user interactions;
(1.3) if service s is atomic service, and be less than the maximum reattempt times MaxinumRetryTimes set by this service to the number of retries RetryTimes of this service, then re invocation service s; If retry success, then business transaction continues to perform; Otherwise turn (1.4);
(1.4) if the alternative services set S of presence service s, then therefrom select one and serve s ' as an alternative; First compensate service s, cancel the impact that it causes, then call service s ', and s ' is removed from S; If the alternative services set S of service s is empty, then turn (1.5); If s ' runs succeeded, then business transaction continues to perform; Otherwise turn (1.5);
(1.5) if service s is set to and user interactions service, then offer suggestions to user, this suggestion comprises and occurs that abnormal service s has identity function attribute and nonfunctional space, but has exceeded the service of the tolerance interval that user proposes when business transaction performs; If user selects one of them service or abandons this exception service, then the CCC about this territory in higher one-level territory is assessed; If CCC does not meet, then illustrate that this territory needs to be compensated, the territory UnatomicException that dishes out to higher one-level territory is abnormal, and waits for the compensation order from coordinator in more the advanced field, and turn (1.6), then business transaction continues to perform; If CCC meets, directly enter into and compensate process to this territory, and assessed ignoring compensation constraints ICCC by optimistic expectation strategy in the process, then business transaction continues to perform; If user does not accept suggestion, then turn (1.6);
(1.6), after receiving the compensation order from coordinator in more the advanced field, enter into and process is compensated to this territory;
Wherein, based on context the abnormal attribute constraint of attribute information and service s is classified to abnormal e, determines that the concrete grammar recovering starting point is as follows according to classification:
(2.1) establish for serving the abnormal attribute constraint set of s, recovery starting point StartOfRecovery is initialized as sky; If Exception Type t ∈ < δ is a, δ b, ρ a, ρ b, ω a, ω b, μ >, element wherein represents the temporary transient unavailable abnormal attribute constraint of the network equipment, the permanent unavailable abnormal attribute constraint of the network equipment, the constraint of alternative physics abnormal attribute, the constraint of irreplaceable physics abnormal attribute, the constraint of service restriction abnormal attribute, the constraint of service describing abnormal attribute and the constraint of user's abnormal attribute according to the order of sequence respectively; For in correspond respectively to seven kinds of abnormal attributes constraint of seven kinds of exceptions above according to the order of sequence its assignment is given and represent what a certain concrete abnormal attribute retrained carry out (2.2) operation to (2.12) step;
(2.2) π is initialized as the context type corresponding to type vector, turn (2.3);
(2.3) one are labeled as a predicate or operation; Initialization predicate stack predicateStack is empty, and operand stack operaterStack is empty, and current markers curToken is empty, and assessment result result is initialized as true;
(2.4) obtain next mark, assignment is to curToken; If curToken is not sky, turn (2.5), otherwise turn (2.9);
(2.5) if curToken is predicate, turn (2.6), otherwise operaterStack is stacked by curToken;
(2.6) if this predicate is & &, turn (2.7), otherwise predicateStack is stacked by curToken;
(2.7) operaterStack pops, by predicateStack stack top element assignment to topPredicate; Assess topPredicate according to π, if topPredicate does not meet, then predicateStack is stacked by false; Otherwise predicateStack is stacked by curToken;
(2.8) turn (2.4);
(2.9) if predicateStack non-NULL, then turn (2.10);
(2.10) predicateStack stack top element assignment is popped to topPredicate, predicateStack; According to π, topPredicate is assessed, if topPredicate is satisfied, then turn (2.12);
(2.11) by false assignment to result;
(2.12) abnormal attribute constraint assessment terminates; If result is true, by t assignment be then corresponding Exception Type, turns (2.13), otherwise turns (2.1);
(2.13) if t is ∈ { δ a, ρ a, ω a}, be then RETRY by StartOfRecovery assignment, if otherwise t ∈ { ρ b, ω b}, be then REPLACE by StartOfRecovery assignment, if otherwise t ∈ { δ b, μ }, be then INTERACTORCOMPENSATE by StartOfRecovery assignment; RETRY represents retry, service is replaced in REPLACE representative, INTERACTORCOMPENSATE represents and user interactions or compensation.
2. a kind of service recovery method based on constraint rule according to claim 1, is characterized in that: the compensation method in territory is as follows:
(3.1) set SS as the set of service completed in territory and performing, cSS is a copy of SS, needs the service compS compensated to be initialized as sky;
(3.2) if cSS is empty, turn (3.7);
(3.3) obtain the compensation the ignored constraints set rs of service s, turn (3.4);
(3.4) to each compensation the ignored constraints ic in rs, if ic is satisfied, then carry out record, then continue to judge next ic; If ic does not meet, then turn (3.5);
(3.5) tempSS is initialized as and compensates the relevant set of service in cSS but not in compS of constraints ic to can ignore, and added compS, tempSS is removed from cSS;
(3.6) to each service ts in tempSS, the operation of (3.2) to (3.5) is carried out;
(3.7) to each service css in cSS, obtain it and can ignore compensation constraints set rs, turn (3.8);
(3.8) constraints r is compensated to each the ignoring in the compensation the ignored constraints set rs of service css, if r is satisfied, turn (3.9); Otherwise css is joined in set compS, turn (3.6);
(3.9) according to the logic rules LR in territory, the service in compS is compensated.
3. a kind of service recovery method based on constraint rule according to claim 2, is characterized in that: the concrete grammar be based on context optimized compensation process is as follows:
(4.1) the compensating for path instantiation set Ψ that initialization exception context mates is empty set;
(4.2) P is established 1, P 2..., P n-1, P npossible compensating for path, for each paths P wherein i, below execution, (4.3) arrive the operation of (4.6);
(4.3) for P ieach instantiation perform the operation of (4.4) to (4.6);
(4.4) initializing variable Completed is true, right in each specifically compensate service C k, perform the operation in (4.5);
(4.5) based on context attribute to C kprerequisite assess, if it is not satisfied, then putting variable Completed is false, turns (4.3);
Here defining a prerequisite specifically compensating service C is:
Requirement C=(p 1,rel,v 1)op(p 2,rel,v 2)op...op(p n-1,rel,v n-1)
Wherein rel ∈ <gt, lt, eq, ne>, op ∈ < & &, || >; Gt, lt, eq, ne represent the property value restriction relation being greater than, being less than, equaling, be not equal to respectively, & & and || respectively presentation logic with and the logical relation of logic OR;
(4.6) if variable Completed is true, then will join in compensating for path instantiation set Ψ;
(4.7) initialization compensating for path instantiation minimal-overhead value MinimumCost is infinitely great, and initialization optimal compensation path examples Instance is empty;
(4.8) for each the compensating for path example I in Ψ p, perform the operation of (4.9);
(4.9) basis Cost P , I P = &Sigma; t &prime; &Element; T Cost P , I P , t &prime; &times; w t &prime; Calculate its overhead value;
The sensitivity weights of user to dissimilar expense are weighed, and weights large expression user is comparatively responsive to corresponding expense, and the sensitivity of weights little expression user to corresponding expense is lower, therefore for the instantiation I of compensating for path P poverhead value can be expressed as:
Cost P , I P = &Sigma; t &prime; &Element; T Cost P , I P , t &prime; &times; w t &prime;
Wherein T is the set of overhead type; w t'it for user is the sensitivity value of the expense of t' to type; for the instantiation I of compensating for path P ptype be the overhead value of the expense of t';
Cost P , I P , t &prime; = &Sigma; CinP V C , t &prime; - X + Y ,
Here V c, t'the overhead value of the expense of t' that to be the concrete type compensating service C be, X be due to service between the overhead value deducted of interaction and needing, Y be due to service between the overhead value that increases of interaction and needing;
If then will assignment is I to MinimumCost, Instance assignment p.
CN201110349574.6A 2011-11-08 2011-11-08 A kind of service recovery method based on constraint rule Expired - Fee Related CN102780753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110349574.6A CN102780753B (en) 2011-11-08 2011-11-08 A kind of service recovery method based on constraint rule

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110349574.6A CN102780753B (en) 2011-11-08 2011-11-08 A kind of service recovery method based on constraint rule

Publications (2)

Publication Number Publication Date
CN102780753A CN102780753A (en) 2012-11-14
CN102780753B true CN102780753B (en) 2015-08-05

Family

ID=47125506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110349574.6A Expired - Fee Related CN102780753B (en) 2011-11-08 2011-11-08 A kind of service recovery method based on constraint rule

Country Status (1)

Country Link
CN (1) CN102780753B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880873B (en) * 2018-06-05 2021-09-07 中国农业银行股份有限公司 Transaction compensation method and device applied to heterogeneous system
CN109254840A (en) * 2018-08-28 2019-01-22 中国邮政储蓄银行股份有限公司 Business compensation method and device, system
CN109451037B (en) * 2018-12-05 2021-06-08 大连海事大学 Method for selecting error repair strategy in CWS fault tolerance problem

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043682A (en) * 2011-01-27 2011-05-04 中国农业银行股份有限公司 Workflow exception handing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6918053B1 (en) * 2000-04-28 2005-07-12 Microsoft Corporation Compensation framework for long running transactions
US7904434B2 (en) * 2007-09-14 2011-03-08 Oracle International Corporation Framework for handling business transactions

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043682A (en) * 2011-01-27 2011-05-04 中国农业银行股份有限公司 Workflow exception handing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Constraint Ruels-based Recovery for Business Transaction;Cao Jiuxin,Zhang Biao,Mao Bo,Liu Bo;《2010 Ninth International Conference on Grid and Cloud Computing》;20101130;第282-289页 *

Also Published As

Publication number Publication date
CN102780753A (en) 2012-11-14

Similar Documents

Publication Publication Date Title
Chung et al. The trap of continual ownership change in international equity joint ventures
Miller et al. WebWork: METEOR 2's web-based workflow management system
US11205150B2 (en) Apparatus and method for policy-driven business process exception handling
Zeng et al. Policy-driven exception-management for composite web services
CN101820428B (en) Composite service optimizing method and device based on protocol composition mechanism
CN102780753B (en) A kind of service recovery method based on constraint rule
CN103425462A (en) Method and device for workflow data persistence
Kaâniche et al. A user-perceived availability evaluation of a web based travel agency
Pu et al. Theoretical foundations of scope-based compensable flow language for web service
Khosravifar et al. Agent-based game-theoretic model for collaborative web services: Decision making analysis
Casati et al. Error handling in process support systems
Mendes et al. Building resilience to natural hazards. Practices and policies on governance and mitigation in the central region of Portugal
Maamar et al. Policies for context-driven transactional web services
Yin et al. QoS-driven transactional web service reselection for reliable execution
Chen et al. A formal method to model and analyse QoS-aware fault tolerant service composition
JP2007529067A (en) Method and apparatus for self-healing composite web service
Bocciarelli et al. Model-driven performability analysis of composite web services
Lakhal et al. Reliability and performance estimation for enriched WS-SAGAS
Elgedawy CRESCENT: a reliable framework for durable composite web services management
CN111539635A (en) Manufacturing service cooperation failure resolution method based on network cascade analysis
Portilla et al. Building reliable mobile services based applications
CN101741624B (en) Internet composite service performance fault-tolerant system
Mahdian et al. Considering faults in service-oriented architecture: A graph transformation-based approach
Shahzad et al. Towards cross language process model reuse–a language independent representation of process models
Sneed et al. Reengineering the corporation-A manifesto for it evolution

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150805

Termination date: 20211108

CF01 Termination of patent right due to non-payment of annual fee