• 沒有找到結果。

Algorithm QCR (Query Cost Reduction)

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.2.3 Algorithm QCR (Query Cost Reduction)

The above DAT and Z-DAT only try to reduce the update cost. The query cost is not taken into account. QCR is designed to reduce the total update and query cost by adjusting the object tracking tree obtained by DAT/Z-DAT. To begin with, we define the query rate q(v) of each sensor v as the average number of queries that refer to objects within the sensing range of v per unit time in statistics.

Given a tree T , we first derive its query cost Q(T ). Suppose that an object x is within the sensing range of v. When x is queried, if v is a non-leaf node, the query message is required to be forwarded to v since p(v) only indicates that x is in the subtree rooted at v. On the other hand, if v is a leaf node, the query message only has to be forwarded to p(v), because sensor p(v) knows that the object is currently monitored by v. The following equation gives Q(T ) by taking into account the number of hops that query requests and query replies have to travel on T .

Q(T ) = 2 ×

 X

v∈VT ∧ v /∈leaf node

q(v) × distT(v, sink) + X

v∈VT ∧ v∈leaf node

q(v) × distT(p(v), sink)

 ,(3.3)

We make two observations on Q(T ). First, because distT(p(v), sink) is al-ways smaller than distT(v, sink), Eq. 3.3 indicates that placing a node as a leaf can save the query cost instead of placing it as a non-leaf. For example, when query rates are extremely high, it is desirable that every node will become a leaf node and T will become a star-like graph. Second, the second term in Eq. 3.3 implies that the value of distT(p(v), sink) should be made as small as possible.

Thus, we should choose a node closer to the sink as v’s parent (however, this is at the expense of the update cost).

Based on the above observations, QCR tries to adjust the tree T obtained by DAT or Z-DAT. In QCR, we examine T in a bottom-up manner and try to adjust the location of each node in T by the following operations.

1. If a node v is not a leaf node, we can make it a leaf by cutting the links to its children and connecting each of its children to p(v). (Note that we can do so because T is regarded as a logical tree.) Let T0 be the new tree after

modification. We derive that

If the amount of reduction is positive, we replace T by T0. Otherwise, we keep T unchanged. Fig. 3.7 illustrates this operation.

w

Figure 3.7: Making a non-leaf node v a leaf node.

2. If a node v is a leaf node, we can make p(v) closer to the sink by cutting v’s link to its current parent p(v) and connect v to its grandparent p(p(v)). Let T0 be the new tree. We derive that

where

q0(v) =

½ 0 if p(v) has more than one child in T

q(p(v)) otherwise .

If the amount of reduction is positive, we replace T by T0. Otherwise, T remains unchanged. Fig. 3.8 illustrates this operation.

w u

v1 v

v k i

w u

v1 v

v k i

Figure 3.8: Connecting a leaf node vito p(p(vi)).

Note that Eq. 3.4 and Eq. 3.5 allow us to compute the reduction of cost without computing U (T0) and Q(T0). This saves computational overhead. Also note that T is examined in a bottom-up manner in a layer-by-layer manner. Nodes that are moved to an upper layer will have a chance to be reexamined. However, to avoid going back and forth, nodes that are not moved will not be reexamined.

For example, suppose that we are given a DAT tree in Fig. 3.9(a) (which is constructed from Fig. 3.1(b)), where the number labelled on each node is its query rate. When examining the bottom layer, we will apply step 2 to sensors H, J , and K and obtain reductions of 1974, −62, and −6, respectively. Hence, only H is moved upward as shown in Fig. 3.9(b). When examining the second layer, we will apply step 1 to sensor G and I and apply step 2 to sensors C, E, and H. Only when applying to sensor H, it will result in a positive reduction of 1970. This updates the tree to Fig. 3.9(c). Finally, sensors B, D, and F are examined. Only D has a positive reduction of 1842. Thus, D will become a leaf and all its children are connected to D’s parent as shown in Fig. 3.9(d). Overall, the cost is reduced from 7124 to 5150, 3180, and then 1338 after each step respectively.

A

Figure 3.9: An execution example of algorithm QCR.

Finally, we show how to derive Eq. 3.4 and Eq. 3.5. To begin with, we present two implicit facts used in the following derivations. First, according to Theorem 1, we can conclude that if the members of Subtree(v) are not changed, the number of messages transmitted on edge (v, p(v)) ∈ T will be unchanged. Second, when a node v is being examined by QCR, wT(p(v), p(p(v))) must be 1. This fact holds because the input of QCR algorithm is a DAT/Z-DAT tree and the tree is examined in a bottom-up manner.

First, we derive the Q(T ) − Q(T0) in Eq. 3.4. When v becomes a leaf and the queried object locates at the sensing field of v, the query only has to be sent to p(v). In addition, when one of v’s children, say i, is connected to p(v) and i is a leaf, p(v) also can reply the query if the queried object locates at the sensing field of i. Thus, we have that when one of v’s children, say i, changes its parent to p(v), the update cost will be increased by

In addition, the events between v and i, where i ∈ neighbors(v) and i ∈ Subtree(v), will be reported to p(v) rather than v when v becomes a leaf. Thus, v must forward an additional message to p(v). The increased cost is

X

i∈neighbors(v)∧

i∈Subtree(v)

wG(v, i).

However, when v becomes a leaf, the event across an edge (x, y) ∈ EG such that y /∈ Subtree(v), x ∈ Subtree(v), and x 6= v will not be transmitted on (v, p(v)).

The cost is reduced by

X

(x,y)∈EG∧y /∈Subtree(v)

∧x∈Subtree(v)∧x6=v

wG(x, y).

Combining above three factors, we have

U(T ) − U(T0) = − X its parent from p(v) to p(p(v)), the saved query cost is q(v). Furthermore, when p(v) has only one child v, the adjustment of v will make p(v) a leaf. This saves a query cost of q(p(v)). Therefore, we have

Q(T ) − Q(T0) = 2 × (q(v) + q0(v)).

The value of U (T ) − U (T0) is affected by three factors, when v changes its parent from p(v) to p(p(v)). The update cost will be increased by

X

(x,y)∈EG∧y /∈Subtree(v)

∧x∈Subtree(v)

wG(x, y).

For edges that have one incident vertex in Subtree(v) and one incident vertex is in Subtree(p(v)) but not in Subtree(v), the events across these edges cannot be absorbed by p(v) after v changes its parent from p(v) to p(p(v)). The increased update cost will be:

X

(x,y)∈EG∧y /∈Subtree(v)∧

x∈Subtree(v)∧y∈Subtree(p(v)

wG(x, y).

However, for edges that have one incident vertex in Subtree(v) and one incident vertex is not in Subtree(p(v)), the events across these edges will be transmitted

on (v, p(p(v))) rather than (v, p(v)) when we connects v to p(p(v)). The update cost will be decreased by

X

(x,y)∈EG∧x∈Subtree(v)

∧y /∈Subtree(p(v))

wG(x, y).

Combing these terms leads to the following equation U(T ) − U(T0) = − X

We have simulated a sensing field of size 256×256. Unless otherwise stated, 4096 sensors are deployed in the sensing field. Two deployment models are considered.

In the first one, sensors are regularly deployed as a 64 × 64 grid-like network. In the second model, sensors are randomly deployed. In both models, the sink may be located near the center of the network or one corner of the network.

Event rates are generated based on a model similar to the city mobility model in [14]. Assuming the sensing field as a square of size r × r, the model divides the field into 2 × 2 sub-squares called level-1 subregions. Each level-1 subregion is further divided into 2 × 2 sub-squares called level-2 subregions. This process is repeated recursively. Given an object located in any position in the sensing field, it has a probability p1 to leave its current level-1 subregion, and a probability 1 − p1 to stay. In the former case, the object will move either horizontally or vertically with a distance of r/2. In the latter case, the object has a probability p2 to leave its current level-2 subregion, and a probability 1 − p2 to stay. Again, in the former case, the object will move either horizontally or vertically with a distance of r/22, and in the latter case it may cross level-3 subregions. The process