Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

The Internet of Things (IoT) paradigm has envisioned and facilitated the interconnection and interoperation of smart things in a dynamic and pervasive environment [1]. Smart things typically serve as heterogenous sensor nodes and constitute wireless sensor networks (WSNs) for promoting domain applications. Due to the complexity, certain applications may require the collaboration of multiple sensor nodes. In this setting, the functional composition of heterogenous sensor nodes is a pressing and promising alternative, where the functionality of sensor nodes is usually encapsulated and represented in terms of a WSN service [5]. Different from traditional Web or REST services on the Internet, WSN services are usually spatial-temporal sensitive, and are mostly scarce in their energy, storage, and computational resources [7]. In this service-oriented WSNs, spatial-temporal-aware and energy-efficient techniques for the discovery and composition of WSN services are of importance.

Service discovery and composition is the long-standing research subject in the context of Web or REST services, and fruitful approaches have been proposed in recent years [3]. Generally, current approaches are promising and have inspired us when developing this technique. However, spatial and temporal-awareness and energy efficiency, which are core properties for WSN services, are not considered extensively, since they may not be relevant to traditional Web or REST services somehow. IoT resources can be encapsulated as IoT-based services, leveraging Device Profile for Web Services for instance [4], to accomplish complex tasks [5]. Generally, current approaches mainly examine the framework for the management and monitoring of IoT-resources composition, whereas the composition of IoT-based services is not explored extensively. Besides, service-oriented paradigm is adopted to promote the collaboration of sensor nodes [7] and mobile devices [2]. These approaches have explored the mobility, reliability, and spatial and temporal constraints, to the selection and composition of WSN services (or mobile devices). Usually, sensor nodes can have various functionalities, and a certain task may require the composition of heterogeneous sensor nodes. Given sensor nodes with a certain functionality, the selection of a certain sensor node should be remaining energy-aware, such that the network lifetime should be prolonged. We argue that connection-awareness and network-lifetime consideration should be important for the composition of WSN services, which has not been examined extensively at this moment, and should be explored further. To remedy this problem, this article proposes an energy-aware mechanism for promoting the composition of WSN services. Our contribution can be summarized as follows:

  • A three-tier service-oriented framework is proposed, where (i) sensor nodes are encapsulated as WSN services, (ii) WSN services are categorized to service classes according to their functionalities, and (iii) service classes are composed for fulfilling the requirement of domain applications.

  • Given a composition of service classes, WSN services are determined, when spatial- and temporal-constraints, and energy-efficiency, are considered. In fact, this can be reduced to the multi-objective and multi-constrained optimization problem, which can be solved through genetic or particle swarm optimization algorithms.

2 Service Classes Chaining and Recommendation

Before introducing the composing mechanism, we give a brief introduction of the concepts of WSN services. In this article sensor nodes are encapsulated and represented in terms of WSN services.

Definition 1

(WSN Service). A WSN service \(sev_{sn}\) is a tuple (nm, dsc, op, eng, spt, tpr), where (i) nm is the name, (ii) dsc is the text description, (iii) op is an operation, (iv) eng is the remaining energy, (v) spt is the spatial constraint, and (vi) tpr is the temporal constraint, of this service.

Generally, a sensor node may provide a single type of functionality. Therefore, a WSN service is assumed to have an operation, which is defined as follows:

Definition 2

(Operation). An operation op is a tuple (nm, InP, OutP), where nm is the name, and InP (or OutP) is the set of input (or output) parameters, of this operation.

Generally, a parameter can be defined by a string name, a type, and a text description. As aforementioned, service classes are abstracted from WSN services for supporting WSN services composition.

Definition 3

(Service Class). A service class \(sev_{cl}\) for a certain WSN service \(sev_{sn}\) is a tuple (nm, dsc, op), where nm, dsc, and op are the same as that of \(sev_{sn}\).

Intuitively, a service class corresponds to a set of WSN services which share a certain functionality. The invocation possibility between service classes is investigated and represented in terms of a service network.

Definition 4

(Service Network). A service network snSC is a directed graph, and represented as a tuple (SvC, Lnk, InvP), where SvC is the set of service classes, Lnk is the set of direct links that represent the invocation relationship between service classes, and InvP is the set of weights specified upon Lnk that represent the invocation possibility between service classes.

As presented at [9], the construction of service network is mostly to calculate the invocation possibility between service classes, and to prune the links which reflects a low possibility. Specifically, the degree of similarity for two parameters is calculated through aggregating the degree of similarity for their names and text descriptions. The invocation possibility of two service classes is calculated through considering (i) the invocation possibility of their operations, and (ii) the degree of similarity for their names and text descriptions. After computing the invocation possibility for all pairs of service classes, and pruning these invocation possibility whose degree is smaller than \(thd_{pi}\), a service network is constructed and represented as a directed graph, where the vertices correspond to service classes, and the weight specified upon directed links reflects the invocation possibility between service classes.

Leveraging the service network constructed, we propose the mechanism for the discovery and recommendation of service classes chains. We refer the reader to our previous work [9] for a detailed description about algorithms. Firstly, we determine the starting and ending service classes, and then candidate service classes chains are to be retrieved from the service network, which is performed through a graph depth-limited search algorithm with a pre-specified limitation on depth. These searched service classes chains (denoted CHN) are used for generating WSN services compositions in the following.

3 WSN Services Composition

After generating service classes chains (denote CHN) which can satisfy the requirement of domain application from the functional perspective, this section proposes to instantiate service classes chains as the composition of WSN services (denote comp(chn)), and to evaluate the applicability of these compositions, where the factors including spatial- and temporal-constraints, and energy-efficiency, are considered.

Generally, we propose to select the WSN services with higher spatial relevancy which provide sensory data for supporting application rq in longer time durations. The spatial relevancy (denote spt(sevrq)) between a certain WSN service sev and rq can be specified by the overlap between these geographical location that are all represented by a disk. And the temporal relevancy (denote tpr(sevrq)) is indicated by the overlap between the available time durations of sev and rq. On the other hand, we propose to minimize the energy consumption of the composition of WSN services comp(chn). Generally, the energy consumption (denote E(comp(chn))) for the composition of WSN services comp(chn) includes the following ingredients [8]: (i) Energy consumption for activating the instantiation of WSN services in comp(chn), (ii) Energy consumption for the communication between WSN services through transmitting and receiving data packets. Besides, WSN services should be balanced for avoiding over-consumption of any single WSN service. Before instantiating a service class with a WSN service sev, sev should have enough residual energy (denoted \(eng(sev_{i})\)) than required to be consumed (denoted \(E_{cst}(sev_{i})\)) for implementing a certain task. A load-balancing factor (denote lbf(comp(chn))) of a certain WSN service composition comp(chn) is specified by eng(sev) and \(E_{cst}(sev)\).

Given a service classes chain chn \(\subset \) CHN in terms of the sequence \(svC_{1}\) \(\rightarrow \) \(\ldots \) \(\rightarrow \) \(svC_{k}\), a certain service class \(svC_{i}\) (where i \(\in \) [1, k]) may be implemented by a set of WSN services \(SEV_{i}\). In this setting, discovering and selecting an appropriate WSN service from \(SEV_{i}\) as the instantiation of \(svC_{i}\), while taking the constraints as specified above into account, is the challenge to be addressed. Intuitively, this challenge can be formulated as a multi-objective and multi-constrained optimization problem, which is formally represented as follows:

  • Input Parameter Settings:

    1. 1.

      CHN = {chn}: service classes chains as discovered and recommended at Sect. 2.

    2. 2.

      spt(sevrq): spatial relevancy of sev with respect to application rq.

    3. 3.

      tpr(sevrq): temporal relevancy of sev with respect to application rq.

    4. 4.

      E(comp(chn)): energy consumption for a composition comp(chn).

    5. 5.

      lbf(comp(chn)): load-balancing factor of a composition comp(chn).

  • Output: WSN Services Composition:

    1. 1.

      comp(chn): the optimal WSN services composition with respect to CHN.

  • Multi-Objective Functions:

    1. 1.

      Minimize: \(Z_{min} = \left\{ E(comp(chn)) \right\} \)

    2. 2.

      Maximize: \(Z_{max} = \left\{ \varphi \cdot lbf(comp(chn)) + \beta \cdot spt(comp(chn)) \right. + \left. \gamma \cdot tpr(comp(chn)) \right\} \), where the factors \(\varphi \), \(\beta \), and \(\gamma \) are positive constant variables, and \(\varphi \) + \(\beta \) + \(\gamma \) = 1.

  • Constraints: For each \(sev_{i}\) \(\subset \) comp(chn) \((i \in [1, k])\), \(eng(sev_{i})\) \(\ge \) \(E_{cst}(sev_{i})\).

  • Fitness function: \(fitness(comp(chn)) = w_{min} \cdot Z_{min} - w_{max} \cdot Z_{max} = w_{min} \cdot E(comp(comp(chn))) - w_{max} \cdot (\varphi \cdot lbf(comp(chn)) + \beta \cdot spt(comp(chn)) + \gamma \cdot tpr(comp(chn))\), where \(w_{min}\) and \(w_{max}\) are objective weights representing the impact of \(Z_{min}\) and \(Z_{max}\), respectively, and \(w_{min}\) + \(w_{max}\) = 1.

Generally, the fitness function measures the extent that a certain WSN services composition comp(chn) can satisfy the objectives and constraints aforementioned, and an approximately optimal comp(chn) is found when fitness(comp(chn)) is relatively small in value.

To solve this multi-objective and multi-constrained optimization problem, two evolutionary algorithms, namely particle swarm optimization and genetic algorithm [6], are adopted in this article, and readers can refer to relevant works for their procedure. Through adopting PSO and GA techniques, an approximately optimal comp(chn) can be found with respect to CHN.

4 Conclusion

In this paper, a 3-tier service-oriented wireless sensor networks (WSNs) framework has been proposed, where sensor nodes are encapsulated as WSN services, and these WSN services are abstracted into service classes according to their functionalities. Consequently, the cooperation of sensor nodes is reduced to the discovery of service classes chains, which can be solved through current services composition approaches. The composition of WSN services is archived through discovering appropriate WSN services as the instantiation of each service class. This problem can be reduced to a multi-objective and multi-constrained optimization problem, which can be solved through adopting particle swarm optimization (PSO) algorithm and genetic algorithm (GA).