Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Sensor Network Databases Ref: Wireless sensor networks---An information processing approach Feng Zhao and Leonidas Guibas (chapter 6)

Similar presentations


Presentation on theme: "1 Sensor Network Databases Ref: Wireless sensor networks---An information processing approach Feng Zhao and Leonidas Guibas (chapter 6)"— Presentation transcript:

1 1 Sensor Network Databases Ref: Wireless sensor networks---An information processing approach Feng Zhao and Leonidas Guibas (chapter 6)

2 2 Sensor Network as Database: Think of a sensor network as a distributed database that store data within the network and allow queries to be injected anywhere in the network. Research issues –how is data stored and organized after sensing –what’s the user interface to the sensor database –How does an external query find and process the data in an efficient manner?

3 3 Challenges –The system is highly volatile –Relational tables are not static New data is continuously sensed –High communication cost In-net processing during query execution –Arbitrarily long delay and unavailable –Limited storage Older data has to be discarded Keep statistics –Range queries common –Long-running, continuous queries

4 4 Querying the physical world –Common user operations in sensor network: Queries Actuate & control –Query: user specify the data they want Simple, SQL-like queries Using predicates, not specific addresses –Challenge is to provide: Expressive and easy-to-use interface High-level operators Power efficient execution framework –Do sensor networks change query processing?

5 5 Type of queries –Historical What is the average rainfall over past 2 days? –Current What is the current temperature in Rm# MI 303? –Long running, continuous Temperature in Rm# MI 303 over the next 4 hours every 30 seconds.

6 6 Example Query –High-level query interface such as SQL  For next 3 hours, retrieve every 10 minutes the max rainfall level in each county in California, if it is greater than 3.0 inch.  SELECT max (rainfal_Level),county FROM sensors Where STATE = California GROUP BY country HAVING max (rainfal_Level) > 3.0in DURATION [ now, now+180min] SAMPLING PERIOD 10 min

7 7 Issues –How to identify relevant sensors? –Computation vs. communication tradoff Where to process query? Inside the sensor network (route query) At centralized location (route data) –Large amount of data transfer  not efficiency How to process?

8 8 Data aggregation –Aggregate data as it flows through the network –Data must meet certain criteria –Not all data can be aggregated

9 9 Issues –When is data generated? sporadic, periodic –Where is data generated? all-producing, selected-producing, single- producing –Where’s data collected? full-site, selected-site, single-site –How is data packaged? Lossy or lossless? Concatenation, fusion, addition, reduction

10 10 Ex : All-producing Model Characteristics: All nodes produce periodically Data can be aggregated Tree construction is down by simple broadcast

11 11 Tiny Aggregation(TAG) In-network processing of aggregates in TinyDB –Common data analysis operation –Communication reducing –Across nodes during same epoch Assume query from external server(sink) Exploit query semantics to improve efficiency

12 12 At A Glance … Trying to minimize the number of messages sent All aggregation is done by building a tree

13 13 Basic Aggregation –In each epoch (sampling period): Consists of # time intervals=tree depth Each node samples local sensors once Generates partial state record (PSR) Local readings and readings from children Outputs PSR during assigned comm. Interval –At end of epoch, PSR for while network output at root –New result on each successive epoch

14 14 Example Select count(*) From sensors 2 1 4 5 3 1 Epoch Interval 4 12345 41 3 2 1 4 Nodes 1,2,3 may sleep Sensor # Interval # Level 1 Level 2 Level 3 Level 4

15 15 Notations Each epoch is divided into a number of fixed-length time intervals. Intervals are numbered in reverse order such that interval 1 is the last interval in the epoch Each node is assigned to the interval equal to its level In the interval preceding their own, nodes listen to their radios, collecting results from any child nodes During a node’s interval, – if it is aggregating, it computes the partial state record (PSR) consisting of the combination of any child values it heard with its own local readings. –After this computation, it transmits either its PSR or raw sensor readings up the network.

16 16 Example Select count(*) From sensors 2 1 4 5 3 2 Epoch Interval 3 12345 41 3 2 1 4 Nodes 1,2,5 may sleep Sensor # Interval # 2

17 17 Example Select count(*) From sensors 2 1 4 5 3 3 Epoch Interval 2 12345 41 32 213 1 4 Nodes 4,5 may sleep Sensor # Interval # 3

18 18 Example Select count(*) From sensors 2 1 4 5 3 4 Epoch Interval 1 12345 41 32 213 15 4 Nodes 2,3,4,5 may sleep Sensor # Interval #

19 19 Example Select count(*) From sensors 2 1 4 5 3 1 Epoch Interval 4 12345 41 3 2 1 4 Nodes 1,2,3 may sleep Sensor # Interval #

20 20 The Tiny Aggregation (TAG) Approach (S. Madden, UCB) Push declarative queries into network –Impose a hierarchical routing tree onto the network Divide time into epochs Every epoch, sensors evaluate query over local sensor data and data from children –Aggregate local and child data –Each node transmits just once per epoch –Pipelined approach increases throughput Depending on aggregate function, various optimizations can be applied

21 21 SQL Primer (Madden) SQL is an established declarative language; not wedded to it –Some extensions clearly necessary, e.g. for sample rates We adopt a basic subset: ‘sensors’ relation (table) has –One column for each reading-type, or attribute –One row for each externalized value May represent an aggregation of several individual readings SELECT {agg n (attr n ), attrs} FROM sensors WHERE {selPreds} GROUP BY {attrs} HAVING {havingPreds} EPOCH DURATION s SELECT AVG(light) FROM sensors WHERE sound < 100 GROUP BY roomNo HAVING AVG(light) < 50

22 22 Query Propagation (Madden) TAG propagation agnostic –Any algorithm that can: Deliver the query to all sensors Provide all sensors with one or more duplicate free routes to some root Paper describes simple flooding approach –Query introduced at a root; rebroadcast by all sensors until it reaches leaves –Sensors pick parent and level when they hear query –Reselect parent after k silent epochs Query P:0, L:1 2 1 5 3 4 6 P:1, L:2 P:3, L:3 P:2, L:3 P:4, L:4

23 23 TAG Discussion (Madden) Result is a stream of values –Ideal for monitoring scenarios One communication / node / epoch –Symmetric power consumption, even at root New value on every epoch –After d-1 epochs, complete aggregation Given a single loss, network will recover after at most d-1 epochs With time synchronization, nodes can sleep between epochs, except during small communication window 1 2 3 4 5

24 24 Taxonomy of Aggregates (Madden) TAG insight: classifying aggregates according to various functional properties –Yields a general set of optimizations that can automatically be applied PropertyExamplesAffects Partial StateMEDIAN : unbounded, MAX : 1 record Effectiveness of TAG Duplicate SensitivityMIN : dup. insensitive, AVG : dup. sensitive Routing Redundancy Exemplary vs. Summary MAX : exemplary COUNT: summary Applicability of Sampling, Effect of Loss MonotonicCOUNT : monotonic AVG : non-monotonic Hypothesis Testing, Snooping

25 25 Data Indices and Range Queries –Key idea: pre-storing the answers to certain special queries –One-dimensional indices Canonical subset: the subset of data forming pre-stored answers –Example: Counting cars passing in each sensor Query for counts over various contiguous segments of the

26 26 One-Dimensional Indices –Build a binary tree: Map u i to s i-1 An internal node aggregates counts from all its descendant sensors in the tree If query for segment between s0 an s4, can get answer from u2( stored in s1) Any segment can be answered by combining subtrees –Partial data aggregation: key for indexing range queries s0 s1s2 s3 s4s5s6s7 u2 u1 u3 u4 u5u6 u7 u4=s0  S1  s2  s3  s4  s5  s6  s7 u1=s0  S1 u3=s2  s3 …

27 27 Multi-dimensional Indices Select * From event s Where Temp >=50 and Temp<=60 and Light >=5 and Light <10 0 1020 3040 50 60 70 Temperature 10 20 30 40 Light_reading

28 28 Three-dimensional indices: k - d tree


Download ppt "1 Sensor Network Databases Ref: Wireless sensor networks---An information processing approach Feng Zhao and Leonidas Guibas (chapter 6)"

Similar presentations


Ads by Google