Credible online and offline federated learning method and system based on Shamir secret sharing

By adopting Shamir secret sharing and threshold secret sharing technology in federated learning, the balance of security and efficiency in federated learning is solved, and the trusted verification of participating nodes and efficient privacy protection of model parameters is achieved to prevent malicious attacks.

CN119602945APending Publication Date: 2025-03-11UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411593088.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When ensuring the security of model parameters, existing federated learning programs are difficult to balance security and efficiency, and lack research on credible mechanisms in online/offline modes, and are vulnerable to malicious attacks.

Method used

The method based on Shamir secret sharing is adopted to construct verification factors through threshold secret sharing technology. When the number of verification factors is greater than the threshold value, the secret value is reliably restored to ensure the safety and efficiency of model parameters.

Benefits of technology

It realizes verifiable counting of effectively participating nodes, provides efficient privacy protection, prevents malicious attacks, and improves data privacy and model security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119602945A_ABST
    Figure CN119602945A_ABST
Patent Text Reader

Abstract

The invention provides a trusted online and offline federated learning method and system based on Shamir secret sharing, and relates to the technical field of distributed computing and cryptography. The method comprises the following steps: a secret key generation center distributes a secret key for a newly registered user; the model requester determines a threshold value according to a task demand, selects a secret value, performs secret segmentation according to the total number of pre-distributed data providers, and transmits a secret share to the server; the data provider trains a local model by using local data, encrypts the local model by using a public key of a model requester, and sends a ciphertext parameter to the server; the server performs secret recovery on the secret share; if the number of the obtained secret shares exceeds the threshold value requirement, the secret is recovered successfully, and model parameters are aggregated and sent to a model requester; otherwise, the server continues to wait until the number of the obtained secret shares reaches the threshold value requirement. The method has remarkable advantages in the aspects of data privacy, model security and calculation complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed computing and cryptography, and in particular to a trusted online and offline federated learning method and system based on Shamir secret sharing. Background Art

[0002] Federated learning, as a new machine learning framework, aims to solve the privacy protection problem of machine learning with multiple users and multiple data sources. It is widely used in smart homes, smart car networks, mobile networks and other fields. However, the process of transmitting parameters in federated learning will still leak some model parameter information, further leading to problems such as gradient reversal attacks and inference attacks. Currently, a large number of federated learning-related works have used cryptographic technologies such as differential privacy, multi-party secure computing, and homomorphic encryption to ensure the security of transmitted model parameters.

[0003] Differential privacy makes model parameters unpredictable by adding perturbations with certain rules. However, as the number of rounds increases, perturbations may lead to large model deviations. Although multi-party secure computation can achieve lossless parameter security operations, the communication overhead generated by the interaction imposes a large communication burden on the system and limits the threshold for system deployment. Homomorphic encryption algorithms are divided into two categories: one is a fully homomorphic algorithm, which supports addition and multiplication of encryption operators; the other is a partially homomorphic algorithm, which only supports additive homomorphism or multiplicative homomorphism. Fully homomorphic encryption algorithms have a large overhead, while partially homomorphic encryption algorithms are more feasible, and generally operate in milliseconds. Considering the operational characteristics of federated learning, partially homomorphic encryption algorithms (such as Paillier homomorphic encryption) support both additive homomorphism and efficient multiplication homomorphism, which can meet the privacy computing needs in real federated learning.

[0004] Since the secure federated learning framework based on cryptography does not limit the number of nodes participating in model sharing, if there are fewer participating nodes, the model will have a large deviation. If the number of participating nodes is too large, it is not realistic for all nodes to participate in model training online. In order to achieve the online / offline participation mode of large-scale nodes, the participating node counting is realized through a simple counter, which cannot resist malicious attacks initiated by the collusion between the server and some nodes. For example, the server may create the illusion of rapid response to model services for the purpose of illegal profit. Since the secure federated learning framework based on cryptographic encryption algorithm guarantees the security of transmission parameters, it makes it difficult to guarantee the authenticity of the data transmitted by the node to the central server. Since the ciphertext data is unreadable, it is impossible to distinguish between deviation data and valid data by visually viewing the transmitted ciphertext data. The authenticity of the source cannot be guaranteed by simply counting the collected data through a counter. For example, the adversary can use a random encryption algorithm to calculate its own model multiple times and upload it multiple times. The data seen on the surface is different, but the local model parameters carried by its ciphertext are consistent, which can achieve multiple submissions of model parameters by a few nodes, resulting in deviations in the final aggregated global model.

[0005] In order to solve the problem of balancing security and efficiency in federated learning, two major challenges need to be addressed. One is how to balance the model computing efficiency of secure federated learning while ensuring the confidentiality of local model parameters transmitted from participating users to the central server; the other is how to provide an online / offline trusted verification mechanism for local model collection on the central server in an environment where system users are semi-honest. In short, the current privacy-preserving federated learning scheme still lacks research on the trusted mechanism of federated learning in online / offline mode. Summary of the invention

[0006] In view of the above problems, the purpose of the present invention is to provide a trusted online and offline federated learning method and system based on Shamir secret sharing, to carry out research on user participation trusted mechanism in online / offline mode, to construct verification factors using threshold secret sharing, and to achieve reliable recovery of secret values ​​when the number of verification factors is greater than the threshold value.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] On the one hand, a trusted online and offline federated learning method based on Shamir secret sharing is provided, the method comprising the following steps:

[0009] S1. System initialization: The key generation center allocates keys to newly registered users;

[0010] S2, Task Allocation: The model requester determines the threshold value according to the task requirements, selects the secret value, determines the polynomial for splitting the secret value, splits the secret according to the total number of pre-allocated data providers, and transmits the secret share to the server;

[0011] S3, local model training: The data provider uses local data to train the local model, encrypts it with the public key of the model requester, and sends the ciphertext parameters to the server;

[0012] S4, model aggregation: The server performs secret recovery on the secret shares attached to the collected model parameters; if the number of secret shares obtained exceeds the threshold requirement, the secret is recovered successfully, the model parameters are aggregated, and the aggregated model parameters are sent to the model requester; otherwise, the server continues to wait until the number of secret shares obtained reaches the threshold requirement.

[0013] Optionally, the step S1 specifically includes:

[0014] In the system initialization phase, the system applies to the key generation center to run the key generation function, initializes the global public parameters of the system operation, and distributes keys to new registered users in the system;

[0015] Among them, key generation includes: by inputting security parameters, the key generation center runs to generate system public parameters pp and user key pairs (pk i , sk i ), where pk i is the public key, sk i For the private key.

[0016] Optionally, the step S2 specifically includes:

[0017] In the task allocation phase, the model requester sends a model training request to the server. The model requester determines the total share of the split and the threshold share of the task by running the task split function, and sends the verification factor and split share to the server.

[0018] Among them, task division The model requester runs by inputting the task identifier Tid, the total share n of the split, and the threshold share d. , to determine the secret value S corresponding to the task i And generate the corresponding verification factor ; Model requester continues to run , n secret shares generated according to the total share and the threshold share serve as valid identifiers for task splitting, and are subsequently sent to each participating user as a trusted verification label for the validity of their uploaded model parameters;

[0019] Each secret share is represented by the coordinates of a point on the polynomial , 1 ≤ j ≤ n satisfies the following conditions:

[0020]

[0021] Among them, a1, a2, ..., a d-1 is the polynomial parameter;

[0022] The model requester sends the secret share, verification factor, and public key to the server, which distributes them to the user who undertakes the task, namely the data provider.

[0023] Optionally, the step S3 specifically includes:

[0024] In the local model training phase, the data provider takes local data as input, represents the original data with Set, and generates initialization local model parameters. ;

[0025] Model Training Includes: Input initialization local model parameters , user j's local training set Set j , the public key pk of the model requester MR , the share ss allocated to user j ij and public parameters pp;

[0026] The model training process uses support vector machine SVM, and the local training set is Set j , the training process selects the kernel function to create the SVM model:

[0027]

[0028] Use local training data and tags Train the SVM model and update the weights of the SVM model and bias Parameters: In multiple rounds of training, the parameters of SVM are updated in each round;

[0029] Data provider runs Generate ciphertext, expressed as ;

[0030] in, ; ;

[0031] r1, r2 are random numbers, and n is the modulus in Paillier encryption;

[0032] The data provider digitally signs the verification share and the ciphertext: , where sk DO The private key of the data provider;

[0033] The data provider will ciphertext , verify the share tag ss ij and signature σ is sent to the server.

[0034] Optionally, the step S4 specifically includes:

[0035] In the model aggregation phase, the server first splits the information collected from each user; if the signature verification fails, the local model is abandoned; otherwise, the server continues to verify whether the collected local models meet the task threshold requirement, that is, the number of collected local models t ≥ d, the server runs ;

[0036] With t trusted verification labels (x ij ,y ij ) is calculated as shown in formula (1):

[0037] (1)

[0038] Take the case of x = 0, obtain the constant term of the polynomial f(x), and determine whether the recovered task secret value is equal to the secret value contained in the verification factor;

[0039] (2)

[0040] If formula (2) is not true, the server continues to wait for the user to submit the local model; otherwise, the server uses Perform model aggregation and update the global model ;in, is the local model involved in the aggregation;

[0041] The calculation of the global weight value is expressed as: ,

[0042] The calculation of the global bias value is expressed as: ;

[0043] The server sends the aggregated global model to the model requester, who runs Decrypt and obtain the global model parameters, where sk MR is the private key of the model requester.

[0044] On the other hand, a trusted online and offline federated learning system based on Shamir secret sharing is provided, which is used to implement any of the above methods, and the system includes: a key generation center, a server, a model requester, and a data provider;

[0045] The key generation center allocates secret keys to newly registered users;

[0046] The model requester determines a threshold value according to task requirements, selects a secret value, determines a polynomial for dividing the secret value, divides the secret value according to the total number of pre-allocated data providers, and transmits the secret share to the server;

[0047] The data provider trains the local model using local data, encrypts the model with the public key of the model requester, and sends the ciphertext parameters to the server;

[0048] The server performs secret recovery on the secret shares attached to the collected model parameters; if the number of secret shares obtained exceeds the threshold requirement, the secret is recovered successfully, the model parameters are aggregated, and the aggregated model parameters are sent to the model requester; otherwise, the server continues to wait until the number of secret shares obtained reaches the threshold requirement.

[0049] In another aspect, an electronic device is provided, the electronic device comprising:

[0050] processor;

[0051] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are loaded and executed by the processor, the steps of the above-mentioned trusted online and offline federated learning method based on Shamir secret sharing are implemented.

[0052] On the other hand, a computer-readable storage medium is provided, in which a program code is stored. The program code can be called by a processor to execute the steps of the above-mentioned trusted online and offline federated learning method based on Shamir secret sharing.

[0053] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0054] The present invention uses threshold secret sharing technology to propose a credible online / offline federated learning scheme, which can realize verifiable counting of valid participating nodes, provide efficient privacy protection for local model parameters, and prevent local model providers and servers from launching collusion attacks on counting. Compared with the existing technology, the present invention has significant advantages in data privacy, model security, computational complexity, and communication overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0056] Figure 1 It is a schematic diagram of a framework of a trusted online and offline federated learning method based on Shamir secret sharing provided in an embodiment of the present invention;

[0057] Figure 2 It is a flow chart of a trusted online and offline federated learning method based on Shamir secret sharing provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.

[0060] The embodiment of the present invention provides a trusted online and offline federated learning method based on Shamir secret sharing. Figure 1 This is a schematic diagram of the framework of this method. First, Figure 1 The relevant concepts are explained as follows:

[0061] Key Generation Center (KGC):

[0062] As a trusted key distribution entity, it is responsible for key distribution to servers and new users, and is responsible for setting and publishing system parameters.

[0063] Server (S):

[0064] As a semi-trusted entity, it is mainly responsible for distributing model training tasks to data providers, confirming the number of data providers participating in the task, and undertaking model aggregation operations. The server needs to arrange secret values ​​for different tasks and perform secret splitting, confirm the number of acquired data providers in a trusted manner, aggregate the local model parameters trained by the data providers, generate the final model, and send it to the model requester.

[0065] Model requester (MR):

[0066] Model requesters are honest users who publish model task requirements and encrypted public keys to the server.

[0067] Data owner (DO):

[0068] Data providers are usually dishonest users. They are at the very end of the federated learning system. They calculate the local model gradient parameters based on the task by calculating the data collected by local storage, and upload them to the central server after encryption.

[0069] In the embodiment of the present invention, the proposed system is based on the security assumption that KGC is trustworthy and MR is honest. The possible threat model of the system is described, and the threats in the system mainly come from the following two adversaries.

[0070] Model privacy: Semi-trusted servers, other data providers in the system, and external attackers conduct eavesdropping attacks on local model parameters provided by data providers. They obtain ciphertext parameters by eavesdropping on public channels, thereby inferring and obtaining plaintext parameter information and data-related information.

[0071] Threshold deception: Dishonest data providers, for the purpose of illegally seeking additional benefits, or external adversaries capture some data providers (the number is less than the threshold value), and submit local model data multiple times, so that the server performs global model aggregation when the collection sources are insufficient to meet the threshold requirements.

[0072] In trusted online / offline federated learning, KGC is responsible for distributing keys to all new users, which are used to encrypt local model parameters transmitted by users to the server; S, as the aggregation server of the global model, is mainly responsible for providing trusted verification to ensure that the local model required for aggregation meets the minimum task threshold requirements; MR determines the secret value for verifying the number of users who undertake the task when issuing the model training task, performs secret splitting and verification, and sends the operator and secret share to S, which distributes it to the users who undertake the task; DO is responsible for using the public key provided by S to encrypt the local model parameters of DO local data training, and sends the secret share to S through ciphertext.

[0073] Specifically, Figure 2 As shown, the trusted online / offline federated learning method based on Shamir secret sharing provided by the embodiment of the present invention includes the following steps:

[0074] S1. System initialization: The key generation center allocates keys to newly registered users;

[0075] S2, Task Allocation: The model requester determines the threshold value according to the task requirements, selects the secret value, determines the polynomial for splitting the secret value, splits the secret according to the total number of pre-allocated data providers, and transmits the secret share to the server;

[0076] S3, local model training: The data provider uses local data to train the local model, encrypts it with the public key of the model requester, and sends the ciphertext parameters to the server;

[0077] S4, model aggregation: The server performs secret recovery on the secret shares attached to the collected model parameters; if the number of secret shares obtained exceeds the threshold requirement, the secret is recovered successfully, the model parameters are aggregated, and the aggregated model parameters are sent to the model requester; otherwise, the server continues to wait until the number of secret shares obtained reaches the threshold requirement.

[0078] Furthermore, the step S1 specifically includes:

[0079] In the system initialization phase, the system applies to the key generation center to run the key generation function, initializes the global public parameters of the system operation, and distributes keys to new registered users in the system;

[0080] Among them, the key generation Including: by inputting security parameters, the key generation center runs, generates system public parameters pp and user key pairs (pk i , sk i ), where pk i is the public key, sk i For the private key.

[0081] Furthermore, the step S2 specifically includes:

[0082] In the task allocation phase, the model requester sends a model training request to the server. The model requester determines the total share of the split and the threshold share of the task by running the task split function, and sends the verification factor and split share to the server.

[0083] Among them, task division The model requester runs by inputting the task identifier Tid, the total share n of the split, and the threshold share d. , to determine the secret value S corresponding to the task iAnd generate the corresponding verification factor ; Model requester continues to run , n secret shares generated according to the total share and the threshold share serve as valid identifiers for task splitting, and are subsequently sent to each participating user as a trusted verification label for the validity of their uploaded model parameters;

[0084] Each secret share is represented by the coordinates of a point on the polynomial , 1 ≤ j ≤ n satisfies the following conditions:

[0085]

[0086] Among them, a1, a2, ..., a d-1 is the polynomial parameter;

[0087] The model requester sends the secret share, verification factor, and public key to the server, which distributes them to the user who undertakes the task, namely the data provider.

[0088] Furthermore, the step S3 specifically includes:

[0089] In the local model training phase, the data provider takes local data as input, represents the original data with Set, and generates initialization local model parameters. ;

[0090] Model Training Includes: Input initialization local model parameters , user j's local training set Set j , the public key pk of the model requester MR , the share ss allocated to user j ij and public parameters pp;

[0091] The model training process uses support vector machine SVM, and the local training set is Set j , the training process selects the kernel function to create the SVM model:

[0092]

[0093] Use local training data and tags Train the SVM model and update the weights of the SVM model and bias Parameters: In multiple rounds of training, the parameters of SVM are updated in each round;

[0094] Data provider runs Generate ciphertext, expressed as ;

[0095] in, ; ;

[0096] r1, r2 are random numbers, and n is the modulus in Paillier encryption;

[0097] The data provider digitally signs the verification share and the ciphertext: , where sk DO The private key of the data provider;

[0098] The data provider will ciphertext , verify the share tag ss ij and signature σ is sent to the server.

[0099] Furthermore, the step S4 specifically includes:

[0100] In the model aggregation phase, the server first splits the information collected from each user; if the signature verification fails, the local model is abandoned; otherwise, the server continues to verify whether the collected local models meet the task threshold requirement, that is, the number of collected local models t ≥ d, the server runs ;

[0101] With t trusted verification labels (x ij ,y ij ) is calculated as shown in formula (1):

[0102] (1)

[0103] Take the case of x = 0, obtain the constant term of the polynomial f(x), and determine whether the recovered task secret value is equal to the secret value contained in the verification factor;

[0104] (2)

[0105] If formula (2) is not true, the server continues to wait for the user to submit the local model; otherwise, the server uses Perform model aggregation and update the global model ;in, is the local model involved in the aggregation;

[0106] The calculation of the global weight value is expressed as: ,

[0107] The calculation of the global bias value is expressed as: ;

[0108] The server sends the aggregated global model to the model requester, who runs Decrypt and obtain the global model parameters, where sk MRis the private key of the model requester.

[0109] In the embodiment of the present invention, in view of the fact that previous studies on federated learning mainly considered the situation where users honestly provided models online, but did not solve the problem of a trusted mechanism to ensure user participation within the federated learning framework, a solution that supports online / offline federated learning is proposed to implement a trusted verification mechanism based on Shamir secret sharing. Specifically, the method uses threshold secret sharing to construct verification factors, and when the number of verification factors is greater than the threshold value, reliable recovery of secret values ​​is achieved. Compared with the prior art, the present invention has significant advantages in data privacy, model security, computational complexity, and communication overhead.

[0110] Accordingly, an embodiment of the present invention further provides a trusted online and offline federated learning system based on Shamir secret sharing, the system comprising: a key generation center, a server, a model requester, and a data provider;

[0111] The key generation center allocates secret keys to newly registered users;

[0112] The model requester determines a threshold value according to task requirements, selects a secret value, determines a polynomial for dividing the secret value, divides the secret value according to the total number of pre-allocated data providers, and transmits the secret share to the server;

[0113] The data provider trains the local model using local data, encrypts the model with the public key of the model requester, and sends the ciphertext parameters to the server;

[0114] The server performs secret recovery on the secret shares attached to the collected model parameters; if the number of secret shares obtained exceeds the threshold requirement, the secret is recovered successfully, the model parameters are aggregated, and the aggregated model parameters are sent to the model requester; otherwise, the server continues to wait until the number of secret shares obtained reaches the threshold requirement.

[0115] The system of this embodiment can be used to execute Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.

[0116] In an exemplary embodiment, the present invention further provides an electronic device, the electronic device comprising:

[0117] processor;

[0118] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are loaded and executed by the processor, the steps of the above-mentioned trusted online and offline federated learning method based on Shamir secret sharing are implemented.

[0119] In an exemplary embodiment, the present invention further provides a computer-readable storage medium, wherein at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the steps of the above-mentioned trusted online and offline federated learning method based on Shamir secret sharing. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0120] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0121] References in the specification to "one embodiment", "an embodiment", "an exemplary embodiment", "some embodiments", etc. indicate that the described embodiments may include a particular feature, structure, or characteristic, but not every embodiment may include the particular feature, structure, or characteristic. In addition, when a particular feature, structure, or characteristic is described in conjunction with an embodiment, it should be within the knowledge of a person skilled in the relevant art to implement such feature, structure, or characteristic in conjunction with other embodiments (whether or not explicitly described).

[0122] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0123] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0124] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0125] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0127] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0128] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0129] The present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention. In order to make the public have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention, but those skilled in the art can fully understand the present invention without the description of these details. In addition, in order to avoid unnecessary confusion about the essence of the present invention, well-known methods, processes, procedures, components and circuits are not described in detail.

[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A trusted online and offline federated learning method based on Shamir secret sharing, characterized in that: The following steps are involved: S1. System initialization: The key generation center allocates keys to newly registered users; S2, Task Allocation: The model requester determines the threshold value according to the task requirements, selects the secret value, determines the polynomial for splitting the secret value, splits the secret according to the total number of pre-allocated data providers, and transmits the secret share to the server; S3, local model training: The data provider uses local data to train the local model, encrypts it with the public key of the model requester, and sends the ciphertext parameters to the server; S4, model aggregation: The server performs secret recovery on the secret shares attached to the collected model parameters; if the number of secret shares obtained exceeds the threshold requirement, the secret is recovered successfully, the model parameters are aggregated, and the aggregated model parameters are sent to the model requester; otherwise, the server continues to wait until the number of secret shares obtained reaches the threshold requirement.

2. The trusted online and offline federated learning method based on Shamir secret sharing according to claim 1 is characterized in that: The step S1 specifically includes: In the system initialization phase, the system applies to the key generation center to run the key generation function, initializes the global public parameters of the system operation, and distributes keys to new registered users in the system; Among them, key generation includes: by inputting security parameters, the key generation center runs to generate system public parameters pp and user key pairs (pk i , sk i ), where pk i is the public key, sk i For the private key.

3. The trusted online and offline federated learning method based on Shamir secret sharing according to claim 1 is characterized in that: The step S2 specifically includes: In the task allocation phase, the model requester sends a model training request to the server. The model requester determines the total share of the split and the threshold share of the task by running the task split function, and sends the verification factor and split share to the server. Among them, task division The model requester runs by inputting the task identifier Tid, the total share n of the split, and the threshold share d. , to determine the secret value S corresponding to the task i And generate the corresponding verification factor ; Model requester continues to run , n secret shares generated according to the total share and the threshold share serve as valid identifiers for task splitting, and are subsequently sent to each participating user as a trusted verification label for the validity of their uploaded model parameters; Each secret share is represented by the coordinates of a point on the polynomial , 1 ≤ j ≤ n satisfies the following conditions: ; Among them, a1, a2, ..., a d-1 is the polynomial parameter; The model requester sends the secret share, verification factor, and public key to the server, which distributes them to the user who undertakes the task, namely the data provider.

4. The trusted online and offline federated learning method based on Shamir secret sharing according to claim 1 is characterized in that: The step S3 specifically includes: In the local model training phase, the data provider takes local data as input, represents the original data with Set, and generates initialization local model parameters. ; Model Training Includes: Input initialization local model parameters , user j's local training set Set j , the public key pk of the model requester MR , the share ss allocated to user j ij and public parameters pp; The model training process uses support vector machine SVM, and the local training set is Set j , the training process selects the kernel function to create the SVM model: ; Use local training data and tags Train the SVM model and update the weights of the SVM model and bias Parameters: In multiple rounds of training, the parameters of SVM are updated in each round; Data provider runs Generate ciphertext, expressed as ; in, ; ; r1, r2 are random numbers, and n is the modulus in Paillier encryption; The data provider digitally signs the verification share and the ciphertext: , where sk DO The private key of the data provider; The data provider will ciphertext , verify the share tag ss ij and signature σ are sent to the server.

5. The trusted online and offline federated learning method based on Shamir secret sharing according to claim 1 is characterized in that: The step S4 specifically includes: In the model aggregation phase, the server first splits the information collected from each user; if the signature verification fails, the local model is abandoned; otherwise, the server continues to verify whether the collected local models meet the task threshold requirement, that is, the number of collected local models t ≥ d, the server runs ; With t trusted verification labels (x ij ,y ij ) is calculated as shown in formula (1): (1) Take the case of x = 0, obtain the constant term of the polynomial f(x), and determine whether the recovered task secret value is equal to the secret value contained in the verification factor; (2) If formula (2) is not true, the server continues to wait for the user to submit the local model; otherwise, the server uses Perform model aggregation and update the global model ;in, is the local model involved in the aggregation; The calculation of the global weight value is expressed as: , The calculation of the global bias value is expressed as: ; The server sends the aggregated global model to the model requester, who runs Decrypt and obtain the global model parameters, where sk MR is the private key of the model requester.

6. A trusted online and offline federated learning system based on Shamir secret sharing, the system being used to implement the method as claimed in any one of claims 1 to 5, characterized in that: The system comprises: a key generation center, a server, a model requester, and a data provider; The key generation center allocates secret keys to newly registered users; The model requester determines a threshold value according to task requirements, selects a secret value, determines a polynomial for dividing the secret value, divides the secret value according to the total number of pre-allocated data providers, and transmits the secret share to the server; The data provider trains the local model using local data, encrypts the model with the public key of the model requester, and sends the ciphertext parameters to the server; The server performs secret recovery on the secret shares attached to the collected model parameters; if the number of secret shares obtained exceeds the threshold requirement, the secret is recovered successfully, the model parameters are aggregated, and the aggregated model parameters are sent to the model requester; otherwise, the server continues to wait until the number of secret shares obtained reaches the threshold requirement.

7. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when loaded and executed by the processor, implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Distributed key recovery method and system and medium

    CN119945678A