Blockchain-based federated learning method, industrial product quality prediction method and system

By introducing blockchain and dynamic committee mechanisms into federated learning, the quality of model updates is verified and rewards are distributed, solving the problem of incentive distortion in existing technologies. This achieves secure, robust, and fair federated learning, improving the convergence speed of the global model and the sustainability of the system.

CN122334407APending Publication Date: 2026-07-03HENAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610566195.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-27
Publication Date
2026-07-03

Smart Images

  • Figure CN122334407A_ABST
    Figure CN122334407A_ABST
Patent Text Reader

Abstract

This invention relates to the fields of blockchain and privacy computing technology, and provides a blockchain-based federated learning method, an industrial product quality prediction method, and a system. The federated method includes: deploying an initialized global model on the blockchain; clients retrieving the model from the chain, training it locally, and submitting model updates; committee nodes, dynamically elected, scoring the updates based on a verification dataset, and generating a consensus score by combining reputation weights and a two-sided pruning mechanism; qualified updates being aggregated by a smart contract to generate a new global model and writing it back to the blockchain; the smart contract distributing rewards and updating the reputation of the client and committee members based on the client's model quality and the consistency of committee member votes; and the system entering the next training iteration. This invention effectively solves the problems of centralized dependence, low-quality update interference, and unfair incentives in traditional federated learning by introducing an incentive mechanism and a dynamic reputation evolution mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of blockchain and privacy computing technology, and in particular to a blockchain-based federated learning method, an industrial product quality prediction method and system. Background Technology

[0002] Federated learning, as a novel distributed training framework, allows multiple participants to collaboratively train a global model without directly exchanging local data, thus mitigating privacy and data compliance risks to some extent. However, existing federated learning suffers from several problems: First, it relies on a centralized parameter server to coordinate and aggregate model updates, exhibiting significant centralized drawbacks. The central server wields excessive control throughout the process, easily becoming a single point of failure. Attacks, outages, or malicious manipulation directly threaten the correctness of the global model and the reliability of the training process. Second, due to the significant differences in data distribution among participants, the quality of model updates uploaded by clients varies considerably. Unfiltered aggregation can not only affect the convergence speed and final performance of the global model but also be exploited by malicious nodes to launch model poisoning attacks by submitting tampered or fake updates, undermining system robustness. Therefore, ensuring the reliable operation of federated learning in large-scale, non-independent, and identically distributed environments has become a crucial research direction in this field.

[0003] To alleviate the aforementioned problems, blockchain technology is introduced into the federated learning framework. While the introduction of blockchain improves the system's transparency and security to some extent, shortcomings remain. Most existing solutions rely on staking or reputation-based reward allocation in their reward mechanism design, neglecting the value of the model update quality itself. This results in some low-quality or even invalid updates potentially receiving rewards, weakening the overall incentive effect. Furthermore, the combination of blockchain and federated learning requires an effective consensus mechanism to ensure the verification and aggregation of updates. However, existing committee consensus mechanisms struggle to balance efficiency, security, and fairness, lacking a flexible design capable of dynamically adapting to differences in node behavior and changes in the network environment. Summary of the Invention

[0004] To address the problem that existing federated learning methods incorporating blockchain rely on collateral and reputation for incentives while neglecting model quality, leading to distorted incentives, this invention proposes a blockchain-based federated learning method, an industrial product quality prediction method, and a system. By introducing blockchain as a decentralized storage and coordination platform, and combining it with a dynamically elected committee to verify the quality of model updates uploaded by clients, rewards are allocated based on the quality results, ensuring continuous optimization of the global model and fair system operation.

[0005] In a first aspect, embodiments of the present invention provide a blockchain-based federated learning method, comprising:

[0006] Step 1: Initialize a global model and deploy it in the blockchain;

[0007] Step 2: Select committee members based on the reputation value and the amount of staked tokens of all user nodes, and the remaining user nodes participate as clients in the model update of the current training round;

[0008] Step 3: The client downloads the global model from the blockchain, trains the global model using the local dataset, obtains model update information, and uploads it to the blockchain;

[0009] Step 4: Committee members score and verify the model update information uploaded by the client, and submit the verified model update information and its score results to the blockchain;

[0010] Step 5: When the model update information in the blockchain reaches a preset number, the committee will aggregate the model update information, generate a new global model, and upload it to the blockchain;

[0011] Step 6: Distribute rewards to clients and committee members in the current training round based on the new global model quality and committee voting consistency, and update the reputation values ​​of all user nodes in the current training round.

[0012] Step 7: Repeat steps 2 to 6 until the preset training rounds are reached, and output the new global model.

[0013] Furthermore, in step 2, the selection of committee members based on the user node's reputation value and the amount of staked tokens specifically includes:

[0014] If the current training round is less than 1, then sort all user nodes by reputation value from largest to smallest, and select committee members according to the preset number of committee members; wherein, the formula for calculating the reputation value of a user node is: = ,in Represents user node The reputation value in the initial training rounds, Represents user node The number of tokens staked;

[0015] If the current training round is greater than or equal to 1, the probability of a user node being selected for the committee is calculated based on its reputation value and the amount of staked tokens. All user nodes are then sorted in descending order of their selection probability, and committee members are selected according to the preset number of committee members. The formula for calculating the selection probability is as follows:

[0016]

[0017] in, Represents user node In training rounds The probability of being selected for the committee, , and This represents the weighting coefficients controlling the collateral tokens, reputation value, and randomness. To ensure fairness in the face of random perturbations, Represents user node In training rounds Reputation value at that time.

[0018] Furthermore, in step 4, the committee members score the model update information uploaded by the client, specifically including:

[0019] Each committee member updates the client's model information. Scoring is performed to obtain an initial score; the scoring formula is as follows:

[0020]

[0021] in, Indicates the members of the committee in round t. For the client Submitted model update information The initial score, Represents the client in round t. The updated global model is used on the validation dataset. The accuracy rate This indicates that in round t, the global model performs well on the validation dataset. The accuracy rate;

[0022] The initial scores for each committee member are adjusted using a two-sided pruning function;

[0023] The adjusted initial score is weighted using the reputation scores of the committee members to obtain the final score;

[0024] The client's rating is based on the final score and the credibility of the committee members:

[0025]

[0026] in, This indicates the committee members after the t-th round of training. For the client Submitted model update information The final score, Indicate committee members Reputation value Indicates the client The rating in round t.

[0027] Furthermore, step 4 also includes: the blockchain storing the hash value and related metadata of the model update information;

[0028] Correspondingly, in step 5, the committee obtains the model update information through a hash index and aggregates the model update information.

[0029] Furthermore, after the t-th round of training, the reward distribution formula for the client is:

[0030]

[0031] in, This represents the client's reward pool after round t. Indicates the client The rating, Indicates the client Reward distribution, Indicates the number of clients;

[0032] The formula for distributing rewards to committee members is as follows:

[0033]

[0034] in, Indicates the committee's reward pool, Indicate committee members Reputation value Indicate committee members Consistency Indicates the number of committee members.

[0035] Furthermore, the user node reputation value update includes the reputation value update of the committee node and client node in the current training round;

[0036] The formula for updating the reputation value of the committee node is as follows:

[0037]

[0038] In the formula,

[0039]

[0040] in, Represents user node In training rounds Reputation value at that time Indicates the attenuation factor. Represents user node Consistency Indicates the members of the committee in round t. The deviation between the scoring and the consensus result. Indicates the client The weight, This indicates the maximum allowed score difference.

[0041] The formula for updating the reputation value of the client node is:

[0042]

[0043] in, Indicates the client The reputation value in round t, This represents the score that client i receives after verification by the committee in round t. The forgetting factor is used to update client reputation and control the trade-off between historical reputation and current round score.

[0044] Secondly, an embodiment of the present invention provides a blockchain-based federated learning system, comprising:

[0045] The initialization module is used to initialize a global model deployed on the blockchain;

[0046] The committee selection module is used to select committee members based on the reputation value and the amount of staked tokens of all user nodes, while the remaining user nodes participate as clients in the model update of the current training round.

[0047] The local training module is used by the client to download the global model from the blockchain, train the global model using the local dataset, obtain model update information, and upload it to the blockchain.

[0048] The model verification module is used by committee members to score and verify the model update information uploaded by the client, and submit the verified model update information and its score results to the blockchain.

[0049] The model aggregation module is used to aggregate the model update information in the blockchain when the number of model update information in the blockchain reaches a preset amount, generate a new global model, and upload it to the blockchain.

[0050] The reward allocation module is used to allocate rewards to clients and committee members in the current training round based on the new global model quality and committee voting consistency, and to update the reputation values ​​of all user nodes in the current training round.

[0051] The result output module is used to repeatedly execute the committee selection module, the local training module, the model validation module, the model aggregation module, and the reward allocation module until a preset number of training rounds are reached, and then output the new global model.

[0052] Thirdly, this invention provides a method for predicting the quality of industrial products based on federated learning, comprising:

[0053] The production management platform, industrial internet platform, or enterprise control server is used as the task publisher, and the task publisher puts the product quality prediction model to be trained into the blockchain as a global model.

[0054] Each workshop edge server, production line control node, or equipment gateway is used as a user node, and the process parameter data, sensor data, quality inspection results, and operation logs collected locally by the user nodes are used as local datasets.

[0055] The product quality prediction model to be trained is federated and trained using the method described in the first aspect.

[0056] The quality of the target product is predicted using a trained product quality prediction model.

[0057] Fourthly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0058] Fifthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0059] The beneficial effects of this invention are as follows:

[0060] This invention employs a committee verification mechanism to evaluate updates submitted by clients and dynamically adjusts the credibility of committee members through a consistency metric and a reputation evolution mechanism. This ensures that committee members with consistently excellent performance gain higher credibility and a greater probability of being elected in subsequent elections, while nodes that frequently deviate from consensus or exhibit malicious behavior gradually lose credibility and participation opportunities, thus guaranteeing the fairness and stability of the committee during operation. Furthermore, the client reward mechanism proposed in this invention no longer relies solely on staking or historical reputation but uses model update quality as the core indicator. High-quality updates receive more incentives, while low-quality or invalid updates do not receive rewards, effectively improving the convergence speed and performance of the global model. In this way, this invention achieves a secure, robust, and fair federated learning incentive mechanism while ensuring data privacy protection. It can operate stably in large-scale, non-independent, and potentially adversarial environments, significantly enhancing the system's sustainability and practical value. Attached Figure Description

[0061] Figure 1 A flowchart illustrating a blockchain-based federated learning method provided in an embodiment of the present invention;

[0062] Figure 2 A structural diagram of a blockchain-based federated learning system provided in an embodiment of the present invention;

[0063] Figure 3 A flowchart illustrating an industrial product quality prediction method based on federated learning, provided for an embodiment of the present invention;

[0064] Figure 4 This is an electronic device architecture diagram provided for an embodiment of the present invention. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0066] like Figure 1 As shown, this embodiment of the invention provides a blockchain-based federated learning method, including:

[0067] S101: Initialize a global model and deploy it in the blockchain.

[0068] Specifically, a randomly initialized global model is deployed in the blockchain, and user nodes can access the current global model. User nodes, task models, and local datasets can be interpreted in different application scenarios, and this invention is not limited to a single scenario.

[0069] For example, in industrial manufacturing scenarios, production management platforms, industrial internet platforms, enterprise control servers, or other nodes with task publishing permissions can initialize a global model and deploy it in the blockchain; user nodes can be factory edge servers, workshop control nodes, equipment gateways, or enterprise nodes participating in collaborative training; the global model can be a product quality prediction model, an equipment fault early warning model, a process parameter optimization model, or a defect detection model.

[0070] For example, in other federated learning application scenarios, the participants in initializing the global model can be business initiators with model training needs, user nodes are computing nodes that hold local private data and participate in training, and the global model is determined according to the specific task type.

[0071] Therefore, the specific forms of the aforementioned user nodes, global models, and local datasets may vary depending on the application scenario, without affecting the implementation of the technical solution of this invention.

[0072] S102: Based on the reputation value and the amount of staked tokens of all user nodes, select committee members from them, and the remaining user nodes participate as clients in the model update of the current training round.

[0073] Specifically, the federated learning smart contract dynamically elects committee members from the node pool, selecting committee members based on the reputation value and staking tokens of user nodes. The remaining user nodes in the node pool serve as clients for the current training round. The staking tokens represent the rights and obligations of nodes in the blockchain network and the cost of malicious behavior. In different application scenarios, these tokens can be manifested as on-chain native tokens (such as TAO coins, AR coins, etc.), platform points, resource quota certificates, service credit values, or other quantifiable rights identifiers.

[0074] S103: The client downloads the global model from the blockchain, trains the global model using the local dataset, obtains model update information, and uploads it to the blockchain.

[0075] Specifically, the client accesses and downloads the current global model from the blockchain. Utilizing local datasets For the global model Conduct training To obtain the global model update information And upload it to the blockchain. In industrial manufacturing scenarios, local datasets can include sensor data such as equipment vibration data, temperature data, current data, and pressure data, process parameter data, product surface images, inspection results, and operation and maintenance logs.

[0076] S104: Committee members score and verify the model update information uploaded by the client, and submit the verified model update information and its score results to the blockchain.

[0077] Specifically, committee members update the client's model information. Scoring and verification are performed using a validation set (the committee's local dataset). The verification process involves applying the client's updates to the global model to obtain a candidate model, and then comparing its accuracy with the global model before training. If the accuracy decreases, it is determined to be a malicious update. After removing malicious updates, the updated information of the verified model is uploaded to the blockchain.

[0078] S105: When the model update information in the blockchain reaches a preset amount, the committee will aggregate the model update information, generate a new global model, and upload it to the blockchain.

[0079] Specifically, when there are a sufficient number of continuous model update messages on the blockchain (in this embodiment, k is set as k), the smart contract triggers aggregation, thereby the committee aggregates the model update messages, generates a new global model, and uploads it to the blockchain.

[0080] S106: Distribute rewards to clients and committee members in the current training round based on the new global model quality and committee voting consistency, and update the reputation values ​​of all user nodes in the current training round.

[0081] Specifically, the smart contract updates the rewards and reputation values ​​of clients and committee members based on the new global model quality and the consistency of committee voting. The rewards and reputation results are automatically recorded and distributed through the blockchain smart contract.

[0082] S107: Repeat S102 to S106 until the preset training rounds are reached, and output a new global model.

[0083] The method provided in this invention combines blockchain and committee mechanisms, enabling a solution for reasonable incentive allocation driven by model quality while ensuring the accuracy of update quality assessment. This improves the fairness, robustness, and sustainable operation of federated learning systems.

[0084] In some embodiments, in S102, committee members are selected based on the user node's reputation value and the amount of staked tokens, specifically including:

[0085] If the current training round is less than 1, then sort all user nodes by reputation value from largest to smallest, and select committee members according to the preset number of committee members; the formula for calculating the reputation value of a user node is as follows: = ,in Represents user node The reputation value in the initial training rounds, Represents user node The number of tokens staked.

[0086] Specifically, in the first round of elections, node reputation is tied to the value of the tokens it has staked, with the initial reputation value being proportional to the number of tokens staked. = .

[0087] If the current training round is greater than or equal to 1, the probability of a user node being selected for the committee is calculated based on its reputation value and the amount of staked tokens. All user nodes are then sorted in descending order of their selection probability, and committee members are selected according to the preset number of committee members. The formula for calculating the probability of being selected for the committee is as follows:

[0088]

[0089] in, Represents user node In training rounds The probability of being selected for the committee, , and The weighting coefficients representing the control over collateralized tokens, reputation value, and randomness constitute an adjustable trade-off mechanism. To ensure fairness in the face of random perturbations, Represents user node In training rounds Reputation value at that time.

[0090] Specifically, starting in the second round, committee members selected factors including credibility, model quality, and consistency.

[0091] In some embodiments, in S104, committee members verify and score the model update information uploaded by the client, specifically including:

[0092] Each committee member updates the client's model information. Scoring is performed to obtain an initial score; the scoring formula is as follows:

[0093]

[0094] in, Indicates the members of the committee in round t. For the client Submitted model update information The initial score, Represents the client in round t. Updated global model validation dataset The accuracy rate This indicates that in round t, the global model performs well on the validation dataset. The accuracy rate.

[0095] The initial scores for each committee member are adjusted using a two-sided pruning function.

[0096] Specifically, to prevent extreme scoring, a two-sided pruning function is used to ensure that committee members' scores always remain within a reasonable range. , Indicates the client The lower limit threshold for scoring, Indicates the client The scoring cap threshold, this formula limits the committee's scores to a reasonable range. Internally, this avoids extreme values ​​interfering with subsequent consensus scoring.

[0097] The adjusted initial score is weighted using the reputation scores of committee members to obtain the final score.

[0098] Specifically, the reputation scores of committee members are used. Adjusted initial scores Weighting ,in For committee nodes Reputation value.

[0099] Clients rate their clients based on the final score and the credibility of the committee members:

[0100]

[0101] in, This indicates the committee members after the t-th round of training. For the client Submitted model update information The final score, Indicate committee members Reputation value Indicates the client The rating in round t.

[0102] Specifically, the client Final score This is equivalent to a weighted average of all committee members' scores, where the weights are the committee members' reputation scores. Committee members with higher reputations have a greater impact on the final result; committee members with lower or unstable reputations have a smaller impact on the consensus outcome. This design aims to prevent malicious committee members from manipulating the overall result through scoring, while ensuring that long-term honest and reliable committee members have a greater voice in the consensus process.

[0103] In some embodiments, S104 further includes: the blockchain storing the hash value of the model update information and related metadata.

[0104] Specifically, to avoid excessive storage pressure and bandwidth consumption on the blockchain, the complete model update parameters are not directly stored on the blockchain. Instead, only the summary information (such as hash value) and related metadata of the model update information are stored.

[0105] Correspondingly, in S105, the committee obtains model update information through hash indexing and aggregates the model update information.

[0106] Specifically, the committee obtains the corresponding model update information through hash indexing during the aggregation process.

[0107] In some embodiments, the client's reward is related to the quality of its model, and the client's reward allocation formula is as follows:

[0108]

[0109] in, This represents the client's reward pool after round t. Indicates the client The rating, Indicates the client Reward distribution, Indicates the number of clients;

[0110] Committee members' rewards are determined by their reputation score and consistency. The reward distribution formula for committee members is as follows:

[0111]

[0112] in, Indicates the committee's reward pool, Indicate committee members Reputation value Indicate committee members Consistency Indicates the number of committee members.

[0113] In some embodiments, the user node reputation update includes the reputation updates of the committee nodes and client nodes in the current training round, and the formula for updating the reputation of the committee nodes is:

[0114]

[0115] Current round reputation score It's the previous round of credit The weighted average of the instantaneous reputation mapping values ​​obtained by mapping with the consistency index of this round, where,

[0116]

[0117] in, Represents user node In training rounds Reputation value at that time This represents the decay factor, which controls the "memory length" (the larger the value, the more historical memory is emphasized; the smaller the value, the more current memory is emphasized). Represents user node Consistency Indicate committee members The smaller the deviation between the committee members' scores and the overall consensus result, the more consistent the committee members' scores are with the judgments of the majority of nodes. Indicates the client The weight is determined by the number of clients, i.e. ; This indicates the maximum allowable score difference, used to standardize the bias and ensure that the result falls within the acceptable range. between.

[0118] Specifically, The value reflects the reliability of the committee member, when When =1, it indicates a committee member. The scores were completely consistent with the final consensus results, demonstrating that the committee member exhibited extremely high reliability and accuracy during the verification and scoring process; when =0 indicates committee members The scoring consistently deviates significantly from the consensus results, indicating that its scoring lacks reference value and may even be malicious. In actual operation, The larger the value, the more committee members... The more trustworthy the behavior, the more accurately the rating reflects the true quality of the client's updates. To ensure the committee's dynamic robustness and long-term fairness, the system updates the reputation values ​​of committee members based on their consistent performance throughout each training round.

[0119] The formula for updating the reputation value of a client node is:

[0120]

[0121] in, Indicates the client The reputation value in round t, This represents the score that client i receives after verification by the committee in round t. The forgetting factor is used to update client reputation and control the trade-off between historical reputation and current round score.

[0122] Smart contracts write new reputation scores into the blockchain ledger, ensuring immutability and transparency across the entire network. The adjustment of reputation scores follows an update formula with a forgetting factor, allowing committee members' long-term performance to gradually accumulate into a stable reputation level. Short-term misconduct is also promptly reflected in reputation score decay. This update enables the dynamic evolution of committee members' reputation scores, allowing committee members who consistently provide honest and high-quality verification to gain higher reputation scores, thus increasing their chances of being elected to the committee in subsequent elections. Nodes that are dishonest or frequently deviate from consensus will gradually lose reputation and eligibility for election.

[0123] like Figure 2 As shown, this embodiment of the invention also provides a blockchain-based federated learning system, including:

[0124] The initialization module is used to initialize a global model deployed on the blockchain;

[0125] The committee selection module is used to select committee members based on the reputation value and the amount of staked tokens of all user nodes, while the remaining user nodes participate as clients in the model update of the current training round.

[0126] The local training module is used by the client to download the global model from the blockchain, train the global model using the local dataset, obtain model update information, and upload it to the blockchain.

[0127] The model verification module is used by committee members to score and verify the model update information uploaded by the client, and submit the verified model update information and its score results to the blockchain.

[0128] The model aggregation module is used to aggregate the model update information in the blockchain when the number of model update information reaches a preset amount, generate a new global model, and upload it to the blockchain.

[0129] The reward allocation module is used to allocate rewards to clients and committee members in the current training round based on the new global model quality and the consensus of committee voting, and to update the reputation values ​​of all user nodes in the current training round.

[0130] The results output module is used to repeatedly execute the committee selection module, local training module, model validation module, model aggregation module, and reward allocation module until the preset training rounds are reached, and then output a new global model.

[0131] It should be noted that the federated learning system provided in this embodiment of the invention is for implementing the above methods, and its specific functions can be referred to the above method embodiments, which will not be repeated here.

[0132] like Figure 3 As shown, this embodiment of the invention also provides an industrial product quality prediction method based on federated learning, comprising:

[0133] S201: The production management platform, industrial internet platform or enterprise control server shall be used as the task publisher, and the task publisher shall put the product quality prediction model to be trained into the blockchain as a global model.

[0134] Each workshop edge server, production line control node, or equipment gateway is used as a user node, and the process parameter data, sensor data, quality inspection results, and operation logs collected locally by the user nodes are used as local datasets.

[0135] S202: The product quality prediction model to be trained is federated using the federated learning method provided in the above embodiments;

[0136] S203: Use a trained product quality prediction model to predict the quality of the target product.

[0137] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 401, a communications interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communications interface 402, and the memory 403 communicate with each other via the communication bus 404. The processor 401 can call logical instructions in the memory 403 to execute the federated learning method provided in the above embodiments, which includes S101 to S107 of the above embodiments.

[0138] Furthermore, when the logical instructions in the aforementioned memory 403 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0139] This invention also provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the federated learning method provided in the above-described method embodiments, including S101 to S107 of the above embodiments.

[0140] This invention also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the federated learning method provided in the above-described method embodiments, including S101 to S107 of the above embodiments.

[0141] 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 foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A blockchain-based federated learning method, characterized in that, include: Step 1: Initialize a global model and deploy it in the blockchain; Step 2: Based on the reputation value and the amount of staked tokens of all user nodes, select committee members from them, and the remaining user nodes participate as clients in the model update of the current training round; Step 3: The client downloads the global model from the blockchain, trains the global model using the local dataset, obtains model update information, and uploads it to the blockchain; Step 4: Committee members score and verify the model update information uploaded by the client, and submit the verified model update information and its score results to the blockchain; Step 5: When the model update information in the blockchain reaches a preset number, the committee will aggregate the model update information, generate a new global model, and upload it to the blockchain; Step 6: Distribute rewards to clients and committee members in the current training round based on the new global model quality and committee voting consistency, and update the reputation values ​​of all user nodes in the current training round. Step 7: Repeat steps 2 to 6 until the preset training rounds are reached, and output the new global model.

2. The blockchain-based federated learning method of claim 1, wherein, In step 2, the selection of committee members based on the user node's reputation value and the amount of staked tokens specifically includes: If the current training round is less than 1, the reputation values of all user nodes are sorted from large to small, and committee members are selected according to the preset number of committee members; wherein the reputation value of the user node is calculated by the formula = , wherein represents the user node The reputation value at the initial training round, represents the user node The number of tokens pledged; If the current training round is greater than or equal to 1, the probability of a user node being selected for the committee is calculated based on its reputation value and the amount of staked tokens. All user nodes are then sorted in descending order of their selection probability, and committee members are selected according to the preset number of committee members. The formula for calculating the selection probability is as follows: in, Represents user node In training rounds The probability of being selected for the committee, , and This represents the weighting coefficients controlling the collateral tokens, reputation value, and randomness. To ensure fairness in the face of random perturbations, Represents user node In training rounds Reputation value at that time.

3. The blockchain-based federated learning method according to claim 1, characterized in that, In step 4, the committee members score the model update information uploaded by the client, specifically including: Each committee member updates the client's model information. Scoring is performed to obtain an initial score; the scoring formula is as follows: in, Indicates the members of the committee in round t. For the client Submitted model update information The initial score, Represents the client in round t. The updated global model is used on the validation dataset. The accuracy rate This indicates that in round t, the global model performs well on the validation dataset. The accuracy rate; The initial scores for each committee member are adjusted using a two-sided pruning function; The adjusted initial score is weighted using the reputation scores of the committee members to obtain the final score; The client's rating is based on the final score and the credibility of the committee members: in, This indicates the committee members after the t-th round of training. For the client Submitted model update information The final score, Indicate committee members Reputation value Indicates the client The rating in round t.

4. A blockchain-based federated learning method according to claim 1 or 3, characterized in that, Step 4 also includes: the blockchain storing the hash value and related metadata of the model update information; Correspondingly, in step 5, the committee obtains the model update information through a hash index and aggregates the model update information.

5. The blockchain-based federated learning method according to claim 1, characterized in that, After the t-th round of training, the reward distribution formula for the client is: in, This represents the client's reward pool after round t. Indicates the client The rating, Indicates the client Reward distribution, Indicates the number of clients; The formula for distributing rewards to committee members is as follows: in, Indicates the committee's reward pool, Indicate committee members Reputation value Indicate committee members Consistency Indicates the number of committee members.

6. The blockchain-based federated learning method according to claim 1, characterized in that, The user node reputation value update includes the reputation value update of the committee nodes and client nodes in the current training round; The formula for updating the reputation value of the committee node is as follows: In the formula, in, Represents user node In training rounds Reputation value at that time Indicates the attenuation factor. Represents user node Consistency Indicates the members of the committee in round t. The deviation between the scoring and the consensus result. Indicates the client The weight, This indicates the maximum allowed score difference. The formula for updating the reputation value of the client node is: in, Indicates the client The reputation value in round t, This represents the score that client i receives after verification by the committee in round t. The forgetting factor is used to update client reputation and control the trade-off between historical reputation and current round score.

7. A blockchain-based federated learning system, characterized in that, include: The initialization module is used to initialize a global model deployed on the blockchain; The committee selection module is used to select committee members based on the reputation value and the amount of staked tokens of all user nodes, while the remaining user nodes participate as clients in the model update of the current training round. The local training module is used by the client to download the global model from the blockchain, train the global model using the local dataset, obtain model update information, and upload it to the blockchain. The model verification module is used by committee members to score and verify the model update information uploaded by the client, and submit the verified model update information and its score results to the blockchain. The model aggregation module is used to aggregate the model update information in the blockchain when the number of model update information in the blockchain reaches a preset amount, generate a new global model, and upload it to the blockchain. The reward allocation module is used to allocate rewards to clients and committee members in the current training round based on the new global model quality and committee voting consistency, and to update the reputation values ​​of all user nodes in the current training round. The result output module is used to repeatedly execute the committee selection module, the local training module, the model validation module, the model aggregation module, and the reward allocation module until a preset number of training rounds are reached, and then output the new global model.

8. A method for predicting the quality of industrial products based on federated learning, characterized in that, include: The production management platform, industrial internet platform, or enterprise control server is used as the task publisher, and the task publisher puts the product quality prediction model to be trained into the blockchain as a global model. Each workshop edge server, production line control node, or equipment gateway is used as a user node, and the process parameter data, sensor data, quality inspection results, and operation logs collected locally by the user nodes are used as local datasets. The product quality prediction model to be trained is federatedly trained using the method described in any one of claims 1-6. The quality of the target product is predicted using a trained product quality prediction model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method as described in any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.