Multi-layer robust federated learning layered framework implementation method based on block chain

By introducing the multi -layer snacks of the federal federal learning layered framework in the federal learning system, the problem of the central server failure and poisoning attacks are solved, the greater robustness and security are achieved, and the data and models are ensured. Safety.

CN119378707APending Publication Date: 2025-01-28HANGZHOU POST QUANTUM CRYPTOGRAPHY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411261620.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Existing federated learning systems are prone to crashes in the event of central server failure or poisoning attacks, and data privacy protection is insufficient, making it difficult to effectively prevent data leakage and model poisoning.

Method used

Based on a blockchain -based multi -layer federal federal learning layered framework, data security and privacy protection are ensured through the decentralized architecture and encryption mechanism of the blockchain. This framework includes clients, node control layers, and blockchain layers. Through model evaluation and distribution strategies, it improves the robustness and anti -poisoning ability of the system.

Benefits of technology

It has significantly improved the robustness and security of the federal learning system, reduced the iteration time of the client, enhanced the defense ability of poisoning attacks, and ensured the security of data and models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378707A_ABST
    Figure CN119378707A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-layer robust federated learning hierarchical framework implementation method based on a block chain. A client, a node control layer and a block chain layer are included. The method comprises the following steps: S1, separately sending training data to clients participating in training; s2, the client carries out independent training on each piece of training data, obtains local model data after training is completed, and uploads the local model data to a node control layer; s3, receiving the local model data by the node control layer, performing model evaluation on the local model data, selecting an optimal model, and generating global model data; s4, if the model training is completed, uploading the trained global model data to a block chain layer; otherwise, the global model data is sent to the client side for model updating, and the step S2 is executed again for the next round of training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cyberspace security technology, and in particular to a method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain. Background Art

[0002] With the development of Internet of Things (IoT), different devices, including mobile devices, smart homes, drones, can be used as high-performance and extremely low-latency computing devices. To this end, on-device training or called edge computing may be an effective solution, and deep neural network models can be applied to edge devices or IoT. However, local training requires a large amount of data that is difficult to obtain for old clients. Therefore, a method is needed to share computing power among different users, that is, different clients can collaborate with their data to complete similar tasks.

[0003] In recent years, federated learning has been widely used in our lives. Federated learning is a distributed machine learning method that aims to solve the problems of data privacy and data dispersion. Traditional machine learning methods usually require that data sets be stored centrally on a central server or in the cloud, while federated learning pushes the computational process of machine learning to the edge device or local server where the data is located to protect the user's data privacy. It is widely used due to its ability to protect the user's original data, where users only need to upload the parameters of the locally trained model instead of local data. However, federated learning relies on its centralized structure, which means that if the central server fails, the model training of federated learning will have problems, and its privacy protection is also fragile.

[0004] In addition, there will be a problem of insufficient data during the training of the local model. In order to solve the problem of insufficient data for local model training, attackers can now use the GAN method to reconstruct local data from unencrypted parameters and increase the training of the local model. GAN is a machine learning model proposed by Ian Goodfellow et al. in 2014. It consists of two neural networks that compete with each other, one is the generator and the other is the discriminator. The goal of the generator is to learn to generate new samples that are similar to real data, such as images, audio, or text. It receives a random noise vector as input and gradually transforms it into generated samples through a series of neural network layers. The output of the generator is passed to the discriminator. The goal of the discriminator is to distinguish between samples generated by the generator and real data. It receives real samples and generated samples as input and outputs a probability indicating the probability that the input sample is a real sample. The discriminator improves its ability to distinguish between real samples and generated samples through training. The training process of GAN is a zero-sum game process. The goal of the generator is to deceive the discriminator as much as possible and generate realistic samples that the discriminator cannot accurately distinguish. The goal of the discriminator is to distinguish between real samples and generated samples as accurately as possible. Through repeated iterative training, the generator and the discriminator will compete with each other and gradually improve the quality of generated samples.

[0005] The present invention is a typical decentralized architecture with an encrypted so-called algorithm blockchain proposed by Zheng et al. The main features of blockchain include avoiding data corruption, decentralized architecture, encrypted transactions, distributed ledgers, consensus, and faster settlement. Therefore, this method can ensure the security of data. Inspired by blockchain, Kim et al. proposed a federated learning architecture in which blockchain is connected to devices, in which the entire blockchain is regarded as a central server and each user is represented as a block on the chain. This method can effectively protect the privacy information of each user. Specifically, the technical solution of this technology includes the following steps:

[0006] 1. Blockchain decentralized architecture: Zheng et al. developed a secure and efficient solution to address the shortcomings of centralized architecture, namely a blockchain decentralized architecture with encryption. The architecture is mainly that a node first requests a transaction, then passes the requested transaction into a P2P network and broadcasts it to each node. A single node receives the request and uses an algorithm to approve the transaction. A new block will be generated based on the approved transaction and added to the public ledger. After the new block is added to the existing chain, the transaction will be completed and permanently completed.

[0007] 2. Blockchain Federated Learning Framework: The logical structure of the learning framework constructed by Kim et al. is mainly composed of devices and miners. Miners can be physically randomly selected devices or independent nodes, such as network edges (i.e., base stations in cellular networks), which are relatively free from energy constraints during the mining process. The operation of the framework is summarized as follows: each device calculates local model updates and uploads them to the associated miners in the blockchain network; miners exchange and verify all local model updates and then run proof of work (PoW); once the miner completes PoW, it generates a block that records the verified local model updates; finally, the generated block storing the aggregated local model updates is added to the blockchain, also known as the distributed ledger, and downloaded by the device. Each device calculates the global model update from the new block.

[0008] Disadvantages of existing technology:

[0009] However, federated learning still has many disadvantages. For example, if the central server fails, the centralized architecture is vulnerable to attacks, and erroneous global model updates can affect the performance of all local models. In addition, many research works have shown that federated learning is vulnerable to inference attacks. Zhang et al. applied generative adversarial networks (GANs) to generate private training data from other participants, and then flipped the labels, poisoned the local data, and trained the local models. After the attacker uploaded his local model update, the global model would be poisoned. Bagdasaryan et al. proposed a constraint and scale technique to train a model on backdoored data and replace the global model. To defend against poisoning attacks on federated learning, Zhao et al. proposed a server-side GAN to generate data from uploaded gradients and audited the data using a server-side audit dataset to check whether the client is malicious. However, this method requires high computational cost on the server-side GAN.

[0010] Therefore, a secure and efficient solution is needed to address the shortcomings of centralized architecture. Summary of the invention

[0011] The purpose of the present invention is to provide a method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain to overcome the shortcomings of the prior art.

[0012] To achieve the above object, the present invention provides the following technical solutions:

[0013] The present application discloses a method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain, including a client, a node control layer, and a blockchain layer;

[0014] The steps include:

[0015] S1: Send training data to each client participating in the training separately;

[0016] S2: The client performs separate training for each training data, obtains local model data after training, and uploads it to the node control layer;

[0017] S3: The node control layer receives local model data, performs model evaluation on the local model data, selects the best model, and generates global model data;

[0018] S4: If the model training is completed, the trained global model data will be uploaded to the blockchain layer; otherwise, the global model data will be sent to the client for model update and returned to S2 for the next round of training.

[0019] Preferably, S2 comprises the following steps:

[0020] S21: The training data is unique, and the node control layer sends the training data to the client;

[0021] S22: If the training round is 1, the client trains the training data; otherwise, the client trains according to the training data and the results of the previous round of training to generate local model data;

[0022] S23: Send the trained local model data to the node control layer;

[0023] S24: The client sends the training process to the node control layer.

[0024] Preferably, after receiving the local model data, the node control layer aggregates the local model data of the client, and then distributes it evenly, and distributes it to each client by an average distribution method.

[0025] Preferably, S3 comprises the following sub-steps:

[0026] S31: The node control layer obtains the verification set through the training data;

[0027] S32: The node control layer compares the local model data provided by the client through the verification set, arranges the local model data according to performance, and selects the best model as the global model;

[0028] S33: Distribute local model data to different clients based on performance.

[0029] Preferably, the local model data and training process submitted by the client are compared, and the client that destroys the accuracy of the model is marked as a malicious user. When distributing local model data, the higher performance model is allocated to ordinary users, and the local model data with good running condition is distributed to malicious users.

[0030] Preferably, selecting the best model in S3 includes the following sub-steps:

[0031] A1: The node control layer obtains the aggregated average data through the local model information of all clients in the current round;

[0032] A2: When the round is not 1, the node control layer calculates by aggregating the average model and the global model information of the previous round to select the best model.

[0033] Preferably, the model update in S4 includes the following contents: the node control layer sends the local model data to the client, and the client performs training calculations on the local model data distributed by the node control layer and the local model data of the previous round in the client to obtain updated local model data.

[0034] The present invention discloses a device for implementing a multi-layer robust federated learning hierarchical framework based on blockchain, comprising a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the above-mentioned method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain.

[0035] The present invention discloses a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the above-mentioned method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain is implemented.

[0036] Beneficial effects of the present invention:

[0037] (1) The blockchain encryption mechanism method proposed in the present invention is aimed at the inefficiency problem in the decentralized architecture of blockchain. Compared with the federated learning block, the model proposed by this method significantly reduces the time consumed by each client iteration; this method applies secure transactions and fork mechanisms to implement a peer-to-peer negotiation method, which facilitates the process of synchronizing data with other nodes on the chain; however, in the federated learning block, a fixed-period waiting mechanism is used to ensure data consistency between all nodes; the waiting time T is crucial to determining the overall accuracy of the federated learning block; the delay starts from 9.12 seconds in the first iteration and is reduced to 5.45 seconds in the 13th iteration; compared with the federated learning block in 15 client training iterations, the total delay is reduced by about 40 seconds;

[0038] (2) The present invention proposes a set of robust anti-poisoning strategy methods embedded in a three-layer framework to address the problem of weak robustness in the blockchain federated learning framework; assuming that one of the node control layer nodes is poisoned in the framework, the accuracy of the poisoned node control layer model remains at 10%; however, after the second non-poisoned node joins the federated learning, the overall accuracy rate increases from 10% to 90%, and after 15 iterations, the performance stabilizes from 2 nodes to 5 nodes; malicious users train the model with poisoned data, and the performance of the poisoned node control layer model cannot be improved; however, the node control layer compares the performance of the models from the client and blockchain layers, and uploads or distributes the higher-performance model to the client and blockchain layers; therefore, from the perspective of the non-poisoned node, the performance of both the node control layer and the blockchain layer maintains the same performance as normal federated learning, that is, more than 90%;

[0039] (3) The method proposed in the present invention is tested on the MNIST dataset. The test results show that the proposed method achieves higher accuracy at both the node control layer and the blockchain layer in single-node mode, which is 95.98% compared to 93% for the federated learning block on the MNIST dataset. The blockchain of the federated learning block framework is only used to synchronize, average and distribute the global model on all connected federated learning clients, similar to the single-node mode in the proposed method, and the federated learning block also needs to average the model multiple times at the blockchain level; compared with the single-node mode, the multi-node mode requires an external averaging mechanism to merge the uploaded models from other nodes running federated learning, and the overall accuracy will be slightly reduced due to the cost of averaging; Table I proves that the performance from the single-node mode to the 5-node mode is only reduced from 95.98 to 91.57; in this experiment, the effectiveness of the framework of this method is proved.

[0040] The features and advantages of the present invention will be described in detail through embodiments in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flowchart of a method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain in the present invention;

[0042] Figure 2 It is a structural diagram of the present invention;

[0043] Figure 3 It is a structural diagram of the device of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below through the accompanying drawings and embodiments. However, it should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the scope of the present invention. In addition, in the following description, the description of known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.

[0045] See also Figures 1-2 , an embodiment of the present invention provides a method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain, in which the robustness of federated learning in the industrial field is studied by conducting an in-depth analysis and research on the security issues of existing federated learning. This method proposes a robust blockchain multi-layer decentralized federated learning (RBML-DFL) framework to ensure the robustness of federated learning. First, the blockchain adopts a three-layer framework to connect the federated learning components to ensure the privacy and data security of federated learning. Secondly, compared with the typical federated learning framework, the framework provides resilience to poisoning attacks on the central model. Finally, compared with centralized federated learning, the decentralized structure associated with the blockchain tracking return mechanism can prevent the central server from malfunctioning or failing. This method evaluates and compares the accuracy, latency, and system robustness of the proposed framework with other state-of-the-art federated learning frameworks under poisoning attacks. Therefore, the proposed method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain makes federated learning more suitable for applications in Internet of Things scenarios.

[0046] Includes client, node control layer and blockchain layer;

[0047] The steps include:

[0048] S1: Send training data to each client participating in the training separately;

[0049] S2: The client performs separate training for each training data, obtains local model data after training, and uploads it to the node control layer;

[0050] S3: The node control layer receives local model data, performs model evaluation on the local model data, selects the best model, and generates global model data;

[0051] S4: If the model training is completed, the trained global model data will be uploaded to the blockchain layer; otherwise, the global model data will be sent to the client for model update and returned to S2 for the next round of training.

[0052] Specifically, they are:

[0053] (1) Before performing a federated learning task, you need to first collect the clients that need to be trained and determine the amount of training data for the federated learning client layer. Then, the collected client information is trained separately, and each client is trained separately to protect the user's privacy. For each trained client model, it will be uploaded to the node control layer separately. During this upload process, it will not interact with any other clients, and the client's data will not be contributed to the node control layer. The uploaded information is only the trained model parameters;

[0054] (2) The node control layer will receive the models trained by the client and manage the parameters of these models. The node control layer aggregates the parameter information of all clients and then distributes it evenly, and distributes this evenly distributed information to each client model. The client model receives this distributed information and updates the model. The updated model will start the next round of model training until the model training is completed. Client training---send to the node control layer---aggregate and distribute back to the client---the client continues training

[0055] At the same time, the node control layer will evaluate the models that have completed each round of training and allocate the models with higher performance to each client;

[0056] (3) For the blockchain layer, it is mainly responsible for providing inter-node communication horizontally to achieve basic blockchain security features, including ledger synchronization, work verification and verification blocks, as well as vertically supporting local control socket APIs called by the node control layer within the same node.

[0057] The S2 comprises the following steps:

[0058] S21: The training data is unique, and the node control layer sends the training data to the client;

[0059] S22: If the training round is 1, the client trains the training data; otherwise, the client trains according to the training data and the results of the previous round of training to generate local model data;

[0060] S23: Send the trained local model data to the node control layer;

[0061] S24: The client sends the training process to the node control layer.

[0062] Specifically, they are:

[0063] In the federated learning client layer, j federated learning clients are located, denoted as C j Each client C j Have a unique set of training data d j , thesej Separated from the node controller layer on node i above. C j Returns a trained model m j , while also providing the basic model M i And a client training process, client j training is calculated by the following formula:

[0064]

[0065] In the formula, Represents the training result of client j in T rounds. is the result of the last round of training of client j in T, d j That is the training data of client j.

[0066] After each client completes training, the parameter information of the trained model is uploaded to the node control layer.

[0067] After receiving the local model data, the node control layer aggregates the local model data of the client, and then distributes it evenly, and distributes it to each client through an average distribution method.

[0068] The S3 comprises the following sub-steps:

[0069] S31: The node control layer obtains the verification set through the training data;

[0070] S32: The node control layer compares the local model data provided by the client through the verification set, arranges the local model data according to performance, and selects the best model as the global model;

[0071] S33: Distribute local model data to different clients based on performance.

[0072] The verification set is obtained through the training data. The training data is split into two parts, one for training and one for verification, and the part used for verification is called the verification set.

[0073] The local model data and training process submitted by the client are compared, and the clients that damage the accuracy of the model are marked as malicious users. When distributing local model data, models with higher performance are assigned to ordinary users, and local model data with good running conditions are distributed to malicious users.

[0074] The selection of the best model in S3 includes the following sub-steps:

[0075] A1: The node control layer obtains the aggregated average data through the local model information of all clients in the current round;

[0076] A2: When the round is not 1, the node control layer calculates by aggregating the average model and the global model information of the previous round to select the best model.

[0077] Specifically, they are:

[0078] Aiming at the inefficiency problem in the decentralized architecture of blockchain, the present invention proposes a robust, secure and efficient multi-layer federated learning structure. Through the encrypted transactions of blockchain, the central server failure or decentralized structure failure is prevented, and the security of the model is maintained during the upload and download process. The node controller layer evenly distributes the models uploaded by the clients from the federated learning client layer and owns a part of the audit data set. Then, the node control layer forwards the local average model to the upper layer of the blockchain through an encrypted transaction to securely upload the currently trained model to the blockchain. When the new data block is synchronized and secure on the chain, the blockchain layer adapts to the robustness requirements according to different blockchain-level averaging strategies and averages the latest models uploaded by all connected nodes.

[0079] The node control layer mainly includes two tasks, namely traffic management and model evaluation. The first is the traffic management part, which mainly receives the model information of each client through the node controller, aggregates the client model information and averages the aggregated model parameter information, and saves the model in the node control layer. Secondly, the averagely distributed model parameter information is sent to the client layer for model information update. In each training iteration, the node control layer also receives the processed model from the client layer, including the training parameters from other nodes.

[0080] For model evaluation, the node control layer compares the models from the user and client layers by using the validation set and assigns the higher performing model to the user, while the malicious user will always receive a healthy model from the node control layer. At the same time, the node control layer only uploads the higher performing model to the client layer to avoid poor model training results.

[0081] Malicious users are a general term here. There are many participants in federated learning. Some of them are not for training a good global model, but for destroying the accuracy of the model. This kind of attack is called a poisoning attack. All users whose purpose is to destroy the accuracy of the global model are collectively referred to as malicious users.

[0082] The model that performs well refers to the global model that is not poisoned, which is not related to the dataset. It means that through our method, even if there are malicious users among the participants, the global model can always be kept non-poisoned.

[0083] The optimal model calculation for T rounds of iteration in the node control layer is calculated using the following formula:

[0084]

[0085] In the formula, is the model information of the T-wheel node control layer, where is the model information of the node control layer in round T, Aggregate and average all client models in round T to update the new round of models. is the model information of user i in round T-1, where the evaluation results of these two rounds of models are compared to select the best model.

[0086] The model update in S4 includes the following contents: the node control layer sends the local model data to the client, and the client performs training calculations on the local model data distributed by the node control layer and the local model data of the previous round in the client to obtain updated local model data.

[0087] Specifically, they are:

[0088] The calculation of the new round of model training for the model after iterating T rounds of distribution in the node control layer is calculated by the following formula:

[0089]

[0090] In the formula, Updated model information for client i in round T, The model parameter information distributed by the node control layer in round T is trained with the model information in the previous round to obtain the updated model information. i Defines how the conversion will be performed.

[0091] In order to solve the problem of weak robustness in the blockchain federated learning framework, a set of robust anti-poisoning strategies embedded in the 3-layer framework can reduce or avoid the damage of external malicious attacks at the server and client levels. First, it is stipulated that: N = {N1, N2, ..., N i} is a node in federated learning; C = {C1, C2, ..., C j} is the client on each node; M = {M1, M2, ..., M i} is the node-level global model; m = {m1, m2, ..., m j} is the client local model. This method is mainly used for client C located at node i. j , reset the client model using the following formula:

[0092]

[0093] Then the model is averaged for node i in the node control layer, and the formula is as follows:

[0094]

[0095] This is mainly for the client local model of T round Take the average.

[0096] Node i uses the model selector and the defined selection strategy in the node control layer to test and select the best model to upload. The formula is as follows:

[0097]

[0098] in, The model that averages the client model in the previous step. For the client model of round T-1, use the modelSel function to select the best model.

[0099] Node i at the blockchain layer, based on a typical blockchain implementation, will test and attempt to publish a new data block on the chain. When a new block is linked, the blockchain layer on node i calculates the average model assigned to the blockchain layer strategy, and the calculation formula is as follows:

[0100]

[0101] in, For the latest uploaded global model, the blockchain will synchronously update the client's update information.

[0102] Node i requests the latest average blockchain layer model at the node control layer, and then i The converted model is calculated as follows:

[0103]

[0104] in, This is the latest global model for round T. The client model of round T-1 is converted using the modelTrains function to obtain the latest average blockchain layer model

[0105] Finally, the node control layer distributes the better model from the previous comparison results to the connected clients located in the device layer.

[0106] The embodiment of the device for implementing a multi-layer robust federated learning hierarchical framework based on blockchain of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, the processor of any device with data processing capability reads the corresponding computer program instructions in the non-volatile memory into the memory for execution. From the hardware level, if Figure 3 As shown, it is a hardware structure diagram of any device with data processing capability where a multi-layer robust federated learning hierarchical framework implementation device based on blockchain of the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in the embodiment of the device may also include other hardware according to the actual function of the device with data processing capabilities, which will not be described in detail. The implementation process of the functions and effects of each unit in the above device is specifically detailed in the implementation process of the corresponding steps in the above method, which will not be described in detail here.

[0107] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0108] An embodiment of the present invention also provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a multi-layer robust federated learning hierarchical framework implementation device based on blockchain in the above embodiment is implemented.

[0109] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.

[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain, characterized by: Includes client, node control layer and blockchain layer; The steps include: S1: Send training data to each client participating in the training separately; S2: The client performs separate training for each training data, obtains local model data after training, and uploads it to the node control layer; S3: The node control layer receives local model data, performs model evaluation on the local model data, selects the best model, and generates global model data; S4: If the model training is completed, the trained global model data will be uploaded to the blockchain layer; otherwise, the global model data will be sent to the client for model update and returned to S2 for the next round of training.

2. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as claimed in claim 1, characterized in that: The S2 comprises the following steps: S21: The training data is unique, and the node control layer sends the training data to the client; S22: If the training round is 1, the client trains the training data; Otherwise, the client performs training based on the training data and the results of the previous round of training to generate local model data; S23: Send the trained local model data to the node control layer; S24: The client sends the training process to the node control layer.

3. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as claimed in claim 1, characterized in that: After receiving the local model data, the node control layer aggregates the local model data of the client, and then distributes it evenly, and distributes it to each client through an average distribution method.

4. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as claimed in claim 1, characterized in that: The S3 comprises the following sub-steps: S31: The node control layer obtains the verification set through the training data; S32: The node control layer compares the local model data provided by the client through the verification set, arranges the local model data according to performance, and selects the best model as the global model; S33: Distribute local model data to different clients based on performance.

5. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as claimed in claim 1, characterized in that: The local model data and training process submitted by the client are compared, and the clients that damage the accuracy of the model are marked as malicious users. When distributing local model data, models with higher performance are assigned to ordinary users, and local model data with good running conditions are distributed to malicious users.

6. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as claimed in claim 1, characterized in that: The selection of the best model in S3 includes the following sub-steps: A1: The node control layer obtains the aggregated average data through the local model information of all clients in the current round; A2: When the round is not 1, the node control layer calculates by aggregating the average model and the global model information of the previous round to select the best model.

7. A method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as claimed in claim 1, characterized in that: The model update in S4 includes the following contents: the node control layer sends the local model data to the client, and the client performs training calculations on the local model data distributed by the node control layer and the local model data of the previous round in the client to obtain updated local model data.

8. A device for implementing a multi-layer robust federated learning hierarchical framework based on blockchain, characterized in that: It includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement a blockchain-based multi-layer robust federated learning hierarchical framework implementation method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, a method for implementing a multi-layer robust federated learning hierarchical framework based on blockchain as described in any one of claims 1 to 7 is implemented.