With the construction of the power Internet of Things, the number of terminal accesses has increased greatly, and achieving low latency and providing real-time services are two major challenges faced by the traditional power Internet of Things. Although there are already some encryption schemes designed to promote secure communication in the power Internet of Things system, the existing schemes generally do not support anonymous and flexible key management. In this paper, based on the consensus mechanism of the block chain, ensures that the decentralized nodes in the power Internet of Things system are guaranteed to achieve the consistency in the block chain system. A block chain-based mutual authentication and key scheme for smart grid systems is proposed. Based on the characteristics of the block chain consensus mechanism, the scheme can support efficient conditional anonymity and key management. It proposes a solution to the problem of secure private communication and key management which is effective for terminal (TA) and data aggregators (DA), and provides an effective key update and revocation algorithm. This paper analyzes the experimental data of the storage cost and time cost of the proposed scheme. The experimental results are compared with the three key management authentication schemes proposed by other papers respectively. The results show that this scheme has obvious advantages in storage cost and time cost. Finally, a discussion and analysis between safety and efficiency are carried out, and constructive opinions are put forward for the construction of the future power Internet of Things.