HOME JOURNALS CONTACT

Journal of Software Engineering

Year: 2013 | Volume: 7 | Issue: 2 | Page No.: 68-76
DOI: 10.3923/jse.2013.68.76
A Web Service Discovery and Composition Method Based on Service Classes
Wei Liu, Yuyue Du and Chun Yan

Abstract: A service class can be formed by Web services with the same function from an abstract operation. Some operations for the service class are presented to reflect its self-adaptation. On the basis of the service class, Web service discovery and composition algorithms are given. In Web service discovery process, a projective operation is proposed and a selection algorithm is provided to choose the optimal Web services and in Web service composition process, some service composition operations are given. The Web service discovery and composition efficiency is improved based on service classes. Finally, the effectiveness of the proposed methods is illustrated by the service composition for travel planning.

Fulltext PDF Fulltext HTML

How to cite this article
Wei Liu, Yuyue Du and Chun Yan, 2013. A Web Service Discovery and Composition Method Based on Service Classes. Journal of Software Engineering, 7: 68-76.

Keywords: service composition, service discovery, service class, Web service and service composition operation

INTRODUCTION

With the development of Web services, the number of Web services is increasing dramatically and more pressure is encountered in Web service discovery and composition. Many services with the same functions are published by different service providers. This will result in the redundancy of some services with the same functions. How to alleviate the burden of network and eliminate the redundancy is becoming a hard task. Thus, the research on Web services discovery is becoming a hot topic (Huhns and Singh, 2005). And on the other hand, it is difficult to meet the needs of users only by a single Web service. So Web service composition is widely investigated.

At present, many standards of Web service composition have been proposed (Curbera et al., 2002) such as the Simple Object Access Protocol (SOAP) used to exchange the messages among services, service providers and clients, Web Service Description Language (WSDL) used to describe service functions and interface and Universal Description, Discovery and Integration (UDDI) used to advertise and discover services. But some complex combinations of Web services cannot be realized based on the standards. Many approaches and technologies have been applied to the composition and verification of Web services, such as Agent, workflows, Petri nets, semantic web and Pi calculus. A workflow-based Web service composition method was introduced (Cardoso and Sheth, 2003). A model was proposed based on Petri nets and situation calculus and the simulation, verification, composition of Web services were made (Li et al., 2011). Business Process Execution Language for Web Services (BPEL4WS) was transformed into a service-oriented Petri net and Web service composition was verified. Colored Petri Nets were applied to describe Web service composition (Azgomi and Entezari-Maleki, 2010). The concept of service community (Benatallah et al., 2003; Maamar et al., 2010), meta service (Li et al., 2007) and service cluster (Qi et al., 2012) are defined to facilitate service composition.

Different from the previous researches on Web service composition, a web service composition method based on service class is presented in this study. The architecture of service composition presented in the study is shown in Fig. 1. There mainly are two kinds of users: requestor and provider. The providers can register some services to the service registry and then some resolving work can be done based on the domain ontology. According to the service function, the atomic services can be classified as different classes through an abstract operation and a service class includes the services with the same function. Thus, the number of the service classes is much smaller than that of the atomic services and the discovery efficiency can be improved. As is well known, there are some dynamic changes for the service classes, thus an updating strategy is proposed. For example, some new services need to be added to service classes when providers provide them (Addition operation⊕) some services existing in the service classes need to be removed when they are unavailable or out of date (Subtraction operation©) and some corresponding changes should be made for service classes when the service provider change the service information (Modification operation®). The service composition can be implemented based on the service classes by the composition engine and the corresponding atomic services achieving the function of service classes can be obtained through projection operations, then service execution can be realized. Finally, the results can be returned to the requestor.

The rest of the study is organized as follows. Basic concepts for Web services and service class are presented and some operations for the service class are proposed in Section 2. Section 3 is devoted to Web service discovery and composition process: a projective operation method is proposed, a selection strategy is provided to choose the optimal Web services and some composition operations are given. The effectiveness of the proposed methods is illustrated by an example.

The Web service discovery and composition method is given based on service classes in the study. The Web service discovery and composition efficiency is improved based on service classes.

Fig. 1: The architecture of service composition based on service classes

WEB SERVICES AND SERVICE CLASS

Some notations are given first. Let S = {s1, s2,..., sn} be a finite set. |S| represents the number of elements in S. Sets U and V are disjoint if U∩V = ø. If ∀sεU⇒sεV and ∀rεV⇒rεU, then U = V. U\V = {p|pεU and p∉V}. is a natural number set, i.e., = {0, 1, 2,...}; k = {0, 1, 2,..., k}; + = \0} and k+ = k\{0}.

In order to find the suitable Web services quickly and effectively, Web services with the same function are combined into a new service class. First an atomic service is defined as a simple operation receiving a group of input parameters and offering a group of output parameters. the Semantic Web version is followed and the service descriptions are enriched by annotating their parameters with semantic concepts taken from domain ontology. Then services with the same functions can be classified as a service class. Some operations for the service class are also presented.

Basic concepts
Definition 1: Atomic service:
An atomic service is expressed as a 6-tuple s = (Na, SF, I, O, QoS, URL), where, Na denotes the service name, SF is a concept taken from domain ontology and denotes the service function, I is a set of input parameters from domain ontology, O is a set of output parameters from domain ontology, QoS denotes the service quality and it can be calculated by the properties such as usability, response time, cost and reliability and URLis short for Uniform Resource Locator denoting the service address and it is unique.

In this study, an atomic service is defined as a simple operation with a name and a function from domain ontology and receives a group of input parameters and offers a group of output parameters. Besides, a QoS (Quality of Services) and an URL (Uniform Resource Locator) are attached.

Definition 2: Service request: A service request given by a service requestor can be expressed as a 4-tuple r = (SFr, Ir, Or, QoSr), where, SFr is a concept taken from domain ontology and denotes the service function needed by the requestor, Ir is a set of known information, i.e., a list of input parameters from domain ontology provided by the requestor, Or denotes a set of needs, i.e., a list of output parameters from domain ontology requested by the requestor and QoSr denotes a set of constrains on service quality made by the requestor.

Notice that a requestor needs a list of outputs while offering a list of inputs and a set of constrains on service quality.

For example, s1 = (Na1, SF1, I1, O1, QoS1, URL1) is a train ticket query atomic service, where, SF1= TrainTicketQuery, I1 = {Departure, Arrival, Date} and O1 = {Time, Price, Type} with the concepts from travel ontology. And there are two other train ticket query atomic services, such as s2 = (Na2, SF2, I2, O2, QoS2, URL2) and s3 = (Na3, SF3, I3, O3, QoS3, URL3), SF2 = SF3 = TrainTicketQuery, I2 = {Departure, Arrival}, O2 = {Type, Time, Price}, I3 = {Departure, Arrival, Date} and O3 = {Price, Time, Train seatings}. Since SF1 = SF2 = SF3, the services s1, s2, s3 with the same function can be classified as a service class.

Definition 3: Service class: Let s1, s2,..., sn be n atomic services and ∀i, jε n+, SFi = SFj. A service class is expressed as a 3-tuple sc = (Na, AS, SCF) where, Na denotes the name of the service class, AS= {s1, s2,..., sn} is a set of atomic services and SCF = SFi, iε n+.

Notice that a service class includes several services with the same function though there may be great differences between the other variables of these services. And in the definition, SCF denotes service class function and it can be described by the function of any atomic services in sc, because all the services in sc can complete the same function. Thus, the number of service classes is much smaller than that of the atomic services in network and the atomic services can be managed efficiently.

In the above example, there exist three services s1, s2 and s3 of querying train tickets, where SF1 = SF2 = SF3 = TrainTicketQuery. The three atomic services can be classified as a service class, denoted as sc = (Na, AS, SCF) where, AS = {s1, s2, s3}, SCF = TrainTicketQuery.

Operations for the service class: In order to manage atomic services in a service class efficiently, some operations are proposed in this subsection. This reflects the self-adaptation of the service class.

Definition 4: Abstract operation: Let AS = {s1, s2,..., sn} be a set of atomic services, where, si = (Nai, SFi, Ii, Oi, QoSi, URLi) be an atomic service, iε n+. P(AS) = {sc1, sc2,..., scm} is the abstract operation on AS, where, scj = (Naj, SFj, Sj) is a service class.

Notice that through an abstract operation, the atomic services can form a service class set. And this service class set satisfies some properties.

Theorem 1: Suppose AS = {s1, s2,..., sn} be a set of an atomic services, P(AS) = {sc1, sc2,..., scm} is a partition of AS.

Proof: According to the definition of the partition, the following conditions should be satisfied.

For ∀siεAS, siεscj and scjεP(AS) and
If sci≠scj, then sci∩scj = ø

According to definition 3 and 4, if Sfi = SCFj and scj∉P(AS), then P(AS) = P(AS)∪{scj}; if Sfi = SCFj and scjεP(AS), then scj = scj∪{si}. Thus, for ∀siεAS, siεscj and scjεP(AS).

Suppose scj, sckεP(AS), sci∩scj≠ø and siεscj∩sck, then siεscj and siεsck. Since service classes are constructed according to the service function and on the basis of definition 3, Sfi = SCFj and Sfi = SCFk, thus SCFj = SCFk, i.e., sci = scj.

Therefore, the conclusion is correct.

After the abstract operation on AS is finished, a service class set P(AS) is constructed. But in fact services in the network are always changed. The service class should have the property of self-adaptation. Thus some operations are proposed in this subsection to manage atomic services in a service class reasonably and efficiently.

Definition 5: Addition operation: Let sc = (Na, S, SCF) be a service class, where, S = {s1, s2,..., sn}. S = S∪{s’} is the new service set in sc, denoted by sc = sc⊕s’, if there exists a new service s’∉S, s’ = (Na’, SF’, I’, O’, QoS’, URL’) and SCF = SF’.

Notice that the Addition operation means that some new services need to be added to service classes when the providers provide them.

Definition 6: Subtraction operation: Let sc = (Na, S, SCF) be a service class, where S = {s1, s2,..., sn}. ∀sεS, s = (Na, SF, I, O, QoS, URL), sc = sc©s denotes deleting s from the set S in sc, i.e., S = S\{s}.

Notice that the subtraction operation occurs when some services existing in the service class need to be removed when they are unavailable or out of date.

Definition 7: Modification operation: Let sc = (Na, S, SCF) be a service class, where, S = {s1, s2,..., sn}. For sεS, s = (Na, SF, I, O, QoS, URL), sc = sc®s denotes making some changes to s from the set S in sc, if no less than one of variables Na, SF, I, O, QoS and URL are changed except for the function SF.

When the modification operation happens, the previous variables of the corresponding service are updated by the new values provided by the provider. Some corresponding changes should be made for the services existing in the service class when the service providers change the service information.

There are some dynamic changes for the service classes and based on the updating strategy in the above definitions, an algorithm for updating the service class is proposed in the following:

Algorithm 1: Algorithm for updating a service class

SERVICE DISCOVERY AND COMPOSITION

Web service discovery and composition are the study focus in the industrial and academic circles and many methods have been proposed. In this study, a composition method based on service class is proposed.

Operations for service discovery: The semantic web version is followed and the service descriptions are enriched by annotating their parameters with semantic concepts taken from domain ontology (Paliwal et al., 2011; Klusch et al., 2009). Let c1, c2 be concepts from domain ontology and the similarity between c1 and c2 is defined as follows:

where, dis(c1, c2) is the distance between c1 and c2, i.e., the edge-number of the shortest path between the two concepts in the concept tree. dismax and dismin, respectively are the maximum and minimum values of dis(ci, cj), where, ci, cjεC and i, jε |C|+.

Definition 8: Projective operation: Let P(AS) = {sc1, sc2,..., scm} be the abstract operation on an atomic service set AS and r = (SFr, Ir, Or, QoSr) be a service request. There are three levels of projective operation defined as follows:

fL1(P(AS)) = {sc|scεP(AS) and L1|sc = •T•} is a projective operation on P(AS), where sc = (Na, S, SCF), L1: sim(SCF, SFr)≥σ is a proposition, σ>0 is a real number and L1|sc = •T• denotes that the logical value of L1 is true for the function SCF in sc.
Let SC = fL1(P(AS)) and sc = (Na, S, SCF)εSC be a service class, where, S = {s1, s2,..., sn} and s = (Na, SF, I, O, QoS, URL)εS. fL2(sc) = {s|sεS and L2|s = •T•} is a projective operation on sc, where L2 = l(I)∧l(O), l(I): I⊆Ir and l(O): O⊇Or are propositions and L2|s = •T• denotes that the logical value of L2 is true for the variable values I and O in s
Let fL1(P(AS)) = {sc1, sc2,…, sck} and SS = fL2(sc1)∪fL2(sc2)∪…∪fL2(sck). fL3(SS) = {s|sεSS and L3|s = •T•} is a projective operation on SS, where L3: QoS≥QoSr is a proposition

Notice that, given a certain service request, fL1(P(AS)) provides us a set of service classes meeting the request; then fL2(sc) returns a set of atomic services in sc according to the input and output parameters; and at last, fL3(SS) shows a set of services that satisfy the quality of service request. Let CS = fL3(SS) be set of candidate services that may satisfy a service request. Then the optimal service should be selected from CS and the following choosing strategy is used.

Definition 9: Matching value: Let r = (SFr, Ir, Or, QoSr) be a service request and s = (Na, SF, I, O, QoS, URL)εCS. M(r, s) is a matching value of r and s, where, M(r,s) = ω1 sim(SF, SFr)+ω2/(|Ir-I|+θ)+ω3/(|O-Or|+θ)+ω4(QoS-QoSr), θ>0, ω1, ω2, ω3 and ω4ε[0,1] are the weights and ∑4i=1i) = 1.

Notice that, given a service request r, each service s in candidate service set from definition 8 has a matching value according to definition 9. sim(SF, SFr) denote the similarity between the functions of r and s; ω2/(|Ir-I|+θ) denotes the redundant degree of the input parameters of r and s, where |Ir-I| denotes the number of the disjoint input parameters and if there are no redundant parameters, i.e., Ir = I, then |Ir-I| = 0 and ω2/(|Ir-I|+θ) reaches maximum value; similarly, ω3/(|O-Or|+θ) denotes the redundant degree of the output parameters of r and s and QoS-QoSr denotes the quality value of s better than r.

Algorithm for service discovery: According to definition 8 and 9, the service discovery algorithm can be given as follows:

Algorithm 2: Algorithm for service discovery

Operations for service composition: From the composition patterns of workflow nets (Qi et al., 2012), there are mainly four basic patterns in the composition of service class, i.e., sequence, parallelism, alternative and iteration. Now these patterns are proposed briefly.

Let P(AS) = {sc1, sc2,..., scm}, where sci, scj are service classes, i, jε m+. The operations on service classes can be defined as follows:

Sequence operation •: sci•scj represents a sequence completion from sci to scj
Alternative operation ◊: sci◊scj represents an alternative completion of sci and scj and precisely one of them is executed
Parallel operation ||: sci||scj represents a parallel completion of sci and scj and they are executed concurrently
Iteration operation μn: μnsci represents an iteration completion of sci and it performs n times repeatedly, where nε +

The Web service composition can be illustrated by an example in the following:

SERVICE COMPOSITIONS FOR TRAVEL PLANNING

Service composition can be completed based on the service classes by the composition engine and the corresponding atomic services achieving the service classes can be obtained through projection operations, then service execution can be realized. And an example is given in the following to illustrate the proposed method in this study.

To make a travel plan, some service classes should be invoked and composed to satisfy the request. In general, for example, eight service classes are needed: Weather Forecast, Place Choose, TrainTicketQuery, TrainTicketPay, AirTicketQuery, AirTicketPay, HotelQuery and HotelPay. The control structure on these service classes is shown in Fig. 2 and the service classes are denoted by squares, respectively.

There are n atomic services si = (Nai, SFi, Ii, Oi, QoSi, URLi), iεNn+ and they are classified as several service classes by the attraction operation. Here the service classes with the function of querying and paying for train tickets are taken as examples, respectively.

Fig. 2: The control structure on service classes in travel planning

Let sc1 = (Na1, S1, SCF1) where S1 = {s1, s2, s3}, SCF1 = TrainTicketQuery, sc2 = (Na2, S2, SCF2) where, S2 = {s4, s5}, SCF2 = TrainTicketPay. The details of si = (Nai, SFi, Ii, Oi, QoSi, URLi), iε5+ are as follows:

s1 = (Na1, TrainTicketQuery, {Departure, Arrival, Date}, {Time, Price, Type}, QoS1, URL1)
s2 = (Na2, TrainTicketQuery, {Departure, Arrival}, {Time, Price, Type}, QoS2, URL2)
s3 = (Na3, TrainTicketQuery, {Departure, Arrival, Date}, {Time, Price, Train seatings}, QoS3, URL3)
s4 = (Na4, TrainTicketPay, {AccountInf, Price}, {DealFail, DealSucceed}, QoS4, URL4)
s5 = (Na5, TrainTicketPay, {AccountInf, Price}, {DealFail, DealSucceed}, QoS5, URL5)

According to Algorithm 1, if a provider provides a new service s6 = (Na6, TrainTicketQuery, {Departure, Arrival, Date}, {Time, Price, Type}, QoS6, URL6), then the function of s6 TrainTicketQuery which is the same as sc1, thus sc1 = sc1⊕s6; if service s3 is invalid, then sc1 = sc1©s3; and if s1 is changed that I1 = I1∪{price}, then sc = sc®s1.

According to the definitions of the operations between service classes, the sequence composition of two service classes sc1 and sc2 can be denoted as sc1•sc2. The sequence composition can also be denoted with the function of the service classes, i.e., TrainTticketQuery•TrainTicketPay.

Thus, the process of the travel planning service can be described by the operations between service classes, i.e., Weather Forecast•Place Choose•((TrainTicketQuery•TrainTicketPay) ◊(TrainTicketQuery•TrainTicketPay)||(HotelQuery•HotelPay)).

At last, according to Algorithm 2, a set of sorted services for each service class in the above process can be obtained and then available atomic services can be found. Services can be chosen from the sorted service sets in order and then the process of the travel planning service composition with atomic services is constructed.

CONCLUSIONS

A service class can be formed by Web services with the same functions. In the paper, the operations related to services classes such as the abstract operation, the addition operation, the subtraction operation, the modification operation, projection operations are presented. And on the basis of the service class, the service discovery algorithm and the operations for service composition are given. Future work will investigate automatic service composition based on service classes.

ACKNOWLEDGMENTS

This study is supported by the National Basic Research Program of China under grant 2010CB328101, The National Natural Science Foundation of China under grants 61170078 and 71001057, the Doctoral Program of Higher Education of the specialized research fund of China under grant 20113718110004, The Scientific and Technological Developing Program of Shandong Province of China under grant 2011GGX10114, The Project of Shandong Province Higher Educational Science and Technology Program under Grant number J12LN11, the China’s Post-doctoral Science Fund under grant 2012M521362 and the SDUST Research Fund of China under grants 2011KYTD102 and 2011KYTD104.

REFERENCES

  • Azgomi, M.A. and R. Entezari-Maleki, 2010. Task scheduling modelling and reliability evaluation of grid services using coloured petri nets. Future Generation Comput. Syst., 26: 1141-1150.
    CrossRef    Direct Link    


  • Benatallah, B., Q.Z. Sheng and M. Dumas, 2003. The self-serv environment for Web services composition. IEEE Internet Comput., 7: 40-48.
    CrossRef    


  • Cardoso, J. and A. Sheth, 2003. Semantic E-workflow composition. J. Intell. Inform. Syst., 21: 191-225.
    CrossRef    Direct Link    


  • Curbera, F., M. Duftler, R. Khalaf, W. Nagy, N. Mukhi and S. Weerawarana, 2002. Unraveling the web services web: An introduction to SOAP, WSDL and UDDI. IEEE Internet Comput., 6: 86-93.
    CrossRef    


  • Huhns, M.N. and M.P. Singh, 2005. Service-oriented computing: Key concepts and principles. IEEE J. Internet Comput., 9: 75-81.
    CrossRef    Direct Link    


  • Li, H., H. Wang and L. Cui, 2007. Automatic composition of web services based on rules and meta-services. Proceedings of the 11th International Conference on Computer Supported Cooperative Work in Design, April 26-28, 2007, Melbourne, Vic., pp: 496-501.


  • Li, X., Y. Fan, Q.Z. Sheng, Z. Maamar and H. Zhu, 2011. A petri net approach to analyzing behavioral compatibility and similarity of web services. IEEE Trans. Syst. Man Cybern., 4: 510-521.
    CrossRef    


  • Maamar, Z., L.K. Wives, G. Al-Khatib, Q. Z.Sheng, A.R.D. de Vit and D. Benslimane, 2010. From communities of web services to marts of composite web serivces. Proceedings of the 24th IEEE International Conference on Advanced Information Networking and applications, April 20-23, 2010, Perth, WA pp: 958-965.


  • Klusch, M., G. Fries and K. Sycara, 2009. OWLS-MX: A hybrid semantic web service matchmaker for owl-s services. J. Web Sem., 7: 121-133.
    Direct Link    


  • Paliwal, A.V., B. Shafiq, J. Vaidya, H. Xiong and N. Adam, 2012. . Semantics based automated service discovery. IEEE Tran. Ser. Comp., 5: 260-260.
    Direct Link    


  • Qi, L., Y.Y. Du and W.J. Luan, 2012. Cluster-oriented service composition modeling method based on logical net units. Proceedings of the 9th IEEE International Conference on NetworkingSensing and Control, April 11-14, 2012, Beijing, pp: 112-117.

  • © Science Alert. All Rights Reserved