Research Article Study on Smart Home Energy Management System Based on Artificial Intelligence

With the increase of household electricity consumption and the introduction of distributed new energy sources, more attention has been paid to the issue of optimizing the cost of electricity purchase for household customers. An e ﬀ ective way to deal with these problems is through home energy management system (HEMS). In this paper, a model of home energy management is presented to optimize the home energy mix. The operation of home electricity consumption devices, distributed generation systems, and energy storage devices, as well as the charging and discharging of electric vehicles, are all considered. HEMS is a self-regulating system that can accommodate ﬂ uctuations in tari ﬀ s and home electricity consumption. The structure and the optimal scheduling algorithm of HEMS are introduced. The smart grid and demand response, smart home, new energy generation, energy storage, and other related technologies are discussed. Furthermore, the optimal scheduling of power consumption devices and energy sources in the HEMS and future development directions are explained and analyzed. A framework of HEMS is presented on the basis of advanced metering infrastructure (AMI). The framework adopts a local information management terminal as the core of data storage and scheduling in the home. Based on the timely purchase of electricity from the grid and the generation of electricity in combination with PV systems, an optimized simulation model for the scheduling of a new home energy management system is established. In addition, the application prospects of arti ﬁ cial intelligence in the HEMS are overviewed.


Introduction
Home energy management system (HEMS) is an intelligent network control system based on smart grid, smart home, and smart meters [1][2][3]. It integrates power generation, electricity consumption, and energy storage devices into a single system for management and control [4][5][6]. HEMS can improve the efficiency of household renewable energy and save electricity bills for customers [7,8]. The traditional power market lacks interaction with customers, and the electricity tariff form is single, resulting in the insufficient supply of electricity during peak hours, as well as wasted electricity in low hours. Subsequently, the peak and off-peak tariff mechanism is introduced, which plays a role in guiding customers to adjust the time of electricity consumption [9]. However, it is less flexible and cannot reflect the real rela-tionship between electricity consumption and supply. Moreover, HEMS can fully interact with the power grid to obtain accurate real-time price, cooperate with generation and load forecasting, perform an intelligent allocation of household energy, optimize the allocation of household load in the time dimension, achieve demand response on the customer side, relieve the pressure on the grid during peak hours, and improve the stability of grid [10]. HEMS is the minimal unit of smart grid, which is a new generation of information technologies such as Internet of Things, cloud computing, mobile Internet, and big data, combined with the household as a carrier to achieve a low-carbon, healthy, intelligent, comfortable, and safe family lifestyle [11,12]. By combining distributed power technologies such as household photovoltaic and energy storage, it flexibly controls various household appliances and realizes an intelligent mode of electricity and energy use. Currently, HEMS has been a hot research topic, and its optimization objectives contain the aspects such as economy, comfort, and load shedding.
Extensive research has been conducted to describe household electricity behavior and establish an intelligent model of household electricity, aiming for maximum peak load shedding and minimum electricity cost [13]. Alternatively, some studies consider the correlation between the use of home appliances and the optimization of household electricity behavior with the goal of minimizing electricity bills and maximizing comfort [14]. In addition to a variety of household appliances, there are scholars who investigate the impact of electric vehicles and energy storage devices in the optimization of smart homes, in order to propose a method of household energy that considers real-time control strategies for energy storage devices [15,16]. Although the above studies coordinate the consideration of smart home energy management with the charging and discharge strategies of energy storage devices, there are very few studies concerned with the rational allocation methods.
In this paper, the structure of HEMS is introduced and the optimal scheduling algorithm of HEMS is analyzed; smart grid and demand response, smart home, new energy generation, and energy storage technologies are discussed; and an analysis of the optimal scheduling of power consumption devices and energy in the HEMS is discussed. Furthermore, a framework for an advanced measurement infrastructure (AMI) is presented for HEMS. Based on the timely purchase of electricity from the grid and the generation of electricity from PV systems, an optimized simulation model for the scheduling of a new HEMS is developed. The prospects for the application of artificial intelligence in the HEMS are also discussed.

Operating Principle of HEMS
2.1. Structure of HEMS. HEMS is a system for the residential user side, which is based on technologies such as AMI, intelligent collection, and intelligent interaction. It is a household area network with smart devices like smart meters, smart sockets/switches, smart appliances and smart interactive terminals in the home [17]. Moreover, it can support the access of distributed energy, electric vehicles, and other devices and uses the local information management terminal as a bridge for comprehensive management of user information and information interaction with the main station, thus realizing the bidirectional interaction between grid and user, energy management, and other functions [18,19].
The bidirectional smart metering terminal is responsible for acquiring electricity generation and consumption information of the household. The mobile terminal supplies the function of interacting with users, which is responsible for acquiring electricity consumption settings of users and displaying household electricity consumption information. As the verification and control device of the HEMS, the local information management terminal is capable of communicating with the bidirectional smart meter and the mobile terminal, acquiring the necessary electricity and setting data, and integrating with the weather, demand response, and other information acquired from the external network to invoke the localized forecasting module and scheduling module to achieve intelligent control of household electricity consumption. Particularly, the scheduling module considers the impact of distributed generation and energy storage access in order to find the optimal control result.

AMI Architecture.
AMI is an open bidirectional communication platform, which is used to connect the system and power load and collect and manage grid data through electricity metering technology to achieve smart usage [20]. It provides customers with time-phased or instantaneous metering values, which improves the efficiency of equipment usage and supports the grid. AMI consists of four main components: smart meters, communication networks, measurement data management systems (MDMS), and home area network. AMI architecture is given in Figure 1.
MDMS is based on the main station and works in conjunction with the AMI Automatic Data Collection System to acquire and store metered values. After getting the data, validation, editing, and estimation are conducted through MDMS. It can provide the processed data to the required systems and ensure that the data stream from other systems is accurate and complete under communication disruptions and customer-side failures. By using the data provided by the MDMS, the utility can implement peak and off-peak tariffs, time-of-use tariffs, and a number of other complex billing methods.
The intelligence of smart meters is embodied in their programmable capability. Except for metering, smart meters also have functions such as compound rate metering, event recording, data storage, and bidirectional communication.
As the foundation of HEMS, it offers data support for home energy dispatch and customer demand-side response.
Bidirectional communication network is the bridge between the company and customer, which is responsible for reading the data of smart meter at regular intervals and sending the demand response information to the customer. PLC, RF, GPRS, and McWiLL are the common communication methods.
Home network is used to connect the intelligent control terminal, the intelligent power consumption equipment, and the intelligent electricity meter [21]. The intelligent control terminal can acquire all the information on electricity consumption and equipment status and send the results of electricity dispatch to the electricity equipment. Wireless communication is often used in the household. The common wireless communication methods are ZigBee, Wi-Fi, etc. ZigBee has greater advantages in power consumption, cost, and networking whereas Wi-Fi has relatively fast speed and can be directly connected to the Internet [22][23][24]. It has a wide range of applications in mobile networking devices. Journal of Sensors 2(b), respectively. The system consists of PV equipment, energy storage equipment, grid-connected inverter, and load. In this system, the photovoltaic panels are measured by a separate meter. The AC grid electricity consumption and the residual grid electricity are measured by a bidirectional meter. The appliance load can be monitored through a smart socket.

Home Energy Management Model
Household electrical appliances, in addition to room temperature heating and domestic hot water systems, can be divided into automatic of appliance (AOA) and manual of appliance (MOA). AOA refers to appliances that can be operated automatically without human intervention, such as washing machines and dishwashers. MOA means the devices that must be operated manually by the user, such as computers, TVs, and hoovers. Since MOAs are only suitable for manual switching, other electrical appliance strategies in the home are aimed at AOAs.

Photovoltaic Cell
Model. The output of power photovoltaic cell is a function of solar irradiance and temperature, and it can be obtained using the daily irradiance curve.
The output power can be expressed as follows: where P PV ðtÞ is the photovoltaic output, P STC is the maximum output under standard test conditions, GðtÞ is the current solar irradiance, G STC is the rated solar irradiance, k is the temperature coefficient, TðtÞ is the temperature of cell module at the current moment, T air ðtÞ is the ambient temperature, T STC is the rated reference temperature, and V W is the current wind speed.

Battery
Model. The battery model mainly regards the state during the charging and discharging process. The remaining capacity of battery is expressed as  3 Journal of Sensors where S SOC ðt + 1Þ is the next charge state, C r is the actual charge capacity, C N is the nominal charge capacity; S SOC ðtÞ is the current charge state, η ch is the battery charge efficiency; η dis is the battery discharge efficiency, P ch ðtÞ is the current charge power, P dis ðtÞ is the current discharge power, and P dis ðtÞ is the charge and discharge time.
Additionally, the life of battery is related to the depth of discharge and the number of cycles, where the life consumption D of lead-acid battery can be expressed as where S SOC ðiÞ is the state of charge when it is transferred from discharge to charge, which represents one discharge cycle.
The battery life parameter is obtained by fitting the number of cycle curves provided by its equipment manufacturer.

Load Model.
The loads in the HEMS can be divided into 4 categories in accordance with their control level as follows: (1) Temperature-controlled loads, which include air conditioners, water heaters, and refrigerators, with a certain degree of cooling or heat storage capacity (2) Active controllable loads, including washing machines and rice cookers, with a fixed working cycle and a certain flexibility of use time (3) Passive controllable loads, including lights and fans, which can be intelligently controlled but have inflexible operating hours (4) Noncontrollable loads 3.3.1. Air Conditioner. Assume that the air conditioner is operating in cooling mode and the operating state is related to the room temperature setting. The air conditioner is energized when the room temperature is above the maximum value. As the temperature is below the minimum value, the air conditioner is disconnected. It maintains the original state if the temperature is within the set range. Its control model and the comfort index K AC,t are shown as follows: where S AC,t is the state of air conditioning (the value of 0 means power off; the value of 1 means power on). T AC,s is the minimum setting temperature. ΔT AC is the room temperature set range. T AC,t is the room temperature at time t. K AC,t is the difference between the current room temperature and the minimum set value after standardization; the higher the room temperature, the greater the comfort index K AC,t ; the lower the satisfaction of the user, thus the higher the power priority. During demand response, the power supply is controlled based on the priority of the air conditioner [25].

Water Heater.
Water heater operation status is related to the water temperature setting. When the water temperature is above the maximum temperature T WH,s , the water heater is disconnected; when it is below the minimum temperature, the water heater is powered on; when it is within the set range, it remains in the original state. The water heater control model and its comfort index K WH,t are given as follows: where S WH,t is the working state of water heater at time t (the value of 0 means power off; the value of 1 means power on). T WH,s is the highest water temperature setting value. ΔT WH is the water temperature setting range. T WH,t is the water temperature at time t. K WH,t is the difference between the current water temperature and the highest set value after normalisation; the lower the water temperature, the greater the comfort index K WH,t ; the lower the customer satisfaction, thus the higher the priority of electricity consumption. During demand response, the water heater is controlled based on its priority.

Electric Vehicles.
It is assumed that the electric vehicle is plug-and-charge type. On the basis of its charging characteristics, the load demand is set as follows. The electric vehicle should be fully charged by the specified time [26]. For instance, if charging is assumed to start at 21:00, it is set to reach full charge at 04:00 on the next day. The electric vehicle control model is presented in Equation (6). The comfort index of electric vehicles is calculated in a different way from air conditioning and water heaters. It is specified that the comfort index tends to infinity when the electric vehicle is not expected to finish charging before the specified time; otherwise, the index is zero where S EV,t is the state of the EV at time t (a value of 0 means disconnected; a value of 1 means energized), Q t is the charge of the EV at time t, Q max is the maximum value of the 4 Journal of Sensors battery state of charge (SOC), Q min,t is the minimum value of the battery SOC at time t. When K EV,t tends to infinity, it indicates that the EV cannot finish charging before the specified time, at which time its power consumption priority can be set to the highest. During demand response, the power supply state of the EV is controlled based on its priority level.

Artificial Intelligence and Its Application in HEMS
Artificial intelligence is a comprehensive discipline developed through the interplay of many disciplines such as mathematical logic, computer science, cybernetics, information theory, neurobiology, and linguistics. The main objective is to develop a theory of intelligent information processing and to design computer systems that can display certain behaviors approximating human intelligence.

Journal of Sensors
The deep learning model has many parameters, a large training data scale, and a large amount of calculation, which consumes massive computing resources. Deep learning model parameters need to be debugged and optimized, such as network structure selection, neuron number setting, weight parameter initialization, learning rate adjustment, and minibatch control. In practice, it requires multiple trainings and constant exploration and experimentation, which further increases the demand for computing resources. With the increase of model depth and training data volume, the training acceleration method of the deep learning model becomes more and more important. Typical acceleration methods mainly include algorithm optimization, GPU acceleration, and computing cluster acceleration.

Knowledge
Graph. Knowledge graph, as another important research direction in the field of artificial intelligence, is widely used in semantic search and automatic question answering. The knowledge graph usually organizes knowledge in the form of a network, describing the relationship between entities in the real world; each node represents an entity; and each edge represents the relationship between entities. After Google proposed the concept of knowledge graph, this form of network representation of knowledge has been widely recognized. The main research goal of knowledge graph is to propose knowledge from unstructured or semistructured information and carry out structured processing, automatic construction of knowledge base, knowledge reasoning, and so on. Knowledge representation is the basis of the research and application of knowledge graphs. The Word2Vec word representation model and toolkit found that there is a translation-invariant relationship in the word vector space, which makes representation learning gain widespread attention in the field of natural language processing. The TransE model expresses the relationship in the knowledge base as a translation vector between entities, which has become the mainstream research method of knowledge representation today. The technical architecture of the knowledge graph is shown in Figure 4, including three parts: information extraction, knowledge fusion, and knowledge processing. Information extraction includes key technologies such as entity extraction, relationship extraction, and attribute extraction. Knowledge fusion includes entity disambiguation, coreference analysis, and

Expert
System. The expert system was produced in the mid-1960s and is an important branch of artificial intelligence applications. Expert system is a computer program system that solves specific problems based on the knowledge of specialized fields. It can simulate the thinking activities of human experts to solve complex problems through reasoning and judgment like experts. A typical expert system is mainly composed of knowledge base, database, inference engine, and man-machine interface, and its structure is shown in Figure 5. There are many problems in the power system that need to be solved by expert planning, designers, dispatchers, etc. in related fields. Some rely on expert experience, and some integrate judgment based on experience with results obtained based on numerical analysis methods. Expert systems have become the most mature artificial intelligence technology used in power systems so far. The main application areas include power grid monitoring and fault diagnosis, power grid dispatching operation guidance, and fault recovery.

Agent Technology.
Agent is an entity with high selfcontrol capability that runs in a dynamic environment, and its structure is shown in Figure 6. From a software perspective, it is a computer program that communicates with the outside through a predefined protocol and is loosely coupled. Distributed intelligent solution is performed in a way. It is an entity that can work autonomously and has semantic interoperability and protocol interaction capabili-ties. It is a distributed technology in the field of artificial intelligence. Due to the advantages of adaptability and openness, it has a good prospect in the new generation of dispatching automation system. Agent encapsulates the tasks and goals to be completed in the target module and collects external data through the perception module. The information processing module makes corresponding decisions based on the data collected by the sensor. The communication module provides conditions for coordination between Agents. An independent rule library is set up in the Agent to provide choices for decisionmaking and improve the efficiency. Mobile agent server (MAS) achieves the goal of entire system by coordinating and controlling each agent. The architecture of MAS system can generally be divided into three types: centralized structure, decentralized structure, and hybrid structure, as shown in Figure 7.

Resident HEMS Application
On December 9, 2019, the first demonstration project for HEMS in Jiangsu was completed and put into operation in Huangzhuang Village in Jinhu County, Jiangsu Province. Jiangsu Electric Power Co., Ltd., of State Grid installed a set of ubiquitous Internet of Things devices such as energy controllers and household appliances in the demonstration area to realize the in-depth perception and precise adjustment of residential loads at the electrical level, allowing residents to interact friendly with the demand of power grid. By cooperating with the cloud master station, the energy controller can accurately predict load fluctuations in the station 7 Journal of Sensors area and effectively converge and regulate customer-side load resources without affecting the daily energy consumption. The temperature of residential air conditioner is adjusted through the energy control system. During the peak period of power consumption in the station area, the heating time of water heater would be adjusted to reduce the total load.
For instance, on a peak load forecasting day, the station area is in the second-level interval during the period from 19:00 to 20:40. According to the load forecasting result and the load coordinated control framework, the main adjustment potential of this period is the air conditioning load, and this period is selected through air conditioning adjustment. 10 users are selected, and their air conditioning temperatures are adjusted from the original 25°C to 23°C. The air condition response of user is shown in Figure 8.

Conclusion
(i) HEMS connects users and the grid. The smart terminal of HEMS enables to read, process, and display information such as household electricity, water, and faults, so as to guide users to use electricity reasonably and save energy. Users can realize remote monitoring of home appliances and achieve prepaid services through the Internet, mobile phones, etc.
(ii) Advanced sensing equipment can sense changes in the external environment in real time and communicate with humans in time. The artificial intelligence enables power equipment to calculate and fuse the sensed information to reach the corresponding conclusion and report it to the user. It can even analyze real-time information and historical data and propose long-term decision-making suggestions to provide reference for user services (iii) Traditional artificial intelligence technologies such as expert systems, neural networks, fuzzy sets, and heuristic search algorithms have been widely used in power systems. New-generation artificial intelligence technology is a breakthrough in distributed power and distributed energy storage. In response to the complex nonlinearity, uncertainty, and temporal and spatial differences brought by the highproportion access of various new energy sources to the grid, effective solutions have been proposed Data Availability