摘要:Single point of failure and node attack tend to cause instability in the centralized Internet of Things (IoT). Combined with blockchain technology, the deficiency of traditional IoT architecture can be effectively alleviated. However, the existing blockchain consensus mechanism still has the problems of forks and wasting of computing power. Therefore, this paper proposes a new framework based on a two-stage credit calculation to handle these problems. Notably, the nodes are selected through the model, and these nodes will compete on the chain according to the behavior of participating in the creation of the block. Then, a comparative simulation with the existing consensus mechanism proof of work (PoW) is presented. The results show that the proposed framework can quickly eliminate malicious nodes, maintain the overall security of the blockchain and reduce consensus delay.