Content uploaded by Athman Bouguettaya
Author content
All content in this area was uploaded by Athman Bouguettaya on Oct 20, 2018
Content may be subject to copyright.
Discovering Spatio-temporal Relationships among IoT Services
Bing Huang, Athman Bouguettaya, Azadeh Ghari Neiat
School of Information Technology,
University of Sydney, Australia
{bing.huang, athman.bouguettaya, azadeh.gharineiat }@sydney.edu.au
Abstract—We propose a framework to discover proximate
IoT service relationships based on spatio-temporal features.
We introduce a spatio-temporal proximity model in terms of
spatial-proximity and temporal-proximity to discard insignificant
IoT service relationships. The proximity model focuses on
quantifying the correlation strength among IoT services from
time and location aspects. A new algorithm is proposed to
discover proximate spatio-temporal IoT service relationships.
Keywords-spatio-temporal relationships; Internet of Things;
proximity; spatio-temporal data;
I. INT ROD UC TI ON
The Internet of Things (IoT) paradigm enables phys-
ical devices to connect and exchange information. IoT
devices allow objects to be sensed or controlled remotely
through Internet [1]. IoT devices are highly heterogeneous in
terms of supporting infrastructure ranging from networking
to programming abstraction[?]. Service-oriented Computing
(SOC) is a promising solution for abstracting things on
the Internet as services by hiding the complex and diverse
supporting infrastructure [3]. This abstraction can shift the
focus from dealing with technical details to how services
are to be used. We refer services for Internet of Things as
IoT services. For example, a light which is connected to the
Internet can be represented as a light service.
Spatio-temporal features are important for IoT services
because they characterize the time and the location of
IoT services’ usage. In this paper, we focus on discover-
ing spatio-temporal relationships among IoT services (i.e.,
we refer such spatio-temporally correlated IoT services as
composite1IoT services). We also use the terms composite
IoT services and spatio-temporally correlated IoT services
interchangeably. It is important to discover spatio-temporal
IoT service relationships. For example, the light, the TV,
and the air-conditioning in the bedroom may be turned on
in the evening as shown in Figure 1. The spatio-temporal
relationship among these IoT services may provide valuable
information to help residents better understand their IoT
service usage patterns. These patterns can be used to design
intelligent control of IoT services in smart homes to reduce
residents’ interactions with IoT services.
1We employ “ composite” and “composed ” interchangeably.
Discovering useful IoT service relationships is challeng-
ing because there are many possibilities of establishing
spatio-temporal relationships among IoT services. Too many
IoT service relationships may hinder residents from under-
standing their actual IoT service usage behaviors. To address
this challenge, there is a need to design a technique to filter
out insignificant spatio-temporal IoT service relationships.
In this paper, we use the proximity among component IoT
services to indicate the significance of the discovered spatio-
temporal relationships. The proximity of the composite IoT
services characterizes the correlation strength of spatio-
temporal relationships among component IoT services.
The usage history of IoT services is recorded in IoT
service event sequences. A snapshot of IoT service event
sequences and their pictorial representation are shown in
Figure 3 and Figure 2, respectively. Proximate IoT service
relationships are implicit and hidden in these sequences. In
this paper, we focus on the problem of discovering proxi-
mate spatio-temporal IoT service relationships from service
event sequences. The key contributions of this paper are as
follows: (1) A new IoT service model is proposed based
on spatio-temporal features. We also introduce the notion
of composite IoT services to capture the spatio-temporal
relationships among IoT services. (2) A spatio-temporal
proximity model is introduced to capture correlation strength
of composite IoT services in terms of spatial-proximity
and temporal-proximity. We develop an efficient algorithm
called P M iner (Proximate Composite IoT service Miner)
to discover proximate composite IoT services.
s1
s3
Relative Time
AC
Light
TV
0 20 40 60 80
s2
Composite IoT
Service
Light
Shower
Toilet Sink
Fridge
Microwave
Toaster
Light
TV
Resident 1
Resident 2
Resident Part of discovered composite IoT sevices
Figure 1. An example of composite IoT service
0 20 40 60 80 100
Bedroom
Living room
Bedroom
Bathroom
A
D
B
C
Day 1
F
E
Day 2
Day 3
M
Relative Time
Clock
LED
Heater
Ventilator
Bathroom Music player
Bathroom Shower
Bedroom
Living room
Bedroom
A
B
C
Clock
LED
Heater
Gym
Gym Airconditioner
KTreadmill
Bathroom EMusic player
Bathroom FShower
Bedroom
Living room
Bedroom
A
B
C
Clock
LED
Heater
G
Living room TV
Bathroom FShower
Location ...
Figure 2. Pictoral representation of service event sequences
Day 1
A+
A-
B+
C+
D+
C-
B-
D-
E+
F+
F-
E-
0
1
5
6
10
22
23
30
60
61
73
75
Day 2
A+
A-
B+
M+
C+
C-
B-
K+
M-
K-
E+
F+
F-
E-
0
1
4
5
7
23
24
30
40
60
70
72
82
84
Day 3
A+
A-
B+
C+
C-
B-
G+
G-
F+
F-
0
1
6
10
25
26
40
60
64
77
Figure 3. An example of service event sequences
II. MODELING
We first introduce the notion of IoT services based on
spatio-temporal features [2]. Then we propose the notion
of composite IoT services to capture spatio-temporal rela-
tionships among component IoT services. Lastly, a spatio-
temporal proximity model is proposed to quantify the cor-
relation strength of the composite IoT services.
A. Spatio-temporal model for IoT service
Definition 1: IoT Service. An IoT service Siis a tuple
Si=< si, Fi, IS, F S >, where:
•siis a unique service identifier.
•Fiis a set of functionalities that are offered by Si.
•IS (Initial State) is a tuple < s+
i, ls, sti>, where
−s+
iis a symbol of IS.
−ls=< xs, ys, zs>is a start location of Si, where
< xs, ys, zs>is a GPS point.
−stiis a start-time of Si.
•F S (Final State) is a tuple < s−
i, le, eti>, where
−s−
iis a symbol of F S
−le=< xe, ye, ze>is an end location of Si, where
< xe, ye, ze>is a GPS point.
−etiis an end-time of Si.
We assume the start location and the end location
are the same during IoT service functionality deliver-
ing and can be detected in smart homes. Since we
focus on the spatio-temporal features in the remainder
of this paper, the representation of the IoT service Si
can also be simplified as < si,(s+
i, sti),(s−
i, eti), li>.
For example, a light service can be represented as <
light, (light+,7pm),(light−,9pm),(1,2,0) >.
B. Spatio-temporal model for composite IoT service
Multiple IoT services may be used collectively based on
time and location correlations. Spatio-temporal correlated
IoT services are referred as a composite IoT service.
Definition 2: Composite IoT Service. A composite IoT
service is denoted by a tuple CS =< S, sup > where
•S={< s1,(s+
1, st1),(s−
1, et1), l1>, ..., <
sn,(s+
n, stn),(s−
n, etn), ln>}represents ncomponent
IoT services, where sti≤sti+1 and sti≤eti.
An example of composite IoT service is shown in
Figure 1. For brevity, we omit the device ID si
and sort all elements s∗
i(* can be + or -) in S
in a non-decreasing order based on its associated
time information sti(or eti). Scan be represented
as S=< Seq , T, L >=
α1... αi... α2n
t1... ti... t2n
l1... li... l2n
,
where Seq ={α1...αi...α2n}is the state symbol
sequence and αi=s∗
j(* can be + or -),
T={t1...ti...t2n}is the time and ti≤ti+1,
and L={l1...li...l2n}is the location.
For example, the composite IoT service in Figure 1 can
be represented as
s+
2s+
1s+
3s−
1s−
3s−
2
48 50 58 65 70 75
l2l1l3l1l3l2
(i.e., l1=<1,2,3>,l2=<2,4,3>,l3=<3,5,1>)
•sup is the support for S. The support sup is a measure
reflecting the usefulness of the composite IoT service
[4]. Let S=< Seq, T , L > and S0=< Seq0, T 0, L0>
be two composite IoT services. Sis referred to as a
sub-composite IoT service of S0, denoted as SvS0,
if Seq ={α1...αi...α2n}is a subsequence of S eq0=
{α0
1...α0
i...α0
2m}, denoted as Seq vS eq0.Seq vSeq0
is satisfied if there exists integers 1≤k1≤k2...kn≤
kmsuch that α1⊆α0
k1,α2⊆α0
k2,..., αn⊆α0
kn.
Given a spatio-temporal database DB which records IoT
service event sequences, the tuple (sid, S0)(i.e., sid is a
sequence ID and S0is the composite IoT service) is said
to contain a sub-composite IoT service Sif SvS0. The
support sup of Sin DB, denoted as sup(S)is the number of
tuples containing S.sup(S)can be formalized as follows.
sup(S) = |{(sid, S)∈DB|SvS0}| (1)
C. Spatio-temporal proximity model for composite IoT
services
A proximity model is proposed in terms of
spatio proximity and temporal proximity to quantify
the spatio-temporal correlation strength among component
IoT services. The proximity model is based on the approach
of measuring spatio-temporal interval data distance used in
clustering spatio-temporal interval data [6].
Definition 3: Proximity. Given a composite IoT service
CS =< S, sup > where Sis in the following representation
form S=< Seq, T, L >=
α1... αi... α2n
t1... ti... t2n
l1... li... l2n
,its
proximity function is defined in Equation (2).
U=w1·spatial proximity +w2·temporal proximity
(2)
where wi∈[0,1] (i=1, 2) is a weight such that w1+w2= 1.
−spatial proximity: The spatial proximity is based on
the spatial aspect. It measures the average location
proximity among all component IoT services. We first
formalize the spatial proximity for one compos-
ite IoT service in Equation (3). Then the average
spatial proximity for the composite IoT service is
formalized in Equation (4).
Spa =
n
X
i=1
1
|xi−xi+1|+|yi−yi+1 |+|zi−zi+1|
(3)
spatial proximity =Psup
j=1 Spaj
sup (4)
where nis the total number of component IoT services,
li=< xi, yi, zi>and li+1 =< xi+1, yi+1 , zi+1 >
are two locations for two consecutive component IoT
services and sup is the support. For example, for the
composite IoT service in Figure 1, its spatio proximity
score is Spa =1
|l2−l1|+1
|l1−l3|=1
|2−1|+|4−2|+|3−3|+
1
|1−3|+|2−5|+|3−1|= 0.473.
−temporal proximity: The temporal proximity is based
on the temporal aspect. It measures the average tempo-
ral proximity among component IoT services. The idea
of temporal proximity borrows from the technique of
clustering time-interval based data in [6]. For each com-
ponent IoT service Si={si,(s+
i, sti),(s−
i, eti), li},
we utilize a function fiwith respect to tto map the
temporal aspect of Si.fiis formalized in Equation (5).
fi(t) = (1, t ∈[sti, eti]
0, otherwise (5)
Then we have a set of functions {f1, f2, ...fn}cor-
responding to the composite IoT service CS . The
temporal proximity for the composite IoT service can
be calculated by Equation (6). The average tempo-
ral proximity is calculated by Equation (7).
T emp =Rt2n
t1Pn
i=1 fi(t)dt
(t2n−t1)·n(6)
temporal proximity =Psup
j=1 T empj
sup (7)
where t1and t2nare the first and the last time informa-
tion of CS, respectively, and nis the number of compo-
nent IoT services. For example, the temporal proximity
score of the composite IoT service {<stove, [18:00,
19:00]>,<washing machine, [18:40, 19:20 ] >}can be
calculated as (18:40−18:00)+(19:00−18:40)·2+(19:20−19:00)
(19:20−18:00)·2
= 0.625. This composite IoT service can be interpreted
as when a resident is cooking, he is also doing laundry.
III. DISCOVERING PROXI MATE COMPOSITE IOT
SERVICES APPROACH
We develop a new algorithm P Miner to efficiently
discover proximate composite IoT services from IoT service
event sequences. P Miner consists of two phases. First,
P M iner searches all frequent composite IoT service can-
didates from service event sequences. Second, P Miner
calculates proximity for each candidate and discards those
having low proximity. For the sake of consistency with the
terms from data analysis techniques, we use event patterns
to refer to composite IoT services occurring in service event
sequences. We use the running example in Figure 3 to
illustrate the process of P M iner shown in Figure 4.
Phase I: Searching event patterns.PM iner employs an
Apriori-based approach and find-then-index strategy, where
n-length patterns are used to find (n+1)-length patterns
through exploring the index sets associated with the n-length
patterns rather than searching the whole database [4][5].
P M iner searches event patterns in three sub-phases.
1. Find the set of 1-length event patterns.P Miner first
scans the DB to count the number of each event pairs. If
the user given minsup is 2, all discovered 1-length event
patterns whose support is more than 2 constitute the 1-length
event set L1as shown in Figure 4.
2. Construct an index set for each 1-length event pattern. Let
L1={p1, p2, ...pn}be the set of 1-length event patterns.
For each pi(1≤i≤n), a corresponding index set piidx
is created. piidx is a collection of elements indicating the
supporting sequences for pi. Each element of piidx contains
three fields, namely, sid,time, and location.sid indicates
the sequence containing pi.time is the time information of
pi.location is the location information of pi. For the sake
of brevity, the location information is omitted in the running
example because it remains the same.
01
03
02
523
424
626
<B+B->
01
03
02
622
723
10 25
<C+C->
01
03
02
01
01
01
<A+A- >
01
02
60 75
70 84
<E+E->
01
03
02
61 73
72 82
64 77
<F+F->
01
03
02
01
01
0 1
<A+A- B+B- >
5 23
4 24
626
01
03
02
01
01
01
6 22
7 23
10 25
<A+A- C+C- >
01
03
02
01
01
01
61 73
72 82
64 77
<A+A- F+F- >
01
02
01
01
60
70
<A+A- E+E- >
75
84
01
03
02
5 6
47
6 10
22
23
25
<B+C+ C-B- >
23
24
26
01
02
523
424
60
70
<B+B- E+E- >
75
84
01
03
02
5 23
424
6 26
61
72
64
<B+B- F+F- >
73
82
77
622
723
60
70
75
84
01
02
<C+C- E+E- >
6 23
723
10 25
61
72
64
73
82
77
01
02
03
<C+C- F+F- >
60 61
70 72
73
82
<E+F+ F-E- >
75
84
01
02
01
03
02
0 1
01
0 1
5
4
6
<A+A- B+C+ C-B- >
6
7
10
22
23
25
23
24
26
L1
C2 consists of all
members
L2 consists of
these members
colored in gray
L3
Figure 4. The Process of P M iner
3. Leverage Lk−1to find Lkthrough searching the index sets
corresponding to Lk−1(k≥2). Let Lk−1={ρ1, ρ2, ...ρm}
be the set of (k-1)-length event patterns. For each member
ρiin Lk−1(1≤i≤m), its index set is ρiidx, resulting in
the set Ik−1={ρ1idx, ρ2idx, ..., ρnidx}corresponding to
Lk−1. To find Lk, a three-step process including join step,
prune step and construct index set step is performed.
•The join step: Let the sequences ρi=
{a1, a2, ..., a2k−2}and ρj={b1, b2, ..., b2k−2}
be two members in Lk−1, where aiand biare event
types. The corresponding index sets for ρiand ρjare
ρiidx and ρjidx, respectively. ρiand ρjare potentially
joinable if ρiidx and ρjidx share at least minsup
numbers of sid, that is, W=ρiidx.sid ∩ρjidx.sid =
{sidw1, sidw2, ...sidwm}such that |W| ≥ minsup.
This condition can efficiently reduce the generation
of candidates. The join, ρi⊕ρj, is performed as
follows. For each shared sidwi ∈W, we can generate
the following sequences, denoted by γwi, by merging
ρi={a1, a2, ..., a2k−2}and ρj={b1, b2, ..., b2k−2}
and sorting these merged elements based on their
time information. Thus the outcomes of joining is
γ=ρi⊕ρj={γw1, γw2, ..., γwm}where γw i is the
new ordered sequence for the shared sequence sidwi.
By performing join action for members in Lk−1, the
outcomes constitute the candidate set Ck. Continue
the running example, L1is used to find C2. Every two
members in L1are joined and the outcomes of the
join step constitute C2in Figure 4.
•The prune step: Let γwi and γwj be two members in γ.
γwi and γwj are the same if their elements are the same,
that is, (γwi[1] = γw j [1]) ∧(γwi[2] = γw j [2]) ∧... ∧
(γwi[h] = γw j [h]). For example, < F +F−G+G−>
and < F +G+F−G−>are two different members.
The prune step focuses on counting the numbers of the
same members in γand filter out those members whose
numbers are less than minsup. In the running example,
no members in C2are filtered out.
•Construct index set: Given γ=ρi⊕ρj=
{γw1, γw2, ..., γwm}after the prune step, collect the
entry < sid, time, location > from ρiidx and ρjidx
for each γwi. All entries constitute the index set for γ.
Phase II: Calculate proximity for event patterns. Given
the event patterns generated by the phase I and minimum
proximity threshold minpro, calculate average proximity
for each event pattern by Definition 3 and filter out those
patterns whose proximity are less than minpro. For the
running example, if the weight for spatial proximity and
temporal proximity is set to be 0 and 1, respectively, the
proximity members in C2is P(A+A−B+B−)=0.418. If
the minpro is set to be 0.3, members in C2whose proximity
is less than 0.3 are filtered out, resulting in the set L2.
By recursively performing the join step, prune step, and
construct index set step, we can find L3. The ultimate out-
comes of the running example are < E+F+F−E−>and
< A+A−B+C+C−B−>and their respective proximity
scores are 0.879 and 0.494.
IV. CONCLUSION AND FUTURE WORK
This paper propose a novel framework for discovering
proximate spatio-temporal IoT service relationships. We
design an efficient algorithm P M iner to search significant
composite IoT services. Future work focuses on improving
the performance of P M iner and explore semantic anno-
tation techniques to enhance the readability of discovered
composite IoT services.
REFERENCES
[1] Atzori. L, Iera. A, “The internet of things: A survey,” Journal
of Computer networks 54(15), 2787-2805 (2010).
[2] Neiat. A. G, Bouguettaya. A, “Crowdsourced Coverage as a
Service: Two-Level Composition of Sensor Cloud Services,”
IEEE Transactions on Knowledge and Data Engineering,
29(7), 1384-1397(2017).
[3] Guinard. D, Trifa. V, “Interacting with the soa-based internet of
things: Discovery, query, selection, and on-demand provision-
ing of web services,” IEEE transactions on Services Computing
3(3), 223-235 (2010).
[4] Han. Jiawei, Jian Pei and Micheline Kamber, “Data mining:
concepts and techniques,” Elsevier, 2011.
[5] Lin. M. Y and Lee. S. Y, “Fast discovery of sequential patterns
by memory indexing,” In International Conference on Data
Warehousing and Knowledge Discovery. pp. 150-160(2002).
[6] Shao and Bouguettaya , “Clustering big spatiotemporal-interval
data,” IEEE Transactions on Big Data. pp.190-203 (2016).