1 / 29

11/09/2006

Query Processing in Sensor Networks. 11/09/2006. Se Ho Park Hyun Ik Jang Frolin Rusu. W. Hong & S. Madden – Implementation and Research Issues in Query Processing for Wireless Sensor Networks, ICDE 2004. I. II. III. IV. V. VI. Introduction. Architecture. Data Model and Query Language.

chapa
Télécharger la présentation

11/09/2006

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Query Processing in Sensor Networks 11/09/2006 Se Ho Park Hyun Ik Jang Frolin Rusu W. Hong & S. Madden – Implementation and Research Issues in Query Processing for Wireless Sensor Networks, ICDE 2004

  2. I II III IV V VI Introduction Architecture Data Model and Query Language Query Dissemination and Result Collection Query Processing Conclusions Outline

  3. I II III IV V VI Introduction Architecture Data Model and Query Language Query Dissemination and Result Collection Query Processing Conclusions Outline

  4. Introduction – Sensor Database SELECT MAX(mag) FROM sensors WHERE mag > thresh SAMPLE PERIOD 64ms • High level abstraction: • Data centric programming • Interact with sensor network as a whole • Extensible framework • Under the hood: • Intelligent query processing: query optimization, power efficient execution • Fault Mitigation: automatically introduce redundancy, avoid problem areas App Query, Trigger Data Sensor Network Query Processor

  5. Architecture - overall TinyDB GUI JDBC TinyDB Client API DBMS PC side 0 Mote side TinyDB query processor 0 2 1 3 8 4 5 6 Sensor network 7

  6. Architecture - mote Query reception Query processing Runtime Adaptation Catalog TinyOS sampling, communication TinyDB Root (gateway node) Distributed in Network Query processor Wireless Sensor networks

  7. Architecture - server Client PC-Base station Query parsing Query optimization Query result storage and display Query Data Routing Tree

  8. I II III IV V VI Introduction Architecture Data Model and Query Language Query Dissemination and Result Collection Query Processing Conclusions Outline

  9. Data Model • Entire sensor network as one single, infinitely-long logical table: sensors • Columns consist of all the attributes defined in the network • Typical attributes: • Sensor readings • Meta-data: node id, location, etc. • Internal states: routing tree parent, time-stamps, queue length, etc. • Nodes return NULL for unknown attributes • On server, all attributes are defined in catalog.xml

  10. Query Language - TinySQL SELECT <aggregates>, <attributes> [FROM {sensors | <buffer>}] [WHERE <predicates>] [GROUP BY <expr>] [HAVING <predicates>] [SAMPLE PERIOD <const> | ONCE] [INTO <buffer>]

  11. Comparison with SQL • Single table in FROM clause • No sub-queries • No column alias in SELECT clause • Only fundamental difference: SAMPLE PERIOD clause • The result of query is a stream of values (rather than single aggregate value)

  12. TinySQL Example “Find the sensors in bright nests.” Sensors SELECTnodeid, nestNo, light FROMsensors WHERElight > 400 SAMPLE PRIOD1s FOR 2s Epoch nodeid nestNo light 0 1 17 455 0 2 25 389 1 1 17 422 1 2 25 405

  13. Event-based Queries ON event SELECT … Run query only when interesting events happen Event examples Button pushed Message arrival Bird enters nest Analogous to triggers but events are user-defined

  14. Query over Stored Data Named buffers in Flash memory Store query results in buffers Query over named buffers Analogous to materialized views Example: CREATE BUFFERname SIZE x (field1 type1, field2 type2, …) SELECTa1, a2 FROM sensorsSAMPLEPERIODdINTOname SELECTfield1, field2, …FROMnameSAMPLE PERIODd

  15. I II III IV V VI Introduction Architecture Data Model and Query Language Query Dissemination and Result Collection Query Processing Conclusions Outline

  16. Tree-based Routing Tree-based routing Used in: Query delivery Data collection In-network aggregation Q:SELECT … A Q R:{…} Q R:{…} Q B C Q Q R:{…} Q Q D R:{…} Q R:{…} Q Q Q F E Q

  17. Basic Aggregation In each epoch: Each node samples local sensors once Generates partial state record (PSR) local readings readings from children Outputs PSR during assigned comm. interval At end of epoch, PSR for whole network output at root New result on each successive epoch 1 2 3 4 5

  18. Illustration: Aggregation SELECT COUNT(*) FROM sensors Sensor # 1 Epoch 1 2 3 4 5 2 4 1 3 3 2 4 1 1 4 5 Interval 4 Interval #

  19. Illustration: Aggregation SELECT COUNT(*) FROM sensors Sensor # 1 1 2 3 4 5 2 4 1 3 3 2 2 2 4 1 4 5 Interval 3 Interval #

  20. Illustration: Aggregation SELECT COUNT(*) FROM sensors Sensor # 1 1 1 2 3 4 5 3 2 4 1 3 3 2 2 1 3 4 1 4 5 Interval 2 Interval #

  21. Illustration: Aggregation SELECT COUNT(*) FROM sensors 5 Sensor # 1 1 2 3 4 5 2 4 1 3 3 2 2 1 3 4 1 5 4 5 Interval 1 Interval #

  22. Illustration: Aggregation SELECT COUNT(*) FROM sensors Sensor # 1 1 2 3 4 5 2 4 1 3 3 2 2 1 3 4 1 5 1 4 1 5 Interval 4 Interval #

  23. I II III IV V VI Introduction Architecture Data Model and Query Language Query Dissemination and Result Collection Query Processing Conclusions Outline

  24. Inside TinyDB T:1, AVG: 225 T:2, AVG: 250 SELECT AVG(temp) WHERE light > 400 Results Queries Aggavg(temp) Filterlight > 400 Name: temp Time to sample: 50 uS Cost to sample: 90 uJ Calibration Table: 3 Units: Deg. F Error: ± 5 Deg F Get f: getTempFunc()… got(‘temp’) get (‘temp’) Tables Samples getTempFunc(…) Multihop Network Query Processor Schema TinyOS TinyDB

  25. Acquisitional Query Processing (ACQP) TinyDB acquires AND processes data Could generate an infinite number of samples An acqusitional query processor controls when, where, and with what frequency data is collected! Versus traditional systems where data is provided a priori

  26. ACQP: What’s Different? How should the query be processed? Sampling as a first class operation How does the user control acquisition? Rates or lifetimes Event-based triggers Which nodes have relevant data? Index-like data structures Which samples should be transmitted? Prioritization, summary, and rate control

  27. Operator Ordering: Interleave Sampling + Selection At 1 sample / sec, total power savings could be as much as 3.5mW  Comparable to processor! Correct ordering (unless pred1 is very selective and pred2 is not): Traditional DBMS (pred2) (pred1) (pred1) Costly mag light ACQP (pred2) (pred2) (pred1) Cheap light mag mag light • E(sampling mag) >> E(sampling light) 1500 uJ vs. 90 uJ SELECT light, mag FROM sensors WHERE pred1(mag) AND pred2(light) SAMPLE PERIOD 1s

  28. Conclusions • Architecture • Data Model and Query Language • Query Dissemination and Result Collection • Query Processing

  29. Questions ?

More Related