# A Context-Aware Edge Computing Framework for Smart Internet of Things
## 3 Framework Architecture
### Context Management
#### 3.1.2 Context Modeling  
The context modeling module is mainly responsible for three functions, as illustrated in Figure 4). A context model is a representation or a subset of the real context collected from sensors that can be used in executing a task. It consists of a set of attributes that describe the context, each of which has a type and a value; additionally, it could also have other properties to describe certain characteristics [9]. According to a predefined set of information to be collected (i.e., static context) or depending on the situation (i.e., dynamic), any newly collected data are represented in terms of attributes, characteristics and relationships to form a model. This process is sensitive to data inconsistencies, incompleteness and invalidity, therefore, it is necessary to clean the data before modeling. Several techniques can be used to eliminate anomalous values from the data such as hidden Markov models (HMMs), Bayesian networks and fuzzy logic. Missing values due to sensor imperfections can affect the modeling process, thus, using imputation or prediction methods to fill in the gaps is needed. Depending on the level of sensitivity, missing values can be approximated using more complex methods such as K-nearest neighbors (KNNs) and deep learning which are computationally expensive. Otherwise, simpler arithmetic methods are more suitable.  
Figure 3: Context Acquisition Module.  
Numerous context representation (i.e., modeling) techniques exist, each with its advantages and disadvantages. A categorical review of the popular modeling methods is presented by [PERSON] et al. [27]; here, we only briefly mention the most notable ones. The choice depends on the developer to select the most appropriate technique for the application. The simplest context representation method is key-value pairs, most suitable for small contexts. Markup methods using tags improve on the previous method in terms of retrieval efficiency. To better capture relationships, graphical modeling is used, which can utilize databases with all their advantages to hold large amounts of data. Rules are used as a logic-based modeling method which helps in the reasoning process. The most widespread modeling method is the one based on ontologies: its advantages include the flexibility, extensibility and generality it offers to the widely available reasoning engines. It also uses standardized languages such as Resource Description Framework (RDF) and Web Ontology Language (OWL).  
In a distributed sensing system, multiple edge servers could run instances of the CONTESS framework, each connected to a different set of sensors. A single context could potentially require data from the sensors connected to different edge servers. To gather and combine the context models from these servers, a sharing scheme must be implemented. Furthermore, a sensing system is not guaranteed to generate data evenly across the edge servers, therefore, the sharing scheme must also include a load balancing function to ease the computing load off overwhelmed servers.