1 / 33

About the Use of Correlations in Component Based Frameworks

About the Use of Correlations in Component Based Frameworks. Georg Jung jung@cis.ksu.edu Department of Computing and Information Sciences Kansas State University. Why Using Correlators?. Consider the following situation:. Component C is receiving from two components A and B

jana
Download Presentation

About the Use of Correlations in Component Based Frameworks

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. About the Use of Correlations in Component Based Frameworks Georg Jung jung@cis.ksu.edu Department of Computing and Information Sciences Kansas State University

  2. Why Using Correlators? Consider the following situation: • Component C is receiving from two components A and B • A and B send at different rates • C needs both inputs to become active A a C ab b B

  3. Why Using Correlators! If we add correlations to the infrastructure Consider the following situation: We can: • Reduce network traffic • Simplify computation inside the component • Clarify the design • Define the components in a more general way A a a + b C ab b B

  4. Hello World! A C B Scenario: Example scenario from introduction slides: • Three Components A, B, and C • Component C receives • A and B send at different rates

  5. Hello World! Head Filter Transformer φCcorrelation HelloWorld (φAa, φBb) a + b { case true: push new φC { x := a.data, y := b.data } }

  6. The Two-Phase Model Filter Stream of incoming events Transformer e1 e3 e1 e2 e2 Conceptually, the correlator divides into two distinct phases: • The Filter • The Transformer Reacting to a detected pattern • Information about: • which events arrived • what data is present Filter Transformer Generates new output events eout eout Detection of event patterns And performs internal actions • Information about: • which events arrived • what data is present

  7. Back to “Hello World!” φCcorrelation HelloWorld (φAa, φBb) a + b { case true: push new φC { x := a.data, y := b.data } } In this simple example the transformer does a type conversion!

  8. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  9. Race Condition Scenario: Components A and B carry out a task and deliver the results to C. Component C expects the results to come in first from A, then from B. The resulting race condition between A and C can be caught with a correlator.

  10. Race Condition Solution: φdatacorrelation CatchRacing (φdata a, φdata b) a + b { case true: push a; push b; }

  11. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  12. Most Recent / Earliest Scenario: A component C receives from A and B. a + b when both events arrive, C wants the most recent (earliest) of both forwarded. We change the filter expression to: la:(a ; b) | lb:(b ; a)

  13. Most Recent / Earliest φDatacorrelation First (φData a; φDatab) la:(a; b) | lb:(b; a) { case la: push a; case lb: push b; }

  14. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  15. Double Match Consider the following filter expression: (a + b) | (a + c) And the following streams: matches: a + b a b a a c c … matches: a + c a c a b b a … matches: a + b and a + c c b b c a a …

  16. Double Match l1:(a + b) | l2:(a + c) Adding Labels to the expression (a + b) | (a + c)

  17. Double Match l1:(a + b) | l2:(a + c) Transformer 1: Send a general notification { case true: push new φnote{}; }

  18. Double Match l1:(a + b) | l2:(a + c) Transformer 2: Send two outputs { case l1: push b; case l2: push c; }

  19. Double Match l1:(a + b) | l2:(a + c) Transformer 3: Send one output, with priority on b if present. { case l1: push b; case l2 & !l1: push c; }

  20. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  21. Interleaving Event We consider three subexpressions x1, x2, x3. x2 shall not interleave between x1 and x3. x1 ; (l2:(x2 ; x3) | l3:x3) φcorrelation Interleaving (...) x1 ; (l2:(x2 ; x3) | l3:x3) { case l2: push some error event; case l3 & !l2: pushsome success event; }

  22. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  23. Redundant-Sensor-Array … + An A3 A2 A1 Consider an array of redundant components A1, A2,…, An. and a single receiving component B, interested in the accumulation of all events a1, a2,…, an. The filter expression is then a1 + a2 + … + an B

  24. Redundant-Sensor-Array … + An A3 A2 A1 a1 + a2 + … + an In a component system some components can be temporarily unavailable! If one component does not send anymore the whole pattern is never satisfied! B

  25. Redundant-Sensor-Array C … An A3 B A2 A1 Notify correlation SensorArray (Notify a1, …, Notify an, Control c1, …, Control cn) l1:a1 + … + ln:an || m1:c1 || … || mn:cn { case l1 & … & ln: push new Notify {} case m1: toggle l1 … case mn: toggle ln } Sensor Array

  26. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  27. Mode-Awareness Scenario: This scenario generalizes the previous. Instead of single devices to switch on or off, we have a several modes to chose from. The same mechanism is used to switch between modes as previously to switch the different devices on and off.

  28. Mode Awareness n filter expressions, labeled with n labels: m1:e1 || … || mn:en n labeled control events: l1:c1 || … || ln:cn

  29. Mode Awareness φoutcorrelation Modal3 (φc c1, φ c c2, φ c c3, arguments for ei…) m1: e1 || m2: e2 || m3: e3 || l1: c1 || l2: c2 || l3: c3 { abort (m2, m3); clauses for e1, e2, e3… case l1: revive (m1); abort (m2, m3); case l2: revive (m2); abort (m1, m3); case l3: revive (m3); abort (m1, m2); }

  30. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems

  31. Periodic Checks of Aperiodic Events Scenario: We introduce a periodic supervisor component into an aperiodic system. Whenever a clock-tick occurs, a sample is collected and sent to the supervisor.

  32. Periodic Checks of Aperiodic Events φsamplecorrelation PeriodicChck (φtimer t, φaa, φbb, φcc) t ; (l1:(a + b + c) | l2:t) { case l1: push new φsample{d1 := a.data, d2 := b.data, d3 := c.data } case l2: push some error event (missed sample); }

  33. Examples This presentation will include: • How to prevent a race condition • How to chose the most recent/earliest in a sequence • How to handle a double match • How to catch interleaving events • How to deal with redundant-device-components • How to introduce mode-dependent behavior • How to bridge the gap between periodic and aperiodic systems These are our examples. Feel free to add your own…

More Related