Service Composition in Service-Oriented Wireless Sensor Networks with Persistent Queries
ABSTRACT Service-oriented wireless sensor network(WSN) has been recently proposed as
an architecture to rapidly develop applications in WSNs. In WSNs, a query task
may require a set of services and may be carried out repetitively with a given
frequency during its lifetime. A service composition solution shall be provided
for each execution of such a persistent query task. Due to the energy saving
strategy, some sensors may be scheduled to be in sleep mode periodically. Thus,
a service composition solution may not always be valid during the lifetime of a
persistent query. When a query task needs to be conducted over a new service
composition solution, a routing update procedure is involved which consumes
energy. In this paper, we study service composition design which minimizes the
number of service composition solutions during the lifetime of a persistent
query. We also aim to minimize the total service composition cost when the
minimum number of required service composition solutions is derived. A greedy
algorithm and a dynamic programming algorithm are proposed to complete these
two objectives respectively. The optimality of both algorithms provides the
service composition solutions for a persistent query with minimum energy
consumption.
-
Citations (0)
-
Cited In (0)
Page 1
arXiv:1202.3254v1 [cs.NI] 15 Feb 2012
Service Composition in Service-Oriented Wireless
Sensor Networks with Persistent Queries
Xiumin Wang† ⋆, Jianping Wang⋆, Zeyu Zheng⋆, Yinlong Xu†, Mei Yang‡
†Department of Computer Science, University of Science and Technology of China, China
⋆Department of Computer Science, City University of Hong Kong, Kowloon, Hong Kong
‡Department of Electrical and Computer Engineering, University of Nevada, Las Vegas
Email: {wxiumin2,jianwang}@cityu.edu.hk, zzeyu2@student.cityu.edu.hk, ylxu@ustc.edu.cn, meiyang@egr.unlv.edu
Abstract—Service-oriented wireless sensor network(WSN) has
been recently proposed as an architecture to rapidly develop
applications in WSNs. In WSNs, a query task may require
a set of services and may be carried out repetitively with
a given frequency during its lifetime. A service composition
solution shall be provided for each execution of such a persistent
query task. Due to the energy saving strategy, some sensors
may be scheduled to be in sleep mode periodically. Thus, a
service composition solution may not always be valid during the
lifetime of a persistent query. When a query task needs to be
conducted over a new service composition solution, a routing
update procedure is involved which consumes energy. In this
paper, we study service composition design which minimizes the
number of service composition solutions during the lifetime of
a persistent query. We also aim to minimize the total service
composition cost when the minimum number of required service
composition solutions is derived. A greedy algorithm and a
dynamic programming algorithm are proposed to complete these
two objectives respectively. The optimality of both algorithms
provides the service composition solutions for a persistent query
with minimum energy consumption.
Keywords: Service composition, Wireless sensor network,
Routing, Query.
I. INTRODUCTION
Service-oriented architecture in WSNs[1], [2] makes it
possible to rapidly develop new applications. In a service-
oriented WSN, a typical application requires several different
services, e.g., data aggregation, data processing, decoding,
which are provided by service providers that are also sensors.
The task of service composition is to assign each required
service to an appropriate service provider according to certain
criteria. Service composition with various performance metrics
[3], [4], [5], e.g., load balance, end-to-end delay and resource,
have been well studied. Service composition in WSNs has also
recently been studied in [6], [7]. [6] studies the minimum-cost
service placement based on service composition graphs with
a tree structure. [7] considers the optimal placement of filters
(services) with different selectivity rates.
Habitat and environmental monitoring represent a class of
WSN applications. The queries in such applications in general
are persistent (or recurrent) queries which need to be pro-
cessed repetitively with a given frequency for a given duration
[1], e.g., an application requests receiving images in which the
monitored area is dimly lit from 9:00am to 5:00pm[7]. Three
services are required in such a persistent query: service s1
checking for dim images, service s2checking for ”sufficient”
motion between successive frames, and service s3fusing the
identified motions(e.g., the appearance of a suspect). In a
service-oriented WSN, such services are provided by sensor
nodes in the network, thus, in-network processing is feasible,
to reduce the possibly massive amounts of raw data.
In WSNs, energy consumption is a critical issue and sleep
scheduling has been well studied as a conservative approach
to save energy [8], [9]. When a node is in sleep mode,
all its provided services are not available, which may cause
disruption to service composition. [9] studied a cross-layer
sleep scheduling design in a service-oriented WSN which
considers system requirement on the number of active service
providers for each service at any time interval.
In a service-oriented WSN, a query routing procedure which
routes requesting services towards service providers is neces-
sary. For a persistent query, the query routing procedure might
need to be conducted many times during its lifetime due to the
sleep schedule in the MAC layer, which might introduce more
energy consumption. Take the query that starts at 09:00am and
ends at 5:00pm with a frequency of 100s as an example. In
Fig. 1(a), at 09:00am, a path is chosen to provide the requested
services, while after 100s one of the sensors in this path
switches into sleep mode, which results in unavailability of the
service composition path. It is necessary to conduct the query
routing procedure again to find a new service composition
path as shown in Fig. 1(b). In this paper, we aim to use the
minimum number of service composition solutions during a
persistent query’s lifetime such that the energy consumption
caused by repetitively conducting query routing procedure is
minimized. Once the minimum number of required service
composition solutions is derived, we then select the service
composition solutions with minimum transmission cost.
The contribution of the proposed work is summarized as
follows:
• We propose a service-oriented query routing protocol.
Traditional routing in WSNs only involves finding a path
from source sensors to a sink. Service-oriented query
routing protocol needs to ensure that the path from source
sensors to the sink includes service providers, which
imposes new challenges to routing in WSNs.
• We propose an optimal greedy algorithm to minimize the
number of required service composition solutions during
a persistent query’s lifetime, which can minimize the
Page 2
energy consumption caused by conducting the service-
oriented query routing protocols.
• We propose a dynamic programming algorithm to min-
imize the total service composition cost which aims to
reduce the transmission cost in executing a query.
?
p?1?:? {? s?1?}?
p?2?:? {? s?2?}?
p?4?:? {? s?3?}?
p?3?:? {? s?2?}?
active ?service provider ?
sleep? ? service provider ?
sink?
(? a? ) ? service composition path ?at ? 09? :? 00? :? 00? am?
p?1?:? {? s?1?}?
p?2?:? {? s?2?}?
p?4?:? {? s?3?}?
p?3?:? {? s?2?}?
(? b? ) ? service composition path ?at ? 09? :? 01? :? 40? am?
relay sensor?
source sensor?
sink?
Fig. 1.
WSN
A persistent query requesting s1→ s2→ s3in a service-oriented
The rest of the paper is organized as follows. The network
architecture and problem definition are given in Section II
and III respectively. The algorithms and simulation results
are presented in Section IV and V respectively. We conclude
the paper in Section VI.
II. NETWORK ARCHITECTURE
In our network architecture, the service providers form a
service provider overlay network as shown in Fig. 2. Two
service providers in the service provider overlay network may
be multiple hops away from each other and the communication
between them can be a multi-hop communication in the same
WSN or through existing 802.11 WLAN.
The service-oriented architecture at the sink has the follow-
ing three layers:
• service composition query layer. This layer maps an ap-
plication’s query into a service composition query which
specifies required services and their invocation order. For
example, the aforementioned query will be converted to
a service composition query with services s1, s2and s3.
• service layer. This layer has the service information pro-
vided by the sensors in service provider overlay network.
We also assume that service layer has the sleep sched-
ule information of service providers in service provider
overlay network.
• service composition layer. This layer finds the service
composition solutions for service composition queries,
which is the problem to be studied in this paper. For a
persistent query, the service composition layer may find
several service composition solutions during its lifetime
since some service composition solutions may not always
be feasible due to sleep schedule. The service composi-
tion solutions are maintained in a service composition
table as shown in Fig. 2.
The service composition solution only specifies a service
provider for each required service in a service composition
query. Once the service composition solutions are identified, a
09? :? 00? am? -? 11? :? 00? am?
11? :? 00? am? -? 2? :? 00? pm?
2? :? 00? pm? -? 5? :? 00? pm?
s?1?/? p?1?-? >? s?2?/? p?2?-? >? s?3?/? p?3?
s?1?/? p?4?-? >? s?2?/? p?5?-? >? s?3?/? p?6?
s?1?/? p?1?-? >? s?2?/? p?5?-? >? s?3?/? p?7?
interest?
p?1?
p?2?
p?3?
Service composition query ?
routing message?
interest?
interest?
Service provider ?
overlay network?
Sensor network? ?
...?
...?
Interest message?
p?4?
Service composition table?
Service composition query layer?
Service layer?
Service composition layer?
Fig. 2.System model
routing protocol is invoked to find paths from source sensors
to the first service provider in the service composition solution
and find paths between any two adjacent service providers. In
this paper, we propose the following service-oriented query
routing protocol:
• The sink broadcasts a service composition query routing
message which includes service composition solution,
duration, and interest. Such a message will reach all
service providers in service provider overlay network.
• Upon receiving a service composition query routing mes-
sage, if a service provider is the first service provider
in the service composition solution, it will broadcast
the interest to the sensor network. Source sensors can
then send the data to the first service provider using
any data-driven routing protocol in WSNs. Thus, service
composition is transparent to source sensors.
• Upon receiving a service composition query routing mes-
sage, if a service provider is in the service composition
solution but not the first service provider, it needs to find
a path to its upstream service provider in the service
composition solution. This can be done by any routing
protocol in WSNs.
During the lifetime of a persistent query, it may be necessary
to switch the service composition solutions due to the sleep
schedule of service providers. The service-oriented query
routing protocol needs to be conducted again when the service
composition solution changes, which consumes more energy.
The rest of the paper focuses on the service composition
with minimum cost to avoid the frequent change of service
composition solutions during a persistent query’s lifetime.
Notice that the service-oriented query routing protocol is
a distributed routing protocol. The sink only generates the
service composition solutions which determines an appropriate
service provider for each required service. To make such a de-
cision, the sink only needs to maintain the services availability
and the sleep schedule information of each service provider.
In a large-scale WSN, service providers are only a small
portion of the whole network. We believe that maintaining
such information at the sink is well-paid when the duration of
a persistent query is long.
III. PROBLEM DESCRIPTION
let S = {s1 → ··· → sm} be a persistent service
composition query and P = {p1,···,pn} be service providers.
Page 3
Let Si be the set of services that sensor pi can provide and
Pj be the set of sensors that can provide service sj. Fig 3(a)
shows the service availability at the service layer. Given the
duration D and the frequency T of a persistent query, the
query should be executed for
and we assume thatD
of k-th execution of the persistent query where 1 ≤ k ≤D
Given the sleep schedule information of the service providers
at the service layer, the sink can derive each service provider’s
availability at tk. Let xikbe 1 if service provider piis active
at tk, otherwise, set xik be 0. Figure 3(b) gives the service
provider availability at the service layer.
With the service availability and the service provider avail-
ability information, the service composition layer can derive a
service composition solution at tkfor 1 ≤ k ≤D
Fig. 3(c), the service composition solution s1/p1→ s2/p8→
s3/p1 is valid at t1,t2 and t3, s1/p2 → s2/p6 → s3/p4 is
valid at t4 and t5 and so on. During this persistent query’s
lifetime, 4 service composition solutions are required and
thus the service-oriented query routing protocol needs to be
conducted 4 times, which consumes energy. This paper aims
to minimize the number of service composition solutions for
a persistent query.
D
Ttimes during its duration D
Tis an integer. Let tk be the start time
T.
T. As shown in
p?1?
1?
0?
1?
p?8?
0?
1?
0?
p?7?
0?
0?
1?
p?6?
0?
1?
0?
p?5?
0?
0?
1?
p?4?
1?
0?
1?
p?3?
1?
1?
0?
p?2?
1?
0?
0?
s?1?
s?2?
s?3?
(? a? ) ? service availability?
p?1?
p?2?
p?8?
(? b? ) ? service provider availability?
p?7?
p?6?
p?5?
p?4?
p?3?
t?1?t?2?t?3?t?4?t?5?t?6?
1?1? 1?
1?1? 0?
1? 1?0?
0?1? 0?
0?
1?0?
1?
t?10?
1?
0?
1?
t?7?t?8?t?9?
0?1?
1?0?
1?1?
1?1?
1?1?
1?
0?
1?
0?
0?
1?
1?
0?
1?
0?
0?
1?
1?
1?
1?
0?
1?
1?
1?
1?
0?
0?
1?
1?
0?
1?
0?
1?
0?
0?
1?
1?
0?
0?
1?
1?
1?
0?
0?
1?
1?
0?
0?
1?
1?
1?
1?
1?
1?
0?1?
t?1?
t?2?
t?3?
t?4?
t?5?
t?6?
t?7?
t?8?
t?9?
t?10?
( ? c ? ) ? service composition solutions?
Service composition solutions?
s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?1?
s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?1?
s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?1?
s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
s?1?/? p?1?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
s?1?/? p?1?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
s?1?/? p?3?-? >? s?2?/? p?3?-? >? s?3?/? p?4?
s?1?/? p?3?-? >? s?2?/? p?3?-? >? s?3?/? p?4?
s?1?/? p?3?-? >? s?2?/? p?3?-? >? s?3?/? p?4?
Fig. 3.
s1→ s2→ s3in a service-oriented WSN
An example of service composition for a persistent query requesting
Let yk be 1 if the service composition solution at tk is
different from that at tk−1, otherwise let yk be 0. Then
Y =?D
solutions during a persistent query’s lifetime, which needs to
be minimized. Under such an objective, a service composi-
tion solution may be used continuously in order to reduce
the energy consumed by frequently invoking service-oriented
query routing protocol. Although some service providers may
be used continuously, this will not decrease the longevity of
network. Since if a service provider is to be active, it has to
provide services for the system according to sleep scheduling.
Though the service-oriented query routing procedure is the
major source of energy consumption, the transmission of the
data from the source sensor to the sink also consumes energy.
Two service providers in the service provider overlay network
may be multiple hops away and if the communication between
them is through the same service-oriented WSN, relay sensors
may also be in sleep mode. Thus, even a service composition
solution can be used continuously over multiple executions,
a local routing discovery procedure may be invoked between
T
k=1ykrepresents total number of service composition
two service providers due to the sleep scheduling. We use
average transmission cost between two service providers to
characterize such energy consumption caused by the local
routing discovery between two service providers.
t?1?
t?2?
t?3?
t?4?
t?5?
t?6?
t?7?
t?8?
t?9?
t?10?
Service composition solution?
r?1?: ? s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?1?
r?1?: ? s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?1?
r?1?: ? s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?1?
r?2?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
r?2?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
r?3?: ? s?1?/? p?5?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
r?3?: ? s?1?/? p?5?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
r?3?: ? s?1?/? p?5?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
r?4?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?5?
r?4?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?5?
Total cost? :?
t?1?
t?2?
t?3?
t?4?
t?5?
t?6?
t?7?
t?8?
t?9?
t?10?
Service composition solution?
r?1?: ? s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?6?
r?1?: ? s?1?/? p?1?-? >? s?2?/? p?8?-? >? s?3?/? p?6?
r?2?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
r?2?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
r?2?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?4?
r?3?: ? s?1?/? p?5?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
r?3?: ? s?1?/? p?5?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
r?3?: ? s?1?/? p?5?-? >? s?2?/? p?3?-? >? s?3?/? p?1?
r?4?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?5?
r?4?: ? s?1?/? p?2?-? >? s?2?/? p?6?-? >? s?3?/? p?5?
(? a? ) ? service composition solution set I ?
(? b? ) ? service composition solution set II?
cost?
20?
20?
20?
10?
10?
18?
18?
18?
25?
25?
184?
cost?
20?
20?
10?
10?
10?
18?
18?
18?
25?
25?
174? Total cost? :?
Fig. 4.
consideration of transmission cost
Besides minimizing the number of service composition so-
lutions during a persistent query’s lifetime, it is also important
to minimize total transmission cost. In Fig. 4, there are two
sets of service composition solutions for a persistent query
and Both include 4 service composition solutions during the
persistent query’s lifetime. Thus, these two sets of service
composition solutions consumes the same energy caused by
service-oriented query routing procedure. In the first set,
r1,r2,r3,r4 will be used for 3 times, twice, 3 times and
twice respectively with a total cost of 184. In the second set,
r1,r2,r3,r4will be used for twice, 3 times, 3 times and twice
respectively with a total cost of 174. Thus, the second set of
service composition solutions will be more energy efficient.
In this paper, firstly, we aim to minimize the number of
service composition solutions during a persistent query’s life-
time. Such a problem is referred to as problem P1. Secondly,
we need to minimize the total cost of the service composition
solutions. Such a problem is referred to as problem P2.
IV. ALGORITHM DESIGN AND ANALYSIS
In this section, we first approach problem P1. Then based
on the result of P1, we approach the second problem P2.
A. Greedy algorithm for problem P1
Let avlikbe the number of executions that service provider
pi can be continuously available from k-th execution (in-
cluding at k-th execution). For example, if pi’s availability
at all execution instances of a persistent query is given as
1100111001, avli1 is 2 since pi can be available at 1st and
2nd execution, avli3is 0 as piis not available at 3rd execution.
The greedy algorithm which is shown in Algorithm. 1 is
always to select the service provider with maximum avlik
for each sj in k-th execution such that the solution can
be continuously used for the maximum number of times.
After the service composition solution is determined for k-th
execution, the number of times that this solution can be used is
determined by the minimum avlikamong all selected service
providers. Let SCk be the set of selected service providers
for k-th execution and numh be the number of times that
h-th service composition solution can be continuously used.
The worst case running time of this greedy algorithm is
O(D
?D
Service composition solutions for a persistent query with the
Tmn).
T
k=1yk gives the minimum number of service
Page 4
composition solutions during a persistent query’s lifetime.
We now prove the optimality of the greedy algorithm. Let
Y =
?D
algorithm where yl1= 1,yl2= 1,···,ylY= 1. Let Y′be
an optimal solution where yl′
Lemma 1 Forany sequence
l′
≤
must always exists l1≥ l′
Proof: We use induction to prove this lemma. Firstly, for
b = 1, it is obvious that l1= l′
algorithm always selects the provider with maximum avlik
for each service, the value of (l2− l1) − (l′
no less than 0, so l2≥ l′
ld≥ l′
is a service composition solution which can be continuously
used from l′
l′
greedy algorithm always selects the service providers which
can provide longest continuous services. In both cases, we
have ld+1≥ l′
T
k=1yk be the solution obtained from the greedy
1= 1,yl′
2= 1,···,yl′
l1,···,lb,···,lr
≤min{Y,Y′}, there
b,···,lr≥ l′
Y′= 1.
and
1,···,l′
b,···,l′
r where 1r
1,···,lb≥ l′
r.
1= 1. When b = 2, as greedy
2− l′
1) must be
2. Assume that when b = d we have
d. For b = d + 1, in the given optimal solution, there
dto l′
d+1> ld, then we must have ld+1≥ l′
d+1. If l′
d+1≤ ld, then we have ld+1≥ ld≥
d+1; If l′
d+1since the
d+1. Thus, lemma holds when b = d + 1.
Algorithm 1: Greedy algorithm
begin
avlik= 0, SCk= ∅ and yk= 0 where 1 ≤ h ≤D
1 ≤ k ≤D
h = k = 1;
for k = 1 toD
for pi∈ P do
calculate the value of avlik;
end
end
while k ≤D
for each service sj ∈ S do
SCk= SCk∪ arg maxpi∈Pj{avlik}.
end
numh= minpi∈SCk{avlik};
yk=1; k = numh+ k; h = h + 1;
end
T, 1 ≤ i ≤ n,
T;
Tdo
Tdo
end
Theorem 1 Y , the solution obtained from the greedy algo-
rithm, must be optimal.
Proof: We prove it by contradiction. Assume that there
exists Y > Y′, then lY > lY′. According to lemma 1, we
also have lY′ ≥ l′
is shown in Fig. 5. Fig. 5 denotes that there exists a service
Y′. The relationship among lY, l′
Y′, and lY′
k?l?1?/? l’?1?
2?
...?
...?
...?
...?
1?
...?
1?
y?k?
y?k’?
...?
l?Y?
...?
l?Y’?
...?
...?
l’?Y’?
0? 0?0? 0?0?
0? 1?
...?
1?
...?
1?
Fig. 5.The value of ykand yk′
composition solution which can cover executions from lY′ to
lY. According to our greedy algorithm, we can find a solution
which can be continuously used from lY′-th execution to the
last execution. Thus Y = Y′, which conflicts the assumption.
B. Minimize the total service composition cost
In the following, we approach problem P2 which minimizes
the total routing cost based on the result of problem P1.
Let Solk,q be the set of feasible service composition solu-
tions at k-th execution which can be continuously used for the
following q executions. For any service composition solution
X ∈ Solk,q, let ck,q(X) be transmission cost if X is selected
to be executed once. Let C(k,q) = minX∈Solk,qck,q(X).
C(k,q) can be obtained by finding a shortest path in an
auxiliary graph G = (V ;E) which is constructed as follows:
• V is the set of nodes consisting of m layers V1,...,Vm
and the jthlayer Vjcontains all service providers which
can continuously provide sj from k-th execution to
(k + q)-th execution, e.g., if pi can provide sj and it
is available from k-th execution to (k + q)-th execution,
node vji∈ Vj.
• Let E be the link set such that there is a direct link
ej−1,i,j,h ∈ E whenever v(j−1)i∈ Vj−1 and vjh ∈ Vj
for j ∈ {2,...,m}. The cost of ej−1,i,j,his the shortest
path cost from pito phin the physical network.
• Add two special nodes s and d such that {s} is the 0th
layer and {d} is the (m+1)thlayer. Link s to each node
in V1and link each node in Vmto d with cost 0.
Algorithm 2: Dynamic programming algorithm
begin
for k = Y toD
cost(k,Y ) = C(k,D
end
for h = Y − 1 downto 1 do
for k = h to (D
cost(k, h) = minq∈[1,D
sw[h,k] = q;
end
end
k = 1;
for h = 1 to Y do
times = sw[h,k];
route[h] ← the service composition solution with minimum
C(k,times) ;
k = k + times;
end
Tdo
T− k + 1) ∗ (D
T− k + 1);
T− Y + h) do
T](C(k, q)∗q+cost(k+q, h+1));
end
Let cost(k,h) be the minimum total cost from k-th execu-
tion to the last execution if h-th service composition solution
starts at k-th execution. Then we have the following recursion:
cost(k,h) = minq(C(k,q) ∗ q + cost(k + q,h + 1))
where 1 ≤ h ≤ Y,h ≤ k ≤D
boundary condition:
T−Y +h. We have the following
cost(k,Y ) = C(k,D
T− k + 1) ∗ (D
T− k + 1)
for k = Y,...,D
The dynamic programming is given in Algorithm. 2 in
which cost(1,1) is the minimum total cost for the persistent
query and route[h] stores h-th service composition solution.
The time complexity of the algorithm is O((D
V. SIMULATION RESULTS
In this section, we first introduce the design of our sim-
ulation. The number of service providers dj of each service
is randomly generated between [15%n,25%n]. We then ran-
domly generate djservice providers for sjfrom p1,p2,...,pn.
For each pi, we also randomly generate its availability at each
execution. Then we validate whether each sjcan be provided
T.
T)3).
Page 5
by at least one active service provider at each execution. If
infeasible, the instance is dropped from our simulation.
To compare the performance of our algorithms, we also
introduce a baseline algorithm named min-cost-based algo-
rithm which aims to select the service composition solution
with minimum transmission cost for each execution. We
compare the number of service composition solutions during
a persistent query’s lifetime and the total transmission cost of
our algorithms with min-cost-based algorithm respectively.
1015 202530 35 40
5
10
15
20
25
30
35
The value of (D/T)
The number of service composition solutions
Greedy algorithm
Min−cost−based algorithm
Fig. 6.
algorithm versus the value ofD
Minimum number of service composition solutions with greedy
T
In the first set of experiments, we evaluate the performance
of algorithms by varyingD
m = 20,n = 40. The effectiveness of greedy algorithm for
P1 is tested by comparing with min-cost-based algorithm. As
shown in Fig. 6, the number of service composition solutions
during persistent query’s lifetime in greedy algorithm is much
less than that in min-cost-based algorithm. For example, with
D
T= 40, the number of service composition solutions in our
greedy algorithm is only 21 while it is 32 in min-cost-based
algorithm. The difference between two algorithms increases
with the number of query’s executions, which demonstrates
the effectiveness and scalability of our work.
Fig. 7 illustrates that total service composition cost obtained
from dynamic programming based on the result of the greedy
algorithm is higher than that obtained from min-cost-based
algorithm. As we explained in section III, the energyconsumed
in service-oriented query routing protocol is much higher
than that in conducting service composition. Thus, though
the solution obtained from our algorithms may consume more
energy in the service composition phase, it consumes much
less energy in service-oriented query routing phase which is
the major energy consumption source in a persistent query.
In the second set of our experiments, we study in detail
the impact of the number of required services on the total
service composition cost and the impact of the number of
service providers on the total service composition cost. We
have selected three scenarios (n = 120,D
60,D
shown in Fig. 8, the total service composition cost increases
with the number of required services m since more service
providers may be involved in a service composition. Given m,
the service composition cost is lower in a network with more
service providers. In a network with more service providers,
Tin {10,15,20,25,30,35,40} for
T
= 40), (n =
T= 40), (n = 30,D
T= 40) by varying m in [10,30]. As
more feasible service composition solutions are possible and
our dynamic programming algorithm can find the service
composition solution with minimum cost.
10 15 2025 30 3540
100
200
300
400
500
600
700
800
900
1000
The value of (D/T)
Total service composition cost
Dynamic programming
Min−cost−based algorithm
Fig. 7. Total service composition cost versus the value ofD
T
1015 20 2530
200
400
600
800
1000
1200
1400
1600
1800
2000
2200
Number of services in the query(m)
Total service composition cost
n=120
n=60
n=30
Fig. 8.
versus the number of services needed to provide
Total cost in each network topology with dynamic programming
VI. CONCLUSION
This paper studies service composition in service-oriented
WSNs with persistent queries. We aim to provide service
composition solutions during a persistent query’s lifetime such
that the involved routing update cost and transmission cost is
minimized. The optimality of greedy algorithm and dynamic
programming provides the service composition solutions for
persistent queries with the minimum energy consumption.
REFERENCES
[1] A. Rezgui and M. Eltoweissy, “Service-Oriented Sensor-Actuator Net-
works,” in IEEE Communications, Volume 45, No. 12, pages 92-100,
December 2007.
[2] D. Gra˘ canin, M. Eltoweissy, A. Wadaa, and L. DaSilva, ”A service-centric
Model for Wireless Sensor Networks” in JSAC, Vol. 23, No. 6, pp. 1159-
1166, June 2005
[3] B. Raman, R. H. Katz, “Load balancing and stability issues in algorithms
for service composition”, in IEEE InfoCom 2003, pp.1477-1487.
[4] J. Jin, K. Nahrstedt, “Source-based QoS service routing in distributed
service networks”, in ICC2004, pp.20-24, June 2004.
[5] X. Gu, K. Nahrstedt, R. Chang, C. Ward, “QoS-assured service compo-
sition in managed service overlay networks”, in ICDCS 2003, pp.19-22,
May 2003.
[6] Z. Abrams and J. Liu, “Greedy is good: On service tree placement for
in-network stream processing”, in Proc. of ICDCS, 2006.
[7] U. Srivastava, K. Munagala, and J. Widom, “Operator placement for in-
network stream query processing”, in PODS’05, Baltimore, MD, June
2005
[8] R. Ha, P.-H. Ho and X.S. Shen, “Cross-Layer Application-Specific
Wireless Sensor Network Design with Single-Channel CSMA MAC over
Sense-Sleep Trees”, accepted by Elsevier Journal: Computer Communi-
cations.
[9] J. Wang, D. Li, G. Xing, and H. Du, “Cross-layer Sleep Scheduling
Design in Service-Oriented Wireless Sensor Networks”, Technical report,
City University of Hong Kong, 2007.