**5. Web service discovery based on learning fuzzy Petri net model**

Web services are used for developing and integrating highly distributed and heterogeneous systems in various domains. They are described by Web Services Description Language (WSDL). Web services discovery is a key to dynamically locating desired Web services across the Internet [16]. It immediately raises an issue, i.e. to evaluate the accuracy of the mapping in a heterogeneous environment when user wants to invoke a service. There are two aspects which need to evaluate. One is functional evaluation. The service providing function should be completely matched with user's request; another aspect is non-functional evaluation, i.e. Quality of Service (QoS) meets user's requirement. UDDI (Universal Description, Discovery and Integration) is widely used as a kind of discovery approach for functional evaluation. But, as the number of published Web services increases, discovering proper services using the limited description provided by the UDDI standard becomes difficult [17]. And UDDI cannot provide the QoS information of service. To discover the most appropriate service, there are necessary to focus on developing feasible discovery mechanisms from different service description methods and service execution context. Segev proposed a service function selection method [21]. A two-step, context based semantic approach to the problem of matching and ranking Web services for possible service composition is elaborated. The two steps for service function selection are Context extraction and Evaluation for Proximity degree of Service. Cai proposed service performance selection method [3]. The authors used a novel Artificial Neural Network-based service selection algorithm according to the information of the cooperation between the devices and the context information. In this paper, we aim at analyzing different context of services and constructing a services discovery model based on the LFPN. Firstly, different service functional descriptions are used to evaluate service function and an appropriate service is selected. Secondly, context of QoS is used to predict QoS and a more efficient service is selected. Data of QoS is real number and LFPN learning algorithm is directly used. But service function description is literal. Therefore, a Learning Fuzzy Petri Net for service discovery model is proposed for keyword learning based on LFPN.

#### **5.1. Web services discovery model based on LFPN**

To map a service's function accurately, free textual service description, WSDL description, Web service's operation and port parameters which are drawn from WSDL are used as input data here. Because the input data type is keyword, the proposed LFPN cannot deal with this type of data. Consequently, a Learning Fuzzy Petri Net for Web Services Discovery model (LFPNSD) is proposed. LFPNSD is a 10-tuple, given by LFPNSD = <*P*, *Tr*, *F*, *W*, *D*, *I*, *O*, *Th*, *α*, *β* > (as shown in Figure 13.)

where: *Tr*, *I*, *O*, *Th*, *β* are same with definition of LFPN. *P*= {*Pinput*}∪{*Poutput*}={*P*11, *P*12, *P*13}∪{*P*21, *P*22, *P*23, *P*24} F (Pinput×Tr)∪(Tr×Poutput)

168 Petri Nets – Manufacturing and Computer Science

output.

have same vector characteristic with *Xk*1, *Xk*2, …, *Xks*, i.e. *x*1,*kj*, *x*2,*kj*, …, *xn*,*kj* are near to *w*1*<sup>k</sup>*, *w*2*<sup>k</sup>*, …, *wnk*. Then, each component *xi*, *kj* (1≤*i*≤*n*) of this data *Xkj* will have bigger similarity to *wik* (1≤*i*≤*n*) than *i*-th components of other weight *W* according to formula (2). *Xkj* will have biggest truth to *trk* according to formula (2). Thus, when data *Xkj* which belongs to class of *Xk*1, *Xk*2, …, *Xks* inputs to LFPN, it will fire *trk* correctly and product correct

**5. Web service discovery based on learning fuzzy Petri net model** 

discovery model is proposed for keyword learning based on LFPN.

To map a service's function accurately, free textual service description, WSDL description, Web service's operation and port parameters which are drawn from WSDL are used as input data here. Because the input data type is keyword, the proposed LFPN cannot deal with this type of data. Consequently, a Learning Fuzzy Petri Net for Web Services Discovery

**5.1. Web services discovery model based on LFPN** 

Web services are used for developing and integrating highly distributed and heterogeneous systems in various domains. They are described by Web Services Description Language (WSDL). Web services discovery is a key to dynamically locating desired Web services across the Internet [16]. It immediately raises an issue, i.e. to evaluate the accuracy of the mapping in a heterogeneous environment when user wants to invoke a service. There are two aspects which need to evaluate. One is functional evaluation. The service providing function should be completely matched with user's request; another aspect is non-functional evaluation, i.e. Quality of Service (QoS) meets user's requirement. UDDI (Universal Description, Discovery and Integration) is widely used as a kind of discovery approach for functional evaluation. But, as the number of published Web services increases, discovering proper services using the limited description provided by the UDDI standard becomes difficult [17]. And UDDI cannot provide the QoS information of service. To discover the most appropriate service, there are necessary to focus on developing feasible discovery mechanisms from different service description methods and service execution context. Segev proposed a service function selection method [21]. A two-step, context based semantic approach to the problem of matching and ranking Web services for possible service composition is elaborated. The two steps for service function selection are Context extraction and Evaluation for Proximity degree of Service. Cai proposed service performance selection method [3]. The authors used a novel Artificial Neural Network-based service selection algorithm according to the information of the cooperation between the devices and the context information. In this paper, we aim at analyzing different context of services and constructing a services discovery model based on the LFPN. Firstly, different service functional descriptions are used to evaluate service function and an appropriate service is selected. Secondly, context of QoS is used to predict QoS and a more efficient service is selected. Data of QoS is real number and LFPN learning algorithm is directly used. But service function description is literal. Therefore, a Learning Fuzzy Petri Net for service *W*=*F*→ *Keywords+*, where weight function on *Pinput×Tr* are different keywords of service description and weight function on *Tr×Poutput* are different service invoking information.

*D* = {*d*11,*<sup>a</sup>*, *d*12,*<sup>b</sup>*, *d*13,*<sup>c</sup>*}∪{*d*21,*<sup>e</sup>*, *d*22,*<sup>f</sup>* , *d*23,*<sup>g</sup>*, *d*24,*<sup>h</sup>* } is a finite set of propositions, where proposition *d*11, *<sup>a</sup>* is that *P*11 has a service description tokens; proposition *d*12, *<sup>b</sup>* is that *P*12 has a free textual description tokens; proposition *d*13, *<sup>c</sup>* is that *P*13 has a service operation and port parameters tokens. And the propositions *d*21, *<sup>e</sup>*, *d*22, *<sup>f</sup>*, *d*23, *<sup>g</sup>*, *d*24, *<sup>h</sup>* are that *P*21, *P*22, *P*23, *P*<sup>24</sup> have different invoking information tokens of services.

**Figure 13.** The learning fuzzy Petri net for Web service discovery (LFPNSD)

*α*(*dij*, *trk* )→ [0, 1]. *α*(*dij*, *trk*)=*yi*∈ [0, 1] is the degree of truth of proposition *dij* to *trk*. *α*(*dij*, *trk*) is computed by bellow rules: if input description has *n* keywords and the *wik* on arc *Pi* to *trk* has *s* same keywords, the degree of similarity between weight keywords and input description keywords is expressed as:

$$\alpha \left( d\_{ij}, tr\_k \right) = 1 - \frac{|m - s|}{\max(m, s)} \tag{36}$$

The fire rule of transition: if *α*(*d*11,*<sup>a</sup>*, *trk*) •*α*(*d*12,*<sup>b</sup>*, *trk*) •*α*(*d*13,*<sup>c</sup>*, *trk*) =max((*α*(*d*11,*<sup>a</sup>*, *tri*) •*α*(*d*12,*<sup>b</sup>*, *tri*) •*α*(*d*13,*<sup>c</sup>*, *tri*))1≤*i*≤*<sup>m</sup>*) and all of *α*(*d*11,*<sup>a</sup>*, *trk*), *α*(*d*12,*<sup>b</sup>*, *trk*), *α*(*d*13,*<sup>c</sup>*, *trk*) are bigger than a threshold value *th*, then *trk* fires, the tokens in *P*11*~P*13 are taken out and tokens which according to *wk*,21, *wk*,22, *wk*,23, *wk*,24 are put into *P*21*~P*24.

As shown in Figure 13, service free textual description, WSDL description and operation and port information are used as input vector in the learning algorithm. And, service classification, WSDL address, all of service operation names and service SOAP messages are used as output vector. Because the training data type is the keyword, the learning algorithm of LFPN is developed into a learning algorithm of LFPNSD. The learning algorithm of learning fuzzy Petri net for Web service discovery is shown in the table 5.

Construction and Application of Learning Petri Net 171

services have unbalance probability to fire transition at beginning stage of training. This makes the similar but different description services improperly fire a transition which

3. In step 2.3 of algorithm, when each of *α*(*dij*, *tr*1), *α*(*dij*, *tr*2), …, *α*(*dij*, *trm*-1) equates 0, it means all weights on transition *tr*1~ *trm*-1 cannot describe this service. Therefore, it is a new type service. If there is a transition which has weight arc, it is used to record the

The two simulations are carried out. One is a more efficient service selection through QoS prediction using LFPN. The other is a service selection for appropriate function using

During the process of Web services discovery, there are maybe several services which have same function. One service which has the best QoS needs to be select. Hereby, the service performance context is used to predict the QoS value for next execution of service. If the

In this simulation, LFPN is used as learning model for predicting service execution time which is main part of QoS. There are 11 inputs and 1 output in this model. 11 inputs include 10 data which are last 10 times execution time of a service and one data which is reliability of the service. The output is a prediction for execution time of service's next execution. 10

A Web service performance dataset is employed for simulation. This dataset includes 100 publicly available Web services located in more than 20 countries. 150 service users executed about 100 invocations on each Web service. Each service user recorded execution time and invocation failures in dataset [27]. We selected one use's invocation data as training data. Last 10 times execution time and reliability of each service was set as input and next time execution time was set as output. 20 sets of training data were selected for each of 100

The initial threshold is selected as 0.2 and the threshold is increased 0.001 at every training episode. The initial learning rate is set as 1/1.1 for every transition. The learning rate is 1/(0.1+*t*) when a transition fired *t* times. Prediction result and training output data are noted as *Outputpredict* and *Outputtraining*. Prediction precision probability *Prepro* is used to evaluate the

 *Prepro* =1-(|*Outputpredict*−*Outputtraining*|/ *Outputtraining*). Three different training stop conditions are set as that three threshold values equal to 0.7, 0.8, and 0.9. The simulation result is listed in Table 6. Here, the number of service, which their execution time is precisely predicted, increased with the training threshold value

has more keywords on its weight. It makes training efficiency lower.

new type service; else a new transition needs to be constructed.

prediction is precise enough, an appropriate service maybe selected.

precision result. And the precision probability is computed using:

**5.2. The result of simulation** 

*Simulation for more efficient Web service selection* 

transitions of LFPN is set when initialization.

LFPNSD.

services.

increasing.

#### **Learning Algorithm of LFPNSD:**

**Step 1**. Make all weights on arcs be �;

**Step 2**. For every service in training data set,


If every keyword in weight is in the input data, then compute *α*(*dij*, *trk*) according to formula (16), else set *α*(*dij*, *trk*) =0.

If each of *α*(*dij*, *tr*1), *α*(*dij*, *tr*2), …, *α*(*dij*, *trm-*1) equates 0 and the weight of *trm* is �, then set *α*(*dij*, *trm*) =1.

If each of *α*(*dij*, *tr*1), *α*(*dij*, *tr*2), …, *α*(*dij*, *trm-*1) equates 0�and *trm* doesn't exist, a new transition *trm* and the arcs which connect *trm* with input and output place are constituted, set weight of arcs to be ��and *α*(*dij*, *trm*) =1.


If training time is *t* and the weight is �, *t* keywords in service description are gotten and they are added into the weight.


**Step 3**. Repeat step 2, until each *α*(*d*11,*<sup>a</sup>*, *trk*), *α*(*d*12,*<sup>b</sup>*, *trk*), *α*(*d*13,*<sup>c</sup>*, *trk*) meets the requirement value *thk*.

**Table 5.** Learning algorithm of learning fuzzy Petri net for Web service discovery

Discussion:


services have unbalance probability to fire transition at beginning stage of training. This makes the similar but different description services improperly fire a transition which has more keywords on its weight. It makes training efficiency lower.

3. In step 2.3 of algorithm, when each of *α*(*dij*, *tr*1), *α*(*dij*, *tr*2), …, *α*(*dij*, *trm*-1) equates 0, it means all weights on transition *tr*1~ *trm*-1 cannot describe this service. Therefore, it is a new type service. If there is a transition which has weight arc, it is used to record the new type service; else a new transition needs to be constructed.
