With the development of artificial intelligence and blockchain technology, the training of deep learning models needs large computing resources. Meanwhile, the Proof of Work (PoW) consensus mechanism in blockchain systems often leads to the wastage of computing resources. This article combines distributed deep learning (DDL) with blockchain technology and proposes a blockchain consensus scheme based on the proof of distributed deep learning work (BCDDL) to reduce the waste of computing resources in blockchain. BCDDL treats DDL training as a mining task and allocates different training data to different nodes based on their computing power to improve the utilization rate of computing resources. In order to balance the demand and supply of computing resources and incentivize nodes to participate in training tasks and consensus, a dynamic incentive mechanism based on task size and computing resources (DIM-TSCR) is proposed. In addition, in order to reduce the impact of malicious nodes on the accuracy of the global model, a model aggregation algorithm based on training data size and model accuracy (MAA-TM) is designed. Experiments demonstrate that BCDDL can significantly increase the utilization rate of computing resources and diminish the impact of malicious nodes on the accuracy of the global model.