Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

12
Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park

Transcript of Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Page 1: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Optimization for Atlas Re-active Engine

Dunam Kim, Hokyu Kang, Yangbae Park

Page 2: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Table of Contents

Page 3: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Introduction

• The problems of the basic RE– PUSH only– Too much energy consumption

• Our objectives– To reduce accessing sensors– To fix minor bugs of the basic RE

Page 4: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Evaluation Shortcut

• Finding optimized execution plan of pulling events

• Steps– Enumerate all possible query-evaluation

plans• All possible sequences of evaluation of atomic

events(terminal events)• Equivalent Rules

– Compute the cost for the plans• Probability of each events

– Pick up the plan having the minimum cost

Page 5: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Evaluation Shortcut (cont’d)

• Probability Model– P(event1) = # Occurrence / # Observation– P(~event1) = 1 - P(event1)– P(event1 ∧ event2) = P(event1) * P(event2)

• Example– P(S1(0,100)) * 1 + P(~S1(0,100)) * P(~S2(0,50))

* 2 + P(~S1(0,100)) * P(S2(0,50)) * 3– [S1,S2,S3], [S1,S2,S3]– [S2,S1,S3],[S2,S3,S1]– [S3,S1,S2],[S3,S2,S1]

Page 6: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Evaluation Shortcut (cont’d)• Formal Representation of Cost Calculation

– n• size of atomic events in forms of S(Number) or  S[Number, Number]. n is 3 in

the previous example.

– Integer x • truth value for each sensing event• x = 011 for [S1(0,100) = FALSE, S2(0,50) = TRUE, S3(0,50) = TRUE]

– M(x)• minimum number of evaluation for the case x, x = 100 for [S1(0,100) = TRUE,

S2(0,50) = FALSE, S3(0,50) = FALSE]

– Pi• probability that ith sensing event is true.• For [S1(0,100), S2(0,50), S3(0,50)], P2 = P(S2(0,50))

– B(x, i) • ith bit value of integer x

B(x, i) = (x >> (n-i)) bitwise & 1

– Expected number of evaluation of sensing event is 

Page 7: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Cache System

Atlas Client (Reactive Engine)

History Manager

Cache Manager

Database

Page 8: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Cache System (cont’d)

• Data History Manager– Stores all received data on the database• MySQL + JDBC Driver

– Provides statistical functions• The number of reports in certain period• Average time interval• Range• Standard Deviation• Probability of event

Page 9: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Cache System (cont’d)

• Cache Manager– Tracks each sensor’s stability• Timestamps• Values

– Controls PUSH/PULL mode of a sensor• Additive Increase Multiplicative Decrease al-

gorithm

– Updates out-of-date caches

Page 10: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Cache System (cont’d)

1 2 3 4 5 6 7 8 9 10 11 12 130

20

40

60

80

100

120

Traditional PUSH mode

value

Time

Valu

e

Page 11: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Cache System (cont’d)

0 5 10 15 20 25 30 35 400

20

40

60

80

100

120

Dynamic PULL mode(Additive Increase)

value

Time

Valu

e

Page 12: Optimization for Atlas Reactive Engine Dunam Kim, Hokyu Kang, Yangbae Park.

Cache System (cont’d)

0 5 10 15 20 25 30 35 400

20

40

60

80

100

120

Dynamic PULL mode(Additive Increase)

value

Time

Valu

e