SenSocial is a middleware proposed to simplify the implementation of applications that integrate online social network (OSN) and mobile sensor data streams. It uses a publish-subscribe interaction model to allow applications to subscribe to different data streams. This reduces programming effort and lines of code compared to not using SenSocial. Two prototype applications demonstrated reduced lines of code by 9 and 24 times when using SenSocial. The paper argues that integrating OSNs and sensor data can provide richer contextual information and SenSocial is presented as a solution to simplify building such ubiquitous computing applications.
Human Factors of XR: Using Human Factors to Design XR Systems
SenSocial Middleware Integrates Social & Sensor Data
1. SenSocial: A Middleware for Integrating
Online Social Networks and Mobile Sensing
Data Streams
Abhinav Mehrotra, Veljko Pejovic, Mirco Musolesi
School of Computer Science
University of Birmingham
3. Context-aware Systems
Richer
Contextual
Information
App 1
Real Time
Integration
How to integrate?
Integration
App 2
3
4. Application Scenarios
Sensor Data
Social Links
Sensor Data
Notification
Online Social
Network
Internet
Server
Notification
Notice of
friend’s arrival
to Paris
Sensor Data
4
5. Application Scenarios
Facebook’s emotional contagion
experiment, Kramer et al. (2014)
EmotionSense, Rachuri et al.
(2010)
5
How these can be improved ?
9. Publish-Subscribe
Interaction Paradigm
Subscription Types
- Topic-based (e.g., get user’s
location).
- Content-based (e.g., get
user’s location when the user
posts about football on his/her
Facebook wall).
Application
onDataSensed()
Subscribe
subscribe()
Context
Data
SenSocial
9
10. Streams
Types of Stream
• Continuous (e.g., get user’s location when the user is not
moving).
• Social event-based (e.g., get user’s location when the user
performs an action on Facebook).
10
11. Stream Filters
Data Streams
Conditions
A condition comprises of a modality, a comparison operator, and a
value.
Example: get location only when a user is not moving.
Condition c = new Condition(ModalityType.physical_activity,
Operator.equals, ModalityValue.still);
Refined Information
11
12. Stream Aggregator
• It wraps multiple streams received by the server into a single
aggregated stream.
• Data from individual streams is multiplexed to the same join stream.
• It works similarly to a normal stream.
12
13. Multicast Stream
Multicast
• It creates duplicate streams on multiple clients.
• Clients are selected based on the OSN connectivity and geographic
location of the users.
OSN Connectivity Geographic Location 13
14. Other Features
Remote Stream Management
Streams can be created, modified, or destroyed remotely on the
mobile clients.
Privacy Control
By specifying the allowed data type (context modality) and the level
of granularity (raw or classified).
14
16. Evaluation
CPU consumption with varying number streams
Average battery consumption with varying number of OSN actions
OSN actions 1 2 3 4 5 6 7
Charge consumed [μAH] 51.7 97.1 142.5 187.8 233.2 278.5 324.3
Note: the above OSN actions occurred within 20 minute time period and
each triggered remote sampling of all five supported sensor modalities.
16
19. Facebook Sensor Map: Code Snippet
/*----------- Create streams----------------*/
SenSocialManager manager = SenSocialManager.getSenSocialManager(getApplicationContext());
String uid = manager.getUserId();
User user = manager.getUser(uid);
Stream s1 = user.getDevice().getStream(SensorUtils.Sensor_Type_Accelerometer, "classified");
Stream s2 = user.getDevice().getStream(SensorUtils.Sensor_Type_Microphone, "classified");
Stream s3 = user.getDevice().getStream(SensorUtils.Sensor_Type_Location, "raw");
/*----------- Create list of filter condition(s) ----------------*/
ArrayList<Condition> conditions = new ArrayList<Condition>();
Condition c = new Condition(ModalityType.facebook_activity, Operator.equals, ModalityValue.active);
conditions.add(c);
/*----------- Add condition list to the filter -----------*/
Filter filter = new Filter(conditions);
/*----------- Set filter to the streams -----------*/
s1 = s1.setFilter(filter);
s2 = s2.setFilter(filter);
s3 = s3.setFilter(filter);
/*----------- Register streams -----------*/
manager.registerListener(this, stream1.getId());
manager.registerListener(this, stream2.getId());
manager.registerListener(this, stream3.getId());
/*----------- Start streams -----------*/
stream1.start();
stream2.start();
stream3.start(); 19
20. Programming Effort Evaluation
Facebook Sensor Map : lines of code reduced by nine times (from 3423
to 316).
ConWeb : lines of code reduced by twenty four times (from 3223 to 130).
Application Name Number of files Lines of code
Facebook Sensor Map (M) (with SenSocial) 8 103
Facebook Sensor Map (S) (with SenSocial) 2 213
Facebook Sensor Map (M) (without SenSocial) 68 2419
Facebook Sensor Map (S) (without SenSocial) 42 1004
ConWeb (M) (with SenSocial) 3 23
ConWeb (S) (with SenSocial) 1 107
ConWeb (M) (without SenSocial) 61 2278
ConWeb (S) (without SenSocial) 38 945
20
21. Summary
• We argue that the integration of OSNs and mobile sensor data
streams can benefit in obtaining richer contextual information.
• We propose SenSocial to simplify the implementation of such
ubiquitous computing applications.
• SenSocial is released as an open-source project.
Available at: https://github.com/AbhinavMehrotra/SenSocial-Library
21