towards discrete control for the internet of things …...towards discrete control for the internet...

28
. . . Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble, France Eric Rutten, INRIA, Grenoble, France Hassane Alla GIPSA Lab, Grenoble, France June 25, 2013

Upload: others

Post on 23-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

.

.

. ..

.

.

Towards Discrete Control for the Internet of Thingsand Smart Environments

Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble, FranceEric Rutten, INRIA, Grenoble, France

Hassane Alla GIPSA Lab, Grenoble, France

June 25, 2013

Page 2: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 Background

.. .3 IoT and smart environments

.. .4 Modelling as a DCS problem

.. .5 Simulation

.. .6 Conclusion

2/25

Page 3: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 Background

.. .3 IoT and smart environments

.. .4 Modelling as a DCS problem

.. .5 Simulation

.. .6 Conclusion

3/25

Page 4: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Motivation.IoT and smart environments..

.

. ..

.

.

massive instrumentation, networked sensors and actuatorsoutside-in robots, sense and act upon their own inner spacesmart homes, smart buildings or smart cities

.Control techniques for autonomic management..

.

. ..

.

.

model possible behaviours, and control objectives, separatelyclassically continuous time dynamics and differential equationsdiscrete control, events and states, Petri nets or automata

.Discrete control for the IoT..

.

. ..

.

.

systematic modelling framework ; case study in smart homeautomata ; Discrete Controller Synthesis (DCS)

4/25

Page 5: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 BackgroundInterfacing to the IoT and Smart EnvironmentsReactive languages, DCSDiscrete control as MAPE-K

.. .3 IoT and smart environments

.. .4 Modelling as a DCS problem

.. .5 Simulation

.. .6 Conclusion

5/25

Page 6: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Interfacing to the IoT and Smart Environments

Entity Entity Entity Entity

SupervisoryController 1

SupervisoryController 2

Application 1 Application 2

Sensor/Actuator

Sensor/Actuator

Sensor/Actuator

Other Service

Space Space Thing Thing

ApplicationLayer

ServiceLayer

Entity AbstractionLayer

DeviceLayer

PgysicalPlant

.monitoring and controlling of entities (rooms, appliances, ...)..

.

. ..

.

.

intermediate abstraction layer HAL (Home Abstraction Layer)supervisory controllers as service : emphasis on genericity

6/25

Page 7: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Reactive languages, synchronous programming.Modelling formalism and programming language..

.

. ..

.

.

reaction to input flows → output flowsdata-flow nodes and equations ; mode automata (FSM)parallel (synchronous) and hierarchical composition

synchronous languages, (25+ years)tools: compilers (e.g., Heptagon), code generation, verification, ...

example: delayable task control (in Heptagon)delayable(r,c,e) = a,s

Idle Wait

e r and c/s

Activec/s

r and not c

a = true

a = falsea = false node delayable(r,c,e:bool) returns (a,s:bool)

let automaton

state Idle do

a = false; s = r and c

until r and c then Active

| r and not c then Wait

state Wait do a = false; s = c

until c then Active

state Active do a = true; s=false

until e then Idle

end tel

7/25

Page 8: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Discrete controller synthesis (DCS): principle

.Goal..

.

. ..

.

.

Enforcing a temporal property Φ on a systemon which Φ does not yet hold a priori

.Principle (on implicit equational representation)..

.

. ..

.

.

State memoryTrans transition functionOut output function

Partition of variables : controllable (Y c), uncontrollable (Y u)Computation of a controller such that the controlled systemsatisfies Φ (invariance, reachability, attractivity, ...)

DCS tool: Sigali (H. Marchand e.a.)

8/25

Page 9: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Discrete controller synthesis (DCS): principle

.Goal..

.

. ..

.

.

Enforcing a temporal property Φ on a systemon which Φ does not yet hold a priori

.Principle (on implicit equational representation)..

.

. ..

.

.

State memoryTrans transition functionOut output function

Trans State OutZY

Partition of variables : controllable (Y c), uncontrollable (Y u)Computation of a controller such that the controlled systemsatisfies Φ (invariance, reachability, attractivity, ...)

DCS tool: Sigali (H. Marchand e.a.)

8/25

Page 10: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Discrete controller synthesis (DCS): principle

.Goal..

.

. ..

.

.

Enforcing a temporal property Φ on a systemon which Φ does not yet hold a priori

.Principle (on implicit equational representation)..

.

. ..

.

.

State memoryTrans transition functionOut output function

Y c

Y u Trans State OutZY

Partition of variables : controllable (Y c), uncontrollable (Y u)

Computation of a controller such that the controlled systemsatisfies Φ (invariance, reachability, attractivity, ...)

DCS tool: Sigali (H. Marchand e.a.)

8/25

Page 11: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Discrete controller synthesis (DCS): principle

.Goal..

.

. ..

.

.

Enforcing a temporal property Φ on a systemon which Φ does not yet hold a priori

.Principle (on implicit equational representation)..

.

. ..

.

.

State memoryTrans transition functionOut output function

Ctrlr Y c

Y u Trans State OutZY

Partition of variables : controllable (Y c), uncontrollable (Y u)Computation of a controller such that the controlled systemsatisfies Φ (invariance, reachability, attractivity, ...)

DCS tool: Sigali (H. Marchand e.a.)

8/25

Page 12: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

BZR programming language [http://bzr.inria.fr]

.

.

. ..

.

.

built on top of nodes in Heptagonto each contract, associate controllable variables, localat compile-time (user-friendly DCS),

compute a controller for each componentwhen no controllable inputs : verification by model-checkingstep and reset functions ; executable code : C, Java, ...

OutCTrC StC

Trans StateCtrlr

eA, eG

xi

contract

Outyj

ck

body

twotasks(r1, e1, r2, e2) = a1, s1, a2, s2enforce not (a1 and a2)with c1, c2

(a1, s1) = delayable(r1, c1, e1);

(a2, s2) = delayable(r2, c2, e2)

& G. Delaval & H. Marchand [ACM LCTES’10] [jDEDS13]9/25

Page 13: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Discrete control as MAPE-K

sensor

executeknowledge

monitor

analyse plan

actuator

managed element

.

.

. ..

..

autonomic MAPE-Kflows : sensor observationsto reconfiguration actionsreactive language BZR usedas DSL for decision

sensor

stateinputs

actuator

managed element

outputs

transitionfunction

control

.

.

. ..

.

.

FSM instanciation ofMAPE-Kexhibit state (observability)accept events or conditions(controllability)

10/25

Page 14: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Hierarchical architecturecontrol

stateinputs outputs

transitionfunction

sensor

stateinputs

actuator

outputs

transitionfunction

sensor

stateinputs

actuator

outputs

transitionfunction

controlcontrol

managed element

.

.

. ..

.

.

hierarchical MAPE-K, through additional interfacesin components : composites using life-cycles of subcomponentsimplementation : step

synthesized and generated off-linecalled at run-time in composite controller

11/25

Page 15: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 Background

.. .3 IoT and smart environmentsTarget environmentsReconfiguration policy

.. .4 Modelling as a DCS problem

.. .5 Simulation

.. .6 Conclusion

12/25

Page 16: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Target environments

lamp

room

window

radiator

door

TV washingmachine

oven

sensor readings

actuator commands

Controller

SystemModel

abstractedby HAL

state

cm

cn

ck

.Smart home example..

.

. ..

.

.

set of entities, observation and control possibilitiesissues of safety (source of light on in case of presence),issues of economy or comfort (instantaneous power peaks)

13/25

Page 17: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Reconfigurable entities

.Basic entities in the apartment..

.

. ..

.

.

door, windowlamp, TV, radiator (off, frost-free, eco or high mode)oven : off, heating up, maintaining its current temperaturewashing machine : phases ; can be suspended

.Sensors and actuators..

.

. ..

.

.

presence, door/window (open or closed)smart plugs for TV or lamp, suspend the wash machine

14/25

Page 18: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Reconfiguration policy.4 categories of objectives..

.

. ..

.

.

safety (sa)security (se)energy efficiency (e)comfort (c)

.System objectives..

.

. ..

.

.

...1 (sa) at least one light source on when room is occupied

...2 (se) close window and door when room isn’t occupied

...3 (e) if window or door open, radiator either off or frost-free

...4 (e) if room inoccupied, no light on and radiator off or frost-free

...5 (sa,e) total power under current threshold(3 modes: minimal-safety, comfort, eco)

15/25

Page 19: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 Background

.. .3 IoT and smart environments

.. .4 Modelling as a DCS problemSystem behaviors modelControl objective specification

.. .5 Simulation

.. .6 Conclusion

16/25

Page 20: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

System behaviors model (i)

closed openpushi & c_doori

pushi or not c_doori door_openi

= truedoor_openi = false

pushi

c_doori door_openi

doori

empty ocupied

presencei

not presencei room_oci = true

room_oci = false

roomi

presencei room_oci

.door and room..

.

. ..

..

two states /configurationscontrollability

door : preventopening, closeroom : observeronly

offfrost

protection

up1

c1

state

rad

down1 eco

power

(0) (300) (1500)

high(2000)

up2

down2

up1 or not c1

down1 or not c1

up1 & c1

down1 or not c1

down2 or not c2

up2 & c2

up2 & c2

down1 ornot c1

c2

.radiator / heater..

.

. ..

.

.

four states / configurationscontrollability

prevent going higherforce going lower

17/25

Page 21: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

System behaviors model (ii)

offwater

fill

washing

rinse

spin

standby

startend& not c

end& c

end(250)

(200)

(800)

(0)

washing machine

end

start

c

state

power

end

(0)

end

(15)

c

.washing machine..

.

. ..

.

.

phases, with powerstandby controllable

off

heat

maintain reheat

standby

start& not c

start& c

temp_ok

(1500)

(300)

(0)

oven

finish

start

c state

powercold (0)

(1000)

temp_ok

finish

finish finish

c

cold & c

temp_ok

.oven..

.

. ..

.

.

5 states, with powerstandby, reheatcontrollable

18/25

Page 22: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

System behaviors model (iii)

minimalsafety

eco_inputeco

management policy

comfort_input

eco

comfort

comfort

eco_input

not eco_input

eco_inputnot

comfort_input

comfort_input

comfort_input

PL=5000

PL=7000

PL=3000

PL

.Global system behavior model..

.

. ..

.

.

parallel composition of instances of automataglobal power consumption functions, in terms of the local onestotalPower = p(wm) + p(ov) + p(rd)

3 management policies : 3 states with different PL

19/25

Page 23: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Control objective specification

.Conjunction of five rules..

.

. ..

.

.

...1 room_oc ⇒ lamp_on ∨ tv_on

...2 ¬room_oc ⇒ ¬(d_open ∨ w_open)

...3 (d_open ∨ w_open) ⇒ (rad_off ∨ rad_frost)

...4 ¬room_oc ⇒ (¬(lamp_on∨tv_on)∧(rad_off ∨ rad_frost))

...5 totalPower ≤ PL

made invariant by control ; controller synthesizedtool-supported : BZR

20/25

Page 24: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 Background

.. .3 IoT and smart environments

.. .4 Modelling as a DCS problem

.. .5 Simulation

.. .6 Conclusion

21/25

Page 25: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Implementation and simulation

.BZR encoding and DCS..

.

. ..

.

.

textual syntax for automata and contractsexecutable code generation (C or Java)

.Simulation..

.

. ..

.

.

MiLeSEnS (Multi-Level Smart Environment Simulator)sensor and actuator models

22/25

Page 26: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Outline

.. .1 Motivation

.. .2 Background

.. .3 IoT and smart environments

.. .4 Modelling as a DCS problem

.. .5 Simulation

.. .6 Conclusion

23/25

Page 27: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Conclusions

.DCS for IoT..

.

. ..

.

.

first results in using discrete supervisory controllersapplied to the IoT and smart homes and buildings

.Systematic modeling framework..

.

. ..

.

.

behavioral modeling of typical entitiesformulation of control objectives of typical categories

(safety, security, energy, comfort)automatic generation of controllersdevelopment and experimental validation

24/25

Page 28: Towards Discrete Control for the Internet of Things …...Towards Discrete Control for the Internet of Things and Smart Environments Mengxuan Zhao, Gilles Privat, Orange Labs, Grenoble,

Motivation. . . . . .Background

. . .IoT and smart environments

. . . .Modelling as a DCS problem Simulation Conclusion

Perspectives.Perspectives..

.

. ..

.

.

Domain-Specific Language for smart environmentsgeneration of LTS and objectives

more DCS : modular, quantitative ; identification of modelsmore complete experiments

.Part of a general approach using discrete control for computing..

.

. ..

.

.

behavioral modeling using LTSs : high level

automatic generation (DCS) : safe, max.permissive

tool support (BZR language)used also for :

coordinating administration loops in the Cloud or HPCmanaging reconfigurable architectures (FPGA)

25/25