Skip to main content
. 2019 May 22;19(10):2363. doi: 10.3390/s19102363
Algorithm 3 Sensor Data Feedback
X ← a sensor node in the query window
queryWindow ← the query window
L ← the hierarchical level of X’s PCH in the query window input by the user
Depth ← the depth of the quadtree structure
GetDataOfRegion(queryWindow, L, Depth){
Begin
if (X is a CH)
if (0<Level<Depth-1)
then begin
  • Step1. Collects and aggregates the required sensing data from CMs;

  • Step2. Aggregates the required sensing data by the algorithm in Section 3.4;

  • Step3. Uses PCH selection algorithm to calculate the level = L PCH;

  • Step4. Calculates the routing to the level = L PCH;

  • Step5. Sends the data to higher level PCH by formula (4)&(5) until level = L PCH receives the data packet;

end
if (Level =Depth-1)
    then begin
  • Step2. Aggregates the required sensing data by the algorithm in Section 3.4;

  • Step6. Directly send packets to Sink;

    end
end
else begin
  • Step7. X sends the sensing data to its CH

    end
    end
}