www.s-cube-network.eu
S-Cube Learning Package
Quality of Service-Aware Service Composition:
QoS optimization in service-based processes
Politecnico di Milano (POLIMI)
Barbara Pernici
Learning Package Categorization
S-Cube
Quality Definition, Negotiation
and Assurance
Quality Definition and SLA Negotiation
Quality of Service-Aware Service Composition: QoS optimization in service-based processes
© B. Pernici
Learning Package Overview
Problem Description
QoS optimization
Service selection
Optimization of composed services
Rebinding
Discussion
Conclusions
© B. Pernici
The Need for QoS Information in the Service-Oriented Architecture
Service Provider
(Supplier, Server)
Service Consumer
(Requester, Client)
1. Publish It differentiates
from competitors
Service Registry (Broker,
Directory)
2. Find It determines
the best match
3. Bind It is used for management (monitoring and control)
Many WSes with
similar functionality
© B. Pernici
S1.op1
S1.op2
S1.op3
S2.op1
S2.op2
S2.op3
Service
registry
Adaptive
networks
Flexible e-services
Dynamic service
selection and
optimization
Adaptive front-
ends
Context-
awareness and
personalization
MAIS-Platform Scenario (MAIS-P)
© B. Pernici
[B. Pernici, ed. Springer, Mobile Information Systems, April 2006]
© B. Pernici
Multi-channel ADAPTIVE information systems
© B. Pernici
Multi-channel ADAPTIVE information systems
t
QoS
Accepted quality threshold
© B. Pernici
QoS optimization
Definition of the problem
Design or run time problem?
Process optimization
© B. Pernici
Web Services
Elementary
Composed
How to associate QoS to WS definition?
Satisfaction of request
[Comuzzi, Pernici 2009]
=> Single values are considered (worst case) in most research work
© B. Pernici
Registry: MAIS E-service ontology
QoS
[Bianchini et al, Ing. Sys., 2006]
© B. Pernici
QoS
QoS
QoS QoS
QoS QoS
Receive
find-travel
Receive
book-travel
Travel-Service book-travel
find-travel
pay-travel
Receive
pay-travel
Service Interface
(+ Port types)
behavior
© B. Pernici
WS QoS (an example)
<?xml version="1.0" ?>
<webServices>
<webService name="ws_1">
<maxTime value="6.767389" />
<minTime value="5.767389" />
<price value="0.123061776" />
<reputation value="0.82627237" />
<availability value="0.9903379" />
<dataQuality value="0.9857625" />
</webService>
<webService name="ws_2">
<maxTime value="7.9125476" />
<minTime value="5.767389" />
<price value="0.45754516" />
<reputation value="0.9279902" />
<availability value="0.9791445" />
<dataQuality value="0.91493726" />
</webService>
.
.
.
</webServices>
Candidate WSs
© B. Pernici
Satisfaction of request
[Comuzzi, Pernici 2009]
=> Single values are considered (worst case) in most research work
© B. Pernici
Quality global constraints:
cost <1000
train.reservation.cost<600
Invoke
hotel.reservation
Invoke
train.reservation
Preferred:
- ACMEHotels
- ItalianHotels
Negotiate:
- lowest price
- offer request
Invoke
flight.reservation
not late late
Probability=0.8 Probability=0.2
Composed WS
© B. Pernici
Abstract process
op1
op2
op3
AS2
Abstract services
op1
op2
op3
AS1
Process
AS1.op1
AS1.op2
AS1.op3
AS2.op1
AS2.op2
AS2.op3
© B. Pernici
Concrete process
op1
op2
op3
CS2
Concrete services Process Concretization
CS1.op1
CS1.op2
CS1.op3
CS2.op1
CS2.op2
CS2.op3
op1
op2
op3
CS1
op3
AS1.op1
AS1.op2
AS1.op3
AS2.op1
AS2.op2
AS2.op3
Process
© B. Pernici
© B. Pernici
t1 t2 tI
ws1
ws1,1 ws1,2 ws1,|OP(1)|
. . .
...
ws2
ws2,2 ws2,|OP(2)| ...
wsJ
wsJ,1 wsJ,|OP(J)| ...
. . .
wsJ,2 ws2,1
A selection problem?
© B. Pernici
Design time or run time problem?
When are service selected?
When is quality agreed?
Rebinding and renegotiation
© B. Pernici
Flexible process Concrete services
T1
T4
T2 T3
Candidates for
T1
Candidates for
T2
Candidates for
T3
Candidate for
T4
Search
criteria
Search
criteria
Search
criteria
Global process constraints
© B. Pernici
PAWS Framework & Architecture
[Ardagna et al IEEE Software 2007]
© B. Pernici
Local optimization: run time selection of the best candidate
service which supports the execution of the running high level
activity
Global optimization: identification of the set of candidate
services which satisfy the end user preferences for the whole
application
Quality of Service (QoS) constraints at local and global level
WS Selection is an Optimization Problem
© B. Pernici
An optimization problem?
Local optimization (Cardoso)
Linear programming (Benatallah, Ardagna)
Genetic algorithms (Canfora)
© B. Pernici
QoS aggregate functions
Modified to account
for # of loop iterations
[Cardoso, 2005] Definition of a QoS evaluation function for each
pair (QoS attribute, workflow construct) and collapsing nodes
while evaluating
© B. Pernici
Examples
S1
S2
S1 S2
S2S1
cost=2
avail=0.9
cost=3
avail=0.8
cost=2+3=5
avail=0.9 · 0.8=0.72
70% 30%
cost=2
avail=0.9
cost=3
avail=0.8
cost=0.3 · 2+0.7 · 3=2.7
avail=0.3 · 0.9+0.7 · 0.8=0.83
cost=2
avail 0.9
Estimated
Iterations=5
cost=2 · 5=10
avail=0.95=0.59
S1
cost=2
avail 0.9
r.time=3
cost=3
avail=0.8
r.time=2
Sequence Loop
Fork (flow) Switch
cost=2+3=5
avail=0.9 · 0.8=0.72
r.time=max(3,2)=3 [Cardoso, 2005]
© B. Pernici
Quality Driven composition
Proposes a global approach to planning to optimally select
component services during the execution of a composite service
Defines a quality model and a quality-driven service selection
[Zeng, et al., 2004]
© B. Pernici
Quality Driven composition
Given a composite service
the execution path and the
execution plan are defined
– Execution paths are
sequences of states
– Execution plans are
execution paths in which
each activity is
performed by a service
The problem is to select
for each activity the
service that not only
satisfies local
requirements but also the
global ones
[Zeng, et al., 2004]
© B. Pernici
Hot path
[Zeng et al, 2004] Exploring all paths and computing the overall
QoS on a “hot” path
– Considering each path at a time
– Only paths likely to be executed (hottest paths)
– Unfolding cycles
– Global planning with linear programming solution
- Difficult to handle attributes that aggregate non-linearly
[Zeng, et al., 2004]
© B. Pernici
Normalization [Zeng et al.]
Given an attribute Q, find the maximum QMAX and minimum QMIN
across all the available services
The normalized value V will be:
and the fitness (to be minimized):
1
V MINMAX
MIN
1
V MINMAX
MAX If QMAX≠QMIN
If QMAX=QMIN
If QMAX≠QMIN
If QMAX=QMIN
negative attributes Positive attributes
e.g. cost e.g. availability
© B. Pernici
Unfolding loops
– Useful in presence of
constraints
– In case of loops, each
abstract service invocation
may be assigned to
different concrete services
– Objective: meet constraints
and maximize QoS
– Loops are unfolded
S1
3
S1
S1
S1
C RT
CS1 3 2
CS2 5 1
Fitness=C+RT
RT≤5
Fitness=18 Fitness=16
© B. Pernici
Composed services optimization
[Ardagna, Pernici, 2005, 2007] Global and Local QoS Constraints
Guarantee in Web Service Selection
Loops:
– Unfolding (consider maximum number of iterations)
– Peeling (associate probability to each iteration sequence)
Global constraints enforcement
– Only Critical path in Zeng 2004
– Local optimization in Meteor-S
Reoptimization (Adaptivity)
Negotiation in case of unsolvable problem
© B. Pernici
[Ardagna and Pernici, 2007]
© B. Pernici
[Ardagna and Pernici, 2007]
© B. Pernici
Formal Definitions
Let wsi,j be the i-th Web service candidate for the execution of task tj
Execution Path (epl): a set of tasks {t1,t2,…,tn}, such that t1 is the initial task, tn is the final task and no ti, tj belong to alternative branches
Sub path (spml): a sequence of tasks [t1,t2,…, tn], ti epl from the begin to the end
task which does not contain any parallel sequence
Execution Plan (eplkl): a set of ordered couples (tj, wsī,j), indicating that task tj
included in eplkl is executed by a given WS wsī,j
Global Plan: a set of ordered couples (tj, wsī,j), which associates every task tj to a given WS wsī,j and satisfies local and global constraints for all execution paths
© B. Pernici
An Example
Global constraints:
– Price6$
– Execution time7 sec.
Solution: ws2,1, ws2,2 and ws2,3 (no global constraints violation in all cases)
© B. Pernici
Notation
Symbol Description
ei,j wsi,j execution time
ai,j wsi,j availability
pi,j price for wsi,j execution
ri,j wsi,j reputation
WSj set of indexes corresponding to candidate Web services of task tj
A set of tasks included in the composite service specification
Al set of tasks included in the execution path epl
L number of execution path arising from the composite service
specification
© B. Pernici
Problem Formulation
The WSC problem is multi-objective and a simple additive
weighting technique is used to evaluate the overall value
of QoS from multiple quality dimensions
Decision variables:
– yi,j equals 1 if the Web service wsi,j executes task tj, 0 otherwise
– xj start time of task tj
– ej task tj duration
© B. Pernici
Objective Function
Plan score:
– (other dimensions may be included, e.g. data quality)
Problem objective:
© B. Pernici
[Ardagna and Pernici, 2007]
© B. Pernici
Problem Constraints
Assignment constraints:
Task duration constraints:
[Ardagna and Pernici, 2007]
© B. Pernici
Problem Constraints
Local constraints: e.g.
Execution time constraints:
Availability constraints:
Price constraints:
Reputation constraints:
The problem is NP-hard, it is equivalent to a Multiple choice
Multiple dimension Knapsack Problem
=> Log if not linear
[Ardagna and Pernici, 2007]
© B. Pernici
Another issue
Task dependency:
– Two tasks have to be executed by the same operation (or different
operations) of the same WS
– Eg: make reservation - payment
[Ardagna and Pernici, 2007]
© B. Pernici
Re-optimization
Re-optimization is performed:
– if the current QoS value differs from the corresponding prediction
(variability of performance of Web services)
– if a Web service invocation fails
– for end user 's context switch
– after the evaluation of switch conditions
– periodically with an adaptive time period Tp (new candidate
services)
Re-optimization reduces the number of variables of the problem and
can be computed efficiently
© B. Pernici
[Ardagna and Pernici, 2007]
© B. Pernici
Performance analysis
[Ardagna and Pernici, 2007]
© B. Pernici
Finding a solution using GA
Representation:
– Array chromosome
– A slot for each abstract service invoked in the process
– Value indicates the binding
– S1, …, SN abstract services
– CSi1, …, CSik concrete services for Si
S1 S2 SN
CS11
CS13
CS12
CS21
CS24
CSN1
CSN
k
[Canfora, Di Penta
2005]
© B. Pernici
Genetic Algorithms
Initialize population P[0];
g=0;
while(g < max_number_of_generations)
Evaluate P[g];
g=g+1;
Select P[g] from P[g-1];
Crossover P[g];
Mutate P[g];
end while
[Canfora, Di Penta
2005]
© B. Pernici
GA Operators
- Selection: Roulette wheel
– pcross=0.7
– pmut=0.1
– GA type: Simple with elitism of 2 (best) individuals
– Population size: 100 individuals
CS13
CS33
CS41
CS41
CS11
CS24
CS31
CS44
CS13
CS22
CS31
CS44
CS11
CS24
CS22
CS33
CS13
CS41
CS22
CS33
CS11
CS12
CS13
CS21
CS22
CS23
CS24
CS31
CS32
CS33
CS41
CS42
CS43
CS44
Crossover: Mutation:
[Canfora, Di Penta
2005]
© B. Pernici
Optimization Problem
Given a solution s
Let us suppose we have the SLA constraints in the form
e.g.
The fitness function (to be minimized) would be something like:
or
where D(s) is defined as:
)s(Dw)s(liabilityRew)s(tyAvailabiliw
)s(sponseTimeRew)s(Costw)s(F
5
43
21
020)s(sponseTimeRe
0100)s(Cost
n...1i0)s(cli
i
n
iy)s(cl)s(D
0)s(cl1y
0)s(cl0y
ii
ii
)s(D1)s(liabilityRew)s(tyAvailabiliw
)s(sponseTimeRew)s(Costw)s(F
43
21
[Canfora, Di Penta
2005]
© B. Pernici
Comparing GAs with integer programming
– Integer Programming (IP) is one of the most widely adopted techniques for this kind of problems
– IP model depends on the number of concrete services available
– Given a workflow composed of S1…Sn abstract services, each one bound to CSi,1,…CSi,m concrete service,
- The number of variables yi,j in the IP problem is given by:
1,0y
1y
j,i
m
1j j,i
i
n
1i
im
[Canfora, Di Penta
2005]
© B. Pernici
Comparing GAs with IP: Results of an empirical study
GAs better than IP for # of concrete services >17
GAs ensure better scalability
Also, it allows to handle non linearity
Workflow containing 18
invocations of 8 distinct abstract
services, cyclomatic
complexity=5
– # of concrete services per
abstract service varying
between 5 and 25
[Canfora, Di Penta
2005]
© B. Pernici
Discussion
IP is a widely adopted technique to solve this kind of problem
GAs better scale up when the number of available concrete services for an
abstract service is very high
– Possible scenarios: widely used services (e.g. hotel booking, search URL, etc.)
GAs do not pose any limitation on the linearity of the fitness function and of
the QoS aggregation formulae
– Linearization necessary for IP not to consider for user-defined, domain
specific QoS attributes
- e.g. temperature service may have QoS attributes such as refresh rate,
accuracy, etc.
– Alternative: nonlinear IP serious scalability problems
www.s-cube-network.eu
Handling re-binding
[Canfora 2005]
© B. Pernici
Causes of re-binding
A service may not be available
or, better services can be available
QoS values deviate from the estimate
Unlikely paths are followed
– Branches unlikely to be executed
– # of iterations largely different from the estimated value
This may lead to:
– Impossibility to continue the execution
– Constraint violation
– Poor optimization of the objective function
[Canfora 2005]
© B. Pernici
Triggering Service re-binding
Perform re-binding between abstract and concrete services
When:
– QoSestimated >QoSconstraint
or QoSactual- QoSestimated >threshold
Due to one of the following events
1. Difference between estimated and actual number of loop iterations
2. Choice of the path to be followed in a switch
3. Difference between the estimated and actual QoS of some executed services
4. A service is not available
The algorithm will try to trigger the re-binding once enough information is available
[Canfora 2005]
© B. Pernici
Remaining n3 iterations: k’3-j3
Remaining n2 iterations: k’2-j2
Determining the re-binding slice
[Canfora 2005]
© B. Pernici
Rebinding: response time evolution
0
5
10
15
20
25
30
35
initial estimate replan. value new estimate final value
Resp
on
se T
ime [
s]
T<29
T<31
[Canfora 2005]
© B. Pernici
Re-binding may fail…
No service available for replacement
No way to recover from constraint violation
– e.g. timing constraints already violated
No way to optimize the objective function
What to do
– Suspend the execution
- replace the unavailable service
– Terminate the execution
- Nothing can be done
– Continue anyway
- Constraints not so hard
- Try to limit the violation
– (Re)Negotiate (Ardagna-Comuzzi-Pernici)
© B. Pernici
Discussion and future work
Interrelation between design and run time decisions (design for QoS optimization),complexity
Semantic information about quality (are weights enough?)
Incomplete information and distributed decisions
Variable quality profiles
Multiple instances and multiple processes
Link with strategic goals and underlying infrastrucure; should decisions be taken independently
Stability of solutions
Application areas
Soft and hard constraints
Further S-Cube Reading
Marco Comuzzi, Barbara Pernici: A framework for QoS-based Web service
contracting. TWEB 3(3): (2009).
V. Andrikopoulos, M.G. Fugini, M. Papazoglou, M. Parkin, B. Pernici, B., S.H.
Siadat, QoS Contract Formation and Evolution, 11th International Conference on
Electronic Commerce and Web Technologies (EC-Web 2010)
George Baryannis, Olha Danylevych, Dimka Karastoyanova, Kyriakos
Kritikos, Philipp Leitner, Florian Rosenberg, Branimir Wetzstein,
Service Composition,
in Service Research Challenges and Solutions for the Future Internet:
S-Cube – Towards Engineering, Managing and Adapting Service-Based System,
Mike P. Papazoglou, Klaus Pohl, Michael Parkin and Andreas Metzger (eds), LNCS
6500, 2010
Salima Benbernou, Ivona Brandic, Cinzia Cappiello, Manuel Carro,
Marco Comuzzi,, Attila Kertesz, Kyriakos Kritikos, Barbara Pernici,
Pierluigi Plebani,
Modeling and negotiating service quality,
in Service Research Challenges and Solutions for the Future Internet:
S-Cube – Towards Engineering, Managing and Adapting Service-Based System,
Mike P. Papazoglou, Klaus Pohl, Michael Parkin and Andreas Metzger (eds), LNCS 6500, 2010
© B. Pernici
© B. Pernici
References
D. Ardagna and B. Pernici. Adaptive service composition in flexible processes. IEEE Trans. on
Software Engineering, June 2007.
D. Ardagna, M. Comuzzi, B. Pernici, P. Plebani, PAWS: Processes with adaptive web services, IEEE
Software, Nov. 2007
D. Bianchini, V. De Antonellis, B. Pernici, P. Plebani: Ontology-based methodology for e-service
discovery. Inf. Syst. 31(4-5): 361-380 (2006)
G. Canfora, M.di Penta, R. Esposito, and M. L. Villani. QoS-Aware Replanning of Composite Web
Services. ICWS 2005 Proc., 2005. Orlando.
J. Cardoso. Quality of Service and Semantic Composition of Workflows. Ph. D. Thesis, Univ. of
Georgia, 2002.
S. Chandrasekaran, J. A. Miller, G. Silver, I. B. Arpinar, and A. P. Sheth. Performance Analysis and
Simulation of CompositeWeb Services. Electronic Market: The Intl. Journal of Electronic
Commerce and Business Media, 13(2):120–132, 2003.
D. B. Claro, P. Albers, and J. K. Hao. Selecting Web Services for Optimal Composition. In ICWS 2005
Workshop Proc., 2005. Orlando.
M. C. Jaeger, G. Muhl, and S. Golze. QoS-aware composition of web services: An evaluation of
selection algorithms. In COOPIS 2005 Proc., 2005. Cyprus.
B. Pernici, ed. Springer , Mobile Information Systems, April 2006
Tao Yu, Yue Zhang, and Kwei-Jay Lin. Efficient algorithms for web services selection with end-to-end
QoS constraints. ACM Trans. Web, 1(1):1–26, 2007.
L. Zeng, B. Benatallah, M. Dumas, J. Kalagnamam, and H. Chang. QoS aware middleware for web
services composition. IEEE Trans. on Software Engineering, 30(5), May 2004.
Acknowledgements
The research leading to these results has
received funding from the European
Community’s Seventh Framework
Programme [FP7/2007-2013] under grant
agreement 215483 (S-Cube).
© B. Pernici
Top Related