Upload
marwan-issa
View
449
Download
1
Tags:
Embed Size (px)
DESCRIPTION
This dissertation focuses on analyzing the accelerometer data collected from built-in sensors in smartphones using the advanced technology of cloud computing for processing and analyzing.
Citation preview
Page 1 of 47
CSC8499 Individual Project: User Activity Analysis
Using Accelerometer and Cloud Computing
Marwan Ali Issa
MSc in Advanced Computer Science,
School of Computing Science, Newcastle University.
Abstract. This dissertation focuses on analyzing the accelerometer data collect-
ed from built-in sensors in smartphones using the advanced technology of cloud
computing for processing and analyzing. The motivation behind this project is
on how to get the benefit of cloud computing technology as backend such as the
performance and storage using mobile platform as a client. In addition, the
availability of such mobile applications has been tempting many people to rec-
ord their daily activities such as walking, running and sleeping on their
smartphones. Although, there are many mobile applications in the market deal
with the daily exercise, but with new paradigms of cloud computing technolo-
gy, it can be used with smartphones to get benefit from this technology.
As a result, the dissertation shows the advantages and disadvantages of using
advanced technology of cloud computing. In addition, this project aims to study
the efficiency of using cloud computing platform instead of mobile platforms
by comparing the two environments. Even though, the dissertation does not at-
tain all the objectives of this project, but still there are significant accomplish-
ments which can be a scientific potential for other research and projects. Final-
ly, recommendations to improve the structure of cloud computing platform (e-
Science Central) regarding analyzing data were presented.
Declaration: I declare that this dissertation represents my own work except
where otherwise explicitly stated.
1 Introduction
1.1 Overview
Nowadays most people are using smartphones which have become very popular in
everyday life. Smartphones have revolutionized technology by reducing the gap be-
tween the mobile phone as voice communication and computer capabilities [25].
Smartphones have more powerful processes which deal with different applications
simultaneously. The most useful norm is having the smartphones useful due to the use
of sensors and accelerometer to deal with a variety of applications in smartphones
which use accelerometer. This has allowed growth of usage of a variety of applica-
tions within smartphones in real life [18].
Marwan Ali Issa
Page 2 of 47
Cloud computing is another paradigm that can be used to replace a single physical
computer with a virtual computer over the internet. In this paradigm users can use the
same functionality and move over the internet with less time and less cost. Advanced
technology nowadays provides users with a platform that implements numerous ap-
plications in different localities [24]. Thus in this case, a computer as piece hardware
can be regarded as less important due to provision of a cloud. Advanced technology
has the potential of converting a smartphone into a mini computer with an inbuilt
sensor whereas a real computer can be converted into a virtual one functioning as a
cloud technology environment [24].
Based on the aforementioned technology, people can use smartphones to get dif-
ferent accelerometer data and send it to a cloud to process and analyze. Most re-
searchers are studying the smartphone using the mobile platform for implementation.
This project aims at analyzing both the advantages and disadvantages of applying
accelerometer techniques using a cloud computing environment, in order to devise its
efficiency.
1.2 Motivation
To understand the relationship between sleep, health and daily activity, Chinese
medicine as an example focuses on the quality of sleep to indicate people’s health
status, also it is a medicine to cure different physiological disease [7]. So the question
here is, can we indicate or determine the quality of the sleep using collected data
while the user is sleeping to generate feedback on the user’s life and health.
Moreover, with advanced technology people are motivated to know more about
their daily activity like walking and running especially for those who have weight
problems, high blood pressure or cholesterol. This type of application may increase
people’s health awareness; also they can monitor daily life activity with less effort
and cost [19].
Most of the applications which use smartphone sensors are only using the storage,
power and the processors of the mobile, but looking at advanced technology such as
cloud computing and its capabilities, it incentivize us to make a transformation from
mobile based applications to mobile-cloud based. Cloud computing is believed that
has benefit and potential to support and solve mobile applications through huge per-
formance and infinity of storage which means smartphones with cloud computing do
not need high performance or storage in the smartphone itself.
The project does not have a particular category of people that will be assessed but
instead is dependent on the availability of a smartphone and internet.
1.3 Aim
The aim of this project is to demonstrate the possibility of using the advanced
technology of cloud computing to support mobile applications that can collect data
through smartphones sensors from user activities such as walking, running and sleep-
Marwan Ali Issa
Page 3 of 47
ing. In addition to the above point, the project also aims to demonstrate the efficiency
of data processing within a cloud environment against a smartphone platform.
1.4 Objectives
The objectives of this project are to develop software which contains two parts us-
ing accelerometers:
1.4.1 Build mobile applications based on cloud technology
The objective of this part is to build an application which will capture three di-
mensions of the accelerometer when the user does the exercise such as walking and
running or sleeping and send all this data to the cloud to process and analyze. In addi-
tion, building required blocks of codes in the cloud platform to determine the number
of steps and number of movements through pedometer and sleep algorithms. The aim
of this part is also to get some benefit from the accelerometer indoor and outdoor.
Moreover, the user can run this software and put the mobile in his pocket or in suita-
ble place; at the end of the day feedback will be displayed about all the activity he has
done. Otherwise, it can use for sleep monitoring by running the application and plac-
ing the mobile on the bed to get the quality of sleep for each night.
1.4.2 Cloud computing using e-Science Central
Cloud computing in this application has an important aspect which is using the
Platform as a service (PaaS) provided by e-Science Central1 to process and analyzes
the data with huge processing power and free storage. The objective of this part is to
build the required blocks and connect them to each other. The target is to receive
collected data from mobile application and starts to process it through specific algo-
rithm and analyze the data, and also to generate the required result that will be saved
within the cloud.
In addition to the above point, the second part of this objective is to build another
application only using the mobile platform to compare and contrast the efficiency of
cloud environment against mobile regarding processing time.
1.5 Dissertation structure
Chapter 1: Introduction, this chapter defines the project through overview
and motivation behind the project to get some knowledge about the technol-
ogy and purpose of the project. It also explains the aim and objectives to de-
scribe what this project intended to do and how.
Chapter 2: Related Work, this chapter enlightens the background research
covering and analyzing some topics which have been done to investigate and
propose different solutions.
1 e-Science Central: Software and Platform as a Service for scientific data provided by Newcastle University.
Marwan Ali Issa
Page 4 of 47
Chapter 3: Requirement Analysis, this chapter clarifies the needs, require-
ments and the boundary of the project.
Chapter 4: System design, this chapter designates how the proposed project
designs through different levels and categories and the reason behind the
idea of the proposed design.
Chapter 5: Implementation, this chapter labels the programming languages,
tools, technologies, platforms and different algorithms to solve the problems
behind this project.
Chapter 6: Evaluation and testing: this chapter shows different evaluation
and testing for different parts of the project to prove the idea of the project.
Chapter 7: Conclusion, this chapter is about the conclusion of the project re-
sult and some future work which may be inspired by technologies behind
this project.
2 Related Work
2.1 Background
This section covers the summary of some terms such as accelerometer, cloud com-
puting and e-Science Central. The purpose is to establish knowledge and understand
the area of the project.
2.1.1 Accelerometer
It is an “Instrument that measures acceleration. Because it is difficult to measure
acceleration directly, the device measures the force exerted by restraints placed on a
reference mass to hold its position fixed in an accelerating body” [17]. Most
smartphones now have an accelerometer which is used for different purposes such as
rotating the screen, games and shaking the device.
This dissertation focuses on using the accelerometer for different human activity
such as detecting changes of the device motion when the user puts the mobile on the
bed during sleep time. Furthermore, when a person is walking, the steps are usually
very regular and observing the output of the accelerometer enables the detection of
steps [29].
2.1.2 Cloud computing
The National Institute of Standards and Technology (NIST) defines cloud compu-
ting as “a model for enabling universal, appropriate, on-demand network access to a
shared pool of configurable computing resources such as networks, servers, storage,
applications and services that can be quickly provisioned and released with minimal
management effort or service provider interaction” [16]. From this definition, the
Marwan Ali Issa
Page 5 of 47
target of cloud computing is to move processing and computing data from personal
computers or small networks to large scale on-demand access to computing data
Cloud service has three characteristics which are: sold on demand, elastic, fully
managed by providers. In addition cloud computing has three main categories as fol-
lows:
A- Infrastructure as a Service (IaaS): is a provision model in which an organiza-
tion outsources the equipment used to support operations, including storage,
hardware, servers and networking components. The service provider owns
the equipment and is responsible for housing, running and maintaining it.
The client typically pays on a per-use basis [16, 8].
B- Platform as a Service (PaaS): is a way to rent hardware, operating systems,
storage and network capacity over the Internet. The service delivery model
allows the customer to rent virtualized servers and associated services for
running existing applications or developing and testing new ones [16,8]
C- Software as a Service (SaaS): is a software distribution model in which ap-
plications are hosted by a vendor or service provider and made available to
customers over a network, typically the Internet [16,8]
2.1.3 e-Science Central
e-Science Central is defined as “software and Platform as a Service for scientific
data management, analysis and collaboration which can be deployed on both public
and private cloud” [26]. By this definition we can understand that it can be catego-
rized as:
Science software as service: it is a website, so the scientists only need a web
browser to access their scientific data from anywhere and use their PC or mobile de-
vice from the website to share, upload and analyze their data [27].
Science platform as service: it gives the scientists the ability to build their applica-
tions which supports storage services, workflow services, social networking and secu-
rity [26,27].
Storage: The storage data on e-Science Central is versioned, signed and supports
multiple storage systems for wide deployment options. It uses virtualized storage
which has an interface supporting document and folder versioning, and the structure
of e-Science Central storage service is based on file system [27].
Workflow: Scientists can design workflows using generic and native blocks wizard
using drag and drop through a web application. The input and output for each block
are typed to avoid incompatibility. Moreover, scientists can develop and build their
own blocks which can be part of the workflow [27].
Figure 1 shows the structure of e-Science Central which contains all the software,
platform and infrastructure as a service.
Marwan Ali Issa
Page 6 of 47
Figure 1.e-Science Central architecture.
2.2 Accelerometer based health care application and research
Related work addresses relevant work that has been conducted academically, from
industry or research groups considering the use of mobile applications capturing sleep
motions and exercise activities such as walking and running. In addition, it intends to
critically evaluate some applications which address to the same topic.
Previous work and research can be categorized by their results and their approach-
es of analysis. Most of this work is only tested on mobile devices, but they have dif-
ferent algorithms to analyze the data collected. The following are some applications
and related research which are closely related to the subject of this dissertation.
The article “Automatic Step Detection in the Accelerometer Signal” by Ying et al
[29] studies three algorithms (Pan-Tompkins method, template matching method and
peak detection based on combined dual-axial signals) and describes disadvantages
and advantages for each of them.
A- Pan-Tompkins method is easy to implement, but yields the positive and negative
as a good feature, that can result in false peak detecting
B- The great advantage of the template matching method is that the algorithm is
capable of detecting the steps self-adaptively and generating the representative
template according to the current step signal.
C- Peak detection based on combined dual-axial signals is the fastest and easiest of
the three algorithms. So far, it provides good performance in the first experiment.
Moreover, it can be easily written as a fixed-point algorithm, which is suitable for
integration into microprocessors of limited computing power.
This article explains in detail each algorithm which is used partly in this project and it
studies different ways of implementing algorithm process collected data using differ-
ent algorithm. Each of these algorithms has advantages and disadvantages in achiev-
ing high quality in detecting the number of steps.
Marwan Ali Issa
Page 7 of 47
Observing the advantages and disadvantages for each algorithm from the report can
thus help this dissertation to decide which algorithm can be implemented. Although,
all the algorithms have similarity, but still the difference for each algorithm may pro-
duce different result. In this dissertation, mostly the first algorithm is followed with
some modifications.
The article “Step Counting Using Smartphone-Based Accelerometer” by Naqvi et
al [19] identifies the steps by the relation between frequency of the step and the mag-
nitude of the accelerometer signal. The algorithm of this paper follows these steps:
A- Device position and orientation: device fixed near center of the body
B- Dataset used for analysis: frequency of the data is 100Hz, collect data from
different user and different level of walking.
C- Understanding the accelerometer reading: ignoring the amount of data due of
no movement of the user is named as white noise
D- Detecting of starting point
E- Detecting of steps
This article takes different approach than this dissertation; it deals with frequency and
magnitude of the accelerometer data, while this dissertation focuses on peak detection
algorithm and determines the walking and running status according to the magnitude
of the accelerometer data. The result of the algorithm in this article is accurate with
0.67% error rate. Otherwise, this article only deals with normal walking and it is not
applicable with different style of walking such as on stairs.
The article “A simple method for reliable footstep detection on embedded sensor
platforms” by Libby [14] simply presents a method for step detection using sensors
which are embedded in different devices. He follows the algorithm which explained
before in the first article “Pan-Tompkins Method” from the same source as the first
article. By taking this algorithm he faced the same disadvantage as described in the
first article which is false peak detection. Same disadvantage are faced as described in
the first article which is false peak detection. The advantage of this article is that it
opens new opportunities to modify the mentioned algorithm to let the algorithm work
faster and more effectively.
The article “Analysis of Sleeping Patterns Using Smartphone Sensors” by Steven
Meliopoulos and Suhel Sheikh [15] investigates how to detect the optimal moment to
wake up the user in the light stage of the sleep, also to identify possible sleep prob-
lems. The aim of this article is to build an application using smartphone and built-in
accelerometer and adding a server to collect data and make comparison with other
users. In this article they use an algorithm which is derived from different articles
which can be summarized as:
Filtering: the first step of this algorithm is to take the derivation of the collected
data
Threshold: to eliminate the noise they applied a threshold to cut off all the values
which are less than the value of the threshold.
Counting the number of changes: it calculate the number of changes per second,
minute and hour.
Although, this algorithm reassures the user that the position of the device does not
have any influence on the result, but through this dissertation it appears that ignoring
the magnitude of the movements may direct the application to detect unimportant
Marwan Ali Issa
Page 8 of 47
movements caused by the nature of the built-in sensor. This dissertation focuses on
the same algorithm plus the magnitude value of the threshold for each time window.
They tested this research on mobile phones, but they used a website to view the re-
sult of multi-user instead of the mobile screen.
In analyzing the data they only propose weekly statistics of the average sleep dura-
tion and average of event frequency. Having the collected data and good algorithm to
identify the frequency of movements allows improvement of the analysis base, such
as letting the user check the level or stage of sleep, using the result to wake up the
user in the light stage of sleep.
The article “Monitoring Body Positions and Movements during Sleep using
WISPs” by Hoque, Dickerson and Stankovic [13] researches how body movement
while sleeping may relate to some particular diseases. In this article they use WISP
(Wireless Identification and Sensing Platform) with active RFID (Radio Frequency
Identification) based sensor equipment. The results of this research identify that the
system can detect all the movement while sleeping, studying four positions of the
body as lying left, right, stomach and back. However, in this study they use a similar
algorithm to the previous article by looking at the collected data from sensors and
comparing it with that threshold and count the number of values which cross the
threshold. In addition they do not unify the three axis in one value, the reason behind
that to identify the position of the body by monitoring the change of the value for
each axis.
There are many applications that use the same algorithm to determine the number
of steps such as pedometer app [6] and runtastic pedometer [22] and also many appli-
cations are using the algorithm of sleep movement detection such as Sleep Time
(alarm clock) [5], which works on Android and iOS operating systems. All the articles
and applications are focusing on the mobile platform or using other devices to capture
accelerometer data. In this project, mobile platform was used with Android operating
system. Moreover, we built this project upon these researches and modified some part
of the algorithm according to the requirements of this project and looking at many
applications to get better experience of what people expected when using these appli-
cations
2.3 e-Science Central cloud technology related researches
This section focuses on using e-Science Central to process and analyze the data on
cloud technology. Newcastle University provides scientists with the computational
resources which they need for their designs, implementation and to maintain their
application.
The article “Developing Cloud Applications using the e-Science Central Platform”
by Hiden, et al [11] describes some problems of cloud computing for each level of
cloud computing such as Iaas, Paas and SaaS. However, it describes the purpose of
designing e-Science Central to contribute in some areas such as platform cloud ser-
vices which provide storages, services execution, security, workflow provenance and
e-Science Central API.
As described in this article, storage can provide versioning for allowing users to
work with different versions of the document, services and workflows. Moreover, e-
Marwan Ali Issa
Page 9 of 47
Science Central provides security to protect their data unless users want to share the
document publicly. Furthermore, it provides social networks for more communication
between scientists for more collaboration in scientific research. In addition, scientists
can create blocks or use generic blocks to run their workflows. Each block has input
and output which are typed to avoid conflict which can be data wrapper, file wrapper
or object wrapper.
In addition, e-Science Central allows scientists to connect the platform through
their computer or using mobile application using e-Science Central’s REST API. For
better security, this API required client registration which needs URL, username and
password for each communication.
Articles such as “e-Science Central for CARMEN: science as a service” by Wat-
son, Hiden, Woodman [27] and “e-Science Central: e-Science on the Web, powered
by Clouds” by Watson et al [26] explain the functionality and capability provided by
e-Science Central for scientists to get the benefits of advanced technology such as
cloud computing.
This project is built upon the technology and service provided by e-Science Central
to demonstrate using mobile applications instead of PCs to connect and send collected
data from accelerometer for processing and analyzing using the storage and workflow
services of e-Science Central.
3 Requirement analysis
3.1 Project scope
This project provides the functionality to run mobile applications using built-in
sensors to collect the data from user activities such as sleeping, walking and running.
Following that, it provides the accessibility to execute different algorithms which are
related to the mentioned exercises using the advanced technology of cloud computing.
Moreover, the project provides the functionality of using the workflow and storage of
cloud computing (e-Science Central) for processing and analyzing the data.
3.2 Software requirements
3.2.1 Technical requirement
To compare the functionality of using cloud computing in this project with the
functionality of using only mobile applications, another application was built using
the process and battery power of the mobile to process and generate the same func-
tions and results. The results derived from this application are used to compare differ-
ent tasks to prove that using mobile application with cloud technology can be better
than using only mobile utilities. This application will be mentioned in the design and
implementation chapters for comparison.
3.2.2 Functional requirement
Marwan Ali Issa
Page 10 of 47
To describe all the interactions that the user will have with the application, use case
scenarios and diagrams can explain in detail these interactions which define the func-
tions performed by the system.
Use case is a textual representation of the structure of functional requirements
within the environment of the business or the system processes. It can be represented
graphically in a diagram and in a textual document.
3.2.2.1 Use Case (process of sleep)
Use case name: Process of Sleep.
Scope: Sleep part of the application.
Level: user goal
Primary actor: user
Stakeholders and Interests: The user wants an easy to use application and gets the
result after waking up
Pre-condition: The user is on the bed and the smartphone beside user on the bed
Post-condition: The user starts the application to collect the accelerometer data by
pressing START button.
Main scenario: When the user wants to start the application first he should lie
down on the bed and put the smartphone beside him and press the START button. It is
preferable for the smartphone to be on charge. In the morning, before getting up, the
user should press the STOP button to stop the accelerometer recording data. To look
at the result, first the user should press the SYNCHRONIZE button to upload the data
to the e-Science Central, after processing the data the user can look at the result by
pressing the RESULT button to look at the latest result and the result for previous
tests
Extension point (alternative flow ): When the user wakes up in the middle of the
night and presses STOP button the accelerometer will stop and when he want to start
again pressing START button will add the new value of the accelerometer to the old
one. If the user presses SYNCHRONIZE button, its mean the test is finished and if he
press the start button it will start new test for sleeping.
It does not matter the position of the smartphone, because the value of each accel-
erometer data is the absolute square root for summation of square three axis
3.2.2.2 Use Case (process of user activity)
Use case name: Process of user activity
Scope: Exercise part of the application
Level: user goal
Primary actor: user
Stakeholders and Interests: The user wants an easy to use application and gets the
result after daily activity like walking and running
Pre-condition: The user holds the smartphone. The rotation of the smartphone be-
fore walking does not matter.
Marwan Ali Issa
Page 11 of 47
Post-condition: The user starts the application to collect the accelerometer data by
pressing the START button and starting to walk or run.
Main scenario: When the user wants to start the application first he should press
the START button and start to walk or run, the application starts collecting the data
after two seconds. When the user wants to stop walking he should press the STOP
button at the same time as actually stopping. If the user wants to continue walking
pressing start button again will continue collecting the data and add to the previous
data. If the user wants to process the data on the cloud by pressing SYNCH button the
smartphone sends the CSV file to the cloud and e-Science Central finishes processing
and analyzing the data and automatically send the result to the smartphone so the user
can look at the result by pressing the RESULT button
Both of the use case descriptions are fully addressed which describe the success
scenario of the application and also describe alternative scenarios which can happen if
the user does not follow the instructions. In addition use case diagrams can be found
in the appendix C.
3.2.2.3 System Sequence diagram (SSD) and description
A sequence diagram is a kind of interaction diagram that shows how processes op-
erate with one another and in what order. In this section SSD only focuses on the
system as a black box, it only explains the sequence of interaction between actor and
the system as one part. Figure 2 describes both requesting and return messages to and
from the system respectively.
Figure 2. System Sequence Diagram
3.2.3 Non-functional requirements (Supplementary requirements)
Before starting the design of the project, there are some requirements which de-
pend on the structure of the project, because the project has two main parts, mobile
Marwan Ali Issa
Page 12 of 47
and cloud computing. For the first part users should have smartphone with Android
operating system which has a built in sensor and for the cloud computing part users
should have an account for e-Science Central which is free and have joined both Stor-
ageServices API and WorkFlowServices API. To communicate between mobile ap-
plication and cloud the smartphone should have access to the internet and it does not
matter if it is wireless or 3G.
4 System design
This chapter describes the overall system design, architecture and defines the com-
ponents which contributed to this project. This project has two main parts, mobile and
cloud computing based tasks. This chapter discusses the reasons and criteria behind
the chosen design between different architectures. It also discusses the interaction
between both users and mobile application to explain the user needs and how the
project can satisfy these requirements. It discusses and explains the reason behind
software design and what will happen inside the black box of the system through both
class diagrams and interaction diagrams.
4.1 Human-Computer interaction (HCI)
By definition, “it is a discipline concerned with the design, evaluation and imple-
mentation of interactive computing systems for human use and with the study of major
phenomena surrounding them” [10] the key component of this definition is that (HCI)
deal with the interaction between the computer as the digital part and humans as the
user part.
4.1.1 User Interface (UI) design
This section describes how the user interface design of the mobile application will
be simple and efficient to satisfy the user needs. In this project the user only interacts
with the mobile interface to run the application and thereafter looks at the results. To
simplify the interface, the interface of this mobile application only has some buttons
with clear text to let the user to go through the application in an easy way. The aim of
using only buttons is to make the interface of the application easy to understand.
The idea behind this design is that the developer or the designer can change the in-
terface to a different design according to the user’s point of view but the functionality
of the application will be the same, because the mobile part only collects the data and
sends it to the e-Science Central cloud for processing and analyzing. The current user
interface is shown in Figure 3. It represents the tree view showing the pages for navi-
gation.
Marwan Ali Issa
Page 13 of 47
Welcome Page
Sleep App page (Start, Stop) Exercise App page (Start, Stop)
Result history pageMulti user result page
Instance result
Result history pageCross population result
page
Instance result
Layer 1 Layer 2 Layer 3 Layer 4
Longitudinal analysis page
Figure 3. User Interface Design
4.2 Software design
4.2.1 Overview
This section studies the idea behind each part of the application and the reason for
choosing the type of the architecture, criteria for both mobile and cloud computing
also it goes one step further to explain the detail for each mobile software architecture
and e-Science Central architecture. In addition, it goes through both class and interac-
tion diagram for each specific part of the system.
4.2.2 Mobile and cloud computing criteria and discussion
In this section, the chosen design will depend on some criteria followed for each
part of the application.
4.2.2.1 Mobile application criteria
As mentioned in Section 2.2 most of the research and applications which focus on
the accelerometer use mobile application or other sensor devices. In this project mo-
bile application was selected, because most people already have their smartphone and
most of these smartphones have built-in sensors to capture the accelerometer data
[25]. In this project Android platform was used to build mobile application, Reasons
for selecting this platform include: it is written using Java language, it can be plugged
with eclipse which is a free tool, it provides free SDK for the developer to create dif-
ferent applications and publish them in the market for free.
Marwan Ali Issa
Page 14 of 47
4.2.2.2 Cloud computing criteria
Cloud computing in this project is the back end which implements all the pro-
cessing and analyzes the data. The importance of cloud computing is increasing with
increasing the number of users which increase the amount of processes. The question
here is why we choose cloud computing technology instead of using a server as the
back end? The challenge of this project is to find the way to minimize the work on
mobile platform to save time, battery power and performance, otherwise transfer the
hard work to other technology to help users to use simple devices such as
smartphones to get better result.
Cloud computing provides huge storage which can be suitable when thousands of
users use this application and also provides a platform to process the raw data. More-
over, the challenge of this project is how to share different result for different people
using the same application which let the application to be more interactive.
Cloud computing provides database structure to collect all the result from different
users. It may use for social networks for exchanging the data between different users
who want to share their result. In this project e-Science Center platform has the avail-
ability of social networking structure which may use in this project.
The advantage of cloud computing is that when there are any changes in the algo-
rithm or any process in the future it will be easy to change it in the cloud technology
instead of upgrading the mobile application from the mobile device itself.
The cost and performance of the cloud computing open a door for the developers to
use the storage and use great performance to run multiple tests with less cost than
using servers. Although, developers can use servers as back end, but using cloud
computing will make the maintenance and IT team who care on the technical side is
not required with cloud computing.
In light of these challenges and reasons, cloud computing technology was chosen
as a solution for different cases in the future.
4.2.3 Design options
As mentioned in the previous section that the project will use both mobile and
cloud computing platforms. This section goes through different options to distribute
process steps between both environments. Collecting data and displaying results will
be on mobile platform because of easy accessibility of using mobile interface instead
of using website. The remained steps will be explained as following.
Total acceleration: in this project the main point of using mobile to get the acceler-
ation magnitude and frequency values, so it does not focus on the value of each axis
rather the total acceleration. Each time when the sensor generates 3 values of acceler-
ation, it unifies them to one value which is the total acceleration of the device move-
ments. Doing this step in mobile platform will let the mobile application to save more
memory and more battery to send collected data with three times size to the cloud
environment
Data filtering: it is well-known that the power of the process in the cloud computer
is much greater than the mobile, so if this step happens in the mobile platform it will
Marwan Ali Issa
Page 15 of 47
generate same size of the file but with extra power and extra time to filter each data
and this amount of time and power can be saved if the process happens in the cloud.
Data processing and data analysis: both processing and analyzing of the data need
good performance power and the aim of this project is to minimize the time of the
performance. Also centralizing the process in one place is better than decentralizing,
because both of processing and analyzing of the data are case of change and upgrade
in the future. On other hand, analyzing data may needs the data from different users
who share their results, so the processes of analyzing will grow more and more by
increasing the number of users who share their results.
Using a mobile processer for analyzing the data from one user may not be a big prob-
lem but dealing with thousands of users is a big problem and transferring this step to
the cloud environment will save the application from potential crash.
Save result: this step only deals with storage and we know that the storage of the
mobile device is limited comparing with e-Science Central storage. Implementing this
step in the cloud will save a lot of memory of the mobile device that may be used for
a different purpose.
Table 1 below illustrates the above mentioned process steps within the design. Table 1. Design distribution structure
Process name Mobile platform Cloud platform
Collect accelerometer data Yes
Total acceleration Yes
Data filtering Yes
Data processing Yes
Data analyzing Yes
Store result Yes
Display Result Yes
4.2.4 Mobile design
In the light of the discussion from previous sections, Figure 4 shows only the pro-
cess that happens in the mobile platform. In this design, mobile application duty is
only to generate accelerometer data and send it as one value for each time as total
acceleration and save all the values inside one file and send it to the cloud when the
test is finished.
Marwan Ali Issa
Page 16 of 47
Start Application
Register the sensors
Axis X Axis Y Axis Z
Esc Cloud
Result of the activity
Send the result to the mobile
End Application
Total acceleration
Figure 4. Mobile design
4.2.5 e-Science Central workflow design
Figure 5 shows the design of the e-Science Central workflow which is independent
for each test conducted by the user. When the user finishes uploading the data using
mobile application, e-Science Central workflow starts to import the CSV file from the
store and select the column which has the raw accelerometer data, following that, it
starts to filter the noises. Processing the data will start when the data is filtered to
generate some values according to the requested algorithm, in the end analyzing the
data will generate results to save them in the store to be available for the user to ac-
cess the result at any time.
Start Process from Esc cloud
Upload data from mobile
Filter the data
Process the algorithm
Analysis the data
Analysis and process result
Multiple results
End Application
Figure 5. e-Science Central workflow design
4.2.6 Multi-users design Options
Depending on the previous e-Science Central workflow design; two options of de-
signing analysis multi user data will be discussed to leverage the performance of the
application when the number of users increases to thousands. In real life the applica-
Marwan Ali Issa
Page 17 of 47
tion should query the users for sharing agreement, but for study purposes we will not
deal with security and authorization case which are out of the scope of this project.
Moreover, this section focuses on the case of cross population between the users to
present this property. The implementation section discusses which option is more
reasonable for this application.
4.2.6.1 Option one
Figure 6 shows the first option of cross population design between different users
using the same application. This design takes an example of four users using this ap-
plication and they want to look at the other users’ results for comparison. They do not
need to use their specific account for e-Science Central; they will only call the admin
account to provide such a result. After authentications succeed, it will ask the cross
population analysis block to go and check all the results. The cross population block
will check each client data and calculate the number of steps, distance, speed and
calories burned and compare all the users’ result and send the result to the admin ac-
count to send again to every user who requests cross population analysis. The ad-
vantage of this design is to minimize the process on the mobile platform, minimize
the usage of the internet, and maximize the performance of the application when the
number of users increases. The disadvantage of this design is that e-Science Central
does not allow the creating block to manipulate the data from different users inside e-
Science Central platform; e-Science Central only allows creating blocks inside a per-
sonal account and manipulation of the data inside that account. Multi-User Architecture
Cross Population Design
ESC C
loud P
hase
Mobil
e Pha
se Client 1 Client 2 Client 3 Client 4
ESC Storage
Client 1-Test 1
Client2-Test 1
Client3-Test1
Client 4-Test1
Cross Population Analysis
Client 1-Test 2
Client2-Test 2
Client3-Test 2
Client 4-Test2
One Account On ESC
Request X-Population AnalysisResult X-Population Analysis
Figure 6. Cross population design Option 1
Marwan Ali Issa
Page 18 of 47
4.2.6.2 Option two
Figure 7 shows the second option of the design for cross population between dif-
ferent users using the same application and agreeing to share their information. In this
design each user has his own account and asks the cross population analysis block
which is inside mobile platform to generate the result from different users’ data. After
that the cross population block should request multiple data from each user using their
authentication information. At the end of the process each user gets the results from
the cross population block inside mobile application. The disadvantages of this design
are: more time to generate cross population result, more load on the internet for ex-
ample, if the number of users who want to share their information is 1000 and each
user has 10 tests, for each user to get cross population results, this mobile application
should connect to the internet 10 * 1000 = 10000 times which may cause the applica-
tion to crash. In addition it takes more power from the mobile device to analyze all the
data from different users. Multi-User Architecture
Cross Population Design
ESC
Clou
d Ph
ase
Mob
ile P
hase
Client 1 Client 2 Client 3 Client 4
ESC Storage
Client 1
Test1Test2Test3Test4Test5
Client2
Test1Test2Test3Test4Test5
Client3
Test1Test2Test3Test4Test5
Client 4
Test1Test2Test3Test4Test5
User 4 Account
User1 Account
User 2Account
User3 Account
Cross Population Analysis
Cross Population Analysis
Cross Population Analysis
Cross Population Analysis
Figure 7. Cross population design Option 2
4.3 Algorithm design
Designing the algorithm depends on the number of functions taken to provide cor-
rect result in the implementation chapter. This section describes the initial architecture
of designing the algorithm in both exercise and sleep parts of the project. The general
algorithm in this project will be divided according to the discussion section between
mobile and cloud computing platform (e-Science Central in this project). Each of the
Marwan Ali Issa
Page 19 of 47
steps in the diagram below will be explained in the implementation chapter by using
different tools and projects in different platforms.
Figure 8 shows that the algorithm has four main steps which are data collection,
data processing, data analysis and generation of results. Each of these steps has sub
data and sub functions and it should be available to complete the algorithm process.
Algorithm Design
Function
Clou
d Ph
ase
Mob
ile P
hase
Start process Data Collection
Data Processing
Data Analyzing
Generate results
End process
X axis
Y axis
Z axis
Total acceleration axis data
Steps detect
Distance
Speed
Calories burned
Number of the
movement while
sleeping
analysis
Last activity
Longitudinal analysis
Cross population
Figure 8. Algorithm Structure
4.4 Design class diagram
4.4.1 Mobile class diagram:
The architecture design of mobile applications depends on two different types of
classes. In mobile applications there are activities and layout, also there are classes.
Activity and layout are the way to represent the items and tools in the mobile interface
to the user, it is written in Java code and XML, more detail about that is discussed in
the implementation chapter. To draw a class diagram for mobile part of the whole
application will be the mixture between activity classes as interfaces and normal clas-
ses which can be found in the appendixes D and E.
4.4.2 Blocks class diagrams
The architecture of blocks is fully dependent on the classes. In this application
there are two blocks and the design for each block can be found in the appendixes F
Marwan Ali Issa
Page 20 of 47
and G. both of blocks are running on the e-Science Central platform. The aim of each
block is receiving data from previous blocks or file and generating different files ac-
cording to the requirements, so each class represents one file. However MyService
class plays the role of main classes to generate files from other classes and send them
to the next blocks.
4.5 Interaction diagram (sequence diagram)
This section describes the sequence of the message between parts of the system.
The previous chapter explained the system sequence diagram which only deals with
actors and the whole system as one block (black box), but this section goes inside the
system to design the interaction between different parts to complete the requirement.
When the user asks the system to start specific activity, the mobile interface starts to
collect the accelerometer data until the user wants to stop the application. When the
user uploads the data to the second part of this system (cloud), the workflow inside
the cloud will process the data to generate the result and store it as a file. The third
step is to generate the analysis process which needs some information from the pro-
cess part to be ready for the user. The user can display analyzed results by sending the
request for analyzed information. All the request and return messages are shown in
the Figure 9.
Figure 9. Sequence Diagram
Marwan Ali Issa
Page 21 of 47
5 Implementation
5.1 Overview
Based on the design architecture in the previous chapter this chapter reviews the
implementation of the suggested design. Basically this project is divided into two
main phases; the first, mobile phase is divided into two parts. In this phase the appli-
cation was written using Java programming language and Android SDK.
The second phase of the implementation is the e-Science Central cloud based phase
which has two workflows, each of the workflows has some blocks which are e-
Science Central built in blocks and one block for processing and analyzing the data
using Java Maven project and written with Java programming language.
To communicate between these two phases, e-Science Central provides new API
which is upgraded from the e-Science Central API to accept mobile application. Both
phases and e-Science Central mobile API will be explained in detail in the next sec-
tions of this chapter. Figure 10 shows both phases.
User Activity Analysis (Implementation Phases)
Fu
nct
ion
E-SC Cloud PhaseMobile Phase
Mobile Application
Sleep Application
Exercise ApplicationExercise
WorkFlow
Sleep WorkFlow
Import CSV file Block
Column Select Block
Exercise Block
Csv, File Export
Java Maven Project
Import CSV file Block
Column Select Block
sleep Block
Csv, File Export
Java Maven Project
Java Programming language
Android SDK
E-SC Mobile API To connect mobile to e-SC cloud
Figure 10. Implementation Detail
5.2 Languages and tools
1- Programming language: this project is written in Java code in both Android
and Maven projects.
2- Tools: this project has been built using eclipse with Android SDK.
3- e-Science Central workflows include built-in blocks and other blocks which
are created for this project.
Marwan Ali Issa
Page 22 of 47
5.3 Mobile platform
Implementation of the mobile application will be briefly explained. The mobile ap-
plication structure divides to two files of codes “activities and layout”.
Activity is a file of Java code to control the behavior of any element in the layout
file. The style of the activity is the same as Java classes, but the purpose of this activi-
ty is only to display Android tools [2]. However, the developer can add methods to
the activity codes like normal class methods. Here are some examples of general
methods used in the activity classes:
- Protected void onCreate(Bundle savedInstanceState)
- Public void onCreateOptionsMenu(Menu menu)
- Public void onSensorChanged(SensorEvent event)
- Public void onAccuracyChanged(Sensor sensor, int accuracy)
Usually each activity has a layout file; also it can be transferred between different
activities using actions and intents. Each activity should be declared in the manifest
file in order to be available.
<manifest>
<application>
<activity android:name="com.ncl.MAIN " />
</application>
</manifest >
Layout is the visual representation for a user interface, the elements of this file
usually are written using XML tags but it can be instantiated at runtime. Writing lay-
out as XML file is to separate visual representation from the code which controls the
behavior of each element [2]. Most of the codes in the activity to display Android
tools are from training course in the Android website [3]. An example of using layout
to represent the main page of this application can be found in appendix A.
In addition to using Android SDK, another open source API has been used which
is achartengine 1.0.0 to display required chart on this application. Achartengine has
multiple chart styles, tools and utilities which are available for the developer to gener-
ate multiple charts using the Java programming language [1]. Appendix B shows
some screen capture of using achartengine API in this application.
5.4 e-Science Central Platform as a Service
As mentioned in the design chapter about e-Science Central workflow architecture,
there are some blocks which are e-Science Central built-in blocks, the developers can
use them in their workflows. Other blocks are built for specific job inside the applica-
tion to run on e-Science Central platform. These blocks are built using Maven project
with Java programming language. The next section explains the Maven project and
what kind of implementations happens in each block. Figure 11 shows the structure of
workflow inside e-Science Central.
Marwan Ali Issa
Page 23 of 47
Figure 11. e-Science Central Workflow Structure
5.4.1 Maven:
Maven is “a software project management and comprehension tool. Based on the
concept of a project object model (POM), Maven can manage a project's build, re-
porting and documentation from a central piece of information.” [4]. from this defini-
tion, it appears that a POM file which is written in XML is the main file of the Maven
project to access all the dependency for a specific project.
5.4.2 Maven workflow blocks
This section does not talk about code for each class inside blocks, but focuses on
the implementation logic behind the design of the e-Science Central Maven workflow
block. Each block has an XML file named service.xml, this file contains the name of
the service, category and most importantly the types and names of input and output
files. Each input and output file has a different type such as data-wrapper, file-
wrapper and object-wrapper.
The other file in the block is MyService.java class, in this class all the input and
output files should be declared and the number of input and output should be the same
as service.xml. In this project other classes can be added but the generated result
should follow the structure of blocks inside e-Science Central. To connect created
blocks with built-in blocks, each block has defined both input and output which is the
way to connect between different blocks inside one workflow which is mentioned in
Figure 11.
5.5 e-Science Central REST API
5.5.1 Overview
Although the user can use e-Science Central software service through a website,
programmatic access is also provided through a REST API to enable developers to
Maven block
Built-in blocks
Marwan Ali Issa
Page 24 of 47
build scalable, secure cloud applications. Security is managed by Java and .Net client
libraries which also give developers an object-oriented version of the API.
e-Science Central API divides into two main categories which are Storage API and
WorkFlow API. In the next section there will be details of system functionality for
each of them. All the codes in section 5.5 are taken from the same document [12].
5.5.1.1 The Storage API
The way of storing the data inside e-Science Central is file system, and each file in
the system represents a document object (EscDocument) inside a folder (EscFolder).
Each item has associated Metadata which can be represented as EscMetaDataItem and
this API provides a list of metadata for each item to display or to attach new metadata
to EscDocument.
In this API the developer can manipulate the folder and items inside the storage us-
ing some built in functions such as:
EscFolder homeFolder = client.homeFolder();
To list all the documents inside homeFolder:
EscDocument[]docs =
client.folderDocuments(homeFolder.getId());
Figure 12. e-Science Central Document Structure
To list all the folder inside homeFolder :
EscFolder[]folders =
client.listChildFolders(homeFolder.getId());
Figure 13. E-SC Folder Structure
To set new name to folder or to change existing name:
Folder.setName(“new name”);
To download and upload file to or from the e-Science Central:
Marwan Ali Issa
Page 25 of 47
Upload file
File fileToUpload = new File(“file Direction”);
EscFolder folder = client.homeFolder();
EscDocumentVersion version =
client.upload(folder,fileToUpload);
Download file
EscDocument doc =client.getDocument(“document id”);
File localFile=new File(“file Direction”);
Client.download(doc,localFile);
5.5.1.2 The Workflow API
This API allows external programs to run and monitor e-Science Central work-
flows and use e-Science Central as the engine to calculate and analyze variety of data.
This API has different tasks and in this section mentions some of them as an example:
Running workflows
EscWorkflowInvocation invocation =
client.executeWorkflowOnDocument(“workflow
id”, “document id”)
Terminate workflow
EscWorkflowInvocation I =
client.executeWorkflow(“workflow
id”);
Client.terminateInvocation(i.getId());
5.5.2 e-Science Central REST API implementation
The functionality of e-Science Central REST API can be used to connect a mobile
application to a cloud. The scalability and security of the API ensure that the applica-
tion can be executed and store the result by using both storage service and workflow
service API’s of e-Science Central. For this project same functions are used to con-
nect, execute, upload and download the information.
To connect mobile application to cloud, the user should provide correct (URL,
username and password), because both sub API’s need these parameters to access the
cloud in secure manner.
storageService = new StorageClient
(“URL”,port,secure;”username”,”password”);
workflowService = new WorkflowClient
(“URL”,port,secure;”username”,”password”);
After connecting to the cloud, “workflow id” is required to upload files and exe-
cute the workflow to let the API distinguishes which workflow is the target to be exe-
cuted. As mentioned previously about uploading the file the same lines of code used
Marwan Ali Issa
Page 26 of 47
in this project and all the documents are automatically versioned, in this case if the
API does not succeed in uploading the file the workflow execution will use the previ-
ous version of the file in the home folder and if there is no file in the home folder the
workflow will not get executed.
To execute the workflow, workflow id as well as all the files which have been up-
loaded and put in the “workflow parameter list” to prepare all the files for execution.
After that the API creates an object of EscWorkflowInvocation to execute the work-
flow with both (workflowid ,parameter list) parameters.
EscWorkflowInvocation invoFolder =
workflowService.executeWorkflowWithParameters
(workflowid,parameterList) ;
5.6 Data analysis implementation
Looking at the design chapter, there are two options for data analysis. Because of
the authorization and authentication problem, first option was not implemented when
multi-user access is needed, so second option will be selected. The implementation of
data analysis has been applied on the exercise part of the application. The implemen-
tation was not repeated for sleep part.
5.6.1 Last activity analysis Implementation
In this section the data from multi users is not required, so the first option is select-
ed from design. When the user test the application, it generate HTML file which con-
tains all the information required for that test and display a nice graph for last activity.
The application lets the user to navigate between all the tests that took place to com-
pare between different results for the same user.
Analyzing last activity happened in the cloud platform. The code to generate
HTML file is mixed of HTML and Java code. The design of the HTML page can be
improved by using different client side programming languages.
Moreover, this implementation produces a graph for each test which is saved in the
e-Science Central storage and also is embedded in the HTML file. In addition, it pro-
duces two CSV files which contain different information required for both (Longitu-
dinal analysis Implementation, Cross population analysis Implementation).
5.6.2 Longitudinal analysis Implementation
In this section, because we need the information from multi users, second option of
the design was applied of which all the implantations are happening on the mobile
platform. The application takes the example of three users’ different tests and all the
results for each user save in the storage in the user account. The idea behind this anal-
ysis is to compare the date and time for multi test for each user. In addition, the aim
also to give the user knowledge about who is testing this application and what the
time for each test in the current day.
To implement this section correctly, some changes are made on the workflow
which generates another CSV file containing the time of the test, number of steps,
Marwan Ali Issa
Page 27 of 47
distance, speed and calories. By applying the second option of the data analysis de-
sign, mobile application downloads each file from the storage of the first user to the
mobile storage and takes the values required and loops this process until it finishes
from the first user and after that it checks the second and third with the same loop.
In this implementation, it will only display the tests for the current day with differ-
ent color for each user. The result will be a graph displaying the number of steps for
each user for more encouragement and competition.
5.6.3 Cross population analysis Implementation
To implement cross population analysis, second option of the data analysis design
is selected, because it needs the information from different users. However, it displays
a graph viewing the total number of steps for each user who has decided to share their
information; in this project, the example of three users is taken. In this analysis it
calculates the number of steps for each test to get the total value following the same
process of previous section. The result displays all the information inside the storage
of all the accounts who agree for sharing information.
The aim of this implementation is to foster a competitive spirit in the user, whereby
knowledge of other users’ scores may incentivize the users to increase their activities.
5.7 Algorithms
5.7.1 Related algorithms research
The algorithms in this project are derived from different researches on the same
fields which has been explained in Chapter Two. The implementation of both algo-
rithms used in this application is explained in the detail as follows:
5.7.2 Exercise activity algorithm
Peaks detect algorithm is simple as concept. This algorithm is processed on the
user by holding the smartphone and starts the application when the user starts walking
and stops the application when the user stops. The algorithm takes the action when the
user stops the application and synchronizes the data with the cloud part by following
the steps outlined below.
Collect data: In this application the algorithm does not depend on the orientation
of the device, so it is not sensitive to the orientation but only care about the frequency
and the magnitude of each datum. Data is collected from 3D acceleration with the
frequency of 5 Hz. Every time the accelerometer generates 3D acceleration data it is
unified in one value to get the total acceleration. All these values are saved as CSV
file in the directory of the smartphone storage to be available temporarily until the
next test, so the file is available for execution unless if the user want to test again.
Total acceleration can be calculated by following the formula [23]:
𝛼 = √𝑥2 + 𝑦2 + 𝑧2 (1)
Marwan Ali Issa
Page 28 of 47
In this equation (a) is the total acceleration derived from the combination of three
acceleration data to eliminate negative values. Figure 14 and 15 show 3D and total
acceleration.
Figure 14. 3D Accelerometer Representation
Figure 15. Total Acceleration
Low pass filter: This step starts when the mobile application upload the CSV file
from temporary storage in the mobile directory to the home folder of e-Science Cen-
tral storage. Although, all total acceleration are collected in one file, but these data
still suffer from gravity and noise from the nature of the device. For example, if we
put the mobile device on the table without any movement still the value of the accel-
eration will be about 9.87 m/s2. Applying a low pass filter will remove the value of
the gravity from the data and reduce the amount of noise by passing the constant val-
ue of ALPHA by following the formula below [20].
ALPHA a=0.15 𝑜𝑢𝑡𝑝𝑢𝑡 = 𝑖𝑛𝑝𝑢𝑡 + 𝛼 ∗ (𝑖𝑛𝑝𝑢𝑡 − 𝑜𝑢𝑡𝑝𝑢𝑡) (2)
Figure 16 represents the accelerometer values after implementing the low pass fil-
ter.
-20
-15
-10
-5
0
5
10
15
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97
101
105
109
113
117
121
125
129
133
137
141
145
149
153
157
X Y Z
0
5
10
15
20
25
1 7
13
19
25
31
37
43
49
55
61
67
73
79
85
91
97
10
3
10
9
11
5
12
1
12
7
13
3
13
9
14
5
15
1
15
7
a
Marwan Ali Issa
Page 29 of 47
Figure 16. Low Pass Filter
Threshold: Looking at the values of the accelerometer it is notable that every time
there is different maximum and minimum values. The average of these two values is
called the threshold, so finding the number of steps from the values of the accel-
erometer; we compare the values with the threshold value every two seconds. The
value of the threshold decides if the step has been taken or not. Figure 17 below is
generated by finding the dynamic value of the threshold with the formula below [29].
𝑡 = 𝑚𝑎𝑥 + 𝑚𝑖𝑛/2 (3)
Figure 17. Threshold Representation
Time window for every two seconds: The purpose of this step is to eliminate the
amount of noise and to ignore any value which may be detected as a step. Through
observation we see that the speed of the human when walking or running is about one
step (walking) and six steps (running) in two seconds. If the number of values is
greater than the threshold is more than six in each two seconds, the extra values will
be discard in that window [29]:
𝑤 = ∑ 𝑎(𝑖) > 𝑡
𝑖=0
𝑖=𝑛
(4)
Step detect: This is the final step to detect the number of steps by taking the condi-
tion of the previous steps. For each value which has been accepted as the value of one
of the peak should be more than the value of the threshold, the number of the values
which are more than threshold should be less than or equal to six in each two second
0
1
2
3
4
1 7
13
19
25
31
37
43
49
55
61
67
73
79
85
91
97
10
3
10
9
11
5
12
1
12
7
13
3
13
9
14
5
15
1
15
7
a
0
0.5
1
1.5
2
2.5
3
3.5
1 6
11
16
21
26
31
36
41
46
51
56
61
66
71
76
81
86
91
96
101
106
111
116
121
126
131
136
141
146
151
156
a
t
Marwan Ali Issa
Page 30 of 47
window also to be more specific the value of the peak should be greater than the value
next to it.
To calculate the other parameters such as distance speed and calories burned, we
just implement the following formulas which depend on each other.
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 = 𝑆𝑡𝑒𝑝 𝑁𝑢𝑚𝑏𝑒𝑟 ∗ 𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑓𝑜𝑟 𝐸𝑎𝑐ℎ 𝑆𝑡𝑒𝑝 (5)
𝑆𝑝𝑒𝑒𝑑 = 𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 /𝑇𝑖𝑚𝑒 (6) 𝐶𝑎𝑙𝑜𝑟𝑖𝑒𝑠 = 1.25 ∗ 𝑆𝑝𝑒𝑒𝑑 (7)
5.7.3 Sleep monitoring algorithm
The following algorithm is to determine the number of movements for each minute
when the user is sleeping. To apply this algorithm, the user should put the smartphone
on the bed and run the application. In the morning, the user stops the application and
synchronizes the data with the cloud part to implement the following steps.
Collect data and low pass filter: The data collection and low pass filter steps in this
algorithm are the same as the previous algorithm so it is meaningless to repeat it.
Noise filter: The aim of this step is to remove all the noise. In this application we
test the application by putting the mobile on the table with no movement, but still
there are different values of the accelerometer which are between 1.44 and 1.48.
Without this step the algorithm will take all the values and find the number of changes
according to the value of the threshold and give different results which are wrong,
because if the smartphone is not moving the result should be zero changes.
To filter all of these values we implement the following formula:
𝑖𝑓(𝑜𝑢𝑡𝑝𝑢𝑡 > 1.44 𝐴𝑁𝐷 𝑜𝑢𝑡𝑝𝑢𝑡 < 1.48) 𝑜𝑢𝑡𝑝𝑢𝑡 = 1.46
(8)
Figure 18.Noise Filter
Standard deviation: The aim of the standard deviation process is to find the adja-
cent elements by implementing the following formula (14):
𝑆𝐷𝑉(𝑎) = 𝑎𝑏𝑠([𝑎(𝑟𝑜𝑤1) − 𝑎(𝑟𝑜𝑤0), 𝑎(𝑟𝑜𝑤2) − 𝑎(𝑟𝑜𝑤1) … 𝑎(𝑟𝑜𝑤 𝑛) − 𝑎(𝑟𝑜𝑤 𝑛 − 1)]) (9)
1.35
1.4
1.45
1.5
1.55
1
11
21
31
41
51
61
71
81
91
10
1
11
1
12
1
13
1
14
1
15
1
16
1
17
1
18
1
19
1
20
1
21
1
22
1
23
1
24
1
25
1
26
1
27
1
28
1
29
1f(a) f(a)
Marwan Ali Issa
Page 31 of 47
Figure 19.Standard Deviation
Threshold and comparison with values for each minute: After implementing stand-
ard deviation on the values, all the values which are less than the threshold should be
eliminated. To find the threshold we will use the formula from previous algorithm
which is summation of maximum and minimum of one minute values and dividing by
two to get the value of the threshold for each minute.
Figure 20. Dynamic Threshold
Display each time movement and feedback: After extracting the number of changes
per minute different feedbacks can be prepared to the user to explain different move-
ment for different stages of sleeping and users can understand the nature of their
sleeping by looking at different feedback for different nights.
6 Testing and Evaluation
6.1 Testing
The mobile application in this project was tested according to the functional re-
quirements in the previous chapter. To test this application, it can be categorized into
four main sections as follows.
6.1.1 Test cases
As mentioned in the functional requirement section, this application was divided
into two main parts. The testing process will take each of these parts and test it ac-
cording to the scenario in the next section as shown by table 2.
0.00000
0.05000
0.10000
0.150001
11
21
31
41
51
61
71
81
91
10
1
11
1
12
1
13
1
14
1
15
1
16
1
17
1
18
1
19
1
20
1
21
1
22
1
23
1
24
1
25
1
26
1
27
1
28
1
29
1
SDV SDV
0.00000
0.02000
0.04000
0.06000
0.08000
0.10000
0.12000
1
14 27 40 53 66 79 92
105
118
131
144
157
170
183
196
209
222
235
248
261
274
287
300
313
326
339
352
365
378
391
404
417
430
443
456
469
482
495
508
521
534
547
560
573
586
599
SDV threshold
Marwan Ali Issa
Page 32 of 47
Table 2. Test Cases
ID Test Case
Name
Subject Test Sequence Test Data UD
ID
1 Exercise
monitoring
All functions Following the
instruction in the
Use Case (process
of user activity)
Testing accelerometer
data collected from
moving the device in
the hand while walking
or running
1
2 Sleep
Monitoring
All Functions Following the
instruction in the
use case (process
Sleep)
Testing the accelerome-
ter data collected from
movement of the device
on the bed while sleep-
ing
2
3 Analyzing
process
Testing each of
(last activity,
longitudinal anal-
ysis, cross popula-
tion )
User clicks on the
button to display
analysis result and
wait for the app to
respond
Testing the data stored
in the storage in e-
Science Central using
the second option of
analysis design
1,2
6.1.2 Test Scenarios
The mobile application in this project was tested using different scenarios such as
the following:
1- Different versions: Test the mobile application in different Android mobile
devices with version between 2.3.3 to 4.2.2 to check the accessibility and usa-
bility in different interfaces. In this test, the mobile application was installed in
different devices with different versions to test the first test case. The test data
will be explained in the next section.
2- Different user account: Because this application deals with different users
with different credentials, it was tested to verify if it is working for multi-
users. This application deals with storage service and workflow service. Each
of these services needs user credentials to access the platform of e-Science
Central platform. The instruction of testing for multi-user was mentioned be-
fore in Section 3.2.3. The scenario of this test was done by running the public
workflow with admin credential parameters with different credential parame-
ters for each user to store the result on their storage, by testing both cases one
and two. The result of this test will be shown in the next section.
3- Usability: To check the usability of the mobile application, this application
and another open source application such as a pedometer were tested by dif-
ferent people using the same mobile devices. This application was running by
five students in the class with instruction for testing case one. The result will
be shown in the next section.
4- Performance: To test the performance of mobile applications in this project,
both cases one and two were tested for the time and amount of battery used in
Marwan Ali Issa
Page 33 of 47
both mobile application with cloud and mobile application using only mobile
platform.
5- Testing Analysis Processing: for this application we follow the second option
of the analysis design which was mentioned in Section 4.2.6. The mobile ap-
plication has some buttons, each of them to display one type of analysis result.
In this test we used three different accounts as an example of this testing. To
test the performance, functionality and usability of this test, it calculates the
information stored in each account and displayed in the chart. This test was
done using test case one and three.
6.1.3 Test Data
After testing the first case through the first scenario, the data collected from three
tests for each of four versions of Android mobile is shown in Table 3. Table 3. Data of Test Scenario 1
Test case ID Test Scenario Version No. Average Step taken Step recorded
1 1 2.3.6 20 19
1 1 4.1.2 20 18.5
1 1 4.2.2 20 51
1 1 4.3 20 56
Looking at table 3, it appears that this application is working with Android ver-
sions between 4.1.2- 2.3.6 and the result from new versions of Android is more than
double of the expected result. In the new version of the android the frequency is about
15Hz, but in this application it takes the frequency 5Hz. To correct this error there
should be some modification of the algorithm implementation to accept high frequen-
cy rate.
The data collected from the first test case by running the second scenario is from
three user accounts and each of them tests the first case of the test for three times to
check the availability and accessibility for multi-user to the same workflow in the e-
Science Central platform. The data of the scenario is presented in Table 4. Table 4. Data of Test Scenario 2
Test case Test scenario Admin User Account Client user account Result
1,2 2 Admin (u, pw) Client 1(u, pw) Pass
1,2 2 Admin (u, pw) Client 2(u, pw) Pass
1,2 2 Admin (u, pw) Client 3(u, pw) Pass
The Data collected from test case 1 while running test scenario 3 is from five stu-
dents who tested this mobile application and an open source pedometer mobile appli-
cation and the data is shown in Table 5.
Marwan Ali Issa
Page 34 of 47
Table 5. Data of Test Scenario 3
Test
case
Test
scenario
Step taken
(walking)
Steps recorded
by pedometer
app
Steps taken
(walking)
Steps recorded by
this application
1 3 20 24 20 18
1 3 20 23 20 22
1 3 20 22 20 21
1 3 20 22 20 21
1 3 20 23 20 22
Average=20 Average = 22.8 Average
(100/5=20)
Average
(104/5=20.8)
For test case 1 and 2, test scenario 4 was run on this mobile application and anoth-
er mobile application to investigate the advantage and drawbacks for each part of this
app.
Time: the data collected from separating the time of uploading and executing the
same function over the bandwidth of the internet of Newcastle University using an-
droid mobile version 4.1.2. Table 6 shows the result. Table 6. Time to test scenario 4
Test Case Scenario Test action Time Any drawback
1 4 Upload 1kb 889-688 ms Pass
2 4 Upload 250 Mb 3.9-5.2 seconds Pass
1 4 Execute 11-15 seconds Pass
2 4 Execute 80-200 seconds Failed (crash)
Testing mobile applications on the mobile platform does not need to upload the da-
ta to another place. In this case, it saves the time spent on uploading the data. In addi-
tion, the time to execute the process is far from comparing with mobile platform
which takes less than one second to process the same codes.
The time of processing the codes to run the algorithm and to generate one CSV file
using the process power of mobile device is about 200 ms, on the other hand, using
the same code for the cloud platform to generate five files takes less than 25 ms.
Amount of the battery used: to measure the power spent by both mobile applica-
tion on the mobile platform and mobile application on both mobile with cloud plat-
form, open source application named PowerTutor 1.4 is used and it gave us these
results: for mobile with cloud the result is 49% of the total power, the time of the
process is 30 seconds and the amount of energy spend using LCD, CPU and Wi-Fi is
10.1 Joule on the other hand using only the mobile application to test the process time
takes 63% of the total energy, the time of the process is about 30 seconds and the
amount of energy used on CPU is about 12.1 Joule by taking into account that 1%
fully charged battery≈32.84 Joules [30].
Marwan Ali Issa
Page 35 of 47
The data collected for test case one and three, test scenario 5 depends on the num-
ber of the users who want to share their information for analysis also on the number
of tests for each user in the storage as illustrated by table 7. Table 7. Data from Analysis Test scenario 5
Test case Scenario Analysis type Time spend Drawbacks
1,3 5 Last activity 123-140 ms pass
1,3 5 Longitudinal analysis 10 seconds Pass
1,3 5 Cross population 10-11 seconds Pass
6.1.4 Test Result
As a summary of the entire test undertaken on this dissertation, the table 8 explains
in detail each test status. Table 8. Test Result
Test case ID Attempt Test Scenario Result
1 5 1 Pass
1,2 3 for each 2 Pass
1 5 for each app 3 Pass
1,2 More than 10 4.1 Pass
2 More than 10 4.1 Failed
1 More than 10 4.2 Pass
1,3 More than 10 5 Pass
6.2 Evaluation
The section discusses and critically evaluates the results achieved during this pro-
ject. As mentioned in Section 1.3, the aim of this project is to demonstrate the possi-
bility of developing mobile applications with a cloud environment. In addition, it also
aims to test the efficiency of data processing using cloud technology. To evaluate the
objectives of this project, each objective will be explained in detail as follows:
Evaluate (Build mobile application based on cloud technology): An Android appli-
cation was successfully developed and it uses the cloud technology as a platform to
run the process of all the data using the e-Science Central platform and software as
service. This application can collect the accelerometer data about mentioned exercises
and upload and execute automatically. Looking at the test result, testing mobile appli-
cation passed, but the time to process the data using cloud computer technology is
more than using mobile platform, because the e-Science Central in this project de-
pends on the file systems to transfer the data which takes more time and storage com-
pared to the mobile platform.
The process of uploading and executing is running sequentially. The time of both
processes in the mobile application takes more than required which sometime be-
comes the reason for crashing the application. To solve this problem, both processes
are separated. The user can only recognize the process when the file uploads to the
Marwan Ali Issa
Page 36 of 47
cloud, but executing workflow took place in the backend. This problem happened
when the size of the raw data is too much such as 2.5 Mb for one night sleep.
Evaluate (Cloud computing using e-Science Central): To implement the first objec-
tive, the mobile application needs a backend technology to support the functionality
of the application. The second objective of this project is using the technology of e-
Science Central which provides software and platform as service for desktop, web and
mobile application. After implementing this objective it appears that there are some
drawbacks in the structure of the API such as it only accepts file systems which leads
to delay of uploading and downloading the data to and from the cloud. This problem
can be avoided using compression mechanism to reduce the size of the file. Further-
more, it does not allow the developer to manipulate the data shared from different
users’ accounts to run workflow inside e-Science Central.
According to the test result, the reason behind failing analysis part of this applica-
tion is that the time of processing the code inside the mobile platform is too much
which can be avoided, if the structure of e-Science Central allows such workflow.
Evaluate (Efficiency of cloud environment against mobile): The efficiency in this
objective is only deal with the time and usage of the battery spent on processing the
data. This objective was not achieved, because of the structure of e-Science Central.
The test result appears that the time of uploading and executing the test is more than
the test on mobile platform.
Although, the time of uploading and executing is too much, but the time of running
only the algorithm on the e-Science Central is less than mobile platform, also the
cloud platform saves all the battery powers which may spend if all the process hap-
pened on the mobile platform.
7 Conclusion
In this section, critical assessment about the project result will be presented and re-
viewed for all the objectives. This will be done to give a summary about the accom-
plishments and failures in this project and what is the reason behind each of them. In
addition, the section “lessons learned” will have the detail about all the personal expe-
riences and suggestions which were discovered through the implementation of this
project. In the end, “future work” will contain some future researches and opportuni-
ties which may take this project as a foundation.
7.1 Conclusion
First, observing the objectives of this project. The first objective to build mobile
application based on cloud computing was achieved. A mobile application which
contains two parts for user activity and sleep respectively was achieved. Developing
mobile application went through the requirement analysis, design, implementation,
testing and evaluation. This application connects to cloud side using e-Science Cen-
tral REST API to upload the data and execute the blocks using e-Science Central’s
platform service.
Marwan Ali Issa
Page 37 of 47
The second objective is achieved. The aim of this objective is to run the process
and analyze data on the cloud. Running the process part was achieved successfully
but failed in some parts to achieve the analysis inside cloud platform. To develop this
objective, it had been researched and discussed through different options of the design
and implementation. The comparison was achieved to prove the efficiency of the
cloud computing platform. The result of the comparison is clear in the testing and
evaluation chapter.
Although, analyzing the information from multi-user was not successful when us-
ing e-Science Central platform, but it does not mean that it is impossible to improve
this application. Having the current structure of e-Science Central, other option was
implemented to use mobile platform instead of cloud platform to analyze the infor-
mation for multi-user. Shortcomings of this project relating to data analysis aspect
within the e-science platform, can be regarded as an opportunity that creates room for
further investigations and room for further research. This would thus improve the
provision of a suitable cloud computing platform regarding the accessibility and per-
formance.
In conclusion, it seems that cloud computing (e-Science Central) needs some im-
provements in the structure of the platform as a service to accept the challenge of
using mobile applications based on cloud computing. In addition this project may play
a role in identifying more challenges about using the platform of cloud computing in
the future.
7.2 Lesson learned (Personal Experience)
The lessons learned from this project are: developing mobile application using An-
droid SDK and Java programming language which was the beginning for me to deal
with this kind of the project. It was a good experience for me to use e-SC REST API
for communication and manipulation the storage and workflow inside the platform of
cloud computing (e-Science Central).
Another experience from doing this project was learning how to handle projects
when there are some obstacles that constrain achievement of project objectives. There
are other options to pass the problem and understand the current problem for more
improvements and developments.
On the other hand, there are other experiences while doing this project which can
be as suggestions to improve the structure of e-Science Central and to let scientists get
more involved. Improving the platform can entail the provision of more documenta-
tion as well as providing more help and User Guide to support users in creating
blocks. My other discovery within the project is that another software developer can
think beyond what I have done regarding transforming from mobile to cloud compu-
ting as platform and service.
7.3 Future work
For the future work, providing interface for authentication is suggested to allow the
user to provide log in and sign up before using this application. This implementation
Marwan Ali Issa
Page 38 of 47
will help the developer to enhance and improve our understanding of using this appli-
cation for multiple users.
To establish the objectives of this project, there is another suggestion to improve
the structure of the e-Science Central platform by providing tools for the developer to
create blocks inside the platform to manipulate the data of multi-user. The first option
of the cross population design could provide a good start.
This application can have a good opportunity to access the data of multi-user to
create a good environment for social network, but first the previous suggestion should
be implemented. In this suggestion the user can check different users who agree to
share their information publically. In this project there are only three type of analysis
which may increase according to the user requirement.
Acknowledgment
I would like to thank all parties who helped me in conducting this project. Special
gratitude goes to:
Professor Paul Watson, the project supervisor who has guided me from the project
proposal preparation also for the great help and supervision he gave me throughout
the life of the project. Without his patience, this research could not have been at any
valuable stage that it claims it is.
I would also like to thank Dr. Simon Woodman and Dr. Hugo Hiden for the help
and discussion regard e-Science Central.
Special thanks to my teacher Hossein Hassani for the help about the dissertation
structure.
Special thanks to my friend Lesego Peter for editing my dissertation.
And last but not least, my family for their prayer and encouragement during my
life.
Marwan Ali Issa
Page 39 of 47
References
[1] AChartEngine Inc. AChartEngine. Available:
http://www.achartengine.org/content/download.html. Last accessed 2/8/2013.
[2] Android Developer. Activities. Available:
http://developer.android.com/guide/components/activities.html . Last accessed
2/8/201.
[3] Android Developer. Training(Getting Started). Available:
http://developer.android.com/training/index.html . Last accessed 20/7/2013.
[4] Apache Maven Project. Apache Maven Project. Available: http://maven.apache.org/.
Last accessed 20/7/2013.
[5] Azumio Inc. Sleep Time - Alarm Clock. Available:
https://play.google.com/store/apps/details?id=com.azumio.android.sleeptime&hl=en.
Last accessed 29/8/2013.
[6] Bagi, L. (December 25, 2010). Pedometer. Available:
https://play.google.com/store/apps/details?id=name.bagi.levente.pedometer&hl=en .
Last accessed July 18, 2013.
[7] Bai, Y et al. Will You Have a Good Sleep? Sleep Quality Prediction with Mobile
Phone. 7th International Conference on Body Area Networks. Sept 24-26, 2012,
Oslo, Norway. 2012.
[8] Business Service Manager Hub. (2011). Understanding the Different Levels of Cloud
Computing. Available:
http://www.businessservicemanagementhub.com/2011/03/16/understanding-the-
different-levels-of-cloud-computing/ . Last accessed 12/8/2013.
[9] Guan, L., Ke, X., Song, M., Song, J.: A Survey of Research on Mobile Cloud
Computing. Computer and Information Science (ICIS), 2011. Pages 387-392.
IEEE/ACIS 10th International Conference on. 2011.
[10] Hewett et al. (2009). CHAPTER 2: Human-Computer Interaction {p. 5}. Available:
http://old.sigchi.org/cdg/cdg2.html#2_1 . Last accessed 14/8/2013.
[11] Hiden, H., Woodman, S., Watson, P., Cala, J.: Developing Cloud Applications using
the e-Science Central Platform. Royal Society of London, Vol. 371, pp. 1-15. 2013.
[12] Hiden, H. (2013): " Using the e-Science Central REST API". e-Science Central
website. http://www.esciencecentral.co.uk/?p=192 . Last accessed 10/8/2013.
[13] Hoque, E., Dickerson, R. F.,Stankovic, J. A.: Monitoring Body Positions and
Movements during Sleep using WISPs.(2010). pp. 44-53. In: WH '10 Wireless
Health,University of Virginia. New York : ACM, 2010.
[14] Libby, R., (2008). A Simple Method for Reliable Footstep Detection in Embedded
Sensor Platforms. Available:
http://ubicomp.cs.washington.edu/uwar/libby_peak_detection.pdf. Last accessed
2/8/2013.
[15] Meliopoulos, S., Sheikh, S., (2011). Analysis of Sleeping Patterns Using Smartphone
Sensors. Semester Thesis. Computer Engineering and Networks Laboratory: Zurich.
Marwan Ali Issa
Page 40 of 47
[16] Mell, P., Grance, T.: The NIST Definition of Cloud Computing.National Institute of
Standards and Technology 800-145, Gaithersburg .2011.
[17] Merriam webster Inc. accelerometer. Available http://www.merriam-
webster.com/dictionary/accelerometer. Last accessed 20/7/2013
[18] Miluzzo, E., (2011). Smartphone Sensing.Ph.D Thesis. Dartmouth College: Hanover,
New Hampshire.
[19] Naqvi, N. Z. et al. Step Counting Using Smartphone-Based Accelerometer.
International Journal on Computer Science and Engineering (IJCSE). V(4). No(05
May 2012). Pages 675- 681, 2012.
[20] Nichols T. (2011). Smoothing Sensor Data with a Low-Pass Filter. Available:
http://blog.thomnichols.org/2011/08/smoothing-sensor-data-with-a-low-pass-filter .
Last accessed 12/7/2013.
[21] Palmer, N.O., Smartphones:A Platform For Disaster Management.Ph.D Thesis. Vrije
University Amestrdam. 2012.
[22] Runtastic . (2013). Runtastic Pedometer PRO. Available:
https://play.google.com/store/apps/details?id=com.runtastic.android.pedometer.pro&
hl=en . Last accessed 11/7/2013.
[23] Rennie, J. (2012). How do I get the total acceleration from 3 axes?. Available:
http://physics.stackexchange.com/questions/41653/how-do-i-get-the-total-
acceleration-from-3-axes . Last accessed 10/7/2012.
[24] Strowd, H., Lewis, G. A., T-Check in System-of-Systems Technologies: Cloud
Computing. Software Engineering Institute, Carnegie Mellon University, Pittsburgh,
Pennsylvania. 2010.
[25] TechTerms.com. Smartphone. Available:
http://www.techterms.com/definition/smartphone. Last Access 30/7/2012.
[26] Watson, P. et al. e-Science Central: e-Science on the Web, powered by Clouds.
School of Computing Science, Newcastle University. Newcastle : Research Clouds:
Hype or Reality? Workshop, 2010. pp. 1-3.
[27] Watson, P., Hiden, H., Woodman, S., e-Science Central for CARMEN: science as a
service. s.l. : Microsoft eScience Workshop, 2010. pp. 2369-2380.
[28] Ying, H. et al. Automatic Step Detection in the Accelerometer Signal. 4th
International Workshop on Wearable and Implantable Body Sensor Networks. 2007,
IFMBE Proceedings , Vol. 13, pp. 80-85. Springer Berlin Heidelberg. 2007.
[29] Zhao, N., Full-Featured Pedometer Design Realized with 3-Axis Digital
Accelerometer. Analog Dialogue, Vol. 44-06. Pages 1-5. 2010.
[30] Thiagarajan. Narendran. T., Aggarwaly. G., Nicoara. A., Boneh. A., Singh. J.P., Who
Killed My Battery: Analyzing Mobile Browser Energy Consumption. the
International World Wide Web Conference Committee (IW3C2) . Session: Mobile
Web Performance.2012, pages 41-50. France. 2012
Page 41 of 47
Appendix
Appendix A: this appendix shows the layout file which written by XML to represent Android tools for user interface.
Marwan Ali Issa
Page 42 of 47
Appendix B: this appendix shows some screen capture of chart used in this application using achartengine open source API
Marwan Ali Issa
Page 43 of 47
Appendix C:
This appendix shows use case diagrams for both user activity and sleep process, both of them has similar cases but with different implementation. Both use cases have one actor who is the user
of the mobile application.
Marwan Ali Issa
Page 44 of 47
Appendix D: this appendix shows the class diagram for exercise part of the mobile application. There is one class which work as main class (exercise main activity), class (ExConnect) to con-
nect and run the workflow in the cloud from mobile application, the other classes are for analyzing the information and show them as a chart. There are two classes (Prefs, Preferance activity) to
manipulate the sitting information to be available for the application when they are required.
Marwan Ali Issa
Page 45 of 47
Appendix E: this appendix shows the class diagram for sleep part of the mobile application. There is one class which work as main class (sleep main activity), class (Connect) to connect and
run the workflow in the cloud from mobile application, the other classes are to show the result for each sleep activity. There are two classes (Prefs, Preferance activity) to manipulate the sitting
information to be available for the application when they are required.
Marwan Ali Issa
Page 46 of 47
Appendix F: this Appendix shows the exercise block class which contains (MyService) as main class and (TextFileGenerator) to produce number of the files required for the processing, (De-
tailData) class to produce a file which contains information for analyzing the test result.
Marwan Ali Issa
Page 47 of 47
Appendix G: this Appendix shows the sleep block class which contains (MyService) as main class and (SleepFileGenerator) to produce number of the files required for the processing, (ChartGen-
erator) class to display the result as graphic using chart, (SleepTimer) class to manipulate the time of sleeping by second, minute and hour.