Model training method and device, equipment and readable storage medium

By training and integrating an encrypted global model across N training nodes on the blockchain, and utilizing the Paillier homomorphic encryption algorithm and a multi-dimensional scoring reward mechanism, the problem of insufficient model confidentiality in blockchain federated learning is solved, achieving end-to-end privacy protection and enhanced security.

CN122389059APending Publication Date: 2026-07-14CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-04-30
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

When performing federated learning in a blockchain, the confidentiality of the model is poor, and there is a risk of model leakage during the training process.

Method used

By receiving training requests from the user, the encrypted global model of N training nodes is trained, and the model training and integration are performed in the ciphertext domain. The optimized Paillier homomorphic encryption algorithm is used to ensure that the model is transmitted and processed in ciphertext form. A multi-dimensional committee scoring algorithm and reward mechanism are adopted to incentivize the participation of training nodes.

Benefits of technology

This enhances model confidentiality during federated learning on the blockchain, ensuring that training nodes cannot directly access global model data, thereby improving security and privacy protection during the training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122389059A_ABST
    Figure CN122389059A_ABST
Patent Text Reader

Abstract

The application discloses a model training method and device, equipment and a readable storage medium, and relates to the field of blockchains. After receiving a training request sent by a user end, the technical scheme of the application trains an encrypted global model by using N training nodes according to training information included in the training request, thereby obtaining N trained encrypted global models. The N trained encrypted global models are integrated to obtain a target global model, so that the training nodes do not directly obtain the data of the global model, thereby completing federated learning of the encrypted global model, and the confidentiality of the model in the training process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, specifically to a model training method, apparatus, device, and readable storage medium. Background Technology

[0002] Federated learning is a distributed machine learning paradigm. Its core idea is to collaboratively train a shared global model among multiple parties, while meeting data privacy and data locality requirements, without uploading the original datasets of each participant to a central server. Blockchain is a decentralized distributed ledger technology that links data blocks together in a chain structure. Each block contains a transaction record, a timestamp, and the hash value of the previous block. Blockchain provides data storage security and immutability, enabling transparent, verifiable, and tamper-proof recording of transactions without the need for a trusted third party. However, in related technologies, the use of federated learning in blockchain for model training does not consider the confidentiality of training nodes, resulting in poor model confidentiality during training. Summary of the Invention

[0003] This application provides a model training method, apparatus, device, and readable storage medium, which solves the problem of poor model confidentiality when performing federated training in a blockchain in related technologies.

[0004] In a first aspect, embodiments of this application provide a model training method, the method comprising:

[0005] The system receives a training request sent by a user client. The training request is used to request training of a global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model.

[0006] Using the training information, the encrypted global model in N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N training nodes are N client nodes out of M client nodes. The M client nodes are client nodes that have completed registration in the blockchain. M is an integer greater than 1 and N is a positive integer less than M.

[0007] The N trained encrypted global models are integrated to obtain the target global model.

[0008] Optionally, the training information includes the learning rate corresponding to the global model and the number of iterative training rounds corresponding to the global model. The step of using the training information to train the encrypted global model on each of the N training nodes to obtain N trained encrypted global models corresponding one-to-one with the N training nodes includes:

[0009] K committee nodes are randomly selected from the M client nodes. Based on the K committee nodes, the other client nodes in the M client nodes are determined as N training nodes, where the sum of K and N is M.

[0010] In the encrypted domain, based on N training datasets, the learning rate corresponding to the global model, and the number of iterations for the global model, the encrypted global model in the N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N preset datasets and the N training nodes are N different training datasets.

[0011] Optionally, the step of training the encrypted global model in the ciphertext domain based on a preset dataset, the learning rate corresponding to the global model, and the number of iterative training rounds corresponding to the global model, respectively, to obtain N trained encrypted global models corresponding one-to-one with the N training nodes, includes:

[0012] For the target training node, a random seed is generated and a mask vector is generated based on a homomorphic pseudo-random generator. The target training node is any one of the N training nodes. The random seed is used to perform random blurring on the encrypted global model, and the mask vector is used to determine the region of the encrypted global model that needs to be randomly blurred.

[0013] Based on the random seed and the mask vector, the encrypted global model is masked and blurred to obtain the processed encrypted global model.

[0014] In the encrypted domain, based on a preset dataset, the learning rate corresponding to the global model, and the iterative training rounds corresponding to the global model, the processed encrypted global model in the target training node is trained to obtain N trained encrypted global models that correspond one-to-one with the N training nodes.

[0015] Optionally, the integration of the N trained cryptographic global models to obtain the target global model includes:

[0016] Based on K committee nodes, the N trained encryption global models are scored respectively to obtain K score values ​​corresponding one-to-one with the K committee nodes. The K committee nodes are K customer nodes out of M customer nodes, where K is a positive integer less than M.

[0017] If the number of scores greater than or equal to a preset threshold among the K scores exceeds K / 2, the N trained encrypted global models are integrated to obtain an initial global model.

[0018] The initial global model is decrypted to obtain the target global model.

[0019] Optionally, the training information also includes the target reward funds corresponding to the global model. After scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes, the method further includes:

[0020] For the i-th training iteration, the first reward fund corresponding to the i-th training iteration is determined according to the target reward fund;

[0021] N reward weight values ​​are determined based on the K score values, and the N reward weight values ​​correspond one-to-one with the N training nodes;

[0022] The first reward funds are calculated based on the N reward weight values ​​to obtain N second reward funds. The N second reward resources correspond one-to-one with the N training nodes. The N second reward funds are the reward funds obtained by the corresponding training node in the i-th iteration of training.

[0023] The target reward funds corresponding to the global model are allocated to the N training nodes.

[0024] Optionally, the step of scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes includes:

[0025] Obtain the scoring items, which include: the participation of training nodes, the legality of training nodes, and the training throughput of training nodes;

[0026] Determine the weight information corresponding to the scoring item. The weight information includes a first weight value corresponding to the participation of the training node, a second weight value corresponding to the legality of the training node, and a third weight value corresponding to the training throughput of the training node.

[0027] For the target committee node, the N trained encrypted global models are scored based on the scoring items to obtain an initial score value, where the target committee node is any one of the K committee nodes;

[0028] Based on the target committee node, the initial score value is weighted according to the weight information to obtain K score values ​​that correspond one-to-one with the K committee nodes.

[0029] Optionally, after integrating the N trained encrypted global models to obtain the target global model when the number of score values ​​greater than or equal to a preset threshold among the K score values ​​exceeds K / 2, the method further includes:

[0030] Send the target global model to the user terminal and store the target global model on the blockchain;

[0031] If the number of rating values ​​greater than or equal to a preset threshold among the K rating values ​​does not exceed K / 2, then the K rating values ​​will be invalidated.

[0032] Based on the K committee nodes, the N trained cryptographic global models are re-evaluated.

[0033] Secondly, embodiments of this application provide a model training apparatus, the apparatus comprising:

[0034] A receiving module is used to receive a training request sent by a user terminal. The training request is used to request training of a global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model.

[0035] The training module is used to train the encrypted global model in N training nodes using the training information, so as to obtain N trained encrypted global models corresponding one-to-one with the N training nodes. The N training nodes are N client nodes out of M client nodes. The M client nodes are client nodes that have been registered in the blockchain. M is an integer greater than 1 and N is a positive integer less than M.

[0036] The integration module is used to integrate the N trained encrypted global models to obtain the target global model.

[0037] Thirdly, this application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect above.

[0038] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0039] Fifthly, this application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the method described in the first aspect above.

[0040] This application discloses a model training method, apparatus, device, and readable storage medium, relating to the blockchain field. The method includes: receiving a training request sent by a user terminal, the training request being used to request training of a global model in the blockchain, the training request including an encrypted global model and training information, the encrypted global model being a model obtained by encrypting the global model according to a preset encryption algorithm, and the training information being used to represent the training target of the global model; using the training information to train the encrypted global model in N training nodes respectively, to obtain N trained encrypted global models corresponding one-to-one with the N training nodes, the N training nodes being N client nodes out of M client nodes, the M client nodes being client nodes that have completed registration in the blockchain, M being an integer greater than 1, and N being a positive integer less than M; and integrating the N trained encrypted global models to obtain a target global model. The technical solution of this application, after receiving a training request sent by the user, trains the encrypted global model using N training nodes according to the training information included in the training request, thereby obtaining N trained encrypted global models. Then, the N trained encrypted global models are integrated to obtain the target global model. This achieves federated learning of the encrypted global model without the training nodes directly obtaining the data of the global model, thereby improving the confidentiality of the model during the training process. Attached Figure Description

[0041] To more clearly illustrate the technical solution of this application, the drawings used in the description of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1A schematic flowchart illustrating a model training method provided in an embodiment of this application;

[0043] Figure 2 The overall interaction flowchart provided for the embodiments of this application;

[0044] Figure 3 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0046] 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, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] The terms "first," "second," etc., used in the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, 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 explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. Additionally, the use of "and / or" in this application indicates at least one of the connected objects, such as A and / or B and / or C, representing seven possibilities: including A alone, B alone, C alone, and the presence of both A and B, both B and C, both A and C, and the presence of A, B, and C.

[0048] See Figure 1 , Figure 1 This is a flowchart illustrating the model training method provided in an embodiment of this application. For example... Figure 1 As shown, the model training method may include the following steps:

[0049] Step 101: Receive a training request sent by the user terminal. The training request is used to request training of the global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model.

[0050] In this embodiment, the global model is a linear regression model. Linear regression is a fundamental and widely used supervised learning algorithm in machine learning, primarily used to solve regression problems. It predicts and analyzes by assuming a linear relationship between the dependent variable (output) and the independent variables (input). For example, a linear regression model can be used to predict house prices in a certain area. Here, independent variables may include house area, number of bedrooms, location, year of construction, etc., while the dependent variable is the house price. In the healthcare industry, a linear regression model can be used to predict a patient's medical expenses. Independent variables may include the patient's age, gender, pre-existing conditions, length of hospital stay, etc., while the dependent variable is the medical expenses. Businesses can use linear regression to explore the impact of advertising expenditure on sales. The independent variable is the amount of advertising expenditure, and the dependent variable is sales revenue.

[0051] The user is the task publisher. Specifically, the user becomes a legitimate task initiator by submitting identity information and obtaining system approval. The training request is used to request training of the global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. Specifically, the trusted center generates Paillier encryption key pairs. Public key Public, private key Securely distributed to task publishers. Task publishers use public keys. For the global model Encryption is performed to obtain the global encryption model. The global model exists in encrypted form throughout subsequent training. Training information is used to represent the training objectives of the global model, such as the number of training iterations and the learning rate. Specifically, the task publisher publishes a learning task that includes encrypting the global model. Training objectives (e.g., number of iterations) Learning rate Clients register and obtain a unique identifier assigned by the system. The Trusted Center generates a signing key pair for each registered client. private key The public key, used for transaction signing, is stored locally on the client side. Publicly binds to the client's identity.

[0052] For example, a training request may be used to request training of a house price prediction model, with 100 iterations.

[0053] Step 102: Using the training information, train the encrypted global model in each of the N training nodes to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N training nodes are N client nodes out of M client nodes. The M client nodes are client nodes that have completed registration in the blockchain. M is an integer greater than 1, and N is a positive integer less than M.

[0054] In this embodiment, the N training nodes are selected from the M client nodes that have registered in the blockchain. For example, 60 client nodes can be selected from 100 registered M client nodes. Specifically, the training nodes download task information and, based on homomorphic encryption properties, train a cryptographic global model using a local dataset in the cryptographic domain to obtain the trained cryptographic global model. After training, the training nodes upload transactions. The transaction content may include the current round, node ID, sum of shares, the trained cryptographic global model, local data size, and signature. For example, the 60 training nodes may use different training datasets to train the cryptographic house price prediction model separately to obtain the trained cryptographic house price prediction model.

[0055] Step 103: Integrate the N trained encrypted global models to obtain the target global model.

[0056] In this embodiment, after obtaining N trained encrypted global models, the encrypted global models are integrated. It should be noted that the integrated global models also need to be decrypted to finally obtain the target global model and feed it back to the user.

[0057] The technical solution of this application, after receiving a training request sent by the user, trains the encrypted global model using N training nodes according to the training information included in the training request, thereby obtaining N trained encrypted global models. Then, the N trained encrypted global models are integrated to obtain the target global model. This achieves federated learning of the encrypted global model without the training nodes directly obtaining the data of the global model, thereby improving the confidentiality of the model during the training process.

[0058] In some feasible implementations, optionally, the training information includes the learning rate corresponding to the global model, the number of iterative training rounds corresponding to the global model, and the target reward funds corresponding to the global model. The step of using the training information to train the encrypted global model on N training nodes respectively, to obtain N trained encrypted global models corresponding one-to-one with the N training nodes, includes:

[0059] K committee nodes are randomly selected from the M client nodes. Based on the K committee nodes, the other client nodes in the M client nodes are determined as N training nodes, where the sum of K and N is M.

[0060] In the encrypted domain, based on N training datasets, the learning rate corresponding to the global model, and the number of iterations for the global model, the encrypted global model in the N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N preset datasets and the N training nodes are N different training datasets.

[0061] In this embodiment, the K committee nodes are selected from the M client nodes that have registered in the blockchain. Specifically, the remaining client nodes, excluding the N training nodes, are used as committee nodes, resulting in K committee nodes. The training information includes the learning rate of the global model, the number of iterations for the global model, and the target reward funds for the global model, where the target reward funds are used to reward the N training nodes that are performing training.

[0062] Specifically, such as Figure 2 As shown, Figure 2 This is the system architecture diagram in this embodiment. The task publisher calls the `node_register()` interface of the smart contract to register, submits identity information, and obtains system approval. The trusted center generates an optimized Paillier homomorphic encryption key pair. private key Securely distributed to the task publisher, public key Publicly available for use by training nodes. The optimized Paillier homomorphic encryption algorithm, compared to the unoptimized algorithm, reduces the number of exponentiations in the decryption phase from... Reduce to This reduces computational complexity. The specific key generation, encryption, and decryption process is as follows:

[0063] Key generation: Select two large prime numbers of the same length. and The conditions are met. .calculate , Select divisor .definition Select generator and guarantee The order is .calculate Obtain the public key private key Plaintext encryption: Given plaintext... Randomly select a positive integer , The ciphertext is calculated as .

[0064] Ciphertext decryption: Given a ciphertext The decryption calculation is as follows:

[0065]

[0066] in, For plain text, It is a ciphertext. .

[0067] Edge devices with computing power and local data Register by calling the node_register() interface and obtain a unique identifier. Trust Center for each client Generate signature key pair private key The public key is stored locally on the client side. Publicly binds to the client's identity.

[0068] Registered clients are categorized into committee nodes and training nodes based on their roles, as shown in the following formula:

[0069] .

[0070] in: This represents the set of all registered clients. Indicates the first Round committee node set, Indicates the first The training node set is divided into (i) training nodes that have completed secret sharing and (ii) training nodes that have completed model uploading, based on their participation in model training. Indicates the first The training nodes for completing the secret sharing phase are completed. Indicates the first The training nodes of the uploaded model are completed in one round.

[0071] Global model encryption and task publishing: Task publishers use public keys Encryption Global Model To obtain the encrypted global model Apart from the task publisher, no entity can decrypt or aggregate the plaintext of the global model.

[0072] Calling the task_upload() interface to publish a task will encrypt the global model. Learning rate Training rounds ,award Forming a transaction Go on-chain and deposit the predetermined amount of reward funds.

[0073] The committee node election mechanism is as follows: Initial round: Round 1, from the set of registered clients. Randomly select the set of committee nodes And randomly assign the master node for that round. (PrimaryNode). Subsequent rounds: [Number] Round, based on the previous round The rating results, from The nodes with the top-k scores will be selected as the next round of committee nodes. And randomly select the master node. .

[0074] Specifically, the Top-k committee selection algorithm is as follows:

[0075] Input: round Client collection Number k, training node set rating set .

[0076] Output: Set of committee nodes Master node training node set .

[0077] The algorithm includes the following steps:

[0078] Step 1 k < , 0.

[0079] Step 2, if The first round of random elections.

[0080] Step 3 ←random( ).

[0081] Step 4 ←random( ).

[0082] Step 5 ← .

[0083] Step 6, else No. The next round is based on the previous round of scoring and election.

[0084] Step 7 ←Top( )

[0085] Step 8 ←random( ).

[0086] Step 9 ← .

[0087] Step 10, end if.

[0088] Step 11, return .

[0089] This embodiment, based on the Top-K committee election algorithm from the previous round of scoring, directly links the reliability and contribution of nodes to their permissions (committee roles) within the system, ensuring the high quality and stability of core aggregation and verification nodes. A multi-dimensional committee scoring algorithm is proposed, comprehensively considering four measurable dimensions to objectively and quantitatively evaluate the overall performance of each training node in a round of training, providing a fair and transparent basis for committee election and incentive allocation. A single-round reward allocation algorithm based on scoring is designed, distributing rewards in each round to effectively incentivize training nodes to maintain long-term, stable, and efficient participation, suppressing training node exits and malicious behavior, and ensuring the robustness and sustainability of the system.

[0090] The training nodes perform local model training within the ciphertext domain. Specifically, the first... Round, training node Call the task_download() interface to download task information, including the previous round of encrypted global model. Learning rate Total training rounds and pay the training deposit for this round. Based on local dataset This enables the training of a local model in the ciphertext domain using the Stochastic Gradient Descent (SGD) algorithm.

[0091] training nodes The trained cryptographic global model calculate:

[0092] .

[0093] in, To encrypt the global model, For learning rate, This is the trained encrypted global model.

[0094] The optimized Paillier cryptographic algorithm has additive homomorphic properties for the same public key. Any of the following ,satisfy , Without decrypting the previous round of encrypted global model Under these circumstances, a cryptographic global model can be computed. .

[0095] .

[0096] in: , Let the local gradient be denoted as [gradient]. Encrypted local gradients . Derivation of component calculation based on homomorphism:

[0097] .

[0098] in: Represents a local dataset The Middle The first sample The gradient of each element. Further derivation. In the following formula For feature vectors The Each element.

[0099] .

[0100] Therefore, based on the calculated local gradient ciphertext The encrypted global model can be updated within the ciphertext domain without decryption. .

[0101] In this embodiment, training nodes can directly calculate the encrypted gradient and update the local model ciphertext based on the homomorphic property without decrypting the encrypted global model. This reduces the computational burden on training nodes and lowers the time and energy consumption of a single training round.

[0102] Optionally, the step of training the encrypted global model in the ciphertext domain based on a preset dataset, the learning rate corresponding to the global model, and the number of iterative training rounds corresponding to the global model, respectively, to obtain N trained encrypted global models corresponding one-to-one with the N training nodes, includes:

[0103] For the target training node, a random seed is generated and a mask vector is generated based on a homomorphic pseudo-random generator. The target training node is any one of the N training nodes. The random seed is used to perform random blurring on the encrypted global model, and the mask vector is used to determine the region of the encrypted global model that needs to be randomly blurred.

[0104] Based on the random seed and the mask vector, the encrypted global model is masked and blurred to obtain the processed encrypted global model.

[0105] In the encrypted domain, based on a preset dataset, the learning rate corresponding to the global model, and the iterative training rounds corresponding to the global model, the processed encrypted global model in the target training node is trained to obtain N trained encrypted global models that correspond one-to-one with the N training nodes.

[0106] In this embodiment, apart from the trusted center, all other entities are honest but curious. Although the training nodes perform computations within the ciphertext domain, and the local model is encrypted, the task publisher possesses the Paillier encryption private key and can therefore decrypt the encrypted global model. Therefore, the encrypted global model needs to be masked to ensure the privacy of local model parameters throughout the entire process.

[0107] Specifically, for the target training node, through each training node Generate random seed Mask vectors are generated based on a homomorphic pseudorandom generator (HPRG). .

[0108] .

[0109] in, Use a random seed. This is the mask vector.

[0110] training nodes Encryption global model Obtained by masking and blurring :

[0111] .

[0112] in, for To encrypt the global model, This is the mask vector.

[0113] To ensure that the mask can be removed during the local model aggregation process even if a training node exits midway, a method is adopted. Secret sharing: Secretly sharing seeds between training nodes. Training nodes Construct polynomial , As a secret Training nodes secret The training nodes send their share to other training nodes, and the other training nodes also allocate their share to the training nodes. Successfully completed the secret-sharing training node Training nodes Use Lagrange interpolation to calculate the sum of your received shares. .

[0114] After training is completed, the training node Call the localModel_upload() interface to upload transaction information, including the current round, node ID, and sum of shares. Masked global encryption model, local data size And signature.

[0115] It should be noted that, among them Represents training nodes The result of signing with the private key successfully completed the upload of the masked encrypted global model training node. .

[0116] No. Round training, based on scoring election committee nodes The rest are used as training nodes. Training nodes Download the global cryptographic model for this round from the new block. and pay the training deposit for this round. This continues until the model reaches the training objective. The task publisher calls the globalModel_download() interface to download the encrypted target global model. Using private key Decryption yields the target global model. .

[0117] This embodiment employs an optimized Paillier homomorphic encryption algorithm, ensuring that the global model exists and circulates in encrypted form throughout its entire lifecycle, from initial publication to final aggregation. The task publisher is the only entity possessing the decryption private key, effectively preventing committee nodes, training nodes, and any third party from stealing or restoring the global model during training. This addresses the core pain points of model intellectual property rights and intermediate state leakage, providing end-to-end privacy protection from local to global perspectives, and significantly enhancing security strength.

[0118] Optionally, the integration of the N trained cryptographic global models to obtain the target global model includes:

[0119] Based on K committee nodes, the N trained encryption global models are scored respectively to obtain K score values ​​corresponding one-to-one with the K committee nodes. The K committee nodes are K customer nodes out of M customer nodes, where K is a positive integer less than M.

[0120] If the number of scores greater than or equal to a preset threshold among the K scores exceeds K / 2, the N trained encrypted global models are integrated to obtain an initial global model.

[0121] The initial global model is decrypted to obtain the target global model.

[0122] In this embodiment, the K committee nodes are also selected from the M client nodes that have completed registration in the blockchain. For example, the remaining client nodes other than the N training nodes can be used as committee nodes to obtain K committee nodes.

[0123] After obtaining N trained global cryptographic models, the N trained global cryptographic models are scored based on the model training participation of the training nodes, transaction legality, local dataset size, and training time of the training nodes by K committee nodes, resulting in K score values ​​for the corresponding K committee nodes.

[0124] In this embodiment, a master node can be determined from among the K committee nodes. The master node receives qualified transaction sequences, encrypted global models, and score sets sent by the other committee nodes, and checks whether it receives at least half of the same results. If so, consensus is reached. Otherwise, it broadcasts re-verification, aggregation, and scoring requests until consensus is reached. The master node packages the encrypted global model, qualified transaction sequences, and score sets into a transaction and signs it to form a new block. After verification by more than half of the committee nodes, the block is uploaded to the blockchain. During the model's training iteration process, until the model reaches the required training rounds, the publisher downloads the encrypted global model and decrypts it using its private key. Thus, the N trained encrypted global models are integrated to obtain an initial global model, which is then decrypted to obtain the target global model. For example, 60 trained encrypted house price prediction models are integrated to obtain the target house price prediction model. The target house price prediction model can be used to predict house price information within a certain time period, thereby obtaining the prediction result.

[0125] Optionally, the training information also includes the target reward funds corresponding to the global model. After scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes, the method further includes:

[0126] For the i-th training iteration, the first reward fund corresponding to the i-th training iteration is determined according to the target reward fund;

[0127] N reward weight values ​​are determined based on the K score values, and the N reward weight values ​​correspond one-to-one with the N training nodes;

[0128] The first reward funds are calculated based on the N reward weight values ​​to obtain N second reward funds. The N second reward resources correspond one-to-one with the N training nodes. The N second reward funds are the reward funds obtained by the corresponding training node in the i-th iteration of training.

[0129] The target reward funds corresponding to the global model are allocated to the N training nodes.

[0130] In this embodiment, based on the first The scoring of each training node in the round determines the reward allocation and penalty.

[0131] The smart contract calls the reward_compute() interface, based on ,in Rewards and penalties are allocated to each training node. As a penalty, training nodes that fail to upload transactions have a portion of their deposit deducted for that round, with the remainder returned. The deducted deposit is used to adjust the reward pool. The total reward will be divided equally among the remaining rounds. The training nodes that upload transactions will receive rewards for that round based on their score percentage, thus implementing a system of rewarding hard work and penalizing those who fail to perform their duties.

[0132] The specific single-round reward allocation algorithm based on scoring is as follows:

[0133] Input: Set of training nodes Upload transaction collection rating set Pre-deposit rewards Total training rounds The deposit for this round of training nodes .

[0134] Output: The Rewards for each node in the round .

[0135] Step 1 .

[0136] Step 2, sum Calculate the total score.

[0137] Step 3 .

[0138] Step 4 No trading training node uploaded.

[0139] Step 5 Half of the deposit will be deducted as rewards for other nodes.

[0140] Step 6 Half of the deposit for this round will be deducted.

[0141] Step 7 = Half of the deposit will be refunded.

[0142] Step 8 The training node that uploads the transaction will be allocated all the deposit for that round plus the reward for that round.

[0143] Step 9 .

[0144] Step 10, end if.

[0145] Step 11, end for.

[0146] Step 12 .

[0147] Step 13, return

[0148] This embodiment is based on a multi-dimensional committee scoring algorithm (covering participation, legitimacy, data volume, and training time), and proposes a reward algorithm and a deposit penalty mechanism based on the percentage of scores allocated in a single round. This mechanism is automatically executed through smart contracts, achieving automation, transparency, and fairness in incentive allocation. It positively incentivizes clients to contribute high-quality data and computing power, while penalizing disconnections and malicious nodes.

[0149] Optionally, the step of scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes includes:

[0150] Obtain the scoring items, which include: the participation of training nodes, the legality of training nodes, and the training throughput of training nodes;

[0151] Determine the weight information corresponding to the scoring item. The weight information includes a first weight value corresponding to the participation of the training node, a second weight value corresponding to the legality of the training node, and a third weight value corresponding to the training throughput of the training node.

[0152] For the target committee node, the N trained encrypted global models are scored based on the scoring items to obtain an initial score value, where the target committee node is any one of the K committee nodes;

[0153] Based on the target committee node, the initial score value is weighted according to the weight information to obtain K score values ​​that correspond one-to-one with the K committee nodes.

[0154] In this embodiment, the committee Each node (non-master node) Verify training nodes using the signature public key. The system collects the signatures of uploaded transactions, verifies the accuracy of the transaction format data, filters out qualified transactions, and forms a qualified transaction sequence. .

[0155] After each committee node selects qualified transactions, it calls the modelAggregation() interface to aggregate the masked cryptographic global model, thus obtaining the masked cryptographic global model. .

[0156]

[0157] in, For a masked global encryption model, Use a random seed. This is the mask vector.

[0158] when At that time, if This indicates that the committee received at least Share of training nodes .based on Secretly shared Properties, Reconstructing Seeds Then demask it. , obtained the Round encryption global model and will and qualified transaction sequence Send to the master node.

[0159] .

[0160] in, For a masked global encryption model, Use a random seed. This is the mask vector.

[0161] Each committee node (non-master node) Based on training nodes Training participation Legality of the transaction Local dataset size Training time The scores are used as indicators to form a score set. ,in Then send the scoring dataset to the master node. .

[0162] The specific algorithm is described as follows: (Throughput, the amount of data processed per unit of time) represents the ratio of the local dataset size to the training time, and is directly proportional to the score. , , Indicates training participation Legality of the transaction and throughput Weighting, set here. , , The values ​​are 0.3, 0.5, and 0.2 respectively.

[0163] Specifically, the multi-dimensional committee scoring algorithm is as follows:

[0164] Input: Set of training nodes Upload trading training node Qualified trading sequence Dataset size Training time Weight , , .

[0165] Output: Set of ratings .

[0166] Includes the following steps:

[0167] Step 1 , = =

[0168] Step 2 .

[0169] Step 3 Upload the trading training node.

[0170] Step 4 .

[0171] Step 5 =Size i / .

[0172] Step 6, if Qualified trading training node.

[0173] Step 7 .

[0174] Step 8, else.

[0175] Step 9 No trading training node uploaded.

[0176] Step 10 =0.

[0177] Step 11, end if.

[0178] Step 12 ( ) + + .

[0179] Step 13, end if.

[0180] Step 14, return .

[0181] Based on the target committee nodes, the initial score value is weighted according to the weight information to obtain K score values ​​that correspond one-to-one with the K committee nodes. This enables the calculation of score values ​​according to different weight information, ensuring the accuracy of the score values.

[0182] Optionally, after integrating the N trained encrypted global models to obtain the target global model when the number of score values ​​greater than or equal to a preset threshold among the K score values ​​exceeds K / 2, the method further includes:

[0183] Send the target global model to the user terminal and store the target global model on the blockchain;

[0184] If the number of rating values ​​greater than or equal to a preset threshold among the K rating values ​​does not exceed K / 2, then the K rating values ​​will be invalidated.

[0185] Based on the K committee nodes, the N trained cryptographic global models are re-evaluated.

[0186] In this embodiment, if the number of rating values ​​greater than or equal to a preset threshold exceeds K / 2 out of K rating values, the N trained encrypted global models are integrated, the target global model is sent to the user terminal, and the target global model is stored on the blockchain. If the number of rating values ​​greater than or equal to the preset threshold exceeds K / 2, a re-aggregation and rating request is broadcast until consensus is reached.

[0187] Specifically, the master node Check if half have been received (| The same aggregation result as |-1) / 2 or above is obtained, and it is checked whether half of the (| |-1) / 2 or more sets of identical ratings. (| |-1) / 2 indicates that it is half of the non-master nodes in the committee.

[0188] If both are true, a consensus is reached. The master node will... Qualified trading sequence and Packaged into a transaction , The new block format is as follows: Master node Broadcast the new block to the committee nodes, after more than (| Once the committee nodes verify (-1) / 2 of the data, it is stored on the blockchain. Otherwise, the re-aggregation and scoring requests are broadcast until consensus is reached.

[0189] The technical solution of this application, after receiving a training request sent by the user, trains the encrypted global model using N training nodes according to the training information included in the training request, thereby obtaining N trained encrypted global models. Then, the N trained encrypted global models are integrated to obtain the target global model. This achieves federated learning of the encrypted global model without the training nodes directly obtaining the data of the global model, thereby improving the confidentiality of the model during the training process.

[0190] See Figure 3 , Figure 3 This is a structural diagram of the model training device provided in an embodiment of this application. For example... Figure 3 As shown, the model training device 300 includes:

[0191] The receiving module 310 is used to receive a training request sent by the user terminal. The training request is used to request training of a global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model.

[0192] Training module 320 is used to train the encrypted global model in N training nodes using the training information, so as to obtain N trained encrypted global models corresponding one-to-one with the N training nodes. The blockchain includes M client nodes that have been registered in the blockchain. The N training nodes are N client nodes among the M client nodes. M is an integer greater than 1 and N is a positive integer less than M.

[0193] Integration module 330 is used to integrate the N trained encrypted global models to obtain the target global model.

[0194] Optionally, the training information includes the learning rate corresponding to the global model and the number of iterations for training the global model. The training module 320 includes:

[0195] A selection submodule is used to randomly select K committee nodes from the M client nodes, and based on the K committee nodes, determine N training nodes from the M client nodes other than the K committee nodes, where the sum of K and N is M.

[0196] The training submodule is used to train the encrypted global model in the N training nodes respectively in the encrypted domain based on N training datasets, the learning rate corresponding to the global model and the iterative training rounds corresponding to the global model, so as to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N preset datasets and the N training nodes are N different training datasets.

[0197] Optionally, the training submodule includes:

[0198] The generation unit is used to generate a random seed and a mask vector based on a homomorphic pseudo-random generator for a target training node. The target training node is any one of the N training nodes. The random seed is used to perform random blurring on the encrypted global model. The mask vector is used to determine the region of the encrypted global model that needs to be randomly blurred.

[0199] A processing unit is configured to perform masking and blurring processing on the encrypted global model based on the random seed and the mask vector to obtain the processed encrypted global model.

[0200] The training unit is used to train the processed encrypted global model in the target training node in the encrypted domain based on a preset dataset, the learning rate corresponding to the global model, and the iterative training rounds corresponding to the global model, so as to obtain N trained encrypted global models that correspond one-to-one with the N training nodes.

[0201] Optionally, the integration module 330 includes:

[0202] The scoring submodule is used to score the N trained encrypted global models based on K committee nodes, and obtain K score values ​​corresponding one-to-one with the K committee nodes. The K committee nodes are K customer nodes out of M customer nodes, and K is a positive integer less than M.

[0203] The integration submodule is used to integrate the N trained encrypted global models to obtain an initial global model when the number of score values ​​greater than or equal to a preset threshold among the K score values ​​exceeds K / 2.

[0204] The decryption submodule is used to decrypt the initial global model to obtain the target global model.

[0205] Optionally, the training information also includes the target reward funds corresponding to the global model, and further includes:

[0206] The first determining submodule is used to determine the first reward fund corresponding to the i-th iteration of training based on the target reward fund corresponding to the global model for the i-th iteration of training.

[0207] The second determining submodule is used to determine N reward weight values ​​based on the K score values, wherein the N reward weight values ​​correspond one-to-one with the N training nodes;

[0208] The first calculation submodule is used to calculate the first reward funds based on the N reward weight values ​​to obtain N second reward funds. The N second reward resources correspond one-to-one with the N training nodes, and the N second reward funds are the reward funds obtained by the corresponding training node in the i-th iteration of training.

[0209] The allocation submodule is used to allocate the target reward funds corresponding to the global model to the N training nodes.

[0210] Optionally, the scoring module 330 includes:

[0211] The acquisition submodule is used to acquire scoring items, which include: the participation of training nodes, the legality of training nodes, and the training throughput of training nodes.

[0212] The determination submodule is used to determine the weight information corresponding to the scoring item. The weight information includes a first weight value corresponding to the participation of the training node, a second weight value corresponding to the legality of the training node, and a third weight value corresponding to the training throughput of the training node.

[0213] The scoring submodule is used to score the N trained encrypted global models based on the scoring items for the target committee node, and obtain an initial score value. The target committee node is any one of the K committee nodes.

[0214] The second calculation submodule is used to perform weight calculation on the initial score value based on the target committee node and according to the weight information, so as to obtain K score values ​​that correspond one-to-one with the K committee nodes.

[0215] Also includes:

[0216] The sending submodule is used to send the target global model to the user terminal and store the target global model on the blockchain;

[0217] The invalidation submodule is used to invalidate the K rating values ​​if the number of rating values ​​greater than or equal to a preset threshold does not exceed K / 2.

[0218] The re-scoring submodule is used to re-score the N trained encrypted global models based on the K committee nodes.

[0219] The technical solution of this application, after receiving a training request sent by the user, trains the encrypted global model using N training nodes according to the training information included in the training request, thereby obtaining N trained encrypted global models. Then, the N trained encrypted global models are integrated to obtain the target global model. This achieves federated learning of the encrypted global model without the training nodes directly obtaining the data of the global model, thereby improving the confidentiality of the model during the training process.

[0220] This application also provides an electronic device. Please refer to [link to relevant documentation]. Figure 4 The electronic device may include a processor 401, a memory 402, and a program 4021 stored in the memory 402 and executable on the processor 401.

[0221] When program 4021 is executed by processor 401, it can achieve the following: Figure 1 Any step in the corresponding method embodiment:

[0222] The system receives a training request sent by a user client. The training request is used to request training of a global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model.

[0223] Using the training information, the encrypted global model in N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The blockchain includes M client nodes that have been registered in the blockchain. The N training nodes are N client nodes among the M client nodes. M is an integer greater than 1 and N is a positive integer less than M.

[0224] The N trained encrypted global models are integrated to obtain the target global model.

[0225] Optionally, the training information includes the learning rate corresponding to the global model and the number of iterative training rounds corresponding to the global model. The step of using the training information to train the encrypted global model on each of the N training nodes to obtain N trained encrypted global models corresponding one-to-one with the N training nodes includes:

[0226] K committee nodes are randomly selected from the M client nodes. Based on the K committee nodes, the other client nodes in the M client nodes are determined as N training nodes, where the sum of K and N is M.

[0227] In the encrypted domain, based on N training datasets, the learning rate corresponding to the global model, and the number of iterations for the global model, the encrypted global model in the N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N preset datasets and the N training nodes are N different training datasets.

[0228] Optionally, the step of training the encrypted global model in the ciphertext domain based on a preset dataset, the learning rate corresponding to the global model, and the number of iterative training rounds corresponding to the global model, respectively, to obtain N trained encrypted global models corresponding one-to-one with the N training nodes, includes:

[0229] For the target training node, a random seed is generated and a mask vector is generated based on a homomorphic pseudo-random generator. The target training node is any one of the N training nodes. The random seed is used to perform random blurring on the encrypted global model, and the mask vector is used to determine the region of the encrypted global model that needs to be randomly blurred.

[0230] Based on the random seed and the mask vector, the encrypted global model is masked and blurred to obtain the processed encrypted global model.

[0231] In the encrypted domain, based on a preset dataset, the learning rate corresponding to the global model, and the iterative training rounds corresponding to the global model, the processed encrypted global model in the target training node is trained to obtain N trained encrypted global models that correspond one-to-one with the N training nodes.

[0232] Optionally, the integration of the N trained cryptographic global models to obtain the target global model includes:

[0233] Based on K committee nodes, the N trained encryption global models are scored respectively to obtain K score values ​​corresponding one-to-one with the K committee nodes. The K committee nodes are K customer nodes out of M customer nodes, where K is a positive integer less than M.

[0234] If the number of scores greater than or equal to a preset threshold among the K scores exceeds K / 2, the N trained encrypted global models are integrated to obtain an initial global model.

[0235] The initial global model is decrypted to obtain the target global model.

[0236] Optionally, the training information also includes the target reward funds corresponding to the global model. After scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes, the method further includes:

[0237] For the i-th training iteration, the first reward fund corresponding to the i-th training iteration is determined according to the target reward fund;

[0238] N reward weight values ​​are determined based on the K score values, and the N reward weight values ​​correspond one-to-one with the N training nodes;

[0239] The first reward funds are calculated based on the N reward weight values ​​to obtain N second reward funds. The N second reward resources correspond one-to-one with the N training nodes. The N second reward funds are the reward funds obtained by the corresponding training node in the i-th iteration of training.

[0240] The target reward funds corresponding to the global model are allocated to the N training nodes.

[0241] Optionally, the step of scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes includes:

[0242] Obtain the scoring items, which include: the participation of training nodes, the legality of training nodes, and the training throughput of training nodes;

[0243] Determine the weight information corresponding to the scoring item. The weight information includes a first weight value corresponding to the participation of the training node, a second weight value corresponding to the legality of the training node, and a third weight value corresponding to the training throughput of the training node.

[0244] For the target committee node, the N trained encrypted global models are scored based on the scoring items to obtain an initial score value, where the target committee node is any one of the K committee nodes;

[0245] Based on the target committee node, the initial score value is weighted according to the weight information to obtain K score values ​​that correspond one-to-one with the K committee nodes.

[0246] Optionally, after integrating the N trained encrypted global models to obtain the target global model when the number of score values ​​greater than or equal to a preset threshold among the K score values ​​exceeds K / 2, the method further includes:

[0247] Send the target global model to the user terminal and store the target global model on the blockchain;

[0248] If the number of rating values ​​greater than or equal to a preset threshold among the K rating values ​​does not exceed K / 2, then the K rating values ​​will be invalidated.

[0249] Based on the K committee nodes, the N trained cryptographic global models are re-evaluated.

[0250] The technical solution of this application, after receiving a training request sent by the user, trains the encrypted global model using N training nodes according to the training information included in the training request, thereby obtaining N trained encrypted global models. Then, the N trained encrypted global models are integrated to obtain the target global model. This achieves federated learning of the encrypted global model without the training nodes directly obtaining the data of the global model, thereby improving the confidentiality of the model during the training process.

[0251] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described model training embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0252] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described model training method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0253] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0254] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a communication device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0255] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A model training method, characterized in that, The method includes: The system receives a training request sent by a user client. The training request is used to request training of a global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model. Using the training information, the encrypted global model in N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N training nodes are N client nodes out of M client nodes. The M client nodes are client nodes that have completed registration in the blockchain. M is an integer greater than 1 and N is a positive integer less than M. The N trained encrypted global models are integrated to obtain the target global model.

2. The method according to claim 1, characterized in that, The training information includes the learning rate corresponding to the global model and the number of iterations for training the global model. The step of using the training information to train the encrypted global model on N training nodes respectively, obtaining N trained encrypted global models corresponding one-to-one with the N training nodes, includes: K committee nodes are randomly selected from the M client nodes. Based on the K committee nodes, the other client nodes in the M client nodes are determined as N training nodes, where the sum of K and N is M. In the encrypted domain, based on N training datasets, the learning rate corresponding to the global model, and the number of iterations for the global model, the encrypted global model in the N training nodes is trained respectively to obtain N trained encrypted global models that correspond one-to-one with the N training nodes. The N preset datasets and the N training nodes are N different training datasets.

3. The method according to claim 2, characterized in that, The step of training the encrypted global model in the ciphertext domain based on a preset dataset, the learning rate corresponding to the global model, and the number of iterative training rounds corresponding to the global model, respectively, on N training nodes, to obtain N trained encrypted global models corresponding one-to-one with the N training nodes, including: For the target training node, a random seed is generated and a mask vector is generated based on a homomorphic pseudo-random generator. The target training node is any one of the N training nodes. The random seed is used to perform random blurring on the encrypted global model, and the mask vector is used to determine the region of the encrypted global model that needs to be randomly blurred. Based on the random seed and the mask vector, the encrypted global model is masked and blurred to obtain the processed encrypted global model. In the encrypted domain, based on a preset dataset, the learning rate corresponding to the global model, and the iterative training rounds corresponding to the global model, the processed encrypted global model in the target training node is trained to obtain N trained encrypted global models that correspond one-to-one with the N training nodes.

4. The method according to claim 1, characterized in that, The process of integrating the N trained encryption global models to obtain the target global model includes: Based on K committee nodes, the N trained encryption global models are scored respectively to obtain K score values ​​corresponding one-to-one with the K committee nodes. The K committee nodes are K customer nodes out of M customer nodes, where K is a positive integer less than M. If the number of scores greater than or equal to a preset threshold among the K scores exceeds K / 2, the N trained encrypted global models are integrated to obtain an initial global model. The initial global model is decrypted to obtain the target global model.

5. The method according to claim 4, characterized in that, The training information also includes the target reward funds corresponding to the global model. After scoring the N trained encrypted global models based on K committee nodes to obtain K score values ​​corresponding one-to-one with the K committee nodes, the method further includes: For the i-th training iteration, the first reward fund corresponding to the i-th training iteration is determined according to the target reward fund; N reward weight values ​​are determined based on the K score values, and the N reward weight values ​​correspond one-to-one with the N training nodes; The first reward funds are calculated based on the N reward weight values ​​to obtain N second reward funds. The N second reward resources correspond one-to-one with the N training nodes. The N second reward funds are the reward funds obtained by the corresponding training node in the i-th iteration of training. The target reward funds corresponding to the global model are allocated to the N training nodes.

6. The method according to claim 4, characterized in that, The process involves scoring the N trained encryption global models based on K committee nodes, resulting in K score values ​​corresponding one-to-one with the K committee nodes, including: Obtain the scoring items, which include: the participation of training nodes, the legality of training nodes, and the training throughput of training nodes; Determine the weight information corresponding to the scoring item. The weight information includes a first weight value corresponding to the participation of the training node, a second weight value corresponding to the legality of the training node, and a third weight value corresponding to the training throughput of the training node. For the target committee node, the N trained encrypted global models are scored based on the scoring items to obtain an initial score value, where the target committee node is any one of the K committee nodes; Based on the target committee node, the initial score value is weighted according to the weight information to obtain K score values ​​that correspond one-to-one with the K committee nodes.

7. The method according to claim 4, characterized in that, When the number of scores greater than or equal to a preset threshold among the K score values ​​exceeds K / 2, after integrating the N trained encrypted global models to obtain the target global model, the method further includes: Send the target global model to the user terminal and store the target global model on the blockchain; If the number of rating values ​​greater than or equal to a preset threshold among the K rating values ​​does not exceed K / 2, then the K rating values ​​will be invalidated. Based on the K committee nodes, the N trained cryptographic global models are re-evaluated.

8. A model training device, characterized in that, The device includes: A receiving module is used to receive a training request sent by a user terminal. The training request is used to request training of a global model in the blockchain. The training request includes an encrypted global model and training information. The encrypted global model is a model obtained by encrypting the global model according to a preset encryption algorithm. The training information is used to represent the training target of the global model. The training module is used to train the encrypted global model in N training nodes using the training information, so as to obtain N trained encrypted global models corresponding one-to-one with the N training nodes. The N training nodes are N client nodes out of M client nodes. The M client nodes are client nodes that have been registered in the blockchain. M is an integer greater than 1 and N is a positive integer less than M. The integration module is used to integrate the N trained encrypted global models to obtain the target global model.

9. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, Includes computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.