INTERNET -T (I T) · MIDDLEWARE AND HEALTHCARE APPS FOR INTERNET-OF-THINGS (IOT) The 30th...
Transcript of INTERNET -T (I T) · MIDDLEWARE AND HEALTHCARE APPS FOR INTERNET-OF-THINGS (IOT) The 30th...
MIDDLEWARE AND HEALTHCARE APPS FOR
INTERNET-OF-THINGS (IOT)
The 30th ACM/SIGAPP Symposium On Applied Computing (SAC 2015) Tutorial
Project supported by: FCT - Grant SFRH/BPD/96749/2013
José Cecílio Pedro Furtado
Outline of tutorial
SAC 2015 © José Cecílio & Pedro Furtado 2
Outline of tutorial
1st Part
Fundamental concepts;
Applications;
Architecture models;
Technologies and mechanisms
for sensing, actuation and
processing;
Cyber-physical data
communication;
3 SAC 2015 © José Cecílio & Pedro Furtado
Outline of tutorial
1st Part
Fundamental concepts;
Applications;
Architecture models;
Technologies and mechanisms
for sensing, actuation and
processing;
Cyber-physical data
communication;
2nd Part
Semantic technologies;
Service oriented solutions;
Networking technologies that
enable the integration of Internet
of Things data and services into
the cyber world (i.e. the Internet
and the Web);
Healthcare IoT solutions;
4 SAC 2015 © José Cecílio & Pedro Furtado
Outline of tutorial
SAC 2015 © José Cecílio
1st Part
Fundamental concepts;
Applications;
Architecture models;
Technologies and mechanisms
for sensing, actuation and
processing;
Cyber-physical data
communication;
2nd Part
Semantic technologies;
Service oriented solutions;
Networking technologies that
enable the integration of Internet
of Things data and services into
the cyber world (i.e. the Internet
and the Web);
Healthcare IoT solutions;
3rd Part
SmartGuia;
BrainTrain;
AidMe;
HelpMeLearning. 5
Outline of tutorial
SAC 2015 © José Cecílio
1st Part
Fundamental concepts;
Applications;
Architecture models;
Technologies and mechanisms
for sensing, actuation and
processing;
Cyber-physical data
communication;
2nd Part
Semantic technologies;
Service oriented solutions;
Networking technologies that
enable the integration of Internet
of Things data and services into
the cyber world (i.e. the Internet
and the Web);
Healthcare IoT solutions;
3rd Part
SmartGuia;
BrainTrain;
AidMe;
HelpMeLearning.
To improve practical skills in order to develop Apps that can be transferred into a real-world environment
6
By embedding short-range mobile transceivers into a wide array of additional
gadgets and everyday items, enabling new forms of communication between
people and things, and between things themselves.
Extending the current Internet and providing
connection, communication, and inter-
networking between devices and physical
objects, or "Things," is a growing trend that is
often referred to as the Internet of Things.
What’s Internet of Things (IoT)?
7 SAC 2015 © José Cecílio & Pedro Furtado
What’s Internet of Things (IoT)?
Things having identities and virtual
personalities operating in smart spaces using
intelligent interfaces.
The technologies and solutions that enable integration of real world data and
services into the current information networking technologies are often described
under the umbrella term of the Internet of Things (IoT).
8 SAC 2015 © José Cecílio & Pedro Furtado
Sensor devices are becoming widely available
Programmable devices
Off-the-shelf gadgets/tools
9 SAC 2015 © José Cecílio & Pedro Furtado
More “Things” are being connected
Home/daily-life devices
Business
Public infrastructure
Healthcare
10 SAC 2015 © José Cecílio & Pedro Furtado
THE APPLICATION OF IOT
11 SAC 2015 © José Cecílio & Pedro Furtado
Why should you learn about IoT
Business trend
Emerging technologies
Growing IoT Services and Application
Source: http://blog.trentonsystems.com/internet-of-things-crosses-business-personal-boundaries/
12 SAC 2015 © José Cecílio & Pedro Furtado
The Application of IoT
Network
Biosensor taken by people
Equipment in public places House
Regional Office
Virtual Environment Transportation Vehicle
13 SAC 2015 © José Cecílio & Pedro Furtado
IoT
Healthcare
Transportation and Logistics
Futuristic Personal and
social
Smart environments
The Application of IoT
14 SAC 2015 © José Cecílio & Pedro Furtado
IoT
Healthcare
Transportation and Logistics
Futuristic Personal and
social
Smart environments
The Application of IoT
Tracking
Identification, Authentication
Data Collection
Sensing
Many are the benefits provided by the IoT technologies to the
healthcare domain
• tracking of objects and people (staff and patients)
• identification and authentication of people
• automatic data collection and sensing
• more comfortable rehabilitation (rehabilitation based on gadgets)
• remote following by the caregivers and doctors
15 SAC 2015 © José Cecílio & Pedro Furtado
IoT
Healthcare
Transportation and Logistics
Futuristic Personal and
social
Smart environments
The Application of IoT
Logistics
Augmented maps
Mobile ticketing
Assisted driving
Environment monitoring
Cars, trains, buses and bicycles are becoming more instrumented with sensors, actuators, and processing power.
Roads themselves and transported goods are equipped with tags and sensors
• important information to traffic control sites
• better routing the traffic • help in the management of
the depots • provide the tourist with
appropriate transportation information
• monitor the status of the transported goods.
16 SAC 2015 © José Cecílio & Pedro Furtado
IoT
Healthcare
Transportation and Logistics
Futuristic Personal and
social
Smart environments
The Application of IoT
Public buildings
Comfortable homes/offices
Industrial plants
Smart museum and gym
Sensors and actuators can make our life
more comfortable in several aspects:
• rooms heating can be adapted to our
preferences and to the weather
• the room lighting can change
according to the time of the day
• domestic incidents can be avoided
with appropriate monitoring and
alarm systems
• energy can be saved by automatically
switching off the electrical equipment
when not needed
Smart environments help in improving
the automation in industrial plants with
a massive deployment of RFID tags
associated to the production parts.
17 SAC 2015 © José Cecílio & Pedro Furtado
IoT
Healthcare
Transportation and Logistics
Futuristic
Smart environments
The Application of IoT
Personal and social
Losses
Historical queries Social networking
Thefts
Enable the user to interact with other people to
maintain and build social relationships.
Things may automatically trigger the transmission of
messages to friends to allow them to know what we are
doing or what we have done in the past.
18 SAC 2015 © José Cecílio & Pedro Furtado
IoT
Healthcare
Transportation and Logistics
Personal and social
Smart environments
The Application of IoT
Many other applications, which we herein
define futuristic rely on some
communications, sensing technologies
In future cities, robot taxis swarm
together, moving in flocks, providing
service where it is needed in a timely and
efficient manner
The enhanced game room as well as the
players may be equipped with a variety of
devices to sense location, movement,
acceleration, humidity, temperature,
noise, voice, visual information, heart rate
and blood pressure.
The room uses this information to
measure excitement and energy levels so
that to control the game activity according
to status of the player.
Futuristic
Robot Taxi
Enhanced game rooms
City information, SmartCities
19 SAC 2015 © José Cecílio & Pedro Furtado
REQUIREMENTS & CHALLENGES
20 SAC 2015 © José Cecílio & Pedro Furtado
Requirements & Challenges
Fault tolerance
• Nodes can get damaged, run out of power, the wireless communication
between two nodes can be interrupted
• Node failures redundant deployments can be necessary
Lifetime
• (Typically) Nodes have a limited energy supply
• Sometimes replacing the energy sources is not practical (e.g. underwater
deployment, large/remote field deployments)
• Energy efficient operation must be planed and implemented
21 SAC 2015 © José Cecílio & Pedro Furtado
Requirements & Challenges
Scalability
• An IoT system may consists of a large number of nodes
• Architectures and protocols should be easy to scale
Wide range of densities
• Density of the network can vary
• Different applications can have different node densities
• Density does not need to be homogeneous in the entire network and
network should adapt to such variations
22 SAC 2015 © José Cecílio & Pedro Furtado
Requirements & Challenges
Programmability
• Nodes should be flexible, it should be easy to change their tasks
• The code should also be changeable during operation (configurable).
Maintainability
• The network and its environment can change
• The system should be adaptable to those changes.
• The operational parameters can change to choose different trade-offs (e.g.
to provide lower quality when energy efficiency is more important)
23 SAC 2015 © José Cecílio & Pedro Furtado
NETWORK AND ITS ELEMENTS
24 SAC 2015 © José Cecílio & Pedro Furtado
IoT Networking
LAN
Gateway
Thing Thing
Thing Thing
Internet
Data Servers
Client Client Client Client
Network is a distributed system.
IoT applications use diverse protocol technologies for networking.
Gateway is the device connecting the network and the Internet.
IoT applications make use of existing Internet technology for interconnection.
Data Servers used to store, share and analyse data.
25 SAC 2015 © José Cecílio & Pedro Furtado
A Thing
We can turn almost every object into a “thing”.
A “thing” still looks much like an embedded system currently.
A “thing” generally consists of four main parts:
• Sensors & actuators
• Microcontroller
• Communication unit
• Power supply
A “thing” has the following properties:
• It’s usually powered by battery. This implies limited source of energy.
• It’s generally small in size and low in cost. This limits their computation
capability.
• It doesn’t usually perform complicated tasks. 26 SAC 2015 © José Cecílio & Pedro Furtado
Smart Devices: Just a Thing
Smart device is also a “Thing” by itself
• Sensors / Actuators / Tag (RF, QR-code, Bar-code) • Processing power • Communication capabilities
Additionally, smart devices may also offer:
Greater mobility support
Multiple sensors
Human Computer Interactions
Allways ON
More storage
More powerful processor
Communication Interaction/sensing Computation
27 SAC 2015 © José Cecílio & Pedro Furtado
The role of Smart Devices in IoT
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
28 SAC 2015 © José Cecílio & Pedro Furtado
The role of Smart Devices in IoT
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 meaningful 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 29
SAC 2015 © José Cecílio & Pedro Furtado
System Model
Storage
Computing
Network
Physical Space Cyber Space
Control physical
world
Collect data
Human interactions
Connect all components
Things
Make global decisions
Inputs
Outputs
30 SAC 2015 © José Cecílio & Pedro Furtado
How are the Networks changing?
From any TIME, any PLACE connectivity for anyone, we will now have connectivity
for anything!
TIME
THING
PLACE
• Night • Daytime
• On the move • Working time
• Outdoors and indoors
• Outdoors and indoors • Anywhere • Shopping
• Office • Home
• Between PCs • Thing to Thing
• Human to Human • Human to Thing, using generic equipment
31 SAC 2015 © José Cecílio & Pedro Furtado
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 deadline. It has to be handled with some appropriate scheduling
algorithm.
32 SAC 2015 © José Cecílio & Pedro Furtado
Types of Applications
Event detection
• Reporting occurrences of events
• Reporting abnormalities and changes
• Could require collaboration of other nearby or remote nodes
• Event definition and classification is an issue
Periodic measurements
• Sensors periodically measure and report the observation and measurement data
• Reporting period is application dependent
33 SAC 2015 © José Cecílio & Pedro Furtado
Types of Applications
Approximation and pattern detection
• Sending messages along the boundaries of patterns in both space/time
Tracking
• When the source of an event is mobile
• Sending event updates with location information
34 SAC 2015 © José Cecílio & Pedro Furtado
Wireless Sensor Networks (WSN)
Connect Things to users
The networks typically run Low Power Devices
Consist of one or more sensors, could be different type of sensors (or actuators)
Sink node
Gateway
Core network e.g. Internet Gateway
End-user
Computer services
35 SAC 2015 © José Cecílio & Pedro Furtado
Things connected to things
Complex and heterogeneous resources and networks
Internet
3G WIFI
36 SAC 2015 © José Cecílio & Pedro Furtado
Things connected to things
Complex and heterogeneous resources and networks
Internet
3G WIFI To share information about (e.g.) • Prices • Delivers • Traffic • Weather • Time to wait in queues • Service time
37 SAC 2015 © José Cecílio & Pedro Furtado
People connected to things
Motion sensor
Motion sensor
Motion sensor
ECG sensor
Internet
EEG sensor
38 SAC 2015 © José Cecílio & Pedro Furtado
HOW TO PROGRAM AN IOT SYSTEMS?
39 SAC 2015 © José Cecílio & Pedro Furtado
Embedded operating systems
Virtual machines
• Abstracting the hardware specific issues from the users.
Need for energy-efficient execution
The code is more restricted (compared to conventional operating systems) so a
full-blown OS is not obviously required.
• An appropriate programming model
• A clear way to structure a protocol stack
• And support for energy management
40
Operating Systems
– and Run-time environments –
SAC 2015 © José Cecílio & Pedro Furtado
OS running on devices with restricted functionality
• In the case of sensor nodes, there devices typically also have limited processing
capability
• e.g. TinyOS, ContikiOS
Restricted to narrow applications
• industrial controllers, robots, networking gear, gaming consoles, metering,
sensor nodes…
Architecture and purpose of embedded OS changes as the hardware capabilities
change (i.e. mobile phones)
41
Embedded Operating Systems
SAC 2015 © José Cecílio & Pedro Furtado
TinyOS
ContikiOS
Arm Embedded Linux
Android
Windows Phone
IOS
…
42
Embedded Operating Systems
SAC 2015 © José Cecílio & Pedro Furtado
“TinyOS is an open source, BSD-licensed operating system designed for low-
power wireless devices, such as those used in sensor networks .”
TinyOS applications are developed using nesC
nesC is a dialect of the C language that is optimized for the memory limits of
nodes.
43
TinyOS
SAC 2015 © José Cecílio & Pedro Furtado
P. Levis, S. Madden, J. Polastre, R. Szewczyk, A. Woo, D. Gay, J. Hill, M. Welsh, E. Brewer, and D. Culler, “Tinyos: An operating system for sensor networks,” in Ambient Intelligence, 2005, vol. II, no. August, pp. 115–148.
TinyOS home page: http://www.tinyos.net/
“TinyOS is completely non-blocking:
• It has one stack;
• All I/O operations that last longer than a few hundred microseconds are
asynchronous and have a callback;
• To enable the native compiler to better optimize across call boundaries, TinyOS
uses nesC's features to link these callbacks, called events, statically.”
44
TinyOS - programming
SAC 2015 © José Cecílio & Pedro Furtado
TinyOS does not provide a clear separation of concern between the operating
system and the application.
Tasks, commands and events are fundamental building blocks of the TinyOS run-
time environment.
Tasks are monolithic processes that should be executed until they are complete.
• This means they can not be blocked by other tasks but they can be interrupted
by events.
• For example a packet reading task can schedule itself repeatedly (sending an
event signal) until it has read all the packets.
• In TinyOS the scheduled tasks use a FIFO principle.
45
TinyOS
SAC 2015 © José Cecílio & Pedro Furtado
Contiki is the open source operating system for the Internet of Things.
• runs on networked embedded systems and wireless sensor networks.
It is designed for microcontrollers with small amounts of memory.
A typical Contiki configuration is 2 kilobytes of RAM and 40 kilobytes of ROM.
Contiki provides IP communication, both for IPv4 and IPv6.
• Combined with power-efficient radio mechanisms such as ContikiMAC, allow
battery-operated devices to participate in networking.
• Contiki supports 6lowPAN and the IETF CoAP standards.
46
Contiki
SAC 2015 © José Cecílio & Pedro Furtado
A. Dunkels, B. Gronvall, and T. Voigt, “Contiki - a lightweight and flexible operating system for tiny networked sensors,” in 29th Annual IEEE International Conference on Local Computer Networks, 2004, pp. 455–462.
Contiki home page: http://http://www.contiki-os.org/
It’s kernel functions as an event-driven kernel.
multithreading is supported by an application library.
Contiki realizes the separation of concern of the basic system support form the
rest of the dynamically loadable and programmable services (called processes).
The services communicate with each other through the kernel by posting
events.
The ContikiOS kernel does not provide any hardware abstraction.
It allows device drivers and application directly communicate with the hardware.
47
Contiki
SAC 2015 © José Cecílio & Pedro Furtado
Each Contiki service manages its own state in a private memory space and the
kernel keeps a pointer to the process state.
Dynamic loading and reconfiguration of services is achieved by defining services,
service interfaces, service stubs and a service layer
It is supported by Protothreads
• Protothreads can be seen as lightweight (stakless) threads.
• They can be also seen as interruptible tasks in event-based programming.
• A protothread is invoked whenever a process receives a message from another
process or a timer event.
48
Contiki
SAC 2015 © José Cecílio & Pedro Furtado
A software stack for mobile devices that includes
• An operating system
• Middleware
• Key Applications (Email Client, SMS Program, Calendar, Maps, Browser,
Contacts)
Uses Linux to provide core system services
• Security
• Memory management
• Process management
• Power management
• Hardware drivers
49
Android
SAC 2015 © José Cecílio & Pedro Furtado
Android home page: https://www.android.com/
50
Android Architecture
All applications are written using
the Java language
Enabling and simplifying the reuse of
components
• Developers have full access to the
same framework APIs used by the
core applications.
• Users are allowed to replace
components.
Including a set of C/C++ libraries used by
components of the Android system
Exposed to developers through the
Android application framework
Provides most of the functionality
available in the core libraries of the Java
language
Provides the environment on which every
Android application runs
• Relying on Linux Kernel 2.6 for core system services
(Memory and Process Management, Network Stack,
Driver Model, Security)
• Providing an abstraction layer between the H/W and the
rest of the S/W stack
SAC 2015 © José Cecílio & Pedro Furtado
Advantages
• Always with the user
• Typically have Internet access
• Typically GPS enabled
• Typically have accelerometer &
compass
• Most have cameras & microphones
51
Android
– in IoT Architectures –
Disadvantages
• Limited screen size
• Limited battery life
• Limited processor speed
• Limited and sometimes slow network
access
• Limited input: soft keyboard, phone
keypad, touch screen, or stylus
SAC 2015 © José Cecílio & Pedro Furtado
Nodes/Network programming can be: node centric or application centric.
52
Node/Network Programming
Programming every detail of processing and communication by hand
Middleware Approaches
MW approaches for parts of the systems
(e.g. WSN)
MW approaches for computer-based
distributed systems
MW approach for both WSN and computer-based distributed systems
Node centric Application centric
SAC 2015 © José Cecílio & Pedro Furtado
Node-centric approaches focus on development of a software for nodes (on a
per-node level).
Application-centric approaches focus on developing software for a part or all of
the network as one entity.
The application centric programming will require collaboration among different
nodes in the network for collection, dissemination, analysis and/or processing of
the generated and collected data.
53
Node/Network Programming
SAC 2015 © José Cecílio & Pedro Furtado
54
The TinyOS code
Interface
An nesC interface is defined as the following:
Clock.nc interface Clock { command result_t setRate(char interval, char scale); event result_t fire(); }
SAC 2015 © José Cecílio & Pedro Furtado
55
The TinyOS code
Module
A nesC module defines a lower-level component, which can be referred by a higher-
level one defined by a configuration. The syntax of a module is given as the
following:
module BlinkM { provides { interface StdControl; } uses { interface Clock; interface Leds; } }
The name for the interface for a timer
is Clock.
The name for the interface for an LED
is Leds.
The first part of the code states that this is a
module called BlinkM and declares the
interfaces which are prefaced by the keywords
provides and uses.
SAC 2015 © José Cecílio & Pedro Furtado
56
The TinyOS code
implementation { bool state; command result_t StdControl.init() { state = FALSE; return SUCCESS; } command result_t StdControl.start() { return call Clock.setRate(TOS_I1PS, TOS_S1PS); } command result_t StdControl.stop() { return call Clock.setRate(TOS_I0PS, TOS_S0PS); } event result_t Clock.fire() { state = !state; if (state) call Leds.redOn(); else call Leds.redOff(); return SUCCESS; } }
The Clock.fired() event is implemented. This is
necessary since BlinkM must implement any event
from an interface that it uses.
Each time Clock.fired() event is triggered, the
Leds.redOn() or Leds.redOff () is called to toggle the
red LED.
The start() command invokes Timer.start()
to create a repeat timer
(“TIMER_REPEAT”) that expires every
TOS_S1PS msec.
The init() command in the implemented
StdControl interface simply initializes the
flag state to FALSE.
SAC 2015 © José Cecílio & Pedro Furtado
57
The TinyOS code
Configuration
• A configuration wires components to one another via bi-directional interfaces.
• These wiring statements are most important, because they bring all
components defined elsewhere together to be an application.
• Each NesC application should have a configuration which is the top-level
component and specifies the starting point of its execution.
configuration Blink { } implementation { components Main, BlinkM, ClockC, LedsC; Main.StdControl -> BlinkM.StdControl; BlinkM.Clock -> ClockC; BlinkM.Leds -> LedsC; }
SAC 2015 © José Cecílio & Pedro Furtado
58
The Contiki code
#include "contiki.h"
PROCESS(sample_process, "My sample process");
AUTOSTART_PROCESSES(&sample_process);
PROCESS_THREAD(sample_process, ev, data) {
PROCESS_BEGIN();
while(1) {
PROCESS_WAIT_EVENT();
}
PROCESS_END();
}
Header files
Defines the name
of the process
contains the
process code
Threads must have
an end statement
Event parameter;
process can respond
to events
process can receive
data during an event
Defines the process will
be started every time
module is loaded
SAC 2015 © José Cecílio & Pedro Furtado
59
The Android App code
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class MyActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
…
}
@Override
public void onResume() {
super.onResume();
runMyCode();
}
@Override
public void onPause() {
super.onPause();
unregister_Callbacks();
}
}
Libraries APP name
Create all objects
associated with the
activity.
Load necessary modules
to the main memory
Called every time that the
APP is resumed
Execute our specific code
Called every time that the
APP is paused (send to
background. Other activity
is activated) Free used callback. This is
important to avoid memory
leaks
SAC 2015 © José Cecílio & Pedro Furtado
60
Android Application Lifecycle
Created
Started
Resumed
onCreate()
onStart()
onResume()
Paused
Stoped
Destroyed onPause()
onStop() onStart()
onStop()
SAC 2015 © José Cecílio & Pedro Furtado
MIDDLEWARE
- CONCEPTS AND APPROACHES -
61 SAC 2015 © José Cecílio & Pedro Furtado
Functional components of IoT
– middleware –
IoT Middleware
Interoperation
Man
agin
g
dat
a V
olu
me
Se
curity &
P
rivacy
Context Processing
Data S
torag
e &
kn
ow
led
ge
datab
ase
Features of Middleware
• Device Management
• Interoperation
• Platform Portability
• Context Awareness
• Security and Privacy
62 SAC 2015 © José Cecílio & Pedro Furtado
Functional components of IoT
– middleware –
Sensor
Sensor
Sensor
Sensor
…
Things
Interface protocols
Device Abstraction
Syntax & Semantics resolution
Central control, context
detection & Management
Application Abstraction
Context Processing
Private Knowledge data associated with corresponding devices/sensors
Knowledge data, rule engine associated with application
Remote control
Raw sensor data: • Periodic sensing • One time query
Internet
63 SAC 2015 © José Cecílio & Pedro Furtado
Functional components of IoT
– middleware –
Sensor
Sensor
Sensor
Sensor
…
Things
Interface protocols
Raw sensor data: • Periodic sensing • One time query
...
Interface protocols
• Wired
• USB, Ethernet
• Wireless
• ZigBee
• RFID
• IPv6
• 6lowpan
• Rime
• IEEE 802.15.4
• Bluetooth
• WiFi 64 SAC 2015 © José Cecílio & Pedro Furtado
Current IoT – middleware approaches
Middleware for IoT-based solutions
Middleware for WSN
Middleware for internet sharing
Middleware for WSN and Internet
Control and Sharing
Database abstractions
Mobile agents
Virtual machines
Application driven and
message-oriented
• GSN • Borealis • IrisNet • Hourglass • HiFi • SStreaMWare • Intelligent bridge • EdgeServers • ESP framework
• 6LoWPAN • SOAP • Lightweight web server and the Rest engine • sMAP • AutoWoT • MidSN • CoAP
• TinyDB • Cougar • SINA • DsWare
• Agilla • Impala • SensorWare • COMiS • Scatterweb • RUNES • MiSense • TeenyLIME • EMMON
• Maté • SwissQM • Squawk
• Mires • ATaG • TinySOA • USEME • MiLAN
65 SAC 2015 © José Cecílio & Pedro Furtado
José Cecílio, Pedro Furtado: Wireless Sensors in Heterogeneous Networked Systems: Configuration and Operation Middleware. Computer Communications and Networks, Springer 2014, ISBN 978-3-319-09279-9, pp. 1-143.
High level abstraction
• Data centric programming
• Interact with sensor network as a
whole
• Extensible framework
Under the hood:
• Intelligent query processing: query
optimization, power efficient execution
• Fault mitigation: automatically
introduce redundancy, avoid problem
areas
66
TinyDB
SELECT nodeid, light FROM sensors WHERE light > 400 SAMPLE PERIOD 1s
Query Data
TinyDB
sensor network
SAC 2015 © José Cecílio & Pedro Furtado
S. R. Madden, M. J. Franklin, J. M. Hellerstein, and W. Hong, “TinyDB: an acquisitional query processing system for sensor networks,” in ACM Transactions on Database Systems, 2005, vol. 30, no. 1, pp. 122–173.
Declarative queries
• Simple, SQL-like queries
• Users specify the data they want and the rate at which data should be refreshed
• Using predicates, not specific addresses
TinyDB collects data from motes in the environment, filters it, aggregates it, and
routes it out to a PC
TinyDB does this with power-efficient in-network processing algorithms
67
TinyDB
SAC 2015 © José Cecílio & Pedro Furtado
68
TinyDB
– Examples of Node Querying –
”Find the rooms on floor 6 where the average volume is over some threshold (assuming each room can have multiple sensors). Do this every 30 seconds.”
SELECT room, AVG(volume) FROM sensors WHERE floor = 6 GROUP BY room HAVING AVG(volume) > threshold SAMPLE PERIOD 30 s
”Signal the event hot whenever the temperature goes above some threshold. Read the temperature every 10 seconds.” SELECT nodeid, temp FROM sensors WHERE temp > threshold OUTPUT ACTION SIGNAL hot(nodeid, temp) SAMPLE PERIOD 10 s
SAC 2015 © José Cecílio & Pedro Furtado
MidSN defines a node and remote
configuration components
Designed to run over heterogeneous
distributed platforms
Defines homogeneous APIs and
formats
Developed only once for each
operating-system
69
MidSN
Network 1 (e.g. wired)
Config. UI Client Applications
Network 2 (e.g. WSN) Gateway
MidSN-P/S Catalog
MidSN-NC
MidSN-RConfig
Operating System
Drivers
Pe
rf. D
eb
ug
gin
g
MidSN-NC
Operating System
Drivers P
erf.
De
bu
gg
ing
MidSN-NC
Operating System
Drivers
Pe
rf. D
eb
ug
gin
g
Pe
rf M
on
itor
API
SAC 2015 © José Cecílio & Pedro Furtado
José Cecílio, Pedro Furtado: Architecture for Uniform (Re)Configuration and Processing Over Embedded Sensor and Actuator Networks. IEEE Trans. Industrial Informatics 10(1): 53-60 (2014).
70
MidSN
Operating System
MidSN
FileSystem Comm. Acquisition/ Actuation
Timers Mem. alloc
MidSN is supported by drivers which allows
running it over different hardware and software.
API API API API API
Each API includes a set of methods used
by the MidSN.
The programmer needs to develop each API
according to the MidSN specifications
How to achieve platform independence with MidSN
SAC 2015 © José Cecílio & Pedro Furtado
71
MidSN
How to support different communication protocols and its operability
MidSN Translator gateway
MidSN Rime
MidSN IP
TCP/IP Embedded device communication protocol
Gateway
MidSN Translator gateway
MidSN uIP-IPv6
MidSN IP
Gateway
WSN nodes
Catalog
<MidSN_Catalog>
<Gateway>
<id> net1 </id>
<ip_Address>10.3.3.82
<iIP_address>10.3.3.82
<iIP_port>5000
<iWSN_protocol>Rime
<iWSN_address>0x0000
<iWSN_port> 5000
<iWSN_channel>20
<node>
<id> 1.1
<ip_Address> 10.3.3.101
<protocol_address> 0x0001
(…)
SAC 2015 © José Cecílio & Pedro Furtado
72
MidSN
– Examples of Node Configuring –
” Web-service API methods called to start a sensor collection operation in nodes 1.1, 1.2, 1.3 with 3 seconds of acquisition and sending rates.”
MIDSN.Operation.create( [1.1, 1.2, 1.3] , “pressureStream”, 3s, 3s, 1, {(PRESSURE, VALUE)}, {ControlStation, PS} ); ” Create a filter over the pressure values”
MIDSN.Filter.create([1.1, 1.2, 1.3], “Pressure_NoNoise”, “pressureStream”, CONDITION ((PRESSURE, VALUE), <, (VALUE, 6)) );
SAC 2015 © José Cecílio & Pedro Furtado
CoAP is a transfer protocol for constrained nodes and networks.
CoAP uses the Representational State Transfer (REST) architecture.
• REST make information available as resources that are identified by URIs.
• Applications communication by exchanging representation of these resources
using a transfer protocol such as HTTP.
• Clients access servicer controlled resources using synchronous
request/response mechanisms.
- Such as GET, PUT, POST and DELETE.
• CoAP uses UDP instead of TCP and has a simple “message layer” for re-
transmitting lost packets.
73
Constrained Application Protocol
– CoAP –
SAC 2015 © José Cecílio & Pedro Furtado
Z. Shelby, C. Bormann, and B. Frank, “Constrained Application Protocol (CoAP),” in An online version is available at httpwww ietf orgiddraftietfcorecoap01 txt 0807 2010, 2011, vol. 07, no. draft-ietf-core-coap-07.txt, pp. 1–81.
74
Constrained Application Protocol
– CoAP –
Client/Node
GET/temperature,
Room A
Server/Node
200 OK
Txt/plain
17, Celsius
SAC 2015 © José Cecílio & Pedro Furtado
IOT & HEALTHCARE SYSTEMS
75 SAC 2015 © José Cecílio & Pedro Furtado
Healthcare Landscape is
Changing
Obesity is growing
Poor diet
Sedentary lifestyle
76
Massive growth market for new systems which
improve productivity, cut
costs and support the shift
of healthcare from hospital to
the home
SAC 2015 © José Cecílio & Pedro Furtado
Healthcare IoT Architecture Diagram
77
IoT healthcare services allow patients to
access health support and education
It creates a virtual medical community
for providers
• Personalized medical services
• Education materials and coaching
• Online discussions and support
• Provider trainings and continuing
medical education
SAC 2015 © José Cecílio & Pedro Furtado
Introduction
• The patient can stay longer and safer at home
• Smart devices can alarm in case of critical conditions
• Provides constant monitoring
• The patient can be relieved from the hassle of routine
checks
• Diminishes costly travels and reduces patient stress
• Implantable wireless devices to store health records
could save a patient's life in emergency situations.
IoT impact in Healthcare
78 SAC 2015 © José Cecílio & Pedro Furtado
Healthcare Landscape is
Changing
79 SAC 2015 © José Cecílio & Pedro Furtado
Healthcare Landscape
– Monitor Personal Stress Levels –
Mobile health hart –Just in time therapy
Changes in heart rate variability
Recalibrates by sensing and tracking usage of mobile therapies
Contextual sensing (location, calendar integration) and 24h
sampling
Personalized therapies
80 SAC 2015 © José Cecílio & Pedro Furtado
81
Healthcare Landscape
– The Preventive Healthcare & Continuous
Multiparameter Monitoring –
SAC 2015 © José Cecílio & Pedro Furtado
82
Healthcare Landscape
– IOT to Monitor and Develop Therapies –
Ubiquitous multiparameter monitoring can provide high quality information
SAC 2015 © José Cecílio & Pedro Furtado
83
Healthcare Landscape
– Improving the products delivered to the Patient –
One size fits all is not the most effective strategy
Personalized drug development trough personalized information
SAC 2015 © José Cecílio & Pedro Furtado
Benefits of IoT in the Healthcare
Increased access to healthcare services
Enhanced access to specialists
Improved quality of care
Reduced hospitalizations and emergency visits
Cost-effective method of service delivery
Patient and provider satisfaction
84 SAC 2015 © José Cecílio & Pedro Furtado
TAKING IMAGING INTO THE THERAPEUTIC DOMAIN: SELF-REGULATION OF BRAIN SYSTEMS FOR MENTAL
DISORDERS 85
BrainTrain project
SAC 2015 © José Cecílio & Pedro Furtado
BrainTrain
86
Use functional Magnetic
Resonance Imaging (fMRI)
to determine the most
indicated areas to rehabilitate
Create an EEG NF protocol
based on the areas identified
on fMRI
Apply this protocol in NF games, which might be used by associations or individuals
Envisioning real life transfer
SAC 2015 © José Cecílio & Pedro Furtado
Project home page: http://www.braintrainproject.eu/
BrainTrain
87
DB
Private Network
Reports
Data processing
Data Mining
Data Storage Report
generation
Data Acquisition
Data Processing and feedback computations
Communication with server for data
logging
Local/patient room Remote room
• Controlled environment (no external interferences)
• High number of electrodes (mapping several brain areas)
• High data sampling (high resolution)
• Wired communication between electrodes and computer system
(signal amplifier, processing unit, …)
• Just supports local games (single player)
SAC 2015 © José Cecílio & Pedro Furtado
88
Pediatric Hospital
– laboratory –
89
Video Capture
Capture postures and body movements
Virtual reality visual stimulation (2D or 3D)
Projection system using virtual reality helmets
Sound stimulation (5.1 surround sound system)
System capture of eye movements
Mobile system for electroencephalography (EEG)
SAC 2015 © José Cecílio & Pedro Furtado
90
Training Game
SAC 2015 © José Cecílio & Pedro Furtado
BrainTrain & IoT
91
DB
Network
Reports
Data processing
Data Mining
Data Storage Report
generation
Data Acquisition
Communication with server
Patient environment
Healthcare center/cluster
Local data (pre)processing
LAN WAN
Wired IP Wireless WIFI Bluetooth Zigbee/uIP
Data Processing and Feedback
Patient Feedback interface
Computer
Tablet
Smartphone
TV (IPTV)
Game interactions Personal reports (scores) Rehabilitation/training plan
SAC 2015 © José Cecílio & Pedro Furtado
BrainTrain & IoT
92
This house is equipped with: • Cameras • Motion sensors • Gas Sensors • Door sensors • Water flow sensors • Temperature sensors • Light sensors
In order to provide independency and safe living of patients, all information is
processed in real-time.
SAC 2015 © José Cecílio & Pedro Furtado
93
BrainTrain & IoT
SAC 2015 © José Cecílio & Pedro Furtado
DAILY ASSISTANT FOR PEOPLE WITH DEMENTIA AND ALZHEIMER´S DISEASE
94
AidMe project
SAC 2015 © José Cecílio & Pedro Furtado
AidMe
95
The population of Europe is aging quickly.
The increasing of the age originates problems related with autonomy
and capabilities to do specific daily activities, originating diseases like
Alzheimer or dementia.
Assistive technologies can improve the quality-of-life of these persons
Can be used, for instance, to “follow” a person and help him/her to
return to home or/and to remember he/she to take the right medication
at a right schedule).
SAC 2015 © José Cecílio & Pedro Furtado
AidMe
96
Caregivers manage the
information sent to the patients
• Reminder Messages
• Medication Plans/Alerts
• Clocks and Calendars
• Locator of Things
• Aids for Reminiscence and
Leisure
Talk with patients and/or track
them when they perform outdoor
activities.
SAC 2015 © José Cecílio & Pedro Furtado
DIGITAL BOOK OF EXERCISES FOR FIRST SCHOLAR LEVEL FOR CHILDREN WITH CEREBRAL PALSY
97
HelpMeLearning
SAC 2015 © José Cecílio & Pedro Furtado
HelpMeLearning
98
Cerebral palsy is a disorder that affects muscle tone, movement, and motor
skills (the ability to move in a coordinated and purposeful way).
It is usually caused by brain damage that occurs before or during a child's
birth, or during the first 3 to 5 years of a child's life.
Other health issues may also be related with Cerebral palsy, including vision,
hearing, speech problems, and learning disabilities.
There is no cure, but treatment, therapy, special equipment, and, in some
cases, surgery can help a child who is living with the condition.
SAC 2015 © José Cecílio & Pedro Furtado
HelpMeLearning
99
Platform where teachers define
the exercises for children with
Cerebral Palsy and share it with
other teachers and/or parents
Collaborative platform
Material organized by modules
and themes
Delivered by Android equipment
Internet
SAC 2015 © José Cecílio & Pedro Furtado
HelpMeLearning
100 SAC 2015 © José Cecílio & Pedro Furtado
INFORMATION AND NAVIGATION SYSTEM FOR BLIND PEOPLE
101
Karen Duarte José Cecílio Pedro Furtado
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
Motivation
Useful information is commonly delivered by visual means
Even emengency signals and warnings
102 SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
Motivation
Blind persons are deprived of a strong and important information channel
Information Navigation Orientation
Availability News
Changes
103 SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
IOP & Blind People
Information on the Cloud
Location and Local Network
User Layer • Smartphone • Interface Configuration
104
Internet of People
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
IOP & Blind People
105
Information on the Cloud • maps, signs, warnings • shopping information,
promotions
Location and Local Network User Layer
• Smartphone • Interface Configuration
Internet of People
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
IOP & Blind People
106
Information on the Cloud
Location and Local Network • Beacon-based location • Wi-Fi, BT, wireless technologies
User Layer
• Smartphone • Interface Configuration
Internet of People
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
IOP & Blind People
107
Information on the Cloud Location and Local Network
User Layer
• Smartphone Intuitive interface (touch/voice) Location and route planning
• Interface Configuration Easy Remote Adaptative
Internet of People
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
IOP & Blind People
Internet of People
108
Information on the Cloud • maps, signs, warnings • shopping information,
promotions
Location and Local Network • Beacon-based location • Wi-Fi, BT, wireless technologies
User Layer • Smartphone
Intuitive interface (touch/voice) Location and route planning
• Interface Configuration Personal and Remote Adaptative
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
Practical case
109
Shopping Center
• More than 70 stores • Around 20 beacons • 9 different enclosing
categories and 33 subcategories
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
Practical case
110
Shopping Center
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
Practical case
111
Shopping Center
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
112
SmartGuia
Modular Architecture
Handle Building Layouts
Foresee Environmental
Dynamism
Capable of Using Existing
Tecnologies
Handle Positioning
Minimize User Interactions
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
113
SmartGuia
Modular Architecture
Handle Building Layouts
Foresee Environmental
Dynamism
Capable of Using Existing
Tecnologies
Handle Positioning
Voice Interface Option Explore Semantics User-Friendly Mechanisms
Minimize User Interactions
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
114
SmartGuia
Modular Architecture
Handle Building Layouts
Foresee Environmental
Dynamism
Capable of Using Existing
Tecnologies
Minimize User Interactions
Deal with Uncertainty Issues ( e.g. RSSI, beacons off)
Handle Positioning
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
115
SmartGuia
Modular Architecture
Foresee Environmental
Dynamism
Capable of Using Existing
Tecnologies
Handle Positioning
Minimize User Interactions
Correlation between position found and building layout
Handle Building Layouts
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
116
SmartGuia
Modular Architecture
Handle Building Layouts
Capable of Using Existing
Tecnologies
Handle Positioning
Minimize User Interactions
E.g. different beacons while walking, walls, people, Reflections, etc
Foresee Environmental
Dynamism
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
117
SmartGuia
Modular Architecture
Handle Building Layouts
Foresee Environmental
Dynamism
Handle Positioning
Minimize User Interactions
Existing networks on the building (e.g. Wi-Fi, BT), mixing technologies
Capable of Using Existing
Tecnologies
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
118
SmartGuia
Handle Building Layouts
Foresee Environmental
Dynamism
Capable of Using Existing
Tecnologies
Handle Positioning
Minimize User Interactions
Enabling to easily modify each module according to deployment requirements
Modular Architecture
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
119
SmartGuia
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
120
SmartGuia
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
121
SmartGuia
Environment Scan
Fingerprinting
Proximity beacons
Shopping layout conditions
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
122
SmartGuia
Calculate Shortest Path
Dijkstra’s Algorithm
Generate Route Instructions
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
123
SmartGuia
Identification of Beacons
Read Beacons Ids
Measure Beacons RSSI
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
124
SmartGuia
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
125
SmartGuia
Identify User Destination
Provide Information about available
Points of Interest
Exploring Semantics
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
126
SmartGuia
10 POI’s
3 categories
2 subcategories
User Keyword
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
127
SmartGuia
10 POI’s
3 categories
2 subcategories
User Keyword
2 subcategories
4 POI’s
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
128
SmartGuia
User Interaction
Speech Synthesis
Voice Recognition
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
129
SmartGuia
Google Talkback
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
130
SmartGuia
Live demo of SMARTGUIA
SAC 2015 © Karen Duarte, José Cecílio & Pedro Furtado
MIDDLEWARE AND HEALTHCARE APPS FOR
INTERNET-OF-THINGS (IOT)
The 30th ACM/SIGAPP Symposium On Applied Computing (SAC 2015) Tutorial
Project supported by: FCT - Grant SFRH/BPD/96749/2013
José Cecílio
https://eden.dei.uc.pt/~jcecilio/
131
Pedro Furtado
https://eden.dei.uc.pt/~pnf/
Karen Duarte