# Strategies for Datacenters Participating in Demand Response by Two-Stage Decisions

Authors: Yuling Li; Xiaoying Wang; Peicong Luo
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

Modern smart grids have proposed a series of demand response (DR) programs and encourage users to participate in them with the purpose of maintaining reliability and efficiency so as to respond to the sustainable development of demand-side management. As a large load of the smart grid, a datacenter could be regarded as a potential demand response participant. Encouraging datacenters to participate in demand response programs can help the grid to achieve better load balancing effect, while the datacenter can also reduce its own power consumption so as to save electricity costs. In this paper, we designed a demand response participation strategy based on two-stage decisions to reduce the total cost of the datacenter while considering the DR requirements of the grid. The first stage determines whether to participate in demand response by predicting real-time electricity prices of the power grid and incentive information will be sent to encourage users to participate in the program to help shave the peak load. In the second stage, the datacenter interacts with its users by allowing users to submit bid information by reverse auction. Then, the datacenter selects the tasks of the winning users to postpone processing them with awards. Experimental results show that the proposed strategy could help the datacenter to reduce its cost and effectively meet the demand response requirements of the smart grid at the same time.


---

## Body

## 1. Introduction

With the development of the world economy and the depletion of natural resources, energy crisis and environmental pollution have become serious issues of sustainable development. The Energy Development Corporation envisions the world powered by clean energy and calls on the energy sector to make the necessary shift to clean and low-carbon energy to alleviate the energy issues [1]. As a large energy-consuming country, China has proposed a series of corresponding energy utilization strategies. For example, Jiangsu province first experimented with a dynamic seasonal electricity pricing policy in 2015, using a potential way to encourage users to participate in demand response [2]. On the other hand, demand-side management as an important part of the smart grid is a critical way and an inevitable choice to achieve energy-saving and sustainable development of power enterprises. In order to meet various requests of the power users, the smart grid also needs to continuously deepen the power demand-side response and guidance mechanism to enhance the energy-saving and environmental protection effects [3]. The smart grid needs to propose a series of incentive mechanisms and effective demand response strategies to increase the flexibility of demand-side management to improve its sustainability. Smart grid programs should be carefully designed and can integrate the use of renewable energy, reduce electricity use, and lower CO2 emissions. Hence, some research studies have turned to focus on the design of a new hybrid smart grid performance framework for evaluation from the perspective of sustainability [4].Currently, an effective way for the smart grid to maintain sustainable development is to implement a more effective demand response strategy to realize the balance of power supply and demand. In order to improve the reliability, stability, and sustainability of the smart grid, power companies in some countries have initiated a series of demand response (DR) programs to encourage their users to participate in with the aim of reducing the peak load of the grid and thus improving the reliability of the power grid [5]. In general, there are two main types of demand response programs of the smart grids, including incentive-based and price-based programs. In particular, incentive-based demand response programs include direct load control and interruptible load control. Price-based demand response programs include time-of-use electricity prices, real-time electricity prices, peak electricity prices, and other price-related programs [6]. A great number of power companies are also trying to implement special demand response programs to achieve the goal of peak load shaving. Demand response programs also provide users with incentives to encourage user participation to adapt power consumption to demand response goals.On the other hand, with the increasing complexity of computing services and storage services provided by datacenters, and with the development of technology and the advancement of communication technologies, datacenters are more and more widely used as the basic computing and storage infrastructure. In 2017, there were approximately 8 million datacenters around the world, which consumed 416.2 terawatt-hours of electricity [7]. Hence, the power requirements of the datacenters increase dramatically, and high energy consumption becomes increasingly serious, which can lead to high carbon emissions of datacenters, which are not conducive to environmental protection. The datacenter is a large power consumer in the smart grid environment, and its load is usually highly flexible and adjustable. Datacenter participating demand response is envisioned as a promising approach for alleviating operational instability faced by smart grids and on the one hand, the datacenter can also save energy in response to the increase of electricity costs. In this case, the datacenter can be regarded as a potential participant of demand response programs in the smart grid [8, 9]. On the other hand, most datacenters support various types of workloads. Moreover, some workloads have the characteristic of high flexibility. For example, delay-tolerant tasks can be scheduled later as long as they could be completed before their deadlines [10]. This proves that datacenters can give a response by adjusting their own workloads when participating in demand response.As an important part of the smart grid, demand-side management is a significant way for the sustainability of power companies. Therefore, the power grid should conduct more plans to attract more users to participate in demand response projects. Demand response conducts economic incentives aimed at balancing energy demand during critical demand periods [11]. As a commodity, electricity has its own particularity. One is that electricity is not easily stored. Generally, electricity is consumed as much as it generates. The other is that the cost of electricity is relatively high during peak periods of electricity consumption. Therefore, it is critical for power companies to propose kinds of demand response programs to alleviate the load pressure. Generally, consumers will be encouraged to shift their loads to off-peak hours in demand response process [12]. Real-time electricity prices track the price of the entire electricity market dynamically and guide users to avoid electricity consumption behaviors during peak periods, thereby reducing their electricity demand during peak periods [13]. However, datacenters are high demanders of electricity, making them potential participants in demand response. Datacenter participation in the demand response programs would bring many benefits, which could not only reduce the load pressure on the power grid but also reduce the power cost of the datacenter.In this paper, we aim to reduce the total cost of the datacenter by involving the datacenter to participate in demand response program provided by the smart grid and in turn to improve the sustainability of the demand side of the grid. We proposed a two-stage decision process to figure out particular actions. In the first stage, the power grid sent the DR signals to the datacenter according to the variation of real-time electricity prices, while sending incentive information to the datacenter. The second stage was the bidding selection between the datacenter and its users based on a reverse auction mechanism. The user submitted bidding information firstly, including the number of tasks that could be postponed and the cost that the datacenter needed to pay due to the delayed execution of some tasks. Then, the datacenter tried to find the optimal solution by stochastic searching, delayed the execution of the task of the winning users, and rewarded them. Using the two-stage strategy, the purpose of reducing the peak load pressure of the smart grid while reducing the power cost of the datacenter could be achieved. This paper is an extended version of our prior work [14]. Based on the original version, we used the neural network for forecasting the real-time electricity price to judge the grid operation state in advance. In addition, we conducted a more detailed and comprehensive analysis of experiment results, including analyzing the impact of different forecasting accuracy on datacenter participants in DR, discussing the efficiency of the proposed method, and comparing the reward paid from the grid to the datacenter under different strategies.The remainder of this paper is organized as follows. Section2 introduces some related works about datacenter participation in demand response programs. Section 3 shows the system architecture and the optimization problems defined in this paper. Section 4 describes the two-stage decision process and strategies we designed to solve the defined problem. Section 5 analyzes the experiment results by comparing three different strategies. At last, Section 6 concludes the whole paper and discusses the possible future work.


## 2. Related Work

In recent years, the topic of how datacenter participates in demand response programs for the purpose of balancing the supply and demand for electricity has been discussed a lot. Different researchers keep different opinions and design diverse strategies to participate in demand response programs. Some of the researchers have focused on the benefits for both supply and demand sides by proposing a game-theoretic framework between the datacenter and the smart grid. There were also some researchers who realized the purpose of participating in demand response by transferring the load of the datacenter to other distributed datacenters for execution. In addition, some works proposed letting the datacenter actively participate in DR programs by reducing the load by shifting or delaying its own tasks.


### 2.1. Taking a Game-Theoretic Approach to Participate in Demand Response

Zhou et al. [15] used the real-time electricity price as a demand response signal in the deregulated electricity market and modeled the datacenter decisions on power company selection and workload scheduling as a many-to-one game model. This algorithm not only improves the revenue of power companies but also reduces the average contract cost of the datacenter. They turned the game problem into an easy-to-solve mixed-integer linear programming problem for solving. In [16], the authors adopted time-varying rewards to motivate the willingness of users to participate in demand response projects. They used a game theory framework to model the game between a single datacenter and its users. In addition, they extended the proposed strategy by combining two demand response strategies: server shutdown and local renewable energy generation. Zhou et al. [17] aimed at the two-way electricity flow between smart grids and datacenters with hybrid green energy generation capability and geo-distributed nature of large cloud system; they proposed a pricing scheme designed for geo-distributed green datacenters from a multileader single-follower game point of view. At the cloud side, in quest for scalability, robustness, and performance, the energy cost minimization problem is solved in a distributed manner, based on the technique of alternating direction method of multipliers. Bahrami et al. [18] considered the real-time pricing (RTP) and modeled the decisions of datacenters select utility company and workload scheduling as a many-to-one matching game with externalities. They developed a distributed algorithm that guarantees converging to a stable outcome.Through the analysis of the above pieces of literature, these studies are basically to establish a game model between the datacenter and the power company. Finally, they proposed an effective algorithm and obtained an equilibrium solution.


### 2.2. Participating in Demand Response by Geographic Load Balancing

Wang et al. [19] proposed a price-based incentive method. In order to motivate users to participate in their demand response projects, power companies set different power prices in different datacenters, encouraging users to shift the load to datacenters with lower electricity prices. Wang and Ye [20] regarded the datacenter operations as a problem of minimizing energy costs. They designed a distributed demand response algorithm. Administrators send optimized messages by broadcasting messages to each datacenter, and then each datacenter itself optimizes towards its own objective. Tran et al. [21] studied the distributed datacenter demand response method and proposed a two-stage pricing scheme based on the Stackelberg game. Each power company maximizes its profit by setting real-time prices in the first stage. In the second phase, the datacenter service provider uses workload shifting and dynamic server allocation to minimize its costs according to the electricity price. Liu et al. [22] thought predicted-based pricing is an appealing market design and showed that it outperforms more traditional supply function bidding mechanisms in situations where market power is an issue. These researches started with electricity prices from power companies and proposed incentive methods or other demand response methods for achieving the objective of reducing electricity costs in datacenters. Chau and Yang [23] took the advantage of the electricity price varying by region; they proposed a competitive online algorithm to achieve the load balance that can be applied to a limited time range and small-to-medium-scale energy storage. Liu et al. [24] explored the feasibility of using fully renewable energy to power Internet-scale systems. They conducted a trace-based study to assess three issues related to achieving this goal: the impact of geographic load balancing, the role of storage, and the optimal combination of renewable energy. Rao et al. [25] aimed at the location and time diversity of the electricity prices; they studied the issue of minimizing the total electricity cost in multiple electricity market environments while ensuring service quality. They modeled the problem as a constrained mixed-integer programming to solve.


### 2.3. Combining Multiple Methods to Participate in Demand Response

Guo et al. [26] aimed at the problem of a serious carbon footprint that resulted from using a backup diesel generator to supply power when datacenter participates in demand response. They focused on the effective and environment-friendly demand response of the datacenter. By designing economic incentives, they encourage tenants to reduce the load of the emergency demand response (EDR) in emergency situations and use the Nash equilibrium theory to analyze the relationship between datacenter operators and tenants. Chen et al. [27] argued that datacenters had the ability to provide large capacity reserves to emerging smart grid programs and, thus, provided opportunities for sustainable datacenter growth and cost savings as well as more flexibility for the grid. Therefore, they proposed policies to deliver datacenter demand response for peak shaving, regulation services, and frequency control programs. Cupelli et al. [28] combined the datacenter heating, ventilation, and air-conditioning equipment and delayed IT load and battery storage systems to coadjust the demand response projects. They proposed an optimization framework based on MPC (Model Predictive Control) forecasting to ensure the reliable operation of the datacenter and also analyzed the cost reduction in the case of incentives and prices. Paul et al. [29] considered that different types of jobs are distributed in different layers of the datacenter server, and, in particular, some of them can be delayed. They proposed rolling scheduling based on Receding Horizon Control (RHC). Based on the discrete-time model, they used two different methods to formulate and solve the optimal server configuration problem: minimizing operating costs and jointly minimizing capital and operating costs between service configurations at different layers. In [30], they took into account the risk of energy demand and core business processes of the datacenter in participating in demand response process, and they used a genetic heuristic algorithm for energy consumption prediction. Guo et al. [31] proposed a coordinated management method and model for datacenter computing and cooling load. In the datacenter energy supply system with distributed photovoltaic power generation, they established a datacenter energy supply system under the time-of-use electricity price environment to respond to demand with the goal of minimizing the cost of electricity consumption. In response to the economic demand response of the custodian, they [32] proposed a reward-reduction incentive mechanism, which reflects the interaction between the DRP (demand response provider) of custodian compensation to the custodian and the colocation operator reward to tenants. Chen et al. [33] proposed a pricing mechanism for mandatory and voluntary EDR (emergency demand response) projects, which is a parameterized supply function based on bidding, both when tenants are price-taking and when they are price-anticipating.Overall, some of the previous works only considered the power adjustment of the datacenter as a holistic entity to participate in demand response, and a lot of them were realized by the mutual transfer of load between geographically distributed datacenters. In addition, some researchers designed game-theoretic models between the datacenter and the power grid and sought to find an equilibrium solution between them. Considering the emergency of sending demand response signals, we adopt forecasting methods to obtain demand response signals in advance in order to schedule the tasks of the datacenter in time. In this paper, we design a two-stage decision strategy to make the datacenter participate in demand response. Compared with prior research work, the main contributions of this paper include the following:Establishing interactions between the smart grid, the datacenter, and the users and designing a two-stage decision process to participate in DRPredicting DR requirements by following real-time electricity price variation in the first interaction stage and designing a corresponding incentive mechanismDesigning the second stage of the datacenter interaction mechanism with the users by reverse auction, in which users submit bid information to the datacenter voluntarily and the datacenter selects some users by analyzing the optimal choice


## 2.1. Taking a Game-Theoretic Approach to Participate in Demand Response

Zhou et al. [15] used the real-time electricity price as a demand response signal in the deregulated electricity market and modeled the datacenter decisions on power company selection and workload scheduling as a many-to-one game model. This algorithm not only improves the revenue of power companies but also reduces the average contract cost of the datacenter. They turned the game problem into an easy-to-solve mixed-integer linear programming problem for solving. In [16], the authors adopted time-varying rewards to motivate the willingness of users to participate in demand response projects. They used a game theory framework to model the game between a single datacenter and its users. In addition, they extended the proposed strategy by combining two demand response strategies: server shutdown and local renewable energy generation. Zhou et al. [17] aimed at the two-way electricity flow between smart grids and datacenters with hybrid green energy generation capability and geo-distributed nature of large cloud system; they proposed a pricing scheme designed for geo-distributed green datacenters from a multileader single-follower game point of view. At the cloud side, in quest for scalability, robustness, and performance, the energy cost minimization problem is solved in a distributed manner, based on the technique of alternating direction method of multipliers. Bahrami et al. [18] considered the real-time pricing (RTP) and modeled the decisions of datacenters select utility company and workload scheduling as a many-to-one matching game with externalities. They developed a distributed algorithm that guarantees converging to a stable outcome.Through the analysis of the above pieces of literature, these studies are basically to establish a game model between the datacenter and the power company. Finally, they proposed an effective algorithm and obtained an equilibrium solution.


## 2.2. Participating in Demand Response by Geographic Load Balancing

Wang et al. [19] proposed a price-based incentive method. In order to motivate users to participate in their demand response projects, power companies set different power prices in different datacenters, encouraging users to shift the load to datacenters with lower electricity prices. Wang and Ye [20] regarded the datacenter operations as a problem of minimizing energy costs. They designed a distributed demand response algorithm. Administrators send optimized messages by broadcasting messages to each datacenter, and then each datacenter itself optimizes towards its own objective. Tran et al. [21] studied the distributed datacenter demand response method and proposed a two-stage pricing scheme based on the Stackelberg game. Each power company maximizes its profit by setting real-time prices in the first stage. In the second phase, the datacenter service provider uses workload shifting and dynamic server allocation to minimize its costs according to the electricity price. Liu et al. [22] thought predicted-based pricing is an appealing market design and showed that it outperforms more traditional supply function bidding mechanisms in situations where market power is an issue. These researches started with electricity prices from power companies and proposed incentive methods or other demand response methods for achieving the objective of reducing electricity costs in datacenters. Chau and Yang [23] took the advantage of the electricity price varying by region; they proposed a competitive online algorithm to achieve the load balance that can be applied to a limited time range and small-to-medium-scale energy storage. Liu et al. [24] explored the feasibility of using fully renewable energy to power Internet-scale systems. They conducted a trace-based study to assess three issues related to achieving this goal: the impact of geographic load balancing, the role of storage, and the optimal combination of renewable energy. Rao et al. [25] aimed at the location and time diversity of the electricity prices; they studied the issue of minimizing the total electricity cost in multiple electricity market environments while ensuring service quality. They modeled the problem as a constrained mixed-integer programming to solve.


## 2.3. Combining Multiple Methods to Participate in Demand Response

Guo et al. [26] aimed at the problem of a serious carbon footprint that resulted from using a backup diesel generator to supply power when datacenter participates in demand response. They focused on the effective and environment-friendly demand response of the datacenter. By designing economic incentives, they encourage tenants to reduce the load of the emergency demand response (EDR) in emergency situations and use the Nash equilibrium theory to analyze the relationship between datacenter operators and tenants. Chen et al. [27] argued that datacenters had the ability to provide large capacity reserves to emerging smart grid programs and, thus, provided opportunities for sustainable datacenter growth and cost savings as well as more flexibility for the grid. Therefore, they proposed policies to deliver datacenter demand response for peak shaving, regulation services, and frequency control programs. Cupelli et al. [28] combined the datacenter heating, ventilation, and air-conditioning equipment and delayed IT load and battery storage systems to coadjust the demand response projects. They proposed an optimization framework based on MPC (Model Predictive Control) forecasting to ensure the reliable operation of the datacenter and also analyzed the cost reduction in the case of incentives and prices. Paul et al. [29] considered that different types of jobs are distributed in different layers of the datacenter server, and, in particular, some of them can be delayed. They proposed rolling scheduling based on Receding Horizon Control (RHC). Based on the discrete-time model, they used two different methods to formulate and solve the optimal server configuration problem: minimizing operating costs and jointly minimizing capital and operating costs between service configurations at different layers. In [30], they took into account the risk of energy demand and core business processes of the datacenter in participating in demand response process, and they used a genetic heuristic algorithm for energy consumption prediction. Guo et al. [31] proposed a coordinated management method and model for datacenter computing and cooling load. In the datacenter energy supply system with distributed photovoltaic power generation, they established a datacenter energy supply system under the time-of-use electricity price environment to respond to demand with the goal of minimizing the cost of electricity consumption. In response to the economic demand response of the custodian, they [32] proposed a reward-reduction incentive mechanism, which reflects the interaction between the DRP (demand response provider) of custodian compensation to the custodian and the colocation operator reward to tenants. Chen et al. [33] proposed a pricing mechanism for mandatory and voluntary EDR (emergency demand response) projects, which is a parameterized supply function based on bidding, both when tenants are price-taking and when they are price-anticipating.Overall, some of the previous works only considered the power adjustment of the datacenter as a holistic entity to participate in demand response, and a lot of them were realized by the mutual transfer of load between geographically distributed datacenters. In addition, some researchers designed game-theoretic models between the datacenter and the power grid and sought to find an equilibrium solution between them. Considering the emergency of sending demand response signals, we adopt forecasting methods to obtain demand response signals in advance in order to schedule the tasks of the datacenter in time. In this paper, we design a two-stage decision strategy to make the datacenter participate in demand response. Compared with prior research work, the main contributions of this paper include the following:Establishing interactions between the smart grid, the datacenter, and the users and designing a two-stage decision process to participate in DRPredicting DR requirements by following real-time electricity price variation in the first interaction stage and designing a corresponding incentive mechanismDesigning the second stage of the datacenter interaction mechanism with the users by reverse auction, in which users submit bid information to the datacenter voluntarily and the datacenter selects some users by analyzing the optimal choice


## 3. System Architecture and Problem Modeling

In this section, we mainly introduce the interaction between the grid, the datacenter, and the users. We aim at the problem of datacenter participating in demand response to establish the optimization problem. Figure1 shows the interaction between the smart grid, the datacenter, and the users. The grid sends demand signals and incentive information at some unspecific moments. Then, the datacenter selects users according to their bidding information and postpones tasks of selected users after receiving the demand response signals from the smart grid. Assume that the datacenter consists of N hosts, denoted as host 1 to host N. We also assume the electricity price at time t is σt$/Wh and the revenue brought by executing a task is γ$.Figure 1
Interaction between the smart grid, the datacenter, and users.


### 3.1. Grid Side

As shown in Figure1, the operations of the grid side include sending DR signals, incentive information, and charging electricity bills to datacenters. In this paper, we use the variation of real-time electricity prices to determine the moment of demand response.Generally, smart grids propose incentive methods in order to attract more users to participate in demand response programs for balancing the supply and demand for electricity. Considering that the datacenter (DC) participates in demand response, the grid side should give the datacenter a certain reward based on the behavior of DC. In general, the rewards given to users participating in demand response by the power grid are calculated according to the execution rate of power reduction. We define a parameter of execution rate to reflect the degree of datacenter participation in DR. Here, we use the average value of the power consumption of the datacenter at each time slot in the past 5 days as the reference valuepbase. If the actual power consumption reduction after the DC participates in the demand response is pred, then the execution rate is defined as re=pred/pbase. We refer to the reward method proposed in [34] and define the reward at time t as equation (1), denoted as θ (t), wherein the baseline is a constant which is a base value preset for rewards:(1)θt=re⋅baseline,0≤re<1,baseline,re≥1.


### 3.2. User Side

From the perspective of datacenter users, they can voluntarily decide whether to participate in the demand response or not. Here we consider two types of tasks, including interactive workloads and batch workloads, respectively. At each time slot, users submit tasks to the datacenter, including the tasks that need to be responded immediately (interactive tasks) and the tasks that can be postponed to process (batch-type tasks). DenoteIu (t) and Bu (t) as the number of interactive-type tasks and batch-type tasks, respectively, which are submitted at time slot t by user u. Furthermore, we divided batch-type tasks into two categories, including delay-sensitive and delay-insensitive tasks according to the time that can be delayed. Specifically, delay-sensitive tasks can be postponed for 4 time intervals, and delay-insensitive tasks can be postponed for 8 time intervals.If the user decides to participate in the demand response, he/she can submit the bid information defined as a tuple consisting of the number of task candidates and the corresponding charge, denoted as <ϕut,t′, αut>. Specifically, the first element ϕut,t′ denotes the number of tasks that can be delayed to process from time t to t′ and the second element αut denotes the expected charge resulting from postponing these tasks of user u. We use a binary variable xu,t to record whether the user u wins the bid at the current time slot, which indicates that user u is selected or not.


### 3.3. Datacenter Side

As stated previously, the datacenter can be regarded as a large load of the smart grid and could participate in demand response programs provided by the grid. From the perspective of the datacenter, effectively scheduling tasks submitted by its users could be a useful means to help it adjust its own power consumption. This can also help the datacenter owner to reduce the electricity cost.In general, datacenter should guarantee the QoS (quality of service) of users when datacenter processes the requests of users. In this section, we define a penalty model for the datacenter if it proactively postponed the execution of the user tasks. In other words, if tasks submitted by users are postponed due to the datacenter participation in the DR programs, the datacenter should pay the users for the delay. We adopted the penalty model adopted in [35], using tsub and texec to represent the submission time and the actual execution time of the task, respectively. Then, the penalty for delaying task i can be defined as follows:(2)μi=texec−tsub⋅β,where β is a constant factor used to reflect the penalty.Hence, denoteπt and ruser(t) as the number of tasks that violate the QoS restriction and the total fee paid to users by the datacenter, respectively. Therefore, ruser(t) consists of the penalty due to the postponed tasks in order to respond to the DR signal and it can be calculated as(3)rusert=∑i=1πtμi.In addition, in the process of the datacenter interacting with its users, the datacenter needs to pay the users who actively bid the cost and are willing to participate in demand response. Then, the total chargeωt of datacenter that needs to pay for the users can be calculated as(4)ωt=∑u=1mαut⋅xu,t.In general, computing power consumption is the dominant part of the total datacenter power consumption [36], which is mainly related to the utilization ratio of the computing devices. Denote Pnt as the computing power consumption of host n in the tth slot. Here, we use a linear calculation method to calculate power consumption [37], as shown in the following equation:(5)Pnt=Pnmaxc+1−c⋅un,t,where Pnmax is the maximum power consumption of the server, c is the percentage of static power consumption, and un,t is the CPU utilization of the server n at time t. Hence, the total power consumption of datacenter at time t can be calculated as(6)Pt=∑n=1NPnt.


### 3.4. Establishment of the Optimization Problem

Hence, the total cost of datacenter consists of the penalty due to the postponed tasks in order to respond to the DR signal, the cost paid to some users who actively bid, the revenue from performing tasks, and the energy charge. Therefore, the total cost of the datacenter at time slott can be calculated as follows:(7)Ct=Et⋅σt+rusert+ωt−λt⋅γ−θt,where λt and Et represent the total amount of tasks that need to be executed at time t and energy consumption of datacenter at time slot t, respectively.Overall, the target optimization problem is to minimize the cost of datacenter under certain constraints, as shown in equations (9) and (10), wherein equation (9) means that the total reward asked by the users for postponing their tasks should be less than the revenue brought by finishing these tasks and equation (10) limits the valid range of the variables.(8)minimizeCt(9)subjectto∑u=1mαut⋅xu,t<=∑u=1mϕut,t′⋅γ,(10)xu,t∈0,1,0≤t≤τ,u=1,2,…,m.The notations used throughout this paper are listed in Table1.Table 1
Parameter notations.
SymbolDescriptionNThe number of hosts in datacentersτThe number of time slotsσtThe electricity price at time slottγThe revenue of a task executed by the datacenterpbaseBasic power consumptionpredThe actual power consumption reductionreThe execution rate when participating in DRθtThe reward is given to datacenters by the grid at time slottμiThe penalty of violating the QoS of taskitexecThe execution time of a tasktsubThe submission time of a taskβThe penalty factorPntThe power consumption of hostn at time slot tPnmaxThe maximum power consumption of hostncThe percentage of static power consumptionUn,tThe CPU utilization of hostn at time slot tPtThe total power consumption of datacenter at time slottEtThe total energy consumption of datacenter at time slottIutThe number of interactive tasks submitted at time slott by user uButThe number of batch-type tasks submitted at time slott by user uϕut,t′The number of tasks from useru that can be delayed to process from time t to t′αutThe charge resulted from postponing the execution of some tasks from useru at time slot txu,tA binary variable indicating useru is selected or not at time slot tδtThe number of batch-type tasks executed at timetλtThe total number of tasks needed to be processed at time slottπtThe number of tasks that violate QoS at time slottruser(t)The reward given to the users by the datacenter at time slott


## 3.1. Grid Side

As shown in Figure1, the operations of the grid side include sending DR signals, incentive information, and charging electricity bills to datacenters. In this paper, we use the variation of real-time electricity prices to determine the moment of demand response.Generally, smart grids propose incentive methods in order to attract more users to participate in demand response programs for balancing the supply and demand for electricity. Considering that the datacenter (DC) participates in demand response, the grid side should give the datacenter a certain reward based on the behavior of DC. In general, the rewards given to users participating in demand response by the power grid are calculated according to the execution rate of power reduction. We define a parameter of execution rate to reflect the degree of datacenter participation in DR. Here, we use the average value of the power consumption of the datacenter at each time slot in the past 5 days as the reference valuepbase. If the actual power consumption reduction after the DC participates in the demand response is pred, then the execution rate is defined as re=pred/pbase. We refer to the reward method proposed in [34] and define the reward at time t as equation (1), denoted as θ (t), wherein the baseline is a constant which is a base value preset for rewards:(1)θt=re⋅baseline,0≤re<1,baseline,re≥1.


## 3.2. User Side

From the perspective of datacenter users, they can voluntarily decide whether to participate in the demand response or not. Here we consider two types of tasks, including interactive workloads and batch workloads, respectively. At each time slot, users submit tasks to the datacenter, including the tasks that need to be responded immediately (interactive tasks) and the tasks that can be postponed to process (batch-type tasks). DenoteIu (t) and Bu (t) as the number of interactive-type tasks and batch-type tasks, respectively, which are submitted at time slot t by user u. Furthermore, we divided batch-type tasks into two categories, including delay-sensitive and delay-insensitive tasks according to the time that can be delayed. Specifically, delay-sensitive tasks can be postponed for 4 time intervals, and delay-insensitive tasks can be postponed for 8 time intervals.If the user decides to participate in the demand response, he/she can submit the bid information defined as a tuple consisting of the number of task candidates and the corresponding charge, denoted as <ϕut,t′, αut>. Specifically, the first element ϕut,t′ denotes the number of tasks that can be delayed to process from time t to t′ and the second element αut denotes the expected charge resulting from postponing these tasks of user u. We use a binary variable xu,t to record whether the user u wins the bid at the current time slot, which indicates that user u is selected or not.


## 3.3. Datacenter Side

As stated previously, the datacenter can be regarded as a large load of the smart grid and could participate in demand response programs provided by the grid. From the perspective of the datacenter, effectively scheduling tasks submitted by its users could be a useful means to help it adjust its own power consumption. This can also help the datacenter owner to reduce the electricity cost.In general, datacenter should guarantee the QoS (quality of service) of users when datacenter processes the requests of users. In this section, we define a penalty model for the datacenter if it proactively postponed the execution of the user tasks. In other words, if tasks submitted by users are postponed due to the datacenter participation in the DR programs, the datacenter should pay the users for the delay. We adopted the penalty model adopted in [35], using tsub and texec to represent the submission time and the actual execution time of the task, respectively. Then, the penalty for delaying task i can be defined as follows:(2)μi=texec−tsub⋅β,where β is a constant factor used to reflect the penalty.Hence, denoteπt and ruser(t) as the number of tasks that violate the QoS restriction and the total fee paid to users by the datacenter, respectively. Therefore, ruser(t) consists of the penalty due to the postponed tasks in order to respond to the DR signal and it can be calculated as(3)rusert=∑i=1πtμi.In addition, in the process of the datacenter interacting with its users, the datacenter needs to pay the users who actively bid the cost and are willing to participate in demand response. Then, the total chargeωt of datacenter that needs to pay for the users can be calculated as(4)ωt=∑u=1mαut⋅xu,t.In general, computing power consumption is the dominant part of the total datacenter power consumption [36], which is mainly related to the utilization ratio of the computing devices. Denote Pnt as the computing power consumption of host n in the tth slot. Here, we use a linear calculation method to calculate power consumption [37], as shown in the following equation:(5)Pnt=Pnmaxc+1−c⋅un,t,where Pnmax is the maximum power consumption of the server, c is the percentage of static power consumption, and un,t is the CPU utilization of the server n at time t. Hence, the total power consumption of datacenter at time t can be calculated as(6)Pt=∑n=1NPnt.


## 3.4. Establishment of the Optimization Problem

Hence, the total cost of datacenter consists of the penalty due to the postponed tasks in order to respond to the DR signal, the cost paid to some users who actively bid, the revenue from performing tasks, and the energy charge. Therefore, the total cost of the datacenter at time slott can be calculated as follows:(7)Ct=Et⋅σt+rusert+ωt−λt⋅γ−θt,where λt and Et represent the total amount of tasks that need to be executed at time t and energy consumption of datacenter at time slot t, respectively.Overall, the target optimization problem is to minimize the cost of datacenter under certain constraints, as shown in equations (9) and (10), wherein equation (9) means that the total reward asked by the users for postponing their tasks should be less than the revenue brought by finishing these tasks and equation (10) limits the valid range of the variables.(8)minimizeCt(9)subjectto∑u=1mαut⋅xu,t<=∑u=1mϕut,t′⋅γ,(10)xu,t∈0,1,0≤t≤τ,u=1,2,…,m.The notations used throughout this paper are listed in Table1.Table 1
Parameter notations.
SymbolDescriptionNThe number of hosts in datacentersτThe number of time slotsσtThe electricity price at time slottγThe revenue of a task executed by the datacenterpbaseBasic power consumptionpredThe actual power consumption reductionreThe execution rate when participating in DRθtThe reward is given to datacenters by the grid at time slottμiThe penalty of violating the QoS of taskitexecThe execution time of a tasktsubThe submission time of a taskβThe penalty factorPntThe power consumption of hostn at time slot tPnmaxThe maximum power consumption of hostncThe percentage of static power consumptionUn,tThe CPU utilization of hostn at time slot tPtThe total power consumption of datacenter at time slottEtThe total energy consumption of datacenter at time slottIutThe number of interactive tasks submitted at time slott by user uButThe number of batch-type tasks submitted at time slott by user uϕut,t′The number of tasks from useru that can be delayed to process from time t to t′αutThe charge resulted from postponing the execution of some tasks from useru at time slot txu,tA binary variable indicating useru is selected or not at time slot tδtThe number of batch-type tasks executed at timetλtThe total number of tasks needed to be processed at time slottπtThe number of tasks that violate QoS at time slottruser(t)The reward given to the users by the datacenter at time slott


## 4. Strategies and Methods

To address the issue mentioned in Section3, we proposed a two-stage decision process to participate in DR for cost reduction of datacenter and peak load shaving of the power grid and also implemented two other methods for comparison.


### 4.1. Two-Stage Decision Process (OP)

In this subsection, we will show in detail the issues involved in the proposed two-stage approach.


#### 4.1.1. Stage I: The Interaction between the Grid and the Datacenter

The main goal of this stage is to improve grid reliability and reduce peak load pressure. At this stage, the grid will send DR signals based on the price of electricity. In order to allow grid users to have sufficient preparation time to adjust their own loads to participate in demand response, we adopt the method of predicting real-time electricity prices to send DR signals. The grid will send incentive information to electricity users according to equation (1) so as to attract more entities to participate in demand response.Since the datacenter might not know the accurate time when the DR request will arrive, forecasting techniques were used here to predict the coming of DR signals according to the real-time electricity price of the smart grid. Here, we use the neural network of long short-term memory (LSTM) network model to learn the characteristics of the real-time electricity price [38]. The model is a recurrent neural network trained using back-propagation time, and it can overcome the problem of gradient disappearance of traditional neural networks [39]. Moreover, LSTM uses four neural network layers and interacts with each other by a special method. Specifically, we use the historical real-time electricity price data of the previous k days to predict the data on the k+1 day.


#### 4.1.2. Stage II: The Interaction between the Datacenter and Its Users

At this stage, a reverse auction mechanism is employed for the interaction between the users and the datacenter. Users perform competitive bidding to the datacenter when the datacenter receives demand response signals. After the bidding process, the datacenter selects the winning users, pays the required fee to them, and reallocates the tasks of these users according to the auction results.(1) Reverse auction model. In this process, we regard the datacenter as the buyer and the users as the sellers. Each user u voluntarily submits bid information represented as a tuple <ϕut,t′,αut>. Then, the datacenter selects the winning users according to the objective function as shown in equation (8) while meeting the constraints shown in equation (9) and equation (10).After the auction between users and the datacenter, the tasks performed at DR periods will be rescheduled. The tasks can be shifted in the time dimension to reduce the electricity cost of datacenter. Denotem as the number of users who submit tasks to the datacenter at time t. Denote δt as the number of batch-type tasks executed at time t, including both the batch-type tasks submitted at time t and the batch-type tasks postponed from previous time slots, which can be calculated as(11)δt=∑u=1mBut−∑u=1mϕut,t′+∑u=1m∑tb=0t−1ϕutb,t⋅xu,t,where t′>t,tb<t.Denoteλt as the total amount of tasks that the datacenter needs to process at the time slot t, which can be calculated as(12)λt=∑u=1mIut+δt.(2) Solution. We adopt a stochastic searching algorithm based on the concept of the Genetic Algorithm (GA) to solve the optimization problem as defined in Section 3. GA is a kind of random parallel search algorithm based on the principles of natural selection and genetic genetics. It starts with randomly initializing the population, and after multiple iterations, it constantly generates individuals with higher fitness and finally obtains the optimal individual. We use binary encoding, where an example of chromosome representation is shown in Table 2. If a user wins the bid, the corresponding coding value is 1; otherwise it is 0. In the example shown in the table, u1 did not win the bidding but u2 won it.Table 2
Chromosome coding example.
Useru1u2u3u4u5Bidding situation01101In this method, the datacenter not only participates in the demand response at the first stage but also uses the reverse auction mechanism to reschedule tasks of users in the second stage. Users submit bidding information to the datacenter in a bidding manner, and then the datacenter selects the winning user by stochastic searching to find the close-to-optimal solution. At last, the datacenter can effectively participate in DR programs by actively interacting with the users and reschedule the workloads. The pseudocode of the datacenter decision in the user bidding process is shown as follows (Algorithm1).Algorithm 1: The process of the second stage.
Input:Iu(t), Bu(t), pbase, αut, ϕut,t′Output: the best individual ind_bestBegin(1)
Initialization(2)
InitializeM; pc; pm; I; newPop; P0; ind_best; i ← 1; j ← 1;(3)
whilei ≤ Ido(4)
forj = 1 to size(Pi) do(5)
evaluatef(indj) for Pi(6)
end for(7)
ind_best←the best individual(8)
while size(newPop) < Mdo(9)
if random(0, 1) < pcdo(10)
choose individualpar1, par2 from Pi(11)
determine the crossover point randomly(12)
crossoverpar1 and par2(13)
generate two new individualsx1, x2(14)
end if(15)
if random(0, 1) < pmdo(16)
choose individualpar3 from Pi(17)
mutatepar3 at a random point(18)
generate a new individualx3(19)
end if(20)
newPop←[newPop, x1, x2, x3](21)
end while(22)
i ← i + 1(23)
Pi←newPop(24)
end while(25)
returnind_bestEndIn Algorithm1, M is the population size, pc represents the crossover probability, pm is the mutation probability, I represents the iteration times and i is the evolutionary generation counter, P0 is the original population, ind_best is used to record the best individual, and newPop is the current population updated with new generated individuals during each round. f(x) is a function for calculating the fitness value, which is the opposite of the optimization objective as defined in equation (7). Line 5 evaluates the fitness value of each individual indj in population Pi and line 10 selects two individuals from the current population Pi according to roulette selection operation to generate two new individuals.Here we give on example to demonstrate the working process of the two-stage strategy. Assume that currently a DR moment is predicted through the decision in the first stage and 5 users (denoted asu1∼u5) have submitted their bidding information at this moment. Then, the datacenter will select winning users according to the bidding information submitted by the users based on Algorithm 1. In the selection process, assume that u1, u3, and u4 won, while u2 and u5 failed. In this case, the datacenter will postpone some deferrable tasks based on the task information submitted by u1, u3, and u4 with awards, while the tasks of u2 and u5 are still processed at the current time slot.


### 4.2. Best Effort (BS)

In this strategy, the datacenter makes its best effort to participate in DR programs of the grid by selectively delaying some tasks according to the needs of the datacenter. No auction or bidding mechanisms are employed here. Therefore, the datacenter might violate the QoS of the users and thus a certain penalty would be charged for delaying the execution of some user tasks arbitrarily regardless of the task characteristics. In other words, this strategy does not consider the active participation potential of the users and their other requirements.


### 4.3. Static Method (ST)

In this strategy, the datacenter does not participate in the demand response programs and just manages the workload as usual. For the datacenter, no particular actions will be performed after receiving DR signals.


## 4.1. Two-Stage Decision Process (OP)

In this subsection, we will show in detail the issues involved in the proposed two-stage approach.


### 4.1.1. Stage I: The Interaction between the Grid and the Datacenter

The main goal of this stage is to improve grid reliability and reduce peak load pressure. At this stage, the grid will send DR signals based on the price of electricity. In order to allow grid users to have sufficient preparation time to adjust their own loads to participate in demand response, we adopt the method of predicting real-time electricity prices to send DR signals. The grid will send incentive information to electricity users according to equation (1) so as to attract more entities to participate in demand response.Since the datacenter might not know the accurate time when the DR request will arrive, forecasting techniques were used here to predict the coming of DR signals according to the real-time electricity price of the smart grid. Here, we use the neural network of long short-term memory (LSTM) network model to learn the characteristics of the real-time electricity price [38]. The model is a recurrent neural network trained using back-propagation time, and it can overcome the problem of gradient disappearance of traditional neural networks [39]. Moreover, LSTM uses four neural network layers and interacts with each other by a special method. Specifically, we use the historical real-time electricity price data of the previous k days to predict the data on the k+1 day.


### 4.1.2. Stage II: The Interaction between the Datacenter and Its Users

At this stage, a reverse auction mechanism is employed for the interaction between the users and the datacenter. Users perform competitive bidding to the datacenter when the datacenter receives demand response signals. After the bidding process, the datacenter selects the winning users, pays the required fee to them, and reallocates the tasks of these users according to the auction results.(1) Reverse auction model. In this process, we regard the datacenter as the buyer and the users as the sellers. Each user u voluntarily submits bid information represented as a tuple <ϕut,t′,αut>. Then, the datacenter selects the winning users according to the objective function as shown in equation (8) while meeting the constraints shown in equation (9) and equation (10).After the auction between users and the datacenter, the tasks performed at DR periods will be rescheduled. The tasks can be shifted in the time dimension to reduce the electricity cost of datacenter. Denotem as the number of users who submit tasks to the datacenter at time t. Denote δt as the number of batch-type tasks executed at time t, including both the batch-type tasks submitted at time t and the batch-type tasks postponed from previous time slots, which can be calculated as(11)δt=∑u=1mBut−∑u=1mϕut,t′+∑u=1m∑tb=0t−1ϕutb,t⋅xu,t,where t′>t,tb<t.Denoteλt as the total amount of tasks that the datacenter needs to process at the time slot t, which can be calculated as(12)λt=∑u=1mIut+δt.(2) Solution. We adopt a stochastic searching algorithm based on the concept of the Genetic Algorithm (GA) to solve the optimization problem as defined in Section 3. GA is a kind of random parallel search algorithm based on the principles of natural selection and genetic genetics. It starts with randomly initializing the population, and after multiple iterations, it constantly generates individuals with higher fitness and finally obtains the optimal individual. We use binary encoding, where an example of chromosome representation is shown in Table 2. If a user wins the bid, the corresponding coding value is 1; otherwise it is 0. In the example shown in the table, u1 did not win the bidding but u2 won it.Table 2
Chromosome coding example.
Useru1u2u3u4u5Bidding situation01101In this method, the datacenter not only participates in the demand response at the first stage but also uses the reverse auction mechanism to reschedule tasks of users in the second stage. Users submit bidding information to the datacenter in a bidding manner, and then the datacenter selects the winning user by stochastic searching to find the close-to-optimal solution. At last, the datacenter can effectively participate in DR programs by actively interacting with the users and reschedule the workloads. The pseudocode of the datacenter decision in the user bidding process is shown as follows (Algorithm1).Algorithm 1: The process of the second stage.
Input:Iu(t), Bu(t), pbase, αut, ϕut,t′Output: the best individual ind_bestBegin(1)
Initialization(2)
InitializeM; pc; pm; I; newPop; P0; ind_best; i ← 1; j ← 1;(3)
whilei ≤ Ido(4)
forj = 1 to size(Pi) do(5)
evaluatef(indj) for Pi(6)
end for(7)
ind_best←the best individual(8)
while size(newPop) < Mdo(9)
if random(0, 1) < pcdo(10)
choose individualpar1, par2 from Pi(11)
determine the crossover point randomly(12)
crossoverpar1 and par2(13)
generate two new individualsx1, x2(14)
end if(15)
if random(0, 1) < pmdo(16)
choose individualpar3 from Pi(17)
mutatepar3 at a random point(18)
generate a new individualx3(19)
end if(20)
newPop←[newPop, x1, x2, x3](21)
end while(22)
i ← i + 1(23)
Pi←newPop(24)
end while(25)
returnind_bestEndIn Algorithm1, M is the population size, pc represents the crossover probability, pm is the mutation probability, I represents the iteration times and i is the evolutionary generation counter, P0 is the original population, ind_best is used to record the best individual, and newPop is the current population updated with new generated individuals during each round. f(x) is a function for calculating the fitness value, which is the opposite of the optimization objective as defined in equation (7). Line 5 evaluates the fitness value of each individual indj in population Pi and line 10 selects two individuals from the current population Pi according to roulette selection operation to generate two new individuals.Here we give on example to demonstrate the working process of the two-stage strategy. Assume that currently a DR moment is predicted through the decision in the first stage and 5 users (denoted asu1∼u5) have submitted their bidding information at this moment. Then, the datacenter will select winning users according to the bidding information submitted by the users based on Algorithm 1. In the selection process, assume that u1, u3, and u4 won, while u2 and u5 failed. In this case, the datacenter will postpone some deferrable tasks based on the task information submitted by u1, u3, and u4 with awards, while the tasks of u2 and u5 are still processed at the current time slot.


## 4.1.1. Stage I: The Interaction between the Grid and the Datacenter

The main goal of this stage is to improve grid reliability and reduce peak load pressure. At this stage, the grid will send DR signals based on the price of electricity. In order to allow grid users to have sufficient preparation time to adjust their own loads to participate in demand response, we adopt the method of predicting real-time electricity prices to send DR signals. The grid will send incentive information to electricity users according to equation (1) so as to attract more entities to participate in demand response.Since the datacenter might not know the accurate time when the DR request will arrive, forecasting techniques were used here to predict the coming of DR signals according to the real-time electricity price of the smart grid. Here, we use the neural network of long short-term memory (LSTM) network model to learn the characteristics of the real-time electricity price [38]. The model is a recurrent neural network trained using back-propagation time, and it can overcome the problem of gradient disappearance of traditional neural networks [39]. Moreover, LSTM uses four neural network layers and interacts with each other by a special method. Specifically, we use the historical real-time electricity price data of the previous k days to predict the data on the k+1 day.


## 4.1.2. Stage II: The Interaction between the Datacenter and Its Users

At this stage, a reverse auction mechanism is employed for the interaction between the users and the datacenter. Users perform competitive bidding to the datacenter when the datacenter receives demand response signals. After the bidding process, the datacenter selects the winning users, pays the required fee to them, and reallocates the tasks of these users according to the auction results.(1) Reverse auction model. In this process, we regard the datacenter as the buyer and the users as the sellers. Each user u voluntarily submits bid information represented as a tuple <ϕut,t′,αut>. Then, the datacenter selects the winning users according to the objective function as shown in equation (8) while meeting the constraints shown in equation (9) and equation (10).After the auction between users and the datacenter, the tasks performed at DR periods will be rescheduled. The tasks can be shifted in the time dimension to reduce the electricity cost of datacenter. Denotem as the number of users who submit tasks to the datacenter at time t. Denote δt as the number of batch-type tasks executed at time t, including both the batch-type tasks submitted at time t and the batch-type tasks postponed from previous time slots, which can be calculated as(11)δt=∑u=1mBut−∑u=1mϕut,t′+∑u=1m∑tb=0t−1ϕutb,t⋅xu,t,where t′>t,tb<t.Denoteλt as the total amount of tasks that the datacenter needs to process at the time slot t, which can be calculated as(12)λt=∑u=1mIut+δt.(2) Solution. We adopt a stochastic searching algorithm based on the concept of the Genetic Algorithm (GA) to solve the optimization problem as defined in Section 3. GA is a kind of random parallel search algorithm based on the principles of natural selection and genetic genetics. It starts with randomly initializing the population, and after multiple iterations, it constantly generates individuals with higher fitness and finally obtains the optimal individual. We use binary encoding, where an example of chromosome representation is shown in Table 2. If a user wins the bid, the corresponding coding value is 1; otherwise it is 0. In the example shown in the table, u1 did not win the bidding but u2 won it.Table 2
Chromosome coding example.
Useru1u2u3u4u5Bidding situation01101In this method, the datacenter not only participates in the demand response at the first stage but also uses the reverse auction mechanism to reschedule tasks of users in the second stage. Users submit bidding information to the datacenter in a bidding manner, and then the datacenter selects the winning user by stochastic searching to find the close-to-optimal solution. At last, the datacenter can effectively participate in DR programs by actively interacting with the users and reschedule the workloads. The pseudocode of the datacenter decision in the user bidding process is shown as follows (Algorithm1).Algorithm 1: The process of the second stage.
Input:Iu(t), Bu(t), pbase, αut, ϕut,t′Output: the best individual ind_bestBegin(1)
Initialization(2)
InitializeM; pc; pm; I; newPop; P0; ind_best; i ← 1; j ← 1;(3)
whilei ≤ Ido(4)
forj = 1 to size(Pi) do(5)
evaluatef(indj) for Pi(6)
end for(7)
ind_best←the best individual(8)
while size(newPop) < Mdo(9)
if random(0, 1) < pcdo(10)
choose individualpar1, par2 from Pi(11)
determine the crossover point randomly(12)
crossoverpar1 and par2(13)
generate two new individualsx1, x2(14)
end if(15)
if random(0, 1) < pmdo(16)
choose individualpar3 from Pi(17)
mutatepar3 at a random point(18)
generate a new individualx3(19)
end if(20)
newPop←[newPop, x1, x2, x3](21)
end while(22)
i ← i + 1(23)
Pi←newPop(24)
end while(25)
returnind_bestEndIn Algorithm1, M is the population size, pc represents the crossover probability, pm is the mutation probability, I represents the iteration times and i is the evolutionary generation counter, P0 is the original population, ind_best is used to record the best individual, and newPop is the current population updated with new generated individuals during each round. f(x) is a function for calculating the fitness value, which is the opposite of the optimization objective as defined in equation (7). Line 5 evaluates the fitness value of each individual indj in population Pi and line 10 selects two individuals from the current population Pi according to roulette selection operation to generate two new individuals.Here we give on example to demonstrate the working process of the two-stage strategy. Assume that currently a DR moment is predicted through the decision in the first stage and 5 users (denoted asu1∼u5) have submitted their bidding information at this moment. Then, the datacenter will select winning users according to the bidding information submitted by the users based on Algorithm 1. In the selection process, assume that u1, u3, and u4 won, while u2 and u5 failed. In this case, the datacenter will postpone some deferrable tasks based on the task information submitted by u1, u3, and u4 with awards, while the tasks of u2 and u5 are still processed at the current time slot.


## 4.2. Best Effort (BS)

In this strategy, the datacenter makes its best effort to participate in DR programs of the grid by selectively delaying some tasks according to the needs of the datacenter. No auction or bidding mechanisms are employed here. Therefore, the datacenter might violate the QoS of the users and thus a certain penalty would be charged for delaying the execution of some user tasks arbitrarily regardless of the task characteristics. In other words, this strategy does not consider the active participation potential of the users and their other requirements.


## 4.3. Static Method (ST)

In this strategy, the datacenter does not participate in the demand response programs and just manages the workload as usual. For the datacenter, no particular actions will be performed after receiving DR signals.


## 5. Experimental Results and Analysis

In order to verify the effectiveness of the proposed method, we used theCloudSim Plus tool [40] to simulate the interaction between the datacenter and its users. The datacenter used in our experiment consists of 2000 hosts, and we assume that the number of users is 10. The detailed parameters settings are shown in Table 3. In the experiment, we simulate a whole day (24 hours) and divide it into 24 slots. The data of real-time electricity price is derived from the website [41].Table 3
Parameter settings.
BaselineγβKN50000.91.2312000In the experiment, we adopt theGoogle-trace workload for simulation [42], and we assigned tasks to 10 users. During data processing, we use the Pandas [43] library of the Python [44] language to process and statistics of the workload data of Google-trace in the task-usage file. Tasks contain two categories, interactive-type and batch-type tasks, with a ratio of 1 : 1.5 [45]. Moreover, batch-type tasks are further divided into two types, delay-sensitive and delayed-insensitive tasks, respectively, which are delay-tolerant if being postponed for 4 time slots and 8 time slots. Figure 2 shows the detail of tasks used in the experiment, wherein the blue part represents interactive tasks, and the green part and yellow part represent delay-sensitive tasks and delay-insensitive tasks, respectively.Figure 2
The number of tasks used in the experiment.In our work, as stated in Section3.1, the method of calculating the execution rate defined in this paper is based on the historical power consumption of the datacenter. Hence, we use the average power value of the 5-day historical data in Google-trace as the base value used for calculating the execution rate. Figure 3 shows the detailed average power consumption.Figure 3
Average power consumption of the datacenter in past 5 days.


### 5.1. Forecasting Electricity Prices

Since the DR signal is usually sent from the smart grid according to the variation of the electricity loads, in order to proactively participate in demand response, we attempted to predict the electricity price ahead to prepare for better scheduling. Here, the electricity price data used in the following experiments derives from power companies [41]. We use the historical data of January 2018 as a training set to predict the real-time electricity price situation on 1 February and use the LSTM time series prediction model for forecasting. We use the AdaDelta optimizer; the number of iterations is 100. We also combined machine learning scikit-learn library for data normalization and training. The forecasting result is shown in Figure 4, and the error rate is basically kept within 10%. It can be clearly found that there are six peak electricity price moments, which are 6: 00, 7: 00, 17: 00, 18: 00, 19: 00, and 20: 00, respectively. In the experiment, DR signals are sent during these six moments.Figure 4
Forecasting the electricity price.


### 5.2. Task Scheduling Details

Figure5 shows the task scheduling conditions under the three strategies. As mentioned, under ST strategy, the datacenter just ignored the DR signals and did not perform any particular task-scheduling actions. Compared with the ST method, under BS and OP, there were fewer tasks processed during DR moments, including 6 : 00–7:00 and 17 : 00–20 : 00. This is because the datacenter actively reacted to the DR signals in the first stage and conducted task scheduling. Although the BS strategy can reduce the execution of tasks at the DR time, the datacenter may be punished by reducing the execution of some tasks. This is because the BS strategy does not consider whether the task can be postponed. For example, delaying interactive task execution will violate the QoS of tasks and result in a penalty.Figure 5
Task execution under three strategies.Here, in order to prove that the OP strategy can indeed give a better response at the peak electricity price, we define a parameter PTA (peak average tasks to average tasks of all time slots) to measure the response situation of the three methods. Here, in our experiments, PTA is calculated as the average load at the moment of demand response periods divided by the average load of the entire day. Figure6 shows the PTA value of the three strategies. Compared to the BS strategy, the PTA under the OP strategy is the lowest, which can show that the proposed OP strategy can achieve a better goal of participating in demand response and reduce load pressure during peak hours of the grid.Figure 6
The PTA values under three different strategies.


### 5.3. Power Consumption Condition

Figure7 shows the detailed power consumption of the datacenter at each moment. The red-dashed line represents the variation of the real-time electricity price from the grid. There are two peak electricity price periods. It can be seen from the figure that the power consumption has been reduced under the BS and OP strategies during the time period of peak electricity prices, including 6 : 00–7:00 and 17 : 00–20 : 00. Results also showed that OP could lead to the largest reduction of power consumption compared with the other two strategies.Figure 7
Hourly power consumption of the datacenter.


### 5.4. Revenues and Costs of the Datacenter

We also examined the detailed situation of the revenues and costs during the two-stage demand response actions conducted by the datacenter. As shown in Figure8(a), the red pillar represents the fee paid by the datacenter to the users who win the bidding in reverse auctions under the OP strategy. In comparison, the blue pillars are the penalty in the BS strategy due to the postponed tasks submitted by the users, which resulted from the datacenter DR decisions. In other words, the datacenter delayed some of the interactive tasks so that their QoS was violated. Therefore, the datacenter could pay the users less money using the OP strategy than the BS strategy, since the penalties were reduced by means of the second-stage auction mechanism. Figure 8(b) shows the rewards given to the datacenter from the smart grid during the periods of demand response. It can be obviously seen that the rewards under the OP strategy are higher than the BS strategy, which means that under the OP strategy the DR execution rate is higher.Figure 8
Detailed penalties and rewards in DR periods. (a) The rewards/penalties given to users by the datacenter. (b) The rewards given to the datacenter by the smart grid.
(a)(b)Figure9 shows the costs and rewards paid between the smart grid and the datacenter. As shown in Figure 9(a), from the results of the electricity cost under the three strategies, it can be seen that ST leads to the highest electricity cost, while the OP strategy leads to the lowest cost. This is because the OP strategy actively participates in the demand response at the moments when the electricity price is relatively high. In particular some tasks are postponed until the time when the electricity price is low, so the OP strategy leads to the lowest electricity costs. Figure 9(b) shows the rewards paid to the datacenter from the smart grid due to its participation in the demand response. It can be observed that the OP strategy has the highest reward. This is because the execution rate of the OP strategy was relatively high, which indicates that the demand response participation was effective and could bring revenue for the datacenter.Figure 9
Electricity costs and total rewards of the three strategies. (a) Electricity costs of the datacenter under the three strategies. (b) The total rewards received from smart grid.
(a)(b)Furthermore, Figure10 shows the total cost reduction of BS and OP compared to the ST strategy. It can be observed that they both reduced the total cost than ST, while OP brings much more reduction than BS. This is because the datacenter participated in the demand response, and some tasks were postponed for later execution during DR periods, thereby reducing the cost of electricity included in the total cost. Compared with the BS strategy, since the OP strategy used the reverse auction mechanism to negotiate with users, the penalty became less and the rewards obtained from the grid side could be higher. In contrast, the BS strategy resulted in higher penalties because the datacenter delayed the tasks without considering the requirements of users and thus violated their QoS. Overall, employing the OP strategy could minimize the total cost of the datacenter according to the above results and analysis.Figure 10
Cost reduction under three different strategies.In addition, we also analyzed the impact of the real-time electricity price forecasting results on datacenter participation in demand response when the training dataset size is in different settings. Figures11(a) and 11(b) show the forecasting results when the size k of the training set is 31 and 15, respectively, in which the average error in Figure 11(a) is within 10% and that in Figure 11(b) is within 25%. The DR moments can be accurately predicted when the size k of the training set is 31, so the datacenter can respond at the correct DR moments. However, when the training set size k is 15 and the iteration time is 20, the forecasting results are not very accurate. Under this setting, not all of the DR periods were predicted in advance. For example, the datacenter should respond to the demand response of the power grid at the two moments of 6 : 00 and 17 : 00, but it did not actually perform any actions because of the wrong judgment. This resulted in the datacenter not fully participating in DR program and being unable to effectively reduce its own electricity costs. From the results shown in Figure 11(c), we can obviously obtain that the total cost of the datacenter is the highest when there is no forecasting, while it is the least when the forecasting is accurate. This can prove that improving the accuracy of the DR signal prediction can reduce the total cost of the datacenter more.Figure 11
The total cost of the datacenter under different forecasting accuracies. (a, b) The forecasting results whenk is set to 31 and 15, respectively. (c) The total cost under different settings.
(a)(b)(c)


### 5.5. Algorithm Performance Evaluation

Figure12 shows the relationship between the iteration times and the convergence of the algorithm. In general, the faster the convergence speed of the algorithm is, the better the algorithm is considered, which can save the calculation execution time and in turn achieve high efficiency. From Figure 12, we can obtain that when the iteration times reach about 50 times, the optimal function value tends to be stable and get to the minimum. This illustrates that the method proposed in this paper is efficient for finding close-to-optimal solutions. As we know, datacenters usually have a very large number of processing requests at each moment. Therefore, using the proposed method to solve the problem is more efficient when the amount of requests becomes large.Figure 12
The relationship between the convergence and the iteration times.


## 5.1. Forecasting Electricity Prices

Since the DR signal is usually sent from the smart grid according to the variation of the electricity loads, in order to proactively participate in demand response, we attempted to predict the electricity price ahead to prepare for better scheduling. Here, the electricity price data used in the following experiments derives from power companies [41]. We use the historical data of January 2018 as a training set to predict the real-time electricity price situation on 1 February and use the LSTM time series prediction model for forecasting. We use the AdaDelta optimizer; the number of iterations is 100. We also combined machine learning scikit-learn library for data normalization and training. The forecasting result is shown in Figure 4, and the error rate is basically kept within 10%. It can be clearly found that there are six peak electricity price moments, which are 6: 00, 7: 00, 17: 00, 18: 00, 19: 00, and 20: 00, respectively. In the experiment, DR signals are sent during these six moments.Figure 4
Forecasting the electricity price.


## 5.2. Task Scheduling Details

Figure5 shows the task scheduling conditions under the three strategies. As mentioned, under ST strategy, the datacenter just ignored the DR signals and did not perform any particular task-scheduling actions. Compared with the ST method, under BS and OP, there were fewer tasks processed during DR moments, including 6 : 00–7:00 and 17 : 00–20 : 00. This is because the datacenter actively reacted to the DR signals in the first stage and conducted task scheduling. Although the BS strategy can reduce the execution of tasks at the DR time, the datacenter may be punished by reducing the execution of some tasks. This is because the BS strategy does not consider whether the task can be postponed. For example, delaying interactive task execution will violate the QoS of tasks and result in a penalty.Figure 5
Task execution under three strategies.Here, in order to prove that the OP strategy can indeed give a better response at the peak electricity price, we define a parameter PTA (peak average tasks to average tasks of all time slots) to measure the response situation of the three methods. Here, in our experiments, PTA is calculated as the average load at the moment of demand response periods divided by the average load of the entire day. Figure6 shows the PTA value of the three strategies. Compared to the BS strategy, the PTA under the OP strategy is the lowest, which can show that the proposed OP strategy can achieve a better goal of participating in demand response and reduce load pressure during peak hours of the grid.Figure 6
The PTA values under three different strategies.


## 5.3. Power Consumption Condition

Figure7 shows the detailed power consumption of the datacenter at each moment. The red-dashed line represents the variation of the real-time electricity price from the grid. There are two peak electricity price periods. It can be seen from the figure that the power consumption has been reduced under the BS and OP strategies during the time period of peak electricity prices, including 6 : 00–7:00 and 17 : 00–20 : 00. Results also showed that OP could lead to the largest reduction of power consumption compared with the other two strategies.Figure 7
Hourly power consumption of the datacenter.


## 5.4. Revenues and Costs of the Datacenter

We also examined the detailed situation of the revenues and costs during the two-stage demand response actions conducted by the datacenter. As shown in Figure8(a), the red pillar represents the fee paid by the datacenter to the users who win the bidding in reverse auctions under the OP strategy. In comparison, the blue pillars are the penalty in the BS strategy due to the postponed tasks submitted by the users, which resulted from the datacenter DR decisions. In other words, the datacenter delayed some of the interactive tasks so that their QoS was violated. Therefore, the datacenter could pay the users less money using the OP strategy than the BS strategy, since the penalties were reduced by means of the second-stage auction mechanism. Figure 8(b) shows the rewards given to the datacenter from the smart grid during the periods of demand response. It can be obviously seen that the rewards under the OP strategy are higher than the BS strategy, which means that under the OP strategy the DR execution rate is higher.Figure 8
Detailed penalties and rewards in DR periods. (a) The rewards/penalties given to users by the datacenter. (b) The rewards given to the datacenter by the smart grid.
(a)(b)Figure9 shows the costs and rewards paid between the smart grid and the datacenter. As shown in Figure 9(a), from the results of the electricity cost under the three strategies, it can be seen that ST leads to the highest electricity cost, while the OP strategy leads to the lowest cost. This is because the OP strategy actively participates in the demand response at the moments when the electricity price is relatively high. In particular some tasks are postponed until the time when the electricity price is low, so the OP strategy leads to the lowest electricity costs. Figure 9(b) shows the rewards paid to the datacenter from the smart grid due to its participation in the demand response. It can be observed that the OP strategy has the highest reward. This is because the execution rate of the OP strategy was relatively high, which indicates that the demand response participation was effective and could bring revenue for the datacenter.Figure 9
Electricity costs and total rewards of the three strategies. (a) Electricity costs of the datacenter under the three strategies. (b) The total rewards received from smart grid.
(a)(b)Furthermore, Figure10 shows the total cost reduction of BS and OP compared to the ST strategy. It can be observed that they both reduced the total cost than ST, while OP brings much more reduction than BS. This is because the datacenter participated in the demand response, and some tasks were postponed for later execution during DR periods, thereby reducing the cost of electricity included in the total cost. Compared with the BS strategy, since the OP strategy used the reverse auction mechanism to negotiate with users, the penalty became less and the rewards obtained from the grid side could be higher. In contrast, the BS strategy resulted in higher penalties because the datacenter delayed the tasks without considering the requirements of users and thus violated their QoS. Overall, employing the OP strategy could minimize the total cost of the datacenter according to the above results and analysis.Figure 10
Cost reduction under three different strategies.In addition, we also analyzed the impact of the real-time electricity price forecasting results on datacenter participation in demand response when the training dataset size is in different settings. Figures11(a) and 11(b) show the forecasting results when the size k of the training set is 31 and 15, respectively, in which the average error in Figure 11(a) is within 10% and that in Figure 11(b) is within 25%. The DR moments can be accurately predicted when the size k of the training set is 31, so the datacenter can respond at the correct DR moments. However, when the training set size k is 15 and the iteration time is 20, the forecasting results are not very accurate. Under this setting, not all of the DR periods were predicted in advance. For example, the datacenter should respond to the demand response of the power grid at the two moments of 6 : 00 and 17 : 00, but it did not actually perform any actions because of the wrong judgment. This resulted in the datacenter not fully participating in DR program and being unable to effectively reduce its own electricity costs. From the results shown in Figure 11(c), we can obviously obtain that the total cost of the datacenter is the highest when there is no forecasting, while it is the least when the forecasting is accurate. This can prove that improving the accuracy of the DR signal prediction can reduce the total cost of the datacenter more.Figure 11
The total cost of the datacenter under different forecasting accuracies. (a, b) The forecasting results whenk is set to 31 and 15, respectively. (c) The total cost under different settings.
(a)(b)(c)


## 5.5. Algorithm Performance Evaluation

Figure12 shows the relationship between the iteration times and the convergence of the algorithm. In general, the faster the convergence speed of the algorithm is, the better the algorithm is considered, which can save the calculation execution time and in turn achieve high efficiency. From Figure 12, we can obtain that when the iteration times reach about 50 times, the optimal function value tends to be stable and get to the minimum. This illustrates that the method proposed in this paper is efficient for finding close-to-optimal solutions. As we know, datacenters usually have a very large number of processing requests at each moment. Therefore, using the proposed method to solve the problem is more efficient when the amount of requests becomes large.Figure 12
The relationship between the convergence and the iteration times.


## 6. Conclusions and Future Work

In this paper, we proposed a two-stage datacenter demand response strategy towards the smart grid environment. The first stage is the interaction between the smart grid and the datacenter, which mainly includes the grid sending DR signals to the datacenter according to real-time electricity load. In the second stage, the datacenter interacts with its users by employing the reverse auction mechanism. Users submit bidding information to the datacenter, including the number of tasks that can be postponed and the corresponding charge for postponing these tasks. Then, the datacenter delays the execution of tasks of the winning users and pays the relevant fee after the bid selection. Simulation experiments illustrated that the strategy proposed in this paper could help the datacenter to reduce its total operational cost by effectively participating in demand response while facilitating the smart grid to shave the peak load and keep itself stable. Overall, the strategy proposed in this paper can adjust the power demand according to the DR signals to a certain extent. Therefore, the method can provide a way to help the sustainable development of power enterprises and also facilitate the decarbonization of the datacenters.As a next step in the future, we are planning to study the formulation of the smart grid incentive mechanism and demand response items for the datacenter load characteristics, so that datacenters can better participate in demand response while ensuring that datacenter users have a higher service quality. We also plan to develop a datacenter charging agreement for users based on demand response signals on the grid side. In this way, the datacenter and the grid benefit at the same time.



---

*Source: 5206082-2020-07-22.xml*