SMART FOG COMPUTING FOR EFFICIENT SITUATIONS MANAGEMENT IN SMART HEALTH ENVIRONMENTS

Ontologies are considered a backbone for supporting advanced situation management in various smart domains, particularly smart health. It plays a vital role in understanding user context in order to determine patients’ safety, situation identification accuracy, and provide personalized comfort. The smart health domain contains a huge number of different types of context profiles related to interactive devices, linked health objects, and smart-home. The key role of context profiles is to deduce urgent situations that are needed to run adaptation components on a specific smarthealth Fog. Existing platforms and middlewares lack support to efficiently analyze a large number of heterogeneous specific profiles and continuous context changing in near real time. In this paper, we focus on data and dissemination of information from services related to the field of e-health. This paper aims to provide a new generic user situation-aware profile ontology (GUSP-Onto) for a semantic description of heterogeneous users’ profiles with efficient patients’ situation management and health Journal of ICT, 17, No. 4 (October) 2018, pp: 537–567 538 multimedia information dissemination related to smart health services. Based on the users’ situation management ontology, a two-layered architecture was proposed. The first layer is used to achieve a quality diagnosis of urgent situations including a smart fog computing enhanced with semantic profile modeling that offers efficient situation management. The second layer allows a more in-depth situation analysis for patients and enhanced rich services using cloud computing that provides good scalability. The most innovative of this architecture is the potential benefits from the semantic representation to conduct emergency situation knowledge reasoning and ultimately realize early service selection and adaptation process. The experimental results show a decreased time response and an enhanced accuracy of the proposed approach.

multimedia information dissemination related to smart health services.Based on the users' situation management ontology, a two-layered architecture was proposed.The first layer is used to achieve a quality diagnosis of urgent situations including a smart fog computing enhanced with semantic profile modeling that offers efficient situation management.The second layer allows a more in-depth situation analysis for patients and enhanced rich services using cloud computing that provides good scalability.

INTRODUCTION
In the ubiquitous computing environment, technologies have great potentials in making our daily life healthier, easier and more comfortable, and making environment more citizen-friendly.Smart environment is considered as one of the most important research areas on ubiquitous computing, since peoples spend on advanced sensing and communication technologies of Internet of Thing (IoT) to poke smart environments in new heights.Despite new smart devices comes new managing techniques for such environments, smart environments encompass a set of modern applications.Smart objects of different types put together to communicate and to cooperate in order to enable more immersive experiences for users.The IoT will be a giant network of connected things and people.Recent estimates foresee that by 2020, 100 billion devices will be connected to the Internet.Smart connected objects are deployed in smart-homes and healthy environments for real-time context data acquisition, which may be used for accurate decision and innovative services.Hence, they provide a complete environment automation system but may lead to a negative impact on interactive applications in the growth of smart objects.Such strong and multiple connections between heterogeneous physical things will raise a potential problem of processing more complex set of contextual data in a set of emergency situations.Therefore, we need to rethink about efficient context data management for accurate and timely decision making and fast information dissemination strategies across distributed smart environments.In this domain, building context-aware systems require using multiple heterogeneous specific patients' profiles related to interactive devices, health due to its heterogeneous contexts such as context monitoring environment and its social activities.As a consequence, an efficient context-aware system is crucially needed come up with appropriate services for patients and select adaptations according to near real-time evolving situations.
Managing situations efficiently plays an important role in e-health domain, including context information monitoring and collecting, situation analysis and broadcasting of multimedia information to interested users.Typically, context information is pre-processed in a smart-health Fog to identify urgent situations faster and more reliably.The cost models are applied to select a quality adaptation plan for providing interested users all distributed adaptation services that help them to access/broadcast multimedia documents.It is assumed that smart health resources to be employed are predefined.A very promising solution is to find an efficient and automatically extensible framework according to a large number of different patients' profiles and remote computation capabilities (Remagnino & Foresti, 2005).Thereby, cloud computing adoption will play an essential role particularly in ensuring a significant visibility gap over the delivery of quality applications and multimedia services.Fog computing extends the cloud that provides elastic resources which are close to the mobile device and IoT of smart environment for quality management of urgent situations (e.g.diabetic coma, accident, fire) with low latency and real-time delivery of suitable multimedia emergency services.Therefore, the situation identification methods have new challenges.Can the proposed framework provide real-time situation identification for an individual patient (or community of users) to efficiently provide and dynamically deploy suitable services during his or her mobility with different usages?To realize this, a number of several platforms and middleware awareness were studied such as Aguilar, Jerez, Exposito, and Villemur, (2005) ; Anagnostopoulos & Hadjiefthymiades, (2008); Da, Dalmau, & Roose, (2014); Gherari, Amirat, & Ousslah, (2014) ; Naqvi, Preuveneers, & Berbers, (2005); Forkan, Khalil, & Tari , (2014) ; Gyrard, Bonnet, Boudaoud, & Serrano, (2016); Gomes et al., (2017); Kuzahier, Zahari, & Zaaba, (2017);and Bansal, Chana, & Clarke, (2018).However, these platforms are still inadequate for identifying situations for a huge number of heterogeneous individual profiles.Furthermore, the current mechanisms suffer from certain shortcomings.They do not select efficiently and flexibly relevant cloud services among a large set of candidates.It is important to develop a new approach that is able to manage situations for accurate and timely decision according to the users ' context (i.e. users' constraints and environment-related). Ontologies may play a vital role in the thorough understanding of user context.They offer a better selection of relevant service with best quality from varied service candidates according to the customers' functional needs and contextual constraints.As a result, the dynamic extensibility of the system by the determination of hierarchical structures with higher situation management levels to the current context of users and their needs for providing continuous services can be performed automatically.
The aim of this paper is to provide relevant services in order to answer users' needs and changes of context using semantic-based context-aware selection.We focus on the development of a new approach based on the adoption of web technologies and Fog computing, which allows quality and intelligent situation management and dissemination of multimedia information related to health services.This work seeks to contribute to two main aspects.First, we defined a Generic User Situation-aware Profile ontology (GUSP-Onto) to manage a large number of heterogeneous users' profiles, which are grouped semantically into a generic context-aware profile in order to improve the situation identification accuracy and the efficiency of patients' adaptation tasks.Second, we developed a two-layered context-aware semantic-based architecture that allows us to pre-process context data in the fog-based server for identifying urgent situations faster and more reliably.Cloud server has sufficient cloud resources and several reasoning techniques for collecting and pre-processing large context data, placing patients' situations in ubiquitous scenarios as smart hospital environments where heterogeneous patients' profiles work together.

RELATED WORKS
Challenges in context-aware are monitoring, aggregating and analyzing of the context information in a semantic manner and selection of situation context-aware services for accessing/broadcasting multimedia documents using middleware-based platforms.Our work consists of efficiently managing patients' situations through context-aware users' profile modeling, situationaware identification strategy and providing all distributed adaptation services that facilitate users to share multimedia contents using fog-based Kalimucho middleware (Da et al., 2014) in dynamically changing environments.Several cloud-based platforms and middleware were proposed for managing pervasive healthcare data for the identification of situations for large context users' profiles using various context-aware users' profiles modeling.

Identification of situations for large context user's profiles
Situation identification is classified into two categories: knowledge-based and non-knowledge-based techniques.Knowledge-based situation identification relies on a conceptualization of the context model encoded in resource definition framework (RDF) interpretable machine format.Non-knowledgebased situation identification uses Event-Condition-Action rules and other learning techniques that allow automatic learning from the history of events and detecting daily life situations from the data context.These techniques lack simultaneous real-time semantic-based situation identification of multiple users.We are interested in smart fog-based and ontology-based real-time ondemand urgent situation identification due to mobility of the user and usage contexts.The semantic context model is extracted and computed based on ontology similarity measures.Gyrard et al. (2016) proposed an ontologybased approach to describe formally user's context metadata for improving the assistance of users in their daily life activities and prediction of some urgent situations.The proposed tool aims at collecting context data, inferring and reasoning over these data for the situation identification and decision making.The tool is based on inference rules provided by domain experts to generate appropriate services.More recently, Chabridon, Bouzeghoub, Ahmed-Nacer, Marie, and Desprats (2017) proposed an efficient mechanism to identify and compute the quality of situation using an ontology-based approach, and quality criteria aggregated using the fuzzy Choquet operator.However, these works still suffer from the service selection which provide suitable services to the users.

Cloud-based context-aware frameworks and cloud-based context-aware Middlewares
With the recent improvement of Cloud Computing (Tran & Feuerlicht, 2016), frameworks and middleware have become popular and effective for providing suitable services to users at the right time, at the right place and with the right manner.However, Cloud Computing is able to cope with users' situations in different locations and lighting conditions, depending on the internet network.If an internet connection problem is met, the Cloud will potentially affect the performance in real-urgent situations negatively and hinder service continuity.Naqvi et al. (2014) proposed loosely-coupled context-provision cloud services, context-aware, and quality-aware to adapt services to the context of the user and his or her mobile device.The disadvantage is that it is necessary to mitigate semantic heterogeneity into a generic model that enables more advanced and automated deriving adaptation from a large number of heterogeneous users' profiles.This work does not yield enough performance for real-time situations, on less powerful machines, and with rising heterogeneous user's profiles.Pan et al. (2013) proposed a cloud-based framework that commonly used in pervasive computing environments for deploying and adapting of mobile services.It enables more efficient adaptation approach for each mobile user in the cloud by exploiting the adaptive power management of mobile agentbased service.However, these frameworks do not consider the contextual information that can be gathered by smart sensors.Forkan et al. (2014) proposed a cloud-oriented context-aware middleware, which is based on service-oriented architecture and semantic web for managing massive context spaces for heterogeneous assisted living systems.In this work, large context data of context-aware systems are processed in the cloud and not in local server machines.If any problem occurs such as mobility of the user, availability of context information, instability of the communication network, and the context data cannot be transmitted to the cloud and that leads to the interruption of the system.Our approach has to react rapidly on new situations among those previously observed and grouped in a cluster by analyzing current locations, profiles and physical environments of users.Nevertheless, this work does not mitigate semantic heterogeneity into a generic model that enables more advanced automated deriving adaptation from a large number of heterogeneous users' profiles and the mobility of the users and the instability of the communication network cannot be performed automatically.Aguilar et al. (2005) proposed a context awareness middleware in cloud computing called CARMiCLOC, which is a web-service-based middleware that can behave as a software as a service (SaaS).Due to the amount of data involved to define the context, this work offers an excellent context management using a cloud computing but it is not able to analyze a large number of simultaneous users to identify services with generic similar profiles.
Every work that presented above treats focuses on a specific situation for a particular user profile and explores individually each service description and computes matching distance in order to select the relevant services.In many cases, this issue could exhaust the system.Many profiles cloud be specified, accordingly, many comparisons must be computed and updated.The device profiles evolve rapidly according to different contexts such as user profile, the environment and the patient monitoring.As we have shown in this section, the issue of efficient selection of services among a large set of candidates has been rarely addressed in middleware platforms and cloud-based context-aware frameworks.The clustering approach presented in related works is limited by the predefined specific profiles.As a result, the dynamic extensibility of the system cannot be performed automatically.
In this paper, we propose a new semantic context-aware adaptation approach for pervasive healthcare systems focusing on situation-aware mobile e-health applications.This approach needs to group some specific situations and services that users can share both computation resources and bandwidth resources and accelerates the selection of relevant specific services.Our proposed approach is able to better guide the adaptation process for a hug number of heterogeneous specific profiles like user devices, smart objects, smart-home and to better discover and compose relevant adaptation services among a large set of candidates.We defined a generic user situation-aware profile ontology (GUSP-Onto) based on a two-layered infrastructure which includes a smart fog computing and a central Cloud to manage various users' profiles in order to provide simultaneously to several users personalized multimedia services.The presented approach is based on a middleware called Kalimucho (Da, Dalmau & Roose, 2014).Kalimucho is a platform for pervasive components-based applications.It allows dynamic deployment and reconfiguration of applications on personal computers laptops and mobile devices.Hence, in this system, we implemented a new optimized adaptation approach that groups similar specific profiles together in order to build global generalized profiles and compute adaptation strategies, based on both these global profiles and their specific ones.The goal of this work is to reduce response time and to accelerate the search process of relevant adaptation services according to similar users' situations at run-time.We only tag users who have dynamically changed their context within their community in order to locally recalculate their situations considering their mobility.The goal of this work is achieved by grouping specific contexts and services into a generic profile and by manipulating semantically equivalent preferences and services (category, location, time, quality of service).

A GENERIC USER SITUATION-AWARE PROFILE ONTOLOGY MODEL
The main purpose of our ontology is to thoroughly understand users in order to improve their situation identification.Furthermore, this ontology accelerates the situation identification using relevant context information.GUSP-Onto is a generic ontology for smart environments.This ontology includes machine-interpretable definitions of basic concepts in the smart environment and relations between them.Building generic ontology using a formal context based on ontology can play a vital role in facilitating reasoning by formally representing smart health domain knowledge and facilitating the selection of the appropriate service among a large number of services according to the inferred situations.GUSP-Onto can be used for several ends.Members of the community of the health domain can communicate and share knowledge between them using GUSP-Onto.To develop our ontology, we used a combination of the top-down approach.First, we defined the important concepts in the smart environment domain from existing ontologies: context entity, situation, and service.Second, we generalized and specialized them appropriately.For each concept, we created a taxonomy of concepts to build the hierarchy of GUSP-Onto.For instance, the situation can be urgent and normal.Urgent situations refer to abnormal situations: alarm situation, intrusion, and fire.otherwise, normal situations, refer to user's daily-life activities and user's device.Third, we added for each concept its properties.Finally, we created a logical relationship between those concepts to enable reasoning using our ontology.At the end of the ontologization process, we obtained our GUSP-Onto that contains several specific concepts such as User Context, Smart-Object Context, Environment Context, Urgent Situation and Healthcare Service class.

Context Entity Concept
This concept has many properties to characterize it like Entity-ID, Entity-Name, Entity-

Situation Concept
Each user, device, and thing in smart environment can contain several situations.These situations are divided into two categories: urgent and normal.Each situation can be a part of other situations.It has its start and end time.Situation is performed in a place and consists of two or more contextual conditions.Urgent Situation class represents situations that are related to a specific context entity such as a person's health state like blood sugar situations and blood pressure situations.Normal Situation class represents situations that are related to the social activities of the users and their devices such as home temperature situations and battery situations.

Service Concept
As stated in our approach, each situation corresponds to a set of appropriate services.Each service is described by its functionality provided by contextaware smart environments.A service is provided by an appliance, it has a category.Each service has a service profile which includes QoS properties.
It includes many concepts such as inputs, outputs, and parameters.These concepts are used to specify the appliance which can provide services to user-based decision results.Figure 1 shows the classification of services.
Smart service allows the users to handle the data storage that they need to run their applications that can be deployed on local server or on the cloud.Interactive services are unimodal and multimodal interactions.Adaptation services are able to execute health multimedia contents on different types of devices.In our ontology, concepts are divided into generic concepts and specific concepts.Generic concepts can be used in any smart context-aware system, while specific concepts are used for a specific smart domain, such as smarthealth.We can define several types of user.Each user must use some special services.For example, the services used by a patient are different from those used by the doctor.We can extend specific context health information.We can define three main specific elements: 1) Vital signs, which include medical information that will be useful in determining the health situation of the user, 2) Prescribed medication, which describes a list of medications that is taken by the patient.It can trigger appropriate services that must be provided to the user.3) Activity, which represents different activities that are made by the user as well as his or her time stamp.Services include Emergency Health Services and Diabetes Services.

THE PROPOSED SMART FOG COMPUTING
The proposed smart fog computing approach is a semantic, situation-aware and flexible system regarding the situation management of a large number of heterogeneous specific profiles.It provides an automatic situation identification that uses semantic web technologies, Fog computing, and similarity measure methods.It offers two features.The first one ensures simultaneous context processing and efficient urgent situation management with the semantic description of heterogeneous context data based on the ontology and smarthealth fog.For example, a blood glucose sensor provides blood glucose level data regardless of the unit of measure.The second feature allows a more in-depth situation analysis and enhanced services for emergencies and healthcare services for the patients.The approach highlights, on the one hand, the clustering of equivalent patients' profiles into a generic user situationaware cloud profile model, and on the other hand, facilitates the deployment of suitable services according to users (doctor, nurses, specialists) to perform depth-analysis and emergency services.

Fog Computing and Ontology-Based Framework Architecture
Figure 2 shows the framework components in a local data center and the Cloud.
The key features of the framework are: 1) components that are deployed at run-time between a fog and cloud paradigms, 2) smart mechanisms that retrieve and aggregate contextual information gathered from different and heterogeneous constrained smart objects and smart device, 3) grouping of specific high-level constraints and services into a top-level generic health ontology structure.More precisely, if two profiles are quite similar due to the proposed adapted distance, 4) -early detection of urgent situations and provision of distributed multimedia services that help users to broadcast documents.A smart environment is composed of different wearable smart objects and supports different connectivity protocols like Bluetooth, Wi-Fi, ZigBee, etc. to connect a local data center and a cloud.The architecture consists of two layers:

The Smart Fog-based Semantic Service Adaptation Controller Layer
The smart fog is a core layer to make an early determination in a dynamic way at run-time reconfiguration about deployment support for urgent situations.It provides profile clustering, context processing, urgent situation identification, and multimedia information dissemination related to smart services.

Fog-based Context Manager
This

Fog-based context Clustering
This component acts as the clustering module to group some specific profiles, services, and documents.This grouping accelerates the search process of relevant adaptation services.Unifying some profile descriptions will provide better visibility and situational awareness to analysts for grouping of profiles.

Fog-based Service Manager
This component is responsible for ensuring service continuity, providing all distributed multimedia services that help users to access/broadcast multimedia documents, emergencies, and health care services, and perform quality document adaptation to their family members.The fog-based Service Manager is composed of four components: (1) Service Discovery, which is responsible for discovery of available services from identified situations, (2) QoS Service Selection Engine, which is responsible for deploying and ensuring service continuity on mobile devices, (3) Adaptation Service, which is responsible for deploying and ensuring service continuity on mobile devices and (4) Service Deployer, which is responsible for deploying and ensuring service continuity on mobile devices.

The Cloud-based Semantic Service Adaptation Controller Layer
This component operates on a cloud infrastructure which is expected to scale both horizontally to support the large number of smart objects connected, as well as vertically to address the variety of user's situations on smart-domains.Cloud-based Service Manager: This component is responsible for creating new services from cloud computing infrastructure for the identified situations and has the ability to provide new service updates and manage users' situations.
A Generic User Situation-aware Profile ontology: The semantic description of context data is an important feature to enable context reasoning and context data interoperability across heterogeneous smart domains.
Context profiles repositories: Profiles need to be synchronized automatically from a local data center (fog) to the cloud.Profiles are services, users, and documents.

Kalimucho platform
The Kalimucho is a middleware platform which is useful for managing distributed mobile applications with dynamic components (re-)deployment and migration.It offers an excellent smart service management and predefined policies deployment strategy dedicated to the management of distributed context on the shared domain.We extend Kalimucho platform to efficiently manage the explosion of users' profiles, identify situations and provide realtime appropriate services to multiple users simultaneously.
The following sections present further details about the functionalities of the architecture.

Fog Computing and Ontology-Based Functional Model
The main purpose of our framework is to manage a large number of heterogeneous users' profiles in order to provide simultaneously personalized multimedia services to several users.The novelty of our strategy is to introduce the concept of patient context awareness and reactiveness in order to accelerate the search process of relevant situations according to similar users' profiles at run-time.Our suggested smart fog computing is accompanied by three new stages.The first stage groups some specific context profiles into a generic context profile.The second stage consists of identifying and managing any urgent situation.To deal with the scalability in solving the semantic situationaware cloud service discovery and selection process, the dynamic service selection process is improved in the third stage by grouping semantically equivalent users' device constraints for selecting a set of relevant adaptation services according to current situations.

Stage 1: Generic Users' Profiles Modelling and Clustering
As illustrated in Figure 3, the first step is the collection and pre-possessing of raw, heterogeneous context data from several pervasive sensing devices using the fog-based Context Manager.Some are retrieved automatically from wearable sensors and mobile devices.Others are user specific.The personal raw data are saved as XML format in a user profile repository.Receiving lowlevel context, represented in Figure 3 by the fog-based Context Transformer component, will transform it to a high-level semantic context.The user profile ontology model will be updated with new transformed semantic data from the previous step.After receiving and transforming context data, the Shared Context Manager is ready to call the Profile Clustering Manager to group some equivalent users' profiles that shared a similar context (step 3 in Figure 3).The goal is to minimize space constraints of the situation identification strategy and accelerate the discovery process of relevant health services.The fogbased Shared Context Manager clusters users' profiles according to ontologybased techniques (Anagnostopoulos & Hadjiefthymiades, 2008;Naqvi et al., 2014;Sulaiman, Nordin, & Jamil, 2017).The idea of the profile clustering is to consider equivalent context properties and their similar context data.The situation identification is an important part of the presented approach that detects situations from current relevant context parameters.There are two main techniques to identify situations in the smart environment and select the appropriate service according to the situations: reasoning-based techniques and similarity-based techniques (Anagnostopoulos & Hadjiefthymiades 2008;Naqvi et al., 2014).The similarity-based technique represents the method that applies situation identification decision directly after processing the current user context information.Our similarity measure extends the properties of Sim defined in Alti, Lakehal, Laborie, and Roose (2016).It is formalized as follows: (5) Where "b" is an uncommon context attribute of a given situation S, and "a" is a number of common context attributes between a generic profile Gp and a situation S. The function Sim determines the matching score between Gp and a given situation S based on its associated weights and the atomic similarity value of each common context attribute (Gp i , S i ).We identify situations of a group of users with a higher matching score.
Figure 6 shows the dynamic situation identification algorithm in its concept.It takes as inputs a user generic profile model and a set of situations (line 1) and as output the higher matching score (line 2).Initially, for each pair of common concepts of context constraints and profile, a set of atomic similarity values are initialized and computed (line 4-7).Then, a global similarity value Sim is calculated between a generic context profile and each urgent situation (Eq.1; line 8).Finally, the result set is sorted and a best matching measure with situation matching relation are returned (line 10).

Stage 3: Health Multimedia Information Dissemination
Once the fog-based Context Reasoning identifies the urgent situations of users, we focus on sending the health multimedia information simultaneously to interested users that should be able to execute on different types of devices.The process of deploying distributed services and dissemination of health multimedia information to interested users (step 5 to step 9) is described in Figure 6.The fog-based Shared Context component groups semantically equivalent users' device constraints (step 5 in Figure 7).The fog-based Service Discovery is triggered by the urgent situations that are reported by the fog-based Context Reasoning (step 6 in Figure 7).It then determines suitable services on the identified urgent situations from the services repository.In order to achieve better service discovery, we semantically group similar services.The mechanism of service clustering consists of grouping semantically a large number of heterogeneous cloud services according to their service category, the same type of situations that can trigger these services, and functional and contextual descriptions.This method ensures a fast service selection in order to satisfy most of the target device constraints of interested users, serving as an important quality of service (QoS).We use a generic service profile to select the best service if many specific profiles are possible (step 7 in Figure  ).Then, the QoS Selection Engine selects the best multimedia adaptation services based on various politics (response time, quality of media, availability, throughout and energy saving).The Service Adaptation component makes partial or full adaptations according to current constraints: players, codecs, resources, user profile, and hardware (step 8 in Figure 7).As mobility of users and low battery constraints which can break the execution of mobile services in health pervasive systems, we are looking for an intelligent manner to ensure the service continuity on mobile devices by deploying the different heterogonous services.Therefore, the Service Deployer will deploy services that are selected by the Service Adaptation on the users' mobile device.It generates configuration files automatically by JAVA code generator after scanning the environment and sends it to the Kalimucho platform (step 9 in Figure 7).It is responsible for executing services, assuring the continuity of these services and saving the new service configuration in case of low device resource situations on mobile devices.In parallel situations, patients are also automatically analyzed on the Cloud, allowing enhanced services for the emergencies and health care services.

Prototype Implementation
Our ontology model is implemented in Protégé tool (Horridge, Tsarkov, & Redmond, 2006).This visual modeling tool supports creating and managing ontology models for smart domains and their applications.Protégé is supported by a strong community of academic, government and corporate users to design formal, common and shared semantics with OWL (Web Ontology Language) language.Protégé plug-in architecture can be adapted to build both simple and complex ontology-based applications.Developers can integrate the output of Protégé with rule systems to construct a wide range of intelligent systems.We used the Protégé tool to explicitly define different classes of GUSP-Onto, their properties, and instances.
The prototype is developed with a two-layered architecture: fog-based and cloud-based.The smart objects and mobile devices use an Android 1.5 GPS Wi-Fi Galaxy Smartphone 512 MB RAM and 4GB ROM.A desktop computer simulates the Fog.The machine is Dell Desktop PC, which has an Intel Core i5 4460 (3.20 GHz) CPU and 4GB memory.We deployed smart fog-based SSAC on the PC, which includes context processing components implemented in NetBeans 6.1.The smart fog-based SSAC has four functions: receive context data from smart objects, situation reasoning, sending multimedia to interested mobile users, and sending context data to a cloud.The cloud server uses Amazon Extra Large Cloud.It has 160 GB memory with 124.5 EC2 Compute Units.It implements Socket and our semantic reasoning engine framework.The Cloud server represents and reason upon a large number of contextual information.It also has web services from providing ontology to a group of users.Within the scope of our work, the possible users' cases are varied and vast.Consider the following diabetes case study.

A Diabetes Case Study and Real-Life Scenarios
Our approach offers great potentials in smart hospitals in order to facilitate the sharing of context health information from different patients' profiles.
To begin with, the smart-health fog-based intelligence platform ensures simultaneous context processing and efficient management of urgent situations with a semantic representation of different context data (e.g., blood glucose sensor provides blood glucose level data with various data types and formats).Secondly, it analyses monitored and collected context data of equivalent patients and identifies their urgent situations.Finally, it dynamically deploys suitable services to the nearest users (doctor, nurses, specialists) for immediate preparation for hosting the patient.In parallel context, information related to patients are also analyzed automatically on the Cloud, allowing for more in-depth situation analysis and enhanced services for the emergencies and healthcare services.As shown in Figure 8, the smart hospital is composed of many floors.Each floor consists of a number of patient rooms.Each room is equipped with IP camera.The patient is equipped with wearable biosensors (glucose meter, weight scale, smart bracelet and GPS) with various network protocols (Wi-Fi, GSM, etc.).These sensors are used to promote healthy behaviors of the patients.The context information (glucose level, weight, short patient video, GPS coordinates) are collected by the set-top-box.A given context data may be sensed by different devices (i.e. a patient is localized using IP Camera or GPS devices with various data types and formats).Any smart object around the user can be a possible host or an important source of information.This contextual information is useful to identify a set of users' activities.The monitored context information is collected in a smart gateway.This gateway collects context data monitored by sensors.In the first scenario, as presented in our architecture, the main role of the fog-based SSAC component is to supervise several patients in order to identify urgent situations.The fog-based Context Collector collects and preprocesses raw context data from the smart devices and stores them in the profile repository.Then, it transforms the raw context data into semantic using the fog-based Context Transformer component which is then saved in our ontology.The fog-based Profile Clustering component groups equivalent patients' profiles into a generic context-aware profile model related to their similar context information and their location (as shown in Table 1).Situations related to patients are also analyzed automatically on the Cloud.The hypoglycemic diabetic coma as an abnormal situation was identified by the fog-based Context Reasoning using our similarity measure (Eq. 1) and a generic context-aware profile that triggers the fog-based Service Controller.The latter is responsible for sending/broadcasting notifications and multimedia documents to multiple available nearest users (doctor, nurse, health emergency) The fog-based Service Discovery component is responsible for discovering available adaptation multimedia services according to the availability of users and their current mobile device constraints.
First, equivalent multimedia constraints specified by the doctor and nurse are grouped semantically (as shown in Table 2).Then, the QoS Selection Engine selects best multimedia adaptation services based on various politics (bandwidth, type of media, language, response time and interaction modalities).Based on our previous work (Alti, Lakehal, Laborie & Roose, 2016), Table 3 shows the top evaluation results in which the service components "Emergency Diabetic and High-Quality Video Encoder/Decoder c components" are selected.This selection is based on the high score value where the objective is to minimize adaptation cost and response time and to maximize media quality.Finally, the service selection activates the fogbased Service deployer by triggering a reconfiguration action.The fog-based Service deployer is responsible for deploying and ensuring service continuity on mobile devices.Therefore, it uses Kalimucho framework (Da, Dalmau & Roose, 2014) in order to deploy new service components.The second scenario is when a doctor participates in a meeting, he or she can use now his or her tablet for a larger view and cannot receive the audio during a meeting.Once the absence of right media codec to execute video service is detected, the adaptation manager can provide an adapted video in order to meet all the new constraints, meeting and execution contexts.The fog-based Service Controller searches for relevant services from the cloud, and after its selection and deployment, the doctor can follow the Emergency service while starting a meeting.After receiving the doctor's request, the fog-based Service controller sends a message to inform the nurses about what the necessary first help to be carried out a (inject Insulin dose) or about the time of the doctor's arrival.

Experimentations and Discussion
All our simulation experiments are realized through a 3. Two experiments were designed to study the performance and related issues of the smart fog-based systems.The first experiment showed the size of the ontology to the performance of the system.The second experiment analyzed the computation time based on a different technology: Cloud vs. Fog.

Evaluating the Efficiency of Smart Fog Computing
The first performance was used to evaluate the proposed approach in terms of constraint checking time and situation identification.Using smart fog computing, we compared our situation identification algorithm based on a generic ontology (Aazam & Huh, 2015).We implemented the "Poisson eventbased" simulation model to generate a large number of patients' profiles and their context data.The constraints of patients' profiles increase from 10 to 100.We studied the algorithm's performances and compared them to similar work results (Aazam & Huh, 2015) in order to illustrate the efficiency of our approach.This work is based on fog computing without clustering similar users' profiles.The system is modeled by a Poisson-process.Each glucose level human body temperature) is initialized with a random value in the range of [50,100] (respectively in the range of [37,39]) and incremented automatically by a random value in the range of [zero, 5] (in the range of [0.1, 1]).We collected results consisting of patients' profiles from a local data center, the number of situations identified and their precisions.Our fog-based SSAC component groups similar patients' constraints in order to optimize the situation identification time.Figure 9 reveals that in the majority of the cases, the response time of identification situation of patients was higher than that found in Aazam and Huh, (2015).We noticed also that our algorithm, compared to Aazam and Huh, (2015), minimized the number of tested profiles into 34.23%.This explained that our work groups some individual patients' profiles, which share similar context properties, and accelerates the search process of relevant services at run-time better than the work of Aazam and Huh (2015).

Evaluating the Effectiveness of Cloud Situation Reasoning using Smart Fog Situation Reasoning
The second performance was used to compare cloud situation reasoning and smart fog situation reasoning.In our experimentation, we measured the data transfer from mobile devices and then evaluate the reasoning time from the cloud.We also measured the reasoning time between the smart-health fog and the cloud, as shown in Figure 10.The results show that the smart-health fog generated results earlier than the cloud.This means the proposed method uses intelligent situation reasoning to identify early urgent situations.However, the smart-health fog was more effective on new situations update at run-time, making the context monitor send relevant context information more frequently.

Discussion
The main objective of the presented approach is to achieve an efficient situation identification using smart fog computing.We performed the experiments for smart fog and other similar related work under different number of users' constraints.As shown in Figure 9, smart fog attempts to minimize the number of checked users' constraints, it achieves better performance in terms of the situation identification time (Figure 9).This result confirms that by using smart fog, the situation identification time is less than 39% compared to similar related work (Aazam & Huh, 2015) in 20 to 40 constraints.Since the proposed approach dynamically groups the equivalent situations rules, it checks urgent situations by considering the intelligent java reasoning rules.However, in the last test with high number of constraints (80 constraints), the situation identification and management times respectively in smart fog is less than 3s.This is due to a high rundendent constraints elimination.This method can be applied with near real-time e-Health smart domain where the time required is computed with fractions of a second.We apply fog-based distributed situation reasoning to manage all aspects of situation identification in all connected smart environments.These new solutions include intelligent situations management (sensors and smart devices) coupled with distributed intelligent decision support tools and communication tools.The presented approach offers the users the possibility to identify early urgent situations dedicated to assist users in their everyday needs and to manage all services at once.To prove the efficiency of smart fog, we measured the data transfer from mobile devices and evaluated the reasoning time from the cloud.Figure 10 shows the obtained results for cloud situation reasoning with/without smart fog.From this figure, it can be concluded that for higher data transfer ratio under low bandwidth constraint, cloud reasoning with smart fog archives better results in comparison with only cloud situation reasoning.However, the identification time is important (1800ms) with high constraints number (2100 constraints).This means, that data transfer is a key factor in the evaluation of response time.The proposed technique gives better efficiency than Cloud situation reasoning, but remains relatively rare and must be improved in future works.Notice also that the proposed approach facilitates the extensibility.We can add a new patient profile by registering a new description of this profile in the ontology.Similarly, when we remove a profile on the local server, we delete only the description of this profile in the ontology.The proposed approach can be reused on other domains (smart-vehicle, smart-city, etc.) for quality management of emergency situations.

CONCLUSION
This paper presented a new two-layered semantic context-aware architecture for efficient situation management in smart environments.Our motivation is based on the fact that situation management strategies that are usually used to perform situation identification of a single user in a small smart environment are not applicable to a large number of heterogeneous specific profiles.As the situation identification depends on the highly dynamic users' profiles, according to different contexts (users' profiles, context environments, monitoring, current social activities of doctors and nursing), we proposed a two-level management situation architecture to reduce as much as possible the response time of urgent situations.Our proposed approach consists of a two-layered architecture (smart fog computing and cloud) with field sensors, smart devices and intelligent decision support tool that continuously monitor and diagnose problems in the smart environment.It ensures efficient situation management and good scalability.Our work is divided into three phases: profile clustering, situation management and multimedia information dissemination related to smart services.The aim of our work has been to identify early urgent situations of group of users, inferring constraints and determine appropriate adaptations such that the users can have full exploitation of multimedia contents.This work based on top-level ontology model called GUSP-Onto that allows a high-level conceptual matching using different profiles representations.Moreover, this ontology model can be used to infer appropriate services by means of formal representation of linguistic, semantic and context properties among profiles' concepts.The current research work is based on the use of the proposed ontology profile model together with concepts similarity metrics to improve the exploitation of semantic view of context profiles.It can be composed of complex relations such as specifying some high-level constraints.As the perspective, we plan to implement a new mechanism for optimal and intelligent management of emergency situations based on more complex relations among two or more profiles, where each profile is built in a different description language.

Figure 1 .
Figure 1.A Generic User Situation-aware Cloud Profile Ontology.
Figure2shows the framework components in a local data center and the Cloud.The key features of the framework are: 1) components that are deployed at run-time between a fog and cloud paradigms, 2) smart mechanisms that retrieve and aggregate contextual information gathered from different and heterogeneous constrained smart objects and smart device, 3) grouping of specific high-level constraints and services into a top-level generic health ontology structure.More precisely, if two profiles are quite similar due to the proposed adapted distance, 4) -early detection of urgent situations and provision of distributed multimedia services that help users to broadcast documents.A smart environment is composed of different wearable smart objects and supports different connectivity protocols like Bluetooth,Wi- Fi, ZigBee, etc. to  connect a local data center and a cloud.The architecture consists of two layers: (i) Smart fog-based Semantic Service Adaptation Controller Layer (fogbased SSAC).(ii) Cloud-based Semantic Service Adaptation Controller Layer (Cloudbased SSAC).
component is responsible for verifying the context of multiple users of a given smart environment.It is also responsible for determining urgent situations based on a semantically similar group of context users.It is composed of the following components: (1) Context Searching Service, which allows consumers to search low-level contextual information sources in the smart domain from semantic descriptions, (2) Context Listener, which is responsible for monitoring the user's context change and calling the context pre-processor, (3) Context Collector, which is responsible for managing and aggregating raw context data from different sensing devices, (4) Context Pre-processor, which is responsible for pre-processing raw context data from different sensing devices, (5) Context Transformer, which is responsible for transforming low-level context data to high-level semantic data and save it in the ontology model, (6) The Shared Context Manager, which is responsible for managing shared context data, equivalent device constraints and common document properties and (7) Context Reasoning, which is responsible for identifying urgent situations using the ontology and situation rules.

Figure 2 .
Figure 2. Fog Computing and Ontology-Based Architecture for Smart Health Environments.

Figure 4 .
Figure 4.The Pseudocode of constructing generic user profile algorithm.

Figure 6 .
Figure 6.The Pseudocode of dynamic situation identification algorithm.

Figure 8 .
Figure 8. Smart hospital with their possible scenarios.

Figure 9 .
Figure 9.The computation time of situation identification with/without clustering of constraints.

Figure 9 .
Figure 9.The execution time of situation identification with/without clustering of constraints.
Type, Entity-Location, and others.Context entities concepts have numbers of sub concepts: User Context that includes properties like name, age, weight, height, gender, and others.Smart-Object Context consists of several heterogeneous sensors and actuators, each one having a unique identifier, a local name, a location and other attributes describing its properties, Multimedia Document Context, Environment Context have environment parameters like temperature, humidity, etc., Activity Context that refers to a user in smart environment can do several activities and Host Context.
The three major components of fog-based Context Clustering are: (1) Context Searching Service, which allows consumers to search low-level contextual information sources in the smart domain from semantic descriptions, (2) Context Listener, which is responsible for monitoring the user's context change and calling the context pre-processor and (3) Context Collector, which is responsible for managing raw context data from different sensing devices.
The core components of this layer include three subcomponents: (i) Cloudbased Context Clustering, (ii) Cloud-based Context Manager and (iii) Cloudbased Service Manager.Cloud-based Context Clustering: This component is responsible for clustering scalable context profiles that support the volume and variety of context data.It is able to process very large numbers of heterogeneous services and users' profiles and allow easy integration of new profiles.Cloud-based Context Manager: This component has scalable context processing capabilities, and the ability to consolidate and analyze context data and determine users' situations.

Table 1
Mapping specific patients' profiles into a generic ontology

Table 2
Mapping specific devices profiles into a generic ontology.

Table 3
Evaluations Results.
4 GHz, 4Go RAM PC.The evaluation consists of 100 instances of patients, who are using Smart fog-based SSAC and Autonomic Cloud-based SSAC.It notifies different emergencies to the concerned specialists, family members, and emergency services.Two types of context data set were used: (a) simple context-data and (b) a video file.A video file represents the patient's short video captured for about 10 minutes using a Camera IP, which is uploaded to the smart Fog.Simple context-data is for the situation when location, time, health measures (e.g., glucose level, weight, etc.), and other relevant data are uploaded to the Fog.For different context-data types, different patients' profiles are created, we validate our approach by presenting the obtained results performed in the cloud and the Fog.