1. Introduction
Every year, diverse new devices with advanced features and intelligence are presented and launched to realize the concept of the IoT. A plethora of IoT applications such as smart meters, video surveillance, healthcare monitoring, parcel or asset tracking and transportation are making a significant contribution to the growth of devices and connections. IoT connections are one of the fastest-growing categories of devices and connections. According to statistics, IoT will grow nearly 2.4 times over the forecasted period (an average annual growth rate of 19%), reaching 14.7 billion connections by 2023 [
1]. The Iot can be specified as a network of intelligent devices that have wireless or wired built-in connectivity or sensors, actuators, and any other functions that can perceive and transfer the environment information to the cloud [
2,
3]. The idea of the IoT is to use the Internet as the basis of a communication system to create intelligent interactions between people and surrounding objects while simultaneously bringing different “things” together as a whole. Cloud computing is an important part of the IoT, which provides valuable services to IoT-related implementations in many application areas [
4]. The IoT is playing an important role in many areas and domains to improve our quality of life. These applications include smart homes, industrial automation, and disaster relief for natural and man-made disasters where human decisions are difficult to make [
5].
During the past few decades, the global IoT market has grown enormously. The growing adoption of cloud computing can be attributed to advance data analytics, cost efficient connected devices and the flexibility achieved through integration of advance principal technologies, where computing, storage, and network management functions are operated in a centralized manner [
6]. The cloud-integrated IoT applications offer powerful computing resources, on-demand data storage, and offline analysis of large amounts of data [
7]. However, with the rapid development of applications for the mobile internet and IoT, the existing centralized cloud computing architecture-based application faces major challenges. Mobile devices connected to centralized remote cloud servers attempt to receive advanced applications that add additional load to both the radio access network (RAN) and the backhaul network and cause high latency [
8]. The IoT presents challenges such as severe latency, capacity limitations, devices with limited resources, uninterrupted services with intermittent connections, and increased security that cannot compete with the legacy of centralized cloud computing architecture [
9]. There is an urgent need to develop an advanced cloud computing paradigm to break the centralized architecture and reduce the capacity and latency limitations to meet these challenges.
In edge computing, due to bandwidth and power consumption issues, massive amounts of data collected by various types of IoT devices can be analyzed at the edge of the network, rather than sent to a centralized cloud infrastructure. Compared to cloud computing, edge computing can provide faster response and higher quality of services. Edge computing is better suited to integrate with the IoT paradigm to provide secure and well-organized services to amounts of end-users, and the edge computing architecture can be seen as the future IoT infrastructure [
10]. The edge computing paradigm is perceived as a mechanism to satisfy low latency and efficient bandwidth that not only generates data at the edge of the network but also processes large amounts of data. The sensed data can be analyzed with the edge computing paradigm at the edge of the network [
11,
12,
13]. The edge of the network implicates that the unit is equipped with advanced computing capabilities that consist of networking, storage, computing, and other core functions to generate and process data. There are other similar paradigms, such as Fog Computing [
14,
15] and Mobile Edge Computing [
16,
17] that not only provide effective solutions for large-scale computing but also improve the user experience.
The smart home is focused on improving the living environment of users and saving energy consumption. The smart home technique uses electric home appliances and IoT sensors with central control devices to effectively manage energy consumption. The author of [
18] presented a smart home system that integrates IoT devices with cloud computing to provide a remote control with smartphones and networks. The author of [
19] proposes an IoT and cloud computing-based EMS, which can be accessed remotely by the consumers with a network. These studies ensure remote control with a smartphone application or web browser, which is being challenged with intelligence. The authors of [
20,
21] present a control mechanism with machine learning algorithms to understand residents’ behavior in energy exploitation and needs and provide accurate forecasts in response to residents’ demand without wasting energy. However, machine learning-based controllers lack flexibility because they depend on user behavior of fixed schedule [
22].
In this paper, we propose an intelligent optimization mechanism that utilizes optimization capability and fuzzy logic in the edge computing framework to provide a trade-off between energy consumption and the desired environment setting in a smart home. To Improve the intelligence, we design and Implement a rule-based objective function in the EdgeX edge computing platform to control the temperature states of the smart home. We use the edge computing paradigm to enhance the IoT device capability of computing, storage, and network. The edge computing framework is an open-source, interoperable, software platform at the edge of the network, that interacts with the smart home sensors and actuators to provide intelligent home environment control with optimization mechanism and fuzzy logic algorithm.
The remainder of this paper is constructed as follows.
Section 2 is the related work that gives a concise introduction to edge computing that moves functionality from the cloud to the edge of the network.
Section 3 introduces the proposed intelligent optimization mechanism architecture for smart home environment control.
Section 4 provides some insight into the implementation and results of the proposed system.
Section 5 reports the performance evaluation of the proposed work. Finally,
Section 6 concludes the paper and discusses some directions for future research.
2. Related Work
The recent research of smart home applications can provide a number of benefits; for example, it uses energy efficiency while improving the user experience. However, it is still a difficult task to design a common communication model for each entity of the integrated smart home system.
The author [
23] proposed a smart home control system based on a ZigBee network with the help of a coordinator. The proposed work comprises of energy control system that consists of a home appliance control system and a light control system supported by a ZigBee sensor connected to each home appliance and a light sensor placed in the smart home. An intelligent management system has been developed to effectively control the operating time of electronic devices of a smart home. The author [
24] proposed a smart home system design based on the communication technology of ZigBee and Powerline Carrier. A communication gateway has also been designed. The author [
18] presented a smart home system that integrates ZigBee devices, smart Wi-Fi plugs, IR devices, and cloud computing. Customers can use smartphones and networks to control devices with different communication protocols. The author [
25] proposed the design of a smart home environmental monitoring system based on the ARM Cortex-A53 core Raspberry Pi, B/S architecture, and wireless network functionality. The system consists of the smart home controller, EnOcean/Wi-Fi wireless sensor control network, and smart home client. The smart home client allows users to connect to the smart home controller through the client PC. The system uses a wireless EnOcean and Wi-Fi network to query the working status of the home environment in real-time.
In a typical smart home, residents can control the devices in the apartment, e.g., TVs, lamps, radios, fans, air conditioners and monitor living conditions. These devices have many different communication protocols such as ZigBee, Wi-Fi, and Ethernet. It is therefore necessary to integrate heterogeneous network protocols in smart homes. However, the smart home network integrates sensors, embedded devices, wireless technology, distributed data processing, etc. Heterogeneous communication is important, but embedded computing and distributed information processing have great significance. However, the authors generally do not care about the scalability and flexibility of the system in the smart home.
We also explore several open-source platforms that can be used to develop edge computing. EdgeX Foundry is a vendor-neutral interoperability platform for edge computing of IoT. It hosts microservices at edge nodes such as gateways, and routers [
26]. It provides connectivity with various sensors and actuators via several protocols, controls them, senses information from them, and transfers the data to an application that is located at the edge of the cloud for advanced processing. EdgeX can be operated at various hardware and operating system. In order to shift analytics from cloud to edge devices, Microsoft Azure presents Azure IoT Edge as a cloud service provider [
27]. The edge devices are routers, gateways, or other nodes, which support computing resources. The user who has their applications in the cloud can move them to edge devices through Azure IoT Edge to reduce latency. It can simplify the development complexity of applications of edge devices. In addition, users can make use of Azure functions, Azure ML, and Azure stream analytics to install complex jobs on the edge nodes such as machine learning, image recognition, and other services related to AI. Apache Edgent [
28] is a programming model and lightweight runtime that can be running in small nodes such as gateways and routers. It is dedicated to data analytics at the network of edge, trying to accelerate the implementation of data analysis. CORD [
29] is an ONF project, initiated by AT&T and presented for network operators. Network equipment suppliers provide network infrastructure with closed proprietary-integrated systems. With the dependency of network equipment suppliers, the network capability is hard to manage with network operators. Therefore, computing and networking resources are wasted. CORD tries to use software-defined networks, network function virtualization, and cloud technologies to reconstruct the infrastructure of edge networks to build data centers. It divides the resources of reconstructed datacenters such as computing, storage, and network to provide clouds at the edge network.
We propose an intelligent optimization mechanism for efficient home appliances control based on embedded edge computing for a smart home. IoT devices require heterogeneous capabilities related to protocols, operating systems, and applications.
Table 1, provides a summary of the open-source edge computing platforms. we compare them considering several aspects such as operating systems, programming languages, goals, and system characteristics. EdgeX Foundry is agnostic to hardware, the CPU, operating systems, supports several programming languages, and is designed to provide interoperability, which can be used to satisfy the requirements of heterogeneity of IoT devices.
3. Intelligent Optimization Mechanism for Efficient Home Appliances Control
In this section, we describe the structure of our proposed system that is integrated into the smart home. To realize enhanced intelligence and make up for the shortcomings of IoT devices, the objective function, and fuzzy logic control logic are also explained.
3.1. Proposed Optimization Mechanism Architecture for Home Appliances Control
We propose an intelligent optimization mechanism based on embedded edge computing that employs optimization functions and fuzzy logic in an edge computing framework to balance energy consumption and environmental factors required in a smart home. As shown in the following
Figure 1, the proposed system consists of an intelligent edge computing platform and a smart home environment.
The smart home environment includes temperature sensors, and heating and cooling actuators. The temperature sensors sense the temperature of the smart home and send it to intelligent edge computing platform to provide automatic temperature control through execution of a cooler or heater properly. The sensors and actuators are located in a smart home to support connection with intelligent edge computing platforms via the internet. The intelligent edge computing platform services are running in an embedded system that is equipped with a WIFI network to provide connectivity.
The intelligent edge computing platform consists of several fine-grained and self-contained microservices with individual functionalities such as storage service, an intelligent service, processing service, and internet capabilities. The microservices provide services and communicate with each other through a well-defined message interface, such as REST APIs. The microservices can be independently developed with individual technologies and programming languages that can deploy on the embedded system such as raspberry pi. The Raspberry Pi contains a System-on-a-Chip that is as powerful as a regular computer and can run a full operating system like Linux. Hence, It is possible to develop the applications on the machine itself, making embedded development easier.
3.2. Architecture of Distributed Intelligent Edge Computing in Home Appliances Environment
The proposed system functions are separated into three tiers including the client, intelligent edge computing platform, and IoT networks as shown in
Figure 2.
The client tier imposes the edge client to provide information about the smart home to the users. It interacts with the intelligent edge computing platform through the visualization capability of the client to present readings of device information and sensing data in various styles.
The intelligent edge computing tier includes a connectivity layer, basic services layer, optimal control service layer, and client support layer to distribute computing processes of IoT devices at the edge of the network based on an intelligent method. In order to derive a user-desired result, the optimization engine and fuzzy control jointly control the IoT device. For interacting with IoT devices, the intelligent edge computing platform provides a command transfer service, and data repository to manage device information, storage sensing data, and issues a command to the device using connectivity layer services to link the IoT devices to the cyber world. In addition, the client support layer services allow users to access the displayed virtual object for accessing the actual device over the Internet.
The IoT network tier is constructed with various small single-board computers, sensing devices, and actuators. The IoT devices are deployed in a smart home to collect data from the physical world and operate the actuator to control electric appliances. Typically, sensors and actuators do not have network functionality. Therefore, to transfer collected data from sensors to the intelligent edge computing platform, they directly connect with IoT devices through the native interface. The single-board computer as an IoT device is able to provide wireless or wired connection ability to communicate with intelligent edge computing framework through internet protocols such as Hypertext Transfer Protocol (HTTP) and Constrained Application Protocol (CoAP).
3.3. Development Model of Proposed Microservices of Intelligent Edge Computing Platform
Figure 3 illustrates the development model of client services. To improve user convenience, we designed the client services with device support service and data support service. With the device support service, users can gain information about the device list managed by the intelligent edge computing platform, device details provide a detailed profile of the device, and device command that is served by this device. The data support service provides statistic data, history data, and real-time data which are generated by the devices.
Figure 4, illustrates the development model of the intelligent edge computing platform using EdgeX. The model is separated into six functionalities including the device service, EdgeX core data, EdgeX core command, rules engine, optimization engine, and device controller.
The device service is the edge device connector interacting with physical devices that are managed by the intelligent edge computing platform. The sensing data provided by physical devices are ingested to other services and converted into common EdgeX data formats through device service. The device service exposes REST APIs with the device service interface component to transfer command from other services in the intelligent edge computing platform.
The EdgeX core services such as core data, and the core command are supported by EdgeX. The core data are responsible for storing and managing service for data collected from the device service. The core commands facilitates and controls device actuation requests from other services. To provide the intelligent optimization mechanism in embedded edge computing, we modified the rule engine, and designed an optimization engine and a device controller. The rule engine includes a ZeroMQ subscriber, rule engine, rule repository, and rule creator functions. The rule creator generates rules requested by the users. The generated rules are stored in the rule repository. Afterwards the ZeroMQ subscriber receives flow data provided by the devices and then fed to the rule engine for further processing. The optimization engine consists of an objective function and a data converter. The data converter of the optimization engine converts the data of optimization request to unified formats of the optimization engine and delivers them to the objective function to generate optimized parameters. The device controller is responsible for generating the actuation mechanism of devices based on parameters generated by the optimization engine through fuzzy logic.
To provide sensing data to the intelligent edge computing platform, the simulated IoT device is designed in raspberry pi 3 model B. The designed model is launched on the ubuntu operating system and libraries as an application. The model composes an event generator, event publisher, device handler, and simulated device interfaces. The simulated device interface receives requests from the device service of the intelligent edge computing platform, then invokes proper functions of the device handler to generate an event and finally publishes the event with the event publisher. Detailed Information is depicted in
Figure 5.
3.4. Sequence Diagram of Smart Home Environment Control Using the Intelligent Edge Computing Platform
The sequence diagram of the proposed intelligent edge computing platform for controlling the smart home environment is depicted in
Figure 6. The sensors in the IoT networks detect temperature information of a smart home. Then, previously transfer data to the data repository by REST APIs are exposed by the data repository. When the data repository receives the data sent from sensors of IoT networks, it will issue the data with an event and store them. The rules engine is listening to the event with the ZeroMQ subscriber. When the data repository issues an event through the ZeroMQ publisher it will deliver to receivers of this event. If data match any rules that are registered in the rule engine, they will invoke a related function to execute further processing. In our scenario, when the received event brings the current temperature of the smart home, the rules engine will invoke an optimization engine to obtain the optimized temperature that is a trade-off responds energy consumption and the desired environment setting of residents in a smart home. When an optimization engine response with an optimized temperature, the rules engine invokes the device controller to properly control the smart home. Finally, the device controller calls the command transfer service to send the commands to actuators of IoT networks to maintain the status of the smart home.
3.5. Proposed Energy Efficiency Objective Function Model for Home Appliances Control
We illustrate the block diagram of the proposed objective function model of the optimization mechanism in
Figure 7. The proposed model is comprised of input data, output, system constraints, temperature requirements, and an optimization engine. The input data inject the current temperature into the optimization engine; with the system constraints and temperature requirements of users, the optimization engine generates optimized temperature.
In order to infer the functional expression, the following assumptions are made. The current sensing data for temperature in the smart home are expressed as
. In order to express the user’s acceptable range of temperatures, we denoted them as
. The user preferred maximum and minimum values for temperature are represented as
. It is assumed that within the expected range, the maximum value represents the maximum expected value of the user’s comfort temperature, and the minimum value represents the minimum acceptable value of the smart home parameter for indoor spaces. If energy costs are not an influencing factor, the occupant wants certainly to keep the indoor parameters in a smart home at their maximum level. Setting the indoor parameters to the maximum value in a smart home would incur higher energy costs, so there is a trade-off between the energy consumption and the environmental settings required in the smart home. To be concise, we set the length of the temperature range as
. In this scenario, two smart home actuators (heater, cooler) should be used to maintain the required temperature settings in the smart home. Moreover, there are constraints to operate actuators, such as if
, then the heater is operated to increase smart home temperature. Similarly, if
, then the cooler will be operated to cool down the indoor temperature. We considered that the consumption by the heater and cooler in per unit change in temperature is estimated by
and
, respectively. Being unaffected by the high-cost constraint associated with more power consumption, the user can simply set temperature as per their comfort zones and the user desired parameters but, in practice, we cannot afford this all the time. Therefore, we need to find some trade-off between the user desired setting in the smart home and energy consumption.
Table 2 presents a brief description of the various notations used in this formulation.
We assume
is the optimal parameter that can compromise the required environmental settings and energy consumption. With the user’s acceptable range of temperatures, the optimal parameter
. With the above assumption the total energy to maintain the optimal setting
in the smart home is expressed with the following formula.
Similarly, we can obtain the minimum and maximum power consumption with the following formula.
We want to attain the maximum comfort status of the smart home with minimum energy consumption. We specify that
and
are the gain in making optimal environmental settings and gain in energy saving, respectively. If the user-defined preferences for the optimal environmental setting and energy saving are
and
, respectively, then the objective function is represented through the following equation.
There is a constraint which is
. The gain in having the optimal environmental setting
can be expressed as follows.
There is
which is the deficiency in having an optimal setting for temperature. If we want to maximize the gain through the optimal preference setting
, the deficiency component for the temperature parameter should be minimized. The formula is given by the following.
When
then the optimal preference setting should be to set
. When
then
, that will help in maximizing the desired
. The gain in energy saving
can be expressed as the following formula.
If we want to maximize energy saving, the energy consumed required for optimal setting should be minimized, i.e.,
. When
then
, which is helpful to maximize the energy-saving component
. Finally, the objective function can be expressed with the following formula.
There are some constraints such as:
For the cooling case:
For the heating case:
3.6. Proposed Fuzzy Logic-Based Home Appliances Control Model
The given
Figure 8, illustrates a fuzzy knowledge-based model that is used to control the smart home environment. The fuzzification comprises of the process of transforming values such as current temperature, deviation from optimized temperature into grades of membership for linguistic terms of fuzzy sets. The current temperature is divided into a fuzzy set such as Cool, Normal, Warm, Hot, and Very Hot. The deviation from the optimization temperature is divided into a fuzzy set that includes Negative Long (NL), Negative Short (NS), Optimal (O), Positive Short (PS), Positive Long (PL). The fuzzy rule-based inference engine performs the inference operations based on the rules with input values to map corresponding linguistic terms of heater and cooler. The defuzzification transforms the fuzzy results of the fuzzy rule inference engine into a crisp output.
The Algorithm 1 represents an algorithm that generates the level of cooling and heating using the current temperature and deviation from the optimized temperature. In order to generate a proper level of cooling and heating, we leverage a fuzzy logic. Fuzzy logic is much closer in spirit to human thinking and natural language than the traditional logical systems. Basically, it provides an effective means of capturing the approximate, inexact nature of the real world. The Fuzzy logic takes the current temperature and its deviation from optimized temperature as inputs and outputs the appropriate heating and cooling levels based on the fuzzy rules. Finally, an output class is created to include the result. Through the fuzzy logic-based method, the device control mechanism could provide a proper control level of the cooler and heater.
Algorithm 1: Device Control Algorithm. |
| Input: current temperature, and optimized temperature. Output: level of cooler, and heater. Initialize double to store deviation from the optimization temperature.Initialize double to store the level of the heater. Initialize double to store the level of the cooler. Initialize class to store the level the of cooler and heater. Initialize fuzzy logic inference engine as to generate the level of the cooler and heater. optimized temperature – current temperature; set the variable current temperature with the current temperature; set the variable store deviation from the optimization temperature with dot; evaluate to generate the level of the cooler and heater; obtain the variable of the heater; obtain the variable of the cooler; set the heater with ; set the cooler with ; return ; |
The following
Table 3, is the membership function for the current temperature. We assume the proposed fuzzy logic controller of temperature works perfectly at any temperature within range 13
C–39
C.
The following
Table 4, is the membership functions for deviation from the current temperature. It gives the difference between the user’s preferred temperature and the current temperature of the room as recorded by the temperature sensor in the room. As this model can work in temperature range 13–32
C and the user can set the desired temperature from 18 to 26
C, so the temperature difference between the current and the optimized temperature cannot exceed −21
C (18
C–39
C) and 13
C (26
C–13
C). Thus, (−21
C) and (+13
C) are the lower and upper limits of the input variable “deviation from optimized-temperature”.
The heater can either be in the ON or OFF state depending on the temperature preference in the room. The heater settings are categorized into 1. STOP 2. SLOW 3. MEDIUM 4. HIGH. If the current temperature of the room is below the desired temperature, the heater is turned on automatically according to temperature difference. The detailed information is presented in
Table 5.
The cooler settings are categorized into 1. STOP 2. SLOW 3. MEDIUM 4. HIGH. If the current temperature of the room exceeds the desired temperature then this cooler turns on automatically according to the temperature difference. The detailed information is presented in
Table 6.
5. Performance and Evaluation
Figure 17, illustrates the memory usage of the proposed microservices of the system on the Raspberry Pi 3. We use two Raspberry Pi 3 pieces of hardware, as shown in
Figure 17a,b, to execute the system. The total memory of each device is 929,996 kb, in which the running process takes 196,988 kb, and 281,128 kb, the total available memory is 1,332,356 kb. According to
Figure 17c, the total memory of the microservices is 964,024 kb, and hence we have enough memory to run the microservices. The rules engine, client service provider, fuzzy controller, and simulated device microservices take most memory usage. All the services are developed with a java-based spring boot framework that supports REST APIs for other services and clients. The optimal engine takes 63,532 kb to provide optimization capability to the intelligent edge computing framework and developed with the ASP.net Core framework which is based on the C# language. The EdgeX core services, such as core data, core command, and core metadata running on the Docker container are implemented with Go to provide basic services for the intelligent edge computing framework through consuming 44,948 kb of memory. The device service is also implemented with Go to provide services that take 3536 kb of memory. According to the statistics, it is evident that Go-based services consume less memory compared to C#- and Java-based services.
Figure 18, shows request delays for executing the proposed system based on the intelligent edge computing framework in the network edge. For evaluating the performance of the executing latency, the executing time of the optimization engine and fuzzy control is measured.
Figure 18a presents the execution time of the optimization engine that is requested by the rules engine. The optimization engine is implemented with the C# language to provide optimization capability to the intelligent edge computing framework. According to the statistics, we can understand that the minimum time is 0.152 s, averaging at 0.177 s, and the maximum time is 0.207 s.
Figure 18b presents the execution time of fuzzy control that is invoked by the rules engine. The fuzzy control is implemented with the java language to provide a control function to the managed devices of the intelligent edge computing framework. According to the statistics, the minimum time is 0.169 s, average time is 0.199 s, and the maximum time is 0.252 s.