• 沒有找到結果。

Related Works

Theorem 3. If G is connected, the tree T constructed by algorithm Z-DAT is a connected deviation-avoidance tree rooted at the sink

3. The number of trees used: Obviously, using multiple trees will increase update cost; however, the increase can be compensated by lower query cost

4.2 Update and Query Mechanisms in Multi-Sink WSNsWSNs

4.2.2 The Location Update Mechanism

The goal of location update is to ensure that the Detected Lists of sensors are fresh. The main idea here is that when an object o moves from sensor a’s re-sponsible polygon to sensor b’s rere-sponsible polygon, for each sink σi, the update messages should be sent from a and b along Tσi to lcai(a, b), the lowest common ancestor of a and b in Tσi. The reason for doing so is that the Detected Lists of the ancestors of lcai(a, b) will not be affected by this movement. Furthermore, instead of allowing all trees to update independently, we will update trees simul-taneously with some data aggregation techniques. We make the following obser-vation. In a system with m trees, a sensor x needs to maintain pi(x) for each Tσi, i = 1, · · · , m. Because the number of neighbors of x may be smaller than m, some of the pi(x)s may be duplicate and thus can be updated together. This also implies that when a node y receives an update message, node y should update its Detected List by considering several trees rather than one tree. Thus, the update mechanism comprises two parts: (1) the forwarding rule of the update message, and (2) the updating rule of the Detected List. Furthermore, the update message sent for the event that an object o moves from sensor a to sensor b is denoted by Update(o, a, b, eventid), where eventid is to uniquely represent this event.

Forwarding Rule: When an object o moves from sensor a to sensor b, for each tree Tσi, every node on the tree paths from a to lcai(a, b) and from b to lcai(a, b) should receive the update message at least once. Note that if a node x is on the path from a to lcai(a, b) in Tσi and x 6= lcai(a, b), then Sx(Tσi, a) = 1

and Sx(Tσi, b) = 0. Similarly, if x is on the path from b to lcai(a, b) in Tσi and x 6= lcai(a, b), then Sx(Tσi, a) = 0 and Sx(Tσi, b) = 1. If x is lcai(a, b), then Sx(Tσi, a) = 1 and Sx(Tσi, b) = 1. Thus, when any node x receives a new U pdate(o, a, b, eventid) message, node x can use the following statement to determine whether it is on the tree paths from a to lcai(a, b) or from b to lcai(a, b):

∃i((Sx(Tσi, a) = 0 ∧ Sx(Tσi, b) = 1) ∨

(Sx(Tσi, a) = 1 ∧ Sx(Tσi, b) = 0)) (4.1) (Note that Eq. 4.1 includes the special cases of x = a and x = b, in which the movement of o rather than receiving an update message will make x checking Eq. 4.1.) If x receives the update message for the first time and there is a tree Tσi making Eq. 4.1 true, then an update message should be sent to pi(x). However, if two trees Tσiand Tσjboth satisfy Eq. 4.1 and pi(x) = pj(x), then only one update message needs to be sent (the same applies if multiple trees satisfy Eq. 4.1). This is what we mean by update aggregation.

Updating Rule: When a node is notified that an object o moves from sensor a to sensor b, it will update its Detected List as follows.

• For sensor a, it will remove o from DLa(a) and check whether there exist a tree Tσi and a neighbor y such that Sa(Tσi, b) = 1 and a = pi(y). If the answer is affirmative, this implies that a can find o by asking y. Thus, it adds o into DLa(y).

• For sensor b, it will add o into DLb(b) and remove o from other entries of DLb if o appears in other entries.

• For any other sensor x that receives the update message from y, if ∃i(Sx(Tσi, b)

= 1 ∧ x = pi(y)) is true, this implies that x can find o by asking y; thus o will be added to DLx(y). Otherwise, o will be removed from DLx(y) if o appears in DLx(y).

Fig. 4.2(b) shows an example where Car2 moves from G to I and Car1 moves from H to C. The modified DLs and the reported messages are also shown in Fig. 4.2(b). Our update scheme ensures that when an object o moves from one sensor to another, if no packet loss happens and the update procedure can be com-pleted before o moves to another sensor, then the freshness of Detected Lists of sensors can be guaranteed.

Next, we derive the number of messages required to be sent per unit time for location update as follows.

U = ÃXm

i=1

U(Tσi)

!

ÃX

v∈VG

SC(v)

!

, (4.2)

where U (Tσi) is the update cost for tree Tσi if Tσi is the only tree in the network and SC(v) is the saved cost for sensor v due to the overlap of tree edges among m trees. U(Tσi) can be formulated as

U(Tσi) = X

(u,v)∈EG∧

(u,v) /∈ETσi

(wG(u, v) ×

(distTσi(u, lcai(u, v)) + distTσi(v, lcai(u, v)))), (4.3) where distTσi(x, y) is the hop count of the path connecting x and y in Tσi. To explain the meaning of Eq. 4.3, we assume that Tσi is the only tree in the net-work. When an event occurs on (u, v), the update messages will be forwarded to lcai(u, v) according to the forwarding rule. Eq. 4.3 is similar to the cost function for a single tree in [16], except that when (u, v) ∈ ETσi there is no cost because either u or v is lcai(u, v) and thus no update message has to be sent. This leads to Eq. 4.3. The formulation of SC(v) depends on the forwarding schemes. Two for-warding schemes are considered: the broadcast scheme and the unicast scheme.

Due to the broadcast nature of wireless radio, when a sensor sends an update mes-sage, we assume all its neighbors will receive the update message in the broadcast

scheme. In this case, SC(v) can be formulated as from s to t or from t to s, v will broadcast an update message to its neighbors for updating tree Tσj and this broadcast message can update these i (=f (s, t, v)) trees simultaneously; therefore, (i − 1) messages are saved. This leads to Eq. 4.4.

However, the packet transmission is unreliable in the broadcast scheme. Once the update messages are lost during the transmission, Detected Lists may not con-tain up-to-date information, resulting in the failures of queries. Thus, one also can adopt the unicast scheme to forward update messages in which each update message has a designated destination. In this case, SC(v) can be formulated as

SC(v) = X

where nei(v) denotes the neighbors of v in G and g(s, t, v, u) represents the num-ber of trees, each of which, say Tσj, makes the following statement true (u = pj(v))∧((s, t) 6= (v, u))∧((Sv(Tσj, s)∧¬Sv(Tσj, t))∨(Sv(Tσj, t)∧¬Sv(Tσj, s))).

Eq. 4.5 is similar to Eq. 4.4 except that each of v’s neighbors is considered sep-arately. Though the unicast scheme can provide reliable transmission using ac-knowledgement mechanisms, the number of saved packets is smaller than that in the broadcast scheme. We will compare the performances of the broadcast scheme and the unicast scheme through simulation in which packet loss will be simulated.

Eq. 4.3, Eq. 4.4 and Eq. 4.5 will give us hints for constructing message-efficient multiple virtual trees.