• 沒有找到結果。

optimal KNN boundary updateing KNN

boundary

Figure 5.1: Updating KNN boundary dynamically.

By exploiting local network information in each sector, PCIKNN is able to dynamically adapt KNN boundary. For example, the gray area in Figure 5.1 is adapted to node densities in sectors. Even though this adapted KNN boundary still cannot guarantee the accuracy of KNN query result because the adapted KNN boundary still may be smaller or larger than the real KNN boundary, it is expected to decrease the difference between the estimated KNN boundary and the real KNN boundary. In the performance evaluation section, we will show the performance of estimated boundary updating.

5.2 Adjusting Estimated KNN Boundary from the Home Node

As pointed out early, in PCIKNN, the home node has the partial KNN query results from each sector. Therefore, the home node is able to decide whether KNN query should be propagated or not according to the partial KNN query results collected. Thus, we propose two mechanisms to ensure KNN collection and handle the un-accuracy of the estimated KNN boundary. Due to the nature of PCIKNN, partial results from each sector are collected by the home node, the home node is able to decide and control whether the estimated boundary should be extended or the query processing should be stopped via controlling messages sent by the home node.

Mechanism for the Min Energy Mode:

In the min energy mode of PCIKNN, the goal is to conserve as much energy as possible.

Therefore, only receiving control messages (referring to CONTINUE message) from the home node, Q-nodes alone with the branch-segments are propagated to the next concentric circles.

Specifically, when the home node receives partial results from each sector, the home node will

record some information, such as the sector and the concentric-circle, that indicate where the partial result comes from. Once the home node collect all the partial results from each sector in a concentric-circle Ci, the home node will determine whether the KNN query should be propagated in the next concentric-circle Ci + 1 or not. Note that, when KNN query reaches or exceeds the estimated KNN boundary, the Q-nodes will wait for the control messages from the home node. It can be seen that the KNN query is disseminated concentric-circle by concentric-circle after the KNN query exceeds the estimated KNN boundary. On the other hand, when the partial results from sectors fulfil the KNN requirement, the home node informs the Q-nodes to stop the KNN query dissemination and data collection in each sector, saving the energy consumption.

Mechanism for the Min Latency Mode:

The goal of this mechanism is to minimize the query latency under decreasing unnecessary search overhead and thus, the home node frequently broadcasts the radius of the estimated KNN boundary once receiving the partial KNN results. Explicitly, the home node broad-casts information related to the current status of KNN query results and allow Q-nodes to quickly propagate KNN query. Hence, when a partial result is collected, the home node will estimate the distance between the Kth data and the query point (referred to DMAX) and DMAX is the minimal boundary estimated so far that ensures there are KNN data in this boundary. If the number of KNN results collected by the home node does not exceed K, the DMAX is set to infinite. Note that the DMAX will be updated if the partial KNN results are collected. Then, if the current value of DMAX is different from previous-round DMAX, the home node broadcasts messages that contain the current DMAX to Q-nodes. Otherwise, the home node sends a message to Q-nodes about the location information of the partial results collected. A KNN query stops disseminating when the home node ensures that KNN results are collected. In particular, when a Q-node on a branch-segment exceeds the estimated KNN boundary, this Q-node holds an estimated short period WAIT TIME for waiting the home node message. The estimated period WAIT TIME is sum of the estimated query dissemina-tion time of peri-segment, the partial result returning along return-segment and the estimated message broadcasting time along the branch-segment. Furthermore, when a Q-node receives the DMAX message, if the distance between the home node and this Q-node is larger than DMAX, the KNN query stops the query propagation to avoid unnecessary searching.

For the energy consumption analysis of these mechanisms, we simply utilize the total

is referred as Over Cnum, and Over Ci means the i th concentric-circle that exceeds the estimated KNN boundary, and there are S sector. In min energy mechanism, the home node broadcasts for each exceeded circle and each sector. Hence, the broadcasting messages number is S × Over Cnum. In min latency mechanism, there is an obvious upper bound of the broadcasting time, when each partial result updates DMAX. In this condition, there are S × Over Cnum partial results, and each time of broadcasting is sent for each sector.

As a result, the number of broadcasting messages is S × Over Cnum × S. Obviously, the mechanism in the min energy mode may broadcast less messages and consumes less energy for controlling query processing.

For the latency analysis, the total additional waiting time of mechanisms is used as the analytical latency time. LatencyBj,Over Ci denotes the processing latency of the j th branch-segment in the i th exceeding circle and the value of LatencyBj,Over Ci consists of three factors:

the latency of peri-segments, the latency of return-segments and the latency of broadcasting along with branch-segments. Thus, we have

LatencyBj,Over Ci = Latencyperi,Over Ci+ Latencyreturn,Over Ci+ M sg BroadcastingOver Ci In the min energy mechanism, because the KNN query is propagated circle by circle, the additional latency is formulated as the summation of holding times of each circle:

Latencymin energy =POver Cnum

i=1 (HoldingOver Ci)

, where HoldingOver Ci denotes the holding time of the i th concentric-circle. Clearly, the holding time of each sector in a concentric-circle is determined by the maximal LatencyBj,Over Ci

among each sector and is derived as,

HoldingOver Ci = max1≤j≤S(LatencyBj,Over Ci)

In the min latency mechanism, because the waiting time of each branch-segment is un-affected with each other, the additional latency is the maximal waiting time of among all segments, which is the summation of waiting time of each circle along the branch-segment. Thus, we have,

Latencymin latency = max1≤j≤S(POver Cnum

i=1 (W aitingBj,Over Ci))

, where W aitingBj,Over Ciis the waiting time of the j th branch-segment in the i th concentric-circle and is set to the minimum value between the estimated waiting time and real processing latency.

W aitingBj,Over Ci = M IN {W AIT T IMEBj,Over Ci, LatencyBj,Over Ci}

Note that for the mechanism in the min latency mode, once one partial result is col-lected, the home node informs other Q-nodes the status of KNN results and Q-nodes will determine whether KNN query threads should be propagated or not. For the mechanism in the min energy mode, the goal is to conserve as much energy as possible. Therefore, KNN query threads is propagated after all the partial results in the previous concentric-circles are collected. Obviously, the waiting time W aitingBj,Over Ci in the min latency mechanism is smaller than the holding time HoldingOver Ci in the min energy mechanism. According to the formulas derived above, it can be seen that the latency in the min latency mode is smaller than that in the min energy mode.

Chapter 6

相關文件