slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
11/09/2006 PowerPoint Presentation
Download Presentation
11/09/2006

Loading in 2 Seconds...

play fullscreen
1 / 29

11/09/2006 - PowerPoint PPT Presentation


  • 180 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about '11/09/2006' - chapa


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

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

slide2

I

II

III

IV

V

VI

Introduction

Architecture

Data Model and Query Language

Query Dissemination and Result Collection

Query Processing

Conclusions

Outline

slide3

I

II

III

IV

V

VI

Introduction

Architecture

Data Model and Query Language

Query Dissemination and Result Collection

Query Processing

Conclusions

Outline

slide4

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

slide5

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

slide6

Architecture - mote

Query reception

Query processing

Runtime Adaptation

Catalog

TinyOS sampling,

communication

TinyDB

Root (gateway node)

Distributed in Network Query processor

Wireless Sensor networks

slide7

Architecture - server

Client PC-Base station

Query parsing

Query optimization

Query result storage and display

Query

Data

Routing Tree

slide8

I

II

III

IV

V

VI

Introduction

Architecture

Data Model and Query Language

Query Dissemination and Result Collection

Query Processing

Conclusions

Outline

slide9

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
slide10

Query Language - TinySQL

SELECT <aggregates>, <attributes>

[FROM {sensors | <buffer>}]

[WHERE <predicates>]

[GROUP BY <expr>]

[HAVING <predicates>]

[SAMPLE PERIOD <const> | ONCE]

[INTO <buffer>]

slide11

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)
tinysql example
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

event based queries
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

query over stored data
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

slide15

I

II

III

IV

V

VI

Introduction

Architecture

Data Model and Query Language

Query Dissemination and Result Collection

Query Processing

Conclusions

Outline

tree based routing
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

basic aggregation
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

illustration aggregation
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 #

illustration aggregation1
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 #

illustration aggregation2
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 #

illustration aggregation3
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 #

illustration aggregation4
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 #

slide23

I

II

III

IV

V

VI

Introduction

Architecture

Data Model and Query Language

Query Dissemination and Result Collection

Query Processing

Conclusions

Outline

inside tinydb
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

acquisitional query processing acqp
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

acqp what s different
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

operator ordering interleave sampling selection
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

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