# Introduction mart metering of electrical utilities is a promising technology. On the one hand, it enables consumers to manage the consumption efficiently, and on the other, the Utility Companies to manage the production competently [1]. Though the technology is beneficial for both, the consumers have a major privacy concern [2,3]. It is because the massive data that flows from Smart Meter at consumer premises to the Utility Company [4][5][6] corresponds to consumer's utility usage patterns and may reveal his privacy. For example, if the households are in the home or not, what times they are away; what appliances they use, and when, who has high-tag appliances, what times they watch TV, and even what TV channel they watch [7]. Another type of privacy invasion can be with users of Plug-in Electric Vehicles (EV) where the charging data can be used to identify travel routines [8]. The concern is even more serious for businesses, whose energy consumption patterns can disclose important business operation information to the competitors [9]. Thus there is a need for a system that could mask consumption patterns, to assure consumer privacy. Several methods have been proposed in the literature to provide security and privacy to Smart Meter users. For example, reference [2] proposes a cryptography-based Time of Use protocols for preserving privacy. Though the encryption can provide data security, but not consumer privacy, as it encrypts the data, but cannot hide the energy consumption patterns. Reference [1] proposes to add noise of special threshold to the data signal that moves from the consumer end to the Utility Company. The major drawback of this system is that the amount of noise and the inter symbol interference (ISI), depending upon medium, may result in a total loss of signal, i.e. loss of useful data. Reference [10] uses a battery that sits in the middle of a consumer and the Utility Company. It draws energy from an Electric Utility Company at a constant rate and continuously feeds all the household loads at all times. Thus the battery masks all the real-time energy usage. Though the solution is promising, the drawback is that a battery always supplies the loads constantly. This requires a battery to be of quite a big capacity so that it could power a whole house at all times, which may be cost-prohibitive. The solution proposed in [11] is vague, as it does not show (a) how to calculate the capacity of each load for each residential consumer, (b) the solution mandates customization to each residential consumer as it requires to calculate the capacity of each load at each home. Further, just scheduling, without knowing the utility company's peak rates and load factor cannot provide cost-saving in the energy bills. Thus the claims made are unrealistic. Though Smart metering infrastructure brings unique benefits for Utility Companies as well as consumers, massive consumer data collected and transmitted by the smart meters have raised consumers' privacy concerns. This paper presents a novel solution that employs Artificial Intelligence Techniques to continuously compute the gap between "Average Daily Demand" and "Instantaneous Demand" of a consumer, and thus allows the Battery Banks to discharge just enough to fill the gaps and eliminate kinks in the energy usage graph, and thus to masks the energy usage. The accuracy of computing the Adjusted-average Daily Demand, holds a critical value in this approach. The higher the accuracy of Adjusted-average Daily Demand, the lesser the need for charging/discharging of the Battery Banks. To accomplish this, an Artificial Intelligence-based agent plays a vital role. The approach not only overcomes the abovenoted shortcomings but also offers several benefits, such as, it conceals utility usage-patterns that ensures privacy, does not require higher capacity batteries and eliminates excessive charging/discharging of batteries that lifts the operational constraints of the batteries, employs scheduling that renders utility bill reduction as an add-on feature. Employs existing communication technologies such as e.g. 4G/5G, and Wi-Fi. In addition to the above-noted benefits, the proposed approach is economically as well technically viable as the installation of Battery Banks in residential, commercial, and industrial markets is becoming a norm due to the huge EV market, micro-grids, and home/community energy storage systems [12]. The rest of the paper is organized as follows. Section II presents the proposed solution, Section III presents simulation results, Section IV economic viability, and Section V concludes the work. # II. Description of Proposed Solution We propose an Artificial Intelligence assisted consumer privacy and energy management system. The schematic design of the proposed Artificial Intelligence Agent (AI-Agent) that is the brain of the whole architecture, is shown in figure 1. # Figure 1: Design Schematic of AI-Agent The AI-Agent is a mini-computer, designed to achieve an explicit goal of "Consumer Privacy" and "Energy Management". The brain of the AI-Agent receives critical information through the environment, machine learning algorithm, and its knowledge base. It processes this information and makes intelligent decisions after any given sequence of percepts, and provides output. The Structure of Intelligent Agents can be viewed as the "System Architecture" and the "System Program". The system architecture consists of the following entities that an agent executes on, and is shown in figure 2. As depicted in figure 3, the AI-Agent communicates and receives information from the Utility Server the forecasted load factor, and the complex tariff information for the next 24-hour on a daily basis through a Cloud. The Cloud network consists of a set of servers available to many users over the Internet. Utility companies are shifting to the cloud technology as it will Year 2020 ( ) D © 2020 Global Journals Artificial Intelligence Assisted Consumer Privacy and Electrical Energy Management save utility significant hardware and software purchasing costs. Also, it would provide the utility company to leverage data sharing and analysis. To address the Cybersecurity-related concerns such as unauthorized access to the cloud, the security policies are in place, or the data communication may be one way only, i.e. from the Cloud to AI-Agent. Though a two-way communication will have its numerous benefits. communicates and receives information from the Weather Server, it acquires forecasted weather information, such as temperature, humidity, rain, sun, etc. for the same 24 hours for the consumer's location. AI-Agent uses the real-time prevailing weather information in making smart decisions while scheduling the daily tasks, such as laundry, dishwashing, and setting the optimal values of various thermostats of water heater, air conditioner, refrigerator, etc., AI-Agent communicates and receives information from the Consumer's Smart and IP addressable Appliances that include home appliances such as, washer/dryer, dishwasher, boiler/water heater, air conditioner, refrigerator, etc., and other devices such as home security systems, and the user's calendar, etc. to detect the user's presence at home and adjust thermostat levels for air conditioning, water heater, and refrigerator, etc. accordingly. AI-Agent receives information from the Graphical User Interface (GUI). Graphical Use Interface is integrated with AI-Agent. The consumer uses a Graphical User Interface to input his preferences. These preferences relate to tasks' priority, convenience, comfort, and financial affordability. (e.g., the desired temperature ranges of hot water, refrigerator, airconditioning, preferred time or priority for washing clothes, or dishes, etc.). The consumer may enter these parameters once and save them. The user may feed the parameters using the touchpad, voice recognition, or through a mobile App. Year 2020 ( ) D Artificial Intelligence Assisted Consumer Privacy and Electrical Energy Management AI-Agent communicates and receives information from the Energy-sources Tracker and Selector. It keeps a track record of the available energy sources and their status. Based on the command received from the AI-Agent, it selects the right combination of sources from the pool of available sources. The available sources in the pool, as shown in Figure 1, are Utility Company, Dedicated Battery Banks, and EV-Battery Banks when the EV(s) are parked in the consumer's garage, etc. EV-Battery Banks can be drained to meet the household energy demand, and top up again later when energy is surplus. Since EV adoption rate has increased exponentially recently, the EV-Battery Banks assumption will be a reality in the years to come [15,16]. AI-Agent communicates and receives information from the Task Completion Register. Task Completion Register monitors the appliances' task completion status, pending tasks status, and consequently makes a daily log. The Task Completion Register continuously acquires this information from the appliances and updates the AI-Agent. Based on the parameters acquired from the Utility Server, the Weather Server, the Consumer's Smart Appliances, the Graphical User Interface, the Energysources Tracker and Selector, and the Task Completion Register, the AI-Agent computes the Adjusted-average Daily Demand (ADD). Traditionally, the Adjusted-average Daily Demand is calculated by the total energy used over a year divided by 365 days. However, our AI-Agent calculates it by totaling the energy rating and usage duration (kWh) of each consumer appliance that is scheduled by the scheduler for that day. Scheduling is performed by the AI-Agent by comparing and contrasting the daily load factor and daily complex tariff information received from the Utility Server, consumer preferences and priorities, and prevailing weather conditions, etc. The AI-Agent schedules the daily tasks in a manner that less energy is consumed when the Utility Company has peak demand (and the tariff is high), and as maximum as possible loads/appliances (such as boiler heating, washing, drying, charging Battery Banks, etc.) are operated when the Utility Company has off-peak demand (and the tariff is low). This keeps the overall utility consumption at a low cost. Though the AI-Agent performs careful scheduling, the things may not go as scheduled. For example, the user may override his own preferences knowingly or unknowingly, and/or may turn on the lights/devices/appliances unexpectedly or randomly. Thus despite careful and intelligent scheduling, the actual prevailing load conditions may be different than what planned. Thus another key job of the AI-Agent is to continuously compute the gap between Adjustedaverage Daily Demand and the current/prevailing actual load and directs Energy-sources Tracker and Selector to select the appropriate energy source in such a way that Utility Company always continues to provide Adjustedaverage Daily Demand, and any positive gap between the Current Load and the Adjusted-average Daily Demand is covered by charging the Battery Banks, and any negative gap between the Current Load and the Adjusted-average Daily Demand is covered by discharging the Battery Banks. Since the Battery Banks is used to cover up the gap only, our solution eliminates the excessive discharging and charging of batteries that lifts several operational constraints off the batteries. Thus computing the Adjusted-average Daily Demand accurately carries vital importance. The gap analysis is performed by the AI-Agent as discussed below in the following three scenarios: Scenario 1: If the CURRENT LOAD IS LESS THAN ADJUSTED-AVERAGE DAILY DEMAND, the AI-Agent selects the Utility Company from the pool of available sources to perform all scheduled tasks and uses the surplus energy (i.e. Adjusted-average Daily Demand minus Current Load) to charge the Battery Banks. Thus in this scenario, Utility Company acts as a "source" for feeding the appliances, as well as, charging Battery Banks. As an example to illustrate this scenario, suppose the current load in a given hour is 3kW and the Adjusted-average Daily Demand is 4.5kW, the AI-Agent selects Utility Company to perform all scheduled tasks and uses the surplus energy (i.e. 4.5kW minus 3kW = 1.5kW) to charge Battery Banks. # Scenario 2: If the CURRENT LOAD IS EQUAL TO ADJUSTED-AVERAGE DAILY DEMAND, it again selects Utility Company from the pool of available sources, perform all scheduled tasks, and since, there is no surplus energy (i.e. Adjusted-average Daily Demand minus current load = 0), Utility energy is used to feed all the appliances, and not for charging the Battery Banks. For example, if the current load in a given hour is 4.5kW and the Adjusted-average Daily Demand is also 4.5kW, AI-Agent selects Utility to perform the scheduled tasks only and does not charge the Battery Banks at all. # Scenario 3: If the CURRENT LOAD IS GREATER THAN ADJUSTED-AVERAGE DAILY DEMAND, it selects Utility Company and Battery Banks (Dedicated ones and/or EV-Battery Banks if available) to feed the scheduled loads. Under this scenario, since the existing load is greater than the Adjusted-average Daily Demand, Utility energy is used to feed some of the appliances whereas the Battery Banks to feed the rest of the load. For example, if the current load in a given hour is 7.5kW and the Adjusted-average Daily Demand is 4.5kW, AI-Agent selects Utility to feed the appliances that add up to 4.5 kW and selects the Battery Banks to feed the remaining 3kW load. Thus, no matter whatever the current load is, the AI-Agent intelligently selects the available energy resources in such a way that Utility Company always Year 2020 ( ) D © 2020 Global Journals Artificial Intelligence Assisted Consumer Privacy and Electrical Energy Management continues to provide Adjusted-average Daily Demand, and any gap between Adjusted-Average Daily Demand and the Current Load is covered either discharging the Battery Banks or charging the Battery Banks. This strategy eliminates the excessive discharging and charging of batteries. Also, the higher the accuracy of the Adjusted-average Daily Demand, the lesser will be the frequency and depth of charging/discharging of the Battery Banks. This concept is further elaborated after explaining Figures 3 and 4. Figure 4 shows the hourly demand of a hypothetical consumer on a certain day. The AI-Agent computed the Adjusted-average Daily Demand = 4.5kW that day, which is represented by a blue/thick dotted line at 4.5kW of Y-axis in the Figure . The graph also shows that the consumer load is (a) less than the Adjusted-average Daily Demand for a sum of 16 hours (i.e. from 12:00 AM to 10:30 AM, from 11:30 AM to 02:00 PM, and from 09:00 PM to 12:00 A.M) and (b) greater than the Adjusted-average Daily Demand for the 7-hour duration (i.e. from 02:00 PM to 09:00 P.M.). For Scenario 3 AI-Agent selects both, the Utility Company and the Battery Banks for the interval the load is greater than the Adjusted-average Daily Demand. AI-Agent selects the Utility Company to feed appliances load equivalent to 4.5 kW (sky blue color) and Battery Banks to feed surplus load equivalent to 1.5 kW for 7hour duration i.e. from 02:00 PM to 09:00 P.M (see red color). From Figure 5 graph we can infer that the Battery Banks were discharged for the 7-hour duration (red color). Thus the Battery Banks have to provide 1.5 x 7 = 10.5kWh/day. Considering 90% depth of discharge, the Battery Banks are recommended to have a rating of about 12kWh. The Figure also shows that the Battery Banks are charged for 7 hours at about a maximum of 2.5kW and for 8 hours at about a maximum of 1.5kW. Thus the duration and rating are quite enough to get the Battery Banks fully charged. To avoid over-charging or under-charging of Battery Banks, the AI-Agent has to carefully compute the value of Adjusted-average Daily Demand every day very carefully. For a scenario, when the daily demand is low, the AI-Agent adjusts the Adjusted-average Daily Demand at a lower level (e.g. let's say 2kW, instead of 4.5kW), conversely, for a scenario when the daily demand is high, the AI-Agent adjusts the Adjustedaverage Daily Demand at a higher level (e.g. let's say 6.5kW, instead of 4.5kW). Thus AI-Agent attempts to avoid a situation where Batteries become fully charged or under-charged, and the Utility energy ends-up adding the kinks to the Adjusted-average Daily Demand, hence defeating the masking effect. # Simulation Results As explained in section II, the higher the accuracy of the Adjusted-average Daily Demand, the lesser will be the frequency and need for charging/discharging the Battery Banks. Figure 6 shows that when the proposed algorithm is not applied at all, the red graph (representing consumer's current load) fluctuates a lot over a 24-hour day. Thus there is neither privacy nor cost saving. Figure 8 shows the effect of AI-Agent's gap analysis and reveals that the step of gap analysis eliminates all the kinks, thus masking the consumer's usage pattern completely, as shown by the yellow line. Thus the beauty of the proposed solution is that it manages user privacy, as well as, energy. # Validity and Economic Viability of the Proposal Industry outlook shows that the global lithiumion battery market is expected to reach USD 93.1 billion by 2025 [15] [12]. The driving forces behind this huge market are EVs, micro-grids grids, and home storage systems due to significant growth in the solar industry. References [15][16] show that EV adoption rate has become exponential recently, thus the assumption of Dedicated Battery Banks and EV-Battery Banks in every home will be a reality in the years to come, thus the proposed approach is implementable practically. Reference [17] shows that the operation cost of a lithium-ion storage device is about $0.10 (10 cents) per kW, per cycle (calculated by dividing the upfront cost by the number of cycles these batteries can be used for). For our proposed system that requires about 10 kWh battery, and needs charging/discharging once a day for an average house, the operation cost comes out to be about $365 per year. On the other hand, our proposed scheduling step offers about a 25% reduction in utility bills, as evident from our work in [13]. If we assume that the average residential utility bill $125 per month or $1500 per year. The cost reduction through scheduling will be about $375 that offset the cost of having a privacy feature. Further [17] also shows that ESS batteries set a goal of $100 per kWh capital cost for the batteries that can run for many thousands of cycles. References [18][19][20] also indicate that the cost of operating such storage devices is declining rapidly. The math points to batteries that eventually cost a few cents per kWh. Thus the proposed approach is viable economically as well. V. # Conclusion This paper presents a novel solution that offers several features, such as it (a) masks consumers' utility usage data to conceal their utility usage patterns, thus preserves privacy, (b) offers scheduling that conserves energy, thus renders cost reduction in the utility bill, and also evens out the cost of Dedicated Battery Banks (c) it continuously computes gap between "Adjusted-average Daily Demand" and "Current Load" of a household and allows the battery to discharge only to fill the gaps, consequently eliminates the excessive discharging and charging of batteries, thus it lifts constraints on charging-discharging rates and temperature regulations, (d) is user-friendly, simple to implement, and efficient. Though we considered a residential user as an example in this paper, nothing prevents it to be used in industrial or commercial settings as well. Year 2020 2![Figure 2: Artificial Intelligence based system architecture The Agent Program is an implementation of an agent function and is shown in the flowchart of Figure 3. It receives information from the above-noted entities and consequently makes intelligent decisions to maximize the expected value of the objective function. While explaining the agent functions below, the above entities are elucidated. The AI-Agent is packaged and installed at the consumer's premises. It performs multiple tasks. It acquires system variables from the (a) Utility Server, (b) Weather Server, (c) Consumer's Smart Appliances, (d) Task Completion Register, (e) Energy-sources Tracker and Selector, and (f) Graphical User Interface. The AI-Agent receives the information from the Utility Server and the Weather Server either through 4G/5G technologies, or the smart meter as explained in [14]. The AI-Agent receives the information from the Consumer's Smart Appliances through Wi-Fi technologies, and from its subsystems, i.e. the Task Completion Register, the Energy-sources Tracker and Selector, and the Graphical User Interface over Bluetooth/Wi-Fi or internally wired communication interfaces.As depicted in figure3, the AI-Agent communicates and receives information from the Utility Server the forecasted load factor, and the complex tariff information for the next 24-hour on a daily basis through a Cloud. The Cloud network consists of a set of servers available to many users over the Internet. Utility companies are shifting to the cloud technology as it will](image-2.png "Figure 2 :") 3![Figure 3: AI-Agent based Consumer Privacy & Energy Managment AI-Agentcommunicates and receives information from the Weather Server, it acquires forecasted weather information, such as temperature, humidity, rain, sun, etc. for the same 24 hours for the consumer's location. AI-Agent uses the real-time prevailing weather information in making smart decisions while scheduling the daily tasks, such as laundry, dishwashing, and setting the optimal values of various thermostats of water heater, air conditioner, refrigerator, etc., AI-Agent communicates and receives information from the Consumer's Smart and IP addressable Appliances that include home appliances such as, washer/dryer, dishwasher, boiler/water heater, air conditioner, refrigerator, etc., and other devices such as home security systems, and the user's calendar, etc.](image-3.png "Figure 3 :") 4![Figure 4: 24-Hour Load Factor, and Adjusted Average Daily Demand of an Imaginary Consumer before Applying the Proposed Solution Figure 5 tries to depict the scheduling as well as the above noted three scenarios. The first peak demand of 7kW occurs for 15 minutes (i.e. 10:50 AM-11:05 AM and is shown in green color), and the second peak demand of 9kW for 4 hours (i.e. from 04:30 PM-08:30 PM and is shown in green color). The AI-Agent schedules the load smartly, i.e. it slashes the 15-minute peak (7kW-4.5kW= 2.5kW) and moves to 07:00 AM (see green color), and slashes the 4-hour peak (9kW -4.5kW= 4.5kW) and move it to 10:00 PM-01:00 AM (see green color).](image-4.png "Figure 4 :") 1![and 2, the AI-Agent selects the Utility Company only to feed the (a) base scheduled load/appliances (see the load shown in sky blue color, below dotted line see) (b) the rescheduled load/appliances (see the load shown in green color under the dotted line) and (c) charge Battery Banks (the load shown in yellow color, below dotted line) for 16hour duration (i.e. for the intervals from 12:00 AM to 10:30 AM, from 11:30 AM to 02:00 PM, and from 09:00 PM to 12:00 AM). Thus it is clear that the AI-Agent selects the Utility Company to feed during the intervals, Year 2020 ( ) D Artificial Intelligence Assisted Consumer Privacy and Electrical Energy Management the load is less than the Adjusted-average Daily Demand).](image-5.png "For scenario 1") 5![Figure 5: 24-Hour Load Factor, and Average Demand of an Imaginary Consumer after Applying the Proposed Solution The algorithm, finally, calculates the cycle time. If it is not reached to 24-Hour, the loop returns to the step of acquiring the system variables again. Otherwise, the Task Completion Register makes a daily log, inputs it to AI-Agent, and the machine learning algorithm. The AI-Agent calculates a new Adjusted-average Daily Demand for the next day.](image-6.png "Figure 5 :") ![Thus computing the Adjusted-average Daily Demand Journals Artificial Intelligence Assisted Consumer Privacy and Electrical Energy Management accurately carries vital importance. The AI-Agent prudently performs this job by acquiring real-time information from several entities including remote cloudbased servers, local servers, and machine-learning algorithm. We developed a MATLAB program to design the AI-Agent. The snapshot of the program is presented in Figure 9. Figures 5, 6, and 7 present the simulation results.](image-7.png "") 6![Figure 6: Current Load before Applying the Proposed Solution Figure 7 shows the effect of AI-Agent's scheduling and reveals that scheduling reduces several kinks in the blue line, thus bringing saving in the utility bills, however, it does not mask the user privacy.](image-8.png "Figure 6 :") 7![Figure 7: Load Curve after Applying Scheduling only](image-9.png "Figure 7 :") 8![Figure 8: Load Curve After Applying Proposed Solution](image-10.png "Figure 8 :") ## Acknowledgement The authors are also thankful to Dr. Zahid Saleem, Professor and Senior Vice President Development at Abasyn University Peshawar, Pakistan, for his continuous support, guidance, and help in teaching and helping conduct research. The authors are thankful to Dr. Muhammad Fasih Uddin Butt, Department of ECE, COMSATS University Islamabad, Pakistan, who had a great enthusiasm for collaboration and engaging his students in the research. Despite his busy life on his campus, he set-up meetings with the authors so that his students may learn the art of doing research and writing papers. The authors are thankful to the students, Ishtiaque Ahmed, Sidra Aslam, and Anas Ali Khan, who showed superb interest in getting involved in the research so that they may learn how to perform a literature survey, develop flowcharts, and write algorithms. * A Holistic View of Security and Privacy Issues in Smart Grids MRAsghar DMiorandi 2013 Springer Berlin Heidelberg * Privacy-Aware Smart Metering: A Survey SFinster IBaumgart IEEE Communications Surveys & Tutorials 17 2 2015 * Wireless network deployment in the smart grid: Design and evaluation issues CGentile DGriffith MSouryal IEEE Network 26 6 November 2012 * Communication network requirements for major smart grid applications in HAN, NAN and WAN MKudzu MPipattanasomporn SRahman Computer Networks 67 2014 Supplement C * Review: The role of communication systems in smart grids: Architectures, technical solutions and research challenges EAncillotti RBruno MConti Computer Communications 36 2013 * Wireless mesh network in smart grid: Modeling and analysis for time critical communications YXu WWang IEEE Transactions on Wireless Communications 12 7 July 2013 * Multimedia content identification through smart meter power usage profiles UGreveler BJustus DLoehr Proc. Comput., Privacy, Data Protection (CPDP) Comput., Privacy, Data Protection (CPDP)Brussels, Belgium Jan. 2012 * Secure wireless communication system for smart grid with rechargeable electric vehicles HSu MQiu HWang IEEE Communications Magazine 50 8 August 2012 * Private memoirs of a smart meter AMolina-Markham PShenoy KFu ECecchet DIrwin Proc. 2nd ACM Workshop Embedded Sensing Systems for Energy-Efficiency Building (BuildSys) 2nd ACM Workshop Embedded Sensing Systems for Energy-Efficiency Building (BuildSys) 2010 * Achieving differential privacy of data disclosure in the smart grid JZhao TJung YWang XLi IEEE INFOCOM 2014 -IEEE Conference on Computer Communications April 2014 * Achieving privacy protection using distributed load scheduling: A randomized approach EndongLiu PengCheng IEEE Transactions on Smart Grid 8 2017 * Lithium-Ion Battery Market Worth $93.1 Billion By Grand View Research Inc 2025. August 2017 * Smart energy-consumption management system considering consumers' spending goals (SEMS-CCSG) RYaqub SAhmad AAhmad MAmin International Transactions on Electrical Energy Systems 26 7 2015 * Impacts of plug-in electric vehicles in the portuguese electrical grid JDelgado RFaria PMoura ATDe Almeida Transportation Research Part D: Transport and Environment 62 2018 * Integration of electric vehicles in the electric power system JA PLopes FJSoares PM RAlmeida Proceedings of the IEEE the IEEE 2011 99 * How Cheap Can Energy Storage Get? Pretty Darn Cheap RamezNaam October 14, 2015 * Home Battery Market Expected to Match Solar Industry's Growth MBlack June 13. 2016 * Economic viability for residential battery storage systems in grid-connected PV plants SBarcellona LPiegari VMusolino CBallif IET Renewable Power Generation 12 2 February 2018 * A survey on smart metering and smart grid communication YKabuli Renewable and Sustainable Energy Reviews 57 May 2016