module: internet of things lecture 2: system overview

35
1 Module: Internet of Things Lecture 2: System Overview Dr Payam Barnaghi, Dr Chuan H Foh Centre for Communication Systems Research Electronic Engineering Department University of Surrey Autumn Semester 2015

Upload: others

Post on 07-Feb-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Module: Internet of Things Lecture 2: System Overview

1

Module: Internet of Things

Lecture 2: System Overview

Dr Payam Barnaghi, Dr Chuan H Foh

Centre for Communication Systems Research

Electronic Engineering Department

University of Surrey

Autumn Semester 2015

Page 2: Module: Internet of Things Lecture 2: System Overview

2

Overview

− Cyber-Physical Systems

− Smart devices

− Real-time system

Page 3: Module: Internet of Things Lecture 2: System Overview

Cyber-Physical Systems (CPS)

- Connecting the real and virtual worlds

3

Page 4: Module: Internet of Things Lecture 2: System Overview

Cyber-Physical Systems (CPS)

− CPS is a system of collaborating computational elements controlling physical entities

− CPS integrates computation, networking, and physical processes more closely

− So what’s new?

− Highly pervasive

− Highly automated

− More decentralized in networking and computation

4

Page 5: Module: Internet of Things Lecture 2: System Overview

From Embedded Systemto the Internet of Things

5

Standalone Embedded

System

e.g. an outdoor motion sensor

light

Central Control System

e.g. home alarm system

(it looks BIG, but small)

The Internet of

Things

Cyber-Physical System

network

e.g. integrated home security system

(they look small, but BIG)

We are here

Page 6: Module: Internet of Things Lecture 2: System Overview

Another example: Google Driverless Car

6

Page 7: Module: Internet of Things Lecture 2: System Overview

Another example: Google Driverless Car

7

Page 8: Module: Internet of Things Lecture 2: System Overview

CPS versus IoT

− Appearance:

− Internet of Things: in 1999, introduced by Kevin Ashton

− Cyber-Physical Systems: around 2006, coined by Helen Gill at the National Science Foundation

− They are closely related, sometimes difficult to distinct. Here are what people say:

8Source: Acatech 2011

“CPS is the US version of IoT”

IoT has a wider scope

Page 9: Module: Internet of Things Lecture 2: System Overview

System Model

9

Outputs

Network

Inputs

Computing

generate or collect data

control physical world

make decision

connect all components

With human in the loop

Physical Space Cyber Space

Page 10: Module: Internet of Things Lecture 2: System Overview

Multidisciplinary

10

Computation

Communication Control

Information

Embedded SystemsArtificial

intelligence

Robotics

Wireless Sensor

Networks

Realtime

Systems

CognitiveSciences

Machine Learning

Sensor TechnologyControl Systems

Information Security …Human-

computer interaction

Sociology

Behaviour

Philosophy

Psychology

Page 11: Module: Internet of Things Lecture 2: System Overview

Enabling Technologies

11Source: “What the Internet of Things (IoT) Needs to Become a Reality,” White Paper, by K. Karimi and G. Atkinson

Page 12: Module: Internet of Things Lecture 2: System Overview

Smart Devices

12

- Technologies we cannot live without

Page 13: Module: Internet of Things Lecture 2: System Overview

Smart Things

− Vision: IoT will enable “Smart X”

where X = everything such as phone, watch, TV, fridge,

glasses, wardrobe, car, house, city, etc.

− Why do we think that they are ‘smart’?

− Understand our need (i.e. context aware)

− Implicit Human Computer Interaction (HCI)

13

Phone

Computer

Devices already with

communications

Home Appliance

Car

Powered objects usually without

communications

Furniture

Stationery

Cloth

Objects without a plug

House

Building

City

IoT: when we have everything connected

Power Grid

Page 14: Module: Internet of Things Lecture 2: System Overview

Smart Devices: Just a Thing

− Smart device is also a “Thing” by itself

− with sensors/actuators/tag

− with some processing power

− with communication capability

− Additionally, smart devices also offer:

14

Greater mobility support

Multiple sensors

Improved Human Computer Interaction

More powerful processor

Relatively large storage

Communication Control Computation

Always ON

Page 15: Module: Internet of Things Lecture 2: System Overview

Roles of Smart Devices in IoTs

Data collecting point

Human interaction point

Data processing point

Information storage point

15

Page 16: Module: Internet of Things Lecture 2: System Overview

Roles (1/2)

Data collecting point

− Smart devices can act as a sensor

− Example: sensing surrounding data around the user

Human interaction point

− Smart devices can act as user interface in IoT

− Example: providing messages, allowing user to control the environment

16

Page 17: Module: Internet of Things Lecture 2: System Overview

Roles (2/2)

Data processing point

− Smart devices are equipped with powerful processors, they can be used to perform complex tasks

− Example: processing local raw data to promptly generate meaning information to users

Information storage point

− Smart devices are equipped with non-volatile memory, they can be used to store information locally

− Example: keeping environment status, remembering personal preference

17

Page 18: Module: Internet of Things Lecture 2: System Overview

Real Time Systems – A quick

overview

18

Source: “Misconceptions about real-time computing: a serious problem for next-generation systems,” by J.A. Stankovic, IEEE Computer, vol. 21, no. 10, October 1988, pp. 10-19.

Page 19: Module: Internet of Things Lecture 2: System Overview

Real Time Computing

− “In real-time computing the correctness of the system depends not only on the logical result of the computation but also on the time at which the results are produced”Source: “Misconceptions about real-time computing: a serious problem for next-generation systems,” by J.A. Stankovic, IEEE Computer, vol. 21, no. 10, October 1988, pp. 10-19.

− Many real-time systems are control systems

− IoT and Real-time systems

− A “thing” can be modelled as a real-time system

− A single-domain IoT application (e.g. home alarm)

− A multi-domain IoT application (e.g. smart city) is often a distributed real-time system 19

Page 20: Module: Internet of Things Lecture 2: System Overview

Real Time Computing: Overview

− Classification:

− Hard/Soft Time Constraints

− Workload characteristics:

− Periodic/Aperiodic tasks

− Scheduling:

− Preemptive and Non-preemptive

− Static and Dynamic

− Online and Offline

− Optimal and Heutistic

− Design:

− Data Flow/Control Flow/State Transition Diagrams

20

Page 21: Module: Internet of Things Lecture 2: System Overview

Real Time Computing Classification

− Hard real-time computing

− The entire system failed when a single deadline is not met.

− Example: Satellite deployment

− Note: There is no ideal hard real-time system as no one can guarantee that every single component in the system will not fail. We’ll try to minimize all aspects, especially the design.

− Soft real-time computing

− Performance is degraded when some deadlines are not met.

− Example: Vending machine

− Goals: Minimizing performance degradation by meeting as many key deadlines as possible. 21

Page 22: Module: Internet of Things Lecture 2: System Overview

Workload characteristics

− Periodic tasks

− Tasks are repeated at a regular or semi-regular interval

− Example: Temperature sensing

− Aperiodic tasks

− Tasks arrive at irregular and unpredictable times

− Example: User interaction

− Note: A task may have a hard/soft deadline. It has to be handled with some appropriate scheduling algorithm.

22

Page 23: Module: Internet of Things Lecture 2: System Overview

Scheduling (1/2)

− Preemptive and Non-Preemptive

− With preemptive algorithms, a running task can be interrupted at any time.

− Otherwise, it must be executed uninterruptedly.

− Static and Dynamic

− With static algorithms, scheduling decisions are made based on fixed parameters.

− Otherwise, they are made based on dynamic parameters that may change during runtime.

23

Page 24: Module: Internet of Things Lecture 2: System Overview

Scheduling (2/2)

− Online and Offline

− Online schedulers make decision during runtime.

− Offline schedulers execute the entire task before actual task activation. The outcome can be stored in a table for execution later.

− Optimal and Heuristic

− An algorithm is said to be optimal if it obtains optimal result for a given cost function.

− An algorithm is said to be heuristic if there is no formal proof that its produced result is optimal.

24

Page 25: Module: Internet of Things Lecture 2: System Overview

Specification Approach

− Narrative text (Worst)

− Structured language

− Table or Tree

− Graph (Best)

25

If (System.Armed>5 and PIR.Movement==True)Alarm.Sound(60)

End If

When a movement is detected and the system is armed for more than 5 seconds, sound the alarm for 1 minute.

Armed PIR Door Alarm>5 True False 60>5 True True 60…

ActiveArmed

PendingArmed

Alarm set

5s passed

Alert

PIR trigged

60s passed…… …

Page 26: Module: Internet of Things Lecture 2: System Overview

State Transition Diagrams

− State Transition Diagrams

− Describe the behaviour of a system over time

− Finite State Machine (FSM)

− Finite and discrete-valued states/inputs/outputs

− We focus on Mealy FSM. It has five elements:

−States, Transitions, Events, Actions, and Initial state.

− A toy example:

26

CoolingJust Nice

Heating

T<22/H1

T>25/H0

T<25/F0

T>28/F1

Standby

OFF/H0OFF/F0OFFON

This FSM has• 4 states• 8 transitions• 6 events (or conditions)

• T = temp reading• 4 actions

• H0/1 = Turn off/on heater• F0/1 = Turn off/on fan

Page 27: Module: Internet of Things Lecture 2: System Overview

Mealy FSM: Description

− Formally, a Mealy FSM has 6-tuple: (S, s0, Σ, Λ, T, G)

− S: a finite set of states

− s0: an initial state, s0∈S

− Σ: a finite set of input alphabets (or events)

− Λ: a finite set of output alphabets (or actions)

− T: a transition function, where T : S×Σ → S

− G: an output function, where G : S×Σ → Λ

− We could reduce it to 5-tuple by merging G into T (S, s0, Σ, Λ, T):

− T : S×Σ → S×Λ

27

Page 28: Module: Internet of Things Lecture 2: System Overview

Mealy FSM: Our Toy Example

28

CoolingJust Nice

Heating

T<22/H1

T>25/H0

T<25/F0

T>28/F1

Standby

OFF/H0OFF/F0OFFON

For this FSM• S = {Cooling, Heating, JustNice, Standby}• s0 = Standby• Σ = {ON, OFF, T>28, T>25, T<25, T<22}• Λ = {F0, F1, H0, H1}• 8 transitions:

• T(<Standby,ON>) = <JustNice,->• T(<JustNice,T>28>) = <Cooling,F1>• …

Page 29: Module: Internet of Things Lecture 2: System Overview

Mealy FSM: State Transition Table

− Finite State Machine

− State transition table

29

CoolingJust Nice

Heating

T<22/H1

T>25/H0

T<25/F0

T>28/F1

Standby

OFF/H0OFF/F0OFFON

Current State (4) Event Action Next State (8)

Standby ON Just Nice

Just Nice

T>28 F1: Turn on Fan Cooling

T<22 H1: Turn on Heater Heating

OFF Standby

CoolingT<25 F0: Turn off Fan Just Nice

OFF F0: Turn off Fan Standby

HeatingT>25 H0: Turn off Heater Just Nice

OFF H0: Turn off Heater Standby

Page 30: Module: Internet of Things Lecture 2: System Overview

Mealy FSM: Implementation

30

Current State Event Action Next State

Standby ON Just Nice

Just Nice

T>28 F1: Turn on Fan Cooling

T<22 H1: Turn on Heater Heating

OFF Standby

CoolingT<25 F0: Turn off Fan Just Nice

OFF F0: Turn off Fan Standby

HeatingT>25 H0: Turn off Heater Just Nice

OFF H0: Turn off Heater Standby

...If (state==STANDBY) {

if (event==ON)state=JUST_NICE;

} else if (state==JUST_NICE) { // current stateif (event==TEMP && T>28) { // event

fan.turnOn(); // actionstate=COOLING; // transition

} else if (event==TEMP && T<22) {heater.turnOn();state=HEATING;

} else if (event==OFF) {state=STANDBY;

}} else if ......

Page 31: Module: Internet of Things Lecture 2: System Overview

Distributed Real Time System

− A multi-domain IoT application is often a distributed real-time system

− Connect various single domain IoT applications

− Add another dimension into the system: communication

− Not just to pay attention to timeliness of results, but also accuracy of communication among domains

− A distributed real-time system is essentially a real-time system when we have

− 100% reliable & secure network

− Zero latency & cost communication

− Infinite bandwidth

− One administration

31

Page 32: Module: Internet of Things Lecture 2: System Overview

Internet of Things

32

Smart Security

Simple real-time system

Single domain real-time system

Smart Home Entertainment

Smart Home Lighting Smart

Healthcare at Home

Smart Home: Multi-domain distributed real-time system

Smart Energy

Page 33: Module: Internet of Things Lecture 2: System Overview

33

Summary

− Understand what is a Cyber-Physical System and IoT

− The role of smart devices in IoT− Data collecting point

− Human interaction point

− Data processing point

− Information storage point

− Key concepts in real-time system

− Hard/Soft Time Constraints

− Periodic/Aperiodic tasks and their properties

− Scheduling

− System design, focusing on Mealy FSM

Page 34: Module: Internet of Things Lecture 2: System Overview

Exercise

A smart home security IoT application allows authenticatedusers to configure the system using a smart device. Userauthentication is performed by password, and 3 consecutiveincorrect passwords will trigger the alarm of the system.

Draft a finite state machine to describe a login procedure ofthe system. The initial state of the system is IDLE. If a login issuccessful, the system transits to SUCC state. Otherwise, if 3consecutive incorrect passwords are entered, the systemtransits to FAILED state. In your design, you must specifyappropriate events and actions. You may include anyadditional state where appropriate.

34

IDLE

FAILED

SUCC

Timeout / StopAlarm

UserLoggingOut / DisplayLogout EVENTS:• IncorrectPasswordReceived• CorrectPasswordReceived• …

ACTIONS:• DisplayWelcome• DisplayPasswordError• StartAlarm• …

Page 35: Module: Internet of Things Lecture 2: System Overview

35

Questions?