Optimizing Energy Consumption for Cloud Internet of Things

The Internet of Things (IoT) and Cloud Computing are considered to be two of the greatest technology revolutions in the last few years. New technology raised in recent years is known as Cloud IoT or the Cloud of Things (CoT), which integrates cloud computing and the Internet of things. Dynamic and heterogeneous environments, energy efficiency, and delay-sensitivity are the major issues with the CoT. Energy efficiency is one of the basic requirements of IoT applications and resources in the cloud, which is a challenging issue in the CoT. This paper proposes the optimization of energy schemes for the CoT by applying a Genetic Algorithm (GA). Extensive numerical simulation is carried out to verify the effectiveness of the proposed method compared to the ETCORA algorithm. The analytical results present better performances of the proposed optimizing energy consumption technique. Results also show that the proposed method indeed outperforms the ETCORA in reducing the energy consumption of task requests.


INTRODUCTION
With the rapid advancement of network technologies and the world's movement toward a global society, modern networks like cloud computing, fog computing, and the IoT have become very popular. As a result, new types of potential problems are introduced. One of the key challenges is to effectively utilize energy at different levels, e.g., data centers hosting cloud applications [1]. Energy utilization imposes a new level of complexity to new generations of networks. Energy utilization means the ability to minimize energy consumption, such that the quantity of energy consumed is at an adequate level. Significant research has been devoted to providing solutions to this vital problem. The majority of the studies, however, attempted to solve the problem in terms of optimized scheduling of the resources involved in communication networks so that energy is utilized optimally.
Methods that make use of IoT have sustainably proved to be effective as the former is able to provide high performance across heterogeneous systems. However, the difficulties posed in IoT like the one security, privacy, and reliability are always expended. On the other hand, Cloud Computing has unlimited capabilities in terms of storage, processing power, and reliability [2]. In the context that it was developed, it involves several computing ideas ranging from services to the underlying structure of networks. Recently, the research combines the advantages of both IoT and cloud computing which is called Cloud IoT, while attempting to minimize their drawbacks [3]. Claudio is flexible enough to support different types of services and data among heterogeneous networks [4] and it has gained increasing popularity in recent years. This advanced technology imposes new critical problems. Examples include, but are not limited to, protocol support, energy efficiency, resource allocation, and location of data storage.
In Figure 1, estimating minimum energy consumption in Cloud IoT is a relatively complex problem and many often attempt to solve the dilemma through optimization techniques. From that perspective, the problem is defined as an objective function and its feasible and optimal solution is tried to be determined. The application of GA is one of the proposed solutions for handling energy consumption and optimization problems [5,6]. The underlying assumption behind GA is to combine exceptional characteristics from different ancestors which would likely generate better and optimized offspring, which in turn could have an improved fitness compared to the original ancestors [7]. Therefore, if the technique is iteratively implemented, offspring would be more optimized, thus resulting in higher sustainability in the environment in which they are operating.
In this paper, a new method for energy efficiency in the Cloud IoT is proposed. The method is built on the top of GA. The proposed method computes execution time and energy consumption to reduce the energy consumption of application requests.
The rest of the sections are organized as follows: section Related works presents related works for energy consumption for Cloud IoT; section Proposed Method discusses the proposed method, algorithms, and methodology of the evaluated scenarios;

RELATED WORKS
Several studies have been conducted to find solutions to the effective utilization of energy in CloudIoT. Though significant developments are achieved, techniques are very diverse and the problems are still very challenging which always presents a hot issue for the research community.
Inspired by the fact that Cloud IoT is not the optimal solution to those cases that are sensitive to energy consumption and delay, Mahmoud et al. [8] proposed a new fog-enabled Cloud IoT model. The entire idea is based on the energy allocation technique for populating tasks into a fog device. The reported results showed that energy efficiency has been increased by 8.27% compared to the default Cloud IoT. Additionally, the technique succeeded in reducing the energy consumed by the cloud to 2.72%, whereas it has been reduced by 1.61% using Cloud IoT. In another recent research [9], the authors develop a new algorithm called (E2C2), the proposed algorithm creates an energy-aware structure plan that searches and integrates the least possible number of IoT services, in order to fulfill user requirements. Natesha and Guddeti [10] proposed proposed an approach for energy-efficient computation offloading and dynamic resource scheduling (eoDS) to solve the energy consumption problem in IoT-fog-cloud system. Sun et al. [11] proposed an energy and time-efficient computation offloading and resource allocation (ETCORA) algorithm on the general IoT-fog-cloud architecture. The CitiSim Smart Energy monitoring and simulation platform was also introduced in [11] which aims to optimize resource consumption and reduce costs in energy efficiency measures.
Mishra et al. [12] presented four scenarios: standby routes selection scheme (SBRS), the desired reliability level scheme (DRLS), a reliability-based sub-channel scheme (RBS), and a reliability-based data compression scheme (RBDS) to minimize total traffic power of the cloud-based IoT network through MILP optimization model. A multi-objective particle swarm optimization (MOPSO) mechanism for cloud brokering for optimum energy consumption was proposed by Huang et al. [13] to enhance the return of investment (ROI) for cloud brokers and reduce time response of client requests. In 2018, Moghaddam and Leon-Garcia [14] had derived a heuristic algorithm to solve the problem of the cloud base architecture QoS [15,16] for IoT services selection.
Optimization technique is an approach to find the best solution for complex problems by minimizing or maximizing one or functions that are more objective stand on one or more decision variables that give a value of the objective function [17]. Combinatorial Optimization, Non-linear Programming, and linear Programming are designed to solve a wide range of optimization problems [18][19][20]. Optimization techniques are classified as exact methods and approximation methods (heuristics and meta-heuristics methods). Classification of optimization techniques are shown in Figure 2.
Therefore, the main contribution of this paper is to propose a viable solution introducing the enhanced battery lifetime for IoT nodes, reducing energy consumption, and improvise the QoS requirement for real-time applications in Could IoT.

PROPOSED METHOD
As it was illustrated, energy efficiency is critical to both cloud and IoT applications. However, when it comes to Cloud IoT, the problem is even more challenging as new dimensions are introduced (i.e., Energy efficiency, resource allocation, etc.) [11][12][13][14][15][16][19][20][21][22][23][24][25][26]. To achieve the goal of energy-saving, which is the most important factor, the proposed approach (shown in Figure 3) attempts to handle the problem by optimizing the selection and placement of behavior of task execution time using a genetic algorithm.
The assumption that is made first is that the process of executing a relatively large number of tasks with different sizes often results in consuming a massive quantity of energy. Therefore, the idea is to divide each application into multiple independent tasks and then map the execution of all divided tasks to the Cloud IoT. The execution of each task is either performed on IoT or on cloud computing. However, the decision of executing any architecture depends on comparing the execution time of the corresponding task into IoT to its transmission time, which is equal to the time required to send from IoT to cloud plus the time needed for transmission in the opposite direction. By following this strategy, the execution time for all tasks for IoT and cloud is computed, and the same arguments are applied for execution time in cloud IoT. Then, the energy consumption into both IoT and cloud is computed, hence, the energy consumption into cloud IoT is estimated based on the estimated consumption on the teaching part individually. The mechanism can be defined mathematically. The symbols that are used are highlighted in Table 1.
Thus, the optimization problem to be solved is minimized to the j T= 1 E CIoT Subject to, The working principle of the model is presented as follows.
According to the mathematical model, the following formula is considered, as shown in Equation (1), to calculate the execution time for the task (AT ij ) into IoT. Where N s represents the processing speed in IoT and the data size of the task AT ij denoted by D ij .
Transmission time: Complete transmission time is estimated with the summation of sending time from IoT to cloud and receiving time from cloud to IoT, as shown in Equations (2,3,4). D rate is data transmission rate using with task data size to calculate transmission time when the task AT ij is assigned to the cloud, then data are uploaded through the wireless channel. Sending time is calculated as: Receiving time is calculated as: Transmission time is calculated as: A comparison between execution time calculated in Equation (1) and transmission time calculated in Equation (4) determines where to execute the task into IoT or cloud. Equation (5) represents binary matrix Z.
If Z = 1, the task is executed at IoT device, and if Z = 0, the task is executed at the cloud. Consider the number of applications contains a T number of task schedules to execute in the cloud (i number of virtual machines) or IoT (i number of sensors).
After ensuring the executed tasks, energy consumption strategy in cloud IoT (E CIoT ) has to be executed which has two parts: calculate the energy in IoT denoted by E IoT , and calculate the energy in cloud denoted by E C [17].
EE CIoT =E C +E IoT (7) Energy Consumption in IoT The task is executed at the IoT nodes, P IoT represents power consumption in IoT, G is the channel gain between cloud and IoT nodes, and transmission power for the task (AT ij ) is denoted by P tran . Energy consumption in IoT is the sum of processing energy consumption (E proc ) and transmission energy consumption (E tran ). It is described by Equation (8).
According to Equation (1), processing energy consumption (E proc ) for task (AT ij ) is shown in Equation (9).
Energy consumption in the cloud leads to IoT nodes passing the tasks to the cloud using a wireless link. Firstly, calculate transmission energy consumption (E tran(C) ) when the offloading to cloud shown in Equation (11), where transmission power for the task (AT ij ) is denoted by P tran(c ) .

E tran(c) =P tran(c) D ij D rate
The necessary equation to execute time for the task on the cloud (ET (ATij)C ) is shown in Equation (11), where M s represents machine speed in the cloud [17].
ET AiTj c = D ij M s (12) For executing tasks in the cloud, the server is distributed to the virtual machine (VM). The virtual machine has two states: idle and on. Where T arrival presents time required to arrive the task to VM, P on is the power consumption when the VM is on, T on presents the time required to execute the task when VM is on. According to Equation (11), time spent in one state is calculated by Equation (12) T on =T arrival +ET AT ij c (13) P idle is the power consumption when VM is idle, T idle represents the time required to execute the task when VM is idle. VM moves from idle to on state with a rate T on . According to Equation (10), time spent in one state is calculated by Equation (14).
From Equations. (13,14), it can be obtained idle energy consumption (E idle ) and on energy consumption (E on ). (15) E on =P on x T on (16) From Equations (11,14,15), we can get energy consumption in the cloud (E C )

E idle =P Idle x T idle
Considering this, all tasks should be executed as a constraint in the GA algorithm. The proposed method is shown as the algorithm. The proposed algorithm is divided into two parts: Energy Consumption in IoT and energy consumption in the cloud. The algorithm 1 calculates the energy consumption value for tasks and enhances based on the GA algorithm. In GA, parameters at the input are the requested tasks, data size of task, process speed in IoT, and data transmission rate. The output is the optimal energy-efficient. The proposed scheme is utilized to calculate the suitability of execution whether in the IoT node or at the cloud side. If the task execution time is less than the transmission time, it will be executed at the IoT node, else to be assigned to the cloud. If ET(AT ij ) IoT << TT ij then 6.
The task will be executed on the IoT 7. Else 8.
Offload task to execute on the cloud 9.
Call Energy Consumption in IoT 12.
Call Energy Consumption in Cloud 13.
Get E CIoT by Equation (6) Line 11 of the Algorithm call procedure 1 calculates energy consumption in IoT. Procedure 1 has several input parameters such as power consumption in IoT, the transmission power for the task, and channel gain. Line 2 of procedure 1 computes processing energy consumption (E proc ) and transmission energy consumption (E tran ). While Line 3 of procedure 1 finds the energy consumption in IoT for all tasks that executed local devices. Compute E tran , E proc by by Equations (8,9) 3.

Get E IoT by Equation (7) End
Procedure 2 calculates energy consumption in a cloud called by Line 12 of the Algorithm. Firstly, calculate the transmission energy consumption (E tran(c) ) and execute time for the task on the cloud (ET AT ij C ). Line 3 of procedure 2 checks the state of VMs. VM state=1 means it is the current task executed in on state for VM. According to Line 5 of procedure 2, energy consumption (E on ) can be obtained for all tasks executed in on state for VM. If VM state=0, the state for VM is idle. The time required to execute the task when the VM is idle compute in line 8 of procedure 2, Get E C by Equation (16)

End
The last line of the algorithm used to repeat steps 2-5 of GA is iterated for finding the best optimization for selection and placement of behavior of task time execution and finding the optimal approach to minimizing energy consumption.

SIMULATION RESULTS AND DISCUSSIONS
The proposed method is to evaluate performance through different cases. The GA based method is used for Cloud IoT energy consumption optimization. Results are obtained by using the method written in the C++ programming language. The simulation parameters are listed in Table 2.
• Case 1: To study the effect of crossover (one-point, twopoints) on energy consumption. In the one-point crossover, a crossover point is randomly selected, and the bit blocks swapped between two parents. In a two-point crossover, two bits' positions are randomly selected and then the bit blocks swapped between these two points. Evaluate the energy consumption of application requests based on the effect of crossover types on energy consumption. The consumed energy is determined by using deterministic mutation for various types of crossover (one-point, two-points) considering the number of generations equal to 8 for the different number of tasks (16,20,24,28,32). Based on the results in Figure 5, two-points crossover performed much better compared to one-point. • Case 2: It uses two mutation techniques (deterministic and randomized) mutually one-point and two-point crossovers,  to study the impact on energy consumption. Two strategies for mutation: (a) deterministic mutation randomly selects one gene for mutation and adds constant value for it, (b) randomize the selected gene of mutation. The energy consumption for different numbers of tasks is obtained in Figure 6. The result demonstrates the energy consumption is decreasing when using a randomized mutation. • Case 3: Here energy consumption of application requests in Cloud IoT is evaluated. Figure 7 shows the effect of the generation number with different task numbers on energy consumption. With the progression through each generation, the value of the objective function, energy consumption decreases accordingly. Results prove that the proposed approach is reducing the energy consumption in a clouded form first generation to eight generations for different task numbers. The eighth-generation is selected as the optimal solution. • Case 4: Comparison with other energy consumption algorithms. Authors Sun et al. [8] have proposed IoT-fogcloud architecture with energy consumption and computation time of offloading and resource allocation (ETCORA) algorithm. Figure 8 provides comparison results between the proposed method and ETCORA to evaluate consumed energy for CloudIoT using the same parameters. From Figure 8, the proposed method is optimal, and ETCORA is relatively poor. • Case 5: Difference between energy consumption and power consumption: energy is the total amount of work done, and power is how fast it can be done. The unit of power is in watts and a unit of energy is the joule. In this case, energy consumption depends upon the power consumption at the  IoT level. Therefore, it is possible to study impact power consumption in IoT on the energy consumption for the different number of tasks. The value of power consumption in IoT is set from 0.2-0.8 watt.
According to Equation (8), the relationship between the energy consumption for processing tasks and power consumption in IoT is direct. When increasing the value of power consumption in IoT, the energy consumption increases. Figure 9 shows the energy consumption under the different values of power consumption in IoT.

CONCLUSION
Numerous scheduling and resource utilization techniques for energy consumption in communication networks have been developed in the last few decades, but still, it is a challenging task. This paper presents the Cloud IoT system based on a genetic algorithm (GA) for optimizing energy consumption. The GA is implemented using the C++ platform integrated at the simulation model. The simulation evaluates the performance of the proposed technique through different instances, such as genetic algorithm operators (crossover, mutation, and generation number). Then, a widespread simulation to validate the effectiveness of this mechanism compared with ETCORA algorithm is carried out. Simulations results are investigated to evaluate the performance of the proposed technique with optimal parameters. Results also verified that the proposed approach optimizes the energy consumption in a Cloud IoT and finds the optimal solution as 20J for 16 tasks and 87J for 32 tasks. Finally, the result shows that the proposed approach reduces energy consumption by 51.2% for 16 tasks and 22.3% for 32 tasks compared to the ETCORA algorithm.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.