MobiSys 2012 Medusa: A Programming Framework for Crowd-Sensing Applications Moo-Ryong Ra, Bin Liu Tom La Porta, and Ramesh Govindan 2 Crowd-Sensing Crowds Sensing 2016 2012Camera/Mic. GPS/WPS Accelerometer Compass/Gyro Growing Proximity Smartphone Users Motivation Problem Design Evaluation Conclusion Example: Documenting Social Events User 3 Summaries Full Videos Worker Worker Worker Worker Worker Worker Motivation Problem Design Evaluation Conclusion 4 Other Crowd-Sensing Tasks Auditioning Collaborative Learning Forensic Analysis Motivation Problem Television producer wants potential actors to submit clips of their acting. Mobile app developer wants samples of Security personnel activities train wants to findtopictures classifier. of attack taken by mall visitors. Design Evaluation Conclusion 5 The Problem Recruiting Workers Stage 1 Providing Incentives Coordinating worker actions Can be extremely Stage 2 labor-intensive Stage 3 Gathering contributions Stage 4 Automation using a high-level programming system Motivation Problem Design Evaluation Conclusion 6 Contributions Describe crowd-sensing requirements Devise design principles Design and implement Medusa, a programming system for crowd-sensing Evaluate using qualitatively different tasks Motivation Problem Design Evaluation Conclusion 7 Crowd-Sensing Requirements Expressivity Runtime Worker Mediation Privacy Concurrent Tasks Unsynchronized Execution Anonymity Robustness Sandboxing Secure Communication Resource Usage Controls Access Stored Data In-network Processing Extensibility Timeliness Support Incentives Motivation Problem Design Evaluation Conclusion Runtime Design Principles 8 Partitioned Services Task Management Worker Recruiting Incentive Management Cloud Runtime Cloud (Server) Opt-in Data Transfer Mobile Devices Sensing Client Runtime In-network Processing Dumb Smartphone Motivation Problem Design Evaluation Conclusion Medusa Design 9 MedScript Programming Language Medusa Runtime Motivation Problem Design Evaluation Conclusion Expressivity of MedScript Language Video Documentation Trigger SPC stage Preview outgoing data Processing Sensing Recruit HIT stage TakeVideo ExtractSummary Communication UploadSummary Incentives 10 Curate UploadVideo Worker Mediation XML-based extensible language Motivation Problem Design Evaluation Conclusion 11 Other Language Features Location-based Fork-join Reverse Authoring Incentives construct Tool Trigger MedAuthor Triggering Stage Execution GetAccel. Start Join GetGPS Reverse Typical Motivation Problem Design New! Evaluation Conclusion 12 Task Execution Example Resource Cloud-Initiated UsageExecution Controls Stage Task Initiation Alice User Create ‘Recruit’ Medusa Initiate ‘TakeVideo’ … Initiate ‘UploadVideo’ Unsynchronized Runtime Execution Sign-up to Worker Sign-up to ‘Recruit’ Charlie Motivation Sending the Video to Alice Taking … Uploading Video Video ‘Recruit’ Bob Got the Video Taking Uploading … Video Video Worker Problem Opt-in Privacy Time Flow Design Evaluation Conclusion 13 Medusa Runtime Design Data Repository Interpreted MedScript Program Worker Manager Stage Library Task Tracker C2DM Data Transfer Cloud (Server) Mobile Devices Stage Tracker MedBox Bob Motivation stage Upload Manager Sensor Manager Transform Manager Storage Manager Problem Amazon Mechanical Turk Design stage … Charlie Evaluation Conclusion 14 Medusa Prototype Python + LAMP Java Servlet + Tomcat Implementation Android 10 crowd-sensing tasks Expressivity Evaluation Concurrent Execution Performance Robustness Motivation Problem Design Evaluation Conclusion 15 Expressivity Application LOC Sensors Properties Video Documentation 86 vs Camera 8,763 In-network Processing, Crowd Curation Collaborative Learning 62 Accel., vs 7,076Mic. Different Sensors Auditioning 86 Camera Reverse Incentives, Crowd Curation Fewer than 100 LOC for tasks. Forensic Analysis 86 Spot Reporter 45 Road Monitoring 90 Accel. Citizen Journalist 45 GPS Party Thermometer 62 GPS, Mic. WiFi/Bluetooth Scanner 45 Net. Sensors Motivation Problem GPS, Mic. Access to Stored Data Camera, vs 17,238Mic. Text/Voice Tagging Fork-join Construct (from PRISM, MobiSys’10) Multiple Triggers (from PRISM, MobiSys’10) Location triggering (from PRISM, MobiSys’10) From AnonySense, MobiSys’08 Design Evaluation Conclusion 16 Concurrent Execution 19h08m 19h10m 19h12m Tasks 19h14m 19h18m 19h20m 2 Worker subscribed to the Task s (1) (2) (3) 19h16m 19h22m s s s 19h32m Worker I s (4) (5) (6) s Worker II s (7) (8) s Stage Execution Worker III s (9) (10) s Worker IV s Command Arrival via SMS Time Flow 4 Concurrent Workers Each Eachtask stage may execution has start has a Different aeach different onstage both number execution at Medusa different of stages. and time. times. users Motivation Problem Design Evaluation Conclusion 17 System Performance Cloud Runtime Overhead Mobile Device Medusa runtime Runtime Overheads has very small overheads. Notification Delay ~30ms delay, 5ms for tracking stage Total initialization runtime C2DM gives delay much is only less 100ms latency per stage. Motivation Problem Design Evaluation Conclusion 18 Related Work Crowd-Sourcing Smartphone Sensing Amazon Mechanical Turk PEIR, MobiSys’09 CrowdDB, SIGMOD’11 SoundSense, MobiSys’09 Turkit, UIST’10 AnonySense, MobiSys’08 CrowdSearch, MobiSys’10 PRISM, MobiSys’10 Human-in -the-loop Motivation Incentives MedusaIn-network Processing Problem Design Evaluation Sensing Conclusion Summary Medusa: A High-Level Programming Framework for Crowd-Sensing Applications a. Identified requirements and principles to design high-level programming framework for crowd-sensing applications. b. Design and implementation of the Medscript programming language and associated runtime system. c. Prototyped 10 crowd-sensing applications. Code Demo Video http://code.google.com/p/medusa-crowd-sensing/ http://youtu.be/jL1dGA21ciA 19