About the use of correlations in component based frameworks
Advertisement
This presentation is the property of its rightful owner.
1 / 33

About the Use of Correlations in Component Based Frameworks PowerPoint PPT Presentation

About the Use of Correlations in Component Based Frameworks. Georg Jung [email protected] 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

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.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


About the use of correlations in component based frameworks

About the Use of Correlations in Component Based Frameworks

Georg Jung

[email protected]

Department of Computing and Information Sciences

Kansas State University


Why using correlators

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


Why using correlators1

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


Hello world

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


Hello world1

Hello World!

Head

Filter

Transformer

φCcorrelation HelloWorld

(φAa, φBb)

a + b

{

case true:

push new φC { x := a.data,

y := b.data }

}


The two phase model

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


Back to hello world

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!


Examples

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


Race condition

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.


Race condition1

Race Condition

Solution:

φdatacorrelation CatchRacing (φdata a, φdata b)

a + b

{

case true:

push a;

push b;

}


Examples1

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


Most recent earliest

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)


Most recent earliest1

Most Recent / Earliest

φDatacorrelation First

(φData a; φDatab)

la:(a; b) | lb:(b; a)

{

case la: push a;

case lb: push b;

}


Examples2

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


Double match

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 …


Double match1

Double Match

l1:(a + b) | l2:(a + c)

Adding Labels to the expression

(a + b) | (a + c)


Double match2

Double Match

l1:(a + b) | l2:(a + c)

Transformer 1: Send a general notification

{

case true: push new φnote{};

}


Double match3

Double Match

l1:(a + b) | l2:(a + c)

Transformer 2: Send two outputs

{

case l1: push b;

case l2: push c;

}


Double match4

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;

}


Examples3

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


Interleaving event

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;

}


Examples4

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


Redundant sensor array

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


Redundant sensor array1

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


Redundant sensor array2

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


Examples5

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


Mode awareness

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.


Mode awareness1

Mode Awareness

n filter expressions, labeled with n labels:

m1:e1 || … || mn:en

n labeled control events:

l1:c1 || … || ln:cn


Mode awareness2

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);

}


Examples6

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


Periodic checks of aperiodic events

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.


Periodic checks of aperiodic events1

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);

}


Examples7

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…


  • Login