Development of a Novel Health Promotion System Based on Wireless Sensor Network and Cloud Computing

Existing health promotion systems (HPSs) have some shortcomings, such as lacking in the ability to plan exercise prescriptions (EPs) for individuals automatically, difficulty in acquiring in a timely manner the physiologic signals of users who are doing exercise, and having no efficient mechanisms for notifying medical personnel of users’ emergent conditions. Aimed at addressing these shortcomings, in this study, we leverage the technologies of wireless sensor network (WSN), mobile communication, and cloud computing to develop a cloud-based HPS. The HPS contains a health promotion cloud service platform that can construct users’ physical fitness models and then generate appropriate EPs for the users to perform various exercises. On the user side, in this study, we design an exercise-sensing device that can timely acquire the physiologic signals and global positioning system (GPS) positioning information of users who are doing exercise through the WSN. Several sensors, such as a GPS sensor, are designed into the exercise-sensing device. The exercise-sensing device can then send those data to the cloud service platform through mobile phone communication to allow the users to master their exercise records. In this study, we also design a cloud alarm mechanism that can efficiently notify medical personnel and family members of the user’s emergent states through mobile phone push service. In addition, on the basis of fuzzy inference, we develop an EP adaptation mechanism that can accept the feedback information from the user and can then automatically adjust the user’s EP to an appropriate strength level. The results of this study can be a useful reference for constructing new-generation HPSs.


Introduction
According to many medical reports, people who are overweight or obese have a high risk of having a chronic disease. (1,2)Hence, to be healthy, exercise has become an inevitable trend.It is well known that, to maintain good physical strength, regular workout is required.However, people always have different excuses to exercise, such as busy with work, laziness, and forgetting to exercise.Therefore, some approaches are used to schedule exercise time, such as a memo on a calendar and recording in a notebook.How to assist humans in managing their physical activities is an interesting research issue that is worthy of investigation.
With increases in microprocessor efficiency and advancement in Internet technologies, many health promotion systems (HPSs) have been developed to help people record daily exercise.Elgazzar et al. proposed a concept of remote health condition monitoring via a mobile device. (3)This system allows users to access physical data by using a smartphone, but it has limited storage and is not accessible by multiple users.Lee et al. proposed an abnormal alert mechanism by using a short messaging service for chronic patients. (4)Chen developed a remote health care system by using a private cloud service and virtualization technology for users to store their personal medical data. (5)Hsiao integrated three kinds of sensors, including electrocardiography, an accelerator, and a global positioning system (GPS) receiver, into a mobile device to help users be aware of their physical condition while exercising. (6)Wu et al. built a mobile health management system into a smartphone to enable users to carry out exercise 333, which means an individual takes a 30 min exercise at least 3 times a week with 130 heartbeat rates after exercising. (7)However, the lack of personal exercise suggestion shows that there is still room for improvement.Lim et al. developed an exercise management system for individuals. (8)The system can calculate the daily calories that a user should consume according to the physical data that he/she inputs in advance.
In general, the above-mentioned health care systems are developed to help people manage their physical condition.However, there are still some drawbacks that should be improved.We summarize three points of view and illustrate them as follows.
(1) Insufficient personal exercise plan: Traditionally, an exercise prescription (EP) is designed by a fitness coach or a rehabilitation physician.After evaluating a person's lifestyle, health condition, and physical fitness, a fitness coach designs a specific EP for the person and then tracks the progress of the person in a certain period to determine whether the exercise intensity is suitable.This approach takes a lot of time to generate an EP and is insufficient.Thus, it is inadequate for a person to obtain an exercise plan in an easy manner.
(2) Lack of active notification mechanism for exercise management: Nowadays, people easily experience high blood pressure in daily work.Hence, many excuses are used by people to evade exercise, such as they are too busy and it is raining outside.It is easy to set a goal for exercise, but the lack of an active notification mechanism makes it hard to reach the goal.
(3) Lack of emergency report for multiple users: People with chronic disease or obesity belong to a high-risk group when doing high-intensity exercise.How to maintain the safety of these people when they are exercising is an important issue.If an abnormal condition occurs, the system should inform relatives to carry out emergency treatment.
In this paper, we aim to propose a novel HPS based on cloud computing and wireless sensor network (WSN) technologies and promote the development of a wearable device for users to monitor their physical data while exercising and utilizing a smartphone to gather parameters and then send them to the cloud side for further use.Two sensors are adopted to acquire the necessary parameters of this work.The first one is an SpO 2 sensor that can estimate the pulse rate and oxygen saturation in the blood.The other one is a GPS sensor that can receive the latitude and longitude parameters for locating the position of the exercising individual.
The objective of this research is to help a user create a personal exercise plan with safety consideration and develop a regular exercise practice.

Design of Health Promotion Architecture
According to the review of the literature for the above-mentioned HPS, in this paper, we aim to develop an HPS with the capabilities of specific EP, active exercise management (AEM), and alert push service.The functional requirements are illustrated as follows.
(1) The HPS is capable of measuring personal physical data: Users' physical data, such as heartbeat rate, are basic physiological parameters that indicate their body condition.In addition, the HPS has a GPS module to record users' running path and provide location for relatives when a dangerous situation occurs.
(2) The system should have the capability of classifying the fitness level automatically: In general, the fitness level classification should be finished by at least two persons.One does the fitness exam and the other records.This conventional way is inconvenient.The HPS can classify individual fitness levels automatically to improve convenience.
(3) The HPS should provide EPs for individuals: Nowadays, a suitable individual EP is created by a fitness expert.A fitness expert should evaluate some factors of people, such as daily diet, physical conditions, and exercise objective.The HPS designs an expert knowledge database to achieve the capability of having an EP in an easy manner.(4) The HPS is capable of feedbacking an EP: After working out the EP, people may have different feelings of rating the physical intensity.To create a more suitable EP for individuals automatically, the HPS should adjust the activity intensity by estimating the rate of perceived exertion automatically.
(5) The system should provide the function of automatic scheduling: An EP is an exercise plan.Individuals should follow the plan to do activities regularly.To improve the motivation, the HPS should have functions of automatic scheduling and active reminding of individuals.(6) The HPS should have an alarm report in an emergency: When the user is detected as being in an abnormal situation, the HPS can inform the fitness care or emergency organization to apply first aid treatment immediately to ensure the safety of the user.
On the basis of the aforementioned functional requirements, an HPS architecture is proposed as shown in Fig. 1.The architecture can be divided into three parts, namely, cloud, user, and care sides, which are illustrated as follows.
(1) Cloud side: To fulfill the requirements of the HPS, several functional components are designed on the cloud side.For easy remote access, all functional components are implemented using window communication foundation (WCF) technology and illustrated as follows.
• Graphic user interface (GUI): The GUI provides a user-friendly operational interface for users.• Physical data collection (PDC): PDC cloud service is designed for receiving and recording users' data during exercise, including heartbeat, blood oxygen saturation, location, and so forth.• EP: EP cloud service is responsible for automatically planning personal EPs.(2) User side: The users of the HPS can grasp their exercise information by using a smartphone via Wi-Fi or 4G communication.Hence, except the GUI, five functional components are developed into a smartphone, including physical data acquisition (PDA), health evaluation (HE), exercise training (ET), exercise recording (ER), historical recording (HR), and push service registration and listening (PSRL).In addition, a wearable hardware design for the user including a GPS sensor, physical sensors, and a wireless router is utilized.
(3) Care side: The participant on the care side can be a relative or an exercise consultant.A laptop or a tablet can be used to examine users' exercise progress.The functional components on the care side include a mobile GUI, an abnormal condition display (ADC), and PSRL.

Design of Core Functional Mechanisms
An entire procedure of a HPS consists of five stages, namely, health examination, fitness examination, EP, exercise, and efficiency evaluation.These stages are the core functional mechanisms of the HPS, which are shown in Fig. 2. They are designed as follows.

• Health examination
In the health examination stage, users should have a health checkup in a hospital.According to the health check report, users can fill out the list of the HPS through a browser that includes body mass index (BMI), potential disease, and other physiological parameters.The HPS can evaluate the health risk level.

• Fitness examination
The second stage is fitness examination that can help the users of the HPS to grasp their physical condition on their own.Also, the HPS can provide an adequate EP for individuals.Fitness examination is composed of four items, namely, cardiopulmonary fitness, muscle fitness, softness, and body composition.

• EP
The specific EP should consider the exercise mode, intensity, duration, frequency, and progressiveness relative to an individual's health condition, age, fitness examination results, and the items of the EP for individuals including the type of exercise and short-and long-term objectives.

• Exercise
The objective of doing exercise is to encourage users to improve daily physical activities, bring up regular exercise convention, and observe the reaction after exercise.

• Efficiency evaluation
Users can realize the advantages and disadvantages of carrying out the EP, and this is the objective of the efficiency evaluation.Then, they can adjust the exercise items according to the evaluation results.
To help the users grasp their health conditions, in this paper, we adopt health risk level classification.After filling up the questionnaire on the web page, the system will generate a risk level for an individual.The steps are shown in Fig. 3 and described as follows.
Step 1: The user opens the application form of dangerous factor analysis.
Step 2: The user fills up personal health conditions according to the instructions.
Step 3: The system starts to identify the risk level.Step 4: The system determines the risk level for the user.Risk levels are considered to be low, medium, and high.
Step 5: The system generates the health risk evaluation report.
Step 6: The system calls the WCF service to save the report to the DB on the cloud side.
Step 7: The HPS on the cloud side executes the "save report" method.
Step 8: The evaluation parameters are saved into the DB.
Step 9: The system saves report information to the smartphone DB.
To generate the fitness level for individuals, four fitness tests, namely, 3 min ladder climbing test, 1 min sit-ups, sit and reach, and BMI measurement, are conducted.The user should input the value of sit and reach and BMI in advance.Then, the user can just follow the instructions of the fitness examination function of the smartphone to generate his/her fitness level automatically.The workflows are shown in Fig. 4 and described as follows.
Step 1: The user logins to the system of the smartphone by inputting a valid ID and password.
Step  In this research, we design an automatic counting function in the smartphone when the user is doing push-ups and sit-ups, which is realized using the 3-axis accelerometer embedded in the smartphone.Figure 5 shows the X, Y, and Z value changes of the accelerometer observed when a user performs push-ups and sit-ups.We measure the x, y, and z values when the user performs push-ups to obtain the threshold for counting.The x and y values range from −0.2 to 0.0 and 1.0 to 0.95 in the body-up stage, whereas they range from −0.85 to 1 and 0.0 to 0.5 in the bodydown stage, respectively.Similarly, we obtain the threshold for sit-up counting.Then, we use these thresholds to determine whether a user is completing one count or not.
Before generating an EP, the user must have finished fitness examination in advance.The workflow of generating an EP is shown in Fig. 6 and illustrated as follows.
Step 1: After finishing health evaluation and obtaining the fitness level, the user sends the information to the cloud DB via a smartphone.
Step 2: The user sends a command to the cloud to generate an EP.
Step 3: The prescription generator (PG) on the cloud side requests the user's information from the DB.
Step 4: The PG categorizes the EP for the user.
Step 5: The PG obtains the EP by classification from DB.
Step 6: The PG makes an EP schedule for the user.
Step 7: The PG saves the EP schedule to the DB.
Step 8: The PG downloads the EP schedule to the user to inform him/her to do exercise on schedule.When the HPS generates an EP, the user can do regular exercise training on schedule.The workflow of exercise training is shown in Fig. 7 and described as follows.Step 1: The user logins the HPS by using the ID and password acquired in advance.
Step 2: The HPS activates the function of ET for the user to start ET.
Step 3: ET obtains the user's daily EP from the DB.
Step 4: The user follows the EP to do exercise.In this paper, the first exercise item is jogging.
The exercise-sensing device acquires the physical data of the user and then sends them to ET in a wireless manner.
Step 5: ET activates exercise items of push-downs and sit-ups, as well as the muscle fitness counter function to record the user's fitness result.Steps 6 and 7: ET stores the fitness data into the DB on the cloud side and into the smartphone.
Step 8: The GUI displays the user's physical data.
Step 9: After finishing all exercise items, the user keys in the rating of perceived exertion (RPE), which is divided into five levels, namely, very easy, easy, normal, difficult, and extremely difficult.Steps 10 and 11: ET calculates the exercise score and then saves it into the DB on the cloud side and into the smartphone.The HPS obtains exercise data, such as the degree of completion (DC) and the RPE, from the DB periodically to evaluate the user's physical condition.Then, the adaptive analyzer of an EP adjusts the duration or intensity for the user.Figure 8 shows the workflow of evaluating the effectiveness of the EP, which is explained as follows.
Step 1: The EP obtains exercise data including the DC and RPE from the DB on a Sunday.
Step 2: The adaptive analyzer of the EP starts to analyze the user's physical condition and evaluates whether the EP should be adjusted or not.Step 3: If the EP is adjusted, the adjusted EP to DB is saved.
Step 4: The EP sends the updated message to a mobile phone push service, which is developed by a third-party company.
Step 5: The mobile phone push service pushes the EP-updated message to the user's smartphone.In this study, we define the anomaly threshold of doing cardiorespiratory fitness sports as follows.
(1) The heartbeat rate reaches 90% of the maximum Heartbeat rate; here, it is 220 minus the age.
(2) The SpO 2 value is less than 90%.When the wearable device measures the two above conditions for 1 min, the user may be in danger if he/she works out continuously.Hence, the AR will push an alert message to the smartphone of the user as well as that of a relative.

System Implementation and Integrated Testing Results
In this study, some software tools are adopted to implement the system and are illustrated as follows.
• Integrated development tool: Microsoft Visual Studio.NET 2015.
• Exercise-sensing device: Cygwin and Atmel AVR studio.
Considering the hardware, we adopted for implementation a personal computer, a smartphone, a Wi-Fi router, and two Zigbex sensor modules (e.g., GPS).The SpO 2 sensor can detect the user's pulse and oxygen saturation by using light-emitting diodes and a light detector.The prototype of the wearable exercise-sensing device and the App on the smartphone are shown in Fig. 9.
According to the functional designs, the HPS is implemented as shown in Fig. 10.Three parts, namely, cloud, client, and care sides, are developed and illustrated below.(1) Web pages on cloud side: The web pages provide detailed information of physical activities for users and caretakers to remotely access via a browser, including personal EP, exercise record, and emergency information that is shown at the top of the figure.Also, there is a DB on the cloud that used to store the system information for users.For pushing emergency alert, we integrated the mobile phone push service developed by a third-party company, which is shown on the top-right side of the figure.On the personal EP page, the user can examine daily exercise items and follow the schedule to perform regular training.On the exercise historical data page, the user can browse daily exercise results.The abnormal report page provides the GPS location for users and their relatives to carry out emergency treatment as soon as possible.display.In the sports information option, the user can fill up personal data, measure his/her resting heartbeat rate, create a fitness analysis chart, generate a health evaluation report, and set the information of the caretakers.In the EP option, the user should finish answering a physical activity readiness questionnaire, risk level assessment, and fitness examination before regular exercise.In the EP training option, the user can choose a physical activity that he/she wants to do and examine his/her exercise status instantly while exercising.
(3) App on care side: The lower right side of Fig. 10 shows the App implementation on the care side.Three main functions are implemented to help a user's relative or a consultant to monitor the status of the user, such as a mobile login interface, a listening setup, and an abnormal situation display.People on the care side can use a smartphone to log into the system and begin the procedure of using the listening setup.After finishing the procedure, the valid user on the care side can receive the abnormal report from the cloud side in case of emergency.Also, the people on the care side can apply first aid treatment in such a situation.
To validate the function of the App, we adopt push-ups and jogging as examples and the results are shown in Figs.11 and 12, respectively.In Fig. 11, we clearly observe that the user wears the exercise-sensing device for jogging and that the App on the smartphone shows the heartbeat rate, exercise time, and running distance.In Fig. 12, for the user doing push-ups and the App showing the duration, the objective times of round 1 and the count of the user are shown.After exercising, the user can key in the PRE-level on the App shown in the middle of Fig. 12.
In this study, an AR scenario is conducted to validate the effectiveness of the HPS.The message flow is shown in Fig. 13 and illustrated as follows.When the user is jogging and the AR cloud service of the HPS detects an abnormal situation according to the biomedical data acquired from the user, the AR calls the mobile phone push service to push an alert message to the user's smartphone as well as to a relative's smartphone on the care side.The relative can receive an emergency alert on the smartphone and then can obtain the alert report to understand the user's condition and GPS location.Accordingly, the relative can call an ambulance to bring the user to the nearest hospital to carry out an emergency treatment.On the basis of a WSN and cloud computing, we developed a cloud-based HPS, which has several distinct features and can effectively assist users to improve their physical fitness and promote their health.Some popular technologies are utilized to design suitable EPs for individuals such as WCF, smartphone App, and WSNs.To acquire the user's physiological data and location information, we adopt two sensors, namely, SpO 2 and GPS.Also, the 3-axis accelerometer embedded in the smartphone is used to count when a user performs sit-ups and push-ups.In addition, the HPS provides functions of AEM and abnormal situation report.The user can obtain a suitable EP by using a cell phone and accessing the personal data on the cloud.During exercise, the cell phone monitors the user's physical parameters and then saves them into its DB as well as on the cloud.To help the user achieve the goal of the EP, the HPS adjusts the intensity according to the perceived rating exertion (PRE) after exercise.

Conclusions
After system integration and function verification, the HPS satisfies the requirements of health promotion and improves the wellness of the practitioner to exercise.Also, it brings about good practice to maintain good physical condition.

•
AEM: AEM cloud service helps participants manage their exercise schedules and actively reminds them to do exercise on schedule.Also, AEM analyzes the effectiveness of users' EPs for further use.• Alert report (AR): AR cloud service has the capability of promptly sending alert messages of users' abnormal conditions during exercise.• Historic data query (HDQ): HDQ cloud service is created for users to query their exerciserelated data.• User management (UM): UM cloud service is designed to manage users' accounts of the HPS.• Database (DB): The DB is used for storing various data of the HPS.

2 :
The user chooses fitness examination of the exercise training function to start fitness tests.Step 3: The user starts to perform the 3 min ladder climbing test.The wearable device acquires physiological data continually as well as sends the data to a smartphone.Step 4: After finishing the 3 min ladder climbing test, the user starts to perform sit-ups.

Fig. 9 .
Fig. 9. (Color online) Prototype of exercise-sensing device and App on smart phone.

( 2 )
App on client side: The App developed on the client side is shown on the left-hand side of Fig. 10.The wearable device is also implemented on the client side to acquire the user's biomedical data.The App on a smartphone includes login, function options, EP, and EP training (jogging and push-ups as examples).First, the user ID and password input on the login page are used to verify the identity of the user.After logging into the HPS, the page of function options such as sports information, EP, sports training, and sports log is shown on the mobile

Fig. 12 .
Fig. 12. (Color online) User doing push-ups and the display of the App.