A Dynamical Reliability Prediction Algorithm for Composite Service

Dynamic selection and dynamic binding and rebinding at runtime are new characters of composite services. The traditional static reliability prediction models are unsuitable to dynamic composite services. A new reliability predicting algorithm for composite services is proposed in this paper. Firstly, a composite service is decomposed into composition unites (executing path, composite module and atomic service) according to their constituents. Consequently, a hierarchical graph of all composite units is constructed. Lastly, a new dynamic reliability prediction algorithm is presented. Comparing with the traditional reliability model, the new dynamic reliability approach is more flexible, which does not recompute reliability for all composite units and only computes the reliability of the effected composite units. In addition, an example to show how to measure the reliability based on our algorithm is designed.The experimental results show our proposed methods can give an accurate estimation of reliability. Furthermore, a more flexible sensitivity analysis is performed to determinewhich service component has themost significant impact on the improvement of composite service reliability.


Introduction
With the rapid development and widespread use of web services, more and more businesses are achieved by composite services which can be created by aggregating a number of atomic or composite services (called service components) by following certain composition pattern and rules.Thus, how to ensure the reliability of composite services has become an important problem.In addition, a large amount of functionequivalent services has been in the Internet, which make more services be selected.Users can translate their requirements for services to the constraints of some QoS properties [1].Then, different users may select different service to realize the same function based on different QoS constraints.There are two methods for web service composition: static composition and dynamic composition.In static web service composition, composition is performed manually; that is, each web service is selected and bound before execution.Static composition is sufficient for constructing applications with well-defined specific requirements that are not likely to change frequently.But, it is not flexible and agile enough when the requirements are changed frequently.Dynamic web service composition can achieve this goal as, in dynamic composition, services components are selected at runtime from a set of service components and when the selected service components failed, the new selected service components will replace them while keeping the running services constantly available to users [2].Dynamic service composition provides an ability to rapidly adapt to changes that were not envisioned during design time.
Dynamic binding and rebinding are the basis for the dynamic composition.There are three kinds of binding: early binding, local binding at runtime, and rebinding at runtime [3][4][5][6].In early binding, the service is selected and bound before execution, which is also called static binding.In local binding, when a composite service is running, one of its service components is bound to a selected service according to some QoS properties before it is invoked.Local binding can help service components to avoid binding to failed services and reduce the failure probability of composite services.During the execution of a composite service, when the QoS of some service components do not satisfy the requirements of the user or the bound services fail, the composite service will pause, and after new services are bound to the service components, the composite service continues to run; the binding in this process is called rebinding at runtime.
To address the above problems of dynamic composition, traditional static reliability model to predict the reliability is not applicable to services with dynamic composition.A new dynamic reliability model is presented for the dynamic service composition in this paper.The new model makes the computation simple when the reliability of some service components is changed frequently.
The remaining sections of the paper are organized as follows.Section 2 describes the related works.Section 3 discusses some concepts about composite units.Section 4 describes the reliability of the composite units.Section 5 presents the dynamic reliability prediction approaches based on the hierarchical graph.Section 6 conducts some experiments to verify our reliability algorithm.Section 7 presents the conclusion and our future works.

Related Works
The existing reliability predicting models can be divided into two categories: black-box and white-box [7,8].The blackbox models, such as the Bayesian models, the SRGM (software reliability growth models), and the statistical models, only consider the functionality of software while ignoring its internal structure.The white-box models estimate the reliability of a software system based on its internal structure.The structures are often described by Markov chain [9][10][11][12][13][14][15][16][17][18][19] or Petri net [20,21].These white-box models can be further divided into three categories: state-based models, path-based models, and additive models.As these models are often developed for component-based software systems, they are also called component-based reliability models (CBRM).The state-based models which are the common models usually model the system as a discrete-time Markov chain (DTMC), a continuous-time Markov chain (CTMC), or a semi-Markov process Markov chain (SMP).Wang et al. presented a typical state-based model which described four common architecture styles, including batch-sequential, parallel/pipe-filter, call-and-return, and fault-tolerance styles, and proposed a transformation from architecture view to state view to perform reliability analysis [10].S. Gokhale et al. classified the state-based models from three aspects: the architecture of the application, the failure behavior of components, and the analysis methods.The architectures were CTMC or DTMC and the Markov chain was irreducible or absorbing.The failure behavior was represented by reliability, constant failure rate, or time-dependent failure intensity.The analysis method was composite or hierarchical.In sum, they gave seven kinds of DTMC-based models and CTMC-based models.
The emergency of web services makes the software system be dynamic discovery and binding, which make the development and the execution be more complex.Then, web services are more prone to failure than traditional distributed software.It is necessary to develop new methods to predict the reliability of services [17][18][19].Tsai et al. extended the components based reliability models to services reliability analysis [20,21].The structure of services is also described as Markov chain.Wang et al. proposed a hierarchical reliability model which divided the reliability of services into data reliability, service components reliability, service pool reliability and composite services reliability [22,23].Zheng and Lyu proposed a collaborative reliability prediction approach, which employs the past failure data of other similar users to predict the web service reliability for the current user [24,25].This method needs large amount of user data; when the number of user is small, it is difficult to classify a user to its similar group.The composition process of web services is actually a workflow process; then a workflow-based model is also a usual method to predict the reliability [26].Moreover, there are also other approaches to estimate the reliability of composite services from the ports, message delivery, or network transition [27][28][29][30][31]. Web services are different from general software system, as they are dynamic composition.Most of the existing reliability models are based on the service components in the design phase, without considering the dynamic selection and binding.In this paper, we would propose a new dynamic approach to predict the reliability of services.

Composite Units
Composite services are divided into atomic service, composite unit, execution path, and composite service according to their different constituents.We will discuss the four composite units in detail.

Atomic Service (AS)
. An atomic service is the smallest organization unit of web service.In other words, it would be impractical to decompose an atomic service.An atomic service has a fine-grained structure which can be designed, implemented, and tested independently.A composite service is a composite process; in dynamical composition, the service component in composite process is called abstract service.When the service is invoked, the abstract service is bound to the concrete service.There are several concrete services offering the same piece of functionality, which means that several concrete services may match an abstract service in service specification.So, the reliability of atomic service is changed in the execution process.

Basic Composite Module (BCM).
Service composite module is composed of a set of services according to some operations.The constituted services may be atomic services, composite modules, or composite services.The operations are sequence, choice, loop, and concurrent.According to the operations, the service composite modules can be divided into four categories, that is, sequence module (SM), choice module (CM), loop module (LP), and concurrent module (CoM).If all services in a composite module are atomic services, the composite module is called a basic composite module ().Let  = {, },  is the set of atomic services, and  is the operator of atomic services,  ∈ {, ℎ, , }.

Composite Service (CS).
The execution of a composite service is combined by several paths.Let  = {⟨ℎ 1 ,  1 ⟩, ⟨ℎ 2 ,  2 ⟩, . . ., ⟨ℎ  ,   ⟩}, where ℎ  is the th execution path,  = 1, 2, 3, . . ., , and   is the execution probability of ℎ  .An example of a composite service is shown in Figure 1; the composite service has two execution paths, ℎ 1 , ℎ 2 ,  = {⟨ℎ 1 ,  1 ⟩, ⟨ℎ 2 ,  2 ⟩}.Services in an execution path of composite services may be atomic services, service module, or composite services; then they have  ∈  ∈ ℎ ∈ .A composite service includes several paths and the composite modules in a path may be  or other composite modules which have some .Any composite service can be finally divided into several execution paths consisting of several .We will prove the theorem.

Proposition 1. Any composite service can be finally divided into some execution paths which consist of several 𝐵𝐶𝑀𝑠.
Proof.As a composite service constitutes several execution paths by the probability, suppose that a ℎ  includes another composite module  which consists of several atomic services and a ,  = { 1 ,  2 , . . .,   , ,   } and  = { 1 ,  2 , . . .,   ,   }, where   ∈ {, , ℎ, } and   ∈ {, , ℎ, }.We use   =  and   =  as an example to illustrate the problem.If we introduce composite module  into , we will get  = { 1 ,  2 , . . .,   ,  1 ,  2 , . . .,   , }.Then, a composite module  can be deeply divided into  +  atomic services and the decomposition does not affect its execution path.If one of the operations is ℎ, the execution path ℎ  can be replaced by more execution paths.As   ,   are one of the four operations, the execution path is not affected except when one of the operations is ℎ.One composite module can be decomposed into one or more , and the corresponding execution path can be extended into more execution paths.So, a composite service can be finally divided into some execution paths which consist of several .

Hierarchical Graph of Composite Units.
In this section, we will describe a hierarchical graph to represent the composite unit: composite service, path, basic composite module, and atomic service, while the following section describes how to calculate the graph attributes.
Definition 2 (hierarchical graph).A hierarchical graph is defined by a 2-tuple ⟨, ⟩, where ⟨, ⟩ is a DAG (directed acyclic graph). is a set of nodes in the graph,  = {V  },  = 1 ⋅ ⋅ ⋅ ||, and  is a set of directed edges in the graph,  = {  },  = 1 ⋅ ⋅ ⋅ ||.Definition 3 (node).A node V ∈  models a composite unit  and is defined by a 2-tuple ⟨  ,   ⟩, where   is the name of composite unit  and   is the reliability of composite unit .Definition 4 (edge).A directed edge  ∈  models the constitution of composite units V  and is defined by the tuple ⟨V  , V  ,  , ⟩, where V  , V  are nodes, the node V  is one of the components of node V  , and  , is the weight of edge from node V  to V  which describes the constitution of V  and V  .If  , < 1, the edge represents the node V  consisting of V  according to ℎ structure, if  , = 1, the edge represents the node V  consisting of V  according to  or  structure, and if  , > 1, the edge represents the node V  consisting of V  according to  structure.

Reliability of Atomic
Services.An abstract service may have several concrete services to be matched; then, different user may select different concrete service to be bound for the same abstract service as they have different QoS requirement [24].For example, there are an abstract service  and three matched concrete services  1 ,  2 , and  3 .The reliability of the three concrete services is {0.98, 0.9, 0.75}, and one of the QoS {ℎℎ, , }.The reliability and price of  1 are the highest, and  3 is the lowest.If a user only cares about the reliability and has no claim for price, he may select  1 to be invoked.Other users may have different choice considering the price.The binding information can be recorded by monitor mechanism, and the binding probability can be computed from this information [27].Here, we assume that the binding probability is known.As shown in Figure 3, the reliability of atomic service V  can be computed by the following: where   is the reliability of an abstract atomic service node   ,   is the reliability of V  ,  = 1, . . ., , which is a concrete atomic service to be bound to V  , and  , is the binding probability of node V  to node V  .After the binding changed, the reliability of atomic service  must be recomputed according to the above formula.

Reliability of Basic Composite Module.
Sequence module (), choice module (), loop module (), and concurrent module () are four kinds of composite modules.Next, we will discuss their reliability in a dynamic environment.

Sequence Module/Concurrent Module. As shown in
Figure 3(a), node V  is SM or CM, nodes V 1 , . . ., V  are the atomic services which compose the  or , and the weight of edge from node V  to V  ,  = 1, . . ., , is 1.The reliability of  or  is In the equation, if the binding probability of an atomic service V  is changed, then the reliability of V  will be changed, and the reliability of  will be changed.Let Δ  be the changed value of V  ; then the new value of node V  can be represented by From the equation, we can see that when the binding of a service has been changed, it does not need to recalculate the reliability of the entire services.As long as the changed value is calculated, the whole reliability can be known.

Choice Module.
As shown in Figure 3(b), the weight of edge from node V  to node V  is less than 1; the composite module is .The reliability of  can be computed by the following expression: If a binding probability of an atomic service (e.g., V  ) is changed, the reliability of the atomic service must be recomputed,    =   + Δ  , where Δ  is the changed value of node V  .Thus, the new reliability of  can be expressed by the following: and Δ  = Δ   , .

Loop Module.
As shown in Figure 3(c), the weight of edge from node V  to node V  is larger than 1, the composite module is , and the weight of edge is the number of times.The reliability of  can be computed by the following expression: If the binding probability of V  is changed, Δ  is the changed value of node V  .The new reliability of  can be expressed by the following: From (7), we also can see that when the reliability of an abstract service in  is changed there is no need to recalculate all reliabilities of services in  to get the reliability of the entire service.It is easy to get the reliability of the entire service as long as the changed value has been got.In a word, the incremental reliability of  is

Reliability of Path.
As shown in Figure 2, an execution path is a sequence structure of all its  in the path.The weight of edge from execution paths to its  is 1.So, the reliability of execution path is the same as : where Δ ℎ = Δ  = (Δ  /  )  .

Reliability of Composite Service.
The execution of a composite service can be divided into several paths, and (1) { (2) double  =   ; (3) for (V  = V  .ℎ();each path is executed according to a probability.Assume that node V 0 is a composite service  in Figure 2 that has several execution paths, ℎ 1 , . . ., ℎ  ; their execution probabilities are  1 , . . .,   and their nodes are Then, the reliability of composite service  can be calculated by If the reliability of ℎ  has been changed, and Δ  is the changed value of ℎ  , the new reliability of composite service can be recalculated similar to the : where Δ  = Δ 0 = Δ   0, and   0 is the changed value of composite service.

Reliability Prediction of Composite Service
Composite services can be decomposed into three layers, that is, path layer, BCM layer, and atomic service layer.Thus, the reliability of composite services can be calculated by the reliability of path, BCM, and atomic service.In this section, we will discuss how to compute the reliability of composite services.

Reliability Algorithm for Composite
Service.The nodes in different layer in Figure 2 represent different composite units.We assume that the reliability of atomic services is known, and the reliability of other nodes can be derived from the reliability of their next layer nodes.We can get all the reliabilities of nodes from bottom to up.The algorithm (, V) calculates the reliability of all nodes in the hierarchical graph of the composite service  (Algorithm 1).The parameter  is the hierarchical graph and V  is a node, ⟨V  , V  ⟩ ∈ , whose initial value is (1) { (2) double Δ = 0; (3) for (V  = V  .ℎ();When the algorithm is invoked, parameter V  is the composite service node V 0 .The calculation process is the traverse process and all reliabilities of nodes are calculated in traverse of graph.Then the time complexity is the same as the traverse process, which is ( + ),  is the number of nodes, and  is the number of edges.

Dynamic Reliability Algorithm for Composite Services.
If the reliability of an atomic service is changed, the composite service will be affected.In this section, we will discuss how to perform our dynamic reliability model to evaluate the reliability of services.Not all composite units are affected by the atomic service; we only recalculate the reliability of the influenced nodes.For example, in Figure 4, the nodes with bold line are the affected nodes.The first step is to find all affected nodes, for example, , ℎ 1 , ℎ 2 , ℎ 3 , ℎ 4 ,  1 , and  1 in Figure 4.Then, all the affected nodes are extracted to a subgraph   in Figure 5.We present an algorithm  to calculate the reliability of the affected nodes (Algorithm 2).The parameter   is the subgraph and V  is a node in subgraph   .Variable   is the reliability of node V  .The returned result (Δ  ) is the incremental reliability of a composite service and    = Δ  +   .

Case Study
6.1.Experimental Setup.We demonstrate the reliability prediction model with a typical example of a service for travel.In this example, the composite consists of 11 atomic services, and we assume that their reliability is known.As shown in Figure 6 the composite service can be divided into 4 execution paths and 7 basic composite modules.Its hierarchical graph is Figure 7.

Comparison of Prediction Accuracy.
The prediction reliability of the composite units in travel service according to formula (2) to ( 10) is shown in Table 1.To study our method performance, we compare our prediction approach with the user-object reliability model (UORM).As shown in Figure 8, success and failure states are added to the state diagram of UORM, the transition matrix is , and the reliability is From Table 1, we can see that the result of our approach is the same as that of UORM.
If Δ 3 = 0.02, the new reliability of composite service V 0 is    =   + Δ  = 0.41298.The computing process is very simple, but, according to UORM, the transition matrix   must be rebuilt.The new reliability   UORM =  END ( − )  −1 1, = 0.41298.From the results of two methods, we can see that our dynamic approach is simpler than UORM, especially when the atomic services are not fixed; then our approach is more applicable to dynamic web services.
6.4.Sensitivity Analysis.Sensitivity analysis helps to understand the impact of the reliability of service components with respect to the system or composite service reliability [28].The sensitivity of composite service reliability based on our approach with respect to a given atomic service   can be defined as    The higher sensitivity indicates the greater impact on the reliability of composite service.The results of sensitivity analysis are shown in Table 2. From Table 2, we can see that sensitivity of atomic services  1 ,  2 ,  3 ,  4 , and  5 is the same.The atomic service  9 has the lowest sensitivity among all abstract services, because the atomic service  9 in the execution path ℎ 2 and the execution probability of ℎ 2 is the smallest.We will try to improve the reliability of some critical atomic services to improve the reliability of the composite service.

Conclusion and Future Works
In this paper, a new approach has been proposed to evaluate the reliability of composite services based on the hierarchical graph of composite units.The composite services can be decomposed into four different kinds of composite units, and they are , , ℎ, and  nodes in the hierarchical graph from bottom to top layer.We proposed a recursive algorithm to compute the reliability for the four kinds of nodes from down to up, which simplifies the whole computational process.We also proposed an algorithm to compute the reliability of some affected nodes when some atomic service nodes are changed.The approach firstly searches the affected path in the hierarchical graph from the changed atomic service node to the root node and all nodes in the path are affected by the atomic service.The reliability of nodes in the affected path is recalculated, and the reliability of composite service is recalculated based on the reliability of paths, instead of recalculating the reliability of all nodes.A case study illustrates how to apply the proposed methods to estimate the composite service reliability.The results of case study show the effectiveness and usefulness of our approach.
The proposed approach has some limitations.Currently, a composite service may have more than one decomposition.Which decomposition is the best way and how to select the best decomposition are our new future works.

Figure 2 :
Figure 2: Hierarchical graph of composite service.

Figure 8 :
Figure 8: State diagram of composite service.

Table 1 :
6.3.Dynamic Reliability Prediction.If the reliability of atomic service  3 is changed, the affected composite units are Reliability of composite units.