Model processing method and device, equipment, medium and product
By using blockchain technology and digital signatures in federated learning, the legitimacy and integrity of the model are ensured, the problem of malicious tampering or forgery is solved, and the stability and learning efficiency of the system are improved.
Patent Information
- Application Number
- CN202511019467.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-11-11
AI Technical Summary
In federated learning, how to effectively verify the legality and security of the model, prevent malicious nodes from tampering with or forging the model, and improve the stability and learning efficiency of the system?
The data owner uploads the encrypted model and identity signature to the blockchain, broadcasts the model update transaction in the blockchain, and the aggregation node receives, verifies and aggregates it. The task publisher finally verifies and stores the model, using digital signature and blockchain technology to ensure the legality and integrity of the model.
This effectively avoids the possibility of the model being maliciously tampered with or forged, improves the stability, security and learning efficiency of the system, and ensures the legality and integrity of the model.
Smart Images

Figure CN120934764A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of blockchain technology, and in particular to a model processing method, apparatus, device, medium and product. Background Technology
[0002] With the rapid development of artificial intelligence and big data technologies, federated learning, as a distributed machine learning framework, has been widely applied in various fields, especially in scenarios with high data privacy protection requirements, where it has become an important solution. Federated learning enables multiple data owners (i.e., participants) to collaboratively train machine learning models without directly sharing data. However, in the process of federated learning, how to protect sensitive data from leakage and ensure the credibility and security of the aggregation results are key issues for achieving efficient operation of federated learning systems.
[0003] Traditional federated learning aggregation methods typically rely on multiple iterations until the model's usage requirements are met or complex consensus verification is used to achieve convergence. However, this approach significantly increases the computational cost and overhead of the federated learning system, leading to task completion delays or even preventing model convergence. To address this issue, effectively verifying the legitimacy and validity of uploaded models has become an important research direction for improving the efficiency and security of federated learning. Furthermore, since aggregation nodes integrate local models to obtain the global model, malicious nodes uploading tampered or falsified model information will severely impact the model aggregation results. Summary of the Invention
[0004] This invention provides a model processing method, apparatus, device, medium, and product to prevent the possibility of malicious tampering or forgery of models, thereby improving the stability, security, and learning efficiency of the system.
[0005] According to one aspect of the present invention, a model processing method is provided, comprising:
[0006] The data owner uploads the cryptographic model and identity signature to the blockchain and broadcasts the model update transaction in the blockchain;
[0007] After receiving the model update transaction, the aggregation node verifies the encrypted model and the identity signature. If the verification is successful, it aggregates the encrypted model to obtain an aggregated model, and uploads the aggregated model and digital signature to the blockchain, broadcasting the model aggregation transaction in the blockchain. The digital signature is obtained by the aggregation node signing the aggregated model.
[0008] After receiving the model aggregation transaction, the task publisher verifies the aggregation model and the digital signature. Once the verification is successful, the aggregation model is uploaded to the cloud service provider for storage.
[0009] According to another aspect of the present invention, a model processing apparatus is provided, the apparatus comprising:
[0010] The upload and broadcast module is used to control the data owner to upload the encrypted model and identity signature to the blockchain, and broadcast the model update transaction in the blockchain;
[0011] The verification and aggregation module is used to control the aggregation node to verify the encrypted model and the identity signature after receiving the model update transaction. If the verification is successful, the encrypted model is aggregated to obtain an aggregated model, and the aggregated model and digital signature are uploaded to the blockchain. The model aggregation transaction is then broadcast in the blockchain. The digital signature is obtained by the aggregation node signing the aggregated model.
[0012] The verification and upload module is used to control the task publisher to verify the aggregated model and the digital signature after receiving the model aggregated transaction, and upload the aggregated model to the cloud service provider for storage after the verification is successful.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the model processing method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the model processing method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, embodiments of the present invention also provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the model processing method described in any embodiment of the present invention.
[0019] This invention involves the data owner uploading an encrypted model and identity signature to the blockchain and broadcasting the model update transaction. Upon receiving the transaction, the aggregation node verifies the encrypted model and identity signature. If verification is successful, the node aggregates the encrypted models to obtain an aggregated model and uploads it along with a digital signature to the blockchain, broadcasting the model aggregation transaction. The digital signature is obtained by the aggregation node signing the aggregated model. Subsequently, the task publisher receives the model aggregation transaction, verifies the aggregated model and digital signature, and uploads the aggregated model to a cloud service provider for storage. This invention avoids the possibility of malicious tampering or forgery of the model, improving system stability, security, and learning efficiency.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a model processing method in an embodiment of the present invention;
[0023] Figure 2 This is a diagram of a federated learning system architecture in an embodiment of the present invention;
[0024] Figure 3 This is a schematic diagram of the structure of a model processing device according to an embodiment of the present invention;
[0025] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the model processing method of this invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and their derivatives, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises 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 such processes, methods, products, or apparatus.
[0028] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0029] Example 1
[0030] Figure 1 This is a flowchart of a model processing method in an embodiment of the present invention. This embodiment is applicable to the processing of federated learning models based on blockchain technology. The method can be executed by the model processing device in this embodiment, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0031] S101. The data owner uploads the encrypted model and identity signature to the blockchain and broadcasts the model update transaction in the blockchain.
[0032] In this embodiment, the Data Owner (DO) is a participant in federated learning. In a smart security IoT environment, the data owner can be, for example, a device on the video surveillance IoT side (such as surveillance cameras and sensors). In specific implementations, there can be multiple data owners, which can be represented by the plural form DOs.
[0033] It should be noted that the encryption model can be obtained by the data owner training a model based on local data and then encrypting it. The identity signature can be obtained by the data owner signing their own identity UID (Unique Identifier, a string of characters or numbers used to uniquely identify a user, device, object, or entity).
[0034] As we know, blockchain is a distributed database technology that provides a secure and reliable solution for data storage and transactions through its decentralized, immutable, and transparent characteristics.
[0035] In this embodiment, the model update transaction can be broadcast in the blockchain by the data owner to notify the transaction information of updating the local model.
[0036] Specifically, the data owner trains a local model based on local data to obtain a local model, then encrypts the local model to obtain an encrypted model. In addition, they need to sign their own identity to obtain an identity signature. Then, the encrypted model and identity signature are uploaded to the blockchain and stored in the decentralized storage structure IPFS (InterPlanetary File System). After the upload is completed, the model update transaction can be broadcast in the blockchain.
[0037] S102. After receiving the model update transaction, the aggregation node verifies the encrypted model and identity signature. If the verification is successful, it aggregates the encrypted model to obtain the aggregated model, and uploads the aggregated model and digital signature to the blockchain, broadcasting the model aggregation transaction in the blockchain.
[0038] In this embodiment, aggregation nodes (ANs) are responsible for supervising the federated learning task. First, aggregation nodes (ANs) formulate fine-grained participation policies, selecting and rewarding participants, i.e., data owners (DOs). Then, aggregation nodes (ANs) aggregate and update the parameters of the federated learning model for iterative training. In the specific implementation, multiple aggregation nodes can exist, which can be represented by the complex form ANs. Aggregation nodes (ANs) perform relay and aggregation tasks between task publishers and data owners (DOs). They first collect the local model ciphertext of all data owners (DOs) within the region, verify the identity signatures of the data owners (DOs), and then perform batch signature verification. After successful verification, aggregation nodes (ANs) aggregate these ciphertexts. The aggregated ciphertext generates a digital signature and is stored in the blockchain's IPFS.
[0039] It should be noted that the aggregation model can be a model obtained by the aggregation node aggregating and calculating the encrypted models uploaded by each data owner.
[0040] The digital signature is obtained by the aggregation node signing the aggregation model.
[0041] In this embodiment, the model aggregation transaction can be broadcast in the blockchain by the aggregation node to notify the model that the transaction information has been aggregated.
[0042] Specifically, after receiving a model update transaction in the blockchain, the aggregation node verifies the encrypted model and identity signature uploaded by the data owner. If the verification is successful, the encrypted model is aggregated to obtain an aggregated model, and the aggregated model is signed to obtain a digital signature. Then, the aggregated model and digital signature are uploaded to the blockchain, and the model aggregation transaction is broadcast in the blockchain.
[0043] S103. After receiving the model aggregation transaction, the task publisher verifies the aggregation model and digital signature. Once the verification is successful, the aggregation model is uploaded to the cloud service provider for storage.
[0044] In this embodiment, the Task Publisher (TP) initiates the model training task, distributing the model to be trained to the data owners (DOs) in the initial stage. Subsequently, the TP retrieves the aggregated model completed by the aggregation nodes (ANs) from the blockchain, verifies the signature, decrypts the aggregated model, and evaluates its convergence to determine whether further iteration is needed. Throughout the entire model training process, the TP cannot directly access the plaintext local model of any individual data owner (DO).
[0045] In this embodiment, the cloud service provider (CSP) can be a semi-trusted organization that provides computing and storage services, primarily used to store the final model of federated learning, i.e., the aggregated model that has reached the convergence condition.
[0046] Specifically, after receiving the model aggregation transaction in the blockchain, the task issuer verifies the aggregated model and digital signature. If the verification is successful, the aggregated model is decrypted to obtain the plaintext model. If it is detected that the model obtained in this cycle has converged, the aggregated model is uploaded to the cloud service provider for storage.
[0047] This invention involves the data owner uploading an encrypted model and identity signature to the blockchain and broadcasting the model update transaction. Upon receiving the transaction, the aggregation node verifies the encrypted model and identity signature. If verification is successful, the node aggregates the encrypted models to obtain an aggregated model and uploads it along with a digital signature to the blockchain, broadcasting the model aggregation transaction. The digital signature is obtained by the aggregation node signing the aggregated model. Subsequently, the task publisher receives the model aggregation transaction, verifies the aggregated model and digital signature, and uploads the aggregated model to a cloud service provider for storage. This invention avoids the possibility of malicious tampering or forgery of the model, improving system stability, security, and learning efficiency.
[0048] Optionally, before the data owner uploads the cryptographic model and identity signature to the blockchain, the following steps are also included:
[0049] The data owner trains a local model based on local data, and then encrypts the local model using a homomorphic encryption key to obtain an encrypted model.
[0050] In a specific implementation process, for example, in a smart security IoT environment, devices on the video surveillance IoT side (such as surveillance cameras and sensors) can act as data owners. These devices have accumulated a large amount of sensitive data locally, which can be used as local data to train the federated learning model to be trained issued by the task issuer, thereby obtaining a local model.
[0051] The homomorphic encryption key can be generated by a key generation center, enabling the data owner to use it for homomorphic encryption of the local model.
[0052] Specifically, after the data owner obtains the local data, they train a model based on the local data to obtain a local model, and then homomorphically encrypt the local model using a homomorphic encryption key to obtain an encrypted model.
[0053] An identity signature is obtained by signing the identity information using the data owner's private key.
[0054] The data owner's private key can be generated by a key generation center, which allows the data owner to use it to sign their own identity UID.
[0055] Specifically, the data owner signs the identity information using their private key to obtain an identity signature.
[0056] Optionally, after successful verification, the aggregated model will be uploaded to the cloud service provider for storage, including:
[0057] After successful verification, the aggregated model is decrypted to obtain the plaintext model, and the convergence of the plaintext model is then checked.
[0058] The plaintext model can be the model obtained by the task publisher after decrypting the aggregate model.
[0059] In this embodiment, convergence detection can be understood as a process of detecting whether the aggregation model has reached the convergence condition. The convergence condition can be set by the user according to their actual needs.
[0060] Specifically, the task publisher verifies the aggregation model and digital signature. After verification, the aggregation model is decrypted to obtain the plaintext model. The plaintext model is then subjected to convergence testing. Once the convergence test is passed, the aggregation model is uploaded to the cloud service provider for storage.
[0061] If the plaintext model is detected to have reached the convergence condition, the aggregated model will be uploaded to the cloud service provider for storage.
[0062] For example, the convergence condition could be: the task publisher TP uses the global model obtained in each round to test on the test set, and if the change in accuracy ε over K consecutive rounds satisfies |ε i -ε i-1 If the result is less than 0.1%, it indicates convergence. Additionally, for practical deployment needs, a maximum number of iterations can be set (e.g., 1000 iterations), and training will stop when the maximum number of iterations is reached.
[0063] Specifically, if the task publisher detects that the plaintext model has reached the convergence condition, that is, the model obtained in this loop has converged, the aggregated model will be uploaded to the cloud service provider for storage.
[0064] Optionally, after performing convergence testing on the plaintext model, the following may also be included:
[0065] If the plaintext model is detected as not having reached convergence, the plaintext model is sent to the data owner as a new local model, so that the data owner can repeatedly execute the operation of training the local model based on the local data until the obtained plaintext model reaches convergence.
[0066] Specifically, if the plaintext model fails to meet the convergence condition, meaning the model obtained in this iteration has not yet converged, the task issuer will continue to distribute the plaintext model as a new local model to the data owner. The data owner will then iteratively train the local model based on the local data, encrypt the local model using a homomorphic encryption key to obtain an encrypted model, upload the encrypted model and identity signature to the blockchain, and broadcast the model update transaction in the blockchain until the obtained plaintext model meets the convergence condition.
[0067] Optionally, the digital signature is obtained by the aggregator node signing the aggregation model based on the aggregator node's private key.
[0068] The private key of the aggregation node can be obtained from the key generation center, which enables the aggregation node to use the key to sign the aggregation model and obtain a digital signature.
[0069] Verification of the encryption model and identity signature includes:
[0070] The aggregation node verifies the encryption model and identity signature based on the data owner's public key.
[0071] The data owner's public key can be generated by the key generation center, enabling the aggregation nodes to use it to sign and verify the cryptographic model and identity signature uploaded by the data owner.
[0072] Specifically, the aggregation node verifies the encryption model and identity signature uploaded by the data owner based on the data owner's public key.
[0073] Verification of aggregation models and digital signatures includes:
[0074] The task publisher verifies the aggregation model and digital signature based on the aggregation node's public key.
[0075] Among them, the public key of the aggregation node can be generated by the key generation center, which enables the task publisher to use the key to sign and verify the aggregation model and digital signature uploaded by the aggregation node.
[0076] Specifically, the task publisher verifies the aggregation model and digital signature uploaded by the aggregation node based on the aggregation node's public key.
[0077] After successful verification, the aggregated model is decrypted to obtain the plaintext model, including:
[0078] After successful verification, the task publisher decrypts the aggregated model using the homomorphic encryption key to obtain the plaintext model.
[0079] Specifically, after successful verification, the task publisher decrypts the aggregated model using the homomorphic encryption key to obtain the plaintext model.
[0080] Optionally, the homomorphic encryption key, the data owner's private key, the data owner's public key, the aggregation node's private key, and the aggregation node's public key are all generated by the key generation center.
[0081] In this embodiment, the Key Generation Center (KGC) is a fully trusted entity responsible for managing the system's public parameters and master key, as well as distributing private and public keys to each entity involved in the processing method of this model.
[0082] The technical solution of this invention proposes a verifiable federated learning aggregation scheme. By digitally signing the identity of client nodes (i.e., data owners), the legitimacy of user identities is verified, reducing the risk of data leakage. By combining digital signatures with blockchain technology, the uploaded model is digitally signed and uploaded to the blockchain, enabling the legitimate verification of information uploaded by nodes and preventing the possibility of malicious tampering or forgery of the model, thereby improving the system's stability, security, and learning efficiency.
[0083] As an exemplary description of an embodiment of the present invention Figure 2 This is a diagram of a federated learning system architecture according to an embodiment of the present invention. Figure 2As shown, the processing method of this model mainly involves the following entities, including: Key Generation Center (KGC), Task Publisher (TP), Cloud Service Provider (CSP), Aggregator Nodes (ANs), Data Owners (DOs), and Blockchain System (BCS).
[0084] The Key Generation Center (KGC) is a fully trusted entity. KGC is responsible for managing the system's public parameters pp and master key msk, and will distribute private key sk and public key pk to each entity.
[0085] The Task Publisher (TP) initiates the model training task. In the initial stage, it distributes the model to be trained to the data owners (DOs). Simultaneously, the TP retrieves the aggregated model completed by the aggregation nodes (ANs) from the blockchain, verifies the signature, decrypts the aggregated model, and evaluates its convergence to determine whether further iteration is needed. Throughout the entire model training process, the TP cannot directly access the plaintext local model of any individual data owner (DO).
[0086] Data owners (DOs) are participants in federated learning. They use local data to jointly train the model published by the task publisher (TP). Each DO signs its own identity UID, encrypts and signs the trained local model (i.e., the local model), and then caches the identity signature and encrypted model on the blockchain. Simultaneously, DOs broadcast transactions updating the local model on the blockchain. For DOs with limited storage resources, they only need to store blocks relevant to themselves; information about other blocks can be obtained by querying other nodes.
[0087] Cloud service provider (CSP): A semi-trusted organization that provides computing and storage services for storing the final model of federated learning, i.e., the aggregated model that has reached the convergence condition.
[0088] Aggregator Nodes (ANs): Delegated by the task publisher (TP), the aggregation node (ANs) oversees the federated learning task. First, the aggregation node (ANs) formulates fine-grained participation policies, selecting and rewarding participants, i.e., data owners (DOs). Then, the aggregation node (ANs) aggregates and updates the parameters of the federated learning model for iterative training. The aggregation node (ANs) publishes the aggregated model on the IPFS blockchain system. The aggregation node (ANs) performs relay and aggregation tasks between the task publisher (TP) and the data owners (DOs). It first collects the encrypted models of all data owners (DOs) within the region, verifies the identity signatures of the data owners (DOs), and then performs batch signature verification. After successful verification, the aggregation node (ANs) aggregates these ciphertexts, generates a digital signature for the aggregated model, and stores it in the IPFS blockchain.
[0089] BCS (Blockchain System): As a decentralized and distributed storage architecture, BCS possesses core functionalities such as decentralization, security, and transparency. It includes the decentralized storage structure IPFS and a broadcast mechanism. By publishing various transaction types on the blockchain, such as local model updates, model aggregation, and global model training, the blockchain ensures that model training activities are publicly broadcast, transparently synchronized, and tamper-proof. This mechanism provides security guarantees and prevents data tampering for global model training in federated learning.
[0090] The model processing method is described in detail below based on the diagram: Data owner Dos is responsible for training the local model and signing the identity based on local data. Afterwards, it uploads the local model and identity signature to the blockchain system BCS and broadcasts the model update transaction. Aggregator nodes ANs, upon receiving the model update transaction, obtain the local model and identity signature, then verify the signature. If verification is successful, they aggregate the model to obtain the aggregated model, then upload the aggregated model and digital signature to BCS and broadcast the model aggregation transaction. Task publisher TP, upon receiving the model aggregation transaction, obtains the aggregated model and digital signature, then verifies the signature, decrypts the aggregated model, and, after determining model convergence, uploads the final model (i.e., the aggregated model that has met the convergence criteria) to the cloud service provider CSP. Throughout this process, the key generation center KGC is responsible for generating keys and distributing them to data owner Dos and aggregation nodes ANs.
[0091] For example, in a specific scenario, such as a smart security IoT environment, video surveillance IoT devices (such as surveillance cameras and sensors) accumulate a large amount of sensitive data locally. These devices, acting as data owners (DOs), participate in federated learning. The industry regulatory body, acting as the task publisher (TP), trains an industry-specific security decision-making model based on the local data from the data owners (DOs), aiming to provide data-driven decision support for security professionals within the industry. The data owners (DOs) participate in federated learning and encrypt the trained local model (i.e., the local model) to obtain an encrypted model, which is then uploaded to the aggregation nodes (ANs). The aggregation nodes (ANs) aggregate the encrypted model using a homomorphic encryption algorithm to obtain an aggregate model, which is then uploaded to the blockchain. The task publisher (TP) retrieves the aggregate model from IPFS, verifies and decrypts it, and checks the convergence. If the convergence condition is not met, iterative training continues until the model converges. Finally, the verified model, i.e., the aggregate model that has met the convergence condition, is uploaded to the cloud service provider (CSP) for storage, ensuring data privacy and security.
[0092] Furthermore, the model processing method in this embodiment can also be called a verifiable federated learning aggregation method, wherein the dynamic selection process of aggregation nodes is as follows:
[0093] (1) System initialization:
[0094] During the system initialization phase, the Key Generation Center (KGC) generates the master key msk and common parameters pp. The KGC selects two multiplicative cyclic groups G1 and G2 of prime order p, and the target group G. T Generators are selected from the two cyclic groups respectively. and Define a bilinear mapping It satisfies bilinearity, nondegeneracy, and computability.
[0095] Bilinear mapping: Consider two multiplicative cyclic groups G1 and G2, both of order p, where p is a large prime number. Let g∈G1 be a generator. This leads to the definition of the mapping function e:G1×G1→G2, which has the following properties:
[0096] (1) Bilinear: for any element The following equation holds: e(ag,bg)=e(bg,ag)=e(g,g) ab .
[0097] (2) Non-degenerate: Existence This makes e(g,g)≠1.
[0098] (3) Computability: For all It can efficiently calculate e(g) a ,g b The value of ).
[0099] Key Generation Center (KGC) generates master keys. Calculate the master public key The system is publicly available, where the master public key is the system public key, g1 is a generator of G1 in the bilinear mapping group (G1, G2), and α is the master key msk, which is used for exponential operations. The key generation process is as follows:
[0100]
[0101] msk = {α};
[0102] The hash function H maps the value to... In the above, msk is the system master key, and pp is the public parameter.
[0103] (2) Key generation
[0104] The Key Generation Center (KGC) generates key pairs for the aggregation nodes ANs and the data owners DOs. First, the KGC randomly generates a private key (i.e., the aggregation node's private key) for each aggregation node ANk (ANk represents any aggregation node in ANs). Its public key (i.e., the aggregate node's public key) is Then register on the blockchain. Next, calculate the total private key sk of all aggregation nodes ANs. AN =∑x k The total public key of the aggregation node is calculated as follows: The data owner DOi (DOi represents any data owner among data owners DOs) submits its identity identifier, UIDi (UIDi represents the UID of data owner DOi), to the key generation center KGC. The key generation center KGC then generates its private key (i.e., the data owner's private key). Its public key (i.e., the data owner's public key).
[0105] In addition, the Key Generation Center (KGC) generates the model encryption key ck (i.e., the homomorphic encryption key) for the data owner DOs, where ck is the group key. Random large integers in the range.
[0106] (3) Local model training and signature
[0107] Suppose that there are multiple data owners DOi downstream of the aggregation node ANk. Data owners DOi use locally sensitive data to perform federated learning model training and obtain a local model M. k,i .
[0108] [Data Owner DOs Identity Signature]: Calculate the identity signature based on the data owner DOi's identity UIDi. As shown below:
[0109]
[0110] After signing, the data owner DOi uploads it to the IPFS blockchain for storage.
[0111] [Model Encryption]: To achieve lightweight encryption and computation, data owner DOi chose a homomorphic encryption algorithm to encrypt the local model M. k,i Then the local model ciphertext C is obtained. k,i The homomorphic encryption key ck is shared with the task publisher TP via a trusted channel, and the local model ciphertext C k,i As shown in the following formula:
[0112] C k,i =Enc ck (M k,i);
[0113] [Data Owner Signature]: The data owner's DOi is embedded with the current timestamp t, and the message hash is calculated. Using the data owner's private key based on the identity information UID i Generate the corresponding identity signature The signature is calculated further as follows:
[0114] {C k,i ,σ k,i ,t,UID i};
[0115] After completing model training, encryption, and signing, the data owner DOi broadcasts the relevant transaction information (i.e., the model update transaction) within the system. Simultaneously, each data owner DOi will... k,i and σ k,i Upload to the aggregation node ANk.
[0116] (4) Signature verification and model aggregation
[0117] When the aggregator node ANk discovers a model update transaction for data owner DOi in the blockchain, it retrieves the encrypted models and identity signatures of all data owners DOi from IPFS. The aggregator node ANk first verifies the identity signature of data owners DOi to ensure their legitimacy. Then, it verifies the signature using the public key of data owner DOi (i.e., the data owner's public key) to ensure the validity of the ciphertext. To improve computational efficiency, the aggregator node ANk performs batch verification of multiple signatures. Finally, the aggregator node ANk aggregates all encrypted models and signs them using its own private key (i.e., the aggregator node's private key). The specific steps are as follows:
[0118] [Identity Signature Verification]: As shown below, if the output of the following formula is 1, then the verification is successful.
[0119]
[0120]
prove
[0121]
[0122] [Model Signature Verification]: To improve verification efficiency, the aggregation node ANk performs batch verification of signatures. That is, if the following formula is true, all signatures pass verification, proving that the model is valid; otherwise, invalid signatures exist.
[0123]
[0124]
prove
[0125]
[0126] [Model Aggregation]: After successful verification, the aggregation node ANk aggregates and encrypts model C. ag =ΠC k,i Generate a one-time strong signature pair (s, s′), and randomly generate... calculate s1=C ag s2 = H(s1), The aggregate model signature σ is obtained as shown below. ag :
[0127] σ ag =(s0,s1,s2,s3,r);
[0128] and {C ag ,σ ag The data is uploaded to the blockchain and the relevant transaction information is broadcast (i.e., model aggregated transactions).
[0129] (5) Signature verification and global model generation
[0130] After receiving the model aggregation transaction from the aggregation node ANk, the task publisher TP verifies the signature of the aggregation model to ensure the legitimacy of the ciphertext. Then, TP decrypts the aggregation model using the homomorphic encryption key ck, obtaining the plaintext model of this round's aggregation from all data owner nodes DOs. The specific steps are as follows:
[0131] [Signature Verification]: Verify the digital signature. If the following formula is true, the signature verification is successful, proving that the model is valid; otherwise, the signature is invalid.
[0132]
[0133]
prove
[0134]
[0135] [Global Model Decryption]: The task publisher TP chooses to use the homomorphic encryption key ck to decrypt the aggregated model vector C. ag Then the plaintext model M is obtained. ag As shown in the following formula:
[0136] M ag =Dec ck (C ag );
[0137] (6) Iterative training
[0138] Repeat the above steps until the model converges. After model convergence, the task publisher (TP) uploads the aggregated model that has finally met the convergence criteria to the cloud service provider (CSP) storage.
[0139] The technical solutions of the embodiments of the present invention achieve the following beneficial effects:
[0140] (1) Improved global model convergence efficiency: Based on bilinear pairing digital signature technology, the data owner is required to sign the local model ciphertext (i.e., the encrypted model), the aggregation node signs the aggregated model, and the corresponding upstream node verifies the signature through digital signature verification, ensuring the integrity and validity of the model. This reduces the possibility of malicious nodes injecting invalid models, which could slow down the global model convergence speed, and improves the speed at which the global model converges to the required level. Compared with traditional hash verification, the mathematical provability of bilinear mapping provides strong cryptographic protection for model integrity.
[0141] (2) Ensure the legitimacy of client nodes (i.e. data owners): By combining digital signature technology with blockchain, the identity of client nodes is uniquely digitally signed and stored in the blockchain. After receiving the encryption model, the aggregation node performs identity verification to ensure that the providers of the encryption models being aggregated are all legitimate, thereby ensuring that no illegitimate users steal information in the system and improving the privacy of the system.
[0142] (3) Ensure the immutability and traceability of node operations: For all node operations, including data owner DOs identity signing, local model training and signing, model aggregation and signing, etc., all generated data is uploaded to the blockchain and stored by IPFS. Relying on the secure, immutable and traceable characteristics of blockchain, all operations are transparent, open and traceable, ensuring that the effective model will not be maliciously tampered with or forged, and achieving high efficiency in global model convergence.
[0143] Example 2
[0144] Figure 3 This is a schematic diagram of a model processing device according to an embodiment of the present invention. This embodiment is applicable to federated learning model processing based on blockchain technology. The device can be implemented in software and / or hardware, and can be integrated into any device that provides model processing functionality, such as… Figure 3 As shown, the model processing device specifically includes: an upload and broadcast module 201, a verification and aggregation module 202, and a verification and upload module 203.
[0145] Among them, the upload and broadcast module 201 is used to control the data owner to upload the encrypted model and identity signature to the blockchain, and broadcast the model update transaction in the blockchain;
[0146] The verification and aggregation module 202 is used to control the aggregation node to verify the encrypted model and the identity signature after receiving the model update transaction. After successful verification, the encrypted model is aggregated to obtain an aggregated model, and the aggregated model and digital signature are uploaded to the blockchain. The model aggregation transaction is broadcast in the blockchain. The digital signature is obtained by the aggregation node signing the aggregated model.
[0147] The verification and upload module 203 is used to control the task publisher to verify the aggregated model and the digital signature after receiving the model aggregated transaction, and upload the aggregated model to the cloud service provider for storage after the verification is successful.
[0148] Optionally, the device further includes:
[0149] The training and encryption unit is used to control the data owner to train a local model based on local data, and to encrypt the local model based on a homomorphic encryption key to obtain an encrypted model.
[0150] The signature unit is used to sign identity information based on the data owner's private key to obtain an identity signature.
[0151] Optionally, the verification and upload module 203 includes:
[0152] The decryption and detection unit is used to decrypt the aggregated model to obtain the plaintext model after verification, and to perform convergence detection on the plaintext model.
[0153] An upload unit is used to upload the aggregated model to a cloud service provider for storage if the plaintext model is detected to have reached the convergence condition.
[0154] Optionally, the device further includes:
[0155] The distribution unit is used to distribute the plaintext model as a new local model to the data owner if it is detected that the plaintext model has not reached the convergence condition, so that the data owner can repeatedly perform the operation of training the local model based on the local data until the obtained plaintext model reaches the convergence condition.
[0156] Optionally, the digital signature is obtained by the aggregation node signing the aggregation model based on the aggregation node's private key;
[0157] The verification and aggregation module 202 is specifically used for:
[0158] The aggregation node verifies the encryption model and the identity signature based on the data owner's public key;
[0159] The verification and upload module 203 is specifically used to control:
[0160] The task publisher verifies the aggregation model and the digital signature based on the aggregation node's public key.
[0161] The decryption and detection unit is specifically used for:
[0162] After successful verification, the task publisher decrypts the aggregated model using a homomorphic encryption key to obtain the plaintext model.
[0163] Optionally, the homomorphic encryption key, the data owner's private key, the data owner's public key, the aggregation node's private key, and the aggregation node's public key are all generated by the key generation center.
[0164] The above-mentioned products can execute the model processing method provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects of the execution method.
[0165] Example 3
[0166] Figure 4 A schematic diagram of an electronic device 30 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0167] like Figure 4 As shown, the electronic device 30 includes at least one processor 31 and a memory, such as a read-only memory (ROM) 32 or a random access memory (RAM) 33, communicatively connected to the at least one processor 31. The memory stores computer programs executable by the at least one processor. The processor 31 can perform various appropriate actions and processes based on the computer program stored in the ROM 32 or loaded from storage unit 38 into the RAM 33. The RAM 33 can also store various programs and data required for the operation of the electronic device 30. The processor 31, ROM 32, and RAM 33 are interconnected via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.
[0168] Multiple components in electronic device 30 are connected to I / O interface 35, including: input unit 36, such as keyboard, mouse, etc.; output unit 37, such as various types of monitors, speakers, etc.; storage unit 38, such as disk, optical disk, etc.; and communication unit 39, such as network card, modem, wireless transceiver, etc. Communication unit 39 allows electronic device 30 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0169] Processor 31 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 31 performs the various methods and processes described above, such as model processing methods:
[0170] The data owner uploads the cryptographic model and identity signature to the blockchain and broadcasts the model update transaction in the blockchain;
[0171] After receiving the model update transaction, the aggregation node verifies the encrypted model and the identity signature. If the verification is successful, it aggregates the encrypted model to obtain an aggregated model, and uploads the aggregated model and digital signature to the blockchain, broadcasting the model aggregation transaction in the blockchain. The digital signature is obtained by the aggregation node signing the aggregated model.
[0172] After receiving the model aggregation transaction, the task publisher verifies the aggregation model and the digital signature. Once the verification is successful, the aggregation model is uploaded to the cloud service provider for storage.
[0173] In some embodiments, the model processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 30 via ROM 32 and / or communication unit 39. When the computer program is loaded into RAM 33 and executed by processor 31, one or more steps of the model processing method described above may be performed. Alternatively, in other embodiments, processor 31 may be configured to execute the model processing method by any other suitable means (e.g., by means of firmware).
[0174] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0175] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0176] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0177] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0178] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0179] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0180] In one embodiment, the present invention further includes a computer program product, which includes a computer program that, when executed by a processor, implements the model processing method of any embodiment of the present invention.
[0181] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0182] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0183] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A model processing method, characterized in that, include: The data owner uploads the cryptographic model and identity signature to the blockchain and broadcasts the model update transaction in the blockchain; After receiving the model update transaction, the aggregation node verifies the encrypted model and the identity signature. If the verification is successful, it aggregates the encrypted model to obtain an aggregated model, and uploads the aggregated model and digital signature to the blockchain, broadcasting the model aggregation transaction in the blockchain. The digital signature is obtained by the aggregation node signing the aggregated model. After receiving the model aggregation transaction, the task publisher verifies the aggregation model and the digital signature. Once the verification is successful, the aggregation model is uploaded to the cloud service provider for storage.
2. The method according to claim 1, characterized in that, Before the data owner uploads the cryptographic model and identity signature to the blockchain, the following steps are also included: The data owner trains a local model based on local data, and encrypts the local model using a homomorphic encryption key to obtain an encrypted model; An identity signature is obtained by signing the identity information using the data owner's private key.
3. The method according to claim 1, characterized in that, After successful verification, the aggregated model is uploaded to the cloud service provider for storage, including: After successful verification, the aggregated model is decrypted to obtain the plaintext model, and the convergence of the plaintext model is then checked. If the plaintext model is detected to have reached the convergence condition, the aggregated model is uploaded to the cloud service provider for storage.
4. The method according to claim 3, characterized in that, After performing convergence testing on the plaintext model, the following steps are also included: If the plaintext model is detected as not having reached the convergence condition, the plaintext model is sent to the data owner as a new local model, so that the data owner can repeatedly perform the operation of training a local model based on local data until the obtained plaintext model reaches the convergence condition.
5. The method according to claim 3, characterized in that, The digital signature is obtained by the aggregation node signing the aggregation model based on the aggregation node's private key; Verification of the encryption model and the identity signature includes: The aggregation node verifies the encryption model and the identity signature based on the data owner's public key; Verification of the aggregation model and the digital signature includes: The task publisher verifies the aggregation model and the digital signature based on the aggregation node's public key; After successful verification, the aggregated model is decrypted to obtain the plaintext model, including: After successful verification, the task publisher decrypts the aggregated model using a homomorphic encryption key to obtain the plaintext model.
6. The method according to claim 1, characterized in that, The homomorphic encryption key, the data owner's private key, the data owner's public key, the aggregation node's private key, and the aggregation node's public key are all generated by the key generation center.
7. A model processing device, characterized in that, include: The upload and broadcast module is used to control the data owner to upload the encrypted model and identity signature to the blockchain, and broadcast the model update transaction in the blockchain; The verification and aggregation module is used to control the aggregation node to verify the encrypted model and the identity signature after receiving the model update transaction. If the verification is successful, the encrypted model is aggregated to obtain an aggregated model, and the aggregated model and digital signature are uploaded to the blockchain. The model aggregation transaction is then broadcast in the blockchain. The digital signature is obtained by the aggregation node signing the aggregated model. The verification and upload module is used to control the task publisher to verify the aggregated model and the digital signature after receiving the model aggregated transaction, and upload the aggregated model to the cloud service provider for storage after the verification is successful.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the model processing method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the model processing method according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the model processing method according to any one of claims 1-6.