Consensus-Based Decentralized Energy Trading for Distributed Energy Resources

In smart grids, distributed energy resources (DERs) have penetrated residential zones to provide a new form of electricity supply, mainly from renewable energy. Residential households and commercial buildings with DERs have become prosumers in the local grids, since they can sell surplus power to others. Researches have been initiated to integrate and utilize DERs through better control and communication strategies. With the advances in the Internet of Things (IoT) technology, unprecedented coordination among DERs can be achieved to facilitate energy trading and transactive energy management. However, preventing leakage of users' information during the optimization process keeps challenging researchers, which drives them to develop privacy-preserving energy management systems. In this paper, we develop a fully decentralized transactive energy management using the consensus-based algorithm. To be specific, we design a virtual pool for prosumers to trade energy and exchange information with IoT technologies' support. The consensus-based algorithm enables prosumers to obtain the optimal energy schedule independently in a coordinated manner without revealing any personal data. We use real-world data to perform simulations and validate our developed algorithm. The results show that our consensus-based decentralized transactive energy management strategy is feasible and can significantly reduce the overall system cost.


INTRODUCTION
The smart grid has been trending across the globe to develop grid intelligence and improve energy efficiency, and distributed energy resources (DERs) have been promoted to deploy at residential homes and commercial buildings to provide new types of sustainable energy sources. DERs, such as solar panels and electric vehicles used locally on the consumption side, transform users into prosumers providing clean energy more efficiently and reliably. Benefited from the evolution of two-way power flow [1] , prosumers with DERs can save on electricity bills by selling surplus power to the grid or participating in energy trading with other prosumers at a relatively lower price. The emergence of prosumers in the grid also enables a paradigm shift toward transactive energy [2] . To facilitate transactive energy management of DERs, sufficient information exchange with DERs is often necessary. Due to the nature of low-rate data transmission between DERs, it has been shown that the Internet of Things (IoT) technologies (e.g., Narrowband IoT) can outperform other types of network connection (e.g., WiFi) in DER communication [3] . With the development of IoT technology, the device-to-device (D2D) communications become much more intelligent [4] , and DER devices can be monitored and controlled more effectively [5] . This gives rise to lower latency and more considerable scalability in various arXiv:2110.15178v1 [eess.SY] 28 Oct 2021 smart grid applications [6] . This motivates us to study the following problem in the paper: what would be a good transactive energy management strategy that promotes efficient utilization of DERs using IoT communications?

Literature Review
Existing studies have investigated DERs utilization and coordination at the local level and holistic levels. At the local level, DERs with other electric appliances can form an intelligent microgrid or a virtual power plant to improve the grid's energy efficiency and reduce energy cost for prosumers [7] . The energy management system can optimize the energy usage schedule of HVAC and other DERs for each prosumer [8] . At the holistic level, transactive energy management can fully utilize renewable energy and other DERs for the whole grid network. The management processes typically require users to share their energy consumption preferences and then schedule cooperatively through a central optimization system. Luna et al. designed a centralized system to store and share energy among households, which fully utilizes all DERs in a coordinated manner [9] . Tenti et al. developed a cooperative framework to enhance the grid efficiency by reducing the distribution loss of DERs via central control [10] . Yi, Hong and Liu proposed an initialization-free distributed algorithms to eliminate the adaptation work whenever the network structure is changed [11] . However, these centralized management strategies raise privacy concerns, since users' private information would be at risk of leakage when solving a global optimization problem. Particularly for IoT environments, personal data can be easily exploited [12,13] , and data leakage may occur [14] .
Recent studies on distributed transactive energy management have been widely developed to address the challenges of privacy preservation. Parisio et al. validated the distributed coordination algorithm under the model predictive control framework, which allowed microgrids to perform local optimization sequentially [15] . However, usage information is still disclosed and may be exploited by outside parties. A better way to preserve privacy is to prevent personal data from transmitting to the system. Chang et al. employed the contract net protocol and multi-factor methods to carry out the energy exchange optimization alone without including any personal consumption information [16] . Ge et al. designed a novel decomposition algorithm to build a decentralized platform [17] , where energy transactions among users can be settled to preserve local load information. Le et al. adopted a distributed neurodynamic algorithm to optimize the energy trading by exchanging information among neighbors [18] . Nizami et al. developed a two-stage energy management system that enables energy trading between users under a separated transactive market [19] . Still, the success of trading bids heavily depends on users' inclinations, which would bring ineffectiveness in real-world applications.
Researchers have also made efforts on adding protection mechanisms to the information transmission. Aitzhan and Svetinovic [20] attempted to anonymize the trading transactions using multi-signatures and blockchain technologies. Yang and Wang [21,22] developed blockchain systems with smart contracts to implement distributed optimization algorithms for transactive energy management of smart homes. Chen et al. considered the blockchain technology in economic dispatch problems [23] and peer-to-peer energy trading [24] to secure the reliability without a coordinator. Lu et al. adopted Paillier encryption on the private information in the transactive energy system [25] . Nevertheless, both anonymization and encryption will require extra time and resources to protect user privacy, hindering the deployment of transactive energy systems.

Research Gap and Motivation
From the existing studies, we can see that different algorithms and technologies have their strengths and weaknesses to protect user information. Most of the proposed systems include central operators to perform the higher-level optimization process. Yang et al. proposed a consensus-based algorithm to solve the economic dispatch problem without any reliance on central controllers [26] . Zhao et al. also adopted the consensus-based algorithm to preserve privacy when obtaining the optimal solutions for smart grid energy management [27] . However, both of the studies focused on generation units other than prosumers with DERs. Unlike the above studies, we aim to optimize the energy scheduling for a group of prosumers using the consensus-based algorithm, which would help promote the installation of DERs in residential houses. Celik et al. developed a decentralized energy management system for smart homes by allowing coordinated energy sharing, which isolates the pricing mechanism from users [28] . Wang et al. designed a decentralized mechanism to incentivize users to share energy through evaluating their contributions [29] . In contrast, our market-like pool allows the trading price to be self-adjusted based on prosumers' trading decisions, reflecting the practice of a transactive market. Thus, the need to improve the management process of a fully decentralized system still exists to gain flexibility and protect user privacy at the same time. Our work aims to leverage the advances in IoT technologies enabling device-to-device communications to design privacy-preserving decentralized energy management algorithms for DERs.

Contribution and Paper Organization
In this paper, we present a consensus-based decentralized transactive energy management system with the support of IoT technologies. The main contributions of this work are summarized as follows.
1) Structural Flexibility: Unlike most existing studies of distributed energy management using a fixed communication topology, we establish a decentralized transactive energy system and a market-like virtual pool under flexible communication topology. Our decentralized algorithm enables prosumers to interact and exchange information to determine the optimal energy trading with their neighbors under an IoT network with different D2D communication structures.
2) Privacy preservation: We develop a consensus-based decentralized algorithm that enables users to reach an agreement on energy trading price and quantity over multiple time slots in the operational horizon. The equilibrium prices obtained for consecutive periods lead to an optimal solution to the transactive energy management problem. The consenting process only requires prosumers to share their energy trading data instead of the complete usage data, which would preserve users' privacy.
3) Real-world practicability: We validate our designed system and algorithm using real-world renewable energy and load data. The results show that the system cost is reduced by 17.30%, and the cost of individual prosumers can be reduced by up to 71.54%. The results also show the nearest-neighbor D2D communication structure achieves good convergence with much fewer direct connections among prosumers, compared with the all-connected communication structure, demonstrating the practical value of IoT technology for the future decentralized transactive energy system.
The rest of the paper is organized as follows. Section 2 describes the model of the consensus-based decentralized transactive energy system. Section 3 formulates the optimization problems for both standalone and coordinated scenarios of the system. Section 4 elaborates on the design of the consensus-based decentralized algorithm applied to transactive energy management of prosumers. Section 5 evaluates the proposed system with extensive simulations, and Section 6 concludes our work.

SYSTEM MODEL
Our system model consists of a power grid, a group of IoT-aided smart homes as prosumers with DERs, and a transactive market that connects prosumers, as shown in Figure 1. We assume that there are prosumers in the model, which can be denoted as the set  = {1, 2, … , }. We further assume that the system will operate in multiple time slots, which can be denoted as  = {1, 2, … , }, where is the total number of operating window slots. To be aligned with the market practice, we consider an hour as the operating slot and = 24 for each day.

Overall Framework
As shown in Figure 1, we consider that each prosumer is installed with DERs to generate renewable energy (e.g., solar panel or wind turbine) and other electric appliances to meet living requirements (e.g., air conditioner, washing machine, and lights). This is demonstrated by the different icons of devices surrounding the house icon. Each home is also equipped with an advanced smart meter and energy management system to monitor and schedule its own energy use of different types of flexible load. We model it as the Internal Energy Scheduling Layer. While our energy management system can optimize the energy schedules for prosumers with different preferences, it can manage the energy trading among prosumers as well. The power exchange represented by the green ellipse, which supports prosumers to trade energy with each other, forms a virtual pool for sharing energy generated from DERs. The communication required in the pool (e.g., information exchange and transactive activity) can also be facilitated by the IoT technologies applied on the smart meters, which together will constitute an External Energy Trading Layer. With transactive energy management, DERs can be fully utilized in the designated area in our model.

FIGURE 1
The transactive energy management system.

Internal Energy Scheduling Layer
We use prosumer and user interchangeably in this paper. As we mentioned earlier, each user's house is equipped with DERs and other appliances, which can be split into two parts: the supply model and the load model. The first part refers to the electricity supply either purchased from the grid or generated from the local DERs. The second part refers to the electricity demand from different appliances in the system.
The supply model for each user in  contains two terms G , and RE , in each time slot in , where G , denotes the amount of energy purchased from the grid, and RE , denotes the amount of renewable energy generated from DERs. Further, we define G to be the maximum capacity to draw electricity from the grid for user in any time slot, and RE , to be the available renewable energy from all deployed DERs in user 's home at time . Hence, the two power supply terms G , and RE , should be upper-bounded by G and RE , respectively and should always be non-negative, which can be expressed by the following two constraints: To promote energy saving and consumption fairness, the grid applies a tiered tariff scheme for users. For example, Austin Energy [30] has established a five-tier rate structure to charge higher-load consumers at higher rates, as illustrated in Figure 2. We apply the linear approximation to the tiered prices in order to build up our model in more generalized cases, where the unit electricity price is assumed to increase with the load amount linearly. The unit energy price is formulated as where the gradient term G represents the price increase for each unit increase in energy load, and the constant term G represents the base price. Hence, user 's grid cost becomes

FIGURE 2
An Example for tiered tariff billing with linear approximation (Data source: Austin Energy [30] ).
The load model for each user in time slot consists of HVAC load, other flexible loads, and inflexible loads, which can be denoted as AC , , F , and IL , , respectively. The HVAC load refers to the power consumption of the HVAC unit in adjusting indoor temperature through heating or cooling processes. We define IN , to be the indoor temperature and OUT , to be the outdoor temperature for user 's home in time slot . Then the time-series indoor temperature can be formulated according to the thermal dynamics for HVAC units [31] as where and denote the operating parameters of the HVAC units, and denotes the working mode of the HVAC unit. Cooling gives a positive value, and heating gives a negative value. In our simulations, and are set to 3.3 and 1.35 respectively for all users.
HVAC system operates according to the temperature value set by users, which is denoted as REF .
When the indoor temperature deviates from the setpoint value, it will cause an uncomfortable feeling to users. We consider such discomfort as the cost in managing HVAC, which is modeled by a quadratic cost function as where AC denotes the sensitivity coefficient for user .
Also, we define IN and IN as the lower and upper bounds of user 's tolerable indoor temperature. Hence, the following constraint should be applied to the indoor temperature in time slot : Other flexible loads, denoted by F , , refers to the loads that can be shifted over time but cannot be curtailed due to users' living requirements, such as cooking and laundry. We define F , and F , as the lower and upper bounds of user 's flexible load in time slot , and thus the following constraint should be satisfied Usually, users have their own most comfortable schedule for flexible activities like cooking or doing laundry. We denote REF , as the preferred flexible load schedule for user in time slot . Hence, the total amount of other flexible loads in energy management should always equal to the sum of the preferred schedule, which can be expressed by the following constraint We also consider the user discomfort occurred when the flexible load is shifted away from the preferred schedule. This kind of discomfort represents the cost of managing flexible loads, which can be modeled by the quadratic cost function below where F denotes the sensitivity coefficient of user towards the flexible load deviation. Other inflexible loads IL , include the electricity consumption of all other appliances that are not adjustable in the system, such as light.

External Energy Trading Layer
In our aforementioned structure, at the same time as scheduling their internal energy, users can trade energy with peers via the virtual power exchange pool using IoT-aided communications. Different from energy-trading studies in [32] that forms energy-trading pairs, out work does not require users to identify specific trading partners. Specifically, the transactive energy management system enables users to sell their surplus renewable energy to those having high power demand. The selling parties can have cash inflows to cover some of their electricity bills, whereas the buying parties can purchase energy at a lower price than the regular grid price.
Here, we do not allow prosumers to sell surplus energy to the grid but only to their neighbors. A study on Australian households [33] has shown that the high penetration of renewable energy at the consumption end will have large financial impacts on centralized power generations but minimal impacts on other consumers who do not have DERs. Therefore, self-consumption is encouraged in a system with a high DER penetration rate to diminish the impacts on the grid network.
We denote the amount of power traded by user in time slot as ET , . Here, a positive ET , represents the status of purchasing power from the others, and a negative ET , represents the status of selling power to the others. Under the IoT environment, we omit any time lag to process trading information in our model. We also assume that any amount of power exchange can be completed instantly and simultaneously, and there is no electricity loss during the trading, because the geographic distance between any two of the prosumers' houses is negligible. Since the transactive energy cannot be stored for later use in our virtual trading pool, the scheduled trades for all users should be balanced in any time slot , which can be expressed by which means that the sum of energy trading amounts for all users should be cleared by the end of each time slot. In addition, users should only sell the surplus energy generated from DERs. It will become practically inefficient if the user tries to sell the energy amount over his capacity to generate, because it has to purchase the defective part from the grid at the same time. Therefore, we apply another constraint to prevent users from overselling the renewable energy by lower bounding the energy trading amount ET , .
where − RE , represents the case of selling all the available renewable energy. The cost/profit of energy trading will be discussed in later sections when formulating the coordinated scenario for our transactive energy management system.

PROBLEM FORMULATION
In this section, we consider two scenarios by formulating the optimization problems for both standalone and coordinated energy management of DERs. In the first scenario, each prosumer's energy schedule is optimized independently, where communication and energy trades among users are not required for energy management. In the second scenario, users can trade renewable energy with peers in a coordinated manner to achieve a globally optimal solution for transactive energy management.

Standalone Scenario
In the standalone scenario, the smart meter equipped in each prosumer's house will schedule the internal energy consumption directly without considering any external factors. For each user in  , power can be supplied either from the grid G , or local DERs RE , to different types of consumption including HVAC load AC , , other flexible load F , and the inflexible load IL , . To shorten the notation, we redefine the following variables as RE ={ RE , , ∀ ∈}, G ={ G , , ∀ ∈}, AC ={ AC , , ∀ ∈}, F ={ F , , ∀ ∈}, and IL ={ IL , , ∀ ∈}. During the energy management process, user 's power supply and demand must be equal in each time slot, which leads to the constraint The left-hand side of (13) represents the total power supply, and the right-hand side of (13) denotes the total demand from the HVAC load AC , , the other flexible load F , and the inflexible load IL , . For the standalone energy management, the overall operating cost of user over the entire time slots  is where G ( G ) denotes the electricity bill from the grid, AC ( AC ) denotes the user's discomfort cost of HVAC, and F ( F ) denotes the user's discomfort cost for shifting other flexible load. The energy management system aims to minimize users' total cost in (14). Therefore, User 's Cost Minimization Problem (UCMP ) for the whole operating period  can be formulated as follows. Based on our analysis, user can locally solve the optimization problem in UCMP since it is a standard convex optimization. We denote the optimal total cost in problem UCMP bȳ O and let this value serve as a benchmark cost for the comparison with the costs in the coordinated scenario.

Coordinated Scenario
Unlike the standalone scenario, users not only schedule their internal power supply and demand but also exchange energy externally with other users when needed in the coordinated scenario. Users with surplus renewable energy can sell their energy to other users via the grid; also, users can purchase energy from their neighbors other than the grid to lower the total costs. The energy trading is taken into account, and the load balance constraint becomes Study has shown that the dynamic Lagrangian multiplier can achieve a fast convergence in economic dispatch problems [34] . We introduce the Lagrange multiplier for the constraints (11). The Lagrangian function for our optimization problem should be As we assume that the users can trade energy at any price that they are willing to pay, and such a trading pool can be seen as a perfect market. Hence, the Lagrange multiplier can be considered as the equilibrium price, where the energy trading costs over the entire time slots  can be defined as: In the coordinated energy management system, the system overall cost consists of user's individual operating cost O ( G , AC ) and the trading cost ET ( ET ). Therefore, we formulate the Coordinated Cost Minimization Problem (CCMP) for the platform over the whole operating period  as CCMP: subject to (1), (2), (5), (7), (8), (9), (11), (12), (15) variables: We see that Problem CCMP jointly solves the optimal internal energy scheduling (of renewable and HVAC load) and the optimal external energy trading for all the users. However, solving CCMP in a centralized manner may cause severe privacy concerns because the users have to reveal all their parameters to the platform. To preserve users' privacy and enable coordinated energy management, we aim to solve Problem CCMP in a decentralized manner in Section 4.

DECENTRALIZED ALGORITHM DESIGN
Consensus-based algorithms can achieve decentralized coordination through finding a certain variable value that is agreed among agents or players [26] . Since the Problem CCMP is to find the global optimization for all residential users, consensusbased algorithms can be applied to avoid a central coordinator along with its higher-level calculation and its vulnerability in preventing data leakage. As most of the relevant papers have adopted the electricity prices as the consensus variable [27,35] , we can use the trading prices among users to achieve consensus in our Problem CCMP. We assume that the energy trading market among users is perfectly competitive, which means the trading prices at any single point of time should be public and at equilibrium. We assume rational prosumers who aim to minimize the expected energy costs under a perfect market, as we aim to automate the optimization process for the energy trading without personal interventions. Since all optimizations will be conducted independently by each user, they do not need to share their personal consumption data with others. The only information to be exchanged among neighbors is the estimated trading price and the estimated energy mismatch, which represents the imbalance in the trading pool. Then for each iteration , each user updates its trading price estimates based on its neighbours' estimates according to the communication matrix , where each element , represents the weight that user put on user 's estimation. They will adjust this weighted average estimation by a correction term that equals to its energy mismatch estimates multiplied by a learning rate constant . It means if the energy demand in the trading pool is higher than the energy supply (i.e., the energy mismatch is positive), the trading price should go up, and vice versa, according to the microeconomic principles. Hence, this price update step can be formulated as With the new estimated trading price , [ ], each user can determine its energy trading schedule by independently finding the optimal solution of its own Cost Minimization Problem, which refers to the individual part of the Problem CCMP, i.e., the overall costs plus the energy trading costs. Specifically, the individual-level problem (ILP ) for the whole operating period  is formulated as ILP : subject to (1), (2), (5), (7), (8), (9), (12), (15) variables: After solving ILP, user will obtain its energy trading decision ET . Each user will then update its energy mismatch estimates based on its neighbours' estimates according to and a correction term, which is equal to the difference between current and previous energy trading schedules. The energy mismatch update step can be formulated as The above process will iteratively update users' estimations and optimizations until the consensus is reached. Theoretically, this consensus algorithm's convergence is guaranteed as long as there is a valid trading price corresponding to the minimized cost function [36] . Hence, the iteration loop will be terminated when the two most recent iterations' trading prices have a tolerable difference, and the energy mismatches are tolerably small for all users, e.g., Also, Liu et al.'s work has proved that the converged results of consensus variable is the unique and optimal solution to the original problem [37] . Therefore, when all the users reach an agreement for the trading price according to (20), their energy schedules will converge to the optimal solution of Problem CCMP. The flow chart shown in Figure 4 illustrates the process of our designed consensus-based algorithm.

FIGURE 4
The consensus-based algorithm for our transactive energy management system.

SIMULATION RESULTS AND DISCUSSIONS
In this section, we evaluate the transactive energy management system under both standalone and coordinated scenarios through extensive numerical simulations with real data of renewable generation [38,39] and load from homes [40] . The simulation data include users' daily electricity usage, renewable energy generation, and outdoor temperature.To validate the consensus-based decentralized optimization algorithm developed in Section 4, we simulate a group of 10 users, and their corresponding smart homes are equipped with DERs and other appliances according to the system model we set up in Section 2.

Algorithm Convergence
We firstly evaluate the performance of the decentralized optimization algorithm in Section 4 with 10 users. The convergence test of the consensus-based decentralized algorithm mainly targets two aspects: the trading price consensus and the trading balance in the trading pool.
The trading price consensus means that all users will agree to the same energy trading price in any time slot. In the designed algorithm, the convergence of trading price can be observed directly by the changes to users' estimations (i.e., , ) throughout the iteration process. As shown in Figure 5, we randomly select 6 time slots in the Day 1 simulation and plot the estimated trading price for each user with respect to the number of iterations. We can see that the trading price estimated by each user can always converge to an equilibrium value after around 30 iterations through IoT-aided communications. To further evidence the flexibility of our proposed model, we attempted to validate it under different kinds of communication network structures and larger user scales. As shown in Figure 6, we similarly plot the estimated trading price for two selected time slots for three scenarios: (a) 10 users under the one-to-many structure, (b) 10 users under the nearest-four structure, and (c) 50 users under the all-linked structure. We can observe that the convergence still holds under different types of communication networks and different scales of the user group. However, when there are insufficient links between users, it will cost more iterations, e.g., over 150 times under scenario (a), which is reasonable since coordination works better with more links.

FIGURE 6
The convergence of models with different users and communication networks.
The other aspect, trading balance, refers to the supply-and-demand balance of users' optimal energy exchange in any time slot. In microeconomic theories, the total supply amount should be equal to the total demand amount for a commodity at equilibrium under the perfectly competitive market. Hence, the supply energy should be equal to the demand energy within our virtual trading pool when the algorithm converges. This can be tested by calculating the total amount of actual mismatch in the power exchange for all users and in all time slots (i.e., ∑ ∈ ∑ ∈ ET , ) throughout the iteration process. As shown in Figure 7, we plot the sum of actual mismatches for all time slots with respect to the number of iterations in the Day 1 simulation under the four scenarios we obtained previously. Figure 7(a) can compare the convergence among three types of communication networks. The one-to-many structure requires the longest time to converge, whereas the all-linked structure is the fastest. Again, it illustrates that more links among the network will help speed up the convergence process given the same number of users. Figure 7(b) shows it takes much more iterations if we have more users in the network, e.g., 50 users will need about 500 times of iterations. Regarding the time for transmitting data through IoT communication, our model only requires prosumers to request two data values (i.e., the estimated trading price and the estimated energy mismatch) from linked neighbors. Hence, the time spent to complete one iteration will relate to the number of links in the networks. In other words, a more complex network will take a longer time to process each iteration. In our simulation, 30 iterations take around 3 seconds for 10 users under an all-linked network.

Optimal Energy Management
Secondly, we illustrate the optimal solution obtained from the model simulation for both internal and external layers under the coordinated scenario.
For Internal Energy Scheduling Layer, as shown in Figure 8, we plot the final energy scheduling outputs for all 10 users when the convergence is achieved. We can see that the Grid Usage, which represents the amount of energy purchased from the grid, is managed to be much stable at most of time for all users. In comparison with Renewable Energy, which indicates the utilization of DERs, the patterns for these two energy sources show a complementary relationship throughout the simulation week. It suggests that the stabilization in the grid is mostly benefited from the optimum use of renewable energy generated from DERs. The plot for HVAC Load has similar peak hours to the Renewable Energy, which demonstrates that the energy management system can adjust the undulation of electricity consumption according to the effectiveness of DER generation.

FIGURE 8
The optimal energy schedule under coopertative management in one-week simulation.
For the External Trading Layer, as shown in Figure 9, we plot the final energy trading arrangements for selected users in the one-week simulation, where the orange bars with positive value represent the buying parties in the trading and the purple bars with negative value represents the selling parties. We can observe that there are 3 typical types of users in energy trading. The first type refers to those who are buying a lot of energy from other peers most of the time, such as User 4 shown in Figure 9(a). It means that their DERs cannot generate enough renewable energy to cover their own demand. The second type refers to those who mostly behave as energy sellers, such as User 3 shown in Figure 9(b). They often have surplus renewable energy for sale, because they have a high DER capacity to cover their daily load. The rest of the users who have mixed positions as buyers and sellers throughout the scheduling period are classified as the third type like User 10 shown in Figure 9(c). They can exchange power with others as they needed, such that all renewable energy will be fully utilized locally in the neighborhood.

FIGURE 9
The optimal energy trading history for selected users under coopertative management in one-week simulation.

Energy and Cost Reduction
Lastly, we evaluate the cost reduction for users after implementing our transactive energy management system by comparing the standalone and coordinated scenarios.
As shown in Figure 10, the blue line indicates the scheduled amount of grid energy purchased by User 6 under standalone management. The red line shows his new schedule after joining the coordinated trading with his peers. We can see that the electricity purchased from outside power plants has been significantly reduced during the entire simulated week, given that the consumptions are not much affected. Hence, the goal of energy-saving can be well achieved under our coordinated strategy.

FIGURE 10
The comparison of grid power purchased by User 4 under standalone and coordinated scenarios.
As shown in Figure 11, we plot the overall costs for each user under the two scenarios (orange bars for the standalone scenario and purple bars for the coordinated scenario) and compute their percentage changes (the number above bars). The results show that the coordinated management system can lower the overall cost for all participated users. The cost reduction for individual producers can be reduced from 8.00% to 71.54% at most, and clearly, users who sell more in energy trade can benefit more. The system's total cost can be reduced by 17.30%, which demonstrates a remarkable economic advantage for our transactive energy management system.

FIGURE 11
The overall costs for all 10 users under standalone and coordinated scenarios. (The percentage number above bars refers to the cost reduction.)

CONCLUSION
This paper presented a consensus-based decentralized transactive energy management strategy that enables prosumers with DERs to trade energy with each other in an automated manner. We adopted a consensus-based algorithm to achieve decentralized coordination and hence to improve the utilization of local DERs.
• Our designed algorithm does not require any central coordinator, because it can be completely set up with D2D communication supported by IoT technologies. Also, our model will be maneuverable to different types of D2D communication network structures.
• Information transmitted between the IoT-aided smart meters only involves individual estimations on trading prices and energy mismatch during iterations, which means personal usage information will not be shared with others, and users' privacy can be well preserved.
• Our simulation results showed that our system is feasible under different network structures and scalable to different sizes of grids. The costs for both the gird and all users can be significantly reduced under our model.
• For future work, we will improve the iteration process of the consensus-based algorithm when implementing it in a larger community with more homes. Also, we will attempt to integrate our transactive energy management system with blockchain technology (e.g., smart contract) to further enhance the automation process and secure personal transactive information during energy trading.