I. Introduction
With the rapid development of Internet of Things (IoT) technology and the popularity of IoT devices [1], [2], an era of the interconnection of everything has arrived. A prominent example of the IoT is the smart grid [3], which can be seen as the next generation of the electricity grid [4]. Smart grids consist of multiple smart components that sense measurements and send this data over the network, thus enabling real-time feedback on energy consumption. The widespread use of smart grid technologies is due to the popularity of the use of heterogeneous energy sources such as renewable and nonrenewable resources and the need for simultaneous energy production and consumption. Smart grid has new features such as dynamic and transparent electricity prices, free electricity trading between energy producers and energy consumers [5], etc. Specifically, households, communities, or factories cannot only meet their own electricity needs by generating electricity by themselves, but also make profits by selling excess electricity to nearby users at a suitable price through the smart grid [6], [7].