A Server Partitioned Federated Learning Method Based on Blockchain Sharding

By adopting sharding technology and parallel training in blockchain networks, combined with the consensus protocol of practical Byzantine fault tolerance algorithm (PBFT), the problems of low scalability and transaction delay in traditional blockchains in federated learning are solved, and the training efficiency of federated learning models is improved.

CN117094411BActive Publication Date: 2025-05-27CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311038541.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2025-05-27
Estimated Expiration
2043-08-17

AI Technical Summary

Technical Problem

The low scalability and transaction latency of traditional blockchains in federated learning lead to low consensus tasks in the training of federated learning model of large-scale clients, which reduces training efficiency.

Method used

The server partition federated learning method based on blockchain sharding is adopted, and the parallel training and parameter aggregation of each shard is achieved through the selection of blockchain network sharding and committee nodes, and the practical Byzantine fault tolerance algorithm (PBFT) is used as the consensus protocol.

Benefits of technology

It improves the consensus efficiency of blockchain networks, reduces the communication cost of federated learning, and improves the convergence speed of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117094411B_ABST
    Figure CN117094411B_ABST
Patent Text Reader

Abstract

The present invention relates to a server partitioned federated learning method based on blockchain sharding, belonging to the technical field of federated learning. The task publisher first registers in the blockchain network and publishes the federated learning training content and related requirements, and pays a fee as a prize pool. The federated learning client that applies to join the model training task and is approved by the task publisher performs model training according to the data stored in its own node, and sends the locally obtained parameters to the server node in the blockchain network. The server nodes in each blockchain network shard preliminarily aggregate the locally obtained parameters uploaded by the federated learning clients under their jurisdiction, and upload them to the blockchain shard where they are located. The committee nodes in each blockchain shard upload the preliminarily aggregated parameters of their respective shards to the committee, and the committee aggregates the global parameters. The blockchain ledger encrypts and stores the locally obtained model parameters and aggregated model parameters in each round.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of federated learning, and relates to a server partition federated learning method based on blockchain sharding. Background Art

[0002] With the rapid development of artificial intelligence, a large amount of high-quality data training has received increasing attention. However, in the current situation, most companies or research groups cannot solve the two major problems of small data volume and low data quality, and high-quality data often exists in the form of isolated islands. Therefore, the problem of "data islands" also follows, and high-quality data owners are reluctant to share their private data. In order to reduce the negative impact of the "data islands" problem on the development of artificial intelligence, Google proposed federated learning in 2017. The emergence of federated learning enables machine learning to jointly complete model training by different users without sharing data.

[0003] Traditional federated learning has inevitable single-point failure problems and trust deficiency problems. To optimize the impact of single-point failure problems and trust deficiency problems on federated learning. Most scholars have begun to propose federated learning models based on blockchain. Blockchain has the characteristics of decentralization, openness and transparency, anonymity, data anti-tampering, etc. Therefore, at present, blockchain has been used as a major platform to solve the single-point failure problems and trust deficiency problems of traditional federated learning, leveraging the characteristics of blockchain to empower data anti-tampering and data security protection for federated learning.

[0004] Currently, many models have replaced the traditional centralized federated learning server with a blockchain platform. The most representative ones include BlockFL proposed by Kim et al. (such as Document 1: Kang J, Xiong Z, Niyato D, et al. Incentive mechanism for reliable federated learning: a joint optimization approach to combining reputation and contract theory [J]. IEEE Internet of Things Journal, 2019, 6(6): 10700-10714.), and the decentralized federated learning algorithm based on blockchain and differential privacy (such as Document 2: Pokhrel R, Choi J. A decentralized federated learning approach for connected autonomous vehicles [C] / / 2020 IEEE Wireless Communications and Networking Conference Workshops (WCNCW). IEEE, 2020: 1-6.). In Document 1, user devices train local data and upload model updates, and miners are responsible for collecting enough local model updates within a predetermined time and packing them into blocks to be recorded in the blockchain. In Document 2, the decentralized federated learning algorithm based on blockchain and differential privacy can use the traceable and tamper-proof characteristics of the blockchain to track the activities of malicious nodes while protecting the privacy and security of users. However, as is well known, the blockchain has problems of low scalability and transaction latency. This makes the consensus task difficult in a scenario of federated learning model training with a large number of clients, which will greatly reduce the training efficiency of federated learning.

[0005] In summary, it is necessary to design a server partitioned federated learning model based on blockchain sharding to improve the consensus efficiency of the blockchain network and reduce the communication cost of federated learning, so as to improve the convergence speed of federated learning model training. Summary of the Invention

[0006] In view of this, the purpose of the present invention is to provide a server partitioned federated learning model based on blockchain sharding.

[0007] To achieve the above purpose, the present invention provides the following technical solutions:

[0008] A server partitioned federated learning method based on blockchain sharding, including the following steps:

[0009] S1: The task publisher first registers in the blockchain network and publishes the federated learning training content and related requirements; secondly, the task publisher pays a fee as the prize pool for the federated learning training task.

[0010] S2: The federated learning participants view the training content and related requirements published by the task publisher and decide whether to participate in this federated learning training task; if they participate, the federated learning participants apply to join the blockchain network through the federated learning edge server.

[0011] S3: The blockchain network performs sharding operations and selects the committee nodes for each shard; there is 1 committee node and several ordinary nodes in each shard of the blockchain network; the ordinary nodes, as the federated learning hierarchical servers, initially aggregate the local parameters uploaded by the clients under their jurisdiction, and after obtaining the initially aggregated parameters, send requests to the blockchain shard network where they are located. The blockchain network where they are located will record these initially aggregated parameters, and finally the committee nodes upload these parameters to the committee and broadcast them to other shards.

[0012] S4: The federated learning participants, through the federated learning clients, perform iterative training based on the data they own and upload the local parameters of each round to the relevant federated learning hierarchical servers; the federated learning hierarchical servers perform initial parameter aggregation operations and publish the obtained initially aggregated parameters in the blockchain shard network where they are located; the committee nodes in the blockchain shard network publish all the obtained initially aggregated parameters to the committee network. All committee nodes obtain the initially aggregated parameters of all shards, and finally obtain the global aggregated parameters of this round. The committee network stores the local aggregated parameters and the global aggregated parameters in the blockchain ledger; finally, the committee nodes bring back the global aggregated parameters, publish them in each shard network, and conduct the next round of training with these until the convergence requirements of the task publisher are met.

[0013] Furthermore, in step S2, the federated learning participants are differentiated in the following steps:

[0014] S21: When applying to join this federated learning task, the federated learning participants declare the size of the local data volume and the local computing power.

[0015] S22: The participating nodes whose local data volume is lower than the average of the local data volumes of all federated learning clients participating in the task each time but whose computing power is higher than the average of the local computing powers of all federated learning clients participating in the task each time become federated learning edge servers and apply to enter the blockchain network; the federated learning edge servers are used to perform edge model aggregation on the parameters uploaded by the federated learning clients.

[0016] S23: The participants whose local data volume is higher than the average local data volume of all federated learning clients participating in the task each time but whose computing power is lower than the average local computing power of all federated learning clients participating in the task each time become federated learning clients; the federated learning clients are used for model training in each round and upload the training parameters to the corresponding federated learning edge server.

[0017] Further, in step S3 for blockchain network sharding, the Elastico sharding function will be adopted to partition the federated learning edge servers. The specific process is as follows:

[0018] S31: Each edge server node applying to enter the blockchain network has its own IP and public key PK. The logical partition is determined using the epochRandomness function, and the function is expressed as:

[0019] O = H(epochRandomness||IP||PK||nonce) ≤ 2 γ-D

[0020] where epochRandomness is a random number; (IP, PK) is the node identity information group; nonce is the difficulty coefficient of the verifiable POW workload proof; D is the pre-set POW workload proof difficulty;

[0021] S32: The blockchain network is divided into 2 s shards, and each shard is represented by an s-bit binary number; each node is represented by the hash value O calculated in step S31. The last s bits of the hash value O are used to determine which shard each node belongs to.

[0022] Further, in step S3, the committee nodes of each shard are selected according to the contribution value size. The specific steps are as follows:

[0023] Step 1: Committee node initialization: First, select the federated learning edge server node with the largest computing power of the node.

[0024] Step 2: During the convergence process of the federated learning parameters, the contribution values of the federated learning server nodes in each partition are recorded by the partition blockchain ledger. The committee nodes are reselected every x rounds, and the node with the smallest average contribution value in the previous x rounds and not poisoned is selected as the new committee node.

[0025] Further, the specific process of model training in step S4 is as follows:

[0026] S41: The federated learning client downloads the global variables from the federated learning edge server nodes in the blockchain shard and uses the training data it owns for training.

[0027] S42: The federated learning client uploads the local parameters obtained from model training along with the corresponding training time consumption to the edge server nodes in the blockchain shards;

[0028] S43: The edge server nodes perform local parameter aggregation, package the local aggregated parameters and the data uploaded by each client, and publish them to the blockchain sub-ledger of the shard where they are located;

[0029] S44: The committee nodes download all the local aggregated parameters from the sub-ledger and upload them to the committee. After obtaining the local aggregated parameters of all shards, the committee performs global parameter aggregation and uploads the obtained global aggregated parameters to the blockchain ledger of the entire blockchain network;

[0030] S45: The committee nodes download the global aggregated parameters from the blockchain ledger and bring them back to the shards where they are located. The federated learning clients download the global aggregated parameters from the edge server nodes and perform the next round of training.

[0031] Furthermore, in step S41, the gradient loss function for model training is as follows:

[0032]

[0033] For a machine learning problem, let f i (ω) be l(x i , y i ; ω), that is, use the model parameter ω to perform loss prediction on the instance (x i , y i ).

[0034] Furthermore, in step S43, the local parameter aggregation is obtained by the following formula:

[0035]

[0036] where represents the local parameters of the t-th round uploaded by the i-th client node, and k represents the number of client nodes under this edge server node.

[0037] The beneficial effects of the present invention are as follows: The present invention improves the consensus efficiency of the federated learning model based on the traditional blockchain network and reduces the communication cost of federated learning, thereby improving the convergence speed of model training.

[0038] Other advantages, objectives and features of the present invention will be described to some extent in the subsequent specification, and to some extent, will be obvious to those skilled in the art based on the study of the following text, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following specification. Brief Description of the Drawings

[0039] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail and preferably below in conjunction with the drawings, where:

[0040] Figure 1 is a system architecture diagram of the server partition federated learning model based on blockchain sharding in the present invention;

[0041] Figure 2 is a training flow chart of the server partition federated learning model based on blockchain sharding in the present invention. Detailed Embodiments

[0042] The following illustrates the embodiments of the present invention through specific specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the drawings provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0043] Among them, the drawings are only for illustrative purposes, showing only schematic diagrams, not physical diagrams, and should not be construed as a limitation to the present invention; in order to better illustrate the embodiments of the present invention, some components in the drawings will be omitted, enlarged or reduced, and do not represent the dimensions of actual products; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0044] In the drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "rear", etc. indicating the orientation or positional relationship, they are based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the positional relationship in the drawings are only for illustrative purposes and should not be construed as a limitation to the present invention. For those of ordinary skill in the art, the specific meanings of the above terms can be understood according to specific circumstances.

[0045] As Figure 1 、 Figure 2 shown, a server partition federated learning model designed by the present invention based on blockchain sharding specifically includes the following content:

[0046] S1: Task Publisher: The task publisher first registers and publishes the federated learning training content in the blockchain network, and at the same time publishes the relevant requirements for the federated learning training content. Secondly, the task publisher needs to pay a fee as the prize pool for the federated learning training task.

[0047] S2: Federated Learning Participants: According to the training content and relevant requirements published by the federated learning task publisher, the participants view the relevant content on the platform and decide whether to participate in this federated learning training task. The federated learning participants will be divided into federated learning clients and federated learning edge servers, and the federated learning edge servers will apply to enter the blockchain network.

[0048] S21: When applying to join this federated learning task, the federated learning participants need to declare the size of the local data volume and the local computing power.

[0049] S22: The participant nodes with less local data volume but higher computing power will become federated learning edge servers and apply to enter the blockchain network. The federated learning edge servers are used to aggregate the parameters uploaded by the federated learning clients into an edge model.

[0050] S23: The participants with a large local data volume but a low computing power value will become federated learning clients. The federated learning clients are used for model training in each round and upload the training parameters to the corresponding federated learning edge servers.

[0051] S3: Blockchain Network Sharding: The blockchain network will perform sharding operations and select the committee nodes for each shard. There is 1 committee node and several ordinary nodes in each blockchain network shard. The ordinary nodes, as federated learning hierarchical servers, will initially aggregate the local parameters uploaded by the clients under their jurisdiction. After obtaining the initially aggregated parameters, they will send requests to the blockchain shard network where they are located. The blockchain network where they are located will record these initially aggregated parameters. Finally, the committee nodes will upload these parameters to the committee and broadcast them to other shards.

[0052] Optionally, in the blockchain network sharding step, the Elastico sharding function is used to partition the federated learning edge servers. The specific process is as follows:

[0053] Step 1: Each edge server node applying to enter the blockchain network has its own IP and PK (public key). The epochRandomness function is used to determine the logical partition. The function is expressed as:

[0054] O = H(epochRandomness||IP||PK||nonce) ≤ 2 γ-D

[0055] Among them, epochRandomness is a random number; (IP, PK) is the node identity information group; nonce is the difficulty coefficient of verifiable POW proof of work; D is the pre-set POW proof of work difficulty.

[0056] Step 2: The blockchain network will be divided into 2 s shards, and each shard will be represented by an s-bit binary number. Each node is represented by the hash value O calculated in Step 1, and the last s bits of the hash value O are used to determine which shard each node belongs to.

[0057] The shard committee nodes will be selected according to the contribution value. The specific process is as follows:

[0058] (1) Committee node initialization: First, select the federated learning edge server node with the largest computing power of the node.

[0059] (2) During the convergence process of the federated learning parameters, the contribution values of the federated learning server nodes in each partition will be recorded by the partition blockchain ledger. The committee nodes will be reselected every x rounds, and the node with the smallest average contribution value in the previous x rounds and not poisoned will be selected as the new committee node.

[0060] S4: Model training: The federated learning client will perform iterative training based on the data it owns, and upload the local parameters of each round to the relevant federated learning hierarchical server, that is, the ordinary nodes in the relevant blockchain shard network. These nodes will perform preliminary parameter aggregation operations on the local parameters they collect, and publish the obtained preliminary aggregated parameters in the blockchain shard network where they are located. The committee nodes in the blockchain shard network will publish all the obtained preliminary aggregated parameters to the committee network. All committee nodes will obtain the preliminary aggregated parameters of all shards in this way, and finally obtain the global aggregated parameters of this round. The committee network will store the local aggregated parameters and the global aggregated parameters in the blockchain ledger. Finally, the committee nodes will bring back the global aggregated parameters, publish them in each shard network, and perform the next round of training based on this until the convergence requirements of the task publisher are met. The specific process of model training is as follows:

[0061] S41: The federated learning client downloads the global variables from the federated learning edge server nodes in the blockchain shard, and uses the training data it owns for training. The gradient loss function of model training is as follows:

[0062]

[0063] For machine learning problems, usually take f i (ω) as l(x i , y i; ω), that is, use the model parameter ω to perform loss prediction on the instance (x i , y i ).

[0064] S42: The federated learning client uploads the local parameters obtained from model training and attach the corresponding training time consumption to the edge server node in the blockchain shard, where t represents the round number.

[0065] S43: The edge server node performs local parameter aggregation, and the local parameter aggregation is obtained by the following formula:

[0066]

[0067] where represents the local parameter of the t-th round uploaded by the i-th client node, and k represents the number of client nodes under this edge server node.

[0068] After local parameter aggregation, the edge server node packs the local aggregated parameters and the data uploaded by each client and publishes them in the blockchain sub-ledger of its shard.

[0069] The most commonly used Practical Byzantine Fault Tolerance (PBFT) algorithm is used as the consensus protocol within the blockchain shard. Compared with other consensus algorithms, the PBFT algorithm is an efficient and energy-saving consensus algorithm when the number of nodes is small. Therefore, using it as the consensus algorithm within the blockchain shard can improve the consensus efficiency and thus improve the aggregation efficiency of federated learning.

[0070] S44: The committee node downloads all the local aggregated parameters from the sub-ledger and uploads them to the committee. After obtaining the local aggregated parameters of all shards, the committee will perform global parameter aggregation and upload the obtained global aggregated parameters to the blockchain ledger of the entire blockchain network.

[0071] S45: The committee node downloads the global aggregated parameters from the blockchain ledger and brings them back to its shard, and the federated learning client downloads the global aggregated parameters from the edge server node for the next round of training.

[0072] For example: Suppose there are m federated learning participants in a certain federated learning task, and among the m federated learning participants, there are a federated learning clients and b federated learning edge servers. Suppose the blockchain network is divided into 8 shards. The specific steps of this federated learning task will start from the following steps:

[0073] First, the federal learning task publisher publishes the federal learning task on the blockchain network, which includes the initial model parameters (ω 0 ), the task bonus (rewardPool), and the final converged model (W). m federal learning participants apply to join this federal learning task.

[0074] b federal learning edge servers calculate their own hash value O through the epochRandomness function. Since the blockchain has 8 shards, that is, 2 s = 8;

[0075] s→3

[0076] Therefore, the federal learning edge service nodes take the last 3 bits of O to determine the blockchain shard they belong to.

[0077] The shard committee nodes are initialized as the nodes with the strongest computing power in each shard. To prevent the committee nodes from being malicious nodes, after τ rounds, a node contribution evaluation will be carried out. If a committee node cheats, its qualification to participate in this training will be cancelled and no reward will be given.

[0078] After the training task starts, the federal learning client obtains the initial model parameters (ω 0 ), starts the first round of training, and obtains the local model parameters of this training and uploads them to the federal learning edge server nodes in its shard. After receiving the model parameters uploaded by all client nodes under its jurisdiction, the edge server nodes will perform preliminary aggregation on them. After the edge server nodes complete the aggregation, they will store the preliminary aggregated model parameter data in the shard blockchain network. The latency can be expressed as:

[0079]

[0080] where represents the latency of aggregation of the j federal learning edge server node in the t-th round; τ consensus represents the consensus latency, represents the training latency of the i federal learning client node; represents the upload latency of the i federal learning client node.

[0081] The committee nodes in the blockchain shard network will publish all the obtained preliminary aggregation parameters to the committee network. The latency can be expressed as:

[0082]

[0083] where represents the latency of obtaining all the preliminary aggregation parameters in the s i shard at the t-th round; represents in si The total number of federated learning edge server nodes in the shard satisfies the following formula:

[0084]

[0085] All committee nodes will obtain the preliminary aggregation parameters of all shards in this way, and finally obtain the global aggregation parameters of this round. The committee network stores the local aggregation parameters and global aggregation parameters in the blockchain ledger.

[0086] Therefore, the total delay can be expressed as:

[0087]

[0088] Because each shard starts the training task in parallel, the total delay of each round only needs to take the sum of the delay of the slowest shard and the final aggregation delay (τ aggregation ).

[0089] Finally, the global aggregation parameters of this round are obtained. The committee network stores the local aggregation parameters and global aggregation parameters in the blockchain ledger. Finally, the committee nodes will bring back the global aggregation parameters, publish them in each shard network, and conduct the next round of training with this until the convergence requirements of the task publisher are met.

[0090] A server partitioned federated learning model based on blockchain sharding proposed by the present invention. From the above examples, because the Practical Byzantine Fault Tolerance (PBFT) algorithm is adopted as the consensus protocol in each shard, we can obtain

[0091]

[0092] Therefore, the total delay is optimized, thereby improving the model aggregation efficiency of federated learning. The blockchain sharding technology is applied in the design of this model. The sharding technology allows scalability to be achieved by dividing the network into smaller subgroups. This reduces storage and communication requirements while increasing throughput as the number of shards increases. Applying the blockchain sharding technology to the federated learning model training in this model can not only improve the single point of failure problem and lack of trust problem of traditional federated learning, but also improve the scalability problem and large consensus pressure problem in the traditional blockchain-based federated learning model.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the purpose and scope of the present technical solution, and they should all be covered within the scope of the claims of the present invention.

Claims

1. A server partitioned federated learning method based on blockchain sharding, characterized in that: It includes the following steps: S1: The task publisher first registers and publishes the federated learning training content and related requirements in the blockchain network; secondly, the task publisher pays a fee as the prize pool for the federated learning training task; S2: The federated learning participants view the training content and related requirements published by the task publisher and decide whether to participate in this federated learning training task; If participating, the federated learning participants apply to join the blockchain network through the federated learning edge server; S3: The blockchain network performs sharding operations and selects the committee nodes for each shard; there is 1 committee node and several ordinary nodes in each blockchain network shard; the ordinary nodes act as federated learning hierarchical servers, and initially aggregate the local parameters uploaded by the clients under their jurisdiction to obtain the initially aggregated parameters, and then send a request to the blockchain shard network where they are located. The blockchain network where they are located will record this initially aggregated parameter, and finally the committee node will upload these parameters to the committee and broadcast them to other shards; S4: The federated learning participants perform iterative training based on the data they own through the federated learning client and upload the local parameters of each round to the relevant federated learning hierarchical server; The federated learning hierarchical server performs an initial parameter aggregation operation and publishes the obtained initially aggregated parameters in the blockchain shard network where it is located; The committee nodes in the blockchain shard network publish all the obtained initially aggregated parameters to the committee network. All the committee nodes obtain the initially aggregated parameters of all shards, and finally obtain the global aggregated parameters of this round. The committee network stores the local aggregated parameters and the global aggregated parameters in the blockchain ledger; finally, the committee node brings back the global aggregated parameters and publishes them in each shard network, and conducts the next round of training with this until the convergence requirement of the task publisher is met.

2. The server partitioned federated learning method based on blockchain sharding according to claim 1, characterized in that: In step S2, the federated learning participants are differentiated in the following steps: S21: When applying to participate in this federated learning task, the federated learning participants declare the size of the local data volume and the size of the local computing power; S22: The participant nodes with a local data volume lower than the average of the local data volumes of all federated learning clients participating in the task each time but with a computing power higher than the average of the local computing powers of all federated learning clients participating in the task each time become federated learning edge servers and apply to enter the blockchain network; the federated learning edge server is used to perform edge model aggregation on the parameters uploaded by the federated learning clients; S23: The participants with a local data volume higher than the average of the local data volumes of all federated learning clients participating in the task each time but with a computing power lower than the average of the local computing powers of all federated learning clients participating in the task each time become federated learning clients; the federated learning client is used for model training in each round and uploads the training parameters to the corresponding federated learning edge server.

3. The server partitioned federated learning method based on blockchain sharding according to claim 1, characterized in that: In step S3, the Elastico sharding function will be used to partition the federated learning edge servers in the blockchain network. The specific process is as follows: S31: Each edge server node applying to enter the blockchain network has its own IP and public key PK. The logical partition is determined using the epochRandomness function, and the function is expressed as: O = H(epochRandomness||IP||PK||nonce) ≤ 2 γ-D where epochRandomness is a random number; (IP, PK) is the node identity information group; nonce is the difficulty coefficient of the verifiable POW workload proof; D is the difficulty of the POW workload proof set in advance; S32: The blockchain network is divided into 2 s shards, and each shard is represented by an s-bit binary number; each node is represented by the hash value O calculated in step S31, and the last s bits of the hash value O are used to determine which shard each node belongs to.

4. The server partitioned federated learning method based on blockchain sharding according to claim 3, characterized in that: In step S3, the committee nodes of each shard are selected based on the contribution value. The specific steps are as follows: Step 1: Committee node initialization: First, select the federated learning edge server node with the largest computing power of the node; Step 2: During the convergence of the federated learning parameters, the contribution value of each federated learning server node in each partition is recorded by the partition blockchain ledger. The committee nodes are reselected every x rounds, and the node with the smallest average contribution value in the previous x rounds and not poisoned is selected as the new committee node.

5. The server partitioned federated learning method based on blockchain sharding according to claim 1, characterized in that: The specific process of model training in step S4 is as follows: S41: The federated learning client downloads the global variables from the federated learning edge server nodes in the blockchain shard and uses the training data it owns for training; S42: The federated learning client uploads the local parameters obtained from the model training along with the corresponding training time consumption to the edge server nodes in the blockchain shard; S43: The edge server nodes perform local parameter aggregation, and pack the local aggregated parameters and the data uploaded by each client, and publish them to the blockchain sub-ledger of the shard where it is located; S44: The committee nodes download all the local aggregated parameters from the sub-ledger and upload them to the committee. After obtaining the local aggregated parameters of all shards, the committee performs global parameter aggregation and uploads the obtained global aggregated parameters to the blockchain ledger of the entire blockchain network; S45: The committee nodes download the global aggregated parameters from the blockchain ledger and bring them back to the shard where they are located. The federated learning clients download the fully aggregated parameters from the edge server nodes and perform the next round of training.

6. The server partitioned federated learning method based on blockchain sharding according to claim 5, characterized in that: In step S41, the gradient loss function of model training is as follows: For a machine learning problem, take f i (ω) as i.e., use the model parameter ω to perform loss prediction on the instance (x i , y i ).

7. The server partitioned federated learning method based on blockchain sharding according to claim 5, characterized in that: In step S43, the local parameter aggregation is obtained by the following formula: Among them represents the local parameters uploaded by the i-th client node at the t-th round, and k represents the number of client nodes under this edge server node.

Citation Information

Patent Citations

  • Supply chain data collaboration method and device based on block chain fragmentation and federal learning

    CN114358306A

  • Fair face attribute classification method based on block chain and federal learning

    CN116597498A