With the widespread application of real-time embedded systems, the contradiction between the energy consumption requirements of modern processors and the limited battery capacity becomes more obvious. Dynamic voltage scaling (DVS) has been proven to be one of the most effective technologies for energy management. However, recent studies have shown that the use of DVS leads to a significant increase in the transient fault rate of processors as the characteristic size of logic gates (or transistors) gets smaller and smaller. In this paper, we consider the problem of assigning processing frequencies to a group of periodic real-time tasks so as to minimize the overall energy consumption under the constraints of time and reliability. Firstly, under the DVS, we take the reliability of the embedded systems into consideration through the regularization terms and present the energy consumption optimization model based on the meta-heuristic algorithms. Secondly, a novel algorithm for adaptive differential whale swarm optimization (ADWOA) is proposed according to the optimization requirements. Finally, the optimized data are saved on the chain through the storable feature of the blockchain for the necessary queries. It is worth noting that the on-chain data contains the intrinsic characteristics of the embedded system, which may give rise to the disclosure of processor privacy. Therefore, we come up with the differential privacy on-chain creating algorithm (DPCA) to protect the privacy of data on the chain. Experimental results show that ADWOA can minimize the energy consumption in real-time embedded system on the premise of ensuring system reliability and privacy.