1. Introduction
The availability of a mobile device equipped with various sensors allows users to utilize context-aware services [
1,
2]. The context-aware service senses the physical environment around the user by using various sensors to offer a well-fitted service. However, the context-aware service requires continuous sensing to monitor a user’s context, and thus, it consumes a high amount of power. Specifically, the limited power supply from the battery becomes an important issue for the mobile device in question [
3].
Hence, several studies have focused on the sustainable context-awareness of mobile devices. Generally, there are two kinds of solutions for sustainable context-awareness: application-independent solutions and application-dependent solutions. However, the application-independent solutions have limitations in solving power-related problems in mobile devices due to the over consumption of resources by the faulty design of applications [
4]. If the system indiscriminately blocks application commands to preserve power efficiency, this causes a direct drop in QoS (Quality of Service). Conversely, if the system accepts a request for an unnecessary operation due to a simple design error, this results in inefficient power consumption. Thus, application-dependent solutions are required and ongoing research focuses on low power to solve these problems. This research aids researchers or developers in localizing the energy bug [
5] (that is also termed the energy black hole [
6,
7] or energy leak [
8]), which causes inefficient power consumption at the application level (component level or instruction level in detail). This information can be used by developers to fix the energy bugs and improve power efficiency.
Despite the contributions of extant research, mobile device users continue to suffer from limited battery power. As previously mentioned, context-awareness consumes additional power, and thus power efficiency is an extremely important issue. Thus, a few studies focused on sustainable context-awareness and proposed additional low-power methods. Specifically, they used the similarity of contexts or context hierarchy information to prevent the occurrence of identical sensing operations or to perform sensing operations that are maximally efficient among the sensing operations that enable the same context [
9,
10]. That is, in the case of a context-aware application, an additional low-power option can be achieved by using a context-specific low-power scheme in addition to a traditional low-power scheme.
However, in spite of these efforts, the previous studies had limitations because they do not consider an unnecessary sensing operation in exclusive contexts wherein it is not possible for the contexts to exist logically at the same time. For example, in an indoor/outdoor context-aware service, indoor and outdoor contexts can be inferred when a Wi-Fi signature is acquired and the GPS (Global Positioning System) signal is received, respectively. It is not possible for indoor and outdoor contexts to coexist logically at the same time. However, the afore-mentioned contexts are often inferred by Wi-Fi and GPS sensors simultaneously (for example, at an edge of a building). In a manner similar to this case, it is semantically meaningless to infer two or more exclusive contexts simultaneously, and this leads to inefficient power consumption. Hence, it is necessary to handle the problem for sustainable context-awareness.
Figure 1 shows the context classified by an operational categorization used in a previous study [
11] to illustrate the practical reasons for the occurrence of exclusive contexts.
As shown in
Figure 1, the primary context corresponds to the raw value obtained from actual sensing operations such as GPS location fix and acceleration value. This is utilized to inform secondary contexts based on the business logic of a context-aware application. In conventional methods for low-power consumption, low-power can be achieved by caching the secondary context. Conversely, the inference of the exclusive contexts occurs in the primary context. With respect to the assumption that context 1 and context 2 in
Figure 1 are exclusive contexts, sensing data values, such as (S1 and S2), (S4 and S5), or (S2 and S4), which generate these secondary contexts will not be obtained at the same time. However, in a realistic scenario, the afore-mentioned sensing data values, such as (S3 and S4) or (S1 and S3), are occasionally sensed simultaneously. This is because the accuracy of a context-aware service does not perfectly match the primary context and the secondary context. As a result, the power consumed for inference is unnecessary because the inferred exclusive contexts are not logically meaningful. Therefore, it is necessary to reduce unnecessary power consumption in exclusive contexts for sustainable context-aware service, and this entails the following process.
First, it is necessary to identify the exclusive contexts and the unnecessary sensing operation. In this study, it is assumed that target services are scalable and that their developers could be different. Hence, a context-sensing model is proposed to express the context and sensing operation in each service. The context-sensing model is used to identify unnecessary sensing operations in exclusive contexts and to suggest the means for an efficient operation. The context-sensing model is based on the ease of use and extensibility, and therefore, it is lightweight when compared with the existing sensing models based on interoperability, robustness, and self-adaptability. In particular, all necessary information can be extracted from the automata for the sensing behavior model that is basically generated in the development process, and thus, this does not require the additional effort of a developer representing the context-sensing model. The system proposed in this study (that is, the Exclusive Contexts Resolver; ExCore) can automatically perform a translation from automata to the context-sensing model. The context-sensing model is utilized as a fact in the expert system in ExCore, and it identifies unnecessary sensing operations in the exclusive contexts.
Second, it is necessary to efficiently control the inefficient sensing operation in exclusive contexts for a sustainable context-aware service. To this end, the ExCore provides an environment to suggest and retrieve an efficient sensing operation method. The rules of identifying the inefficient sensing operation in the exclusive contexts as well as dealing with the same can be applied to the expert system in the ExCore. In addition, efficient sensing operation methods in exclusive contexts are shared by a large number of developers, and thus, there is room for improvements in terms of the power efficiency. As a result, the proposed system helps application developers or middleware developers in providing sustainable context-aware services with respect to exclusive contexts.
In this study, the ExCore presented is applied to a scenario in which exclusive contexts occur. The results indicate an improvement of 12%–62% in the power efficiency of the exclusive contexts. It is expected that the ExCore will aid in more efficient power consumption in future heterogeneous situations, as the number of context-aware applications is expected to increase in the future.
The remainder of this study is organized as follows.
Section 2 reviews the literature related to the models and methods for sustainable context-awareness.
Section 3 addresses the exclusive contexts and the reasons for the related existing problems.
Section 4 proposes the ExCore that identifies the inefficient sensing operation in exclusive contexts and provides an efficient sensing operation method.
Section 5 evaluates the ExCore by applying an efficient sensing operation for the application and the middleware in Android OS. Finally,
Section 6 presents the conclusions and directions for future research.
3. Exclusive Contexts
3.1. Problem Definition
This subsection discusses the problem definition to aid in understanding the meaning of exclusive contexts and the reason as to why exclusive contexts cause inefficient power consumption by describing a scenario. The scenario includes the following:
• Scenario.
Tom, a graduate student, usually takes the car to the lab. He studies in the lab and attends a seminar with a professor. He utilizes a context-aware service that provides three key functions. First, the service blocks calls while Tom drives and sends messages informing callers about Tom’s driving state. Additionally, the service changes the ringer to the vibrating mode when Tom studies and to the mute mode when Tom attends seminars. The service classified context into the following three types: The driving context (Situation A) if the GPS sensor receives satellite data. The studying context (Situation B) if the Wi-Fi signal of the office/laboratory can be received and sound around the device exceeds a pre-defined threshold. The seminar context (Situation C) if the Wi-Fi signal of the office/laboratory can be received and sound around the device is less than the pre-defined threshold.
The driving, studying, and seminar contexts correspond to the exclusive contexts that cannot logically coexist at the same time. However, if the GPS sensor receives satellite data and the Wi-Fi sensor can receive the Wi-Fi signal of the office/laboratory, then the driving and studying context or (Situation D) the driving and seminar context is inferred. That is, the simultaneous inference of two or more exclusive contexts is semantically meaningless, and thus the sensing activity inferring these contexts is unnecessary. Therefore, it is necessary to manage the sensing to infer these types of meaningless contexts for the development of sustainable context awareness.
3.2. Efficient Sensing in Exclusive Contexts
Figure 2 describes the problem definition based on the classification by the operational categorization as given in a previous study [
19].
As shown in the
Figure 2, each context-aware application provides a service based on the context of the user. Additionally, each context is inferred by analyzing the sensing data of the sensors in the device. Therefore, the developer of the context-aware service sets the provision of context appropriate to the service and then commands the sensing operation to infer the context. The sensing data collected through the sensing operation is used to confirm whether or not the data supports the context. The context inference algorithm used at this time is designed and implemented by the developer. Therefore, if the accuracy of the inference algorithm is 100%, then exclusive contexts that cannot logically exist at the same time will not be inferred simultaneously such as the driving and seminar, driving and studying, and studying and seminar contexts. However, if the accuracy of the inference algorithm is not 100%, then it is possible to infer exclusive contexts due to incorrect inference of the context. If such exclusive contexts occur simultaneously, then it is not possible to provide a well fitted-service based on the user’s context, and therefore the power consumed in this type of a situation becomes meaningless. This study involves accounting for the exclusive contexts that are not considered by existing context-aware services and reduces inefficient sensing operations in exclusive contexts for sustainable context-awareness. In other words, in this paper, we try to improve the efficiency of power consumption by correcting the inefficient power consumption caused at the application level (faulty design, etc.) through the context-related information.
Even if the context inference algorithm is not perfect, all the exclusive contexts do not actually occur. In the example shown in
Figure 2, the studying context and the seminar context do not occur simultaneously irrespective of the accuracy of the context inference algorithm. This is because sensing data that supports the exclusive contexts are disjointed at the primary context level. When no Wi-Fi signal is received, both contexts are not inferred. When a Wi-Fi signal is received, only one of the two contexts will be inferred according to the condition based on the pre-defined volume threshold. It is not possible for the data (events) collected by a sensor to have more than two values simultaneously, and therefore the contexts cannot be simultaneously inferred if the types of sensors used to infer exclusive contexts and their values are disjointed. On the other hand, in the case that the sensors or their values are not disjointed, exclusive contexts could be inferred. In the example shown in
Figure 2, the driving context uses a GPS, and the studying context and seminar context are inferred using a Wi-Fi and a volume sensor. Therefore, exclusive contexts, such as Driving context and Studying Context and Driving Context and Seminar context, can be inferred by a GPS, Wi-Fi, and a volume sensor. Therefore, in order to enable sustainable context-awareness in exclusive contexts, it is necessary to consider contexts in exclusive contexts as well as the types and conditions of the inferring sensors.
Currently, exclusive contexts are not often inferred, and thus there are limited opportunities for generating low power through these contexts. However, upcoming IoT environments will involve the mixing of heterogeneous devices, context-aware services, and sensors, and thus exclusive contexts will occur frequently. The present study utilizes an expert system to present solutions in this complex situation. An expert system is a system developed to provide a software system with the same intellectual abilities as an original expert. It can effectively grasp complex facts and the logical relationship between the facts. In this study, an expert system is used to identify the exclusive contexts, and an efficient sensing operation is proposed.
4. ExCore: Exclusive Contexts Resolver
4.1. ExCore Overview (System Overview)
Figure 3 describes an overview of the proposed system used in this study, which is termed as the ‘Exclusive Contexts Resolver’ and abbreviated as ExCore.
4.1.1. Automata Translator
It is necessary to analyze context-related information used in service and sensing-related information to infer the context, in order to eliminate unnecessary power dissipation in exclusive contexts. As previously mentioned, various modeling methods exist to define context and sensing-related information. Most of the methods require very detailed and versatile information for operations including interoperability, scalability, and self-adaptability, and this places a burden on developers. In this study, the system only takes automata (sensing behavior model, c) as an input to avoid this burden. However, it is not possible for the expert system to directly read automata, and therefore it is necessary to convert the automata to a form that can be used in an expert system. The Automata translator translates the automata into a context-sensing model (f). The ExCore inputs this context-sensing model to the expert system as facts, and the expert system deduces the unnecessary sensing operations related to the exclusive contexts.
4.1.2. Expert System
The expert system analyzes the context and sensing-related information as facts and identifies the sensing operation that consumes unnecessary power within exclusive contexts by using pre-defined unnecessary sensing operation search rules as defaults (a). This is followed by presenting an efficient sensor operating instruction (h) to enable sustainable context-awareness. The context of the sensing behavior model added by the developer corresponds to a natural language, and the meaning differs based on each individual developer. Hence, ExCore is fed back (e,f) by querying the developer as to whether or not the context to be added to the developer and the existing context are exclusive contexts. Additionally, the developer can propose a more efficient sensing operation by adding an efficient sensor operating instruction (b) as a rule. The efficient sensor operating instruction deduced by the expert system is delivered to the developer. The developer utilizes this instruction to develop an application or a middleware to enable an efficient sensing operation with respect to the exclusive contexts. The sensing operation on the middleware enables efficient power consumption without requiring additional changes in the application code. In order to perform this, it is necessary for the middleware to possess the ability to control various sensors by following the instruction.
4.2. Context-Sensing Model
In order to improve the power efficiency in the exclusive context, it is necessary to analyze context-related information used in the service and sensing-related information used to infer the service. The extent of information analysis and the manner in which the analysis is handled are highly dependent on the modeling of the information. The requirements for the modeling in the proposed system include the following:
Adaptability and Scalability: A model should be provided to developers such that they can express their own context and sensor-related information.
Simplicity: Only minimal information should be required for sustainable contexts such that developers are not burdened.
ExCore only requires automata (sensing behavior model) with respect to the developer to satisfy the requirements. It is assumed that the automata correspond to a minimal artifact produced during the development of a context-aware service. However, if many sensors are used and describing all of the sensors is difficult, the developer is required to make additional efforts in selecting and describing only the sensors and their operations corresponding to the contexts that cause exclusive contexts.
Figure 4 shows an example of the automata that expresses the sensing behavior to infer the seminar context of the Problem Definition as illustrated in
Section 3.1.
The automata is an event driven model that consists of states and transitions and it represents the sensing behavior of sensors for context-awareness. Each state is maintained when it receives sensing data that does not change beyond the threshold, and the service infers the context based on the corresponding state. If sensing data with a change that exceeds the threshold value is received as a result of the periodic sensing operation, then it transits to another state based on the condition of the transition. Each automata is described by each context used to trigger the service, and this is termed as the core context (that is, if there are three contexts, then it is necessary to create three automata). Therefore, the automata consists of a core context and other contexts that are termed as ‘support contexts’. The state inferring the core context is denoted as the marked state. The marked state is used to identify the exclusive contexts.
ExCore receives the sensing behavior model of the automata type that infers individual contexts and inputs the same as a fact in the expert system. The sensing behavior model satisfied the requirements for the modeling as previously mentioned. However, this is not directly usable because it is too complex to use in the expert system. Therefore, it is necessary to change the sensing behavior model from the expert system. The Automata Translator is responsible for these tasks, and as a result, it generates the context-sensing model.
Figure 5 illustrates the context-sensing model proposed in this study.
The bottom of
Figure 5 illustrates a context-sensing model with the goal of expressing the values of the sensing behavior model in the expert system. The context-sensing model consists of a context-model that contains abstract information related to the context and a sensing model that is responsible for explicit information related to the actual sensing data. Additionally, they are composed of entity-related information and relation-related information and are designed to be easy to interpret by the expert system. In detail, the context of a context-sensing model is composed of states, and the states are divided into marked states deducing the core context and supporting states deducing the support contexts. Each state is transited by the event of the sensors and has a domain state that corresponds to the start of transition and a range state that corresponds to the arrival of the transition. The event occurs when one or more sensors (GPS, Wi-Fi, etc.) satisfy the condition.
Figure 6 shows a context-sensing model of the sensing behavior model generated from the seminar context in
Section 3.1.
In
Figure 6, some events are composed of two more sensing conditions such as
wifiscan_success&&
vlume_high. The context-sensing model has a way to represent the AND and OR transitions, and
Figure 7 is an example that illustrates the basic, AND, and OR transitions.
In basic transition case in
Figure 7, when the Sensor1 satisfies
Condition1, then
Eventα is triggered, and it makes a transition from the
StateA to the
StateB. In the AND transition case, the
Eventβ could be triggered when both the
Sensor1 and
Sensor2 satisfy the
Condition1 and
Condition2 at the same time, respectively. For adapting our model to the expert system, we should use only the static number of tuples for the model. For this reason, we separate one
hasCondition into two
hasConditions for representing the AND transition. In the OR transition case, a transition from the
StateA to the
StateB is triggered when either
Sensor1 satisfies
Condition1 or
Sensor2 satisfies
Condition2. Therefore, we separate the event making transition into two events for each sensing trigger, such as the
Eventγ and the
Eventδ. By using a combination of these transition expressions, we can represent all kinds of sensing behavior models as the context-sensing model.
4.3. Low-Power Sensing
The Context-Sensing model generated by the Automata Translator is added as facts to the expert system.
Figure 8 shows the templates for the facts added to Jess, which is one of the famous expert systems and one example among the facts of the seminar context in
Section 3.1 according to the templates.
All name of entities and relations are named by a developer using natural language. To identify each element of the context-sensing models, we add an id slot to all entities, and all relations could refer the entities only using this id.
When the facts for a new context are added, the expert system queries the developer as to whether or not the new context makes new exclusive contexts with the contexts which have been stored as the facts in the expert system. If it is part of the exclusive contexts, it is also added as a fact. Then, the expert system deducts the sensing operation that consumes unnecessary power using the unnecessary sensing search rule defined in this paper. Here are the necessary and sufficient conditions for the unnecessary sensing operation:
- ①
There are no sensors of the same type used for the exclusive contexts, and the exclusive contexts are inferred at the same time.
- ②
If the conditions of the sensors that have the same type and which are used for the exclusive contexts are not same, they are not disjointed. Also, the exclusive contexts are inferred at the same time.
First of all, for identifying the unnecessary sensing operation, we should check whether there are any sensors of the same type used for the exclusive contexts. Rule 1 is responsible for this as shown in
Figure 9. After Rule 1 is fired by the facts in the expert system, the latter of the unnecessary sensing operation ② would be checked. Otherwise, the former ① would be checked.
The unnecessary sensing operation could be divided into two types based on the result of Rule 1, and each of them is discerned by applying different forward chaining rules. First, Rule 2 finds the unnecessary sensing operation when there are no sensors of the same type in
Figure 10. It checks whether there exists a fact satisfying the conditions (2–13) among the facts in the expert system by the existential quantifier (1). If there is an unnecessary sensing operation, the fact (14) is added in the expert system. To examine this rule closely, it checks whether there are two different contexts (2, 4) which are the exclusive contexts (3) in the expert system. Then, it identifies the core state (7, 8) among the states inferring them (5, 6). After that, it checks the sensors and the conditions of the event (11, 12) that makes the transition (9, 10) to the core states. Finally, it checks whether there is the fact, the usedSameSensors (13), in the expert system.
Second, Rule 3 finds the unnecessary sensing operation when some of sensors are of the same type in
Figure 11. As mentioned in the previous section, in this case, the sensing conditions of the unnecessary sensing operation in exclusive contexts should not be disjointed (16).
As an example of the problem definition in
Section 3.1, the driving context and the seminar context and the driving context and the studying context are cases where the kinds of sensors are not the same. Therefore, all the sensing operations inferring these contexts at the same time are unnecessary sensing operations. However, in the case of the seminar context and the studying context, because all conditions of the sensors that have the same type are disjointed, there is no unnecessary sensing operation.
The expert system not only identifies the inefficient sensing operation but also defines rules to infer efficient sensing operation. In this paper, we propose a method of gradually delaying the period of sensing operation in exclusive contexts by using a linear backoff-algorithm that follows Rule 4 in
Figure 12.
Since the rules for effective sensing methods could be modified and are extensible, the expert system continuously improves the efficiency of the sensing operation. In addition, the rules are shared and managed externally, so that more various methods can be proposed than those that are individually managed. Finally, the ExCore helps the application or middleware developer to perform efficient sensing operations considering the exclusive contexts.