State-of-the-Art Artiﬁcial Intelligence Techniques for Distributed Smart Grids: A Review

: The power system worldwide is going through a revolutionary transformation due to the integration with various distributed components, including advanced metering infrastructure, communication infrastructure, distributed energy resources, and electric vehicles, to improve the reliability, energy efﬁciency, management, and security of the future power system. These components are becoming more tightly integrated with IoT. They are expected to generate a vast amount of data to support various applications in the smart grid, such as distributed energy management, generation forecasting, grid health monitoring, fault detection, home energy management, etc. With these new components and information, artiﬁcial intelligence techniques can be applied to automate and further improve the performance of the smart grid. In this paper, we provide a comprehensive review of the state-of-the-art artiﬁcial intelligence techniques to support various applications in a distributed smart grid. In particular, we discuss how artiﬁcial techniques are applied to support the integration of renewable energy resources, the integration of energy storage systems, demand response, management of the grid and home energy, and security. As the smart grid involves various actors, such as energy produces, markets, and consumers, we also discuss how artiﬁcial intelligence and market liberalization can potentially help to increase the overall social welfare of the grid. Finally, we provide further research challenges for large-scale integration and orchestration of automated distributed devices to realize a truly smart grid.


Introduction
Increasing population worldwide demands more and more facilities, which in turn mandates the energy service providers to escalate their generation. Unfortunately, power generation globally is dominated by fossil fuels, which are the main contributor to CO 2 in the atmosphere. Increasing CO 2 emission threatens the world by global warming, as pointed out in the "World Energy Outlook 2019" by the International Energy Agency [1]. To cope with global warming due to increasing CO 2 emission from the traditional power system, governments around the world are encouraging renewable electric energy sources. For example, contributing the green energy, motivated by declining capital costs and the government tax benefits, the United States added 72 gigawatts (GW) of new wind and solar (photovoltaic) capacity between 2018 and 2021 [2]. Similar renewable sources addition is carrying out across the globe today.
Many types of research are being conducted in this domain, and recommendations are fluxing in the market. In accordance with the international target for the environment, the application of renewable energy sources (RES) can provide the alternative source to the dependence on fossil fuels by generating green energy options for the hazardous gas emission reduction and controlling the • Multi-agent system-based microgrid operation strategy for DR [42] • Distributed grid intelligence using FREEDM system to manage the DERs [52] • ANN for optimizing distributed grid operation [31] • Consensus-based distributed intelligence for optimizing SG control [50] • Optimization of distributed generation operation using GA [60] • ANN for forecasting local energy demand [55] • Central Information Model (CIM) for implementing VPP communication and control architecture in SCADA [42] • Deep Learning (Support Vector Regression (SVR), Recurrent Neural Network (RNN)) for electricity price forecasting [98] • Markov Decision Process and RL based smart energy community management [22] • Meta-heuristic algorithm for regulating voltage profile [43] • ANN for detecting energy fraud [28,67] • Multi-service energy storage for providing shared ownership of ESS between local network operator and customers [86] • ANN for DSM for smart consumers [31] • ANN for forecasting day-ahead load profile [26] • Machine Learning (support vector machine, ANN) for predicting electricity price [98] • Deep learning (Conditional Restricted Boltzmann Machine (CRBM)) for forecasting building energy consumption [29] • ANN and dynamic differential evolution for demand side management [111] • ANN and RL for demand response of HEM [30] Electrical

Future Energy System
Today's provision of non-stop high-quality electricity safely and efficiently cannot be supported by the aged and crowded conventional distribution networks. Independent system operator (ISO) or regional transmission organization (RTO) heavily relies on a distributed management system to revamp the reliability and efficiency of the grid [7]. With the increase in consumption and generation, the electrical grid is going through a significant shift in the presence of intelligent techniques. Secure, ascendable, and always available bidirectional flow of power and real-time information are the souls of the future SG. The large-scale integration of DERs in the mainstream grid during the last two decades has changed the implementation and operational structure of the power system across the globe. The utility service providers ought to manage the fluctuating generations for DERs, which do not have advance inter-communicational resources. SG is a promising solution to enhance the existing electrical grid infrastructure by embedding with ICT more systematically, thus allowing greater integration of distributed components [8][9][10][11][12][13][14][15].
According to the definition of EU commission Task Force for Smart Grid, "Smart Grid is an electricity network that can cost-efficiently integrate the behavior and actions of all users connected to it-generators, consumers and those that do both-to ensure a low-loss, economically viable, sustainable power system with high quality and security of supply." [16]. From NIST, the eight priority areas for standardization of the smart grid are [17]: 1. Demand response and consumer energy efficiency: Targets numerous customer segments to involve them in making efficient energy consumption by controlling and scheduling their consumption pattern. 2. Wide-area situational awareness (WASA): Provides the network operators accurate information at the right time to make appropriate decisions. 3. Energy storage: Stores energy for later use to facilitate consumers with cheaper electricity.
It provides more flexibility and helps to balance the grid by providing back-up to the intermittent renewable energy sources. 4. Electric transportation: Provides economical energy, saves the environment, enhances living standards, and drives economic growth via various electric vehicles, e.g., plug-in electric vehicles (PEVs), battery electric vehicles (BEVs), plug-in hybrid electric vehicles (PHEVs). 5. Network communications: Integrates smart energy components via bidirectional communication channels. 6. Advanced metering infrastructure (AMI): Gathers and analyzes information from smart meters and provides efficient/intelligent management opportunities to the consumers. 7. Distribution grid management: Improves the stability of the grid and reduces the losses. 8. Cybersecurity: Protects data collected from the smart grid via ICT from various cyber-attacks.
More recently, utilities are applying various distributed computing algorithms to coordinate distributed components of their power systems. Distributed Internet of Things (IoT) devices communicate, analyze, and control their operations individually or in collaboration with other devices through high-speed and bi-directional communication protocols in a distributed and independent manner [18]. Smart meters (SMs) and IoT connected via the Internet can improve the overall efficiency of the system, from simple load management of a household to complex power quality management of the grid system. These smart devices can interact with other devices and self-learn to make autonomous decisions. The growing digitization in the power system due to the advancement of distributed intelligent techniques has improved the overall system operation and reliability, including motoring, fault detection, maintenance, and RES integration. However, an increasing number of distributed devices with enabling technologies like AMI, to make multi-directional communication among devices and systems, has made the SG more complex and vulnerable to cyber terrorists [19]. Therefore, in this paper, we provide a comprehensive review of the AI techniques in various applications in the SG, namely distributed grid intelligence, renewable energy source integration, energy storage system integration, demand response management, and home energy management. In addition, we discuss the role of the distributed smart grid in market liberalization and present security issues in the SG.

Distributed Grid Intelligence
Distributed grid intelligence leverages energy management based on advanced communication means. An intelligent, cooperative architecture can optimize the energy resources/services to gain the maximum benefits. Intelligent algorithms can help to handle energy management, the configuration of new resources added to the system, and detect and recover from anomalies. The introduction of distributed generations adds new dimensions to the smart grid architecture as traditionally, the grid in most of the world act as a sink for the generations and have limited capacity to accept new penetration of resources. Intelligent distribution network comprises of three layers ranging from residential consumer to system level. In the first layer, the smart devices manage the energy at a smart home, which includes smart meter (SM), home energy management system, inverters, and EV chargers. The second layer accomplishes the objectives such as group load management, information sharing, and grid reliability improvement at the community level with the help of smart devices like relays and smart switches. The system-level grid intelligence includes advanced monitoring and control devices throughout the distribution system, which respond to the information and responses from the first two layers [20].

Distributed Intelligence: Prosumer Side
The advancement in the power system allows a bidirectional flow of energy in SG. Domestic energy users can produce and consume (prosumers) electricity and also share with other energy users in the grid [21]. Millions of people share their energy resources from renewable sources on their residential, commercial, and industrial premises. The concept of centralized and fossil-fueled generation is to be replaced with an intelligent cooperative DER powers system where the prosumers share the electricity to harness maximum economic benefits. A smart residential community model is suggested in [22] that consists of domestic users and a local energy pool, where consumers are free to trade with the local energy pool and enjoy economic energy without investing in multiple RES units.
The use of AI techniques has rushed in the energy market with a potentially practical solution to make efficient use of distributed energy resources, support real-time and quick demand response since the last decade. The grid operators are striving for "all the decisions to be made in the power grid" from the switching of relays to large generators controls so that unwanted harmonics in the system could be mitigated through a mesh of sensors embedded across all the systems to deliver full efficiency of the power system. For this reason, intelligent algorithms are formulating and implementing with foresight, self-learning, and resilience to cope with random and systematic disturbances. AI is still striving for developing computationally efficient algorithms that can predict the generation and consumption data of smart prosumer with real-time electricity prices accurately so that profitable electricity trading decisions could be made [23]. For the last few years due to the rapid advancement of AI technology, expert system, ANN and fuzzy logic, have been utilized in the energy sector, to overcome technical issues [24], price prediction [25], energy forecasting [26,27], and fault detection [28]. These techniques are also useful in energy management in residential areas [29], inside a smart home leveraging DR program [30], and overall demand-side management (DSM) [31]. Qiao et al. [32] proposed an optimization for electric energy meter based on independent and identical distributed area load conditions. The error diagnosis analysis model and fault library model based on a deep learning approach are proposed in their work that can deeply predict the cause of error measured by the meter and can ensure to train the smart meter.

Distributed Intelligence: Generation Side
The challenges for today's power distribution systems are coordinating distributed energy resources, increasing acceptability for RES penetration, establishing proper plans, and defining operational strategies that can increase demand while reducing global greenhouse gas emissions. This may be achieved by optimizing resource adequacy, considering socio-economic impacts, and enhancing grid reliability [33,34]. These complex issues can be well addressed in SG technology since it aims to make the power system more resilient, self-organizing, and troubleshooting [10,35,36]. Installation of intelligent decentralized energy units, the smart grid has a lot to do in: distributed generation and storage capacity, distributed system automatic regulation and optimization, bidirectional flow of information and electricity, plug-in hybrid electric vehicles (PHEVs) [37]. This means there is a need for more and more intelligent and smart controllers beyond DERs to monitor and manage the distribution grid too. Much research and studies have been carried out regarding the operation and control of distributed generation [38][39][40]. If a certain benchmark is crossed, the system becomes unstable due to livability constraints. Distributed grid management can provide energy management, monitoring, and fault detection [41]. Another issue concerning these days regarding online voltage control is well addresses in [42]. The work presents a distributed grid synchronization concept, where fluctuation of voltage profile due to mass integration of distributed and renewable resources escalates the complexity of power controllers, which were typically designed by the passivity hypothesis. This problem has been traditionally handled using complex non-linear programming approaches, which depend upon the centralized computing schemes [43].
Several advanced, decentralized, intelligent, and highly pervasive computing frameworks addressing such issues have been introduced in [44,45]. The promotion of cooperative controllers in the SG for online voltage control distributes the operations among distributed units, which increases processing speed and improve the reliability and efficacy of controllers. The centralized controllers had been used to manage the information gathering and compute control solutions in DER [46,47], which increased the burden (communication and computation) on the central controller thus making the system more vulnerable. To tackle this issue, researchers have proposed various decentralized control techniques that deal directly with the dispersed individual controller of the distributed units, and control actions are taken in response to the local information [48,49]. In real-time large-scale optimization problems, centralized algorithms may face challenges in managing rapidly changing system conditions, such as high variability of renewable based distributed generators (DGs) and controllable loads (CLs). Further, centralized algorithms may encounter computation and communication bottlenecks while handling a large number of variables. A consensus based dimension-distributed computational intelligent technique is proposed for real-time optimal control in smart distribution grids in which a large number of DGs and CLs are presented in [50].
Distributed operation of power system architectures consists of energy management, power management, converters management, and fault detection and restoration. Conventionally, the supervisory control and data acquisition (SCADA) system is used to handle energy resources, but this centralized architecture proved to be practically infeasible because of security and retard operations [51]. These systems have become less effective because they typically involve human interference for routine operations, as today, the grid and its inter-connectivity have become more complex and require high speed and processing of data. Distributed load balancing algorithms are designed to optimize loads of different peers in a distributed system. The nodes participating in the load balancing algorithm communicate with each other and DERs for load shifting from a zone with high consumption to a zone with low load. This migration normalizes their loads, thereby making the system stable and resilient [52]. Monti et al. [53] focus on the control of electricity networks based on distributed state estimation (LQR controller) and distributed intelligent systems. AI and blockchain technology are helpful in distributed data storage in SG security [54]. Eck et al. [55] demonstrate the progress of AI techniques deployment, to support distribution grid operators in handling mass RES penetration based on the market for local energy trading. Table 1 summarizes the AI techniques used for distributed grid management.

Integration of Renewable Energy Source
A mass movement from rural to urban areas across the globe in search of better opportunities resulted in an exponential increment in demand and supply. Currently, 55% of the world's population residing in cities which will project to 68% by 2050, according to the United Nations [57]. Increasing demand for clean, sustainable, secure, and efficient sources of electricity requires integrating RES into existing power system infrastructure. There global RES share in electricity can attain a remarkable ratio in the coming years. As shown in Figure 2, there has been continuous growth in the generation of energy by RESs across the globe. The hydropower contributes the most at 1190 GW, followed by wind energy generation at 623 GW, and solar energy at 586 GW. There are some small contributions from biomass energy and geothermal energy at 14 GW and 500 MW, respectively, as shown in Figure 2.

RES Integration: Prosumer Side
The integration of renewable and storage energy resources at consumer premises is one of the key features of SG. Another key attribute is sharing the responsibility of managing the flow and consumption of energy by leveraging the enabling bidirectional communication technologies [21]. The RES, especially solar, produce on-site energy, which reduces large-scale, long-distance transmission line losses and large investment operating costs (for transformation and transmission of power).
Macedo et al. [31] integrate PV and energy storage system (ESS) with the local grid in a smart home to optimize energy consumption. For high energy consumption buildings, like hospitals, hotels, educational institutions, and commercial buildings, smart grid systems, together with RES and ESS, manage total energy consumption efficiently [59]. Elkazaz et al. [60] design an intelligent optimization algorithm for the optimal online operation of DERs (hybrid FC and PV) for residential applications. The reliability of the power system increased by reducing peaks and cost-saving for smart homes using RES is achieved in [61] when GA, binary particle swarm optimization (PSO), and Cuckoo search algorithms are embedded in the HEM system. Melhem et al. [62] propose mixed integer linear programming (MILP) to integrate PV system, micro-wind turbine system, battery storage, and gridable vehicles for residential energy management. Distributed energy appreciates maximizing the use of renewable energy sources and power generation technology to improve application efficiency and to reduce environmental hazards.

RES Integration: Generation Side
Due to the rising global temperature, we need non-fossil fuel based alternative energy solutions. Renewable generations are closer to where it is utilized and currently gaining popularity in the power systems arena. Due to the increasing deployment of renewable energy technologies, the power system dynamics are shifting to a new level that requires variable energy supply, bidirectional electricity flow, storage facilities, and processing of a huge amount of data. Navigant Research forecasts global microgrid (MG) generation capacity to grow from 1.4 GW in 2015 to 7.6 GW by 2024 [63]. Their intermittent behavior and limited storage capabilities present a new challenge to power system operators to maintain power quality and reliability.
Due to the lack of AI techniques, many system operations are still performed manually or done with a basic level of automation. However, numerous hindrances and challenges, such as complex end-to-end control techniques and customer participation, still need a lot of considerations [64]. Fault detection and safety analysis of DERs and MGs are discussed in [65] and encouraged the deployment of ESS and inverter controller during operation. Two MG operational approaches during an emergency, i.e., regarding inverter control mode and auxiliary energy source (STATCOM) mode, are also briefed in the paper. Kim et al. [66] analyzed the advantages of an advanced power distribution system loop structure from the perspective of loss reduction and voltage regulation. Furthermore, they presented a loop path selection algorithm for loss minimization. In the conventional system, one of the techniques for isolating a failure unit of generations from the grid was the islanding method. Darab et al. [67] deploy an AI technique to detect the fault and exact point of occurrence of a fault in DERs for rapid islanding of the affected unit.
Widespread AI techniques have been contributing to almost all the types of RES for the policy-making, design, estimation, optimization, management, and distribution [68]. Application of AI techniques in the wind, solar, geothermal, hydro, bio-energy, and hybrid RES are briefly discussed in [69][70][71][72][73][74]. Economic energy trading has been focused on by all the power system operators since its inception. Depending on the power forecasted by ANN, the MG energy trading model determines the optimal schedule for all the units by utilizing a genetic algorithm [75]. Development in the power system has shifted from a micro-energy network with a centralized supply to distributed and decentralized energy generations to achieve a ubiquitous state. Alsafasfeh et al. [76] propose distributed saddle point dynamics to optimize the power flow in a PV system. The industrial MG model with DERs in manufacturing industrial area in Ireland provided cheaper energy and steady grid operation than only grid operation [77]. Table 2 summarizes the AI techniques used for the integration of RES.

ESS Integration: Prosumer Side
Energy storage systems (ESS) are expected to play a major role in the future smart grid. They provide a back-up to the intermittent renewable sources and ensure continuous electricity supply to the consumers. Locally, they help in the management of the distribution grid by improving its efficiency and reducing costs. ESS helps in mitigating the peak residential energy demand on the local grid. Numerous incentive based demand response programs have been proposed in [78] to encourage the usage of such alternatives. Home ESS stores energy during the off-peak hours and deliver energy to the users in on-peak hours, which decreases the stress on the main power system and increases financial benefits. According to a report by Statistica, nearly 75.4 billion interconnected devices will be operating through the Internet globally by 2025 [79]. Batteries form the vital core of electric cars and mobile phones, helping us curb carbon emissions and stay connected. The large-scale deployment of ESS in the power system will give 600 million people access to electricity till 2030, which will help to reduce carbon emission in the power sector and transportation by 30% [80].
Using ESS with RES is the best way of reducing current fossil fuel consumption and utilizing green energy. It is an alternative solution for the intermittent power output of RESs, where storing excess generation to provide it in peak time, to fulfill the demand [81]. The three areas in which the batteries are increasingly playing important roles are: reducing CO 2 emission in generation and transportation, getting rid of fossil-fueled power system by making renewable power generation as a dispatchable energy source and off-grid access to electricity. ESS provides a value-added economic dispatch solution as market price and other economic system variants have a great impact on SG operation [82]. ESS is contributing its role in the smart city vision as the Park et al. [83] propose a micro-distribution ESS based smart LED streetlight system that utilizes dispersed/distributed storage devices and Intelligent LED system to energize the streetlights of the city. Storage sharing can reduce both space and investment costs for the user. Rahbar et al. [84] propose an algorithm that optimizes the energy-charged/discharged using the shared ESS concept to profit the consumers.

ESS Integration: Generation Side
Conventional grid designs focus less on data and energy storage, but a SG truly values both. The ESS is an integral component that can transform the current grid structure and operation. Intelligent energy management strategies capable of managing the dynamics of the distributed grid are required to ensure effective implementation and efficient usage of ESS [82]. It can provide targeted energy to all the components of the grid at a different level making the grid reliable and smarter. The authors encourage the deployment of energy storage systems within the electric grid system, supported with effective regulatory and financial policies for development and deployment within a storage based SG system in which storage is placed in a central role [85]. Beside lower wholesale energy prices to consumers, it also supports to reduce the low voltage distribution network investment [86].
Forecasting of voltage and frequency helps a lot in the SG concept as it assures the reliability of the grid. The integrating issues (regarding voltage and frequency) of ESS and local low-voltage distribution grid at a point of common coupling is addressed in [87] using ANN technology to forecast both voltage and frequency matching. Real-time distributed algorithm is proposed in [88], for the operator with distributed ESS, to balance the energy demand through charging and discharging of ESS. The work in [89] presents a simultaneous optimization using non-sequential quadratic programming algorithm for DG and ESS in grid-connected and standalone medium voltage MG, to minimize the energy losses in the distributed system. Table 3 summarizes the AI techniques used for integration of ESS.

Demand Response and Energy Management System
The term demand response (DR) is used for the programs designed to encourage end-users to make short-term reductions in energy demand in response to a price signal from the hourly electricity market, or a trigger initiated by the electricity grid operator [90]. DR changes the power consumption pattern of energy customers to match the demand and supply better. It provides consumers an opportunity to take part in grid operations by reducing or shifting their electricity usage patterns during peak consumption periods and emergencies in response to an hourly pricing scheme [36,91]. The smart consumers are also offered financial incentives. In Incentive based programs, the consumers are offered fixed or time-varying financial benefits in response to the reduction in their electricity consumption during peak times and contingencies [92]. Several other approaches regarding DR implementation have been actively investigated in recent years [93,94]. Gong et al. [95] propose a privacy-preserving scheme for incentive based demand response programs in the smart grid, which enables the demand response provider to compute individual demand curtailments and demand response rewards while preserving customer privacy. The scheme preserved customer privacy by separating the real identity and the fine-grained metering data, i.e., the DR can only learn either the real identity or the fine-grained metering data at a time but cannot link them together.
Following the advancement in ICT, the DR has also entered the arena of digitization, where intelligent techniques are embedded in the pool. This makes communication between the energy management system (EMS) and utility smarter. Kim et al. [96] propose two cloud based DR for speedy communication between the slave (EMS and SM) and master (utility). The data-centric communication and topic based group communication use a publisher/subscriber architecture in a cloud based demand model rather than traditional IP-centric communication. Making a DR program for islanded DERs is a complex task due to the absence of grid connection and market price signals. Ali et al. [97] propose a distributed DR program for islanded multi-MG networks based on welfare maximization by optimal power-sharing among different units without using any central entity. Different methods of forecasting electricity pricing from a linear statistical approach to the computational intelligent prediction model are discussed in [98].
Due to the availability of enough customer data, computing resources, and potential training algorithms, AI has now matured enough to forecast the electricity price even in the complex environment to the customer. A comparative analysis of such intelligent schemes has been investigated in this research focusing on deep learning (DL) and support vector regression (SVR). DR is the change in electricity consumption pattern by end-users from their usual pattern according to the price of electricity over the time proposed by the utility, or to get financial incentives to compromise the power system reliability due to peak demand [99]. In SG, the demand prediction helps to decide on how much-generating units to be utilized efficiently so that the burden could be shared optimally to improve the reliability of the generators. Recently, many researchers have focused on leveraging AI techniques for energy demand prediction [56,100]. Lu et al. [30] propose an hour-ahead DR algorithm using reinforcement learning and ANN to overcome the uncertainty in future electricity prices, considering the user comfort and consumption behavior. In the presence of consumers and utility data, AI techniques can be utilized to model the load and demand prediction [101], as demand and supply prediction helps make many other decisions in SG. The types of energy management system in the smart grid with enabling techniques reviewed in this paper is shown in Figure 3.  [31] • HSDE [21] • GA, ANN [117] • Markov decision process and RL [22] • Building integrated PV (BIPV) [9] • MILP [62] • ANN [51] • Stochastic mixedinteger programming [92] • ANN [55,26] • DL [98] CRBM, FCRBM [29] • Levenberg-Marquardt [77] • LSA [118] • ANN and DE [112] • ANN for DSM [31] • Evolutionary Algorithm [103] Local Grid Coordination Demand Side Management • Multi-service ESS [86] • Shared energy management [84] Energy Sharing

Home Energy Management System
Energy management includes monitoring, controlling, and saving of energy [102]. A HEM system is a combination of hardware and software program that allows the end-users to monitor their energy usage and production (for prosumers) and to manage the energy inside a home. A HEM system is an integral part of SG that can potentially enable DR applications for end-users. In a smart home, it manages and controls the energy utilization by scheduling the home appliances according to the scheduler technique embedded in the HEM controller [103]. The HEM controller, on the bases of information sent by the power service provider and smart meter, decides the pattern of the appliances on the smart home considering the constraints. According to the most recent DR and Advanced Metering Assessment published by the Federal Energy Regulatory Commission, more than half of customers' electricity meters across North America are now SM [104].
Energy management is essential in the SG. HEM system, dynamic pricing, and load shifting are different applications that have been implemented by researchers in the past few years for efficient energy management at the demand side. It helps the end-user with cost-saving for society resources conservation and climate protection in the large sphere by integrating and optimally coordinating various energy resources without compromising work processes [105]. In the traditional grid, the consumption readings were retrieved physically once in a month to calculate the electricity bill. The SG presents a network of SM that can collect, share, and provide updates (e.g., consumption pattern, pricing, priorities, network status, etc.) [106]. Several utility companies in the energy sector have deployed smart metering systems in residential and commercial sectors that provide consumer's consumption behavior in real-time and allow utility companies to monitor the appliances remotely. Smart meters installed in the private home sphere are smart in the sense that the consumers can beneficially manage their electricity consumption based on consumers and utility parameters. The smart meter learns the consumer's lifestyle, appliances the switching pattern, and communicates the information with the utility [107].
A HEM controller lacking a smart home becomes an organizational hassle because the user has to control every appliance in the home manually, which may result in excessive traffic on the distribution network and energy wastage. To address these problems, an integrated controller is needed to connect and manage smart devices. Jo et al. [108] proposed an integrated model that uses learning and training the intelligent efficient energy service (IE2S) model on the base of information generated by smart devices. Squartini et al. [109] propose an optimization algorithm for HEM scheduler to reduce electricity cost in a smart home with a renewable energy source and medium-size energy storage considering dynamic pricing. Kazmi et al. [110] evaluate the comparative performance of the HEM controller embedded with three different heuristic algorithms: harmony search algorithm, enhance differential evolution, and harmony search differential evolution.
AI is quickly becoming an essential part of our power sector and HEM system today, encouraging us to develop more efficient and safe energy production and management techniques. ICTs are an integral part of the HEM system for designing an optimal scheduler and making strategies for intelligent energy management. ANN and optimization algorithms are embedded in HEM controllers to integrate the battery storage and RES with the grid to reduce the energy cost for the smart consumers [111]. Different wireless sensor technologies have been used to communicate home appliances with the HEM controller. In the smart home, appliances are integrated through a wireless network like ZigBee, Bluetooth, and WiFi to collect data from them and communicate with the utility [112,113]. An intelligent HEM controller using ZigBee based on standard IEEE 802.15.4 has been designed to intelligently schedule an air-conditioner, heating system, and two-way communication flow for smart consumers in [114]. Recently, various AI techniques have been implemented in HEM controllers in smart homes to manage the load. The most commonly used AI techniques in HEM schedulers are ANN, fuzzy logic control (FLC), and adaptive neural fuzzy inference system (ANFIS). An ANN based residential thermal control strategy for a single-family home is developed in [115] to create a more comfortable thermal environment. A hybrid approach of GA and ANN algorithms is developed for weekly appliance scheduling to optimize electricity consumption in a residential sector with renewable sources (PV and wind generations) to maintain energy demand during peak hours [116]. A similar efficient hybrid algorithm of Lightning search algorithm (LSA) and ANN selects the optimum number of neurons of ANN hidden layers to make an efficient decision for scheduling air conditioner, water heater, washing machine, and refrigerator in a smart home [117]. It can reduce the peak load while guaranteeing user comfort. They have validated their better performance by comparing the results with a similar approach of hybrid PSO-ANN algorithm proposed in [118]. In another study, Sheikhi et al. [119] propose a model to utilize the cloud computing technology in DSM among a group of Smart Energy Hub. The purpose is to manage communications of data among various endpoints in scalable, online, and highly secure and propose efficient electricity management on the consumption side in the smart hub harnessing the benefits of cloud computing technology and game theory. Table 4 summarizes the AI techniques used for the demand response and HEM system.

Economic Aspect and Market Liberalization in Smart Grid
Transformation in power systems due to technological advancements budges institutional changes in it. Cooperative mechanisms of technical, institutional economics, and social aspects are required to put the smart grid in practice [120]. The RTO/ISOs are struggling for an efficient market based decision system since inception, keeping all stakeholders on the account. The key idea is to make electricity market-liberal and truly open where new ISO/RTOs could access this industry, which will take electricity to medium and small-scale users' accessibility. This will help to shift the centralized fossil fuel generation to green and clean energy too and provide new competition in the market, which may lead to innovations. There is a direct relationship between the consumer's lifestyle and energy issues. The works in [121][122][123][124] discuss the pro-sustainability attitudes and values of electricity transition and consumption using various technological advancements, especially SM. Market liberalization has brought many changes in the energy sector with far-reaching technical and economic consequences. Due to increased digitization, the policymakers and market operators are striving to apply efficient techniques to catch up with the advancements. Xu et al. [125] propose energy market design architecture enabled with AI techniques and big data that can incorporate, coordinate, and manage complex systems of the power industry. A SG can decrease the amount of electricity consumed by houses and buildings and improve the reliability, security of the grid infrastructure by the integration of RES [110].
Advanced communication devices and huge data of consumers and utility service management collected by SM and ICT play an essential role in providing new services. It will also help to manage the electricity price in the market. The continuous liberalization of the electricity market, i.e., shifting from the monopoly system to competitive market structures, draws more and more attention from the investors in the power sector [126]. Through the virtual power plant (VPP) concept, DERs can get access and exposure across all energy markets. They can take benefit from VPP market intelligence to optimize their place to expand the potential of their revenue generation [127]. The essential feature of the modern smart grid is the electricity prices forecasting, as the market dynamics directly affect the behavior of grid operators such as GENCOs, traders, RTO/ISOs, and independent power producers (IPPs) in the diverging electrical market [128]. Increasing development in decentralized renewable generations will have a remarkable influence on deciding the future of the electricity market since they have been financed/purchased electricity from them without any compact agreements. Future electricity markets should be flexible enough to optimally handle the dynamics and uncertainties of RES generation along with dynamic and flexible benefits on the demand side. The small-scale smart prosumers should be encouraged to take part in policy-making to uplift the overall social welfare [129].

Smart Grid Security
The SG comprises various components located at many different locations, such as smart home appliances, distributed generating units, smart meters, and energy storage systems, providing numerous entry points to the grid. The physical security of the grid is equally vital to cybersecurity to withstand against moderate disasters. With the advanced control and communication system, SG is striving its best to ensure the security of distributed components using ICTs [130]. McLaughlin et al. [131] explain how malicious code can be embedded into smart appliances to get access to any part of the grid and how important data like user authentication keys can be hacked. In the real world, all the systems, including the SG, have vulnerabilities and complexities. Numerous issues arise in the grid system when cyber and physical systems are integrated with it, besides factors like human behavior, regulatory and political policies, and commercial interests. The integration and deployment of information communication technology in the SG network for collecting, storing, and analyzing using different sensors and smart measuring devices attract the intruders to access the grid and modify the operations.
Through AI techniques like ANN, the cyber-physical system (smart grid) can be made secure against cyber-attacks [132]. Critical issues related to the SG are individual privacy, security, and reliability in terms of communication and performance, and denial of service. Dogaru et al. [133] focus on a deep neural network to mitigate the impact of cyber-attack at a different level in the power grid and successfully identify through a case study the point of attack. Threats mean various possible actions (artificial or natural) that are capable of influencing the performance of the system [134]. These threats are hazardous if appropriate actions are not taken on time. The most prevalent threat is breaching of consumer's data privacy and malicious control of the devices and appliances in the smart home [135].
To enumerate all possible threats in the SG is not possible due to system complexities and the unidentifiable nature of sophisticated attacks. Lu et al. [136] categorize malicious threats in three different types based on their goals, i.e., network availability, data integrity, and information privacy. Besides technical challenges, the SG poses regulatory challenges too. Stakeholders and policymakers strive for their dominance due to which changes are expected randomly [6]. Smart devices designers need to ensure the standards of the SG.

Data Integrity and Information Privacy
User data stored and utilized in the smart grid has increased exponentially since the last decade. The ownership of data is also a big challenge in the smart grid from which almost every stakeholder takes benefit. Data integrity objective refers to preventing the data from modification of unauthorized person or a system like in smart grid the sensors data, SM data, and operator commands [137]. Privacy preservation techniques aim to prevent information disclosure to any unauthorized person or system without legal permission. Both the generation and consumer side data need to be secured from any intruder. The consumer's behavior, appliances data, authentication keys, and utility plant's data are always vulnerable due to a large number of interconnected devices. Shi et al. [138] propose a privacy-preserving aggregation of time-series data, in which a group of nodes uploads encrypted information of users to the data aggregator. The aggregator can only calculate the collective values of users periodically but cannot reveal any beneficial information. SMs are highly targeted by the hackers as it is the hub between utility and consumer and where all data about the consumer is stored and transferred [139]. The service provider facilitates the consumers on the base of information provided by the SM.

Denial of Service
Currently, with the exponential expansion of the Internet, a large portion of resources and communications in the smart grid are available online, which has provided the attackers with more scope for their malicious activities. A SG framework needs to guarantee its (resources and communications) inaccessibility to unauthorized persons or systems. An attack to make a SG network and resources unavailable to its destined users is called a puppet attack where the attacker target a particular node name as puppet node to enter the AMI network [140]. Large scale deployment of interconnected devices via the Internet in the smart grid exposes it to the IP based attackers. They can make the power system partially or totally unavailable for the consumers [141]. The adversaries can jam the communication channel by flooding the network traffic to launch a DoS attack, which makes the power system unstable. Lui et al. [142] investigate the effect of such an attack on load frequency control in the power grid by applying switch system theory. Boumkheld et al. [143] develop and intrusion detection system using data mining techniques to detect the DoS attack, which they termed as black hole attack in the smart grid. Different threats and issues related to grid security, along with potential solutions, are summarized in Table 5.

Architecture
Protection of smart grid, substations, and ICT gadgets from various cyber attacks AI based load estimator using sensors [144] Power theft ANN based fraud detection [28] Operation Fault detection and separation Coordination among DERs, smart sensors [145], smart device standards [6] Reliability and resiliency Pervasive computing architecture using ubiquitous devices based on a trust model [146] Data management Data integrity and consumer privacy Data encryption Data security against cyber-attacks (active and passive) Distributed data randomization [138] Secure generation, monitoring, storing, and analysis of data Online voltage control using SCADA [42] Denial of Service (DoS) Hybrid fuzzy set based feed forward neural network [147] Environment Consideration of environmental factors, responding to natural disasters Smart grid forensic science [130] (earthquakes, lightnings, tree falling, etc.)

Market liberalization and regulatory policies
Consumers awareness about the benefits of smart grid, RND investment, planning and regulatory policies by stakeholders, government support and private sector coordination in implementation, market liberalization and IPPs attraction Social marketing, social norms approach [123]

Conclusions and Future Outlook
In this paper, we presented a comprehensive review of the state-of-the-art artificial intelligence techniques designed to support various applications in the future distributed SG, including the integration of renewable energy sources, integration of energy storage systems, demand response management, home energy management, and security. These techniques are expected to improve the performance further and ease the management of the SG. We also identified some limitations of the AI techniques presented in the literature. Some general areas of limitations are scalability, consideration of user satisfaction/preference, algorithm efficiency, security and privacy, stability under failures, algorithms efficiency, understanding of the intelligent tools by users and network operators, etc.
There remain some important research challenges to overcome these limitations and fulfill the requirements of the future distributed SG. Some of these challenges are outlined below: • Self-learning system: AI and cloud computing utilization for predicting electricity generation and consumption can minimize outages and enhance SG security. With the changing input variables of the distributed agents, the system learns and adopts the required operation. Every node in the grid will be responsive, eco-sensitive, flexible, adaptive, and price-smart. Self-learning algorithms can help to update the system configurations after every event/operation to enhance the grid intelligence. Huge data availability with machine learning algorithms will increase the self-learning ability of the power system.

•
Complete automation: SG can further advance by fully automating the network from electricity generation to distribution and grid service management. Currently, most of the operations in the power system are done manually or with a basic level of automation. Using distributed automation techniques, the speed, cost, outage management, reactive power management, preventive equipment's activation, and DERs' integration can be improved. The following areas are still striving for high-level intelligence to make the SG system completely automatic: remote devices monitoring, fault detection and restoration, automated feeder switching, voltage regulation, Non-technical losses reduction, real-time load balancing, DER integration, etc.
• Self-healing grid: SG equipped with automated controllers, sensors, and enabling techniques can utilize the real-time data for detecting and isolating anomalies and for reducing the burden on utilities and customers. Human intervention for recovery solution takes time, which can be shortened (frequency and duration of outages) using self-healing technology. Some potential research challenges are online self-assessment of the grid's operating status, prompt implementation of precautionary control, and detection and rapid diagnosis of concealed faults. • Plug-and-play: SG plug-n-play technology can facilitate and encourage customers to share energy generated on their premises with other smart users. Efficient distributed algorithms may be embedded in distributed controllers to manage energy among the DG units economically using plug-n-play operation. • Cybersecurity: Security protocols need to explore new machine learning, information theory, and knowledge detection based techniques. Some potential research challenges are the application of the existing security protocols according to the requirements of SG applications, self-healing/adaptive security techniques, and integrative security protocols for distributed components.

•
Skilled workforce: With the evolving technologies and standards in the SG, the workforce for the future power system operators needs advanced skills in various areas, such as intelligent techniques for monitoring and control of smart devices, cybersecurity, distributed system communication protocols, DER integration, regulatory issues, IPPs goals, utility decision-making applications, etc.
In sum, the application of AI techniques can be leveraged to reduce the power losses in the distribution grid to enhance power quality. Moreover, AI techniques can provide improved and automated management of distributed resources, enhancing the scope of smart grid services to build an even smarter grid.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: