entity-based state management for complex event processing … · 2011-08-16 · • complex state...

29
Entity-Based State Management for Complex Event Processing Applications Hannes Obweger UC4 Senactive RuleML 2011 @ Europe

Upload: others

Post on 22-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Entity-Based State Management for Complex Event Processing Applications

Hannes ObwegerUC4 Senactive

RuleML 2011 @ Europe

Page 2: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Sense-and-Respond Infrastructure

24.07.2011 2

Page 3: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

… works well for detecting situations of a defined length and structure… faces difficulties when the state of an entity shall be derived from

a stream of low-level, incremental updates

CEP using Event Condition Action (ECA) Rules

24.07.2011 3

> 4h

Presenter
Presentation Notes
Despite they all have the same basic structure – if pattern, then action – there user groups
Page 4: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Durable entity state– vs. sliding time windows– Specific data management for non-volatile data– Ex-post analysis

• Complex state calculation logic– Goal: Keep rules thin and understandable

• Active entity monitoring– vs. pull-based approach

• Context-aware data access– Integegration with contexts, correlation sets, …

• Ease of use– Accessible to business users

Challenges

24.07.2011 4

Page 5: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Encapsulate state calculation logic• Manage data as system-wide data structures• Plugged into application• Expose easy-to-use interfaces• Updated and queried using ECA rules

Business Entity Providers

24.07.2011 5

Page 6: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Business Entity Providers

24.07.2011 6

→ Exploit CEP also in entity-centric environments→ Simplify rule logic→ Separation of concerns

• Low-level processing logic, high-level business logic→ Full integration with rule model

Page 7: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion

Outline

24.07.2011 7

Page 8: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Provider per „kind“ of entity– E.g., queues (de facto: sets)

• Generic framework: You may implement a provider in whichever way is appropriate for your purposes– E.g., RDBMS + SQL statements, Hadoop/Cassandra,

Business Rule Engine, …

• BUT: Must adhere to a basic structure

Business Entity Provider Model

24.07.2011 8

Page 9: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Business Entity Type– E.g., Task queue– Key properties (→ composite key)

• Business Entity– E.g., Task queue #42– Unique, immutable key tuple

• Update and query interfaces– Query properties, update functions

Business Entity Provider Model

24.07.2011 9

Business Entity Provider

Key Property

Business Entity Type1

*

Appl

icat

ion-

Spec

ific

Conf

igur

atio

n

Business Entity

1

* conforms to

Update Function

Query Interface

Query Property*

is derived from

1

11

Update Interface

*

accesses

Appl

icat

ion-

Spec

ific

Even

t Pro

cess

ing

Logi

c

Page 10: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion

Outline

24.07.2011 10

Page 11: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Base Entity– Key → Set of typed entity properties– E.g., Customer– Update / Query: 'setter' and 'getter' for all entity properties

• Scores– Key → Numeric score value– E.g., Alarms per server– Update: set, increment, decrement– Query: current value, aggregates

• Sets– Key → Collection of set elements– E.g., FIFO queue, priority queue, stack– Update: insert, remove– Query: Current set of elements → calculations

Exemplary Business Entity Providers

24.07.2011 11

Page 12: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion

Outline

24.07.2011 12

Page 13: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Separation:

Rule Model: Basics

24.07.2011 13

Event Correlation

Group events that are generally related to each other; e.g., all events of

a transport process

Pattern Detection

From the resulting situations, pick those that are noteworthy;

e.g., all transports longer than 4h

and

Page 14: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Rule Model Basics: Correlation Model

24.07.2011 14

Page 15: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Rule Model Basics: Decision Graph Model

24.07.2011 15

• Event Conditions• Response-Event

Actions• Associated with a

Correlation Set

Page 16: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion

Outline

24.07.2011 16

Page 17: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Generalization: Let users define relations between events, events and business entities, and different kinds of entities

• Events: Correlated based on event attributes• Business Entities: Correlated based on key properties

Rule Model Extensions: Correlation Model

24.07.2011 17

Page 18: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Whenever activated: Update correlated business entities

Rule Model Extensions: Business Entity Action

24.07.2011 18

• Business entity provider• Business entity type• Key property expressions• Update function (e.g., increment)• Function parameter expressions (e.g., 1)

Page 19: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Rule Model Extensions: Business Entity Action

24.07.2011 19

Page 20: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Evaluate a query on all correlated business entitiesa. whenever activated (on-demand access)b. whenever an update occurs (continuous access)

Rule Model Extensions: Business Entity Condition

24.07.2011 20

• Provider, type, key property expressions• Boolean condition (e.g., Value > 100)• Binary connective (all, at least one, exactly one)• Execution mode (on demand vs. continuous)

Page 21: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Rule Model Extensions: Business Entity Condition

24.07.2011 21

Page 22: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Rule Model Extensions: Business Entity Condition

24.07.2011 22

Page 23: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion

Outline

24.07.2011 23

Page 24: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Implementation: Basics

24.07.2011 24

• Provided as .NET assemblies• Referenced in an XML file• On start up: Parsed by SARI, instantiations

Business Entity ProviderImplementations

SARI

Page 25: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Implementation: On Demand Access

24.07.2011 25

• Added to globally accessible provider management service• Called directly and synchronously from rule services

Page 26: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Implementation: Continuous Access

24.07.2011 26

On start up: Register as listener at provider management1. Update occurs2. Special notification event is sent to all registered services3. Use basic correlation mechanism to active decision graph4. Evaluate key property expressions5. Evaluate query as with on-demand access

Page 27: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion

Outline

24.07.2011 27

Page 28: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

• Novel approach to state management for ECA-based CEP• Business Entity Providers

– Encapsulate custom state-calculation logic– Plugin-based implementation model– Fully integrate with SARI rule model

• Durability entity state, comple state calculation • Active entity monitoring • Context-aware data access • Ease of use

Conclusion

24.07.2011 28

Page 29: Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state calculation logic – Goal: Keep rules thin and understandable • Active entity

Thanks for your attention!

24.07.2011 29