D ATA C ACHING IN WSN Mario A. Nascimento Univ. of Alberta, Canada - - PowerPoint PPT Presentation

d ata c aching in wsn
SMART_READER_LITE
LIVE PREVIEW

D ATA C ACHING IN WSN Mario A. Nascimento Univ. of Alberta, Canada - - PowerPoint PPT Presentation

D ATA C ACHING IN WSN Mario A. Nascimento Univ. of Alberta, Canada http: //www.cs.ualberta.ca/~mn With R. Alencar and A. Brayner. Work partially supported by NSERC and CBIE (Canada) and CAPES (Brazil) Outline Outline Motivation


slide-1
SLIDE 1

Mario A. Nascimento

  • Univ. of Alberta, Canada

http: //www.cs.ualberta.ca/~mn

With R. Alencar and A. Brayner. Work partially supported by NSERC and CBIE (Canada) and CAPES (Brazil)

DATA CACHING IN WSN

slide-2
SLIDE 2

2

2 /23

Outline Outline

 Motivation  Cache-Aware Query Processing  Cache-Aware Query Optimization

 Query Partitioning  Cached Data Selection

 Cache Maintenance  Experimental Results

slide-3
SLIDE 3

3

3 /23

(One) Application Scenario (One) Application Scenario

User WSN Station Base Satellite User User User

slide-4
SLIDE 4

4

4 /23

Using Pre Using Previous (Cached) Queries vious (Cached) Queries

Q’ 2 P 1 P 3 Q (a) (b) P

Q’ : Q “minus” {Pi } { Pi } : Set of previous queries Q : Current query

slide-5
SLIDE 5

5

5 /23

Quer Query P y Par artitioning Ov titioning Over erhead head

(b) BS SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN BS SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN (a)

Query processing cost is estimated through an analytical cost-model Query Processing: query is forwarded, locally flooded, results are collected and shipped back

slide-6
SLIDE 6

6

6 /23

Ov Overall Ar erall Archit chitecture ecture

Base Station WSN Processor Query Cache Manager Cache Index Query Optimizer User D( ) P’, D(P’) Q, P’’,

  • Q

D(Q) P Q Q, P’

  • P’’,

Current query Relevant Cached Queries Non-stale subset of P and its dataset Subset of relevant queries and sub-queries (min: query cost) Answer

slide-7
SLIDE 7

7

7 /23

“Quer “Query Plan” Pr y Plan” Problem (QSP)

  • blem (QSP)

Less larger sub-queries vs. more smaller sub-queries

For obtaining Q’ we used the General Polygon Clipper library. For partitioning Q’ into the set of sub-queries Θ we used a O(v log v) algorithm which finds a sub-optimal solution (minimizing the number

  • f sub-queries).
slide-8
SLIDE 8

8

8 /23

B+B (Heuristic) Solution t B+B (Heuristic) Solution to QSP

  • QSP

4 P’’ = P’ P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ , P’ } P’’ = P’ \ {P’ , P’ } 1 2 3 4 2 1 P’’ = P’ \ {P’ , P’ } 2 3 2

For each node Q is “clipped” using a subset of P’’, a set of sub-queries is generated and its cost is obtained. The search stops at a local minimun.

slide-9
SLIDE 9

9

9 /23

Other Heuristic Solutions t Other Heuristic Solutions to QSP

  • QSP

4 P’’ = P’ P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ , P’ } P’’ = P’ \ {P’ , P’ } 1 2 3 4 2 1 P’’ = P’ \ {P’ , P’ } 2 3 2

In addition to the B+B we also used two more aggressive greedy heuristics: GrF (GrE) starts with all (no) cached queries removing (inserting) the smallest (largest) cached query as long as there is some gain. GrF “path”

slide-10
SLIDE 10

10

10 /23

Cache Maint Cache Maintenance enance

  • Reader

Cache Updater Cache Index Query Processor P’, D(P’) Q P’, P’’, Q, P \ P’, P’ \ P’’, Q P Cache Manager (internals) P \ P’

  • Cache
slide-11
SLIDE 11

11

11 /23

Cache Maint Cache Maintenance enance

3 1 2 P (used) Q’ Data that can be used to refresh P ’s data 1 P2 Q (a) (b) (c) P P P 1,1 1,2 P (dropped)

slide-12
SLIDE 12

12

12 /23

Losses Losses wr wrt Optimal Solution Optimal Solution

2 4 6 8 10 12 > 1 ( 8

  • 9

] ( 6

  • 7

] ( 4

  • 5

] ( 2

  • 3

] ( 1

  • 1

] < 1 Frequency [%] Energy loss (range) wrt OPT [%] B+B GrF GrE

B+B is the Branch-and-Bound heuristic. GrF (GrE) is an aggressive greedy heuristic, starting with all (no) cache and removing (inserting) the smallest (largest) cached queries available as long as there is some gain.

slide-13
SLIDE 13

13

13 /23

Gains Gains wr wrt NO NOT Using Cache T Using Cache

2 3 4 5 6 7 8 9 10 11 12 ( 8

  • 9

] ( 6

  • 7

] ( 4

  • 5

] ( 2

  • 3

] (

  • 1

] Frequency [%] Energy savings (range) wrt no cache [%] B+B GrF GrE

By design GrE cannot be any worse that no using any cache.

slide-14
SLIDE 14

14

14 /23

Gains Gains wr wrt Using ALL Cache Using ALL Cache

5 10 15 20 25 30 35 40 ( 8

  • 9

] ( 6

  • 7

] ( 4

  • 5

] ( 2

  • 3

] (

  • 1

] Frequency [%] Energy savings (range) wrt FC [%] B+B GrF GrE

By design GrF cannot be any worse that using all of the cache.

slide-15
SLIDE 15

15

15 /23

 Detailed results or skip to main conclusions?

slide-16
SLIDE 16

16

16 /23

De Detailed results tailed results

 We investigate the performance of the proposed

approach wrt efficiency (for finding the query plan) and effectiveness (cost of solution) when varying:

 Number of sensors  Size of cache (number of cached queries)  Query size (wrt total area)  Validity time (of cached results)

slide-17
SLIDE 17

17

17 /23

Var arying # of Sensor ying # of Sensors s

5 10 15 20 25 5 4 3 2 1 Energy cost loss wrt OPT [%] Number of sensors (x 1,000) B+B FC GrF GrE 1 10 100 1000 10000 5 4 3 2 1 Number of states explored Number of sensors (x 1,000) GrE GrF B+B OPT

slide-18
SLIDE 18

18

18 /23

Var arying Cache Size ying Cache Size

5 10 15 20 500 400 300 200 100 Energy cost loss wrt OPT [%] Cache size [# Queries] B+B FC GrF GrE 1 10 100 1000 10000 500 400 300 200 100 Number of states explored Cache size [# Queries] GrE GrF B+B OPT

slide-19
SLIDE 19

19

19 /23

Var arying Quer ying Query Size y Size

10 20 30 40 50 60 70 16 4 1 0.25 0.01 Energy cost loss wrt OPT [%] Query size [% of total area] B+B FC GrF GrE 1 10 100 1000 10000 16 4 1 0.25 0.01 Number of explored states Query size [% total area] GrE GrF B+B OPT

slide-20
SLIDE 20

20

20 /23

Var arying Quer ying Query V y Validity Time alidity Time

2 4 6 8 10 12 10 15 20 25 30 35 40 45 50 Energy cost loss wrt OPT [%] Validity time [number of timestamps] B+B FC GrF GrE 1 10 100 1000 10000 10 15 20 25 30 35 40 45 50 Number of states explored Validity time [# timestamps] GrE GrF B+B OPT

slide-21
SLIDE 21

21

21 /23

Conclusions Conclusions

 The cached query selection, query clipping and sub-

queries generation amounts to a fairly complex and combinatorial problem

 Although a query cost model is needed, our proposal

is orthogonal to it

 If nothing can be done your best shot is to use all of

the cache, but …

slide-22
SLIDE 22

22

22 /23

Conclusions Conclusions

 The Branch-and-Bound heuristic :

 Finds a “query plan” orders of magnitude faster

than the exhaustive search

 Is typically less than 2% more expensive than the

  • ptimal query cost

 Is robust with respect to a number of different

parameters

 Next stop:  Aggregation queries …

slide-23
SLIDE 23

23

23 /23

Thanks Thanks