Federated learning (FL) allows data owners to train neural networks together without sharing local data, allowing the industrial Internet of Things (IIoT) to share a variety of data. However, traditional FL frameworks suffer from data heterogeneity and outdated models. To address these issues, this paper proposes a dual-blockchain based multi-layer grouping federated learning (BMFL) architecture. BMFL divides the participant groups based on the training tasks, then realizes the model training by combining synchronous and asynchronous FL through the multi-layer grouping structure, and uses the model blockchain to record the characteristic tags of the global model, allowing group-manners to extract the model based on the feature requirements and solving the problem of data heterogeneity. In addition, to protect the privacy of the model gradient parameters and manage the key, the global model is stored in ciphertext, and the chameleon hash algorithm is used to perform the modification and management of the encrypted key on the key blockchain while keeping the block header hash unchanged. Finally, we evaluate the performance of BMFL on different public datasets and verify the practicality of the scheme with real fault datasets. The experimental results show that the proposed BMFL exhibits more stable and accurate convergence behavior than the classic FL algorithm, and the key revocation overhead time is reasonable.