Construction d'applications dans la jungle de...
Transcript of Construction d'applications dans la jungle de...
Construction d'applications dans la jungle de l'IOT
DIVERSE : DIVERsity-centric Software Engineering
Software intensive systems
Context: Buidling services on top of the IoT Jungle
• Heterogeneous and Distributed Services • Heterogeneous: The infrastructure on which the service
runs is composed of a set of different nodes and networks. • The “IOT Jungle" which ranges from microcontroller based
sensors and devices to cloud.
• Distributed: The implementation of the services is composed of a set of independent processes communicating asynchronously. • Truly distributed services implementation is required in order to
provide useful and reliable services which take advantage of the infrastructure.
Examples n Health domain and ambient assisted living n Energy domain and smart grids n Environmental monitoring and oil and gas n Safety in hazardous environments n Intelligent Transport Systems (ITS) n ...
Heterogeneous infrastructure
New Services on top of the IoT Jungle
Legacy Partner
Proprietary product
External service
System under development
Things
8
Arduino RaspberryPi
IntelEdison STNucleo ESP8266
Cost $3-$30 ~$35 $40 $8 ~$3
Wifi Shield($60)orESP8266
USBDongle Built-in Shield($60)orESP8266
Built-in
Programming C/C++ Python/Java/C++,Javascript,…
C,C++,Javascript,Python,Java,..
C,C++ C++/Lua
CodedistribuAon
USB/SPI/Serial In-Situ In-Situ USB/SPI/Serial Serial/OTA
Storage Built-In SD-Card Built-In Built-In Built-In
I/O ArduinoUno:13GPIO/6ADC
17GPIO 20GPIO(PWM,SPI,one-wire) •6analoginputs. 1UART(Rx/Tx).
GPIO(50) 12-bitADCwith16 Timers(8) I2C(3),SPI(3) USART(3)
10GPIO/1ADC
PowerconsumpAon
12V 50mA Deepsleep?
1A5V peak:984mWusingWifi5GHzband:680mWusingserialport:346mW Idle88mW poweredoff45mW
128µA/MHz.InStopmode, thepower consumpeoncanbeaslowas9µA. 3,3V
3,3V Transmit802.11b,CCK11Mbps,POUT=+18.5dBm197mA Standby0.9mA Deepsleep 10uA
9
Model-driven software engineering to handle
diversity
Our Main Objective
• Enable efficient exploitation of the broad diversity of the future computing continuum for rapid service innovation of advanced services, by providing service developers with new agile tool supported software engineering methods enabling short innovation cycles
10
Heads project outputs Two new modelling languages to tame the
IoT jungle
11
What is ThingML ? n A DSL to model distributed reactive systems
n IoT systems, embedded systems, sensor networks, ... n Components, State machines and action language
n « Main stream » MDE n Contributions of ThingML
n « Complete » action language n Slots, Mixins and Aspects instead of Inheritance and Composites n Enforced encapsulation and actors semantics
n Target Platforms and Applications n MDE for resource constrained systems (microcontrollers, IoT) n Development of applications distributed across heterogeneous
hardware n Other types of reactive systems?
Why ThingML ? n Typical MDE benefits
n Reduce development, maintenance and evolution costs n Perform verifications and analysis on the models n Model application at a platform independent level
n No existing approach can deal with microcontrollers n ThingML can run on hardware less than 1ko of RAM
n No existing approach is really platform independent n Since actions are written in the target language
ThingML Goals
• Provide tools and methods • For each actor to concentrate on his task
• For decoupling the tasks of different actors
• Using state of the art software engineering practices • Modularity, reusability, runtime deployment, continuous
integration, validation, etc…
• Cost efficient and practically usable • No large overhead, integrated with legacy systems, etc…
Blink example state machine thingBlinkincludesLedMsgs,TimerMsgs{requiredportHW{sendsled_toggle,timer_startreceivestimer_timeout}statechartBlinkImplinitBlinking{stateBlinking{onentryHW!timer_start(1000)transition->BlinkingeventHW?timer_timeoutactionHW!led_toggle()}}}
Blink
Stopped ?timer_timeout !led_toggle()
on entry !timer_start(1000)
HW
<= timer_timeout() => led_toggle() => timer_start(delay:int)
Blink example and instance groups
Timer:Timer
do: DigitalOutput pin: IOPin
Arduino Board
app: BlinkApplication
led: Led
led group
Led HW
HW timer
io group
configurationBlinkArduino{groupled:LedArduinosetled.io.digital_output.pin=DigitalPin:PIN_13//Thetimerinstancetimer:TimerArduino//Theblinkapplicationinstanceapp:Blinkconnectorapp.HW=>led.led.Ledconnectorapp.HW=>timer.timer}
The ThingML tools n Based on Eclipse / EMF Metamodel n Textual Syntax with EMFText
n For good usability and productivity n To keep the development cost of the editor(s) reasonable
n Graphical exports (graphML, graphviz, …) n Static well formedness and type checker n Equivalent compilers for a set of platforms
n C/C++ for different microcontrollers, linux, embedded linux n Java for computers, smartphones, … n Javascript (NodeJS) n Maybe others if needed
n Generators for communication channels n Easy to distribute ThingML IDE
n Standalone and lightweight IDE n Eclipse plugins
ThingML Editor
Kevoree: a DSML to drive software configuration and deployment
• Heterogeneous execution platforms • how to handle deployment?
• how to handle reconfiguration?
• how to verify system level properties?
• Effective support for runtime models • limited resources
• time constraints
• Distributed model dissemination
Models@runtime for distributed and heterogeneous systems
Lightweight M@R framwork for building Distributed Adaptive System
M@R Runtimes for Distributed and Heterogeneous adaptive systems
Extensible Virtual System Infrastructure
Resilient Software
infrastructure based on diversity
Kevoree in nutshell 1/3
Kevoree in nutshell 2/3
• Kevoree Abstraction model for architectural diversity
• Model@Runtime eases the management of distributed systems
• Homogeneous adaptation for heterogeneous CPS devices
• Large scale adaptation dissemination (Gossip, Paxos, etc.)
• Ready for cloud and elasticity algorithms development
• Open source
• lost, www.kevoree.org
Kevoree in nutshell 3/3
Current Works
24
correctness envelop
Reasonable correctness envelop
25
P
P'
• Automatic synthesis of software diversity • sosies are different
programs that still belong to the correctness envelop
Automatic diversity synthesis
• Automatic synthesis of software diversity • sosies are different programs that still belong to the
correctness envelop
26
P
correctness envelop
PP'
correctness envelop
Software intensive systems
27
Software intensive systems
Continuous design for
Heterogeneous, variable, adaptive within reasonable
correctness boundaries