• 沒有找到結果。

Event and Action Procedure Descriptor

Chapter 4 Descriptors

4.6 Event and Action Procedure Descriptor

What is procedure? For end users, they order Service, however, the communications between Appliances are through the system core-union -Service Engine, therefore all the entities outside core-union they use service-view and inside the core-union use procedures to describe Service and control Service acting.

Procedure s are Hieratical and the condition judgment in procedure should be time sensitive. Some services may ask events to happen in order or some services do not care about the happening sequence. This kind property should be show in the service procedure.

Procedure is just a form, and the Service will fill it. A procedure consists of event and action part. To enhance the reusability and flexibility, I decide to manage and store event and action parts separately.

By observation my daily life, I simplified what the actions a normal people would do to their home devices into the set in upper one; then I switch the on/off into up/down, higher/lower… or some specific functions like recording and deleting…then we get several similar procedures sets in the lower one:

1. Turn A’s function A1’s Parameter AP1 up 2. Turn A’s function A1’s Parameter AP1 down

3. Turn A’s function A1’s Parameter AP1 up, then turn off B’s function B1’s Parameter BP1 down

4. Turn A’s function A1’s Parameter AP1 up, then turn off B’s function B1’s Parameter BP1 up

5. Turn A’s function A1’s Parameter AP1 down, then turn off B’s function B1’s Parameter BP1 down

6. Turn A’s function A1’s Parameter AP1 down, then turn off B’s function B1’s Parameter BP1 up

7. It’s the time, then …(1~6)

Figure 4-6 A draft of device’s event/action procedure Here I show how the basic procedure 4 looks like:

<event>

<if type="and"> <timesing waitingTime="30">0</timesing>

//the unit is second and 30 secs is the basic time zone <var>

<targetID>A</targetID>

<varName>Power</varName>

<acceptList >

<acceptValue type="Solic">true</acceptValue>

</acceptList>

</var>

</if>

</event>

Figure 4-7 An example of the event procedure descriptor

</eventRule>

</event>

</if>

</var>

</acceptList>

<acceptValue type="Solic">off</acceptValue>

<acceptList >

<acceptValue type="Solic">true</acceptValue>

<acceptList >

<acceptValue type="Solic">fail</acceptValue>

<acceptList >

<varName>Power</varName>

<targetID>A</targetID>

<waitingTime>10</waitingTime>//the unit is second <var>

<timesing>1</timesing>

<if type="and">

<event> //a rule has one event

<ruleCapture>IF some device off on off</ruleCapture>

<rulegroupID>rg0001</rulegroupID>

<eventRule ID="er00010" NAME="IF_4">

Figure 4-8 An example of the event procedure descriptor for Sweet Dream service

</actionRule>

</action>

</reaction>

<argumentValue>true</argumentValue>

<argumentName>Lock</argumentName>

<actionName>Lock</actionName>

<BasicServiceName>Lock</BasicServiceName>

<commandTarget>A</commandTarget>

<argumentValue>fall</argumentValue>

<argumentName>setPower</argumentName>

<actionName>Power</actionName>

<BasicServiceName>Power</BasicServiceName>

<commandTarget>A</commandTarget>

Figure 4-9 An example of the action procedure descriptor for Sweet Dream service This is a simple procedure has one event message and one action command.

Each <var> is a query to a single device’s single and I use <and> to capsulate the single event, and if the service needs more than one event message, <and> can capsulate these events. Surly, <or> can work for its situation too.

When there are multi event message, here comes a new problem—the timing control. Event messages are sent by devices and cause by human operating and the

different sequences may mean different intentions. For example, turn down the light in toilet then open one in the hallway, can indicate a move from toilet to hallway; a reverse sequence can not cause by the same move. On the other hand, the order can mean nothing but the time slot may do. Quick open and shut down the same light can be a signal of starting some services, same behavior but happened in 5 minutes may just means you leaved and came back to the same place.

Table 4-1 The time control tag description of event procedure Event

Tag Description

TIMESING= 0 The event does not care about the sequence and time range of event.

TIMESING= 1 The fallowing Query responses have to be accepted in order;

otherwise the action will not be triggered.

TIMESING= 2 This event repeats in a time range.

WAITINGTIME if TIMESING= 1 How long the service can wait the next event happened. The time unit is second.

if TIMESING= 2 The time range

TIMEORDER if TIMESING = 1 indicate the sequence of the event.

Table 4-2 The time control tag description of action procedure Tag Description

Action

TIMESING= 0 All the reactions occur at the same time and the order is not strict.

TIMESING= 1 Reactions perform in a particular sequence.

Chapter 5 Home Services and

相關文件