Ontology-Directed Generation of Framework for Pervasive Service

PerWare 2007. 8. Abstract description of services. Semantic properties. • Multimedia capacities, priority, location… COMMAND. • onoff. • zoom. • getTemperature.
706KB taille 1 téléchargements 271 vues
Ontology-Directed ! Generation of Framework for ! Pervasive Service Development C. Consel, W. Jouve, J. Lancia, and N. Palix Phoenix Group INRIA / LaBRI PerWare’07

Issues •  Middleware Crisis –  Various domains •  Medecine, military, home automation, surveillance

–  Partial redesign required for new application domains –  Too generic

•  Various hardware devices –  Physical properties –  Exchanged data –  Interaction modes

2

•  Highly dynamic –  Variable context –  Deployments of new services PerWare 2007

Our Goals •  A retargetable middleware –  Adapted to distributed heterogeneous environments –  Easy addition of new services

•  A programming framework –  Robust –  Support for service development •  Driver development •  Application development

PerWare 2007

3

Application Example •  Domain: Surveillance •  Application: Hall Motion Detection Manager •  Problems –  Domain definition –  Driver development –  Application development

4

PerWare 2007

Our Approach

5

PerWare 2007

Abstracting environments

A hierarchy of Abstract Services

Service

Device

Manager

Data Center

7

Actuator

Webcam

Contact

Light

PerWare 2007

Agenda

Motion Detection Manager

Abstract description of services EVENT

COMMAND •  onoff •  zoom •  getTemperature •  …

•  EventInput •  EventOutput

8

SESSION •  SessionInput •  SessionOutput •  SessionProxy Semantic properties •  Multimedia capacities, priority, location… PerWare 2007

An Ontology of Abstract Services

Service

Device

P: location I: Command{getAutonomy}

P: uri I: Command{shutdown}

Manager

Data Center

P: priority

9

Actuator

Light

I: Command{do}

Webcam

P: frame rate, video mode I: SessionInput{Video}

Contact

Agenda

I: Command{lookup} I: EventOutput{Activity}

P: color I: Command{on, off}

PerWare 2007

Motion Detection Manager

I: EventInput{Motion} I: SessionProxy{Video}

The Motion Detecting Webcam

Service

I: Command{shutdown}

Device

P: location I: Command{getAutonomy}

Webcam

P: frame rate, video mode I: SessionInput{Video}

Zooming Webcam

Motion Detecting Webcam

P: zoom type I: Command{zoom}

I: EventOutput{Motion}

PerWare 2007

10

Ontology-directed framework generation

11

PerWare 2007

Ontology-directed Service Development

Developing Services •  Service management support –  Service creation, –  Generated method stubs, –  Already implemented methods.

•  Service discovery support –  Automatic service registration, –  Browsing in the pervasive environment. •  Partitions

•  Service invocation support –  Ensuring valid method invocations, –  Hiding the communication mode: •  RMI, SIP…

PerWare 2007

13

Driver Development: Skeleton generated by Eclipse 1. 

public class MyWebcam extends MotionDetectingWebcam {

2.  3.  4.  5. 

public MyWebcam(String uri) { super(uri); // TODO Auto-generated constructor stub }

6.  7.  8.  9. 

public VideoSession connect(IVideoSessionOutput service) { // TODO Auto-generated method stub return null; }

10.  11.  12. 

public void disconnect(VideoSession activeSession) { // TODO Auto-generated method stub }

13.  14.  15.  16.  17.  18.  19.  20.  21.  22.  23.  24.  25. 

public void zoom(Region region) { // TODO Auto-generated method stub }

Service

I: Command{shutdown}

Device

P: location I: Command{getAutonomy} 14

Webcam

public Autonomy getAutonomy() { // TODO Auto-generated method stub return null; }

Zooming Webcam

Motion Detecting Webcam

public void shutdown() { // TODO Auto-generated method stub } }

PerWare 2007

P: frame rate, video mode I: SessionInput{Video} P: zoom type I: Command{zoom}

I: EventOutput{Motion}

Driver Development: Constructor 1.  public MyWebcam(String uri) { 2.  super(uri); 3.  // from the Device service 4.  location.setValue(myLocation); 5.  // from the Webcam service 6.  videomode.addValue(new VideoMode(VideoCodec.MJPEG, Resolution.4CIF)); 7.  videomode.addValue(new VideoMode(VideoCodec.MPEG4, Resolution.2CIF)); 8.  framerate.setValue(25); 9.  [...] 10.  }

PerWare 2007

15

Application development 1. 

public class HallMotionDetectionManager extends MotionDetectionManager {

2.  3.  4.  5. 

private MotionDetectingWebcam myWebcam; [...] public HallMotionDetectionManager(String uri) { super(uri);

6.  7.  8.  9.  10.  11.  12.  13.  14.  15.  16.  17. 

MotionDetectingWebcamPart part = MotionDetectingWebcam.getPartition(); part.location.setValue(hall); myWebcam = MotionDetectingWebcam.getService(part); myWebcam.subscribe(this); } public void receive(MotionEvent event) { Region region = event.getValue().getRegion(); Display myDisplay; [myDisplay definition] myWebcam.zoom(region);

18.  VideoSession webcamSession = myWebcam.connect(this); 19.  VideoSession displaySession = myDisplay.connect(this); 20.  bridge = bind(webcamSession, displaySession); 21.  [...] 22.  } 23.  [...] 24.  } PerWare 2007

16

Questions?

17

PerWare 2007