A federated learning method and device based on a sharded blockchain, equipment and medium

By scoring the behavior and performance of blockchain nodes, nodes are redistributed to even out the performance differences between shards, thus solving the problem of uneven execution rates among shards in the federated learning system and improving the overall execution efficiency of the system.

CN114611721BActive Publication Date: 2026-01-06GUANGDONG UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210257885.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2026-01-06
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

In existing federated learning systems that incorporate sharding technology, the performance differences between shards due to variations in the performance of blockchain nodes are significant, impacting the overall system execution speed.

Method used

By scoring the verification behavior and response latency of general nodes, a behavior record table and performance score are constructed. Nodes are then redistributed to even out the performance differences between shards. The PoW consensus mechanism is used to determine the leader and master nodes of ordinary shards.

Benefits of technology

This reduces the performance differences between shards, making the execution time of each ordinary shard similar when performing the same task, thus improving the overall operating speed of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114611721B_ABST
    Figure CN114611721B_ABST
Patent Text Reader

Abstract

The application discloses a federated learning method and device based on a sharded blockchain, and equipment and a medium. The method comprises the following steps: a master node in a common shard constructs a behavior record table based on the verification behavior of a general node in the same common shard, and determines the behavior score of the general node based on the behavior record table; after the master node in the common shard issues a calculation task, the response time delay of the general node in the same common shard is recorded, and the performance score of the general node is determined based on the response time delay; the master node in the leader shard re-determines the general node in each common shard based on the behavior score and the performance score of each general node. The application can determine the behavior score and the performance score according to the verification behavior and the response time delay of the general node, re-determine the general node in the common shard based on the behavior score and the performance score of the general node, and thus reduce the performance difference between the shards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of blockchain and federated learning technology, and in particular to a federated learning method, apparatus, device and medium based on sharded blockchain. Background Technology

[0002] Federated learning is an emerging foundational artificial intelligence technology used to build shared models between mobile terminals and servers. This enables the effective utilization of large-scale data resources while ensuring user privacy and security. Federated learning refers to a distributed machine learning method where participants train their data on local data, upload updated parameters to a server, and the server aggregates the parameters to obtain the overall set of parameters. Compared to traditional machine learning techniques, federated learning not only improves learning efficiency but also integrates and utilizes data scattered across various organizations and institutions while meeting data privacy requirements.

[0003] Blockchain is a novel distributed infrastructure and computing paradigm that utilizes a block-chain data structure to verify and store data, distributed node consensus algorithms to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script code to program and manipulate data. Due to the decentralized, traceable, immutable, programmable, and collectively maintained characteristics of blockchain, using its distributed storage architecture as the foundation for federated learning, and designing protocols at the blockchain layer to implement model aggregation tasks on the client side, can ensure the consistency of model parameters among multiple participants in federated learning, as well as the secure and reliable synchronization and sharing of model parameters. Furthermore, a reasonable incentive mechanism within the blockchain provides a technical solution to enhance the enthusiasm of participants in collaboratively training federated learning models.

[0004] Sharding technology was initially proposed to optimize large centralized databases. Specifically, it involves dividing the data in a large database into many shards and then distributing these shards across different servers, thereby improving the overall performance of the database. Inspired by the sharding technology used in large centralized databases, developers proposed applying sharding to blockchain architecture. In a blockchain, any change to the ledger requires consensus from all nodes in the network. Its transparent and immutable characteristics reduce trust costs in multi-party scenarios. Each transaction goes through four processes—transaction generation, block construction, block competition, and block broadcasting—before being recorded in the blockchain. It is only finally confirmed after being signed by a majority of nodes. This complex consensus process, while ensuring security, limits scalability and thus becomes a bottleneck for improving blockchain network performance. With sharding, nodes within a single shard only need to handle a portion of the network's work, allowing shards to work in parallel, thereby improving the overall network's capacity.

[0005] Existing federated learning systems that incorporate sharding technology primarily employ a random sharding strategy. However, due to the varying performance of nodes within a blockchain system, random sharding can lead to significant performance differences between shards, negatively impacting the overall system execution speed. Summary of the Invention

[0006] This application proposes a federated learning method, apparatus, device, and medium based on sharded blockchain. It determines the general nodes within each general shard by using the behavior scores and performance scores of each general node, thereby reducing the performance differences between general shards and improving the overall throughput of the system.

[0007] To achieve the above objectives, this application adopts the following technical solution:

[0008] Firstly, this application provides a federated learning method based on sharded blockchains, including:

[0009] In a normal shard, the master node constructs a behavior record table based on the verification behavior of the general nodes within the same normal shard, and determines the behavior score of the general nodes based on the behavior record table.

[0010] After the master node in a normal shard issues a computing task, it records the response latency of the general nodes within the same normal shard and determines the performance score of the general nodes based on the response latency.

[0011] The master node in the leader shard will evenly distribute general nodes with behavior scores below the threshold to each ordinary shard, and will evenly distribute the remaining general nodes to each ordinary shard according to their performance scores.

[0012] According to one achievable method of the first aspect of this application, the member nodes in the leader shard and the master nodes in the ordinary shard are determined through a PoW consensus mechanism.

[0013] According to one achievable method of the first aspect of this application, the master node in the ordinary shard constructs a behavior record table based on the verification behavior of general nodes within the same ordinary shard, including:

[0014] The master node in each ordinary shard receives the basic model issued by the leader shard and distributes the basic model to multiple smart terminals. The basic model is constructed by the leader shard based on the federated learning task in the smart contract.

[0015] The multiple smart terminals train the basic model to obtain corresponding gradient data, and package it into multiple transactions and submit them to ordinary shards;

[0016] In a regular shard, the general nodes verify the multiple transactions, and the master node in the same regular shard records the verification behavior of each general node to construct a behavior record table.

[0017] According to one achievable method of the first aspect of this application, the general nodes in the ordinary shard verify the multiple transactions, and the master node in the same ordinary shard records the verification behavior of each general node to construct a behavior record table, including:

[0018] In a regular shard, a general node verifies the multiple transactions to determine the legitimate transactions among them.

[0019] The master node in a regular shard determines the malicious behavior of each general node based on the verification behavior of each general node in the same regular shard for the legitimate transaction, and records the malicious behavior of each general node in the behavior record table.

[0020] According to one achievable method of the first aspect of this application, the general nodes in the ordinary shard verify the plurality of transactions to determine the legitimate transactions among the plurality of transactions, including:

[0021] The general nodes in the ordinary shard verify the multiple transactions;

[0022] Transactions that pass verification more than a preset number will be considered valid transactions.

[0023] Secondly, this application provides a federated learning system based on sharded blockchain, including...

[0024] The behavior scoring determination module is used to construct a behavior record table based on the verification behavior of general nodes within the same ordinary shard by the master node in the ordinary shard, and to determine the behavior score of the general node based on the behavior record table.

[0025] The performance scoring determination module is used to record the response latency of general nodes within the same general shard after the computing task is issued by the master node in the general shard, and to determine the performance score of the general node based on the response latency.

[0026] The general node determination module is used to evenly distribute general nodes with behavior scores below a threshold to each ordinary shard through the master node in the leader shard, and to evenly distribute the remaining general nodes to each ordinary shard according to their performance scores.

[0027] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement any of the above-described steps of federated learning based on sharded blockchain.

[0028] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps of federated learning based on sharded blockchain described above.

[0029] Compared with existing technologies, this application provides a federated learning method, apparatus, device, and medium based on sharded blockchain. This application can determine behavior scores and performance scores based on the verification behavior and response latency of general nodes, and redetermine general nodes in ordinary shards based on the behavior scores and performance scores of general nodes, thereby reducing the performance differences between shards and making the execution time of each ordinary shard similar when performing the same task, thus improving the overall working speed of the system. Attached Figure Description

[0030] Figure 1 A flowchart illustrating the federated learning method based on sharded blockchain provided in a preferred embodiment of this application;

[0031] Figure 2 A structural block diagram of a sharded blockchain-based federated learning device provided in a preferred embodiment of this application;

[0032] Figure 3 This is a diagram illustrating the overall working framework of a sharded blockchain system, provided as a preferred embodiment of this application. Detailed Implementation

[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0034] The term "comprising" and any variations thereof in the specification and claims of this application are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product or device.

[0035] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.

[0036] like Figure 1 This application discloses a federated learning method based on sharded blockchain, the method comprising:

[0037] S1. The master node in a normal shard constructs a behavior record table based on the verification behavior of the general nodes within the same normal shard, and determines the behavior score of the general nodes based on the behavior record table.

[0038] S2. After the master node in a normal shard issues a computing task, it records the response latency of the general nodes in the same normal shard and determines the performance score of the general nodes based on the response latency.

[0039] S3. The master node in the leader shard will evenly distribute general nodes with behavior scores below the threshold to each ordinary shard, and will evenly distribute the remaining general nodes to each ordinary shard according to their performance scores.

[0040] Specifically, the member nodes (i.e., master nodes and general nodes) in both ordinary shards and leader shards are blockchain nodes. The master nodes in ordinary shards and the member nodes in leader shards are determined in advance through the PoW consensus mechanism. In the initial training iteration of federated learning, the general nodes in ordinary shards are determined randomly.

[0041] Specifically, response latency refers to the time delay between the master node of a regular shard issuing a computation task and receiving the response from the regular node. The performance score of a regular node can be determined based on response latency as follows:

[0042] The computational performance of general nodes is evaluated based on their response latency. Based on the evaluation results, general nodes are divided into three categories: excellent, medium, and poor performance. The performance scores of general nodes in the excellent, medium, and poor performance categories are 3, 2, and 1, respectively (general nodes in the excellent performance category have the shortest response latency, while general nodes in the poor performance category have the longest response latency).

[0043] Specifically, the master node in the leader shard will evenly distribute general nodes with behavior scores below the threshold to each ordinary shard, and will evenly distribute the remaining general nodes to each ordinary shard according to their performance scores.

[0044] Specifically, such as Figure 3As shown, in federated learning, the member nodes in the leader shard and the master nodes in the ordinary shards are determined in advance through the PoW consensus mechanism. In the first training iteration of federated learning, the general nodes in the ordinary shards are determined in a random manner. In subsequent training iterations, the performance scores and behavior scores of all general nodes are determined first based on the first training iteration, and then the general nodes in the ordinary shards are determined based on the performance scores and behavior scores of each general node. During the initial training iteration, the user publishes a federated learning task via a smart contract. The leading shard builds a basic model based on the federated learning task in the smart contract and distributes the basic model to the master nodes of each ordinary shard. The master nodes of each ordinary shard then select multiple smart terminals to train the basic model. The smart terminals package the trained gradient data into transactions and submit them to the corresponding ordinary shards. The ordinary nodes in the ordinary shards verify the received transactions. The master nodes in the ordinary shards obtain the gradient data from the verified transactions and test the obtained gradient data one by one using the test dataset. The master nodes of the ordinary shards determine the weight value of each gradient data based on the test results of each gradient data, and then aggregate each gradient data based on the weight value to generate a local model (i.e., a local gradient). After the data (gradient data) is packaged into transactions, it is submitted to the leader shard. The master node in the leader shard receives the transactions uploaded by each ordinary shard and obtains the local model (i.e., local gradient data) of each ordinary shard. Then, the master node in the leader shard uses the test dataset to test each local model (i.e., local gradient data) to obtain test results. Based on the test results, it determines the weight value of each local model and then aggregates the local models to generate a global model (i.e., global gradient data). Since the user also publishes the federated learning task at the same time as publishing the basic model, if the generated global model does not meet the requirements of the federated learning task, the smart terminal will use the global model as the basic model in the new round of iteration training and use local data to train a new basic model until the final generated global model meets the requirements of the federated learning task.

[0045] In this embodiment, the general nodes in a regular shard need to verify the received transactions. In the federated learning system, the master nodes in each regular shard receive the basic model issued by the leader shard. The master nodes in each regular shard select multiple smart terminals to train the basic model. The smart terminals use local data to train the basic model. Since the local data of each smart terminal is different, the gradient data obtained by each smart terminal is different. The smart terminal packages the trained gradient data into a transaction and sends it to the corresponding regular shard. After the regular shard receives the transaction uploaded by the smart terminal, the general nodes in the regular shard verify the transaction. Only after the transaction is verified (the transaction is considered valid when more than a certain number of general nodes in the regular shard verify it) can the gradient data in the transaction be used to aggregate and generate an aggregated model. In a regular shard, the master node records the verification behavior of each general node to form a behavior record table for each shard. Verification behavior refers to the verification actions of general nodes on legitimate transactions. When verifying a transaction, a general node's verification behavior can either fail or succeed. If a general node fails to verify a legitimate transaction, then that general node's verification behavior is considered malicious. The master node in the same regular shard will then count these malicious behaviors and record them in the behavior record table. Each regular shard's behavior record table primarily records the number of malicious behaviors by each general node. The master node in the regular shard then uses these behaviors as a basis for further analysis. The record table can then score the behavior of each general node. Since general nodes with behavior scores below the threshold have a significant impact on sharding performance, when allocating nodes in ordinary shards, general nodes with behavior scores below the threshold are first screened out and evenly distributed among the various ordinary shards to ensure that the number of general nodes with low behavior scores in each ordinary shard is similar. Then, the remaining general nodes are evenly distributed among the ordinary shards based on their performance scores. Determining general nodes in ordinary shards from both behavior and performance scores can further reduce the performance differences between ordinary shards, making the execution time of each ordinary shard similar when performing the same task, thereby improving the overall system speed.

[0046] In one embodiment, the member nodes in the leader shard and the master nodes in the ordinary shard are determined through a PoW consensus mechanism.

[0047] In this embodiment, since the member nodes in the leader shard and the master nodes in the ordinary shard consume more computing power and storage during the federated learning process than other blockchain nodes, nodes with strong storage and computing performance are selected as the member nodes in the leader shard and the master nodes in the ordinary shard.

[0048] In one embodiment, the master node in the ordinary shard constructs a behavior record table based on the verification behavior of general nodes within the same ordinary shard, including:

[0049] The master node in each ordinary shard receives the basic model issued by the leader shard and distributes the basic model to multiple smart terminals. The basic model is constructed by the leader shard based on the federated learning task in the smart contract.

[0050] The multiple smart terminals train the basic model to obtain corresponding gradient data, and package it into multiple transactions and submit them to ordinary shards;

[0051] In a regular shard, the general nodes verify the multiple transactions, and the master node in the same regular shard records the verification behavior of each general node to construct a behavior record table.

[0052] In this embodiment, the verification behavior of general nodes within a common shard refers to the verification behavior of received transactions. That is, when verifying a received transaction, there are two possible results: verification successful or failed. During federated learning, general nodes within a common shard receive a large number of transactions. If the master node within a common shard were to build a behavior record table based on the verification behavior of general nodes for all transactions, it would significantly increase the system's workload. Furthermore, the verification behavior of each general node for a portion of transactions does not affect the accuracy of the behavior score. Therefore, to reduce the workload of the master node in the common shard, the behavior record table is built only based on transactions packaged and generated by the smart terminal; that is, transactions packaged by the smart terminal from the gradient data generated by training the basic model issued by the master node.

[0053] In one embodiment, general nodes in the ordinary shard verify the multiple transactions, and the master node in the same ordinary shard records the verification behavior of each general node to construct a behavior record table, including:

[0054] In a regular shard, a general node verifies the multiple transactions to determine the legitimate transactions among them.

[0055] The master node in a regular shard determines the malicious behavior of each general node based on the verification behavior of each general node in the same regular shard for the legitimate transaction, and records the malicious behavior of each general node in the behavior record table.

[0056] In this embodiment, legitimate transactions can be determined by the verification behavior of all general nodes within a common shard, i.e., transactions that pass verification within the same common shard. However, recording all verification behaviors of general nodes within a common shard in the behavior log table would place a huge storage burden on the master node within that shard. Therefore, to alleviate the storage pressure on the master node in a common shard, the behavior log table only needs to record malicious behavior from each general node within that shard (a general node failing to verify a legitimate transaction is counted as one malicious behavior).

[0057] In one embodiment, a general node in the ordinary shard verifies the plurality of transactions to determine the legitimate transactions among the plurality of transactions, including:

[0058] The general nodes in the ordinary shard verify the multiple transactions;

[0059] Transactions that pass verification more than a preset number will be considered valid transactions.

[0060] In this embodiment, the general nodes in the ordinary shard first verify the received transaction, and then aggregate the gradient data in the verified transaction to generate a local model (i.e., local gradient data). In order to ensure the amount of gradient data used to aggregate and generate the local model, when the number of times the transaction is verified by the general node is greater than a preset number, the transaction can be determined as a valid transaction. The preset number is set in advance.

[0061] As shown in Figure 2, this application also discloses a federated learning device based on sharded blockchain, the device comprising:

[0062] The behavior scoring determination module 201 is used to construct a behavior record table based on the verification behavior of general nodes within the same ordinary shard by the master node in the ordinary shard, and to determine the behavior score of the general node based on the behavior record table.

[0063] The performance scoring determination module 202 is used to record the response latency of general nodes within the same general shard after the computing task is issued by the master node in the general shard, and to determine the performance score of the general node based on the response latency.

[0064] The general node determination module 203 is used to evenly distribute general nodes with behavior scores below a threshold to each ordinary shard through the master node in the leader shard, and to evenly distribute the remaining general nodes to each ordinary shard according to their performance scores.

[0065] In one embodiment, the behavior scoring determination module 201 includes:

[0066] The basic model distribution unit is used to receive the basic model distributed by the leader shard through the master node in each ordinary shard, and distribute the basic model to multiple smart terminals. The basic model is constructed by the leader shard based on the federated learning task in the smart contract.

[0067] The transaction generation unit is used to train the basic model through the multiple smart terminals to obtain the corresponding gradient data, and package it into multiple transactions and submit them to the ordinary shard.

[0068] The behavior record table construction unit is used to verify the multiple transactions through general nodes in the ordinary shard, and the master node in the same ordinary shard records the verification behavior of each general node to construct the behavior record table.

[0069] In one embodiment, the behavior scoring determination module 201 includes:

[0070] The legitimate transaction determination unit is used to verify the multiple transactions through general nodes in the ordinary shard and determine the legitimate transactions among the multiple transactions;

[0071] The malicious behavior recording unit is used to determine the malicious behavior of each general node by the master node in the ordinary shard based on the verification behavior of each general node in the same ordinary shard on the legitimate transaction, and to record the malicious behavior of each general node in the behavior recording table.

[0072] In one embodiment, the behavior scoring determination module 201 includes:

[0073] A transaction verification unit is used to verify the multiple transactions through general nodes in the ordinary shard;

[0074] The legitimate transaction determination unit is used to identify transactions that pass verification more than a preset number of times as legitimate transactions.

[0075] In one embodiment, an electronic device, specifically a computer device, is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the sharded blockchain-based federated learning method described above.

[0076] In one embodiment, a computer-readable storage medium is provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, represents the steps of a federated learning method based on a sharded blockchain as described above.

[0077] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.

[0078] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, ROM (Read-Only Memory), or RAM (Random Access Memory), etc.

Claims

1. A federated learning method based on a sharded blockchain, characterized in that, The method comprises the steps of: The leader shard constructs a base model based on a federated learning task in a smart contract and distributes the base model to master nodes of each ordinary shard; The master nodes in the ordinary shards select a plurality of intelligent terminals, train the base model based on data of the plurality of intelligent terminals, and obtain gradient data; The member nodes in the leader shard and the master nodes in the ordinary shards are determined through a PoW consensus mechanism; The general nodes in the ordinary shards obtain the gradient data of the intelligent terminals and verify, and in the verification, the master nodes in each ordinary shard receive the base model distributed by the leader shard, and distribute the base model to a plurality of intelligent terminals, wherein the base model is obtained by the leader shard based on a federated learning task in a smart contract; The plurality of intelligent terminals train the base model to obtain corresponding gradient data, and pack the gradient data into a plurality of transactions and submit them to the ordinary shards; The general nodes in the ordinary shards verify the plurality of transactions, and the master nodes in the same ordinary shard record the verification behaviors of each general node to construct a behavior record table; Based on the behavior record table, the behavior scores of the general nodes are determined, and the master nodes of the ordinary shards record the response time delays of the general nodes in the same ordinary shard, and determine the performance scores of the general nodes based on the response time delays; The master nodes in the ordinary shards obtain the gradient data that passes the verification, generate a local model based on the gradient data, and send the local model, the behavior scores and the performance scores to the leader shard; The leader shard aggregates the local model parameters of each ordinary shard to generate a global model; The master nodes in the leader shard uniformly distribute the general nodes with behavior scores lower than a threshold to each ordinary shard, and uniformly distribute the remaining general nodes to each ordinary shard according to the performance scores.

2. The federated learning method based on the sharded blockchain according to claim 1, characterized in that, The general nodes in the ordinary shards verify the plurality of transactions, and the master nodes in the same ordinary shard record the verification behaviors of each general node to construct a behavior record table, comprising: The general nodes in the ordinary shards verify the plurality of transactions, determine the legal transactions in the plurality of transactions, and The master nodes in the ordinary shards determine the number of malicious behaviors of each general node according to the verification behaviors of the general nodes in the same ordinary shard on the legal transactions, and record the number of malicious behaviors of each general node in the behavior record table.

3. The federated learning method based on the sharded blockchain according to claim 2, characterized in that, The general nodes in the ordinary shards verify the plurality of transactions, determine the legal transactions in the plurality of transactions, comprising: The general nodes in the ordinary shards verify the plurality of transactions; The transactions with a verification pass number greater than a preset number are regarded as legal transactions.

4. A federated learning device based on a sharded blockchain, characterized in that, The method comprises the steps of: A model training module is configured to construct a base model based on a federated learning task in a smart contract by the leader shard, and distribute the base model to master nodes of each ordinary shard; The master nodes in the ordinary shards select a plurality of intelligent terminals, train the base model based on data of the plurality of intelligent terminals, and obtain gradient data; The general nodes in the ordinary shards obtain the gradient data of the intelligent terminals and verify, and in the verification, the master nodes in each ordinary shard receive the base model distributed by the leader shard, and distribute the base model to a plurality of intelligent terminals, wherein the base model is obtained by the leader shard based on a federated learning task in a smart contract; The score determination module is configured to acquire gradient data of the intelligent terminal by a general node in the common shard and verify, when verified, the main node of the common shard constructs a behavior record table based on the verification behavior of the general node in the same common shard, and determines a behavior score of the general node based on the behavior record table, the main node of the common shard records a response time delay of the general node in the same common shard, and determines a performance score of the general node based on the response time delay; The aggregation module is configured to acquire the verified gradient data by the main node in the common shard, generate a local model based on the gradient data, and send the local model, the behavior score and the performance score to the leader shard; The model generation module is configured to aggregate local model parameters of each common shard by the leader shard, and generate a global model; The re-allocation module is configured to acquire the verified gradient data by the main node in the common shard, generate a local model based on the gradient data, and send the local model, the behavior score and the performance score to the main node of the leader shard; the main node in the leader shard uniformly allocates the general nodes with a behavior score lower than a threshold to each common shard, and uniformly allocates the remaining general nodes to each common shard according to the performance score.

5. An electronic device, characterized in that... The memory, the processor and the computer program stored in the memory and capable of running on the processor are included, and the processor implements the steps of the federated learning method based on the sharded blockchain according to any one of claims 1-3 when executing the computer program.

6. A computer readable storage medium characterized by, The storage medium stores the computer program, and the computer program is executed by the processor to implement the steps of the federated learning method based on the sharded blockchain according to any one of claims 1-3.

Citation Information

Patent Citations

  • Block chain fragment scheduling method and device, equipment and storage medium

    CN112615905A