a restful architecture for integrating decomposable delayed services within the web of things

22
1/22 Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion A RESTful architecture for integrating decomposable delayed services within the Web of Things Andreas Ruppen, Jacques Pasquier, Tony Hürlimann {firstname.lastname}@unifr.ch University of Fribourg Department of Informatics Software Engineering Group December, 2011

Upload: andy-ruppen

Post on 22-Apr-2015

443 views

Category:

Technology


3 download

DESCRIPTION

My Presentation in the IoT workshop held at ICPADS 2011 in Tainan, Taiwan

TRANSCRIPT

Page 1: A RESTful architecture for integrating decomposable delayed services within the Web of Things

1/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

A RESTful architecture for integratingdecomposable delayed services within the

Web of Things

Andreas Ruppen, Jacques Pasquier, Tony Hürlimann{firstname.lastname}@unifr.ch

University of FribourgDepartment of Informatics

Software Engineering Group

December, 2011

Page 2: A RESTful architecture for integrating decomposable delayed services within the Web of Things

2/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

1 Introduction

2 Generic Architecture

3 RESTifying a Service

4 Validation

5 Conclusion

Page 3: A RESTful architecture for integrating decomposable delayed services within the Web of Things

3/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Web of ThingsOur Vision

Internet Of Thingssmart Thing

SunSPOT

Arduino

Page 4: A RESTful architecture for integrating decomposable delayed services within the Web of Things

4/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Web of ThingsOur Vision

Internet Of Thingssmart Thing

SunSPOT

Arduino

RESTful Services

REST

HTTP

HATEOAS

statelessnes

addressable

Page 5: A RESTful architecture for integrating decomposable delayed services within the Web of Things

5/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Web of ThingsOur Vision

Internet Of Thingssmart Thing

SunSPOT

Arduino

RESTful Services

REST

HTTP

HATEOAS

statelessnes

addressable

Web Of Things

Page 6: A RESTful architecture for integrating decomposable delayed services within the Web of Things

6/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Web of ThingsOur Vision

Internet Of Thingssmart Thing

SunSPOT

Arduino

RESTful Services

REST

HTTP

HATEOAS

statelessnes

addressable

Web Of Things

Services

Page 7: A RESTful architecture for integrating decomposable delayed services within the Web of Things

7/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Motivating ExampleThe parcel delivery center

A parcel delivery center deals each day with a big numberof parcels.Parcels are arriving during the day.Parcels received the day before are distributed tocustomers.The central has a fixed number of trucks.Over night an optimal route to deliver the parcels has to befound.This routing takes into consideration:

the number of available trucks andthe priority of each parcel.

Page 8: A RESTful architecture for integrating decomposable delayed services within the Web of Things

8/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Preliminary considerationsLessons learned from the motivating example

Resources that appear and disappear are very much in thespirit of the WoT.We want a RESTful solution.The service has no physical representation.The service is asynchronous.The solution decomposes itself in sub-solutions.

Page 9: A RESTful architecture for integrating decomposable delayed services within the Web of Things

9/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

WoT ServicesTaxonomy

Services can roughly be classified into four categories:Short-living services.Real-time services.Delayed services.Complex-delayed services.

Page 10: A RESTful architecture for integrating decomposable delayed services within the Web of Things

10/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Preliminary considerationsArchitectural starting point

The approach proposed by Richardson et al. for simpledelayed services is a good starting point.The only resources bound to the service are the tasks andthe task queue.As stated by Richardson these tasks are not a state whichis transferred to the server but a new resource available onthe server.The service is invoked by creating a new task or byconsulting an existing task.

Page 11: A RESTful architecture for integrating decomposable delayed services within the Web of Things

11/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

ArchitectureRelation between Tasks

A sub-task always relates to a parent-taks.A parent-task can have zero or more sub-tasks.This observation motivates the choice of the following URIscheme:

http://example.com/tasks/⇒ List of taskshttp://example.com/tasks/1/⇒ Details of task 1http://example.com/tasks/1/5⇒ Details of sub-task 5. . .

Page 12: A RESTful architecture for integrating decomposable delayed services within the Web of Things

12/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

ArchitectureThe Task Model

All such services have in common that the ongoing task isrepresented by a Task object. We can define a set of minimalproperties composing a Task:

A unique idA user idThe resultThe inputThe statusThe start- and end-timeA short log messagesA list of sub-tasks

Page 13: A RESTful architecture for integrating decomposable delayed services within the Web of Things

13/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

ArchitectureSemantics

According to the specification of RESTful services, standardCRUD methods are implemented. However in the case ofdecomposable delayed services, it is important to note that:

POST creates a new Task. The server should immediatelyrespond with a 202 Accepted.PUT is used to abort a task (and its eventually sub-tasks).DELETE has to make sure that first all sub-tasks areaborted and second that the delete is cascading.GET should allow to filter for most of the fields of a Task.

Page 14: A RESTful architecture for integrating decomposable delayed services within the Web of Things

14/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

RESTifying a Service

Services can bere-used.Even not RESTful ones.They can be restified.

Page 15: A RESTful architecture for integrating decomposable delayed services within the Web of Things

15/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

RESTifying a Services

Page 16: A RESTful architecture for integrating decomposable delayed services within the Web of Things

16/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Validating ExampleThe parcel delivery center

Given a big parcel delivery center which has to deliverparcel to its customers.Each parcel has an assigned priority representing anadditional constraint on the delivery time.All parcels received during the day, will be distributed thenext day respecting the priorities.Upon arriving at the parcel delivery center, each parcel isscanned and added to the distribution list.This is a well know problem in operations-research: TheVehicle Routing Problem with Time Window (VRP-TW)which consists of finding an optimal set of routesperformed by a fleet of vehicles respecting the deliverytime constraints.

Page 17: A RESTful architecture for integrating decomposable delayed services within the Web of Things

17/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Validating ExampleVehicle Routing Problem with Time Window (VRP-TW)

Definition (VRP-TW)Given n locations numbered from 1 to n, we want to delivergood to each customer in a given time-window using kvehicles, all starting at the central (location 1) and return to thecentral using the shortest distances possible.

The problem is solved in two steps:Partitioning all the customer 2 to n into k subgroups.Finding the shortest path with respect to the time-windowsfor each subgroup.

Page 18: A RESTful architecture for integrating decomposable delayed services within the Web of Things

18/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Validating ExampleVehicle Routing Problem with Time Window (VRP-TW) — Solution

Page 19: A RESTful architecture for integrating decomposable delayed services within the Web of Things

19/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Validating ExampleVehicle Routing Problem with Time Window (VRP-TW) — Solution

Page 20: A RESTful architecture for integrating decomposable delayed services within the Web of Things

20/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Validating ExampleVehicle Routing Problem with Time Window (VRP-TW) — Solution

Page 21: A RESTful architecture for integrating decomposable delayed services within the Web of Things

21/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Validating ExampleVehicle Routing Problem with Time Window (VRP-TW) — Solution

Suppose the central has to deliver 199 customer in a givenregion during a given day.Starting in the morning at 5h00, each of the four postmenvisits a subset of all customers.Suppose furthermore, that each customer is in a group of“express”, “normal” or “slow” delivery.“express” means that the item has to be delivered no laterthan 9h25, “normal” no later than 11h05 and “slow” till16h00.The partitioning takes 10min.Each of the 4 routings takes 20min.

Page 22: A RESTful architecture for integrating decomposable delayed services within the Web of Things

22/22

Outline Introduction Generic Architecture RESTifying a Service Validation Conclusion

Conclusion

We identified the challenging problem of integratingdecomposable delayed service into the WoT.We propose a reference architecture for such services.We showed how existing services can made be availableto the Web of Things.Finally we validated our findings with a prototypalimplementation.