In recent years, microgrids have attracted much attention as one of the typical applications of the Internet of Things (IoT). With the development of renewable energy, a bilayer energy-trading scenario of microgrids has emerged. In the upper layer, the microgrids trade energy with each other, and in the lower layer, users trade energy within the microgrid. Traditional management schemes based on the cooperation mode or island mode of the microgrids can no longer meet the needs of energy trading. In this article, we propose an energy-trading management solution for the bilayer energy-trading scenario. In order to maximize the bilayer’s [i.e., users’ and microgrid operators’ (MGOs)] utility functions under the condition of the local energy supply and demand, we propose a multiobjective optimization model. To solve the optimization model, we give a solution energy-trading management algorithm (ETMA) based on the nondominated sorting genetic algorithm (NSGA). Moreover, the proposed energy-trading framework that is based on the multiblockchain ensures the security and privacy of energy trading, and a consensus mechanism named the Delegated Proof of Reputation (DPoR) is proposed to urge users to complete the transaction according to their promised trading schemes. Experiments based on the real data of Guizhou are done to evaluate the performance of the proposed optimization model. The results show that our proposed model can achieve better performance in terms of users’ and MGOs’ utility functions in the bilayer energy-trading scenario compared with the traditional models.
In the ring-architecture-based federated learning framework, security and fairness are severely compromised when dishonest clients abort the training process after obtaining useful information. To solve the problem, we propose a Ring- architecture-based Fair Federated Learning framework called RingFFL, in which we design a penalty mechanism for FL. Before the training starts in each round, all clients that will participate in the training pay deposits in a set order and record the transactions on the blockchain to ensure that they are not tampered with. Subsequently, the clients perform the FL training process, and the correctness of the models transmitted by the clients is guaranteed by the HASH algorithm during the training process. When all clients perform honestly, each client can obtain the final model, and the number of digital currencies in each client’s wallet is kept constant; otherwise, the deposits of clients who leave halfway will be compensated to the clients who perform honestly during the training process. In this way, through the penalty mechanism, all clients either obtain the final model or are compensated, thus ensuring the fairness of federated learning. The security analysis and experimental results show that RingFFL not only guarantees the accuracy and security of the federated learning model but also guarantees the fairness.