1. Introduction
The smart grid is the vision for enhancing the efficiency of electricity utilization from the production to end-user points, together with enabling consumer participation in the demand-side [
1,
2]. Along with the growing importance of the smart grid, smart households that can monitor the use of electricity in real time have also received more attention in recent years [
3]. With the widespread deployment of advanced metering infrastructure [
4], the two-way flow of electricity and real-time information is a remarkable feature of smart households, which offers numerous technical benefits and flexibilities to both utility providers and consumers. Those advantages include balancing supply and demand in a timely fashion and improving energy efficiency [
5].
An important way to improve the operation utility of households is through a Home Energy Management System (HEMS) [
6]. It is employed to collect data from household appliances using smart meters and sensors [
7] and then to optimize power supply and management with this information [
8,
9]. It is expected to guarantee economic efficiency and operation security in households. These functions make HEMS act as the “core” of smart households. However, there are some major challenges for HEMS to play a role. The forecasting error increases due to the highly variable and unpredictable nature of renewable resources [
10]. Furthermore, it is challenging to manage energy without the future knowledge of time-varying load requirements and electricity prices [
11]. Fast and effective energy regulation is needed to satisfy the increasing demand of real-time decisions.
HEMS has been receiving significant research attention over the past few years [
12]. Currently, the research about HEMS falls into two major categories. In the first kind of HEMS, the electricity demand curve of household load needs to be forecasted. A large number of historical data needs to be analyzed statistically; thus, the operational complexity is relatively high. In [
13], a non-intrusive load-monitoring technique is adopted to characterize the physical characteristics of household appliances based on historical data. The running time of appliances is further estimated. Additionally, the result is used for the power scheduling of enrolled appliances in order to save on electricity bills. In [
14], an autonomous appliance scheduling method is proposed for a single home. Time-of-use probabilities of each device are used to generate optimal operating schedules of appliances. In the calculation of probabilities, weather conditions, day of the week and penetration level of appliances need to be considered.
In the second kind of HEMS, instead of forecasting the operating schedules of appliances, users need to set the running time interval and preferred time interval for scheduling regularly. Therefore, this method is not suitable for situations of random demand. Besides, this kind of HEMS mostly adopts traditional optimization algorithms, which are of high computational complexity. Apart from the consumption demand, other uncertain factors still need to be predicted, such as prices, distributed generation, outdoor temperature, and so on. In [
15], a multi-objective mixed integer nonlinear programming model is developed for a single home. Additionally, the energy savings and a comfortable lifestyle are considered. Residents need to provide the running time range, the preferred time range for scheduling, the length of operation time and the estimated energy consumption. In [
16], an intelligent home energy management algorithm is proposed for residential consumers. The household appliances are managed according to their preset priority and the comfort demand of users. The homeowner should set the comfort preference, load priority and running time range of appliances. In [
17], an efficient scheduling method for household power usage is proposed to reduce electricity expenses and the power peak-to-average ratio. A genetic algorithm is adopted to solve the problem based on the combination of real-time pricing and the inclining block rate. It is necessary for residents to set the time parameters for appliances, such as the length of operation time, the operation time interval and the power consumption per hour. In [
18], game theory is adopted for residential load management to minimize the energy cost and the peak-to-average ratio. The electricity price adopts the forecasted value. Residents need to select the beginning and the end of a time interval in which appliances can be scheduled. In [
19], a home energy management controller is presented to reduce the electricity bill of consumers. The controller receives the forecasted outdoor temperatures and price signals as inputs. Users need to update the settings of appliances several times during a day, such as the preferred operation time interval of deferrable appliances, the power profile of non-flexible deferrable appliances, the required energy for flexible deferrable appliances, the preferred indoor temperature, and so on.
It can be seen that the existing research about HEMS is mostly based on the forecasting model and user intervention. As for the forecasting model, due to the strong randomness of the household load, the forecasting error of the load is relatively large [
20], which makes the optimal schedule difficult to carry out. As for the user intervention, HEMS with too many preset parameters cannot perform well under the random demand of occupants. Meanwhile, the manual intervention of occupants breaks the intelligence of HEMS and affects the comfort level of occupants. Therefore, an online [
21,
22] scheduling algorithm that does not rely on any future information and user intervention is highly desirable [
23].
In order to solve the above problems, an online [
24,
25,
26] energy management algorithm based on event triggering is proposed. In this algorithm, we tackle the home energy management problem with the Lyapunov optimization approach, which is a useful technique for solving stochastic network optimization, particularly in queueing systems [
27]. Our main contributions are summarized as follows:
An online energy management algorithm based on the Lyapunov optimization method is developed. It does not rely on any future information and could quickly regulate energy flow under the fluctuation of distributed generation, demand and price. The decision at each slot can be made by only using the current observations.
Occupants do not need to manually preset the operation time interval of appliances. The energy management is implemented without user intervention, which can deal with the random demand.
The event-triggering mechanism is adopted to decide when to execute the online energy management algorithm, which reduces the computational cost significantly. The time complexity of the algorithm is , which enables the algorithm to be applied in an embedded system and realizes the cost-effective management of smart households.
The rest of this paper is organized as follows.
Section 2 describes the research object and basic models. Some basic concepts of online energy management algorithms are introduced in
Section 3. In
Section 4, the online energy management algorithm is proposed. Case studies and the analysis of the results are presented in
Section 5. Finally, conclusions are given in
Section 6.
4. Online Energy Management Algorithm
4.1. Allocation Strategy of PV Power
PV power at every slot is set to first satisfy the demand of baseline load . Define as the excess PV power after meeting demand of . The excess PV power would be allocated to controllable load according to principles of priorities and the maximum delay limit. The order of precedence for PV power allocation is EWH, HVAC and PEV. The maximum delay limit of each appliance is set on the basis of their operation properties. The allocation strategy of excess PV power is described as follows.
(1) At every slot
t, the delay condition of controllable load is checked in the order of priority. The length of controllable load queues represents the uncompleted demand. The value of
is either zero or
. According to Equation (
13),
is composed of demand blocks
, which means that
is multiples of
. Thus,
can represent the delay time of the
i-th controllable load. If the delay time of the
i-th controllable load exceeds the limit,
i.e.,
, the appliance would get its corresponding PV energy
subject to the constraint Equation (
15). The process continues until all of the controllable appliances are checked or PV power has worn out.
(2) If PV power is still left after the first step, the excess energy would be used to satisfy all of the accumulated demand in queue backlog in order of priority.
Note that the maximum delay limit and priorities are only used in the allocation strategy of PV power and are irrelevant to the following strategy of scheduling controllable load.
4.2. Event-Triggering Mechanism
The event-triggering mechanism is implemented in the monitor and power controller. The monitor collects the information vector at a fixed rate and decides whether the triggering signal is generated to send to the power controller. Once the signal is received, the power controller will refresh its control actions, and the value of decision variables will be redetermined according to the current system state. Otherwise, decision variables will remain at the last value.
In terms of the event detection logic, the load scheduling process is affected by baseline load, controllable load, PV generation and electricity price. The monitor will generate a new signal to trigger the power controller if the following events occur.
The variation of baseline load exceeds a certain range.
At least one of the controllable load queues accumulates to a certain degree.
where
is the electricity consumption of the
i-th controllable load per time slot. Equation (
25) means that the demand of the
i-th controllable load has been piled up at least three times, and the power controller should be triggered to refresh its control actions.
The variation of PV output exceeds the accepted range.
The time-of-use electricity price changes.
Note that the above thresholds are chosen empirically through simulation tests. Large thresholds in the above events could decrease the triggering times and thus reduce the computational cost effectively. However, the performance of the algorithm would be affected, as the decision variables will remain at last value. If the last value is zero, the appliances would keep the “off” state, and thus, consumers would suffer from the excessive delay of controllable load. If the last value is , the appliances would keep the “on” state, which may incur a large penalty on the electricity cost. On the contrary, small thresholds could guarantee the timely execution of the algorithm, but increase the triggering times and make the event-triggering mechanism invalid. In practical applications, the thresholds in the events can be set as adjustable parameters, which are set according to consumer preferences and weather conditions.
A state machine is well designed to realize the event-triggering mechanism. Three states, “event monitoring”, “load scheduling” and “execution”, are involved. The “event monitoring” state is at the beginning of the loop and is the most normal state of the state machine. Once one or more events are detected, the “load scheduling” state will be triggered to redetermine the operation status of controllable load. The “execution” state will then be triggered, and the instructions conveyed by the “load scheduling” state will be executed. After the execution is completed, it will go back to the “event monitoring” state and enter into the next time slot. The process is shown in
Figure 2.
4.3. Lyapunov Optimization
Define
as the concatenated vector of controllable load queues. Lyapunov function
is defined as a scalar measure of the congestion of all of the controllable load queues. Define the Lyapunov drift for slot
t:
where
is the expected variation of the Lyapunov function over a time slot, which represents the stability of queues. The expectation depends on the control actions of HEMS and is related to the random arrival of load demands from consumers.
Based on the drift-plus-penalty method in Lyapunov optimization [
44], an online energy management algorithm is designed in this paper. At every time slot, the current information vector
is observed. Based on the information acquired, the value of
is determined to minimize the drift-plus-penalty expression:
where the first item is Lyapunov drift, representing the queue stability. In the second item,
represents the importance weight, illustrating how much we emphasize the cost minimization of the
i-th controllable load. The rest of the second item is the cost incurred by the
i-th controllable load.
represents the tradeoff between stabilizing queues and minimizing the electricity cost. The physical meaning of
(kWh
/RMB) is the increment on the variation of the Lyapunov function when the electricity cost decreases by 1 RMB. It unifies the measurement of the two different physical quantities and scales the conversion from the cost to the drift.
is determined based on the power level of the
i-th controllable load and the user preference between cost and delay. If
, it corresponds to the pure system stability problem by minimizing the Lyapunov drift. Minimizing
alone would push all demand queues towards lower backlog, but would incur a large penalty on the cost. Therefore, the algorithm proposed in this paper minimizes the weighted sum of drift and penalty.
Lemma 2. (Drift bound) For any control policy that satisfies the constraints in Equation (20), the drift-plus-penalty expression satisfies:where the constant is defined as: Proof. A bound can be computed on the Lyapunov drift through its definition:
and thus,
can be defined as Equation (
31). Using Equation (
9) and Equation (
11), we have:
Adding the utility function to both sides, we thus have Equation (
30). The proof is concluded. ☐
The original problem Equation (
20) is transformed into the following problem by minimizing the right-hand side of Equation (
30).
The above problem can be further reduced to the following simple threshold rule:
It can be seen from Equation (
35) that Lyapunov optimization is relatively simple to implement compared to the traditional optimization method. It does not need
a priori statistical knowledge and only relies on the instant information about the system state at this moment. The complex energy management problem is transformed into a linear programming problem, which largely reduces the computational complexity. Furthermore, it has no curse of dimensionality and, hence, can be easily applied in extended formulations with multiple queues and multiple households. The overall flowchart of the proposed online energy management algorithm is shown in
Figure 3.
4.4. Optimality Analysis
The performance of the online energy management algorithm is analyzed in this section. Some conclusions of the optimality are given in the following theorem.
Theorem 3. Suppose that the system state is over time. If we use the proposed algorithm every slot t, then:
(1) The proposed algorithm stabilizes the system, which means that the controllable load queues are mean rate stable and the constraints of original problem Equation (20) are satisfied. (2) The time average expected cost under the proposed online algorithm is within of the optimal value. (3) Suppose there are constants and for which the Slater condition of Assumption 1 holds. Then:where and , are defined as . Proof. Since the system state
is assumed to be
over time and the related variables
,
,
and
are all bounded, the conclusion in Lemma 1 holds. At every slot
t, our implementation comes by minimizing the upper bound of the drift-plus-penalty expression. Plugging the conclusions of Lemma 1 into the right-hand-side of Equation (
30) yields:
Fix any slot
τ. Take expectations of both sides, and use the law of iterated expectations to yield:
Summing over
for some
and using the law of telescoping sums yields:
Rearranging terms and neglecting nonnegative terms when appropriate, the following inequality is obtained for all
:
Taking a limit as proves the conclusion in (2).
To prove the conclusion in (1), the following inequality is derived from Equation (
40).
where
. Using the definition of the Lyapunov function yields:
Therefore, for all
, we have:
Since the variance of
cannot be negative, we have
. Thus, for all slots,
.
Dividing both sides by tand taking a limit as
yields:
Thus, all controllable load queues are mean rate stable, proving the result in (1). To verify the conclusion in (3), Assumption 1 is presented as follows.
Assumption 1 (Slater Condition): There exist values
and
(where
) and a policy that only depends on the system state that satisfies:
Plugging the above condition into the right-hand side of the drift bound Equation (33) yields:
Taking iterated expectations, summing the telescoping series and rearranging terms yields:
However, the limiting time average expectation for
cannot be better than
:
Taking a limit of Equation (
49) as
and using Equation (
50) could yield Equation (
37). The proof is concluded. ☐
This theorem demonstrates the
performance-delay tradeoff, which proves that the optimal time average cost of Equation (
34) is within
of the optimal value of the original problem Equation (
20), with a corresponding
tradeoff in the average queue length. By choosing a larger
, the time average cost of the
i-th controllable load can get closer to the optimal value, with the penalty on the congestion of demand queues.