Context
PHILIPPE LALANDA
KOBE UNIVERSITY – AUGUST 2017

Pervasive computing
Pervasive computing promotes the integration of smart,
networked devices in our living environments in order toprovide us services.

Those services
are context aware
require minimal and natural interaction
bring real added value
are easy to administrate by end-users

Philippe Lalanda - 20172

Purpose of this lecture
Our goal is to:- define the notion of context in pervasive computing- define the notion of context-aware applications- show how to structure and build a context- develop different modeling techniques

Philippe Lalanda - 20173

AgendaExampleDefinitions
Global architecture
Context building
Challenges and conclusion

Philippe Lalanda - 20174

Example: “Keeping in touch”

Management of communication means with your family
and friends• Phone calls• Messages• Photos• Coordinating activities• Being aware of activities of friends and family

Philippe Lalanda - 2017

Problems with Keeping in Touch
Irrelevant messages• Vacation mail, junk email
Interruptions• During meetings, movies, dinner, driving
Lack of awareness on callee side• Phone tag, time zone issue (oops!)
Information overload• Can make it hard to find useful messages
The goal is to provide the right call/message at the righttime and under the right form
Philippe Lalanda - 2017

5 Design Considerations
1. Improving relevance
2. Minimizing disruption
3. Improving awareness
4. Reducing overload
5. Selecting channels

Philippe Lalanda - 2017

5 Design Considerations
1. Improving relevance

Deciding when a communication is relevant to theperson’s current (or near future) situation.
• For example, getting notification about an email
from your travel agent regarding itinerary changes
while packing to leave for the airport.
2. Minimizing disruption•

3. Improving awareness
4. Reducing overload
5. Selecting channels

Philippe Lalanda - 2017

5 Design Considerations
1. Improving relevance
2. Minimizing disruption
Deciding when and how to notify people that they
have a communication.
• For example, your phone should vibrate and not ring,when you are at the symphony (unless it is trulyurgent).
3. Improving awareness•

4. Reducing overload
5. Selecting channels

Philippe Lalanda - 2017

5 Design Considerations
1. Improving relevance
2. Minimizing disruption
3. Improving awareness
Deciding what information and mechanisms canhelp people make intelligent communication
decisions.
• For example, the caller should be told you are at themovies before the call goes through.
4. Reducing overload•

5. Selecting channels

Philippe Lalanda - 201710

5 Design Considerations
1. Improving relevance
2. Minimizing disruption
3. Improving awareness
4. Reducing overload
Deciding how to reduce the number of communications
that don’t apply given your context.
• For example, filtering out emails about going to lunchwhen you are away from the office (or already at lunch).
5. Selecting channels•

Philippe Lalanda - 201711

5 Design Considerations
1. Improving relevance
2. Minimizing disruption
3. Improving awareness
4. Reducing overload
5. Selecting channels••

Deciding which communication device should be used
to get in touch with somebody.
For example, routing calls to your home phone instead ofyour cell phone when you are at home and cellular
reception is poor.

Philippe Lalanda - 201712

To do so...
The “Keeping-In-Touch” application has to be aware of its contextof execution
Then, it must adapt its behavior in order to provide the expected
serviceThis is the essence of pervasive computing, but rather hard toachieve

Philippe Lalanda - 201713

AgendaExampleDefinitions
Global architecture
Context building
Challenges and conclusion

Philippe Lalanda - 201714

Context definition
Dey, 2001

Any information that can be used to characterize thesituation of entities (i.e., whether a person, place or object)that are considered relevant to the interaction between auser and an application, including the user and theapplication themselves
Application

PhilippeLalanda
Lalanda- 2017Philippe15

Examples

User identity

Spatial information (location, orientation, speed, acceleration)
Temporal information (time, date, season)

Environmental information (temperature, air quality, light, noise)Social situation (who you are, who you are with, people nearby)
Resources that are nearby (accessible devices, networks, hosts)
Availability of resources (battery, display, network, bandwidth)

Physiological measurements (blood pressure, heart rate, respiration
rate, muscle activity, tone of voice)
Activity (talking, reading, walking, running, sleeping)Schedules and agenda

Philippe Lalanda - 201716

Classification
Computing context
Application itself, network connectivity, communication
bandwidth, nearby resources like printers, display, etc.
User context
People nearby, user’s profile, location, emotional state,,
current activity
Physical context
Objects, locations,temperature, etc.

Philippe Lalanda - 2017

lighting,noise,traffic,conditions,Primary versus secondary context
Primary context (low level information)
Any information retrieved without using existing context andwithout performing any kind of sensor data fusion operations(e.g. GPS sensor readings as location information)
Secondary context (High level information)
Any information that can be computed using primarycontext. The secondary context can be computed by usingsensor data fusion operations or data retrieval operations
such as web service calls

Philippe Lalanda - 201718

Example: activity
The activity of a person belongs to secondary context• Computed from multiple sensors values• Use of probabilistic models (Markov)

Philippe Lalanda - 201719

Context-aware application
Abowd, 2009
A system is context-aware if it uses context to provide
relevant information and/or services to the user, whererelevancy depends on the user’s task
ExampleSmart phones screen goes brighter when exposed to light(using photo sensors) and goes dimmer on low battery.

Application
Uses
Context source
Philippe Lalanda - 201720

Context-aware application - implication
Context-aware applications adapt according to the context inorder to provide better services
Delivering the right service at the right moment

Adaptation loop
Application

Context source

Philippe Lalanda - 201721

Level of context-awareness
Personalization
It allows the users to set their preferences and expectation.
For example, users may set the preferred temperature so theheating system can maintain the specified temperature.
Passive context-awarenessThe system monitors the environment and offers theappropriate options to the users so they can take actions.
For example, when a user enters a super market, the mobile
phone alerts the user with a list of discounted products.
Active context-awarenessThe system monitors the situation and acts autonomously. For
example, if the smoke detectors and temperature sensors
detect a fire, the fire brigade is called by the system.
Philippe Lalanda - 201722Context modelHenricksen, 1999A context model identifies a concrete subset of the context
that is realistically attainable from sensors, applications andusers and able to be exploited in the execution of the task.
The context model that is employed by a given contextaware application is usually explicitly specified by theapplication developer, but may evolve over time”

HappymoodJohn

location

activity
Philippe Lalanda - 2017

KitchenDrinking

beverage

Tea
23Context attribute
Henricksen, 1999
A context attribute is an element of the context model
describing the context. A context attribute has an identifier,a type and a value, and optionally a collection of properties
describing specific characteristics

Tea

Philippe Lalanda - 2017

GreenJapanese
Very hot24

Context quality
A number of definitions and parameters that have been
proposed.
Important parameters• data validity• context data precision• context data up-to-dateness (freshness)
The context quality depends on the quality of the physicalsensors, and quality of the delivery process

Philippe Lalanda - 201725

Synthesis
Context is a major source of information for pervasive applications
It enables to manage the vast amount of information thatsurrounds the userIt allows to discriminate what is important and what is not
It helps us to adapt to our surroundings
But context
is imperfect
has temporal dimensions
is hard to capture, represent and manage

Philippe Lalanda - 201726

AgendaExampleDefinitions
Global architecture
Context building
Challenges and conclusion

Philippe Lalanda - 201727

Getting contextual information - 1
Directly from sensors• Context is directly acquired from the sensor• Software drivers and libraries need to be installed locally• This method is typically used to retrieve data from sensors
attached locally
ApplicationPhilippe Lalanda - 201728

Benefits and limits
Efficient as it allows directcommunication with the sensors
Have more control over sensor
configuration and data retrieval
process

Significant technical knowledge isrequired about devices internals andtheir configuration
Significant amount of time, effort,
cost involved

Updating is very difficult due to tightbound between sensor and application

Can be used for small scale scientific experiments. Can also be used
for situation where limited number of sensors are involved.
Philippe Lalanda - 201729

Getting contextual information - 2
With a middleware• sensor data is acquired by middleware solutions.
• The applications retrieve sensor data from the middleware andnot from the sensor hardware directly

Ex: publish-based

Application

Middleware

Philippe Lalanda - 201730

Benefits and limits
Easy to manage and retrieve
context as most managementtasks are facilitated by themiddleware.

Can retrieve data faster with lesseffort and technical knowledge

Require more resources (processing,memory, storage) as middleware
solutions need to be employedLess control over sensor configuration

Moderately efficient as data need to beretrieve through middleware

Pervasive application will use this methods in most cases. Can beused in situations where large number of heterogeneous sensors areinvolved (on local network).
Philippe Lalanda - 201731

Getting contextual information - 3
With a context server• Specific module in charge of acquiring context, from several
sources• Provides an API to access contextual information• Can be distributed (if resources are scare for instance)
Application

WebService

Philippe Lalanda - 2017

Context Server32Benefits and limits
Less resources required

Can retrieve data faster with lesseffort and technical knowledge

No control over sensor configuration

Less efficient as the context need to bepulled from server over the network

Can be used in situations where significant amount of context are
required but have only limited resources (i.e. cannot employ context
middleware solutions due to resource limitations) that allows run theconsumer application.
Philippe Lalanda - 201733

Frameworks

Principles related to context management frameworks
Supporting technology
Application programming interface (API)Event management
Extensibility
Scalability
optimization

Philippe Lalanda - 2017

AgendaContext and context-awarenessExample
Global architecture
Context building
structureacquisition
modeling
Challenges and conclusion
Philippe Lalanda - 201735

Building context-aware applications

Regardless of the global architecture, building a context
requires to•••••Acquire the necessary data
Model and abstract the captured information
Possibly, reason about the information
Make the modeled information available to application(it is then the task of applications to adapt themselves)

Philippe Lalanda - 201736

Layered approach

Acquisition

Philippe Lalanda - 2017

• Acquisition• Single/Double way• Synchronization

37

Layered approachRepresentation• Model• Storage• HistoricAcquisition
Philippe Lalanda - 201738

Layered approach

Processing• Aggregation• Mediation• Inference• Enrichment

Representation

Acquisition
Philippe Lalanda - 201739

Layered approach
Access• Query• APIs• Event

Processing

Representation

Acquisition
Philippe Lalanda - 201740

AgendaContext and context-awareness
ExampleGlobal architecture
Context building
structureacquisition
modeling
Challenges and conclusion
Philippe Lalanda - 201741

Context acquisition: responsibility
Pull

The software component which is responsible for acquiringsensor data from sensors make a request (e.g. query) from thesensor hardware periodically (i.e. after certain intervals) or
instantly to acquire data
Push
The physical or virtual sensor pushes data to the software
component which is responsible to acquiring sensor data
periodically or instantly. Periodical or instant pushing can be
employed to facilitate a publish and subscribe model

Philippe Lalanda - 201742

Context acquisition: frequency
Instant (threshold violation)

These events occur instantly. The events do not span acrosscertain amounts of time. Open a door, switch on a light, oranimal enters experimental crop field are some types of instantevents. In order to detect this type of event, sensor data needs
to be acquired when the event occurs. Both push and pullmethods can be employed.
Interval
These events span a certain period of time. Raining, animal
eating a plant, or winter are some interval events. In order todetect this type of event, sensor data needs to be acquired
periodically (e.g. sense and send data to the software every 20
seconds). Both push and pull methods can be employed.
Philippe Lalanda - 201743

Context acquisition: process
Sense

The data is sensed through sensors, including the sensed datastored in databases
Derive
The information is generated by performing computational
operations on sensor data. These operations could be as simple
as web service calls or as complex as mathematical functions
run over sensed data (e.g. calculate distance between twosensors using GPS coordinates)
Manually provided
Users provide context information manually via predefined settings
options such as preferences (e.g. understand that user doesn’t liketo receive event notifications between 10pm to 6.00am).
Philippe Lalanda - 201744

AgendaContext and context-awareness
ExampleGlobal architecture
Context building
structureacquisition
modeling

Challenges and conclusion
Philippe Lalanda - 201745

Context modeling

Extensive research and proposals on that topic
Let us examine the us ofKey value
MarkupObjects (programming)
Databases (relational)
Logic
Ontologies
Entity/relation

Philippe Lalanda - 201746

Key-value based context
Contextual information is sent to applications through lists of keyvalue pair
• new list is sent when information is updated or when new information iscaptured (mobility)• Applications provide means to receive the information and interpret itAppAppApp((type printer) (color yes)...)

Context

Philippe Lalanda - 201747

Key-value - Benefits and limits
SimpleStrongly coupled with application

Easy to manage when small
applications

Not structured (no schema)

Flexible

Not scalable

Hard to retrieve information

No way to represent relationships

Can be used to model limited amount of data such as user
preferences and application configurations. Mostly independentand non-related pieces of information.
This is also suitable for limited data transfer and any other lesscomplex temporary modeling requirements.
Philippe Lalanda - 201748

Markup-based context
Contextual information is sent to applications through XML files (withkeywords and nested lists)• new file is sent when new or updated information• Applications provide means to receive the information and interpret it
App

AppApp((type printer)(features (color yes)(size A4) ...))

Context

Philippe Lalanda - 201749

Markup - Benefits and limits
FlexibleStrongly coupled with application

Validation possible (schemas)

Can be complex when many levels ofinformation are involved

More structuredTools available

Not scalable

Information retrieval not always easy

Can be used as intermediate data organization format as well as
mode of data transfer over network. .
Can be used to decouple data structures used by twocomponents in a system.
Philippe Lalanda - 201750

Object-based context
Contextual information is provided through object-oriented APIs
• Applications have to get the information• Events can be sent when something changes (can be complex)
App

Philippe Lalanda - 2017

AppApp51

Objects - Benefits and limits
Allow relationships modelingCan be well integrated withprogramming languages
Tools available

Hard to retrieve information

No standards but govern by designprinciple

Can be used to represent context in programming code level.
Allows context runtime manipulation. Very short term, andmostly stored in computer memory.

Philippe Lalanda - 201752

Database context
Contextual information is provided through request server• Applications have to get the information (with SQL in general)• Events can be sent when something changes (extremely complex)
App

Philippe Lalanda - 2017

AppApp

abc

abc

abc

abc

xyz
abc

xyz
abcxyz
abc

xyz
abc

abc

abc

xyzabcxyz
abcabcxyzabc

53

Database - Benefits and limits
Allow relationships modeling

Querying can be complex

Different standards (for datarepresentation) available

No standards but govern by designprinciple

Based on universal APIs

Processing tools available

Configuration may be required

Can be used for long-term and large volume of permanent data.
Historic context can be used in database context.

Philippe Lalanda - 201754

Logic-based context
Contextual information is provided as facts (and sentences)• Applications have to get the information• Events can be sent when something changes (complex)
AppAppApp(A, B, C)

Philippe Lalanda - 201755

Logic- Benefits and limits
Allow to generate knowledge

Strongly coupled with applications

Processing tools available

Hard to use

Support logical reasoning

No standard

Can be used to generate high level context using low level
context, model events and actions.

Philippe Lalanda - 201756

Ontology-based context
Contextual information is provided as a semantic graph• Applications have to get the information• Events can be sent when something changes (complex)
App

Philippe Lalanda - 2017

AppApp57

Ontology - Benefits and limits
Support semantic reasoning

Representation can be complex

Application independent

Reasoning can be long

Allow expressive representationof context
Strong support by standards
Sophisticated tools available

Information retrieval can be complex
and resource intensive

Can be used to model domain knowledge and structure context
based on the relationships defined by the ontology. Rather thanstoring data on ontologies (slow and hard to access), data can be
stored in appropriate data sources (databases) while structure
is provided by ontologies.

Philippe Lalanda - 201758Agenda
ExampleDefinitions
Global architecture
Context building
Challenges and conclusion

Philippe Lalanda - 201759

Conclusion
Different definitions of context available, but a common (intuitive)
understanding
Important aspects
Identity and location
Activity
Time

Available resources

Different ways to represent context

Philippe Lalanda - 201760

Multiple contexts
Application1

Application2

Cloud infrastructure

Gateway

Smart device

Philippe Lalanda - 201761

Main goal

Build the context for the the application

Philippe Lalanda - 201762