Based on the introduction of blockchain technology, the article proposes Byzantine fault-tolerant consensus algorithm (DT-PBFT) based on dynamic credit mechanism, adopts credit score mechanism to protect the rights and interests of good nodes while penalizing evil nodes, and introduces a flexible dynamic adding and deleting mechanism to screen and eliminate the evil nodes. Subsequently, an on-chain and off-chain data collaborative algorithm model for blockchain traceability is proposed, which combines the master-slave replication principle to construct an on-chain log collaborative synchronization mechanism for off-chain data, takes the operation logs stored on the chain as the instruction to drive the update of off-chain traceability data, and combines with cryptographic algorithms to design the calculation method of off-chain data state, so as to achieve the collaborative feedback and sharing security between heterogeneous on-chain operation data and off-chain traceability data. Through the comparison experiments of consensus algorithms, it is proved that the DT-PBFT algorithm proposed in this paper is more flexible and efficient in the actual application process, and reduces the consumption of resources and improves energy saving at the same time. In the simulation simulation experiment of the cooperative mechanism, in the insertion time comparison, the overall efficiency of this paper’s method has been greatly improved, and there is an improvement of about 155ms under 20,000 pieces of data.