saving energy and enhancing quality of service in battery- operated medical and medication systems...

45
Saving Energy and Enhancing Quality of Service in Battery- Operated Medical and Medication Systems Albert M. K. Cheng Real-Time Systems Laboratory Department of Computer Science University of Houston, TX 77204, USA *Supported in part by NSF under Award No. 0720856.

Upload: george-patterson

Post on 02-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Saving Energy and Enhancing Quality of Service in Battery-Operated Medical and Medication Systems

Albert M. K. ChengReal-Time Systems LaboratoryDepartment of Computer ScienceUniversity of Houston, TX 77204, USA

*Supported in part by NSF under Award No. 0720856.

Medical and Medication Devices Medical and medication

devices (MMDs) are increasingly controlled by computer systems with hardware and software components.

These devices are real-time systems with safety and timing requirements – many are battery-operated.

They range from hard-real-time, embedded, and reactive systems such as pacemakers and vital-sign monitors to soft-real-time diagnosis instruments and medication dispensers.

Project Objectives

Apply (m,k)-firm constraints as a guide to increase the Quality-of-Service (QoS) and stability of medical devices.

Use a ventilator system as a motivating example to illustrate our approaches for improving its performance which translates into speedier recover for the patient.

One goal is to dynamically vary the ventilator assist rate by adapting it to the respiratory capability of the patient.

Manage and reduce power consumption in battery-operated medical systems using modified scheduling techniques.

Target battery-operated systems with Multiple Feasible Interval (MFI) jobs.

Consider systems with rechargeable batteries.

Ventilator System

A device for mechanically moving breathable air into and out of the lungs of a patient with respiratory difficulties, such as the inability to breathe on his/her own or breathing insufficiently caused by one or more ailments.

Attached to the patient via an endotracheal tube connected through the mouth to the trachea (larynx intubation) or a tracheotomy canula (a more comfortable and practical approach requiring minor surgery if connected for more than two weeks).

The ventilator pneumatically compresses the air reservoir several times per minute to deliver normal room air or a mixture of air and oxygen to the patient.

High-Level Diagram of a Ventilator System

Inspired Air

OxygenV

Patient

Expired Air|

Sensors

Assist Actuator

^Ventilator

Ventilator Monitors:

Patient-related parameters such as air flow, pressure, and volume from sensors attached to the patient and to the connection between the ventilator and the patient as described above.

Ventilator functions such as power failure, air leakage, pneumatic system, and mechanical problems.

Backup power supply – typically, system is connected to the power grid, but may need to be battery-operated in the field or during emergency black-out.

Oxygen tanks

Operation of Ventilator

A clinician (doctor, respiratory therapist, or nurse) can set the ventilator to provide full support where the patient does not initiate breaths,

Or to provide partial support in which case the patient’s inspiratory efforts trigger some or all the breaths delivered by the ventilator.

Ventilator Operation

In the assist-control mode of ventilation, the clinician manually sets a respiratory rate and volume of gas (or inspiratory pressure) for the patient.

The normal breaths per minute (BPM) for a healthy person is 12.

The ventilator rate is usually set at between 4 and 12 breaths per minute (BPM).

Therefore, it is desirable to maintain a combined BPM of 12 from the ventilator-assist A and the patient’s natural breathing B, that is,

A + B = 12 BPM

State of the Practice

The clinician manually adjust the assist BPM and other output parameters on a periodic basis (usually once or twice a day).

Once this assist rate is set, the ventilator attempts to adapt its pressure and flow characteristics of the air delivered to the patient while keeping this preset assist BPM.

However, the ventilator does not dynamically adjust the assist BPM even if the patient’s breathing capability becomes stronger as a result of medication and other factors.

There may be an overuse of the ventilator assist. The patient has to wait until the clinician revisits in the next period in order for the assist rate to be adjusted.

Project Objectives

Make the ventilator’s assist rate dynamically adaptive to the breathing performance of the patient in real-time while maintaining a combined BPM of 12.

If the breathing capability of the patient is improving (even slightly), this adaptive ventilator performance would potentially shorten the assistive period, allowing the patient to have a speedier recovery.

Note that the patient’s breathing capability should not be measured by transient performance but by stable performance over an interval of time.

(m,k)-firm Scheduling

In the (m,k)-constrained model, m out of any k consecutive jobs’ deadlines must be met.

For instance, (1,1)-constrained represents the hard real-time requirement and (2,3)-constrained designates at most one deadline can be missed in any three consecutive job releases.

Our recent work (Lin and Cheng, RTCSA 2006) makes use of the surplus computing time once the original pre-defined (m,k) constraints have been satisfied.

We aim to complete additional important mandatory jobs (thus yielding finer granularity) rather than to run optional jobs.

To accomplish it, each task Ti associates with a class of finite levels of QoS (e.g., (m, k) OR (m+1, k) OR …… OR (k, k)) and each level in the class has a specific reward called the Granularity of Quality of Service reward (GQoS-reward).

Modeling with (m,k)-firm Constraints Can be readily modeled by the (m,k)-firm model with k

being the length of this interval expressed as the number of total breathes by the patient and ventilator assist, and m being the number of breathes by the ventilator.

Here, m can vary from 0 (no ventilator assist) to k (full ventilator assist). As the patient improves his/her breathing capability, m becomes smaller, and thus the ventilator assist becomes lower.

Therefore, we have a sequence of (m,k)-firm constraints where m is a varying parameter over time.

Modeling the Adaptive Assist Behavior Dynamically varying assist rate can be

modeled by varying the parameter m in the (m,k) constraint, treating k as the window or interval length. In this model, m = 0 means no ventilator assist, and m = k means full ventilator support.

Furthermore, we are studying whether patterns can be used to provide better control of the air flow and pressure settings in real-time.

Partitioning Strategies for Sequence of Jobs Currently, there are two main partitioning strategies for

mandatory and optional jobs in a sequence. The first is the deeply-red pattern proposed by Koren et

al: a job Tij, i.e., the jth instance of task Ti , is determined to be mandatory if 1 j mod ki mi (for mi < ki. If mi = ki, Ti is a hard real time task. If mi = 0, all jobs of Ti are optional); otherwise, it is optional.

The second strategy is the evenly-distributed-mandatory pattern proposed by Ramanathan et al. According to this pattern, Tij is mandatory if and only if j = (mi > 0. If mi = 0, all jobs of Ti are optional similarly); otherwise, it is optional.

We use the evenly-distributed-mandatory pattern in our work since it has been reported that it exhibits a relative good schedulability and stability.

Improving Fault Tolerance

In most ventilator systems, a backup processor is ready to run all critical tasks in the event of the failure of the primary processor.

If the backup processor has lower performance (for instance, a slower CPU speed) than the primary processor, it still guarantees the satisfaction of the deadlines of all critical tasks such as the ventilator assists but it may not be able to meet the deadlines of non-critical tasks, such as those for refreshing the digital displays of the system’s parameters and settings.

Employing (m,k)-firm scheduling would allow us to ensure a higher QoS derived from the non-critical tasks and to achieve greater performance stability.

Scheduling Real-Time Tasks on Battery-Operated Embedded Systems

IntroductionReal-time or embedded system.Low power design for embedded systems.

Power-Aware Scheduling of Multiple Feasible Interval JobsStatic method: a Simulated Annealing (SA)

approach.Dynamic method: an on-line greedy heuristic.A leakage-aware method.

An Embedded System or Real-time System Real-time system

Produces correct results in a timely manner. Embedded system

computer hardware and software embedded as part of complete device to perform one or a few dedicated functions;

often with real-time requirements. Examples:

MMDs, PDAs, Cell phones, GPS, etc.

Low Power Design for Real-Time Systems Low power (energy) consumption is a key design for

embedded systems Battery’s life during operation. Reliability. Size of the system.

Power-aware real-time scheduling Minimize the energy consumption

• Problem I: Power-aware scheduling for multiple feasible interval jobs.

Achieving some goal while satisfying the real-time and/or energy constraints. • Problem II: Real-time Task Assignment on

Rechargeable Multiprocessor System.

Power-Aware Scheduling for Multiple Feasible Interval Jobs

What is a Multiple Feasible Interval Job? Dynamic Voltage Scaling (DVS or DFS) A Motivational Example Techniques to minimize the

CPU’s/System-wide’s energy consumptionStaticDynamic

Experimental results.

Multiple Feasible Interval Job Regular Real-time task/job

It has only one feasible interval for execution: [ready time, deadline], and a computation time demand.

Multiple Feasible Interval JobIt has more than one feasible interval.A job can be executed in any of its feasible

intervals. A feasible interval is defined as I = (S, E]. The set

of the feasible intervals of Ji is denoted by И = {Ii, 1, Ii, 2, Ii, 3,…, Ii, m}.

Dynamic Voltage Scaling (DVS) Technique for Real-Time Task CPU’s energy/power consumption is a convex function of the

CPU’s speed, e.g. P = CV2f -> P = s3. Slowing down CPU’s speed reduces the energy usage for CPU. Saving energy consumption V.S. Meeting deadline.

Reducing the CPU’s speed as much as possible while meeting every task’s deadline.

A minimum constant speed is always an optimal solution (if possible).

If more than one speed are needed, a “smooth” selection is better.

For regular single instance real-time jobs with only one feasible interval, Yao designed an algorithm for computing the optimal solution.

A Motivational Example (EDF)

Job Feasible Intervals Comp. Time

J1 (1, 9] 2

J2 (2, 7], (8, 13] 2

J3 (1, 4], (5, 8], (9, 13] 2

J2

1 94

0.5

13

J1

0.66

J3

0.4

J2

91

0.5

13

J1

6

J1

(b)

J3

2

(a)

Formulation of the Problem Problem Energy-MFIJ

Given a set of MFI jobs, finding a speed schedule on a single processor such that 1) every job in the set is schedulable and 2) the energy consumption by the jobs is minimized. • Determining whether a set of multiple

feasible interval jobs is schedulable or not is NP-Hard.

• Even though for a schedulable set of MFI jobs, the problem is still NP-Hard.

Determining the speed statically – introduction of the Simulated Annealing (SA) algorithm Simulated Annealing Algorithm

simulates the process of annealing in metallurgy used to temper or harden metals and glass.

Repeat

• An initial feasible solution is chosen as the starting point p, and then the cost or energy at this point is evaluated.

• A neighbor, next, is chosen randomly as an alternative solution and the cost/energy of this neighbor is evaluated.

• If the cost/energy of the neighbor is higher, the acceptance probability for accepting the neighbor solution is exponentially decreasing with the cost/energy difference and is slowly lowered with time. If the neighbor solution has lower cost, accept.

Determining the speed statically – for Energy MFIJ problem An initial feasible schedule is given, and the total energy

consumption by the schedule is calculated. The neighbor solution in the algorithm is obtained by

randomly selecting a job to re-determine its executing interval. If the reselected interval is feasible, we calculate the

energy of the schedule based on the new executing interval. The modification is accepted only if the new feasible schedule has less energy consumption or with a probability which decreases exponentially with the energy difference and is lowered in each iteration.

Algorithm Simulated Annealing Static

Exploiting on-line slack The Worst Case Execution Time is too

conservative, and typically the real-time jobs take a small fraction of their WCET.

A significant amount of energy can be saved by exploiting the dynamic slacks generated at run-time.

For MFI jobs, on-line slack can be used by fetching a job ahead for execution by re-selecting its executing interval.

An Example….Job Feasible Intervals Comp. Time

J1 (1, 9] 2

J2 (2, 7], (8, 13] 2

J3 (1, 4], (5, 8], (9, 13] 2

J291

0.5

13J1

6

J1

(a)

J3

2

J2

91

0.5

13

J1

5

J1

(b)

J3

2 4

0.3 0.5

J2

81

0.5

J1

5

J1

(c)

J3

2 4

0.3 0.66

Two Rules to use on-line slacks Rule 1: using the slack by upcoming jobs

first.using the slack as early as

possible. Rule 2: , fetching a job ahead for execution

only when it is guaranteed to save energy. It needs exponential time to find the

optimal allocation.

A heuristic for Rule 2

An illustrative example for dynamic fetching

Job Feasible Intervals Comp. Time

J1 (1, 9] 2

J2 (2, 7], (8, 13] 2

J3 (1, 4], (5, 8], (9, 13] 2

J4 (4.5, 8.5], (9, 14] 3

6

J2

1 9 112

0.5

14

J1 J1

1.0

J3 J4

8J2

1 92

0.5

14J1 J1

0.6

J3 J4

0.3

0.66

J2

1 9 112

0.5

14

J1 J1

1.0

J3 J4

0.3

5

5

(a)

(b)

(c)

Considering power consumption for leakage current As VLSI technology marches towards deep

submicron and nanoscale circuits operating at multi-GHz frequencies, the rapidly elevated leakage power dissipation will soon become comparable to, if not exceeding, the dynamic power consumption:Pleak = I leak V

P = Pdyn + Pleak

A critical speed s* = s where P(s) = P’(s)sShut down the CPU when it is idle.

• Shut-down overhead.

Techniques for reducing the overall energy usage

Only executing jobs at s* or higher. Shut-down CPU if an idle interval larger than

the minimum idle interval exists.A job can be pushed back by re-

selecting its later feasible interval as its executing interval • only when it can execute at a speed not higher. • only when it will not cause any job missing the

deadline.

Algorithm Leakage-aware

Results for SA algorithm

0

0.2

0.4

0.6

0.8

1

1.2

10 20 30 40 50 60 70 80 90 100

Num. of Jobs

Nor

mal

ized

Ene

rgy

FFIF-BFFFIF-WFWF-SAFFIF-FFFFIF-LFBF-SAFF-SALF-SA

0

0.2

0.4

0.6

0.8

1

1.2

1 2 3 4 5 6 7 8 9 10

Num. of Intervals

Nor

mal

ized

Ene

rgy

FFIF-BF

FFIF-WF

FFIF-FF

FFIF-LF

BF-SA

WF-SA

FF-SA

LF-SA

Results for Dynamic Fetching

0

0.2

0.4

0.6

0.8

1

1.2

1 2 3 4 5 6 7 8 9 10

Num. of IntervalsN

orm

aliz

ed e

nerg

y

No On-Line

OLDVS

OLDVS+DynamicFetching

0

0.2

0.4

0.6

0.8

1

1.2

10 20 30 40 50 60 70 80 90 100

Num. of Jobs

Nor

mal

ized

Ene

rgy

No On-Line

OLDVS

OLDVS+DynamicFetching

Results for Leakage-Aware Algorithm

0

0.2

0.4

0.6

0.8

1

1.2

10 20 30 40 50 60 70 80 90 100

Num. of Jobs

Nor

mal

ized

Ene

rgy

Leakage-Aware

DVS Only

0

0.2

0.4

0.6

0.8

1

1.2

1 2 3 4 5 6 7 8 9 10

Num. of Intevals

Nor

mal

ized

Ene

rgy

Leakage-AwareDVS Only

Real-time Task Assignment in

Rechargeable Multiprocessor Systems Scheduling of frame-based real-time

tasks in partitioning schemes for multiprocessor systems powered by rechargeable batteries.

In frame-based real-time systems, a set of tasks must execute in a frame, and the whole frame is repeated. This system model is widely used in real-time communication, real-time imaging and a lot of other real-time/embedded systems, including medical systems.

The problem for uniprocessor system has been studied in [Allavena and Mosse 2001], in which an algorithm of complexity O(N) was proposed for determining the feasibility of a task set.

However, doing so in a rechargeable multiprocessor system is NP-Hard [Lin and Cheng 2008].

We propose heuristic and approximation algorithms. Simulation results have shown that our algorithms exhibit very good behavior.

Figure: Algorithm for rechargeablesingle processor [Allavena and Mosse 2001]

Real-time Task Assignment in Heterogeneous Distributed Systems with Rechargeable Batteries

Our techniques to solve the problem are based on four heuristics, namely Minimum Schedule Length (MSL), Min-min Schedule Length (MmSL), Genetic Algorithm (GA), and Ant Colony Optimization (ACO).

While the modifications of the MSL, MmSL and GA approaches from their original implementation are somewhat straight-forward, we design a novel structure using ACO.

Performance comparisons of these four techniques are performed and the results are discussed in [Lin and Cheng 2009].

RealEnergy: a New Framework and Tool to Evaluate Power-Aware Real-Time Scheduling Algorithms

Linux

Measure EnergyTarget System

ApplicationsBenchmarks

RTAI

Data Analysis

Low Power Scheduling

Alg.

Change Frequency

CPU Sleep & Wake-up

Intel XScale/PXA255 Module

Example of the Measured Current

using RealEnergy

Actual Energy Consumption Using DVS as meaured by RealEnergy

Concluding Remarks

Achieve higher QoS in real-time/embedded systems

Reduce power consumption Ensure stable power supply Evaluate systems with actual

implementations and measurements Deliver actual benefit to society

References J. Lin and A. M. K. Cheng, “Maximizing Guaranteed QoS in (m,k)-firm Real-time Systems,” Proc. 12th

IEEE International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA), Sydney, Australia, Aug. 2006.

J. Lin, Y. H. Chen, and A. M. K. Cheng, "On-Line Burst Header Scheduling in Optical Burst Switching Networks,'' Proc. 22nd IEEE International Conference on Advanced Information Networking and Applications (AINA), Okinawa, Japan, 2008.

J. Lin and A. M. K. Cheng, “Real-time Task Assignment in Recharegable Multiprocessor Systems,” Proc. 14th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA), Kaohsiung, Taiwan, Aug. 2006.

J. Lin and A. M. K. Cheng, ``Real-time Task Assignment in Heterogeneous Distributed Systems with Rechargeable Batteries,'' IEEE International Conference on Advanced Information Networking and Applications (AINA), Bradford, UK, May 26-29, 2009.

J. Lin and A. M. K. Cheng, “Real-time Task Assignment with Replication on Multiprocessor Platforms," Proc. 15th IEEE International Conference on Parallel and Distributed Systems (ICPADS), Shenzhen, China, Dec. 8-11, 2009.

A. M. K. Cheng. Real-time systems: scheduling, analysis and verification. Wiley-Interscience, 2002. 2nd printing with updates, 2005.

A. M. K. Cheng, ``Applying (m, k)-firm Scheduling to Medical and Medication Systems,'' Workshop on Software and Systems for Medical Devices and Services (SMDS), in conjunction with IEEE-CS Real-Time Systems Symposium,Tucson, Arizona, Dec. 2007.

A. M. K. Cheng, ``Cyber-Physical Medical and Medication Systems,'' First International Workshop on Cyber-Physical Systems (WCPS2008), sponsored by the United States National Science Foundation, Beijing, China, June 20, 2008 (in conjunction with IEEE ICDCS 2008).

F. Lemaire. Mechanical Ventilation, Translation of “La ventilation artficielle,” 2nd ed. Paris: Masson, Editeur, 1991.

D. R. Hess and R. M. Kacmarek, Essentials of Mechanical Ventilation. New York: McGraw-Hill. 1996. T. Fernandot, J. Packert and J. Cade. On-line Estimation of Patient and Ventilator Respiratory Work,

Proc. IEEE-EMBC and CMBEC 1995. D. S. Nelson, IEEE, J. H. Strickland, and T. C. Jannett. Simulation of Fuzzy Control for Management of

Mechanical Ventilation Respiratory Rate in Assist-Control, Proc. 19th International Conference - IEEE/EMBS, Chicago, IL. USA, Oct. 30 - Nov. 2, 1997.

Thank You!