Keywords

1 Introduction

With the explosive growth of all kinds of services on the internet, how to discover the services that can meet user’s diversified and individualized requirements quickly is an urgent problem to be solved in Service-oriented computing [1].

Services can be organized using some approaches, and this can help users discover the services efficiently and exactly. Service clustering methods cluster the services which realize similar function goal but have different QoS values into service clusters. In addition, some approaches are used to organize services, such as petri net-based [2], community-oriented [3], Multi-granularity [4], workflow method [5], FCA [6], VINCA [7], etc. These methods organize services from different views, like service execution constraint relationship, service behavior, etc. The problem is how to quickly discover the services which can realize service composition according to specific service request. In addition, in the fast-changing web environment, how to dynamically add new services to the proper position to realize service composition is another problem to be solved urgently. The existing service organization methods are lack of the consideration of these aspects.

This paper uses the Decorator Pattern ideology to organize service clusters according to the collaborative relationships between them. The decorated service clusters are selected firstly, then it uses tree structure to express concrete service organization construction and this can help to realize service discovery smoothly. Through this method, the composite services can be found more efficiently and services can be added to the service organization dynamically.

2 The Related Work

There exists some research work about the service organization. Wu et al. have used a logical petri net-based approach to compose service clusters in a virtual layer [2]. Services are clustered in [9] according to the service node, and services are organized from the aspect of business logic integration. Aznag et al. in [6] have used the Formal Concept Analysis (FCA) formalism to organize the constructed hierarchical clusters into concept lattices according to their topics. Sellami et al. have used community to organize and manage Web services [3]. The method in [5] mainly organizes services in the view of service execution process, and it can’t deal with the situation of adding services to the service organization dynamically. The method in [7] supports business user programming and composition services are formed according to the business process. Zhou et al. have concentrated on the research of data providing services discovery [10]. They have not elaborated the detail process of how to organize service clusters. On the basis of Web service clustering, we have organized the service clusters from aspects of semantic interoperability [11] and users’ requirement features (role, goal, process) [4].

Liu et al. in [12] have aggregated and organized services according to the users’ personal requirements and only the atomic services can be discovered. A user-centric service composition method starts from users’ needs and it realizes service organization in the exploratory manner [13]. Ye et al. have proposed a new concept, Autonomous Web Service (AWS), to search requirement autonomously [14]. The above three methods use different methods to organize services from users’ requirements directly. But it does not organize services according to the users’ requirements in real time and it can lay the foundation of on-demand service selection. The method in [15] mainly concentrates on the service interoperability but not the service clustering and organization. In the above approaches, the clustering method is not used and it can’t deal with the services which realize similar function but have different QoS values. Therefore, the service discovery efficiency will be influenced.

3 Service Organization

3.1 Decorator Pattern

The class diagram of Decorator Pattern [8] is shown in Fig. 1.

Fig. 1.
figure 1

The UML of Decorator Pattern.

3.2 The Rules of Organizing Service Clusters

The organization rules mainly include the following aspects.

  1. (1)

    The collaborative relationships between service clusters are used to describe the “decorative” and “decorated” relationship.

  2. (2)

    The role of Component interface is reflected in two aspects. On one hand, the collaborative relationships between service clusters are stored through the Component interface. On the other hand, the specific function that can be realized by service clusters collaboration can be manifested through it.

  3. (3)

    When new services are added into the service group, the corresponding Decorator and Component Interface will be created.

3.3 Service Clusters Organization

Example 1.

The following are some different service clusters: WS = {WS_A, WS_B, WS_C, WS_D, WS_E, WS_F, WS_G}. The collaborative relationships among them are shown in Fig. 2.

Fig. 2.
figure 2

The service clusters collaborative relationships.

Algorithm 1 is used to generate the tree structure of organizing services using Decorator Pattern ideology.

In the step 2–4 of the above algorithm, the constructing graph method is used to determine the degree of every service cluster. In step 5–15, the ComponentNode, DecoratorNode and ServiceNode of the corresponding ws i in CeCluster are constructed firstly. Then the relationship between nodes is added into tree. The relations between nodes of ws are added into tree through step 16–25.

  1. (1)

    Selection of decorated service clusters

    We select the appropriate service clusters in CeCluster to play the role of ConcreteComponent in Fig. 1. These service clusters are called as the “decorated” service clusters. And we denote the “decorated” service clusters as central service clusters. It selects the central service clusters using the constructing graph method.

    1. (1)

      The service clusters in CeCluster are denoted by nodes and the specific collaborative relationships between them are denoted by edges of graph. Through this method we can construct the graph of CeCluster. It is shown in Fig. 3.

      Fig. 3.
      figure 3

      The figure of graph.

    2. (2)

      Then we calculate the degree for each node and the degree of node x can be denoted as C(x). We can get C(WS_A) = 4, C(WS_C) = 3, C(WS_B) = C(WS_D) = C(WS_E) = C(WS_F) = C(WS_G) = 1.

    3. (3)

      The node whose degree is more than one will be selected to be the central service clusters. That means the node of “decorated” service clusters have at least two edges in the graph. WS_A and WS_C are selected as central service clusters and they are the “decorated” service clusters in Decorator Pattern.

  2. (2)

    Service organization

    The organization detail of service clusters is shown in Fig. 4.

    Fig. 4.
    figure 4

    The service clusters organization using Decorator Pattern.

In Fig. 4, we can conclude that WS_A is decorated by WS_B, WS_C, WS_D and WS_E. The corresponding Interface and Decorator are Component_1 and Decorator_1. Both WS_F and WS_G decorate WS_C. There exist service clusters to decorate WS_C, the Component_2 and Decorator_2 are constructed.

In Algorithm 1, the tree structure is constructed to express service clusters organization using UML. The tree structure of Fig. 4 is shown in Fig. 5. In the figure, A represents WS_A, 1 represents Component_1 and 1ʹ represents Decorator_1, etc.

Fig. 5.
figure 5

The tree structure of service clusters organization.

3.4 Add Services Dynamically

We use the following method to add new service clusters to service cluster organization dynamically.

Example 2.

There are some service clusters to be added: WS_K, WS_H, WS_I, WS_J. Their collaborative relationships are shown in the following: <WS_K, WS_A>, <WS_H, WS_A>, <WS_H, WS_I>, <WS_H, WS_J>.

  1. (1)

    There exists collaborative relationship of Sequence between WS_K and WS_A. WS_A is a central service cluster as shown in Fig. 4. WS_K is added into the organization as a “decorative” service cluster of WS_A.

  2. (2)

    We can discover that WS_H is a central service cluster among WS_I, WS_J and WS_H. As shown in the grey area of Fig. 4, WS_H, WS_I and WS_J are organized according to the relationships between them. WS_H is the “decorated” service cluster. WS_I and WS_J are the “decorative” service clusters. New components called Component_3 and Decorator_3 are constructed towards WS_H. The relationship between WS_H and WS_A is Sequence. We use WS_H to decorate WS_A. Then WS_H, WS_I and WS_J are dynamically added to the service cluster organization which already includes WS_A. They are shown in the gray area of Fig. 4.

4 Service Finding

Algorithm 2 is used to find the corresponding service clusters that include services to realize composition for a given service cluster.

For node D in Fig. 5, we can get service cluster composition of A→D through step 3–5 in Algorithm 1. For node C, we can get A→C through step 7. And we get C→G and C→F through step 9–13. Then we can get A→C→G and A→C→F.

Algorithm 3 is used to find services according to the users’ specific requests.

In the step of 2–4, the corresponding tree node will be found firstly. Then it uses GetCollaNode() in Algorithm 2 to find the nodes which has relationship with the node using step 5. It uses step 8–14 to find the services with proper QoS values in the service clusters. The notation of \( \beta \) in step 3 is the threshold of similarity between service request and service provider.

5 Experiment and Evaluation

5.1 Experiment Environment

Software Environment: Windows XP, MyEclipse 6.0, Pellet reasoner, OWL-S API (http://www.mindswap.org/2004/owl-s/api/), xampp (http://www.apachefriends.org/en/xampp.html); Hardware Environment: CPU: double Intel (R) Core (TM)2 i5 CPU 760@ 2.80 GHz, Memory: 4G; Dataset: OWL-TC (http://projects.semwebcentral.org/projects/owls-tc/). We do the experiments in the education area.

5.2 Experiment and Analysis

We do the experiments in the education area within 300 services. The number of services that is included in every service cluster is shown in Table 1.

Table 1. The number of services in different service clusters.

The Workflow [6] method uses the work-flow approach to organize the service clusters. And we denote the method that does not cluster and organize services as the Random method.

Experiment 1.

Comparison of atomic service finding efficiency and numbers.

In the case of using the Workflow, Random and Decorator Patten method to organize services, the experiment result is shown is Figs. 6 and 7.

Fig. 6.
figure 6

Comparison of atomic service finding numbers.

Fig. 7.
figure 7

Comparison of atomic service finding time.

We can conclude that the atomic service discovery recall rate of Random method is the best, but its efficiency is the lowest of all. The atomic service finding efficiency and recall rate of Workflow and Decorator Pattern method is about same.

Experiment 2.

Comparison of composite service finding efficiency and recall rate.

The service finding time is shown in the following Fig. 8.

Fig. 8.
figure 8

Comparison of composite services finding time.

We can see the service finding time that uses Decorator Pattern and the Workflow methods to organize service clusters is significantly less than the time of the Random method. In Fig. 9, we can see the composite service finding recall rate is about same through the methods of Workflow, Random and Decorator Pattern. The recall rate of the Random method is about 100 %, and the rate of the other two methods is about 96 %.

Fig. 9.
figure 9

Comparison of composite service finding recall rate.

5.3 Service Finding Complexity Analysis

Supposing the total number of services is N, the number of service clusters is m and the number of central service clusters is n. Nm>n. The average number of service clusters that have collaborative relationships with one central service cluster is (mn)/n. The service finding complexity comparison is shown in Table 2.

Table 2. Comparison of service finding complexity.

We can conclude that the complexity of Random method is the largest of all apparently. Our Decorator Pattern method is lower than the Workflow method.

6 Conclusion

In order to enhance service (including atomic and composite service) discovery efficiency, this paper uses the Decorator Pattern ideology to organize the service clusters. This approach not only realizes services to be added dynamically, but also enhances the efficiency of service discovery. The next research work is to set the threshold automatically according to the experiment result. The services will be organized from the semantic level to realize interoperable organization.