Академический Документы
Профессиональный Документы
Культура Документы
University of Luxembourg
Åmbiance Project
Autonomous Systems Group reza.razavi@uni.lu Laboratoire d’Informatique de Paris 6 – CNRS
University of Luxembourg
Université Pierre et Marie Curie
Jean-Francois Perrot
Kirill Mechitov, Sameer Sundresh and Gul Agha
Université Pierre et Marie Curie
University of Illinois at Urbana-Champaign
Open Systems Lab jean-francois.perrot@lip6.fr
University of Illinois at {mechitov, sundresh, agha}@cs.uiuc.edu
Urbana-Champaign
Response to Query
Requirements for uQuery Engines 2: Deer at (10,35)
moving NW at 5mph
• Targeted at end-users, not programmers Adapted from: [Boulis, 2005]
• Dynamic: deploy and change behavior at run-time
• Support concurrency inherent to ambient systems Connecting together a large number of small computers with
• Multiplicity of end-users sensing and actuating capabilities, to collectively and cost-
effectively solve problems, based on real-time data.
Application Example: Break Beam Detector
We want to detect an object passing through a break beam sensor, on Note the following issues with the code below.
request: • Static:
• Wait for a request message from the user • Specification and linking of components at compile time
• Perform the requested action • All components are compiled into a single image deployed on the sensor
• Execute detectBeamEvent() primitive • Low-level:
• Keep checking the sensor until a change in status is detected • Programmer is responsible for managing: timing, communication,
• Send the result of detection back to the user Mica2-Dot and Telos motes
memory management, error handling
http://research.sun.com/ • No separation of concerns:
The user (programmer) is responsible for choosing the right OS and • OS and network programming elements are inextricably linked with
network components, and assembling them along with the specific business logic programming elements
application logic into an executable program.
// Communication: receive requests for execution and send results
/* Detect break beam event application (code excerpt) */ void sendPacket(uint8_t *buf, uint8_t n)
configuration Example {} __attribute__((C,spontaneous)) {
implementation { memcpy(msgbuf.data, buf, n);
// list of application components msglen = n;
components Main, ExampleM, LedsC, GenericComm, TimerC, if (call SendMsg.send(TOS_BCAST_ADDR, msglen, &msgbuf)
Photo, CC1000ControlM; == SUCCESS)
// statically link all components sendPending = 1;
Main.StdControl -> GenericComm; }
Main.StdControl -> TimerC; uint8_t isSendPending() __attribute__((C,spontaneous)) {
Main.StdControl -> Photo; return sendPending;
Main.StdControl -> ExampleM; }
ExampleM.SendMsg -> GenericComm.SendMsg[10]; event result_t SendMsg.sendDone(TOS_MsgPtr mp, result_t success) {
ExampleM.ReceiveMsg -> GenericComm.ReceiveMsg[10]; if (!success) call Timer.start(TIMER_ONE_SHOT, 200);
ExampleM.CC1000Control -> CC1000ControlM; else {
ExampleM.Timer -> TimerC.Timer[unique("Timer")]; call Leds.redToggle(); sendPending = 0;
ExampleM.Leds -> LedsC; }
ExampleM.PADC-> Photo; return SUCCESS;
} }
event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr mp) {
module ExampleM { TOS_Msg m;
/* … */ call Leds.greenToggle();
} if ((uint8_t)mp->data[0] == 20) {
implementation { m.data = deref(detectShadow());
TOS_Msg msgbuf; sendPacket((uint8_t *)m.data, strlen(m.data));
uint8_t msglen, sendPending; }
volatile uint8_t ioPending; return mp;
uint16_t ioData; }
event result_t Timer.fired() {
/* … */ return call SendMsg.send(TOS_BCAST_ADDR, msglen, &msgbuf);
}
// primitive function #20: detect beam event (using photo sensor)
uint16_t detectBeamEvent(); /* … */
// I/O: convert split phase non-blocking I/O to blocking I/O // Implementation of detectBeamEvent primitive
uint16_t IO(uint16_t a, uint16_t b) __attribute__((C,spontaneous)) { uint16_t detectBeamEvent() {
while (ioPending) yield(); int i;
if (a == 20) { call PADC.getData(); ioPending=1; } uint16_t data, avg = 0;
while (ioPending) yield(); ledSet(0);
return ioData; for (i = 0; i < 10; i++)
} avg += IO(2, 0);
async event result_t PADC.dataReady(uint16_t data) { avg /= 10;
ioPending=0; ioData=data; while ((data = IO(2, 0)) > avg - 15) yield();
return SUCCESS; ledSet(7);
} return list(2, newWord(20), newWord(data));
}
}
Ambiance: Adaptive Object Model-based
Platform for Macroprogramming Sensor Networks
Meta-data corresponds to data that specifies the • Have not been applied to WSNs
Programs’:
OO Language Object meta-data repository
Adaptive • Lack of standard techniques for
Domain entity types service
• Object-model (Structure and Behavior) Rules • WSN dynamic code generation
Properties provision
• Windows, Menus, Configuration Panel, … Programmer Agent Associations • Supporting concurrency
Events
• Saved as configuration data • Supporting separation of high-level control
Write access from the execution
Expert Beam Event
Detector • Run-time optimization
Dynamically-composed
uQuery (ambient service)
Structure of queries 1
2
Behavior
0..* -dependents • Finite directed acyclic graph 3 13
Plot Histogram
1 1
* 1 0..1 -holds • Steps may hierarchically point to tasks
-content Main Task
-organization 0..*
Task Step • Reflective 4
1..1 * 1..1
0..* 0..* • Same set of concepts reused to extend the system 5
Vehicle
12
Histogram Entry
Structure
Procedure Do <T2> Create Histogram Entry Step
1 0..1
-holds 0..1 Conceptual Ontology 0..* -computation method
Grid List
0..1
Ontology Concept 1..1
-contributes Construct 0..*
Semantics of queries 6
T1: Compute Histogram Entry
-type
0..1 -instantiates • Parallel evaluation of contributions 9 10 11
Primitive
1..1
Control Structure
• Limited to their dependencies Pulse Pair 3 Mobile Object Vehicle
Concept
Average Pulse Pairs Estimate Motion Classify Vehicle
0..* 0..* Contract
Result Argument
-spec
ActorNet Primitive • Different execution semantics Construct
8 8
-requires 0..*
-policy 0..1
* 1
• Same set of concepts reused to extend the system Pulse Pair 1 Pulse Pair 2
-produces 0..1
Behavioral Ontology
Execution Strategy Association • Late Sort Edges Sort Edges
Generalization
Contributes
Signature Aggregation • value binding
1..1 1 *
7 7 7
Relation
• method binding Pulse 1 Pulse 2 Pulse 3
The Core Design of Dart: A Reusable and Extendible T2: Identify Vehicle
3 Output object
Registration + sleep