+ All Categories
Home > Documents > Asynchronous event detection for context inconsistency in pervasive computing

Asynchronous event detection for context inconsistency in pervasive computing

Date post: 19-Nov-2023
Category:
Upload: independent
View: 0 times
Download: 0 times
Share this document with a friend
11
Int. J. Ad Hoc and Ubiquitous Computing, Vol. 0, No. 00, 2012 1 Asynchronous Event Detection for Context Inconsistency in Pervasive Computing Daqiang Zhang School of Computer Science, Nanjing Normal University, Nanjing, China E-mail: [email protected] Zhangbing Zhou School of Information Engineering, China University of Geosciences (Beijing) E-mail: [email protected] Qin Zou School of Computer, Wuhan University, Wuhan, China E-mail: [email protected] Tianyi Zhan Department of Computer Science, Nanjing University, Nanjing, China E-mail: [email protected] Minho Jo* College of Information & Communications, Korea University, Seoul, South Korea E-mail: [email protected] *Corresponding author Abstract: Event detection for context inconsistency is challenging in pervasive computing environments, where contexts are often noisy owing to fragile connectivity, node frequent movement and resource constraints. As a recent scheme, CEDA — Concurrent Event Detection for Asynchronous inconsistency checking (CEDA) concurrently detects context inconsistency by exploring the happened-before relation among events. Nevertheless, CEDA suffers from several problems — unscalable from partial centralized detection manner, heavy computation complexity and false negative. To address these challenges, we propose in this paper the SECA scheme — asynchronous event detection for context inconsistency in pervasive computing. It puts forward a new type logical clock — snapshot timestamp — to check event relations, which enables it to be efficient in the scenarios where CEDA fails to. Meanwhile, SECA comes up with a lightweight update mechanism for the snapshot clock, which considerably reduces time and space complexity. Extensive experiments have been conducted and results show that SECA surmounts CEDA with respect to detection accuracy and scalability. Keywords: Context Inconsistency; Context-awareness; Event Detection; Snapshot-based Timestamp; Pervasive Computing. Biographical notes: Daqiang Zhang ... Zhangbing Zhou is an associate professor at China University of Geosciences (Beijing). He received his PhD from Digital Enterprise Research Institute, National University of Ireland, Galway. His research interests include process-aware information system, service- oriented computing, cloud computing, and sensor network middleware. Qin Zou received his PhD from Wuhan university, China in 2012. From Oct. 2010 to Oct. 2011, he was a visiting student at the Computer Vision Lab, University of South Carolina. His research interests involve computer vision, machine learning, ubiquitous computing and intelligent transportation systems. Tianyi Zhan is a PhD student at Nanjing University. Her research interests include multi- agent system, mechanism design, algorithmic game theory. Minho Jo ... Copyright c 2009 Inderscience Enterprises Ltd.
Transcript

Int. J. Ad Hoc and Ubiquitous Computing, Vol. 0, No. 00, 2012 1

Asynchronous Event Detection for ContextInconsistency in Pervasive Computing

Daqiang Zhang

School of Computer Science, Nanjing Normal University, Nanjing, ChinaE-mail: [email protected]

Zhangbing Zhou

School of Information Engineering, China University of Geosciences (Beijing)E-mail: [email protected]

Qin Zou

School of Computer, Wuhan University, Wuhan, ChinaE-mail: [email protected]

Tianyi Zhan

Department of Computer Science, Nanjing University, Nanjing, ChinaE-mail: [email protected]

Minho Jo*College of Information & Communications, Korea University, Seoul, South KoreaE-mail: [email protected] *Corresponding author

Abstract: Event detection for context inconsistency is challenging in pervasivecomputing environments, where contexts are often noisy owing to fragile connectivity,node frequent movement and resource constraints. As a recent scheme, CEDA —Concurrent Event Detection for Asynchronous inconsistency checking (CEDA) —concurrently detects context inconsistency by exploring the happened-before relationamong events. Nevertheless, CEDA suffers from several problems — unscalable frompartial centralized detection manner, heavy computation complexity and false negative.To address these challenges, we propose in this paper the SECA scheme — asynchronousevent detection for context inconsistency in pervasive computing. It puts forward a newtype logical clock — snapshot timestamp — to check event relations, which enables itto be efficient in the scenarios where CEDA fails to. Meanwhile, SECA comes up witha lightweight update mechanism for the snapshot clock, which considerably reduces timeand space complexity. Extensive experiments have been conducted and results show thatSECA surmounts CEDA with respect to detection accuracy and scalability.

Keywords: Context Inconsistency; Context-awareness; Event Detection; Snapshot-basedTimestamp; Pervasive Computing.

Biographical notes: Daqiang Zhang ...

Zhangbing Zhou is an associate professor at China University of Geosciences (Beijing).He received his PhD from Digital Enterprise Research Institute, National University ofIreland, Galway. His research interests include process-aware information system, service-oriented computing, cloud computing, and sensor network middleware.

Qin Zou received his PhD from Wuhan university, China in 2012. From Oct. 2010 to Oct.2011, he was a visiting student at the Computer Vision Lab, University of South Carolina.His research interests involve computer vision, machine learning, ubiquitous computingand intelligent transportation systems.

Tianyi Zhan is a PhD student at Nanjing University. Her research interests include multi-agent system, mechanism design, algorithmic game theory.

Minho Jo ...

Copyright c⃝ 2009 Inderscience Enterprises Ltd.

2 D. Zhang et al.

1 Introduction

Growing convergence of wireless communicationtechnologies, hand-held devices and embedded systemshas fostered an attention to pervasive computing, whichis a new computing paradigm shift from distributedsystem (1). The new paradigm aims at creatingintelligent spaces so that users access services fromspaces without awareness of underlying technologies.This kind of intelligence is chiefly achieved by context-awareness that refers to a mechanism that assistspervasive applications in adapting to varying contextualinformation. Contexts are pieces of informationthat captures the features of pervasive computingenvironments (2). Owing to the context noise causedby unreliable connectivity, resource constraints anddynamic context evolution, context inconsistencyremains open (3). For instance, a RFID-based applicationmay obtain two pieces of location contexts: the user is inthe living room and the user is in the kitchen owing to theRFID data noise or signal interference (4) (5) (6) (1).

A wide spectrum of schemes for context inconsistencychecking have been proposed over the past three years.In (7; 8; 9), hidden rules and axioms from ontologyhave been exploited to check context inconsistencywhere contexts were denoted as assertions. In (2), twopolicies drop-all and drop-best were proposed to resolvecontext inconsistency where contexts were modeled bytuples. Nevertheless, these two schemes did not delineatethe context inconsistency checking. In (10), a tree-based checking scheme on top of the first-order logicwas reported, which detected context inconsistency byrefining consistency trees using context constraints. Tofurther extend the work, (11) reported the manners bywhich the context consistency was built and checked withpartial constraints. However, most existing schemes areseriously limited by two problems. They require centralcontrol or centralized, which incurs their less scalabilityin large-scale pervasive computing environments with ahuge number of nodes. Moreover, they implicitly assumethat contexts being checked belong to the same snapshotso that they could not fairly measure the temporalrelations among context events. For the above RFID-based location acquisition, they could detect the contextinconsistency with the assumption that these two piecesof location context took place at the same time. Thisassumption is criticized in (4) and (12) because it maynot hold in some pervasive computing environments thatconcurrent events (formal definition as Figure 5) arenormal owing to the asynchronous communication andnetwork delay.

To eliminate the above two assumptions, CEDA(Concurrent Event Detection for Asynchronousinconsistency checking) (4) was proposed. Intuitively,it mapped context inconsistency checking into contextevent detection, and checked concurrent context eventsbased on the happened-before relation. CEDA has threelimitations. Firstly, it checked event inconsistency ina centralized manner, incurring its less effectiveness

in large-scale pervasive applications. Secondly, itintroduced false negative because happened-beforerelation could hardly capture all event relationsaccurately. Finally, CEDA suffered heavy time andspace complexity, resulting in its poor performance.Figure 1 illustrates the fairness of central-based systemsin detecting context inconsistency among n nodes. Allnodes are in the same environment, and every nodeacquires one kind of context and delivers contextualinformation to central node D by m message. Thus, thenode D will get m ∗ n communication overhead, n timesas much as that of the normal node, (e.g., node A or F ).

m

m

m

m

m

m

Figure 1 The fairness of central-based systems in eventdetection for context inconsistency. The numbersin the figure refer to the corresponding link’sbandwidth demand.

To address the challenges of the current schemes,we propose in this paper SECA scheme – asynchronousevent detection for context inconsistency in pervasivecomputing environments, which is built based on timesnapshots and logical clocks. SECA detects contextinconsistency in a distributed manner, which enableschecking nodes not to be blocked or to become systembottlenecks. It adopts logical clocks rather than vectorclocks to evaluate event relations. In order to be scalable,SECA customizes logical clocks by holding the valuepart. Thus, it detects event relations that CEDA canand cannot support. Theoretical analysis and extensiveexperimental results show that SECA achieves higherdetection accuracy than that of CEDA in a more scalablemanner. To summarize, the main contributions of thispaper are the following three-fold.

• SECA scheme is significantly improved comparedwith the state-of-the-art detecting techniques, suchas CEDA scheme from the performance aspect.Specifically, CEDA is a central-based checkingsystem, which makes the payload of the systemheavy. In contrast, SECA achieves its function ina fully distributed manner.

Asynchronous Event Detection for Context Inconsistency in Pervasive Computing 3

• SECA scheme can detect false negative scenarioswhere CEDA fails to. We also conduct theoreticalanalysis to discuss about the reasons that SECAcan while CEDA cannot.

• SECA scheme respectively reduces CEDA’scomplexity of time and space from O(n2) to O(n)and from O(1) to O(n), where n is the number ofnodes in a pervasive network.

Preliminary result of this paper has been reportedin our previous work (13; 14). This paper gives a morecomprehensive presentation and discussion about theasynchronous event detection for checking the contextinconsistency, including details of definitions, tractablealgorithms, and evaluation of the algorithms.

The remaining of this paper is structured as follows.Section 2 provides an overview of the existing work.Section 3 briefly introduces the background knowledgethat is the basis of our work. Section 4 presentsthe design of SECA scheme, following by theoreticalanalysis. Section 5 reports our extensive experimentalresults. Section 6 concludes the paper and point outdirections of the future improvement.

2 Related Work

Context-awareness is a main mechanism for pervasivecomputing that enables people to unobtrusivelyaccess services without the awareness of underlyingtechnologies. Noisy contexts usually lead to context-aware applications incongruous behaviors and userperplexed feelings. Hitherto, context inconsistencydetection has drawn increasing attention in recent years.

A bunch of schemes have been proposed in theexisting literature. In (7) (15), ontology was used tomodel contexts and their properties. In (8) (9), contextconsistency was specified by ontology assertions suchthat it could be checked by hidden rules and axiomsin ontology. In (10), context consistency was modeledby tuples and inconsistency checking was mapped tothe comparison among the elements in tuples. Thiskind of context inconsistency was resolved in (2), wherethree resolution policies including drop-all and drop-best had been proposed. To further detect contextinconsistency based on first order logic, (11) reportedthe work that built context consistency trees and refinedthese trees by checking partial constraints. However,most existing schemes suffer from a couple of problems.They are heavily centralized or require central control,which incurs their ineffectiveness in large-scale pervasiveenvironments or pervasive applications. Moreover, theydo not consider the event relations, particularly temporalrelations. As a matter of fact, most of them implicitlyassume that contexts being examined belong to thesame snapshot. This assumption may not always besatisfied in pervasive computing environments, whichare characterized by asynchronous cooperation and

schedule. Note that DCCI (12) reported the workthat detected context inconsistency in a peer-to-peermanner. However, this work also relies on the above twoassumptions.

CEDA (4), as a derivation of (16), took eventtemporal relations into account and presented a schemeon the basis of happened-before relation. It consisted ofa checker process that determined context inconsistency,and several normal processes that reported the valuesof event vector clocks. However, CEDA was a semi-centralized scheme in which the checker process might bethe system bottleneck when the system scale increases.Another prominent issue is that its communicationoverhead was heavy, since normal processes reportedtheir observations from time to time owing to thefrequent happened context events. Taking RFID forexample, a reader gets around 50 values each second fromthe same tag as usual (5). In addition, CEDA ignoredsome false negative scenarios, which affected its detectionaccuracy.

It is worthwhile to mention that our work SECA issimilar with IEEE 1516 time management (17) (18) withseveral differences.

• Firstly, we share the similar idea in timemanagement in IEEE 1516. We focus on theconcept of snapshot timestamp, as well as itscharacteristics with theoretical analysis. WhileIEEE 1516 emphasizes on the usage of timemanagement with distributed time clocks.

• Secondly, we develop and implement the snapshotclock for concurrent event detection, while IEEE1516 is a standard that does not provide away to checking event concurrency detection.Actually, IEEE 1516 is designed for simulationsto ensure that temporal aspects of the systemunder investigation are correctly reproduced by thesimulation model.

• Finally, SECA is an independent scheme and canbe customized for personal computers, and smartdevices. While IEEE 1516 relies on federates andthe Runtime Infrastructure (RTI), because it isjust a part of IEEE 1516 standard. IEEE 1516 timemanagement can be extracted as an independentmodule after modification. In addition, IEEE 1516is more complex than SECA, providing variousfunctions that are not mentioned in SECA, e.g.,clock synchronization and time compensation.

Consequently, we find it appropriate to revisit theevent relation in asynchronous pervasive computingenvironment. Owing to the absence of a global clock andabsence of 100% accurately synchronized clocks, logicalclock was introduced in (19) and happened-before wasdesigned to measure event relations. In this paper, SECAcustomizes a logical clock for event detection of contextinconsistency. Theoretical analysis and experimentalresults show that SECA address the issue of context

4 D. Zhang et al.

inconsistency detection with an accurate and scalablemanner.

3 Background

In this section we introduce happened-before relation.Then we give an overview about the logical clock andLamport’s algorithm. Finally, we briefly present whatvector clock is.

3.1 Happened-Before Relation

The happened-before relation is coined in (19). It refers toa way of ordering events by the potential causal relationof pairs of events in a concurrent system, particularlyasynchronous distributed systems. Suppose a singleprocess is a set of events with a priori total ordering,the events of a process form a sequence, and sending orreceiving messages in a process is an event (20). Thus,the happened-before relation denoted by ”→”, is given asDefinition 3.1.

Definition 3.1 The “→” among events of a system isa relation such that:

1. If b and c are events in the same process, and boccurs before c, then b→ c.

2. If b is sending a message by one process and c isthe receipt of the same message by another process,then b→ c.

3. If b→ c and c→ d, then b→ d.

Note that any event cannot occur before itself, i.e.,b 9 b for any event b. Two events b and c are concurrentif both b 9 c and c 9 b. In fact, the happened-beforerelation is a kind of strict partial order, which isinherently transitive, irreflexive and asymmetric. Notethat the processes that compose a distributed systemhave no knowledge of the happened-before relation unlessthey are ordered by a logical clock, e.g., Lamport clockor vector clock (21) (22). Even though one event b occursphysically earlier than another event c, this does notimply that b→ c. For the same reason, b→ c neitherindicates that the event b occurs physically earlier thanthe event c.

3.2 Logical Clock

Logical clock is introduced in distributed computingowing to the lack of global physical clocks and completelyaccurate synchronization clocks. It is a mechanism forcapturing causal and chronological relations betweenevents. It is defined as follow:

Definition 3.2 Given an event a in a process Pi, thecorresponding logical clock Ci is a function that assigns anumber Ci(a), where the number is regarded as the timewhen the event occurred.

By Definition 3.2, the clocks of the entire system isrepresented by the function C that assigns to any eventa the number C(a), where C(a) = Cj(a) if a is an eventin the process Pj . Thus, only when one of followingconditions is satisfied, the happened-before relation istrue:

1. Events a and b are in the same Pi, and a occursbefore b, then Ci(a) < Ci(b).

2. Event a in the process Pi sends the message to anevent b in the process pj , then Ci(a) < Ci(b).

Let P0, P1 and P2 be three processes, and a, b, ..., kbe events. All events are counted by Lamport’s logicalclock algorithm. Figure 2 illustrates an example usingLamport’s logical clock, which partially orders theevents happened in P0, P1 and P2. Lamport’s logicalclock algorithm gets local events sequenced, e.g., aand b events. However, it causes an issue of identicaltimestamps and thus it hardly states which events arecausally related. For instance, whether events a and fmay have the same timestamps or not. To address theidentical timestamp issue, vector clock is introduced.

(a,1) (b,2) (c,3) (d,4) (e,5)

(f,1) (g,4)

(j,6)

(k,5)

Figure 2 An example of Lamport’s logical clock.

b, (2, 0, 0)

c, (2, 1, 0) d, (2, 2, 0)

f, (2, 2, 2)

Figure 3 An example of vector clock.

3.3 Vector Clock

Vector clock refers to a mechanism for partially orderingevents in a distributed system and detecting causalityviolations. The vector clock of a holistic system isan array/vector of N logical clocks, and every processmaintains a clock. A local smallest possible value copyof the global clock-array is kept in every process. Figure3 shows an example of vector clock.

V C(b) < V C(c)⇔∀j [V Cj(b) 5 V Cj(c)] Λ∃k [V Ck(b) < V Ck(c)]

(1)

Let V C be a function of assigning the number V C(a)to an event a, where V C(a) = V Cj(a) if a is an eventin the process Pj . Equation 1 gives the judgement of

Asynchronous Event Detection for Context Inconsistency in Pervasive Computing 5

vector clocks of two events b and c. Thus, happened-beforerelation in vector clock is given by Theorem 1.

Theorem 1: If V C(b) < V C(c), then b→ c.

Vector clock is promising for event ordering, but ithas several conspicuous issues. First, it requires thatevery process maintains an array to record the logicalclock values of all processes. Second, it is designedunder an assumption of a fixed set of participants (23).This assumption may not be held in asynchronouspervasive computing environments, where nodes are ableto join or leave pervasive networks randomly. The sameissue appears in Lamport’s logical clock. Consequently,these logical clock algorithms are inappropriate to beused in pervasive scenarios due to changing numbers ofparticipants and churns.

4 Asynchronous Event Detection forContext Inconsistency in PervasiveComputing

In this section, we propose a scheme for event detectionfor context inconsistency in pervasive computingenvironments. We introduce the system model, andthen depict the system design in detail, followed bydiscussions.

4.1 System Model

Pervasive computing environments are modeled asa loosely-coupled distributed system, where physicalentities (e.g., objects and users) sense environments,and pervasive infrastructures handle sensor readingsand deliver services to pervasive applications. Apervasive computing environment is composed of aset of n asynchronous processes P1, P2, . . ., Pn,which communicate with each other through message-passing (24). The processes do not share a global memoryand communicate solely by exchanging messages. Thecommunication delay is finite but unbounded. An evente in the process Pj is modeled by intervals using booleanpredicate Ej . The event e is occurring in the process Pj

when Ej is true. Otherwise, the event does not exist. Theevents are modeled by means of intervals. The beginningand the end of an event are denoted as lo and hi,respectively.

4.2 Modeling Events by Intervals

The event is detected by a boolean predicate Bi. Theevent is happening in the process Pi when Bi is true,and it does not occur when Bi is false. The eventis represented by an interval, denoted by lo and hi,corresponding to the beginning and the end of theinterval. The notations in the design of the proposedscheme are given in Table 1.

Table 1 Notations in the design of SECA algorithm.

Notation Explanation

n the number of processesPi the ith process involved in the

context inconsistency detectionlo the beginning of an intervalhi the end of an intervalI the interval that denotes the time period

between two successive eventsEi event on Pi

SCi[1..n] snapshot clock on Pi

4.3 System Design

This subsection presents snapshot timestamp and itsupdate policy, and then introduces snapshot-based eventdetection.

Snapshot Timestamp is an implementation oflogical clocks, where all nodes maintain a logical clock.In the system of snapshot clocks, the time domainis denoted as a set of n−dimensional, non-negativeinteger clock. Each process Pi maintains a snapshot clockSi[1..n], where Si[k] is the kth local logical timestampand describes the logical time process at the processPi. The process Pi updates its snapshot clock by thefollowing rules:

1. Before sending a message, the process Pi updatesits local clock by

Si[k] = Si[k − 1] + d (d > 0), (2)

where the default value of d is 1. Then, Pi

piggybacks a message m with its snapshot clock tothe remaining nodes in the same environment.

2. When receiving a message (m,Sj [send]) from theprocess Pj , the process Pi gets the snapshottimestamp at the receiver point as:

Si[receiver] = max(Si[k], Sj [send]), (1 ≤ k ≤ n)(3)

Figure 4 illustrates the update policies of snapshotclock algorithm, where events are represented by thestarting and the end of intervals, i.e., lo and hi. Whenthe process P0 would like to send a message, it willautomatically increment the value of its snapshot clock,and then forwards it to the processes P1 and P2.

3

3

4

4

4

5

5

5

6

6

6

lo hi

hi

Figure 4 An example of snapshot-clock updatemechanism.

6 D. Zhang et al.

4.3.1 Basic Properties

Isomorphism. Evidently, by comparing timestamps(i.e., an array of n− elements), the snapshot clockkeeps its property of isomorphism. The relations betweentimestamp intervals include two ordering relationsrepresented as ’≤’ and ’<’, and one concurrent relationdenoted as ’∥’.

Property 4.1: Given two snapshot timestamp Sp andSq, the isomorphism of the snapshot clock is given as:

Sp ≤ Sq ⇔ ∀i Sp[i] ≤ Sq[i]

Sp < Sq ⇔ Sp ≤ Sq and ∃i, i′ Sp[i] < Sq[i′]

Sp ∥ Sq ⇔ not (Sp < Sq) and not (Sq < Sp)

Happened-before Relation. Recall that relation →partially orders the set of events in a distributedexecution. Snapshot timestamp based events in adistributed system satisfies Theorem 2.

Theorem 2: Suppose two events b and c havetimestamps Sp and Sq respectively, then:

b→ c⇔ Sp < Sq

b ∥ c⇔ Sp ∥ Sq

P: According to the update policies of snapshot clocks,the happened− before relation holds. �

Consequently, an isomorphism property existsbetween the set of partially ordered events produced bya distributed computation and their timestamps. This isa powerful and interesting property of snapshot clocks.By checking timestamps, we are able to get the eventconcurrent relations. For instance, let the events b and cbeing occurred at the processes Pi and Qj , respectively.They are assigned of timestamps Sp and Sq. Then, thehappened− before relation between these two events issatisfied in Theorem 3.

Theorem 3: b→ c⇔ Sp[i] < Sq[i]

P: Straightforwardness. �

Note that the concurrent relation between the eventsb and c can be detected by comparing their timestamps(e.g., Sp and Sq). However, this is an inappropriatescheme owing to two reasons. One is that it is complex tocompare snapshot timestamps. The other is that it mayincur false negative when using the happened− beforerelation, which will be discussed in the discussion part.In order to easily detect concurrent events, we proposean event concurrence detection mechanism as presentedin Theorem 4.

Theorem 4: Given two events b and c in the processesPi and Pj, and these two events communicate each other.

Assume the event b sends a message to the event c withits timestamp Spb[i]. Then:

b ∥ c ⇔ (clo ≤ Spb[i] < chi)

P: There is a message from the event b to the event c.According to the update policy of snapshot clocks, Spb[i]is the maximal event timestamp between the timestampsof the events b and c, respectively. Thus, the value ofSpb[i] is not less than clo. Because the message is handledby the event c, the value of Spb[i] must be less than chi�

4.4 Snapshot-based Concurrent Event Detection

In this section we present the SECA scheme —asynchronous event detection for context inconsistencyin pervasive computing environments. SECA is builtupon snapshot timestamps, and enables all nodes todetect concurrent context inconsistency events withoutcentral control or centralized hierarchy. Thus, SECAdramatically reduces communication complexity andsuccessfully avoids the risk that the central nodes areeasily to be the bottleneck of a pervasive computingsystem.

bhi=2

clo=1 chi=3

Spb[i]=1

Pi

Pj

Figure 5 Concurrent events b and c, where Ic.lo ≤ Ib.x <Ic.hi.

The distributed architecture of SECA suggeststhat every process will automatically check contextinconsistency. The basis of context inconsistencydetection lies in the fact that: when two events b and care concurrent, b and c can satisfy Theorem 4. Figure 5illustrates the fact that the events b and c are concurrent.

The pseudo-code of SECA scheme is given inAlgorithm 1, which includes three parts: event processing(lines 2-8), message processing (lines 9-19), and contextinconsistency checking (lines 20-26).

The event processing refers to a process that updatesits snapshot clock when an event occurs within its lifespan. To be specific, the process updates its snapshotclock, the event queue EQ, as well as interval queue IQ,by broadcast (e.g., SECA offers a System Broadcastprimitive). Note that we do not provide a function toreduce the message complexity in SECA scheme owingto its scale is not large. For large-scale applications

Asynchronous Event Detection for Context Inconsistency in Pervasive Computing 7

of context inconsistency detections, to further reducethe message complexity, we may design a preliminaryprocedure to let every process realize which processes itshould communicate with for inconsistency detection.

There are two kinds of message exchange actions:sending and receiving. The sender is in charge ofupdating the event queue and interval queue (see steps11-14). Correspondingly, the receiving process modifiesits snapshot clock by picking the maximal timestampvalue between the snapshot timestamps of the sender andreceiver processes (see steps 15-19). Note that the actionsof senders and receivers are incorporated together in thepseudo-code.

The third part of Algorithm 1 corresponds to thecontext consistency detection. Since the elements in EEimplicitly satisfy Theorem 4, we output the event pairssimply by a validation check.

4.5 Discussions

Thus far, we have presented the design of SECAscheme in previous sections. Does SECA solve falsenegative caused in CEDA scheme? Does SECAdetect context consistency accurately in pervasivecomputing environments? We investigate these issueswith theoretical study in this section. We furtherevaluate SECA scheme by extensive experiments in thefollowing Section 5.

4.5.1 False Negative in Happened−Before-Based Context Consistency Detection

Given n intervals I1, I2, . . ., In, CEDA checks concurrentcontext consistency events by Equation 4, which isdefined upon the happened− before relation.

(Ij .lo→ Ik.hi) ∧ (Ik.lo→ Ij .hi),∀1 ≤ j ̸= k < n. (4)

The case of interval overlaps, which is characterizedby concurrent events, is illustrated by Figure 6.

Ij.hi

I .lo Ik.hi

Figure 6 Overlapping intervals that can be detectedbased on Happened− before relation in CEDAscheme.

In some cases, intervals are overlapped and eventsare concurrent, but CEDA cannot detect them. This isnotorious for false negative phenomena, thus definitelybrings down the detection accuracy of the CEDA

Algorithm 1: SECA checks context inconsistencyin normal processes

Input: P = {P1, . . . , Pi, . . . , Pn}, a set of processesin a pervasive systemn, the number of processes in the system;EQ[], an event queue;IQ[], an interval queue;EE[], pairs of events which have

communication with each other;S[], a list of snapshot timestamps;

Output: A set of concurrent eventsC = {< ex, ey >}

1 begin2 /* When an event e occurs at Pi */

3 if Pioccur←− e then

4 /* suppose it occurs at timestamp k with

id eiid */

5 Si[k]=Si[k-1]+1;6 EQ[i].push(eiid, Si[k]);7 IQ[i].push(eiid, lo=Si[k], hi=Si[k]+1);8 System Broadcast(Pi, Si);

9 /* Upon the process Pi receives a message

from the process Pj */

10 if Pimsg←− Pj then

11 (ejid, Sj [k]) = EQ[j].getTop();12 Sj [k+1] = Sj [k]+1;

13 EQ[j].push(ejid, Sj [k+1]);

14 IQ[j].current = (ejid, lo, max(hi,Sj [k+1]+1);

15 Si[receive] = max(Si, Sj [k+1]);

16 if ejid is received by eiid then17 (eiid, lo, hi) = IQ[j].pop();18 IQ[i].push(eiid, lo, max(hi, Sj [k+1]);

19 EE.push(eiid, ejid);

20 /* Context inconsistency detection */

21 while (!EE.IsNullOrEmpty()) do

22 < eiid, ejid > = EE.pop();

23 if (IsValid(eiid)) && (IsValid(ejid)) then

24 C.push(eiid, ejid);

25 /* Output concurrent events */

26 Unique(C);

scheme. This is because Equation 4 cannot detect theseoverlapping intervals, although they are mutually across.

Figure 7 illustrates three kinds of false negativescenarios, where CEDA scheme fails to check contextconsistency correctly. In Figures 7(a), 7(c) and 7(c), twoevents in two processes satisfy (Ij .lo→ Ik.hi) ∧ (Ik.lo 9Ij .hi), (Ij .lo 9 Ik.hi) ∧ (Ik.lo→ Ij .hi), and (Ij .lo 9Ik.hi) ∧ (Ik.lo 9 Ij .hi), respectively. These two eventpairs occur concurrently, but Equation 4 fails to detectthem. On the contrary, SECA scheme is capable offinding these concurrent context events successfully. As

8 D. Zhang et al.

Ij.hi

I .lo Ik.hi

(a) False negative scenario one between twoconcurrent events

Ij.hi

I .lo Ik.hi

(b) False negative scenario two between twoconcurrent events

Ij.hi

I .lo Ik.hi

(c) False negative scenario three between twoconcurrent events

Figure 7 Three kinds of false negative scenarios caused by happened− before relation in CEDA scheme. Concurrent eventsin these scenarios can be accurately detected by SECA scheme.

for Figures 7(a) and 7(b), SECA compares the messagetimestamps of senders with the lo and hi of the receiversand then find the concurrency. Note that concurrencyin Figure 7(c) is challenging to detect. This kind ofconcurrency is mainly caused by the message delay.

As a matter of fact, there are 25 temporal interactionof intervals in a distributed system (25) (26) (27), asshown in Figure 8. We have checked these 25 temporalinteraction of intervals, and find that 16 temporalinteraction of intervals can satisfy the requirement shownin Equation 4. This implies that these 16 temporalinteraction of intervals can be accurately recognized bythe happened− before relation. However, the rest of 9temporal interaction of intervals, i.e., IA, IB, IC, ID, IE,IF, IJ, IH and IK labeled in Figure 8, may be overlappedin physical time, but the happened− before relationfalls short of checking them. For those 16 temporalinteraction of intervals within concurrent events, SECAscheme can detect them using the snapshot timestamp,and hence may be regarded as a general solution. For therest temporal interaction of intervals, it remains open toresearch community.

IA IB

ID

IE IF

IJ IK

IH

TimeX

X.hi X.lo X.hi

X.lo X.hi

Figure 8 Temporal interaction of intervals in adistributed system.

4.5.2 Complexity

Taking a panoramic view of the SECA scheme, it doesnot rely on central control to check context consistency.

Table 2 Comparison of PCA, CEDA and SECA withrespect to checking context consistency events

Items PCA CEDA SECA

Synchronization√

× ×An event occurs × O(n) O(1)Concurrent event O(n) O(n2) O(n)False negative × |overlap| < ε −ε < overlap < 0

All processes involved in a pervasive system are equaland check context consistency by snapshot clocks. Everyprocess requires O(1) space complexity to maintainsnapshot timestamps, and O(n) time complexity forevery context consistency event detection.

To further evaluate the time and space complexityof the proposed scheme, we have implemented thedetection schemes by means of physical clocks, vectorclocks and snapshot clocks, labeled as PCA, CEDAand SCA, respectively. Table 2 compares the PCA,CEDA and SECA in terms of their clock synchronization,handling the occurrence of an event, detecting overlappedintervals and concurrent events, and false negative.By comparison, SCA significantly reduces the timeand space complexity concerning event processing andcontext consistency checking. Meanwhile, SECA cuts offa half of the possibility of false negative generated inCEDA scheme.

5 Experiments

We conduct extensive experiments in this sectionto further evaluate whether SECA is appropriate tocontext-aware applications in asynchronous pervasivecomputing environments. Particularly, this section willevaluate

• to what extent the detection accuracy is thatSECA scheme can achieve, and

• whether SECA outperforms CEDA in terms ofdetection accuracy and computation.

5.1 Experiment Setup

A smart building scenario is simulated where usersmove around randomly. The duration of users’ stayingin an office follows the exponential distribution. In

Asynchronous Event Detection for Context Inconsistency in Pervasive Computing 9

view of that user location is regarded as the mostimportant type of context in asynchronous pervasivecomputing environments (2) (28) (29) (30), user locationis our focus. The environment is equipped with RFIDdevices and every user carries a RFID tag such thatthe location context is collected timely and correctly.The RFID data concerning user location is generatedwith controlled error rates of 10%, 20%, 30%, 40% and50% by using the mechanisms presented in the existingliterature (11) (31). A constriction is implanted that auser cannot have two difference locations at the sametime. Table 3 reports the experimental settings in detail.Note that some parameters are not listed in Table 3,e.g., lo and hi, since they are included in the design ofSECA scheme, illustrated in Algorithm 1. Meanwhile,the detection accuracy is evaluated as the average valuefor all processes in all network nodes.

Table 3 Experimental settings

Items Experimental settingsThe number of processes 2 – 15The event duration 5 – 120sThe message delay 0.01 – 655.36s

Checking Devices

Windows 7 UltimateIntel Core2 CPU, 1.67 GHzMemory: 2 GBDisk: 512 GB

5.2 Overall Performance

A series of experiments are designed to check thedetection accuracy of SECA and whether it performsbetter than CEDA. Given that the experiments shedlight on detecting concurrent events of user locations,we limit the number of nodes attending for the samecontexts from 2 to 20. Every node runs two detectionprocess instances. Every event has a random life spanfrom 20 to 120 seconds and every message suffers arandom delay between 0.25 to 8 seconds. The followingexperiments employed the same setting without explicitdeclaration.

Figure 9 illustrates the performance results withtuning the number of nodes from 2 to 20. Both CEDAand SECA schemes achieve high level of detectionaccuracy, showing a slightly downward trend. Thisindicates that vector clocks and happened− beforerelations are efficient for detection of concurrent contextinconsistency events. Meanwhile, SECA gets higher levelof accuracy than CEDA scheme, which is attributed tothe exclusion cases that CEDA scheme fails to detect arechecked by snapshot clocks in SECA scheme.

5.3 Detection Performance with Varying MessageDelays

In this section, several experiments are conducted toinvestigate how the changes of the average message delayaffect the concurrent event detection of the proposedscheme.

2 4 6 8 10 12 14 16 18 2068%

72%

76%

80%

84%

88%

92%

96%

100%

Acc

urac

y

The number of nodes

SECA CEDA

Figure 9 Overall performance of SECA scheme byincreasing node participants.

-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 80%10%20%30%40%50%60%70%80%90%100%

Acc

urac

y

Logarithm of message delay

SECA CEDA

Figure 10 Detection accuracy with varying messagedelays.

10 D. Zhang et al.

As shown in Figure 10, both SECA and CEDAschemes reduce their detection accuracy with theincrease of message delay (note that the x−axis is thelogarithm of the message delay, counted by seconds).In all experiments, SECA achieves higher level ofaccuracy than CEDA, owing to its snapshot-basedtimestamp checking mechanism. As the logarithm of themessage delay is between -2 to 3, SECA gets a betterdetection accuracy with less communication overheads.Meanwhile, in view of the pervasive network scale, wehereby set the value of the logarithm of message delayas 0.25 to 8 seconds.

5.4 Detection Performance with Varying EventDuration

This section carries out a couple of experiments toevaluate to what extent the event duration influences thedetection accuracy of SECA scheme. It also examinesthe appropriate values of the event duration in givenscenarios.

20 30 40 50 60 70 80 90 100 110 120

90%

92%

94%

96%

98%

100%

Acc

urac

y

Event duration (seconds)

SECA CEDA

Figure 11 Detection accuracy with varying eventduration.

Figure 11 illustrates the experimental results withvarying the event duration from 20 to 120 seconds. BothSECA and CEDA schemes are capable of achieving highlevel of detection accuracy (the least accuracy is biggerthan 85%.), which indicates that they are not heavilyinfluenced by event duration. The longer the eventduration is, the higher level of detection accuracy SECAand CEDA can achieve. Figure 11 also indicates thatSECA is much more accurate than CEDA in handlingevents with various life span. Consider that SECA gets ahigh level of detection accuracy when the event durationis in a range between 20 and 50 seconds, we set the eventduration as a random value in the same range.

5.5 Lessons Learned

So far we have presented all evaluations. Experimentalresults show that SECA is appropriate for context-aware application in asynchronous pervasive computing

environments. Particularly, SECA outperforms CEDAregarding concurrent event detection of contextinconsistency. It is capable of tolerating fairly longmessage delay with high level of detection accuracy.Finally, it is robust to the variations of event duration,making it desirable in asynchronous pervasive computingenvironments where message communication suffersvarious delays owing to the network limitation.

6 Conclusion

In this paper, we have studied concurrent event detectionof context consistency checking in asynchronousubiquitous computing environments. We have proposedthe snapshot timestamp and based on it we haveput forward the SECA scheme. Extensive experimentalresults show that SECA is desirable in context-aware applications and outperforms CEDA in termsof concurrent event detection accuracy, and toleratingmessage delay and event duration.

Currently, SECA scheme could be further improvedin the following perspectives. Firstly, we plan toinvestigate how SECA performs in large-scale pervasivecomputing environments with thousands of participants.Secondly, we will study whether and how SECA copeswith the dynamic changes of processes involved in theconcurrent event detection. Finally, we are going toevaluate SECA performances in various scenarios withmore types of contexts and consistency constraints.

Acknowledgement

This work is supported by the National NaturalScience Foundation of China (Grant Nos. 61103185,61003247, 61100178, 61073118 and 50905063), the Start-up Foundation of Nanjing Normal University (GrantNo. 2011119XGQ0072), and Natural Science Foundationof the Higher Education Institutions of JiangsuProvince, China (Grant No. 11KJB520009). This workis also supported by Major Program of NationalNatural Science Foundation of Jiangsu Province (GrantNo. BK211005). This research was also supportedby the Korea-China Science and Technology JointResearch Center by the National Research Foundation(NRF) under Grant No. 2011-0019905 of Ministry ofEducation, Science and Technology (MEST), the Koreangovernment.

References

[1] M.-S. Jian, T.-Y. Chou, and S. H. Hsu, “Mobility

corresponding location-aware information services based

on embedded rfid platform,” International Journal of Ad

Hoc and Ubiquitous Computing, vol. 9, no. 2, pp. 122–

131, 2012.

Asynchronous Event Detection for Context Inconsistency in Pervasive Computing 11

[2] C. Xu, S. Cheung, W. Chan, and C. Ye, “Heuristics-

based strategies for resolving context inconsistencies in

pervasive computing applications,” Int. Conf. Distri.

Comput. Sys., pp. 713–721, 2008.

[3] D. Zhang, M. Guo, J. Zhou, D. Kang, and J. Cao,

“Context reasoning using extended evidence theory in

pervasive computing environments,” Future Generation

Comp. Syst., vol. 26, no. 2, pp. 207–216, 2010.

[4] Y. Huang, X. Ma, J. Cao, X. Tao, and J. Lu,

“Concurrent event detection for asynchronous

consistency checking of pervasive context,” IEEE

International Conference on Pervasive Computing and

Communications, vol. 0, pp. 1–9, 2009.

[5] D. Zhang, J. Zhou, M. Guo, J. Cao, and T. Li, “TASA:

tag-free activity sensing using RFID tag arrays,” IEEE

Trans. on Parallel and Distributed Systems, vol. 22, pp.

558–570, 2011.

[6] D. Zhang, H. Huang, X. Liao, and M. Chen, “Empirical

study on taxi gps traces for vehicular ad hoc

networks,” in Proc. of IEEE International Conference

on Communications, 2012.

[7] X. Wang, D. Zhang, T. Gu, and H. Pung, “Ontology

based context modeling and reasoning using OWL,” in

Proceedings of the Second IEEE Annual Conference on

Pervasive Computing and Communications Workshops.

Orlando, FL, USA: IEEE, March 2004, pp. 18 – 22.

[8] Y. Bu, T. Gu, X. Tao, J. Li, S. Chen, and J. Lu,

“Managing quality of context in pervasive computing,”

in Proc. of the 6th. Int. Conf. on Quality Softw., 2006,

pp. 193–200.

[9] Y. Bu, S. Chen, J. Li, X. Tao, and J. Lu, “Context

consistency management using ontology based model,”

in Current Trends in Database Technology — EDBT

Workshops, 2006, pp. 741–755.

[10] C. Xu, S. C. Cheung, and W. K. Chan, “Incremental

consistency checking for pervasive context,” in Proc. of

the 28th Int. Conf. Softw. Eng. ACM, 2006, pp. 292–

301.

[11] C. Xu, S. C. Cheung, W. K. Chan, and C. Ye, “Partial

constraint checking for context consistency in pervasive

computing,” ACM Trans. Softw. Eng. Methodol., vol. 19,

pp. 9:1–9:61, 2010.

[12] D. Zhang, M. Chen, H. Huang, and M. Guo,

“Decentralized checking context inconsistency

in pervasive computing environments,” The J.

Supercomput., 2011.

[13] D. Zhang, Q. Zou, and Z. Sun, “Seca: Snapshot-

based event detection for checking asynchronous context

consistency in ubiquitous computing,” in Proc. of

2012 IEEE Wireless Communications and Networking

Conference, 2012.

[14] D. Zhang, H. Huang, C.-F. Lai, X. Liang, and

M. Guo, “Survey on context-awareness in ubiquitous

media,” Multimedia Tools and Applications, DOI:

10.1007/s11042-011-0940-9, pp. 1–33, 2011.

[15] T. Gu, X. H. Wang, H. K. Pung, and D. Q.

Zhang, “An ontology-based context model in intelligent

environments,” in Proc. of Commu. Netw. Distri. Sys.

Model. Simul. Conf., 2004, pp. 270–275.

[16] Y. Huang, Y. Yang, J. Cao, X. Ma, X. Tao, andJ. Lu, “Runtime detection of the concurrency propertyin asynchronous pervasive computing environments,”IEEE Trans. Paral. Distri. Sys., pp. 1–17, May 2011.

[17] R. M. Fujimoto, “Time management in the high levelarchitecture,” Simulation, vol. 71, no. 6, pp. 388–400,1998.

[18] W. H. E. W. Group, “Ieee 1516 – standard for modelingand simulation high level architecture framework andrules,” IEEE Standard, July 2000.

[19] L. Lamport, “Time, clocks, and the ordering of eventsin a distributed system,” Commun. ACM, vol. 21, pp.558–565, 1978.

[20] Z. Zhou, S. Bhiri, and M. Hauswirth, “Control and datadependencies in business processes based on semanticbusiness activities,” in Proc. of the Tenth InternationalConference on Information Integration and Web-basedApplications Services, 2008, pp. 257–263.

[21] C. J. Fidge, “Timestamps in message-passing systemsthat preserve the partial ordering,” in Proc. of In 11thAustra. Comp. Sci. Conf. University of Queensland andGriffith University, 1988, pp. 55–66.

[22] F. Mattern, “Virtual time and global states ofdistributed systems,” in Proc. Workshop Paral. Distri.Alg., C. M. et al., Ed., Elsevier, 1989, pp. 215–226,(Reprinted in: Z. Yang, T.A. Marsland (Eds.), ”GlobalStates and Time in Distributed Systems”, IEEE, 1994,pp. 123-133.).

[23] P. Almeida, C. Baquero, and V. Fonte, “Interval treeclocks: a logical clock for dynamic systems,” Princi.Distri. Sys., Lecture Notes in Comp. Sci., vol. 5401, pp.259–274, 2008.

[24] Z. Zhou, S. Bhiri, H. Zhuge, and W. Gaaloul, “Serviceprotocol adaptability assessment based on novel walkcomputation,” IEEE Transactions on Systems Manand Cybernetics, Part A: Systems and Humans, DOI:10.1109/TSMCA.2012.2183362, 2012.

[25] A. D. Kshemkalyani, “Temporal interactions of intervalsin distributed systems,” J. Comp. Sys. Sci., vol. 52,no. 2, pp. 287–298, 1996.

[26] D. Zhang, J. Wan, Q. Liu, X. Guan, and X. Liang,“A taxonomy of agent technologies for ubiquitouscomputing environments,” KSII Transactions onInternet and Information Systems, vol. 6, no. 2, pp.547–565, 2012.

[27] Z. Chen, D. Zhang, R. Zhu, and P. Yin, “A reviewof automated formal verification of ad hoc routingprotocols for wireless sensor networks,” Sensor Letters,2012.

[28] L. Ni, Y. Liu, Y. Lau, and A. Patil, “Landmarc: indoorlocation sensing using active rfid,” Wirel. Netw., vol. 10,no. 6, pp. 701–710, 2004.

[29] R. Want, A. Hopper, V. Falcao, and J. Gibbons, “Theactive badge location system,” ACM Trans. Info. Sys.,vol. 10, pp. 91–102, 1992.

[30] Y. Ji, “Performance analysis for indoor locationdetermination,” International Journal of Ad Hoc andUbiquitous Computing, vol. 8, no. 1/2, pp. 3–15, 2011.

[31] J. Rao, S. Doraiswamy, H. Thakkar, and L. S. Colby,“A deferred cleansing method for rfid data analytics,”in Pro. of 32nd Int. Conf. Very Large Data Bases, ser.VLDB ’06, 2006, pp. 175–186.


Recommended