I nte rna t io na l J o urna l o f   E lect rica l a nd   Co m p ute E ng in ee ring   ( I J E CE )   Vo l.   9 ,   No .   6 Dec em b er   201 9 ,   p p .   4 9 9 3 ~5 0 0 5   I SS N:  2 0 8 8 - 8708 DOI : 1 0 . 1 1 5 9 1 / i j ec e . v9 i 6 . p p 4 9 9 3 - 5005          4993       J o ur na l ho m ep a g e h ttp : //ia e s co r e . co m/ jo u r n a ls /in d ex . p h p / I JE C E   Desig n and   i m ple m en tatio n of   c o ntext - a w a re  h ea lth  s ervi c p la tf o r m  ( CA H S)       Sih a m   B elha di,  Ra chid M er zo ug ui   De p a rt m e n o f   T e le c o m m u n ica ti o n ,   T lem c e n   Un iv e rsit y ,   A l g e ria       Art icle  I nfo     AB ST RAC T     A r ticle  his to r y:   R ec eiv ed   Oct   8 ,   2 0 1 8   R ev i s ed   A p r   11 ,   2 0 1 9   A cc ep ted   J u n   26 ,   2 0 1 9       Co m p u ters   a re   n o   m a tch   to   h u m a n in   d e d u c in g   si tu a ti o n a in f o rm a ti o n   f ro m   th e ir  e n v iro n m e n a n d   in   u si n g   it   in   t h e ir  i n tera c ti o n s.   T h e   a d v e n o f   th e   c o n tex t - a w a r e   a p p li c a ti o n se e m to   o ff e a   w a y   o u to   th e   c o m p u ter  th a is  n o t   c o n tex t - se n siti v e .   T h e   c o n tex a w a re   a p p li c a ti o n c a n   a d a p th e ir   b e h a v io rs  a c c o rd in g   to   t h e   p e rc e iv e d   c o n tex o situ a ti o n ,   w it h o u e x p li c it   u se in terv e n ti o n ,   th e re b y   p ro v id i n g   h u m a n - c e n tri c   se rv ic e s .   To   sim p li fy   th e   c o m p lex it y   o d e v e lo p in g   a p p li c a ti o n s,  c o n tex a wa re   f r a m e wo rk ,   w h ich   in tro d u c e s c o n tex a wa re n e ss   in to   th e   e n v iro n m e n w h e re   th e   a p p li c a ti o n s a re   e x e c u ted ,   is  h ig h li g h ted   t o   p r o v id e   a   h o m o g e n e o u in terf a c e   in v o lv in g   g e n e ric  c o n tex m a n a g e m e n a n d   a d a p tatio n   so l u ti o n s.   T h is  p a p ier  h a f o c u se d   o n   th e   d e sig n   o f   Co n tex t - Aw a r e   He a lt h   S e rv ice (C A HS p latf o rm ,   w h ich   p ro v id e   a   h e a lt h   a p p li c a ti o n f ra m e w o rk   e m b e d d e d   o n   m o b i le  d e v ice s.   Ou p ro p o se d   p latf o rm   is   c a p a b il it ies   f o c o n tex m a n a g e a n d   a d a p tatio n a c c o rd in g   to   c o n tex c h a n g e s.  It  is  d e sig n e d   t o   b a se   o n   t h e   S OA   p rin c i p les   f o a c h iev in g   a   f lex ib le an d   d y n a m ic  a rc h it e c tu re .   K ey w o r d s :   A d ap tatio n   C o n te x t   C o n te x t - a w ar e   C o n te x t - a w ar f r a m e w o r k   h ea lt h   d o m ai n   Co p y rig h ©   2 0 1 9   In stit u te o A d v a n c e d   E n g i n e e rin g   a n d   S c ien c e   Al rig h ts re se rv e d .   C o r r e s p o nd ing   A uth o r :   Sih a m   B elh ad i,    Dep ar t m en t o f   T elec o m m u n ic atio n ,     T lem ce n   Un i v er s i t y ,     ST I C   L ab o r ato r y ,   A lg er ia.   E m ail: b el h ad i.ttl@ g m ail. co m       1.   I NT RO D UCT I O N     No w ad a y s ,   m o b ile  tech n o lo g y   is   in cr ea s in g l y   b ei n g   u s ed   b y   all  a g g r o u p s   o f   p eo p le.   Mo r eo v er ,   th ap p ea r an ce   o f   m o r an d   m o r m o b ile  ap p licatio n s   i n   d if f er e n d o m ai n s   h as  h elp ed   to   in s tall  v ar io u s   ap p licatio n s   o n   m o b ile  d e v ice s .   Un f o r tu n atel y ,   t h i s   h as  h ad   n e g ati v i m p ac o n   t h eir   c ap ac it y ,   s p ee d ,   etc.   T h co n tex t - a w ar f r a m e w o r k   h as  b ee n   i n tr o d u ce d   f o r   th p u r p o s o f   o v er co m i n g   t h is   p r o b lem .   I ts   m ain   o b j ec tiv is   to   p r o v id th ex ec u tio n   e n v ir o n m e n th a h elp s   to   m an a g ap p licatio n s   a n d   also   to   ad a p to   th at   en v ir o n m e n t.  T h p r esen p ap er   f o cu s e s   o n   th n e w   co n ce p o mo b ile  h ea lth   ( m - Hea lth )   w h ic h   h a s   b ec o m an   i m p o r tan s u b - s e g m e n o f   th f ield   o f   elec tr o n ic  h ea l th   ( e - Hea lth )   [ 1 ] .   T h d if f er en m o b ile  h ea lt h   ap p licatio n s   ca n   cr ea te,   co llect,   s to r an d   a ls o   tr an s m it  in f o r m atio n   in   o r d er   to   en s u r e   th s a f et y   o f   b o th   th p atien an d   th p h y s ic ia n   [ 2 ] .   I n   o r d er   to   m a k th e s ap p licatio n s   s m ar ter   an d   m o r au to m atic,   t h co n tex t - a w ar f r a m e w o r k   [ 3 - 8 ]   f o r   h ea lt h   ap p licatio n s   is   p r o p o s ed   f o r   th p u r p o s o f   i m p r o v in g   th q u alit y   o f   h ea lt h   ca r e .   C o n te x t - a w ar h ea lt h   s er v ice s   n ee d   s y s te m s   [ 9 ]   th at   ca n   a u t o m a ticall y   ac q u ir p er s o n al   i n f o r m atio n ,   i.e .   th e   li v in g   e n v ir o n m e n t,  p h y s ical   ch ar ac ter is tics ,   ac tiv i ti es;  t h e y   m u s b e   ab le  to   p r o v id an d   ad ap t h eir   s er v ices  ac co r d in g l y ,   as  s h o wn   i n   Fi g u r 1 .   T h er ef o r e,   au to m atic  m a n ag e m e n o f   m o b ile  h ea lt h   s er v ices  a n d   th eir   ad ap tatio n   to   th co n te x lead s   to   p r o p o s co n tex t - a w ar f r a m e w o r k   t h r o u g h   t h u s a g o f   m o b ile   d ev ices.  T h is   p r o p o s ed   f r am e w o r k   i s   co m m o n l y   ca lle d   th C o n te x t - Aw ar Hea lt h   Ser v ices  ( C A HS )   f r a m e w o r k .     Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8708   I n t J   E lec  &   C o m p   E n g ,   Vo l.  9 ,   No .   6 Dec em b er   2 0 1 9   :   4 9 9 3   -   50 0 5   4994       Fig u r 1 .   A r ch itectu r o f   t h p latf o r m   s y s te m       C A HS  h av ca p ab ilit ie s   f o r   o f f er in g   t h m a n ag er   o f   t h co n t ex an d   s er v ices  b y   u s i n g   t h t ec h n iq u e   o f   co n te x t - a w ar en e s s   a n d   t h e   ad ap tatio n .   T h is   f r a m e w o r k   ca n   b d esi g n ed   b y   d iv id i n g   th eir   f u n ctio n alitie s   in to   m o d u les.  Fo r   s a m f u n ctio n alit y ,   w ca n   p r o v id m u ltip le  i m p le m e n tatio n s ,   ea c h   s u ited   f o r   d if f er en co n tex s it u atio n .       2.   RE L AT E WO RK   Ou r   i n ter est  r e v o lv e s   ar o u n d   m o b ile   h ea l th   an d   t h a s s o cia ted   to p ics.  T h is   d o m ai n   k n o ws  m aj o r   d ev elo p m en t   i n   r ec en ti m e s .   W m e n tio n   Vital   W av C o n s u lt in g   [ 1 ]   w h o   d ef i n a   m o b i le  h ea l th   as  " Usi n g   m o b ile   co m m u n icatio n s - s u ch   as  P DAs  a n d   m o b ile   p h o n e s - f o r   h ea lth   s er v ices  a n d   i n f o r m atio n " .   T h m o b ile  h ea lt h   s u r v e y   [ 2 ]   p r esen ts   t h v ar io u s   m o b iles   h ea l th   ap p licatio n s ,   w h ic h   a i m s   to   h e lp   th e   p atien t s   a n d   th h ea lth   p r o f e s s io n als.  T h is   s u r v e y   ar r i v es  t h i m p o r ta n i s s u es  s u c h   as  t h co o p er atio n   b et w ee n   m - Hea lt h   ap p licatio n s   th a t n ee d   m o r co m p r e h en s iv s t u d y .   Usi n g   th e   m o b ile   ap p licatio n s   in   h ea lt h   s er v ices   h a v e   an   o p er atio n al  co n s tr ai n ts   t h at  m ak t h e m   u n s u itab le  i f   t h e x ec u tio n   co n d itio n s   ar c h an g i n g   r ap id l y .   T h is   allo w s   cr ea tin g   co n te x t - a w ar p latf o r m .   T h er ar e   th r ee   im p o r tan ax e s th co n te x t,  th co n te x m a n ag er ,   an d   th ad ap tatio n   s tr at eg y   t h at  allo w s   f o r   th f lex ib le  a n d   th ad ap tab le  s er v ice  ex ec u tio n .     I n   t h ar ea   o f   co n te x t,  t h s e v er al  r esear ch er s   w er d e f i n ed   o f   t h co n te x s o m e   o f   t h e m   w a s   b ased   o n   th en u m er atio n   o f   th e   co n tex t u al  in f o r m atio n   ( lo ca lizatio n ,   ti m e,   d ate,   te m p er atu r e,   id en tit y ,   en v ir o n m e n t,  etc. )   li k p r o p o s in g   i n   [ 1 0 - 1 2 ] ,   an d   th o t h er s   r esear ch er s   w er g i v en   th e   d ef i n itio n s   w h ic h   b ef it   th eir   s tu d ie s ,   as  in   [ 1 3 ]   is   d ef i n ed   th e   co n te x a s   " A l t h in f o r m atio n   w h ic h   s tar ts   a   s er v ice   o r   ch a n g e s   th f o r m   o f   a   s er v ice  i f   its   ch a n g e s   o f   v alu e" .   Ho w ev er ,   t h e   d ef in i tio n   m o s g en er al  s u g g e s ted   b y   [ 1 4 ]   w h ich   is   d ef in ed   a s "   an y   i n f o r m atio n   ca n   b u s ed   to   ch ar ac ter ize   th s it u atio n   o f   en t it y   w h ich   i s   p er s o n ,   p lace ,   a n d   o b j ec t".   W co n s id er   th i s   e n tit y   as   t h s et   ele m en t s ,   wh ich   r ep r esen al asp ec t,  wh ich   i n f l u e n ce s   o n   th m o b ile  s er v ice  ex ec u tio n   i n   th h ea lt h   d o m ai n .   T h s ec o n d   is s u co n ce r n s   t h co n tex m an a g er   w h ich   i s   co m p o s ed   t h v ar io u s   s tep   ( ac q u is itio n ,   class i f icatio n ,   an d   m o d el) .   T h er ar th d i f f er e n ts   m e th o d s   o f   t h co n tex t   m a n a g er .   I n   a   r elate d   w o r k   [ 1 5 ] ,   w m en tio n ed   ce r tain   t h ese  m eth o d s ,   w h ic h   ar u s ed   i n   th p r o p o s ed   co n tex a w ar f r a m e w o r k   d ed icate d   to   th d i f f er en t   d o m ai n   ( h ea lt h ,   tr an s p o r t) .   Au th o r s   o f   t h w o r k   [ 1 6 ]   p r o p o s th m an a g er   o f   t h co n tex t   ele m e n ts .   T h is   co n te x m a n ag er   ca n   ev al u ate  th s tate  o f   t h co n tex o n   d e m an d ,   a   co n ti n u o u s   b asi s ,   w h e n   ce r tain   ele m e n ts   n ee d   to   b m o n ito r ed .   B u t,  ce r tain   ele m e n t s   h a s   m o n ito r ed   in   th e   d ef er e n ti m s o   th e y   n o t   r elate   to   th r elatio n   b et w ee n   t h co n te x t e le m en t s   f o r   s tar ti n g   th eir   m o n i to r .   W w o u ld   p r o p o s th co n tex m a n a g er   f o r   th e   h ea lt h   s er v ices.  I n   th i s   d o m a in ,   th er ar e   th d i f f er en t s   t y p e s   o f   t h r ela tio n s   b et w ee n   th e   co n te x i n f o r m atio n .   T h ese   r elatio n s   m u s t   b u s ed   to   en s u r e   th b es p r ese n tatio n   an d   th e   p r o p er   in ter p r etatio n   o f   t h co n tex t   ele m en ts   in   o r d er   to   estab lis h   a   co r r ec t   b eh av io r   o f   th r u n n in g   ap p licatio n s .   Fo r   th is ,   w w o u ld   lik to   cr ea te   m o n ito r   f o r   ea ch   co n tex ele m e n t,  an d   to   s tar t a   g r o u p   o f   th m o n ito r   in   t h d if f er en t ti m e.   T h is   p r o v id th r elatio n   b et w ee n   t h e le m e n ts   f o r   f ac ilit y   o f   th s er v ice  an d   t h co n te x m an a g er ,   an d   t h r ed u ce   ti m o f   th r ea ctio n .   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J   E lec  &   C o m p   E n g     I SS N:  2 0 8 8 - 8708       Desig n   a n d   imp leme n ta tio n   o f   a   co n text - a w a r h ea lth   s ervice  p la tfo r ( C A HS )   ( S ih a B elh a d i)   4995   A   t h ir d   is s u o f   a n   i m p o r tan ce   in   o u r   p latf o r m   is   t h ad ap tatio n   s tr ate g y .   Ob v io u s l y ,   th er ar e   th v ar io u s   r esear ch   p ap er s   f o cu s   o n   t h th e m o f   an   ad ap tatio n   [ 1 7 - 1 9 ] .     So ,   th er ar e   m ain l y   f o u r   k in d s   o f   an   ad ap tatio n :   a)   co n te n ad ap tatio n ,   b )   ad ap tatio n   o f   b eh av io r   ( s er v ices) ,   c)   p r ese n ta tio n   ( o r   in ter f ac e)   ad ap tatio n   an d   s o f t w ar co m p o n en ts   ad ap tatio n   [ 2 0 ]   an d   [ 2 1 ] .   I n   w o r k   [ 1 3 ]   p r o p o s ed   co n tex t - a w ar e   d y n a m ic  s er v ice  ad ap tatio n   ap p r o ac h .   th s er v ice  ad ap tatio n   ca n   b d o n i n   t w o   w a y s : a )   a u to m at ic  tr i g g er i n g   o f   s er v ice  ac co r d in g   to   th e   c u r r en t c o n tex t   o r   b )   ch an g i n g   t h q u ali t y   ( f o r m )   o f   p r o v id ed   s er v ice  ac co r d in g   to   th c u r r en co n tex t   b ec au s o n o r   m o r o f   t h co n tex t u al  i n f o r m atio n   h a s   o r   h a v e   ch an g ed   it s   o r   th eir   v alu e( s ) .   A cc o r d in g   to   [ 1 6 ] ,   t h au t h o r   h as  ch o s e n   to   f o llo w   t h p r in cip les  o f   Ser v ice - O r ien ted   A r ch itect u r ( SOA ) .   s er v ice  i s   a n   i n ter f ac f o r   r ep r esen ti n g   th e   co n tr ac b et w ee n   t h e   s er v ice   p r o v id er s   a n d   clien ts .   T h s er v ice  ca n   h av t h s a m e   f u n ctio n alit y   w it h   t h d if f er e n i m p le m e n tatio n s ,   ea c h   o n ad ap ted   to   ce r tain   co n tex s it u atio n .   T h e y   ca ll  " eq u iv ale n s er v ices"   th d i f f er e n i m p le m e n tatio n s   o f   th s a m in ter f ac e,   Ser v ic e   S ( 1 )   an d   Ser v ice  S ( 2 ) .     B ased   o n   r elate d   w o r k s ,   P o p o v ici  et  a l .   [ 1 6 ]   d ev elo p ed   th C o n te x t - Aw ar T r an s p o r Ser v ice   ( C A T S)  f r a m e w o r k   a n d   p r e s en ted   it s   ad v an tag e s   in   m an ag i n g   co n t e x a n d   s er v ic es,  an d   p r o v id in g   th in ter ac tio n   b et w ee n   v ar io u s   ap p licatio n s .   T h er ef o r e,   it  is   in ter e s ti n g   to   s u g g e s th c o n tex t - a w ar h ea lth   s er v ice  ( C A H S),   w h ich   i s   p o ten tial  v er s io n   o f   th C A T f r a m e w o r k .   T h is   co n tex in cl u d es   th f u n ct io n alit ies  o f   co n tex m an a g er   a n d   ad ap tatio n   s tr ate g ies   t h at  ar s u itab le  f o r   th e   h ea lth   d o m ain ,   w h ic h   is   ch ar ac ter ized   b y   v ar io u s   r elati o n s   b et w ee n   i n f o r m atio n   a n d   its   co n tex t.  Fo r   th i s   p u r p o s e,   th p r esen w o r k   m ak e s   an   atte m p to   cr ea te  co n tex cla s s i f icatio n   in   o r d er   to   en s u r th b est  p r esen tatio n   o f   th e s r elatio n s .   T h co n tex m an a g er   o f   th i s   f r a m e w o r k   ev al u ate s   ea ch   co n tex ele m en t,  u s i n g   t h p r o p o s ed   class i f icatio n .   On   t h o th er   h a n d ,   th co m b i n atio n   o f   th t w o   ap p r o ac h es  p r o p o s ed   in   [ 1 3 ]   an d   [ 1 6 ]   all o w s   cr ea ti n g   n e s tr ateg y   th a t o f f er s   f lex ib ili t y   i n   th ad ap tatio n   o f   s er v ice s .       3.   CO NT E XT - AW ARE H E AL T H   SE R VIC E S ( CAH S)  F R AM E WO RK   Ou r   p r o p o s ed   m o d el  r elate d   to   th h ea lt h - o r ien ted   ap p licati o n s   f o r   th h a n d h e ld   m o b ile  d ev ices  a n d   th eir   ad ap tatio n   to   t h c u r r en co n te x t.  I n   t h is   s ec t io n ,   w e   w ill   g i v a   v ie w   ab o u t   t h ter m   " co n tex t   a n d   co n tex t - a w ar e" .   T h en   w w i ll  p r esen " co n tex t - a w ar e   s e r v ice  ad ap tatio n "   f o r   d esig n i n g   o f   th m o b ile   ap p licatio n s .         3 . 1 .   H ea lt h   W f o cu s   ab o u h ea lt h   d o m a in ,   b ec au s t h is   d o m ai n   h as  ce r tai n   co n s tr ai n t s .   I n   ad d itio n ,   th ch a n g i n   th co n tex n ec e s s ar il y   ef f ec t s   o n   t h ex ec u tio n   o f   t h s o m s er v ices.  A ll  h e alth   s er v ices  s h o u ld   b ab le  to   ex ec u te  o n   th d i f f er en co n te x t u al  s i tu a t io n   a an y   t i m e,   t h is   co n ce p is   c alled   an   ad ap tatio n   d ep en d   to   th co n tex t.  O u r   s o l u tio n   i s   b ased   o n   m an a g er   o f   t h co n te x an d   t h s er v ices,   in   co n te x t - a w ar e   f r a m e w o r k ,   w h ich   h as  a   ca p ab ilit y   t h s u r v e illa n ce   o f   t w o   o r   m o r m alad ies.  Si n ce ,   a m o n g   s e r v ice s   t h at  o u r   f r a m e w o r k   m u s p r o v id w i n clu d d is p la y i n g   a n d   an al y zi n g   o f   t h d if f er en m ed ical  d a ta  an d   th w ir ele s s   co m m u n icatio n   b et w ee n   t h p atien t s   an d   th e ir   d o cto r s .   I n   o u r   s o lu tio n ,   t h ap p licatio n   m u s t c h o o s s er ies o f   an   ap p r o p r iates  s er v ice s   ac co r d in g   to   t h c u r r en co n te x tu a s it u atio n .   Mo r eo v er ,   t h s er v ices   m u s e x i s i n   an y   t i m e.   Fo r   th is ,   w p r ef er   lo ca s er v ices  ( i.e . ,   h a v i n g   a ll  n ee d ed   s er v ice s   o n   t h d ev ice) ,   as  th e y   a v o id   th ti m lo s s e s   to   tak d ec is i o n   o n   th p atie n t ' s   s itu a tio n .     3 . 2 .   Co nte x t   a nd   co nte x t - a w a re   No w ad a y s ,   t h m ai n   a x f o r   b u ild in g   m o b ile  ap p licatio n   is   t h co n tex t.  W to o k   t h i s   n o tio n   a s   a   s tar ted   p o in f o r   o u r   f r am e w o r k   C AHS.   W id en tif ied   th ele m e n ts   th a in f l u en ce   th h ea lt h   s er v ice s   ex ec u t io n   i n   th p ar ticu lar   s it u atio n   o f   th u s er s .   W p r o p o s s i m p le  g en er ic  s tr u ct u r f o r   r ep r esen tin g   a n y   co n tex t e le m e n t ( C E )   in   t h T ab le   1 .       T ab le  1 .   T h ch ar ac ter is tic  o f   t h co n te x t e le m en t   C h a r a c t e r i st i c   C o n t e x t   e l e me n t   N a me     T h e   n a me   o f   t h e   c o n t e x t   e l e m e n t     Ty p e     T h e   t y p e   o f   a n   i n f o r mat i o n   o f   t h i s   c o n t e x t   e l e m e n t     V a l u e     T h e   v a l u e   o f   t h i c o n t e x t   e l e m e n t   a t   t h e   p a r t i c u l a r   t i me     C l a ss    T h e   r e l a t i v e   c l a ssi f i c a t i o n         A   co n te x ele m e n is   id en ti f ie d   b y   it s   n a m e,   w h ich   m u s n ec ess ar il y   b u n iq u e.   I i s   c h ar ac ter ized   b y   its   v al u at  g iv e n   m o m e n t,  a n d   its   clas s .   W id en tify   t h th r ee   ty p es  t h at  ca n   b p r esen te d   th C E B o o lean ,   d is cr ete,   an d   co n tin u o u s   [ 1 6 ] .     Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8708   I n t J   E lec  &   C o m p   E n g ,   Vo l.  9 ,   No .   6 Dec em b er   2 0 1 9   :   4 9 9 3   -   50 0 5   4996   I n   o u r   w o r k   ,   th s er v ice  ad ap tatio n   ca n   b d o n in   t w o   s tep s a)   s p ec if y i n g   o f   s er v ice  wh ich   m u s t   b tr ig g er   ac co r d in g   to   t h c u r r en co n te x o r   b )   id e n ti f y in g   o f   t h ap p r o p r iate  s er v ice   v e r s io n   ac co r d in g   to   th c u r r en co n te x b ec au s o n o r   m o r o f   a   co n te x t u al  i n f o r m atio n   h a s   o r   h a v c h a n g ed   i ts   o r   th e ir   v al u e( s ) .   T h is   is   en o u g h   ab s tr ac a n d   li m it s   t h s et  o f   co n te x tu a i n f o r m atio n .   T h F i g u r e   2   s h o w s   t h s er v ice s   a n d   th s et s   o f   i n f o r m atio n   t h at  ca u s e s   th ad ap tatio n ,   w h ich   co n s id er ed   as p ar ts   o f   th g lo b al  c o n tex t.   I n   n o w   co m p u ti n g ,   t h ap p licatio n s   r ea ct  to   t h c h a n g e s   in   t h eir   co n te x t.  T h ese  ca p ab ilit ies  ar e   ca lled   co n tex t a w ar en es s   [ 9 ] ,   w h ic h   r eq u ir es t h co n tex t u al  in f o r m atio n   .   th e s i n f o r m a tio n     m u s t b co llected   an d   p r esen ted   to   t h ad ap ta tio n   ap p licatio n .   B ec au s e   t h ese  i n f o r m atio n   ar c h ar ac t er ed   b y   d iv er s i t y ,     h eter o g e n eit y   an d   g r ea q u alit y ,   w s u g g ested   to   c lass if y   t h ese  i n f o r m a tio n   in   o r d er   to   m ak t h ad ap tatio n   o p er atio n   ea s ier .   Ou r   class if ic atio n   o f   th co n te x ele m e n ts   w a s   p r esen ted   in   th f o llo w i n g   titl e.   T h s tate  o f   th co n tex t   ch a n g es   ac co r d in g   to   ti m e.   T h is   e v e n allo w ed   t o   u s m o d u le s   ca lled   C o n tex t   Mo n ito r s .   C o n te x t   M o n ito r s   m o n ito r ed   th v al u o f   th s i n g le  co n te x t e le m e n t.            Fig u r 2 .   T h ap p licatio n   co m p o s itio n       3 . 3 .   T he  co nte x t   cla s s if ica t io n   T h er ar e   th d if f er e n t y p es  o f   th r elatio n s   b et w ee n   co n tex in f o r m a tio n .   th e s r elatio n s   m u s b e   u s ed   to   en s u r th b est  p r ese n tatio n   a n d   th p r o p er   in ter p r etatio n   o f   t h ese  ele m e n ts   i n   o r d er   t o   estab lis h   co r r ec b eh av io r   o f   r u n n i n g   a p p licatio n s .   I n   o r d er   to   th r elatio n s h ip   is   t h r es u lt  o f   th ce r tain   d ep en d en c e   b et w ee n   t h co n tex t   ele m en ts .   Fo r   th i s   r ea s o n ,   it   is   s u g g es te d   to   class i f y   all   t h i m p o r tan co n tex t   e le m en t s   i n   th f o r m   o f   tr ee ,   as r ep o r ted   in   [ 3 ].   T h is   c las s if icatio n   p r es en ted   in   t h F i g u r 3 .               Fig u r 3 .   T h co n tex t tr ee       T h is   class i f icatio n   allo w s   th f ac ilit y   o f   t h co n te x an d   th s er v ice  m an a g er   an d   th r ed u ce   ti m o f   th r ea ctio n   i n   t h ca s o f   t h co n tex t   ch a n g es.  W h a v m a d class if ica tio n   in   t w o   ca te g o r ies  t h at  s ee m s   to   u s   m o r e x p r ess i v an d   h elp f u l:  a)   co n tex in f o r m at io n   w h o s ar r esp o n s ib le  f o r   s tar tin g   o r   s to p p in g   a   s er v ice  v er s io n   an d   b )   co n tex in f o r m at io n   th a u s ed   b y   th s tar ted   s er v ice.   T h is   class i f i c atio n   in cl u d f i v e   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J   E lec  &   C o m p   E n g     I SS N:  2 0 8 8 - 8708       Desig n   a n d   imp leme n ta tio n   o f   a   co n text - a w a r h ea lth   s ervice  p la tfo r ( C A HS )   ( S ih a B elh a d i)   4997   th m ai n   clas s es  a s   u s ed   Ser v ice  co n te x t,  P h y s ical  co n te x t ,   User   co n te x t,  Hea lt h   e n v ir o n m e n co n te x t,  an d   Dev ice  C o n te x t.  I is   m o r ex p r ess i v an d   co m p lete,   b ec au s it  co v er s   al asp ec ts   o f   t h co n te x t,  w h ic h   in f lu e n ce s   o n   th e x ec u t io n   o f   th m o b ile  ap p licatio n s   d ed ic ated   to   th h ea lth   d o m ai n ,   an d   f ac ilit ate s   th ta s k   o f   an   ad ap tatio n .   I t   is   m o r o r g an ized ,   b ec au s ea c h   co n t ex ele m e n co n ta i n s   th e   s u b - ele m e n ts ,   th at   h a v e   th d if f er e n t y p e s   o f   th r el atio n s h ip s   b et w ee n   t h e m ,   f o r   ex a m p l e,   h y p er te n s iv p a tien t ,   c h an g i n   th ac tiv it y   co n te x v alu ( s ti l ea tin g )   m a y   a f f ec t h v al u e   o f   h is   v ita s ig n s   ( in cr ea s in   s y s to lic  p r ess u r e) ,   th ese  r elatio n s h ip s   f ac ilit ate  t h co n tex m an a g er .     3 . 4 .   T he  co nte x t - a w a re   s er v ice  a da pta t io n   T h ad ap tatio n   s tr ateg y   is   b a s ed   o n   s tar ti n g   a n   ap p r o p r iate  s er v ice  ac co r d in g   to   th e   cu r r e n co n te x t.  Fo r   ea ch   co n tex s it u atio n ,   th e   s et  o f   s er v ices  ca n   s tar t.  ea ch   s er v ice  h as  th s e o f   v er s io n s   ( i n   o u r   w o r k ,   th a n a l y s i s   s er v ice  h as  t w o   v er s io n s ) .   Fo r   ea ch   s er v ice,   t h er ar s et   o f   co n tex tu al   i n f o r m atio n ,   w h ic h   i s   r esp o n s ib le  f o r   s tar ti n g   t h s er v ice  v er s io n .   Ou r   p r o p o s ed   w o r k ,   th co n t ex tr ee   co n s i s ts   f i v clas s es,  w h ic h   n o ted   C ct  ={ Ser v i ce   co n tex t,  P h y s ical   co n te x t,  U s er   co n te x t,  Hea lth   en v ir o n m e n co n tex t ,   Dev ice  C o n te x t}.     Fo r   ea ch   class   h as   m atr i x   ( MC)  w h ic h   p r esen t s   an   i n f o r m atio n   o f   m o n ito r ed   co n tex ele m e n t.  On   t h o t h er   h a n d ,   th s er v ice  ca n   h av t h s a m f u n ctio n alit y   with   th d if f er e n i m p le m e n ta ti o n ea ch   o n ad ap ted   a   ce r tai n   s it u atio n .   W ca ll  " s er v ice  v er s io n "   th d if f er e n i m p le m en ta tio n   o f   t h s a m in ter f ac e.   A   s er v ice  w il b s tar ted   s p ec if ic   v er s io n   i f   t h co n te x s i tu at io n   is   a n   ap p r o p r iate  to   th is   v e r s io n .   I n   ad d itio n ,   f o r   ea ch   s e r v ice   h a s   d ef au l v er s io n   t h at  as s u r th co n ti n u o u s   o f   a n   ex ec u tio n   w h e n   th s itu a tio n   co n te x t u al  is   n o t v er i f ied .   A   p r in cip le  o f   t h ad ap tati o n   is   b ased   o n   co r r elatio n   b et w ee n   t h co n te x t   ele m en ts   a n d   th s er v ices.  A   m atr ix   M C   u s ed   in   t h is   s tr ateg y   t h at  a llo w to   id en t if y i n g   th r elatio n   b et w ee n   C E   an d   S.   T h d im e n s io n   o f   m atr i x   M C   ( i,  j )   d ef in ed   as  f o llo w i n g i:   s p ec if ie s   an   id e n ti f icatio n   o f   C E   in   i ts   C las s ,   an d   j : sp ec if ies a  v er s io n   o f   t h u s ed   s er v ice.   T h m atr ix   co ef f icie n t( )   is   eq u al  0   o r   1   (   =   1 ,   i f   C E   is   m o n ito r ed ,   o r   0 ,     i f   C E   is   n o m o n ito r ed ) .   So ,   if   cla s s Hea l th   E n v ir o n m e n C o n te x ( HE C )   h a s   t h r ee   C E s   w h ic h   p r ese n ted   th e   in f o r m a tio n   th at  f o c u s   o n   t h h ea lt h   d o m ai n ( Vital  s i g n s   ,   A c tiv it y   ,   P r escr ib ed   m ed icatio n   )     th en   t h m atr ix   ( MC)   o f   th i s   class   is   p r ese n ted   as f o llo w i n g :       Vs 1   Vs 2   Vs m     11             12  …      1 m     CE 1   MC HEC  =                     21                   …    2 m               CE 2     31   32    …    3 m           CE 3     Fro m   co ef f icie n ar d eter m i n ed   th co n tex tu al  s it u atio n .   Si n ce ,   all  co ef f icie n v al u e s   ar 1 ,   w e   co n s id er   to   cr ea te  th e   cu r r e n co n te x t u al  s it u atio n   f o r   s p e cif y in g   th e   ad ap ted   s er v ice   v er s io n .   T h er ef o r e,   th ad ap to r   p ick s   th   s er v ices  v er s io n   ac co r d in g   to   co n tex t u al  s it u atio n .       4.   ARCH I T E C T UR E   O F   T H E   CO NT E X T - AW ARE  H E AL T H   SE R VI CE ( C AH S)  F RAM E WO RK   As  s h o w n   in   t h Fi g u r 4 ,   th e   f r a m e w o r k   C AHS  p r o v id es  an   ex ec u tio n   e n v ir o n m e n t h at  ad ap ts   th e   h ea lt h   s er v ices  d ep en d i n g   to   t h co n te x s it u atio n s   at  r u n   ti m e,   w it h o u e x p licit   d e m a n d   f r o m   t h u s er .   O n   t h e   o th er   h an d ,   th f r a m e w o r k   ai m s   to   m a n a g o f   t h s et  ap p licatio n s   t h a m o n ito r   o f   s e v er al  p atien ts   w it h   t h e   d if f er e n c h r o n ic  d i s ea s e s .   T h er ef o r e,   C AHS  is   co m p o s e d   o f   t h r ee   s p ec i f ic  m o d u les   ( co n tex t   m an a g er ,   ad ap to r ,   c o n tr o ller - SDC )   w h ic h   f u n ctio n   co n tin u o u s l y   a s   lo n g   as t h f r a m e w o r k   is   s tar ted .             Fig u r 4 .   T h C A HS  f r a m e w o r k   ar ch itect u r e   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8708   I n t J   E lec  &   C o m p   E n g ,   Vo l.  9 ,   No .   6 Dec em b er   2 0 1 9   :   4 9 9 3   -   50 0 5   4998   4 . 1 .   T he  co nte x t   m a na g er   m o du l e   T h co n tex t   m an a g er   m o d u le  is   r esp o n s ib le   f o r   m o n it o r in g   th e   ce r tain   co n te x e l e m en ts   in   th d if f er e n ti m e.   E ac h   co n te x ele m e n h a s   m o n ito r   t h eir   v alu a n d   tr ig g er   th o t h er   m o n ito r s   o f   t h co n te x t   ele m e n ts   w h ic h   b elo n g   to   th s a m cla s s   ( d ev ice  co n te x t,  u s er   co n tex t,  e n v ir o n m e n h ea lt h   co n te x t,  p h y s ica l   co n tex t,  s er v ice  co n te x t)   b y   u s i n g   f ile  XM L   C D C .   T h p r o ce s s   ab o u t h co n tex m an ag er   d escr ib ed   in   th F i g u r 5 .   T h co n tex m an g er   co n tai n s   t w o   co m p o n e n ts :           Fig u r 5 .   T h co n tex t   m a n ag e r       a.   Mo n ito r   o f   C E   Mo n ito r   o f   C E   allo w s   to   ev a lu ate  th co n tex s tate.     I ac q u ir es  v al u o f   th co n te x t   ele m en t.   T h is   is   a llo w ed   to   r ed u ce   t h e   ch ar g e   at  t h le v el  o f   Hea r t   o f   co n te x m a n ag er .   T h co n t ex tu a s itu at io n   i s   co n s is ted   b y   t h s et  o f   th co n tex t e le m en ts   a n d   its   p r esen tat io n   is :         Sc j {CE 1j ,   C E 2j , …,   C E nj   j = 1 , …,   m .     Fo r   ea ch   co n te x ele m e n h a s   th m o n ito r .     T h m o n i to r   is   n o ted   MCE ij   s u c h   a s i   p r esen ts   n u m b er   th co n te x t e le m en t in   C las s ,   an d   j   p r esen ts   n u m b er   th s it u at io n   w h ic h   cr ea ted   b y   th s e t o f   co n tex t e le m e n t.   b.   Hea r t o f   co n tex m a n ag er     Hea r o f   co n tex m an a g er   i s   n o ted   " Hea r o f   C M" .     Hea r o f   co n t ex t   m an a g er   i s   t h m ain   p o le  i n   th co n tex t   m a n a g er   m o d u le.   I is   r esp o n s ib le  f o r   r ea d in g   t h X m f ile   o f   t h co n tex cla s s i f icatio n ,   s tar ti n g   th n ee d ed   m o n ito r   o f   ea c h   co n tex ele m e n t,  a n d   n o ti f y i n g   C o n ctr o llo r - S D C   o n   t h c o n tex t u al  s it u atio n .   I n   ca s t h f ir s t   u s e,   Hea r o f   co n tex t   m a n a g er   d eter m i n s   t h u s er   i n f o r m atio n .   Fo r   th i s ,   h ea r o f   C cr ea te   t w o   tx f ile f ir s f ile  is   n a m ed   P r o f il.tx t,  w h ich   co n tain s   an   i n f o r m atio n   o f   t h u s er   ( First   n a m e,   f a m il y   n a m e,   ag e,   s tatu s   ( p atien o r   d o cto r ) ,   u s er n a m e,   p ass w o r d ) ,   an d   o th er   f ile  is   n a m ed   Statu s - U s er . tx t.  T h is   f ile  is   cr ea ted   w h e n   th u s er   is   p atie n t.  P r escr ib ed m ed icatio n . t x c o n tain s   an   i n f o r m atio n   o f   t h e   p atien ( m alad ies,   n u m b er   o f   m ed icat io n ,   n a m o f   m ed icat io n ,   th ti m to   ta k m ed icatio n ,   an d   d o s o f   m ed icatio n ) .     4 . 2 .   Co ntr o ller - SDC   T h m a in   g o al  o f   C o n tr o ller - S DC   cr ea tes a  m atr i x   MC   ac co r d in g   to   t h s tatu s   o f     M C E ij as   s h o w n ed   in   Fi g u r 6 .   C o n tr o ller - SDC   ac ts   as  co r r elatio n   p o in b et w e e n   t h co n te x ele m e n a n d   th s er v ice  i n   o u r   f r a m e w o r k .   T h p o licies  o f   C o n to ller - S DC   ar e   b ased   o n   th v ar iatio n   s tatu s   o f   M C E .   I u p d ates  t h m atr i x   ( MC)  f o r   s tar tin g   t h b etter   s e r v ice  v er s io n   d ep en d in g   to   th e   co n tex t u al  s i tu at io n .   T y p icall y ,   th f u n cti o n alit y   o f   C o n tr o ller - SD C   i s   t h p r eli m i n ar y   s t ep   o f   th e   ad ap tatio n   s tr ate g y .   I n   t h d i f f er en ti m e,   th co n te x t   m an a g er   d e m an d s   to   tr i g g er   th m o n i to r   o f   t h co n tex t   el e m en ts .   T h ese   ele m e n t s   b elo n g   th e   s a m cla s s .   I n   th i s   ti m e,   C o n tr o ller - SD C   c r ea ted   th m atr i x   ( MC)  w h ic h   d ep en d s   th is   m o n i to r ed   class .   T h is   m eth o d   allo w s   t s tar th m o n ito r s   o f   co n tex ele m e n as  g r o u p .   It   ass u r es  t w o   i m p o r ta n ts   p o in ts   in   t h co n te x t - a w ar h e alth   s y s te m :   -   Ma n ag t h g r ea q u a n tit y   an d   th e   h eter o g en e it y   a n d   th d i v er s it y   o f   t h co n tex in f o r m a tio n   w it h o u b e   th ch ar g in   t h o n l y   co m p o n en t le v e l o f   t h C A H S f r a m e wo r k .   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J   E lec  &   C o m p   E n g     I SS N:  2 0 8 8 - 8708       Desig n   a n d   imp leme n ta tio n   o f   a   co n text - a w a r h ea lth   s ervice  p la tfo r ( C A HS )   ( S ih a B elh a d i)   4999   -   T h d if f er en t y p e s   o f   t h r elatio n s   b et w ee n   t h co n te x in f o r m atio n .   T h ese  r elatio n s   m u s b u s ed   to   o f f er   th b est co n te x t u al  s it u atio n   in   o r d er   t o   estab lis h   r u n n i n g   a p p r o p r iate  s er v ice  v er s io n .           Fig u r 6 .   C o n tr o ller - S DC       4 . 3 .   A da pto r   A d ap to r   is   r e s p o n s ib le  f o r   m a n ag i n g   t h s er v ice s   a s   s h o w n   i n   t h F ig u r e   7 .   W h e n   cr ea ti n g   th m atr i x   ( MC)  ab o u t h m o n ito r   s t atu s   o f   co n tex ele m en t s   f r o m   C o n t r o ller - SD C ,   A d ap to r   w ill  c h ec k s   th i n co m p atib il it y   b et w ee n   t h n o tific atio n s   f r o m   t h e   C o n tr o ller - S DC   an d   t h s er v ice   v er s io n .   W r ec all   th co n tex t u al  s it u atio n   ( Sc)   i n   t h s ec tio n   ( 3 . 3 ) .   T h p r o b l e m   i s   to   f i n d   th e   m o s s u itab l s er v ice  v er s io n   i n   th s er v ice  s et  e x is ted   lo ca ll y   o n   th d ev ice.           Fig u r 7 .   T h s er v ice  m an a g er       T h s er v ice  ca n   h av th s a m f u n ctio n alit y   w i th   th e   d if f er en i m p le m e n tat io n .   T h is   s e r v i ce   ta k es   th s a m n a m e.   On   t h o th er   h an d ,   f o r   ea ch   v er s io n   o f   t h is   s er v ice  w ea r s   th d i f f er e n n u m b er .   I n   th m o r e   d etail,   th s er v ice  h as  t h n a m " T " .   W ca n   m e n tio n   th v er s io n s   o f   th i s   s er v ice  S j ( T )   {S 1 ( T ) ,   S 2   ( T ) , …,   S m ( T ) }.   A d ap to r   co m p ar ed   b et w ee n   t h n u m b er   o f   th e   s er v ice   v er s io n   a n d   t h c o n tex t u al  s it u atio n .   I f   th n u m b er s   ar eq u al,   A d ap to r   w i ll st ar t t h is   s er v ice  v er s io n   ac co r d in g   to   th i s   co n te x t u al  s itu a tio n .       5.   T H E   I M P L E M E NT A T I O O F   T H E   P RO P O SE F RA M E WO RK     I n   th i s   s ec tio n ,   w p r esen a n   i m p le m en ta tio n   o f   o u r   f r a m e w o r k .   W h a v ev a lu ated   t h b eh av io r   o f   o u r   f r a m e w o r k   o n   An d r o id   s m ar tp h o n e s .   W c h o s to   i m p le m e n t h i s   f r a m e w o r k   u s i n g   t h O SGi  tec h n o lo g y   an d   th iP OJ O   [2 2 ]   c o m p o n e n m o d el.     5 . 1 .   T he  CAH f ra m ew o rk   w it iPO J O     T h C A H Fra m e w o r k   i s   co m p o s ed   b y   th m u ltip le  s er v i ce s   co m p atib le  w it h   b o th   An d r o id   an d   OSGi.  O u r   f r a m e w o r k   d ev e l o p ed   as  an   An d r o id   ac tiv it y   w h ic h   e m b ed s   th e   Feli x   f r a m e w o r k   a n d   I p o j o .   L a u n c h i n g   Fel ix   i n s id an   An d r o id   p r o g r am   i s   n o d if f icu lt.  I is   b u ilt  o f   co m p o n e n ts ,   w h i c h   ar b o u n d   at   th e x ec u t io n .   E ac h   co m p o n e n m u s p r o v id it s   o w n   t h f u n ct io n al,   a n d   is   i m p le m en ted   as  b u n d le  r u n n i n g ,   m an a g e s   th n o n - f u n ct io n al  ca p ab ilit ies.  T h m an a g er   m o d u les  w er alr ea d y   d escr ib ed   in   th p r ev io u s   s ec tio n   ( C o n tex m a n ag er ,   C o n tr o lle r - SD C   an d   A d ap to r ) .   W in tr o d u ce   th i m p le m e n ta tio n   ex p la n atio n   o f   th m a n a g er   m o d u le s   b y   u s i n g   iP OJ an d   A n d r o id .   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8708   I n t J   E lec  &   C o m p   E n g ,   Vo l.  9 ,   No .   6 Dec em b er   2 0 1 9   :   4 9 9 3   -   50 0 5   5000   T h C o n tex Ma n a g er   ca n   e v a lu ate  t h co n te x s tate  o n   d e m an d ,   b y   s tar ti n g   o r   s to p p in g   t h m o n ito r   o f   th co n te x ele m e n ( MC E ) .   I n   th f ir s ti m e,   Hea r o f   C r ea d s   th X ML   C D C   f ile  w h ic h   p r esen ts   th co n te x tr ee   as  s h o w n   i n   th Fi g u r 3 .   T h is   r ea d in g   al lo w s   to   s tar t h g r o u p   o f   th co n tex ele m e n ts   m o n ito r s .   T h ese  co n tex ele m en ts   b elo n g   to   th s a m clas s .   T h co n tex m an a g er   n o ti f ies  C o n tr o ller - SDC   o n   th c h a n g ed   s tat u s   o f   C E   f o r   c r ea tin g   t h m atr i x   ( M C ) .   T h ad ap to r   is   r esp o n s ib le  f o r   e x e cu ti n g   t h s er v ices.   I r ea d s   th m a n i f est. f m   f ile  o f   t h all  s er v ices  v er s io n s   t h at   ar av ailab le  o n   th C A H f r a m e w o r k   an d   ca n   d ec id to   s tar t o r   s to p   s e r v ices   b ased   o n   th m atr i x   ( MC).     5 . 2 .   T he  ex peri m e nta l r esu lt s   o f   t he  pro po s ed  f ra m ew o rk   T h g o al  o f   o u r   i m p le m en ta t io n   is   to   e v alu a te  t h f o llo w i n g   asp ec ts t h b eh a v io r   o f   t h C A HS   f r a m e w o r k   o n   t h p h o n es   a n d   th e   d if f er en t   s o lu tio n s   f o r   m an a g i n g   t h co n te x t,   a n d   th ad ap tatio n   o f   th h ea lth   s er v ice.   W m ea s u r th ti m n ec e s s ar y   f o r   in s t allin g   an d   s tar tin g   t h s er v ice s ,   b ec au s t h is   t i m e   tak es   th e   i m p o r ta n p lace   in   th ad ap tatio n   ti m e,   w h ic h   c o n s id er ed   as  a n   i m p o r tan t   f a cto r   f o r   esti m ati n g   th e f f ec tiv e   o f   t h C A HS  f r a m e w o r k .   Fo r   t h is ,   w m ea s u r also   th ad ap tatio n   ti m w h ic h   is   th n ee d ed   ti m e   f o r   tak i n g   u tile  t h s u ited   all  s er v ices  w h ic h   ar r ea d y   f o r   u s e.   I n   s t u d ied   d o m ai n ,   a m o n g   t h s er v ices   th at   o u r   f r a m e w o r k   m u s p r o v id w i n clu d d is p la y in g   an d   an al y zi n g   o f   t h m ed ical  d ata,   w ir el ess   co m m u n icat io n   f o r   s en d i n g   th h ea lt h   s i tu at io n   o f   t h p atie n to   th d o cto r ,   an d   th m ed ical  d ata  s to r ag u s i n g   th P HP   w e b   s er v ice,   es s en t ial  to   an   u s er   i n   th h ea lt h   d o m ai n .   T h u s er   is   eith er   p atie n o r   d o cto r ,   f o r   th at,   h n ee d s   th d if f er e n co n te x ele m e n t   m o n i to r .   W w o u ld   b ase  o n   t w o   cla s s e s   o f   t h co n te x e le m e n t:  ( 1 )   Hea lt h   en v ir o n m e n t c o n tex t ( 2 )   Dev i ce   co n tex t.  Her ar th u s ed   ele m e n ts   i n   t h ev al u atio n :   a.   T h f ir s t e le m e n t i s   th co n tex t e le m e n w h ich   p r e s e n ted   as f o llo w i n g :   C E 1   {Na m B lo o d   s u g ar   le v el;  T y p d is cr ete;  C lass H ea lth   E n v ir o n m e n t}.   C E 2   {Na m E C G;  T y p co n tin u o u s ; Cl a s s Hea lth   E n v i r o n m e n t}.   C E 3   {Na m A cti v it y ; T y p d is cr ete;  C las s Hea lt h   E n v i r o n m e n t}.   C E 4   {Na m P r escr ib ed   m ed ic atio n ; T y p d is cr ete;  C lass Hea lth   E n v ir o n m e n t}.   C E 5   {Na m Me m o r y ; T y p d is cr ete;  C las s Dev ice} .   C E 6   {Na m B atter y ; T y p d is cr ete;  C las s Dev ice} .   b.   T h s ec o n d   ele m en t i s   t h m o n ito r   o f   th co n tex t e le m e n wh ich   p r ese n ted   as f o llo w i n g :   T h co n tex Mo n ito r   f o r   " B l o o d   s u g ar   lev el"   is   s er v ice   th at  ev al u ates  t h B lo o d   s u g ar   lev el  f o r   th e   d iab etic  p atien t.    T h co n tex Mo n ito r   f o r   " E C G"   is   s er v ice  t h at  e v al u ates   th v al u es   o f   t h E C s i g n al   f o r   t h ca r d iac   p atien t.   T h co n tex t M o n ito r   f o r   " A cti v it y "   is   s er v ice  th a t d etec ts   t h ac tiv it y   f o r   th d iab etic  o r   ca r d iac  p atien t.   T h co n tex Mo n ito r   f o r   " m e m o r y "   is   s er v ice  t h at  ev a lu ates  th m e m o r y   o f   th m o b il p h o n f o r   th e   d if f er e n t u s er .   T h co n tex Mo n ito r   f o r   " b at ter y "   is   s er v ice   th a ev al u a tes  t h b atter y   o f   th e   m o b ile   p h o n f o r   th e   d if f er e n t u s er .   T h m o n ito r s   ev a lu ate   t h co n tex t e le m e n t s   e v er y   ti m i n   th g r o u p   w a y .   T h co n te x t e le m en ts   b elo n g   t h e   s a m cla s s   . t h ese  co n te x t e le m en ts   e v al u ated   th e v er y   s a m ti m e.   c.   T h th ir d   ele m en t i s   s er v ice  w h ic h   p r esen ted   as  f o llo w in g :   -   Di s p la y   s er v ice:  i is   r e s p o n s ib le  f o r   d is p la y in g   t h m ed ic al  d ata.   I h as   t h r ee   v er s io n s   w h ic h   p r esen ted   S(d is p la y ) ={ S 1 ( d is p la y ) ,   S 2 ( d i s p la y ) ,   S 3 ( d is p la y ) }   S 1 ( d is p la y)   is   th f i r s v er s io n   f o r   th e   d iab etic  p atien t.  I d ep en d   o n       Sc  ( HE C )   {CE 11 {n a m e=   B lo o d   s u g a r   lev el  },   C E 21 {n a m e= ac ti v it y } ,     CE 31 n a m e=   P r escr ib ed   m ed icatio n   }}   an d   Sc( DC )   CE 11 {n a m e= m e m o r y },   C E 21 { n a m e= b atter y }} .     W u s th a n d r o id   GUI   el em en t,  as s h o w n   i n   t h Fi g u r 8 ( a ) .   S 2 ( d is p la y)   is   t h e   s ec o n d   v er s io n   f o r   th e   ca r d iac  p atien w h ic h   d ep en d   o n       Sc  ( HE C )   C E 1 2 {n a m e= E C G},   C E 2 2 {n a m e= ac ti v it y } ,   C E 3 2 {n a m e=   P r escr ib ed   m ed icatio n   }}   an d   Sc( DC )   C E 1 2 {n a m e= m e m o r y },   C E 2 2 {n a m e= b atter y } }.   W u s th an d r o id   GUI   e le m e n t,  an d   th e   Gr ap h Vie w - 4 . 0 . 1 . j ar   l ib r a r y ,   a s   s h o w n   i n   th F ig u r 8 ( b ) .   S 3 ( d is p la y)   is   th th ir d   v er s io n   f o r   th d o cto r   w h ic h   d ep en d   o n     Sc( DC ) ={ C E 1 3 {n a m e= m e m o r y } ,   C E 2 3 {n a m e= b atter y }} .   W u s t h an d r o id   GUI   el e m e n t,  as  s h o w n   i n   th F ig u r e   8 ( c )   an d   th e     Fig u r 8 ( d ) .   -   A n al y ze   s er v ice:  it   is   r esp o n s ib le  f o r   a n al y z in g   t h m ed ic al  d ata.   I h as   t w o   v er s io n s ,   wh ich   p r esen ted :     S ( an al y ze )   {S 1   ( a n al y ze ) ,   S ( an al y ze ) }.     S 1 ( a na lyze)    is   th f ir s v er s io n   f o r   th d iab etic  p atien t.  I t d ep en d   o n     Sc( HE C )   ={ C E 1 1 {n a m e=   B lo o d   s u g ar   lev el  },   C E 2 1 {n a m e= ac tiv it y },   C E 3 1 n a m e=   P r escr ib ed   m ed icatio n   }}   a n d   Sc( DC )   C E 1 1 {n a m e= m e m o r y },   C E 2 1 {n a m e= b atter y }} .     Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J   E lec  &   C o m p   E n g     I SS N:  2 0 8 8 - 8708       Desig n   a n d   imp leme n ta tio n   o f   a   co n text - a w a r h ea lth   s ervice  p la tfo r ( C A HS )   ( S ih a B elh a d i)   5001     S 2 ( a na lyze)    is   t h s ec o n d   v er s io n   f o r   th e   ca r d iac  p atien t.  I d ep en d   o n   Sc  ( HE C )   =   C E 1 2 {n a m e= E C G} ,   C E 2 2 {n a m e= ac t iv i t y },   C E 3 2 {n a m e=   P r escr ib ed   m ed icati o n }}   Sc  ( D C )   {   C E 1 2 {n a m e= m e m o r y },   C E 2 2 {n a m e= b atter y }} .   I an al y ze s   t h E C s i g n al  f o r   d etec tin g   th ab n o r m al  s itu a ti o n .     I allo w s   to   d eter m in t h Hea r tb ea t,  an d   t h QR S d u r atio n .   -   C o m m u n ic atio n   s er v ice:  it  i s   r esp o n s ib le  f o r   s en d i n g   a n d   r ec eip tin g   th m ed ical  d ata  an d   th p atien t   s itu a tio n .   Fo r   th i s   s er v i ce ,   w u s So c k et.   I h as  t w o   v er s io n s   w h ich   p r esen te d                     S(c o m m u n icatio n ) ={ S 1 ( co m m u n ica tio n ) ,   S 2 ( co m m u n icatio n ) }.   T o   d em o n s tr ate   th e   ca p ac it y   an d   ef f ec t iv e n es s   o f   t h C A H f r a m e w o r k ,   it  w a s   d ec id ed   to   p r esen t   th e v en ts   th at   o cc u r   d u r i n g   it s   ex ec u tio n ,   as   s h o w n   in   Fi g u r 8 .   T im ( T b   )     is   co n s id er ed   as  th e   d u r atio n   d u r in g   w h ic h   t h co n tex i s   m o n ito r ed ,   T s   is   th e   m o m e n t h s er v ice   is   s elec ted ,   T on   t h m o m e n t   th e   s elec ted   s er v ice  is   ac ti v ated   an d   T off   th m o m en w h e n   t h in ap p r o p r iate  s er v ice  is   d is ab led .   T h d if f er e n ti m es  ar m ea s u r ed   an d   g i v en   i n   Fi g u r 9 .             ( a)     ( b )           ( c)     ( d )     Fig u r 8 .   T h C A HS  f r a m e w o r k s er v ice s ( a)   S 1   ( d is p la y ) ( b )   S 2   ( d is p lay ) ,   ( c)   S 3   ( d is p lay )   f o r   d iab etic   d o cto r ( d )   S 3   ( d is p lay )   f o r   ca r d io lo g y   d o cto r           Fig u r 9 .   T h ex p er im e n tal  m ea s u r e m en t s   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8708   I n t J   E lec  &   C o m p   E n g ,   Vo l.  9 ,   No .   6 Dec em b er   2 0 1 9   :   4 9 9 3   -   50 0 5   5002   T im e   A   -   A f ter   co n te x m o n it o r in g ,   th MC  m atr i x   is   d ev e lo p ed ,   f r o m   th m o m e n it  w as  cr ea ted   u n t il  th ap p r o p r iate  s er v ice   is   s elec ted .   T h ti m r eq u ir ed   to   s elec th ad eq u ate  s er v ice  v er s io n   i s   r ep r esen ted   b y   t h f o llo w i n g   e q u atio n :     T im A   [ Si ( T ) ]   T s   [ Si ( T ) ]   -   ( T b   + )     w h e n   th m o n ito r in g   o f   th co n tex ele m en is   co m p lete d ,   th en   th v al u es  o f   t h co n tex ele m e n ts   ar ev alu a ted   ac co r d in g   to   T b .   T h p ar am eter     r ep r esen ts   t h p er io d   o f   ti m r eq u ir ed   to   cr ea te  th m a tr ix   M C .   I n   o u r   e v al u atio n ,   t h r ee   v er s io n s   o f   t h d is p la y   s er v ice  an d   t w o   v er s io n s   o f   th e   an a l y s i s   s er v ice  w er e   co n s id er ed ,   w ith   m   3   f o r   t h e   f ir s s er v ice  a n d   m   2   f o r   t h s ec o n d   o n e.   T h s er v ice  v er s io n s   w er s e lecte d   f r o m   t h co n te x t sit u atio n ,   d u r in g   t h ti m p er io d   T s   [ Si ( T ) ] ,   w it h   i =   1 ,   . . . ,   m .   T im B   -   Th is   is   th p er io d   o f   ti m r eq u ir ed   f o r   t h C A H f r a m e w o r k   to   s tar t h e   v er s io n   o f   th s elec ted   s er v ice.   T h is   ti m e   is   d eter m in ed   u s i n g   th f o llo w i n g   eq u atio n :     T im B   [ Si ( T ) ]   T o n   [ Si ( T ) ]   -   T s   [ Si ( T ) ]     T o n   [ Si  ( T ) ]   is   th ti m w h e n   th v er s io n   o f   th s el ec ted   s er v ice  is   s tar ted .   I s h o u ld   b n o ted   th at   th co n te x ele m e n ca n   ta k s ev er al  v al u e s .   Fo r   ex a m p le,   f o r   th d is ea s e   o f   d iab etes,  t h v alu o f   v ita s i g n s   is   d is cr ete  b u f o r   th e   h ea r t   d is ea s t h v al u o f   v ital  s ig n s   i s   co n tin u o u s .   I i s   t h er ef o r i m p o r tan t   to   d is tin g u is h   th f o u r   ca s e s   g i v e n   b elo w :   C ase   1   :   T h u s er   is   p atien w h o   s u f f e r s   f r o m   d iab etes.  A ll c o n te x t e le m e n ts   ar d is cr ete.   C ase   2   :   T h u s er   is   p atien w it h   a   h ea r d is ea s e.   So m co n te x t   ele m en ts   ar d is cr ete  an d   o th er s   ar co n tin u o u s .   C ase  3   :   T h u s er   is   d o cto r   w h o   tr ea ts   d iab etes.   C ase  4   :   T h u s er   is   d o cto r   w h o   tr ea ts   h ea r t d is ea s e.   T h ti m e   elap s ed   f r o m   th e   co n tex t   ele m en m o n ito r   to   t h s elec tio n   o f   t h ap p r o p r ia te  s er v ice   v er s io n   is   r ep r esen ted   b y   T im A .   I n   all  f o u r   ca s es,  it  is   ea s y   to   n o tice  t h at  T im B   T im A ;   iP O J n ee d s   c er tain   ti m b et w ee n   t h s elec tio n   o f   t h n e w   s er v ice  a n d   th s tar o f   t h i s   s er v ice.   T h is   ti m is   al w a y s   g r ea ter   th an   0 .   I is   th er e f o r p o s s ib le  to   co n clu d th at  th n u m b er   o f   s er v ice s   an d   t h eir   s ize s   d o   n o af f ec T i m A .   T h er ef o r e,   it  ca n   b co n cl u d e d   th at   T im e - ad ap i s   lar g er   t h an   t h o t h er   p er io d s .   Fi g u r 1 0   s h o w s   t h at  T i m e - ad ap f o llo w s   th s a m p ath   as  T im B it  s h o u ld   b n o t ed   th at  th e s t w o   p er io d s   o f   ti m ar id en t ical.   T h is   o b s er v atio n   ca n   b ex p lai n ed   co n s id er in g   t h ex p r ess io n s   o f   t h t w o   p er io d s   b elo w :           T im e_ ad ap [ Si  ( T ) ]   T im A   [ Si  ( T ) ]   T im B   [ Si  ( T ) ] ;   T im e_ ad ap [ Si  ( T ) ]   -   T im B   [ Si  ( T ) ]   =   T im A   [ Si ( T ) ]     0.           Fig u r 1 0 .   T h av er a g o f   T i m A ,   B ,   an d   T im e - ad ap t   Evaluation Warning : The document was created with Spire.PDF for Python.