• No results found

Algorithms for QoS Query on Composite Services

Chapter 2: Background and Fundamentals

4.3 Algorithms for Answering a User’s QoS Query

4.3.2 Algorithms for QoS Query on Composite Services

In this section, we propose methods to process the problem of QoS query on composite services. Recall Definition 7 in Section 4.2.2.3. Now the goal is to compute the query result of a QoS query vectorpon a composite service setC, denoted asR(p,C), i.e., the set of all the composite services∈C, each of which is not dominated by any other composite service∈C.

Straightforward Strategy

Suppose each composite serviceCi∈Chask tasks in its execution flow. Each task is exe- cuted by a candidate serviceSkii (i=1,2, ...,k)belonging to service groupSi(i=1,2, ...,k), the cardinality of which is|Si|. A straightforward strategy for the QoS query on compos- ite service setCis to enumerate all possibleCi={Sk11,S2k2, ...,Skii , ...,Skkk }firstly and then compute their composite quality difference with respect to p, and finally returnR(p,C)by applying the proposed algorithms in Section 4.3.1 onC. Clearly, each service inSican con- tribute toCi, so the total number of composite services inCis

k

i=1|Si|, which leads to much more expensive cost than QoS queries on individual services. If the number of services in service groups or the number of service groups increases, the cost of the straightforward strategy is even more expensive.

Locally Pruning Method

As we can see, the straightforward approach traverses all services in each service group then combines traversed individual services to find qualifying composite services, so the number of services in each service group is a key factor in the cost, and it would be useful if we

109

can reduce the number of services in service groups. To achieve this, we need to identify and remove those services from each service group, which are impossible to appear in the final query result R(p,C). In this section, thelocally pruning method(LPM) is developed to address this issue. The intuition behind this approach is that a locally dominated service, i.e., it is dominated by some other service in the same group, does not appear in R(p,C). This idea can be summarized by the following heuristic:

Heuristic 1. Let Si be a group of services and Sikibe an arbitrary service∈Si. Service Skii can be safely pruned if there exists a service Skii 0∈Sisuch that Skii 0 ÂSkii .

Proof. According to the four different workflow patterns in Figure 4.1, we give the proof separately.

Firstly, assumeSki

i is selected to a sequential structureCi={S1k1,S2k2, ...,Skii , ...,Skkk }of a composite service inR(p,C). Now we modifyCiby replacingSkii withSkii 0to obtain another sequential structure Ci0= {S1k1,S2k2, ...,Skii 0, ...,Skkk }. According to Equation 4.7, we have D(p,q(Ci)) = kl=1 D(p,Skl l ), andD(p,q(Ci0)) = i−1 ∑ l=1 D(p,Skl l )+D(p,Ski 0 i )+ kl=i+1 D(p,Skl l ).The dominance check betweenCiandCi0can be done using formula

D(p,q(Ci0))−D(p,q(Ci)) =D(p,Ski

0

i )−D(p,Skii ). Note thatSki

0

i ÂSkii , so the QoS value of D(p,q(Ci0))−D(p,q(Ci))on each metric is not larger than zero and strictly smaller on at least one metric. That is to say, the value ofD(p,q(Ci0))on each dimension is not larger than that ofD(p,q(Ci))and strictly smaller on at least one dimension. Therefore,Ci0dominates CiandCican not appear inR(p,C), which is contradictory to the fact thatCi∈R(p,C).

As for loop structures and conditional structures, since they can be converted into linear sequential structures according to the conversion rules in Section 4.2.2.2, the conclusion can be derived similarly.

Now we suppose Ski

i is selected to a parallel structure Ci of a composite service in R(p,C). Since Ci’s QoS values on price, reliability and reputation can be accumulated, effectively it can be regarded as a sequential structure and the deduction above still ap- plies. Therefore, we only need to prove the heuristic rule works on duration metric as well. Without loss of generality, we supposeCionly contains two service groupsSiandSj, whereSi={Ski

0

i ,Skii }, Ski

0

i ÂSkii and Sj ={Sk jj }. Ifdur(Sk jj )≤dur(Ski

0

i ), then dur(Ci) is determined bySki

i orSki

0

i , so service Skii can be safely pruned; ifdur(Sk jj )≥dur(Skii ), then dur(Ci)is determined bySk jj , thus clearly serviceSkii can also be safely pruned; otherwise dur(Sk jj )falls in betweendur(Siki0)anddur(Skii )and we have the dominance relationship be- tween two compositions:{Ski0

i ,S k j

j } Â {Skii ,S k j

j }, therefore, serviceSikican be safely pruned, too.

111

input : A QoS query vector p kservice groupsS1,S2, ...,Sk

output: A query result setRcontaining satisfying composite services R=φ;

1

foreachservice service group Sido

2

LocateSiforSi;

3

ObtainSi0by removing those services fromSidominated byS∗i;

4

end

5

repeat

6

select one candidate service from each service groupS0i;

7

form a composite serviceCi;

8

if∃Ci0∈R such that Ci0ÂCiwith respect to pthen

9 discardCi; 10 else 11 insertCitoR; 12

remove every serviceCi0∈Rsuch thatCiÂCi0with respect top;

13

end

14

untilno more services can be traversed;

15

ReturnR;

16

Algorithm 4.3: The LPM algorithm for QoS query on composite services

Based on the heuristic rule above, now we consider how to find suchSkii 0s for service group Si. For a serviceSkii 0 inSi, its ability to prune and exclude other services from further con- sideration is determined by its own QoS value and the extent of the distribution of the QoS values of services inSi. Suppose the value range on metrick(k=1,2,3,4)is[ak,bk]inSi.

Then the pruning ability ofSkii 0, denoted asPA(Siki0), is evaluated asPA(Skii 0) = ∏4

l=1(bl−q l ki0).

We select the service fromSi with the maximum pruning ability, termed S∗i to prune non- qualifying services. After pruning non-qualifying services for each service group Si, the straightforward strategy is applied to compute the query result R(p,C). Let S0i represent Si from which some services have been pruned. The number of pruned services for Si is

|Si| − |Si0|. Therefore, the total number of pruned composite services inCis ∏k

l=1(|Sl| − |S

0 l|). Algorithm 4.3 shows the pseudo-code of the LPM algorithm.