In this section, the materials and methods used to design the proposed health monitoring system are discussed. The proposed methodology consists of a series of task orchestration steps, microservices analysis for health-tasks generation, creation of virtual objects from health devices, intelligent task mapping of health, and health task deployment on health devices in an IoT environment.
Figure 2 presents the flow of the proposed task orchestration approach using intelligent task mapping to develop E-PHMS. The first component is the elderly patient health monitoring service, which is analyzed to generate microservices such as elderly patient health monitoring at home, elderly patient health monitoring in the ambulance, and elderly patient health monitoring at the hospital.
Health tasks are defined based on the generated task suggestions from the microservice analyzer component. Health tasks are functional units of health microservices. Health monitoring devices are the biomedical sensors used for monitoring patients. Health devices are virtualized into virtual objects using the virtualization module of the system. Virtual objects are connected to biomedical sensing devices using an attribute of the virtual objects called Uniform Resource Identifier (URI). Task mapping component map health tasks on health devices based on the optimal order received from the proposed task mapping algorithm. The proposed task mapping algorithm uses objective optimizations based optimization approach to generate optimal devices operations plans. For ease of understanding the concept, the mapping component visualizes the results task mapping algorithm in a mapping window, showing a visual connection between virtual objects and health tasks. Finally, device operations plans are used to create processes for execution on one or more biomedical sensors. The process of executing a health task on a health device is called health task deployment.
Micro-operations, also known as health tasks, are assigned to one or more virtual objects. A virtual object emulates the features and attributes of health monitoring devices. The health tasks layer provides task-level management of health monitoring microservices. The tasks Mapping (IM) layer provides a mechanism for generating tasks and virtual object pairs. The TM layer input health task attributes to task mapping algorithms to generate optimal ordered pairs of health tasks and virtual objects. The optimization layer provides optimization schemes to generates these ordered mapped pairs based on optimal health devices operation plans. Optimal health device operation plans are obtained by maximizing the objective function results. The ordered task mapping pairs are used to create processes. These processes are executed on health monitoring devices.
3.1. Mathematical Formulation of Task Mapping Algorithm
In this section, mathematical formulation of objective functions of the intelligent task mapping scheme is presented. In the later part of the section, the proposed task mapping scheme is discussed in algorithmic form. The list of symbols used in the formulation of the objective function is described in
Table 2.
In the E-PHMS case study, there are a set of tasks performing health monitoring operations on health devices. There are two types of tasks, periodic and event-based tasks. An example of periodic tasks is sensing tasks such as body temperature tasks. An example of event-driven are tasks that are executed when some event is detected by the system, such as patient fall detection tasks. Consider the set of health tasks in are responsible for health operations on health devices . A health task is a functional unit of the health monitoring services for performing a unit operation such as monitoring the body temperature of the elderly patient. For instance, report-body-temperature and get-body temperature are examples of two distinct unit health tasks. A task can be allocated on one health virtual object or on a set of health-virtual objects .
A health task is an operation performed by a health monitoring device, or in other words; health device operation is a health task in execution, i.e., . A health task must be executed based on an optimal mapping index. Before starting the discussion on the optimization scheme for optimal mapping index, constraints are discussed. Each health task has attributes such as duration, period, priority, worst case finish time, start time, finish time, and delayable time. The system sets the priority of the tasks; for example, the system will prioritize event-driven tasks compared to regular periodic tasks. Each task is executed on the health device using its related process. A process is created based on one or more tasks using the priority of a task, task mapping index, and list of devices on which the process will be executed.
Based on the constraints discussed, the task mapping algorithm computes a function using optimization objective function which propels the health tasks arrangement in such a way that maximum task delayable time is achieved. Tasks delayable time is maximized based on task start and finish time assignment to obtain optimal cumulative
. Optimal
is given by :
where
of cumulative delayable time of arranged tasks list, delayable time of health task is the time till which health execution can be delayed.
and
are the worst-case finish time and duration of
respectively. For the mathematical presentation of the task mapping mechanism, examples of body temperature, heart rate, and body position sensors are taken as elderly patient health monitoring devices. However, the number of devices can be increased for monitoring more complex situations. Based on these sensors’ profile descriptions, generated health tasks are given in
Table 3. The health task parameters presented are in milliseconds.
,
attributes are the primary constraint considered; however, some other health task attribute can be considered to maximize the cumulative delayable time all of tasks arrangement.
The next step of the intelligent task mapping mechanism generates possible health tasks and virtual objects pairs such as get-body-temperature, body temperature sensor, get-heart-rate, heart rate sensor. The intelligent task mapping approach’s objective is to find tasks devices pairs list, which leads to a maximum of
.
is the task device mapping index that finds optimal operation plans of the health monitoring devices.
Table 4 presents ordering of health devices operation plan.
Task device mapping index is a function of maximizing the delayable time of device operations plans. If the task device mapping index is maximum, the delayable time of device operations plans will be maximum and vice versa. Task device mapping index (
) is given by :
where
function provides device operation plans to maximize resource use.
Table 4 presents ordering of Health Devices Operation Plan.
of health devices,
,
,
, ...
is given by:
function of health devices is computed as follows.
Maximum
means optimal devices operation plan with short idle time and high delayable time.
Table 5 presents task allocations on different health devices and its impact on cumulative similarity index (CSI). Task allocation based on a maximum
means that task allocation based on the device operations plans is flexible. The flexibility of the architecture highlights the reliability factor of the proposed architecture.
If delayable time is low, then changes in the task mapping plan may make the delayable time negative, and hence health task will be dropped. The high task drop rate means low reliability of the system and vice versa. Many literature studies highlight the importance of reliability and network delay in critical task applications. The group of devices with a maximum
reside in the same network; thus, delay for a request to devices is less compared to devices belonging to a different network. Thus, maximum
also minimizes network latency. The main objective of the intelligent task mapping mechanism is to find a set of devices that contribute to the highest CSI. The objective function goal is to maximize CSI. The CSI of a network is given by:
Based on the CSI equation, the task mapping module’s job is to find device operational plans within a network to maximize the CSI. Maximum CSI also means a reliable and efficient plan of devices and tasks arrangement; hence it will lead to a flexible task mapping plan and the most scalable task orchestration architectures.
The proposed task mapping algorithm uses the optimization scheme mentioned above for task allocation on devices with optimal cumulative task mapping index . The algorithm’s input are, list of health tasks and health devices . For each health device, a virtual object is generated; these virtual objects are added to the list of virtual objects. Next, a greedy approach is used to generate all task virtual object pairs. For each task pair, maximum delayable time is computed for the execution on the health device. In the next step, device operation plans for the health devices are calculated. The mapping index is calculated based on the task mapping pairs and function from a set of health devices operations plans. This individual mapping index is summed to the cumulative mapping index. The algorithm (Algorithm 1) uses the cumulative mapping index to compute the cumulative similarity index. Finally, processes are created for device plans with a maximum cumulative similarity index. The process is allocated to health monitoring devices.
Algorithm 1: Task Mapping Algorithm |
|
3.2. Implementation Environment
In this section, the discussion on the implementation environment for the E-PHMS application development is presented. The E-PHMS application is developed based on the proposed intelligent task mapping-based task orchestration architecture. The IoT server is developed on Raspberry PI devices. Three Raspberry PI devices are used for emulating home, ambulance, and hospital environments. For health sensors, the e-Health sensing platform was used, which provides support for many health sensors. This toolkit comes with many biomedical sensing devices.
Table 6 presents the implementation environment of E-PHMS.
Body temperature, heart rate, body position, and blood glucose level sensors were used for the case study of E-PHMS. These devices are connected to the IoT servers configured on Raspberry PI devices. The IoT server maintains the registry of these health sensors after devices’ virtualization into virtual objects. The registry contains information, including connectivity status and URI of these sensing devices. E-PHMS application was deployed on a PC server where flask-based web server was configured. E-PHMS application is mainly programmed using python language based on the model view controller paradigm(MVC). The application identifies each sensing device using URI for the deployment of a health task. The application send HTTP-based request to the IoT server using the URI of the device, and the IoT server parses the request. The requested operation is executed on the health device, and the response is sent back to the application in the form of a JSON object. E-PHMS application parses the JSON object into a user-friendly HTML-based presentation.
Figure 4 represents the developed health monitoring application using the task composition toolkit based on intelligent task mapping. The service analysis menu is used for health monitoring services, and the manage tasks menu is used for tasks level management. Task mapping menu provides task mapping scheme interface. Task scheduling menu visualizes tasks virtual objects ordered pairs using timeline chart. Task allocation represents task deployment results of elderly patient health monitoring services.
Figure 5 represents health task and microservices generation window that shows the visualization of the health tasks suggestion based on the microservice analyzer component. Three microservices of patient health monitoring along with ten health tasks are generated by the microservice analyzer component using the service description. The automated suggested tasks and microservices can be saved to the repository or discarded. However, the application also provides manual addition of tasks and microservices. Health tasks and microservices are generated based on the description of the services needed by the health authorities. E-PHMS application uses natural language processing (NLP) library NLTK. E-PHMS application is scalable to other health microservices and tasks using a manual approach. Microservice and health task forms are used for manual entry. Apart from adding new microservices, existing microservices and tasks can be removed or edited using the E-PHMS application dashboard. The save to repository option is used to save tasks and microservices permanently in the database. MySql was used as a database server; however, any alternative database can be used. Manage tasks menu is used for tasks profile management, whereas manage VOs menu is used for device virtualization and device profile management. Tasks allocated on devices can be accessed through the "task allocation" menu. The proposed task mapping algorithm generates devices and health tasks operations plans for the generated tasks and virtual objects. An optimal device operation plan results in an optimal ordered list of tasks virtual object pairs. An optimal devices operation plan is selected for task allocation on the sensing device to maximize the time until which a task can be delayed and minimize the delay for a task that needs to be executed first. For task allocation, the system creates processes from the device operation plan. The process is deployed on the IoT device using the URI. As discussed above, the IoT server registry contains information on all health sensors and actuators. For example, the URI of the device contains the ID and a message. IoT server parses this message using the decoded mechanism to deploy the process on the device.
Figure 6 represents anomaly detection using the E-PHMS application. E-PHMS application displays the task execution results in a graphical user interface, as shown in the Figure.
For instance, the body temperature, heart rate, body position, and blood glucose level tasks are visualized in the figure. Once an anomaly is detected in the results from task execution based on the threshold-based method, it is notified using dialogue alert, alarm, and call alert. Anomaly detection based on the body temperature data is shown in the figures. The dialogue shows the notification of a patient suffering from fever. Anomaly detection based on the health sensing data is discussed in detail in the results and discussion sections.
3.3. Data Presentation and Assessment
The system is evaluated using two types of subjects data, first with a real test using 30 volunteer subjects wearing the biomedical sensors and performing activities such as walking, sitting, standing, falling, and jogging. Other performance evaluation tests such as reliability, round trip time (RTT), and latency were conducted in a simulation environment for three sets of virtual patients of 30, 50 and 100 users. For the simulation of various user sets, the Locust load testing tool was used. Pox-based simulation of devices were used to investigate sensing devices failure effect on the response time. The devices were power off to induce device failure error. The experiment of 30 subjects has been done in the Mobile computing laboratory of the computer engineering department of Jeju National University, Jeju, South Korea. A total of 1440 data instances was recorded for different activities of these 30 subjects. Heart rate, body temperature, blood glucose level, and body position was recorded using wearable sensors. Statistical data of 30 subjects sensing data are presented in
Table 7. The average heart rate recorded during the experiment is 73.4. Heart rate is calculated based on the number of times a heart beats in one minute. A healthy heart function is to supply the right amount of blood at the right rate for body activities. For example, running or walking fast will make the heart rate faster. The average body temperature recorded is 97.1, and the average blood glucose level recorded using a glucometer sensor is 5.61. Minimum, maximum, average, and standard deviation were used to statistically analyze the collected data.
Heart rate, body temperature, and blood glucose level are essential human body traits to identify normal and abnormal health conditions.
Figure 7a represents the average, minimum, maximum, and standard deviation of heart rate data collected during the subjects’ activities.
Figure 7b represents the average, minimum, maximum, and standard deviation of blood glucose level data collected during the subjects’ activities.
If an elderly patient has a disease or injury, it will weaken the heart, and the body organs will not receive enough blood to function normally. A human being’s heart rate gets progressively slower when a person moves towards adolescence. The normal heart rate, body temperature, and blood glucose level are analyzed to set a threshold for anomaly detection and alarming abnormal behavior. Heart rate data is in beats per minute (BPM), whereas blood glucose level data is in millimoles per liter (mmol/L).