Model and Implementa:on G. Cugola E. Della Valle - - PowerPoint PPT Presentation

model and implementa on
SMART_READER_LITE
LIVE PREVIEW

Model and Implementa:on G. Cugola E. Della Valle - - PowerPoint PPT Presentation

Stream and Complex Event Processing Uncertainty in CEP Model and Implementa:on G. Cugola E. Della Valle A. Margara


slide-1
SLIDE 1

Stream ¡and ¡Complex ¡Event ¡Processing ¡

Uncertainty ¡in ¡CEP ¡ Model ¡and ¡Implementa:on ¡

  • G. ¡Cugola ¡ ¡ ¡ ¡E. ¡Della ¡Valle ¡

¡ ¡ ¡A. ¡Margara ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡Politecnico ¡di ¡Milano ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Vrije ¡Universiteit ¡Amsterdam ¡

cugola@elet.polimi.it a.margara@vu.nl dellavalle@elet.polimi.it

slide-2
SLIDE 2

Uncertainty ¡in ¡CEP ¡

Complex ¡Event ¡ Processing ¡

sources ¡ sinks ¡ rules ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 2 ¡

slide-3
SLIDE 3

Uncertainty ¡in ¡CEP ¡

Iden:fy ¡ Model ¡ ¡ & ¡ Propagate ¡ Implement ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 3 ¡

slide-4
SLIDE 4

IDENTIFY ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 4 ¡

slide-5
SLIDE 5

Iden:fy ¡

  • Uncertainty ¡in ¡events ¡
  • Content ¡of ¡events ¡
  • Occurrence ¡of ¡events ¡
  • Time ¡of ¡occurrence ¡
  • Uncertainty ¡in ¡rules ¡
  • Incomplete ¡knowledge ¡of ¡the ¡domain ¡
  • Erroneous ¡assump:ons ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 5 ¡

slide-6
SLIDE 6

Uncertainty ¡in ¡Events ¡

  • Content ¡of ¡events ¡
  • Imprecise ¡sensor ¡
  • E.g., ¡a ¡temperature ¡sensor ¡with ¡max ¡resolu:on ¡of ¡1°C ¡
  • Erroneous ¡reading ¡from ¡sensors ¡
  • Systema:c ¡error ¡

– E.g., ¡the ¡measured ¡temperature ¡is, ¡on ¡the ¡average, ¡1°C ¡higher ¡ than ¡the ¡real ¡temperature ¡

  • Random ¡error ¡

– Varies ¡from ¡measure ¡to ¡measure ¡ – Centered ¡around ¡the ¡“real” ¡value ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 6 ¡

slide-7
SLIDE 7

Uncertainty ¡in ¡Events ¡

  • Occurrence ¡of ¡events ¡
  • False ¡nega:ves ¡
  • E.g., ¡source ¡failure ¡/ ¡communica:on ¡error ¡
  • There ¡is ¡a ¡probability ¡that ¡there ¡is ¡smoke ¡even ¡if ¡we ¡did ¡

not ¡receive ¡any ¡no:fica:on ¡from ¡a ¡smoke ¡sensor ¡

  • False ¡posi:ves ¡
  • E.g., ¡imprecise ¡source ¡
  • There ¡is ¡a ¡probability ¡that ¡there ¡is ¡no ¡smoke ¡even ¡if ¡we ¡

received ¡a ¡no:fica:on ¡from ¡the ¡smoke ¡sensor ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 7 ¡

slide-8
SLIDE 8

Uncertainty ¡in ¡Events ¡

  • Time ¡of ¡occurrence ¡
  • Two ¡problems: ¡
  • Synchroniza:on ¡problems ¡
  • Out ¡of ¡order ¡delivery ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 8 ¡

slide-9
SLIDE 9

Synchroniza:on ¡Problems ¡

  • If ¡A ¡and ¡B ¡are ¡very ¡close ¡(in ¡:me) ¡to ¡each ¡other, ¡

how ¡can ¡we ¡evaluate ¡the ¡correct ¡order? ¡

  • Impossibility ¡to ¡implement ¡clock ¡synchroniza:on ¡with ¡

infinite ¡precision ¡

A ¡à ¡B ¡ A ¡ B ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 9 ¡

slide-10
SLIDE 10

Out-­‑of-­‑Order ¡Delivery ¡

  • Imagine ¡we ¡have ¡“precise ¡enough” ¡clocks ¡
  • Aber ¡receiving ¡B, ¡should ¡we ¡wait ¡for ¡an ¡A ¡(with ¡

lower ¡:mestamp)? ¡

  • How ¡long ¡should ¡we ¡wait? ¡

A ¡à ¡B ¡ A ¡ B ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 10 ¡

slide-11
SLIDE 11

Out-­‑of-­‑Order ¡Delivery ¡

  • In ¡most ¡CEP ¡systems ¡out-­‑of-­‑order ¡is ¡simply ¡

ignored ¡

  • For ¡performance ¡reasons ¡
  • Some:mes ¡events ¡are ¡stored ¡and ¡ordered ¡in ¡

an ¡input ¡queue ¡before ¡processing ¡

  • When ¡performance ¡are ¡not ¡of ¡primary ¡importance ¡
  • Simple ¡solu:on ¡
  • Es:ma:on ¡of ¡maximum ¡delay ¡(MD) ¡
  • Always ¡wait ¡for ¡MD ¡before ¡events ¡can ¡be ¡processed ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 11 ¡

slide-12
SLIDE 12

Out-­‑of-­‑Order ¡Delivery ¡

12 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡

A ¡à ¡B ¡ A ¡ B ¡

10ms ¡

slide-13
SLIDE 13

MODEL ¡& ¡PROPAGATE ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 13 ¡

slide-14
SLIDE 14

Requirements ¡

  • Capture ¡both ¡uncertainty ¡of ¡events ¡and ¡rules ¡
  • Expressive ¡
  • Should ¡apply ¡to ¡exis:ng ¡rule ¡languages ¡
  • Low ¡overhead ¡
  • CEP ¡engines ¡are ¡designed ¡for ¡performance! ¡
  • Easy ¡to ¡use ¡
  • Wri:ng ¡rules ¡is ¡complex! ¡
  • We ¡do ¡not ¡want ¡to ¡further ¡complicate ¡it ¡
  • Actually, ¡we ¡want ¡to ¡simplify ¡it ¡… ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 14 ¡

slide-15
SLIDE 15

Our ¡Solu:on ¡

  • CEP2U ¡
  • Complex ¡Event ¡Processing ¡Under ¡Uncertainty ¡

15 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡

slide-16
SLIDE 16

CEP2U ¡-­‑ ¡Design ¡

  • Two ¡different ¡models ¡
  • Probability ¡theory ¡
  • To ¡model ¡uncertainty ¡in ¡events ¡
  • Bayesian ¡Networks ¡
  • To ¡model ¡uncertainty ¡in ¡rules ¡
  • Completely ¡independent ¡modeling ¡and ¡

evalua:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 16 ¡

slide-17
SLIDE 17

CEP2U ¡-­‑ ¡Design ¡

  • Low ¡modeling ¡effort ¡
  • Uncertainty ¡in ¡events ¡does ¡not ¡affect ¡rule ¡

defini:on ¡

  • Effort ¡delegated ¡to ¡sources ¡
  • Uncertainty ¡in ¡rules ¡is ¡op:onal ¡
  • Incremental ¡modeling ¡is ¡possible ¡

– Refinement ¡steps ¡

  • Actually ¡simplifies ¡modeling ¡

– When ¡unknown ¡phenomena ¡influence ¡the ¡occurrence ¡of ¡ composite ¡events ¡ – When ¡non ¡measurable ¡phenomena ¡influence ¡the ¡occurrence ¡

  • f ¡composite ¡events ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 17 ¡

slide-18
SLIDE 18

CEP2U ¡-­‑ ¡Design ¡

  • Designed ¡to ¡demand ¡for ¡low ¡processing ¡effort ¡
  • Uncertainty ¡in ¡events ¡introduces ¡a ¡rela:vely ¡low ¡
  • verhead ¡during ¡event ¡processing ¡
  • Uncertainty ¡in ¡rules ¡evaluated ¡at ¡rule ¡design ¡:me ¡
  • No ¡addi:onal ¡effort ¡at ¡run-­‑:me ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 18 ¡

slide-19
SLIDE 19

UNCERTAINTY ¡IN ¡EVENTS ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 19 ¡

slide-20
SLIDE 20

CEP2U ¡-­‑ ¡Event ¡Model ¡

Temp@10 ¡%1 ¡ (km=<16.1, ¡U(-­‑1,1), ¡value=<24.5, ¡N(0,1)> ¡

Probability ¡of ¡

  • ccurrence ¡

Random ¡error, ¡ encoded ¡as ¡a ¡random ¡variable ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 20 ¡

slide-21
SLIDE 21

CEP2U ¡-­‑ ¡Event ¡Model ¡

  • Error ¡in ¡event ¡arributes ¡can ¡and ¡should ¡be ¡

defined ¡at ¡sources ¡

  • E.g., ¡based ¡on ¡the ¡data ¡sheets ¡of ¡the ¡sensors ¡
  • E.g., ¡based ¡on ¡previous ¡observa:ons ¡
  • Probability ¡of ¡occurrence ¡and ¡distribu:on ¡of ¡

arributes ¡of ¡composite ¡events ¡

  • Computed ¡at ¡run-­‑:me ¡
  • As ¡part ¡of ¡the ¡detec:on ¡process ¡
  • Based ¡on ¡the ¡values ¡in ¡primi:ve ¡events ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 21 ¡

slide-22
SLIDE 22

CEP2U ¡-­‑ ¡Assump:ons ¡

  • Primi:ve ¡events ¡have ¡always ¡an ¡associated ¡

probability ¡of ¡occurrence ¡of ¡1 ¡

  • As ¡we ¡will ¡see, ¡false ¡posi:ves ¡and ¡false ¡nega:ves ¡

can ¡be ¡considered ¡while ¡modeling ¡the ¡uncertainty ¡ in ¡rules ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 22 ¡

slide-23
SLIDE 23

CEP2U ¡-­‑ ¡Assump:ons ¡

  • Values ¡in ¡event ¡arributes ¡are ¡independent ¡

from ¡each ¡other ¡

  • Not ¡a ¡theore:cal ¡limita:on ¡in ¡the ¡model ¡… ¡
  • It ¡would ¡be ¡possible ¡to ¡consider ¡mul:-­‑dimensional ¡

random ¡variables ¡

  • … ¡but ¡a ¡design ¡choice ¡
  • To ¡simplify ¡the ¡defini:on ¡of ¡events ¡
  • To ¡simplify ¡the ¡genera:on ¡of ¡events ¡

– From ¡sources ¡

  • To ¡reduce ¡the ¡overhead ¡of ¡computa:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 23 ¡

slide-24
SLIDE 24

CEP2U ¡-­‑ ¡Assump:ons ¡

  • Timestamps ¡are ¡always ¡assumed ¡to ¡be ¡correct ¡
  • Trade ¡precision ¡for ¡performance ¡
  • Common ¡choice ¡in ¡almost ¡all ¡exis:ng ¡systems ¡
  • They ¡all ¡ignore ¡communica:on ¡delays ¡… ¡
  • … ¡offering ¡no ¡support ¡for ¡out-­‑of-­‑order ¡event ¡delivery ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 24 ¡

slide-25
SLIDE 25

CEP2U ¡-­‑ ¡Rule ¡Model ¡

  • We ¡use ¡TESLA ¡as ¡our ¡reference ¡language ¡… ¡
  • … ¡but ¡we ¡consider ¡the ¡main ¡operators ¡present ¡in ¡

exis:ng ¡languages ¡

  • Selec:on ¡
  • Combina:on ¡
  • Nega:on ¡
  • Aggrega:on ¡
  • Produc:on ¡
  • Generic ¡approach ¡
  • Suitable ¡for ¡stream ¡processing ¡systems ¡… ¡
  • … ¡including ¡parern ¡matching ¡operators ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 25 ¡

slide-26
SLIDE 26

PROPAGATE ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 26 ¡

slide-27
SLIDE 27

CEP2U ¡– ¡Propaga:on ¡

  • We ¡focus ¡on ¡the ¡different ¡abstract ¡operators ¡

we ¡iden:fied ¡

  • We ¡show ¡how ¡we ¡consider ¡uncertainty ¡in ¡

events ¡… ¡

  • … ¡to ¡derive ¡the ¡uncertainty ¡in ¡composite ¡

events ¡

  • Uncertainty ¡of ¡occurrence ¡
  • Uncertainty ¡in ¡the ¡values ¡of ¡arributes ¡

27 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡

slide-28
SLIDE 28

CEP2U ¡by ¡Examples ¡

  • Tunnel ¡Ven:la:on ¡System ¡(TVS) ¡

Malfunc:oning ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 28 ¡

slide-29
SLIDE 29

Selec:on ¡

  • Assume ¡we ¡receive ¡the ¡following ¡event ¡
  • We ¡need ¡to ¡compute ¡the ¡probability ¡that ¡the ¡

two ¡constraints ¡are ¡sa:sfied ¡

– P(Temp.km ¡< ¡17.1) ¡* ¡P(Temp.value ¡> ¡30) ¡ – We ¡can ¡mul:ply ¡since ¡we ¡assume ¡arributes’ ¡ values ¡are ¡independent ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 29 ¡

slide-30
SLIDE 30

Selec:on ¡

  • Consider ¡the ¡first ¡constraint ¡
  • P(Temp.km ¡< ¡17.1) ¡
  • Temp.km ¡= ¡<16.2, ¡U(-­‑1,1)> ¡

Real ¡ (unknown) ¡ value ¡ Error ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 30 ¡

slide-31
SLIDE 31

Selec:on ¡

  • Similar ¡for ¡the ¡second ¡constraint ¡
  • P(Temp.value ¡> ¡30) ¡
  • Temp.value ¡= ¡<31.8, ¡N(0,1)> ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 31 ¡

slide-32
SLIDE 32

Selec:on ¡

  • The ¡probability ¡that ¡both ¡constraints ¡are ¡

sa:sfied ¡is ¡the ¡product ¡of ¡the ¡two ¡ probabili:es ¡

  • 0.9 ¡* ¡0.964 ¡= ¡0.868 ¡
  • We ¡have ¡no ¡addi:onal ¡constraints ¡
  • 0.868 ¡is ¡the ¡probability ¡of ¡occurrence ¡of ¡

TVS_Malfun ¡

  • It ¡is ¡propagated ¡to ¡sinks ¡
  • Can ¡consider ¡it ¡to ¡decide ¡their ¡(re-­‑) ¡ac:ons ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 32 ¡

slide-33
SLIDE 33

Combina:on ¡

  • Consider ¡the ¡following ¡two ¡events ¡
  • From ¡previous ¡example, ¡P(value ¡> ¡30) ¡= ¡0.964 ¡
  • We ¡need ¡to ¡compute ¡the ¡combina:on ¡constraint ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 33 ¡

slide-34
SLIDE 34

Combina:on ¡

  • We ¡know ¡that ¡
  • From ¡which ¡we ¡can ¡derive ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 34 ¡

slide-35
SLIDE 35

Combina:on ¡

  • We ¡can ¡compute ¡the ¡probability ¡of ¡the ¡constraint ¡
  • 0.999 ¡
  • The ¡probability ¡of ¡the ¡composite ¡event ¡

becomes ¡

– 0.999*0.964 ¡= ¡0.963 ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 35 ¡

slide-36
SLIDE 36

Combina:on ¡

  • Problem ¡
  • Not ¡always ¡possible ¡to ¡combine ¡random ¡variables ¡
  • Non ¡linear ¡opera:ons ¡

– E.g., ¡bi-­‑dimensional ¡area ¡instead ¡of ¡“km” ¡arribute ¡

  • Different ¡distribu:ons ¡

– E.g., ¡Sum ¡of ¡normal ¡and ¡uniform ¡

  • Solu:on ¡
  • Use ¡Monte ¡Carlo ¡simula:on ¡to ¡approximate ¡
  • Computa:onally ¡expensive ¡
  • Hopefully, ¡not ¡necessary ¡in ¡real ¡applica:ons ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 36 ¡

slide-37
SLIDE 37

Nega:on ¡

  • Nega:on ¡of ¡one ¡event ¡
  • Type ¡E ¡
  • Constraints ¡c ¡
  • In ¡a ¡window ¡w ¡
  • E.g., ¡Not ¡Rain(mm>0.5) ¡within ¡5 ¡min ¡
  • We ¡received ¡n ¡events ¡of ¡type ¡Rain ¡in ¡w ¡(5 ¡min) ¡
  • We ¡want ¡to ¡compute ¡the ¡probability ¡that ¡no ¡

Rain(mm>0.5) ¡event ¡occurred ¡in ¡w ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 37 ¡

slide-38
SLIDE 38

Nega:on ¡

  • pi ¡is ¡the ¡probability ¡the ¡the ¡ith ¡event ¡of ¡type ¡E ¡

in ¡w ¡sa:sfies ¡c ¡

  • The ¡probability ¡of ¡the ¡nega:on ¡is ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 38 ¡

slide-39
SLIDE 39

Aggrega:on ¡

  • Assume ¡we ¡receive ¡n ¡events ¡to ¡aggregate ¡
  • Also ¡assume ¡that ¡the ¡error ¡of ¡the ¡value ¡to ¡aggregate ¡is ¡

normally ¡distributed ¡

  • We ¡can ¡evaluate ¡the ¡aggregate ¡constraint ¡as ¡

follows ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 39 ¡

slide-40
SLIDE 40

Aggrega:on ¡

  • As ¡for ¡combina:on, ¡compu:ng ¡aggregates ¡may ¡

be ¡difficult ¡

  • Non ¡linear ¡aggrega:on ¡func:ons ¡
  • E.g., ¡Maximum, ¡minimum ¡
  • Heterogeneous ¡distribu:ons ¡
  • E.g., ¡Normal ¡and ¡Uniform ¡
  • Distribu:ons ¡that ¡are ¡not ¡close ¡w.r.t. ¡the ¡aggrega:on ¡

func:on ¡

  • E.g., ¡Uniform ¡and ¡linear ¡combina:on ¡
  • As ¡for ¡combina:on, ¡we ¡can ¡use ¡Monte ¡Carlo ¡

simula:on ¡

  • Hopefully ¡not ¡necessary ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 40 ¡

slide-41
SLIDE 41

Aggrega:on ¡

  • The ¡set ¡of ¡events ¡to ¡consider ¡can ¡itself ¡be ¡

uncertain ¡

  • E.g., ¡it ¡depends ¡from ¡another ¡selec:on ¡or ¡composi:on ¡

constraint ¡

  • Aggregate ¡all ¡temperature ¡events ¡in ¡a ¡certain ¡area ¡
  • We ¡need ¡to ¡take ¡into ¡account ¡also ¡the ¡probability ¡that ¡

an ¡event ¡has ¡to ¡take ¡part ¡into ¡the ¡aggregate ¡

  • Example: ¡
  • Two ¡temperature ¡reading ¡t1 ¡and ¡t2 ¡
  • We ¡want ¡to ¡compute ¡the ¡average ¡avg ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 41 ¡

slide-42
SLIDE 42

Produc:on ¡

  • In ¡all ¡the ¡previous ¡examples ¡we ¡did ¡not ¡

consider ¡arributes ¡in ¡composite ¡events ¡

  • We ¡only ¡computed ¡their ¡occurrence ¡probability ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 42 ¡

slide-43
SLIDE 43

Produc:on ¡

  • CEP2U ¡also ¡computes ¡the ¡values ¡

(distribu:ons) ¡of ¡the ¡arributes ¡in ¡the ¡ composite ¡events ¡

  • Similar ¡to ¡computa:on ¡of ¡aggregates ¡
  • Same ¡assump:ons ¡/ ¡limita:ons ¡involved ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 43 ¡

slide-44
SLIDE 44

Hierarchies ¡of ¡Events ¡

  • Rules ¡can ¡involve ¡composite ¡events ¡in ¡the ¡parern ¡
  • Used ¡to ¡build ¡different ¡layers ¡of ¡abstrac:ons ¡
  • Allowed ¡in ¡many ¡exis:ng ¡CEP ¡systems ¡
  • Difficult ¡to ¡deal ¡with ¡in ¡presence ¡of ¡uncertainty ¡
  • Requires ¡to ¡track ¡the ¡history ¡of ¡constraints ¡evalua:on ¡
  • To ¡avoid ¡using ¡them ¡mul:ple ¡:mes ¡
  • Probability ¡of ¡composite ¡events ¡can ¡easily ¡drop ¡while ¡

moving ¡up ¡in ¡the ¡hierarchy ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 44 ¡

slide-45
SLIDE 45

Hierarchies ¡of ¡Events ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 45 ¡

Temp ¡> ¡27 ¡ No ¡Rain ¡ Dry! ¡ Dry ¡for ¡3 ¡days ¡ Temp ¡> ¡30 ¡ Alert! ¡

slide-46
SLIDE 46

Hierarchies ¡of ¡Events ¡

  • The ¡CEP2U ¡solu:on ¡
  • Forget ¡about ¡the ¡past ¡
  • All ¡input ¡events ¡have ¡probability ¡of ¡occurrence ¡1 ¡
  • Including ¡composite ¡events ¡used ¡to ¡build ¡hierarchies ¡
  • Op:onal ¡threshold ¡
  • To ¡limit ¡propaga:on ¡of ¡undesired ¡events ¡
  • Only ¡events ¡having ¡a ¡probability ¡that ¡overcome ¡the ¡

threshold ¡are ¡generated ¡

– Not ¡delivered ¡to ¡sinks ¡ – Not ¡re-­‑evaluated ¡inside ¡the ¡CEP ¡engine ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 46 ¡

slide-47
SLIDE 47

UNCERTAINTY ¡IN ¡RULES ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 47 ¡

slide-48
SLIDE 48

Bayesian ¡Networks ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 48 ¡

  • Direct ¡Acyclic ¡Graph ¡(DAG) ¡to ¡represent ¡
  • Random ¡variables ¡
  • Condi:onal ¡dependencies ¡between ¡them ¡
slide-49
SLIDE 49

Bayesian ¡Networks ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 49 ¡

slide-50
SLIDE 50

Bayesian ¡Networks ¡

  • The ¡tables ¡represent ¡“a-­‑

priori” ¡probability ¡

  • If ¡we ¡observe ¡(put ¡

evidence ¡on) ¡a ¡value ¡for ¡

  • ne ¡variable ¡… ¡
  • … ¡We ¡can ¡deduce ¡the ¡“a-­‑

posteriori” ¡probability ¡for ¡ the ¡others ¡

  • Which ¡is ¡the ¡probability ¡

that ¡the ¡Solar ¡Panel ¡is ¡ON ¡ if ¡we ¡observe ¡that ¡Hot ¡ Water ¡is ¡ON? ¡

50 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡

slide-51
SLIDE 51

Uncertainty ¡in ¡Rules ¡

  • CEP2U ¡automa:cally ¡builds ¡a ¡Bayesian ¡Network ¡

from ¡each ¡rule ¡

  • At ¡deployment ¡:me ¡
  • The ¡Bayesian ¡Network ¡is ¡extremely ¡simple ¡
  • Easy ¡to ¡understand ¡and ¡manage ¡
  • Forgets ¡about ¡all ¡arributes ¡
  • They ¡are ¡modeled ¡as ¡part ¡of ¡the ¡uncertainty ¡in ¡events ¡
  • Previous ¡work ¡arempted ¡to ¡use ¡only ¡Bayesian ¡

Network ¡

  • Tables ¡explode ¡
  • Modeling ¡becomes ¡extremely ¡complex ¡
  • Evalua:on ¡becomes ¡expensive ¡

– Performance ¡drops ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 51 ¡

slide-52
SLIDE 52

Uncertainty ¡in ¡Rules ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 52 ¡

slide-53
SLIDE 53

Uncertainty ¡in ¡Rules ¡

  • Consider ¡the ¡probability ¡of ¡occurrence ¡of ¡the ¡

composite ¡event ¡by ¡looking ¡only ¡at ¡ imprecision ¡/ ¡errors ¡in ¡the ¡rule ¡

  • Such ¡probability ¡can ¡be ¡computed ¡at ¡design ¡

:me ¡

  • No ¡overhead ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 53 ¡

slide-54
SLIDE 54

Uncertainty ¡in ¡Rules ¡

  • With ¡the ¡default ¡Bayesian ¡Network ¡produced ¡

by ¡CEP2U, ¡this ¡probability ¡is ¡1 ¡

  • Users ¡asked ¡to ¡enrich ¡it ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 54 ¡

slide-55
SLIDE 55

Uncertainty ¡in ¡Rules ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 55 ¡

slide-56
SLIDE 56

Uncertainty ¡in ¡Rules ¡

  • Uncertainty ¡in ¡rules ¡independent ¡from ¡

uncertainty ¡in ¡events ¡

  • Both ¡contribute ¡to ¡the ¡probability ¡of ¡occurrence ¡
  • f ¡the ¡composite ¡event ¡
  • Overall ¡probability ¡is ¡computed ¡by ¡mul:plying ¡
  • The ¡occurrence ¡probability ¡given ¡the ¡uncertainty ¡of ¡

events ¡

  • Computed ¡at ¡run-­‑:me ¡based ¡on ¡the ¡received ¡events ¡
  • The ¡occurrence ¡probability ¡given ¡the ¡uncertainty ¡in ¡

the ¡rule ¡

  • Pre-­‑computed ¡when ¡the ¡rule ¡is ¡deployed ¡or ¡when ¡the ¡

corresponding ¡Bayesian ¡Network ¡is ¡modified ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 56 ¡

slide-57
SLIDE 57

IMPLEMENTATION ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 57 ¡

slide-58
SLIDE 58

CEP2U ¡in ¡T-­‑Rex ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 58 ¡

slide-59
SLIDE 59

EVALUATION ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 59 ¡

slide-60
SLIDE 60

Selec:on ¡

0.2 0.4 0.6 0.8 1 20 40 60 80 100 Processing Time (ms) Number of uncertain attributes (%) Average 99th Percentile

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 60 ¡

slide-61
SLIDE 61

Combina:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 61 ¡

slide-62
SLIDE 62

Combina:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 62 ¡

slide-63
SLIDE 63

Nega:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 63 ¡

slide-64
SLIDE 64

Nega:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 64 ¡

slide-65
SLIDE 65

Aggrega:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 65 ¡

slide-66
SLIDE 66

Aggrega:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 66 ¡

slide-67
SLIDE 67

Bayesian ¡Network ¡Evalua:on ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 67 ¡

slide-68
SLIDE 68

Conclusion ¡

  • Novel ¡model ¡
  • Separa:on ¡of ¡sources ¡
  • Different ¡models ¡
  • Lightweight ¡evalua:on ¡
  • Open ¡problems ¡
  • Generic ¡combina:on ¡of ¡random ¡variables ¡
  • Assump:on ¡of ¡independence ¡
  • Hierarchies ¡of ¡events ¡

Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Uncertainty ¡in ¡CEP: ¡Model ¡and ¡Implementa:on ¡ 68 ¡