WS-ECA - AT&T Labs Research

Download Report

Transcript WS-ECA - AT&T Labs Research

WS-ECA: An ECA Rule Description Language
for Ubiquitous Services Computing
Jae-Yoon Jung
Seung-Kyun Han
Jonghun Park
Kang Chan Lee
ASRI
Seoul National
University, Korea
[email protected]
Digital Interactions Lab.
Seoul National
University, Korea
[email protected]
Digital Interactions Lab.
Seoul National
University, Korea
[email protected]
Protocol Eng. Center
ETRI, Korea
[email protected]
1
Contents
1. Introduction
2. WS-ECA Language
3. The Framework of WS-ECA
4. Example
5. Rule Conflict Detection
6. Conclusions
2/18
Introduction – Ubiquitous Computing Environments
Mobile
Automobile Service
SIM
SD
MMC
SD
MMC
Office
Infra
Info
How to coordinate ?
Personal
Info
Home
DVC
STB
IC Card
♪
Game
TV
E-Tower
Shop
Map Info
PC
Digital
Contents
Audio
SD
MMC
DVD
Telephone
Outdoor
Source: ETRI (Electronics and Telecommunications Research Institute), 2006
3/18
Introduction – Ubiquitous Computing Environments
Ubiquitous Web Services
Any Devices
Any Network
Any Service
Source: ETRI (Electronics and Telecommunications Research Institute), 2006
4/18
Introduction – limitations
Focus on device ONLY
We need to…
• Make the devices
web-services enabled
Define their own protocol &
device description standard
• Use open standards
• Provide event
chaining mechanism
No support coordination
5/18
Introduction – Requirements of New Language
Conditional response & event filtering
2
Event forwarding/broadcasting/multicasting
Temporal reaction
Logical expression of events and actions
Adopt
Event-Condition-Action
Mechanism
3
4
Transitive rule
6/18
1
5
WS-ECA Language – ECA Overview

General structure of ECA Rule
on event

if condition
do action
Examples of ECA Rules
– (conditional response)
 on e1 if c1 do a1
 on e1 if c2 do a2
– (transitive property) on e1 if c1 do{on e2 if c2 do a2}
 Rule 1: on e1 if c1 do a1 (e1’)
cf. action a1 generate internal event e1’
 Rule 2: on e1’^e2 if c2 do a2
– (logical operation)
 Event
on (e1^e2) | e3 if c1 do a1
 Condition
on e1 if c1|(c2^~c3) do a1
 Action
on e1 if c1 do a1|(a2^a3)
7/18
WS-ECA Language – WS-ECA

WS-ECA Rules
Variables
Device variables
Event variables
ECA Rule
Event
Condition
WS-ECA Rules
– Variables
– Event
Events
Time events
Service events
External events
Internal events
primitive & composite
events
– Condition
– Action
 primitive & composite
actions

Action
Actions
Generate intEvent
Generate extEvent
Invoke Service
8/18
WS-ECA Language – Event

Event
– triggers a rule
Event
Primitive
internal
external
Time
absolute
periodic
relative
service
before
<compositeEvent type=“OR” name=“xs:NCName”>
event+ </compositeEvent>
<compositeEvent type=“AND” name=“xs:NCName”
TTL=“xs:duration”> event+ </event>
<compositeEvent type=“SEQ” name=“xs:NCName”
TTL=“xs:duration”> event+ </event>
<compositeEvent type=“NOT” name=“xs:NCName”>
event </compositeEvent>
</events>
after
Composite
<events>
<timeEvent type=“once” name=“xs:NCName”>
xs:dateTime </timeEvent>
<timeEvent type=“periodic” name=“xs:NCName”
unit=“xs:duration” issued=“xs:dateTime”?
expired=“xs:dateTime”?>xs:dateTime </timeEvent>
<timeEvent type=“relative” name=“xs:NCName”
baseEvent=“xs:NCName” interval=“xs:duration”/>
<intEvent name=“xs:NCName”/>
<extEvent name=“xs:NCName” eventID=“xs:anyURI”/>
<svcEvent type=“before” name=“xs:NCName”
service=“xs:QName”/>
<svcEvent type=“after” name=“xs:NCName”
service=“xs:QName”/>
disjunction
conjunction
sequential
negation
9/18
WS-ECA Language – Condition

Condition
<condition
expression="/alarm/today/@holiday='no'"/>
– boolean statement
– XPath expression

Variables
Variable
– specific elements of an
device variable
event variable
event
– state of device

Extension functions
– getVariable
– getDateTime
Functions
Return type
Return value
eca:getVariable(event
QName, path PathExpr)
xs:any
Specific values from
event variables
eca:getDateTime(event
Qname)
xs:dateTime
Date and time
information of the
system
10/18
WS-ECA Language – Action

Actions
– instructions executed when
a triggered rule is activated
Action
Primitive
invokeService
createExtEvent
createIntEvent
Composite
disjunction
conjunction
11/18
<actions>
<invokeService name=“xs:NCName”
service=“QName”>
xs:any </invokeService>
<createIntEvent name=“xs:NCName”
intEvent=“xs:NCName”>
xs:any </createIntEvent>
<createExtEvent name=“xs:NCName”
extEvent=“xs:anyURI”>
xs:any </createExtEvent>
<compositeAction name=“xs:NCName”
operator=“AND” transaction=“xs:anyURI”>
action+ </compositeAction>
<compositeAction name=“xs:NCName”
operator=“OR” sequence=“xs:boolean”>
action+ </compositeAction>
</actions>
The Framework of WS-ECA
Event sources
WS-ECA Rules
Variables
Device variables
Event variables
ECA Rule
Event
Condition
Device
WS-Eventing
WS-ECARules
Rules
WS-ECA
WS-ECA
Rules
Events
Time events
Service events
External events
Internal events
Services
Service
invocation
Action
Device
Actions
WS-Eventing
Generate intEvent
Generate extEvent
Invoke Service


WS-ECARules
Rules
WS-ECA
WS-ECA
Rules
Services
Service invocation

Web service
providers
WS-Eventing & SOAP
Use XML-Family standards
Web services in devices
12/18
Example – “morning cook service”

Alarm Clock
–

Rice Cooker
–
–




Event: State of the cooker (‘out-of-rice’ and ‘cook_completion’)
Service: cook
Coffee Maker
–

Event: ‘get-up time’ event, ‘n minutes before get-up time’ event
Service: make coffee
A user set the get-up time to 7:00 AM on the alarm clock before
sleeping.
The clock informs the rice cooker of ’20 minutes before get-up’.
The cooker starts to cook, and if rice is not enough, it alerts to
the user at his/her get-up time.
When the cook is completed, the cooker informs the coffee
maker, and the coffee maker will start to prepare a morning
coffee after 10 minutes.
13/18
Example – “morning cook service”
svcEvent(before cook())
if rice is not enough
get-up time=7:00AM
cook()
intEvent(out_of_rice)
extEvent(20min before ‘get-up’)
svcEvent(after cook())
extEvent(‘getting-up’)
if cooking is completed
extEvent(get-up)
alert()
extEvent(cook_completion)
after intEvent(out_of_rice)
alarm.xml
…
<rules>
<rule name="alarm-before-get-up-rule">
<event name="before-get-up-time"/>
<condition expression="/alarm/today/@holiday='no'"/>
<action name="pre-alarm"/>
</rule>
<rule name="alarm-on-get-up-rule">
<event name="get-up-time"/>
<condition expression="/alarm/today/@holiday='no'"/>
<action name="get-up-alarm"/>
</rule>
</rules>
…
14/18
timeEvent
(10min after cook_completion & getting-up)
invokeService(makeCoffee())
Rule Conflict Detection

ECA Rules in Ubiquitous Service Devices
– WS-ECA rules can be defined by multiple users and
registered to distributed devices.
– Some rules may have discrepancies with each other and
they may cause conflicts.

Service Constraints
– a set of service invocation actions that are not allowed to
occur at the same time.
e.g. 1) radio.turnUp() & radio.turnDown()
e.g. 2) heater.trunOn() & air conditioner.turnOn()

Global Rule Manager (GRM)
– analyzing the defined rules for devices at build-time
– resolving any rule conflicts at run-time
15/18
Rule Conflict Detection

Static Conflict
– triggering rules cause a conflict
– detect & resolve at build-time
e.g.)
rule 1: on e1 if c1 do radio.turnOn();
rule2: on e1 if c1 do radio.turnOff();

Dynamic Conflict
– triggering rules MAY cause a
conflict
– detect & resolve at run-time
e.g.)
rule 1: on e1∧e2 if c1 do radio.turnOn();
rule 2: on e1∧e3 if c1 do radio.turnDown();
16/18
Flowchart of rule generation and execution
Conclusions

ECA Rules in Ubiquitous Service Computing
– WS-ECA: Rule description Language

Advantages of WS-ECA in Ubiquitous Computing
– Active functionality of service devices
– Stateless and light interaction
– Decentralized rule processing based on ECA rules

Future Work
– Develop conflict detection and resolution algorithm
– Make language standard
17/18
Jae-Yoon Jung
Seung-Kyun Han
Jonghun Park
Kang Chan Lee
ASRI
Seoul National
University, Korea
[email protected]
Digital Interactions Lab.
Seoul National
University, Korea
[email protected]
Digital Interactions Lab.
Seoul National
University, Korea
[email protected]
Protocol Eng. Center
ETRI, Korea
[email protected]
18