Smart microgrid is promising in providing a more affordable, efficient, and sustainable energy solution with increasing energy production from distributed renewable sources and diverse household electricity usage with large amounts of connected smart devices. Accurate prediction of the household electricity load and renewable energy production plays a significant role in achieving optimized efficiency of the microgrid. Meanwhile, the privacy and security of data sharing over the smart grid are crucial. This paper proposes a blockchain-enabled microgrid Internet of Things (MIoT) with accurate predictions of renewable energy production and household electricity load. The blockchain framework can guarantee the privacy and security of data sharing over the microgrid. An improved model by stacking long short-term memory (LSTM) and gated recurrent units (GRUs) is proposed for energy generation and electricity load predictions using historical data in the microgrid and the weather forecasting data. The sparrow search algorithm optimized by Levy flights (LevySSA) is used to optimize the hyperparameters of the stacked LSTM-GRU method. The experimental results verify the accuracy and robustness of the proposed method in the prediction of electricity load and renewable energy production for effective smart microgrid operation. For PV forecasting, the proposed LevySSA-LSTM-GRU achieves nRMSE = 0.0535, nMAE = 0.0455, and R2 = 0.9898, outperforming the strongest baseline. For load forecasting, averaged over four test intervals, it yields nRMSE = 0.1034, nMAE = 0.0836, with R2 = 0.9340, demonstrating consistent superiority compared with conventional baseline models. Overall, the proposed framework enables secure data sharing and high-accuracy forecasting, offering strong potential to support real-time energy management and operational optimization in smart microgrids.
Sun et al. (Thu,) studied this question.