1 / 72

Mobile Software Development Framework: Adaptive Mobile Applications

Mobile Software Development Framework: Adaptive Mobile Applications. 10/23/2012 Y. Richard Yang. Outline. Admin Mobile cloud services Push notification service Track service Storage service Adaptive mobile applications. Admin. HW3 Project ideas. Recap: Example Mobile Cloud Services.

pete
Télécharger la présentation

Mobile Software Development Framework: Adaptive Mobile Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mobile Software Development Framework: Adaptive Mobile Applications 10/23/2012 Y. Richard Yang

  2. Outline • Admin • Mobile cloud services • Push notification service • Track service • Storage service • Adaptive mobile applications

  3. Admin. • HW3 • Project ideas

  4. Recap: Example Mobile Cloud Services • Push notification service • Location based services, e.g., • Track service (supporting location based services) • Storage services, e.g., • iCloud, Google Drive, Dropbox • Proxy services, e.g., • Kindle Split Browser • Recognition/synthesis services

  5. Example: Push Notification Service • A single persistent connection between Push Notification Service (PNS) and each mobile device • Authorization • App developer registers project with PNS • App on device registers with PNS and forwards registration to PNS • App server sends to registered apps on devices • Scalability, fault tolerance, generality • Send only notification, not data • For reliability, use soft state, not hard state

  6. Example: Track Service Creation • TC MakeCollection(GroupCriteria criteria, boolremoveDuplicates) Manipulation • TC JoinTrackCollections (TC tCs[], boolremoveDuplicates) • TC SortTracks (TC tC, SortAttributeattr) • TC TakeTracks(TC tC, int count) • TC GetSimilarTracks (TC tC, Track refTrack, float simThreshold) • TC GetPassByTracks (TC tC, Area[] areas) • TC GetCommonSegments(TC tC, float freqThreshold)

  7. API Usage: Ride-Sharing Application • // get user’s most popular track in the morning • TC myTC = MakeCollection(“name = Maya”, [0800 1000], true); • TC myPopTC = SortTracks(myTC, FREQ); • Track track = GetTracks(myPopTC, 0, 1); • // find tracks of all fellow employees • TC msTC = MakeCollection(“name.Employer = MS”, [0800 1000], true); • // pick tracks from the community most similar to user’s popular track • TC similarTC = GetSimilarTracks(msTC, track, 0.8); • Track[] similarTracks = GetTracks(similarTC, 0, 20); • // Verify if each track is frequently traveled by its respective owner • User[] result = FindOwnersOfFrequentTracks(similarTracks);

  8. Outline • Admin and recap • Mobile Cloud Services • Push notification service • Track service • Storage service

  9. Storage/Sync Service • Store content in cloud to be accessible by multiple selected devices • Multiple deployed services, e.g., • iCloud • Google Drive • DropBox

  10. Storage/Sync Service Example: iCloud • Backend • Hosted by Windows Azure and Amazon AWS • Uses HTTPS connect to servers • More details: see iCloud sessions • https://developer.apple.com/videos/wwdc/2012/?id=209

  11. Key Design Points for Mobile Storage • Data models • what data structure to put on mobile storage • Read miss • stalls progress (user has to wait for data) • Synchronization/consistency • user may see outdated data • user modification may generate conflicts • Good topic for investigation/design projects • See backup slides for some pointers

  12. Outline • Admin and recap • Adaptive mobile applications

  13. Adaptive Mobile Applications • An adaptive mobile application adjusts the amounts as well as the locations of resources that it consumes • The objective typically is to • Improve responsiveness • Reduce energy consumption at device

  14. Amazon Silk Split-Browser • Dynamically split browsing work between local device and Amazon cloud http://www.extremetech.com/mobile/97587-amazon-silk-bridging-the-gap-between-desktop-and-tablet-web-browsers

  15. Adaptive Mobile App: Big Picture in-netproxy device serviceserver On-device app/sys adaptation Device-aware service partition, delivery Service partition

  16. Adaptive Mobile Applications: Overview • This is a large topic • We will look at an example on each entity in-netproxy device serviceserver On-device app/sys adaptation Device-aware service partition, delivery Service partition

  17. Outline • Admin and recap • Adaptive mobile applications • Device adaptation

  18. Discussion • What resource parameters/aspects of a mobile device can be controlled? http://www.wired.com/gadgetlab/2012/09/iphone5-spec-showdown/

  19. Example: iphone 5 downloading idle iPhone 5 controls the CPU frequency http://www.anandtech.com/show/6324/the-iphone-5-performance-preview

  20. Iphone5 A6 Processor http://www.zdnet.com/inside-apples-a6-processor-7000004786/

  21. CPU Power Model • The power consumption rate P of a CMOS processor satisfies where k is a constant, C the capacitance of the circuit, f the CPU frequency, and V the voltage • When the supply voltage V is lower, charging/discharging time is longer; thus frequency should be lower => P ~ O(V3)

  22. CPU Power Model Question: • Suppose P ~ V3. Do we save energy by reducing freq/vol to 1/3, but finish the same job? • What if linear: P ~ V? throughput

  23. Dynamic Voltage Scaling • For convex power consumption rate, to minimize power for finishing a job, one may lower the freq/vol to close to 0 • Constraint • bound response time (e.g., deadline of multimedia playback)

  24. Example Architecture: GraceOS multimedia applications monitoring requirements scheduling scheduler demand distribution profiler time constraint speed adaptor speed scaling CPU

  25. b1 b2 Demand Prediction • Online profiling and estimation: count number of cycles used by each job CDF F(x) = P [Xx] 1 cumulative probability Cmin=b0 br=Cmax br-1

  26. Demand Stability Demand distribution is stable or changes slowly

  27. b1 b2 CPU Resource Allocation How many cycles to allocate to amultimedia job? Application should meet percent of deadlines  eachjob meets deadline with probability   allocate C cycles, such that F(C)=P[XC]   1  cumulative probability C F(x) b0 br br-1

  28. How Fast to Run the CPU? • Goal: provides Ci cycles during a time duration of Pi • Fact: since power is a convex function of frequency, if a job needs C cycles in a period P, then the optimal frequency is C/P, namely the lowest constant frequency.

  29. Why Not Uniform Speed? • Intuitively, uniform speed achieves • - minimum energy if use the allocated exactly • However, jobs use cycles statistically • - often complete before using up the allocated • - potential to save more energy •  stochastic DVS

  30. b1 b2 Stochastic DVS • For each job • find speed Sxfor each unit allocated cycle x CDF F(x) = P [Xx] 1 cumulative probability Cmin=b0 br=Cmax br-1

  31. suchthat Stochastic DVS • For each job • find speed Sxfor each allocated cycle x • time is 1/Sx and energy is (1 - F(x))S3x

  32. 400 speed (MHz) 200 100 Job 1 2.5x106 cycles Job 2 1.2x106 cycles Example Speed Schedule cycle: speed: 100 MHz 200 MHz 400 MHz Observation: speed up the processor with increasing clock cycles

  33. A1 B1 A1 B1 DVS • context switch • Store speed for switched-out • New speed for switched-in speed up within job switch back A1 speed A2 A1 execution

  34. Implementation • Hardware: HP N5470 laptop • Athlon CPU (300, 500, 600, 700, 800, 1000MHz) • round speed schedule to upper bound system call process control block • DVS modules • PowerNow speed scaling • Soft real-time scheduling standard Linux scheduler • Extension to Linux kernel 2.4.18 • 716 lines of C code

  35. Evaluation: Normalized Energy Reduces power consumption However, limited due to few speed options

  36. Odyssey: An Example Client Architecture • Application indicates resource capabilities in its request to service • Operating system maintains/monitors available resources • no need to have each application re-implement the monitoring • An application registers a resource descriptor and an upcall event handler with the OS • OS notifies the application upon detecting resource changes • Application adjusts requests to the server

  37. Outline • Admin and recap • Adaptive mobile applications • Device adaptation • Server adaptation

  38. Server Adaptation • It is a good practice to design your app so that • Client notifies the server about its capability • Server adapts according to client capability

  39. Example: Content Distribution Server • Server has many dimensions to adapt image/video fidelity: • frame rate (for video) • image size • quality of image • Usage: e.g., data acceleration offered by many carriers

  40. Frame Encoding: Block Transform Encoding DCT

  41. Discrete Cosine Transform 4C(u)C(v) n-1 n-1 (2j+1)up (2k+1)vp f(j,k) cos å å cos F[u,v] = n2 2n 2n j=0 k=0 where 1 for w=0 Ö 2 C(w) = for w=1,2,…,n-1 1

  42. more detail Basis Functions of DCT • An image is a superposition of basis functions • DCT computes the contribution of each basis function • - F[u,v]: for the basis • function at position [u, v] • Q: If you want to change encoding rate, what mayyou do?

  43. Huffman Code Run-length Code Frame Encoding: Block Transform Encoding DCT Quantize Zig-zag 011010001011101...

  44. Example: MPEG Block Encoding DC component Quantize DCT original image AC components zigzag run-length and Huffman encoding of the stream 10011011100011... coded bitstream < 10 bits (0.55 bits/pixel)

  45. Compressed(22 KB, 12:1) Uncompressed(262 KB) Compressed(6 KB, 43:1) Examples

  46. Outline • Admin and recap • Adaptive mobile applications • Client adaptation • Server adaptation • Proxy and job partition

  47. Discussion • When may a proxy help? in-netproxy device in-netserver

  48. Example: Round-Trip-Time Effects server device

  49. Example: Round-Trip-Time Effects server device

  50. Measured Benefit of Reduced Latency

More Related