PowerPoint 演示文稿

Download Report

Transcript PowerPoint 演示文稿

EE5900 Advanced Embedded System For Smart Infrastructure

Computationally Efficient Smart Home Scheduling

Outline 1 2 3 4 5

Smart Home Cloud Computing Algorithm Case Study Conclusion

2

Smart Home Power Line Communication Line 3

Start End Dish washer 13:00 18:00 Landry machine 09:00 18:00 PHEV AC …… 18:00 17:00 08:00 N/A 4

Home Appliance (HA) in Smart Home Non-schedulable HA Restrictive-schedulable HA Full-schedulable HA 5

Multiple Power Levels Power level 350 W 500 W 820 W 1350 W http://www.supplyairconditioner.com/1-4-9-split-wall-mounted-air-conditioner.html

6

Multiple Working Stages

Working cycles Prewash Spinning Washing Drying Rinsing

  Assume all stages have same working frequency for simplicity Partition the whole task to multiple subtasks with precedence constraints 7

Plug-in Hybrid Electric Vehicles (PHEV)

Powered by an Electric Motor and Engine

• Internal combustion engine uses alternative or conventional fuel • Battery charged by outside electric power source, engine, or regenerative breaking • During urban driving, most power comes from stored electricity. Long trips require the engine 8

Contemporary Hybrids Toyota Camry Toyota Prius Toyota Highlander Honda Insight Honda Civic Honda Accord Lexus RX400h Lexus GS450h Saturn Vue Ford Escape Chevy Silverado 9

Charging of PHEV

Level 1:

120 V, alternating current (AC) plug; dedicated circuit

Level 2:

240 V, AC plug and uses the same connector on the vehicle as Level 1

Level 3:

In development; faster AC charging 10

Existing Products of Battery  Accord PHEV 120-volt: less than 3 hours 240-volt: one hour  Toyata PHEV 120-volt: less than 3 hours 240-volt: 1.5 hours Quick charge to 80% needs 30 minutes.

11

Dynamic Pricing from Utility Company https://rrtp.comed.com/live-prices/?date=20130404 12

Dynamic Voltage and Frequency Scaling (DVFS) 10 kwh Power 10 cents/kwh 5 cents / kwh Power r 10 cents/kwh 5 cents / kwh 1 2 Time

(a)

cost = 10 kwh * 10 cents/kwh = 100 cents 5 kwh 1 2

(b)

3 Time cost = 5 kwh * 10 cents/kwh + 5 kwh * 5 cents/kwh = 75 cents 13

Smart Home Scheduling (SHS)  Given n home appliances, to schedule them for monetary cost minimization satisfying the total energy constraint and deadline constraints  Demand Side Management – when to launch a home appliance – at what frequency – The variable frequency drive (DVFS) is to control the rotational speed of an alternating current (AC) electric motor through controlling the frequency of the electrical power supplied to the motor – for how long 14

Benefit of Smart Home – Reduce monetary expense – Reduce peak load 15

Smart Home Scheduling (SHS) Home appliance level User level Community level 16

Smart Home Scheduling (SHS)  Home appliance level  User level  Community level 17

Single Home appliance Scheduling Non-schedulable HA Consider the non-schedulable home appliance as fix energy consumption 18

Single Home appliance Scheduling Restrictive-schedulable HA For restrictive-schedulable home appliance, set start time to be earlier than the user’s requirement.

For example, in summer, user wants to come back to home at 5pm. The AC should be on before 5pm. 19

Single Home appliance Scheduling Full-schedulable HA For full-schedulable home appliance, one needs to schedule when to launch a home appliance at what frequency considering DVFS for how long to minimize monetary cost satisfying that the total energy is consumed.

20

Home Appliance Definition      Ts: Start time Te: End time P i : Power level E: Total required energy 𝛼 𝑡 : Unit price of time slot t 21

Dynamic Programming  Given a home appliance, one processes time slot one by one for all possibilities until the last time slot and choose the best solution 𝑇 𝑠 𝑇 𝑠 + 1 𝑇 𝑠 + 2 𝑇 𝑒 − 1 𝑇 𝑒 0 0 0 𝑃 1 𝑃 2 𝑃 𝑃 1 2 𝑃 𝑃 1 2 Choose the solution with total energy equal to E and minimal monetary cost 22

Characterizing  For a solution in time slot i, energy consumption e and cost c uniquely characterize its state

Time slot i

(e i , c i )

Time slot i+1

(e i+1 , c i+1 ) 𝑒 0 = 0, 𝑐 0 𝑒 𝑖+1 = 𝑒 𝑖 𝑐 𝑖+1 = 𝑐 𝑖 = 0 + 𝑝 𝑖+1 + 𝑝 𝑖+1 ∙ 𝛼 𝑖+1 23

Pruning  For one time interval, (e 1 , c 1 ) will dominate solution (e 2 , c 2 ), if e 1 >= e 2 and c 1 <= c 2

Time slot i

(15, 20) (15, 25) (11, 22) 24

Algorithmic Flow of Dynamic Programming Start time t = T s Calculate all possible (e, c) Prune all dominated (e, c) Next time slot t = t + 1 No End time t = T e Yes Choose the result (e, c) which e = E and c is minimal e < E No Schedule Schedule 25

Dynamic Programming based Appliance Optimization Price 0 Power level: {1, 2, 3} Dynamic Programming returns optimal solution 𝛼 1 = 2 (3,6) (2,4) (1,2) (0,0) t1 𝛼 2 = 1 (3,3) (2,2) (5, 8) (5, 7) (4, 5) (3, 3) (4, 6) (3, 4) (2, 2) (4, 7) (3, 5) (2, 3) (1, 1) (1,1) (0,0) Runtime : t2

O

(

m

2

k

) Time – – # of distinct power levels = k # time slots = m 26

Smart Home Scheduling (SHS)  Home appliance level  User level  Community level 27

Scheduling Among Multiple Appliances for One User Appliances Determine Scheduling Appliances Order An appliance Schedule Current Task Not all the appliance(s) processed Update Upper Bound of Each Time Interval All appliance process Schedule 28

Smart Home Scheduling (SHS)  Home appliance level  User level  Community level 29

Game Approach User 1 User 2 .............

User m A game approach is deployed where each customer acts as a player.

30

Game Theory  For every player in a game, there is a set of strategies and a payoff function, which is the profit of the player.

 Each player choose actions from the set of strategies in order to maximize its payoff.  When no player can increase its payoff without changing the actions of others, Nash Equilibrium is reached.

31

Game Formulation in Community Level Players: All the customers in the community Payoff: − 𝑙 ℎ,𝑗 𝐶 ℎ 𝐿 ℎ Strategy: Choose power levels and launch time to maximize payoff while the constraint conditions can be satisfied 32

Algorithmic Flow in Community Level Each user schedules their own appliances separately All users share information with each other Each user reschedules their own appliances separately No Equilibrium Yes Schedule 33

Multiple Customer Scheduling

u 1

FPGA

r 1 u 2

FPGA

r 2 u 1

• Low frequency • High cost • Hard to maintain

u 2

FPGA FPGA …… Schedule

u 3

FPGA

r 3 u 3

FPGA

First iteration Communication Second iteration

……

Equilibrium

34

Cloud Computing  In Cloud Computing, a new class of network based computing takes place over the Internet  It is a collection/group of integrated and networked hardware, software and Internet infrastructure 35

Why Cloud Computing  Advantages – Low cost – High availability, flexibility, elasticity – You can increase or decrease capacity within minutes, not hours or days; – You can commission one, hundreds or even thousands of server instances simultaneously. – Your application can automatically scale itself up and down depending on its needs.

– Free of maintenance – Security 36

Service models Software as a Service (SaaS)

SalesForce CRM LotusLive Google App Engine

Platform as a Service (PaaS) Infrastructure as a Service (IaaS) 37

Cloud Taxonomy 38

Some Commercial Cloud Offerings 39

Amazon EC2   Amazon EC2 is one large complex web service.

EC2 provided an API for instantiating computing instances with any of the operating systems supported.

 It can facilitate computations through Amazon Machine Images (AMIs) for various other models.

40

Google App Engine  This is more a web interface for a development environment that offers a one stop facility for design,   development and deployment Java and Python based applications in Java and Python.

Google offers the same reliability, availability and scalability at par with Google’s own applications Interface is software programming based 41

Windows Azure    Enterprise-level on-demand capacity builder Fabric of cycles and storage available on-request for a cost You have to use Azure API to work with the infrastructure offered by Microsoft 42

In Home vs. Cloud Computing Scheduling  Cost – High performance FPGA vs. Low performance FPGA + Cloud    – Low performance FPGA vs. Low performance FPGA + Cloud Upgrade – Upgrade FPGA vs. Cloud service Maintenance – Broken FPGA – Cloud is free of maintenance Runtime – In Home vs. Cloud Computing 43

Estimation of Computation Time of Low Performance FPGA  FPGA in smart home: 250 MHz – 1000 users with 1000 FPGA – – – Runtime is approximately 10 seconds in one iteration Communication time: 10kb/250kb/s=0.04s

100 iterations: (10+0.04)*100 = 1004 sec = 16.73 min  Since the pricing policy is updated each 15 minutes by most utilities, 16.73 minutes are unacceptable.

 Why not using some quite high performance machines in each home?

44

Cloud Based Distributed Algorithm

u 1

FPGA

r 1 u 2

FPGA

r 2 u 3

FPGA

r 3

Cloud

r 1

FPGA

u 1

Communication

r 2

…… Schedule FPGA

u 2 r 3

FPGA

u 3

First iteration Communication

……

Equilibrium

45

Monetary Cost Aware Scheduling Problem  There are different types of machines in cloud with different monetary cost, frequencies and storage  One is required to schedule those users’ tasks to appropriate machines to minimize the monetary cost of the distributed algorithm satisfying the timing constraints 46

An example I    FPGA: 250 MHz CPU in cloud: 2 GHz with $0.02/hour, 3 GHz with $0.06/hour Timing constraints T c = 5

Runtime (s)

FPGA 2 GHz 3 GHz

u 1

12 1.5

1

u 2

14 1.75

1.17

u 3

10 1.25

0.83

u 4

15 1.88

1.25

If one schedules tasks of user 3 to CPU with 2 GHz and schedules tasks of user 1, 2 and 4 to CPU with 3 GHz, then The monetary cost C = 1.25 / 3600 * 0.02 + (1+1.17+1.25) / 3600 * 0.06 = $6.39 * 10 -5 .

The runtime T = max{1.25, 1+1.17+1.25} = 3.42 < T c .

47

An example II    FPGA: 250 MHz CPU in cloud: 2 GHz with $0.02/hour, 3 GHz with $0.06/hour Timing constraints T c = 5 Runtime (s) 2 GHz (s) 3 GHz (s)

u 1

12 1.5

1

u 2

14 1.75

1.17

u 3

10 1.25

0.83

u 4

15 1.88

1.25

If one schedules tasks of user 1 and 2 to CPU with 2 GHz and schedules tasks of user 3 and 4 to CPU with 3 GHz, then The monetary cost C = (1.5 + 1.75) / 3600 * 0.02 + (0.83 + 1.25) / 3600 * 0.06 = $5.27 * 10 -5 .

The runtime T = max{1.5 + 1.75, 0.83 + 1.25} = 3.25 < T c .

48

Problem Formulation  Given 𝑛 users in smart home scheduling problems with runtime 𝑡 𝑟𝑖 running in local machine with frequency 𝑓 𝑟 , 𝑚 types of machines in cloud with frequency 𝑓 𝑗 and monetary cost 𝑐 𝑗 , one needs to schedule these 𝑛 users’ tasks to 𝑚 machines such that the total monetary cost is minimized and maximum runtime over all the machines satisfies the timing constraints.

49

Monetary Cost Problem Formulation  𝑀𝑖𝑛 𝑠. 𝑡.

𝑀 𝑀 = 𝑚 𝑗=1 𝑛 𝑖=1 𝑥 𝑖,𝑗 ∙ 𝑡 𝑟𝑖 ∙ 𝑐 𝑗 ∙ 𝑓 𝑟 𝑓 𝑗 𝑇 𝑗 = 𝑛 𝑖=1 𝑥 𝑖,𝑗 ∙ 𝑡 𝑟𝑖 ∙ 𝑓 𝑟 𝑓 𝑗 , 𝑗 = 1, 2, … , 𝑚 𝑚 𝑗=1 𝑥 𝑖,𝑗 = 1, 𝑖 = 1, 2, … , 𝑛 𝑥 𝑖,𝑗 = 0 𝑜𝑟 1 𝑀𝑎𝑥 𝑇 𝑗 ≤ 𝑇 𝑐 50

Linear Programming With Rounding  𝑀𝑖𝑛 𝑠. 𝑡.

𝑀 𝑀 = 𝑚 𝑗=1 𝑛 𝑖=1 𝑥 𝑖,𝑗 ∙ 𝑡 𝑟𝑖 ∙ 𝑐 𝑗 ∙ 𝑓 𝑟 𝑓 𝑗 𝑇 𝑗 = 𝑛 𝑖=1 𝑥 𝑖,𝑗 ∙ 𝑡 𝑟𝑖 ∙ 𝑓 𝑟 𝑓 𝑗 , 𝑗 = 1, 2, … , 𝑚 𝑚 𝑗=1 𝑥 𝑀𝑎𝑥 𝑇 𝑗 𝑖,𝑗 = 1, 𝑖 = 1, 2, … , 𝑛 ≤ 𝑇 𝑐 For each 𝑖 , round the largest 𝑥 𝑖,𝑗 to be 1, others to 0 51

Algorithmic Flow

Sort all machines increasingly by by ratio of

𝒄

/

𝒇

Solve the continuous fashion problem combinatorially Flag all machine to be available Assign task fractionally to the available machine with highest ratio of

𝒄

/

𝒇 No

Runtime of machine is reaching T C

Yes

Flag the machine to be unavailabe Discretize the continuous solution

52

Combinatorial solving T C T c f i – Timing constraints - Frequency of cloud machines …… f 1 f 2 …… f m-1 f m 53

Discretization T C 3 2 3 1 T’ T C 2 3 1 f 1 f 2 f 1 f 2 (b) ratio 𝑐 𝑓 , the total monetary cost must be no greater than the optimal solution while the timing constraint may be violated by 𝑇 𝐴𝐿𝐺 ≤ 𝑇 𝐶 + max 𝑡 𝑖 ∙ ( 𝑓 𝑚𝑎𝑥 𝑓 𝑚𝑖𝑛 − 1) 54

Theorem  There exists an algorithm such that the total monetary cost must be no greater than the solution of continuous problem while the timing constraint may be violated by 𝑇 𝐴𝐿𝐺 ≤ 𝑇 𝐶 + max 𝑡 𝑖 ∙ ( 𝑓 𝑚𝑎𝑥 𝑓 𝑚𝑖𝑛 − 1) , running in 𝑂(𝑛𝑙𝑜𝑔𝑛) time 55

High Level Algorithm

u 1

FPGA

r 1 u 2

FPGA

r 2 u 3

FPGA

r 3

First iteration

Cloud

r 1

Communication

r 2

…… Schedule

r 3

Communication

……

Equilibrium

FPGA FPGA FPGA

u 1 u 2 u 3

The distributed algorithm needs multiple iterations to achieve the equilibrium, thus the scheduling algorithm needs to handle all the iterations repeatedly.

56

FPGA & Amazon EC2   Low performance FPGA in smart home: 250 MHz Computer in cloud: – 1 core with 1 ECU (approx.. 1.7 GHz, $0.034 per hour) – – 1 core with 2 ECU (approx.. 3.5 GHz, $0.068 per hour) 2 cores with 2 ECU (approx.. 3.5 GHz, $0.136 per hour)  – 4 cores with 2 ECU (approx.. 3.5 GHz, $0.271 per hour) Communication time: 10kb/250kb/s=0.04s

 Observing that there are machines with multiple cores, we can schedule multiple tasks to one machine with multiple cores at the same time 57

Comparison for 1000 users  W/o cloud – 1000 users with 1000 FPGA – Runtime is approximately 14 seconds in one iteration – Communication time: 10kb/250kb/s=0.04s

 – 100 iterations: (10+0.04)*100 = 1004 sec = 16.73 min W/ cloud of 1 core with 1 ECU – 1000 computers in cloud – – – Runtime is approximately 2 seconds in one iteration Communication time: 10kb/250kb/s=0.04s

100 iterations: (2+0.04)*100 = 3.4 min (4.92X) 58

Comparison for 1000 users  W/ cloud of 1 core with 2 ECU – 1000 computers in cloud – Runtime is approximately 1 seconds in one iteration – Communication time: 10kb/250kb/s=0.04s

 – 100 iterations: (1+0.04)*100 = 1.7 min (9.84X) W/ cloud of 4 core with 2 ECU (Parallel in four cores) – 250 computers in cloud – – – Runtime is approximately 1 seconds in one iteration Communication time: 10kb/250kb/s=0.04s

100 iterations: (1+0.04)*100 = 1.73 min (9.67X) 59

Case Study Setup    Low performance FPGA in smart home: 250 MHz, $200 High performance FPGA in smart home: 1250 MHz, $2000 Computer in cloud: – 1 core with 1 ECU (approx.. 1.7 GHz, $61/yr upfront, $0.034/hr) – 1 core with 2 ECU (approx.. 3.5 GHz, $122/yr upfront, $0.068/hr) – – 2 cores with 2 ECU (approx.. 3.5 GHz, $243/yr upfront, $0.136/hr) 4 cores with 2 ECU (approx.. 3.5 GHz, $486/yr upfront, $0.271/hr) http://www.xilinx.com/support/documentation/data_sheets/ds160.pdf

http://www.amazon.com/C3-DRK-Digital-Radio Kit/dp/B001KBPIOQ/ref=sr_1_8?s=pc&ie=UTF8&qid=1365106998&sr=1-8&keywords=fpga http://aws.amazon.com/ec2/pricing/ 60

Case Study Setup (Cont.)  Home appliances category – End time: 18:00 Frequency level: 20Hz, 40Hz, 60Hz, 80Hz – Full-schedulable Start time: 9:00 End time: 18:00 – Frequency level: 20Hz, 40Hz, 60Hz, 80Hz Non-schedulable Start time: 0:00 End time: 23:59 61

Case Study Setup (Cont.)   200 to 1000 users in one community Each user could have 10 – 30 home appliance – 30% of restrictive-schedulable home appliance – 50% of full-schedulable home appliance – 20% of non-schedulable home appliance 62

An Example – One User

HA

AC Washer & Dryer Dish Washer PHEV Refrigerator

Start time

17:00 09:00 09:00 18:00 00:00

End time

20:00 18:00

Total energy (kW.h)

8 5

Power levels (W)

{400, 600, 800, 1000, 3000} 1000 18:00 07:00 23:59 http://www​.mpoweruk.​com/electricity_demand.htm

3 12 1.2

1000 {1900, 3000, 20k, 240k} 50 63

Total Bill – Monthly Dollars 200 180 160 140 120 100 80 60 40 20 0 Utility Bill W/o SHS Utility Bill w/ Low Performance FPGA In Home SHS Utility Bill w/ Cloud SHS 64

Runtime Minutes 18 16 14 12 10 8 6 4 2 0 Runtime of Low performance FPGA In Home SHS Runtime of Cloud SHS 65

High Performance FPGA  FPGA in smart home: 1250 MHz, $2000  Runtime – 1000 users with 1000 FPGA – Runtime is approximately 2 seconds in one iteration – – – Communication time: 10kb/250kb/s=0.04s

100 iterations: (2+0.04)*100 = 204 sec = 3.4 min No real time issue 66

Total Bill – First Year Dollars 4000 3500 3000 2500 2000 1500 1000 500 0 Utility Bill W/o SHS Utility Bill w/ High performance FPGA In Home SHS Utility Bill w/ Cloud SHS 67

Total Bill – Ten Years Dollars 25000 20000 15000 10000 5000 0 Utility Bill W/o SHS Utility Bill w/ High performance FPGA In Home SHS Utility Bill w/ Cloud SHS 68

Total Bill – Ten Years Cloud computing service cost reduction 25000 Dollars 20000 Utility Bill W/o SHS 15000 10000 5000 Utility Bill w/ High performance FPGA In Home SHS Utility Bill w/ Cloud SHS 0  Cloud computing service cost reduction rate: 10%/yr 69

Total Bill – Ten Years FPGA Maintenance Dollars 25000 20000 Utility Bill W/o SHS 15000 10000 5000 Utility Bill w/ High performance FPGA In Home SHS Utility Bill w/ Cloud SHS 0  FPGA maintenance cost: $50/yr 70

Total Bill – Ten Years FPGA Broken Dollars 25000 20000 Utility Bill W/o SHS 15000 10000 5000 Utility Bill w/ High performance FPGA In Home SHS Utility Bill w/ Cloud SHS 0  FPGA broken rate: 2.8% http://homepages.cae.wisc.edu/~aminf/FCCM09%20 %20FPGA%20Design%20Analysis%20of%20the%20Clustering%20Algorithm%20for%20the%20CERN%20Large %20Hadron%20Collider.pdf

71

Total Bill – Ten Years US Dollars Inflation Dollars 30000 25000 20000 15000 10000 5000 0 Utility Bill W/o SHS Utility Bill w/ High performance FPGA In Home SHS Utility Bill w/ Cloud SHS  Inflation rate of US dollars: 2%/yr http://www.usinflationcalculator.com/inflation/historical-inflation-rates/ 72

Conclusion    According to case study, our approach by use of cloud can make several times speed up comparing to low performance FPGA based algorithms such that the timing constraints could be satisfied and archive 18.95% monetary cost reduction on average If high performance FPGA is chosen, user needs to pay 58.3% on average more than bill without SHS in first year of buying FPGA; user will pay higher than cloud based scheme considering cost reduction of cloud computing, maintenance and broken of FPGA in first ten years Overall, cloud computing is better than both low performance FPGA and high performance FPGA 73

Further Study   Design an algorithm to decide the number of machines in cloud to minimize the reservation cost More case study will be conducted to generalize my conclusion 74

Thanks

75