Decentralized hierarchical federated learning method and system, edge server

By using decentralized hierarchical federated learning method and secure multi-party computing protocol in federated learning, edge server cluster aggregates the gradient ciphertext of the client, solving the problems of data leakage and model pollution in federated learning, and improving the security of model aggregation.

CN119338029BActive Publication Date: 2025-03-18CETC BIGDATA RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411884166.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-03-18
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Federated learning has the risk of data breaches and model contamination during model parameter transmission, especially when central servers are untrusted.

Method used

The decentralized hierarchical federated learning method is adopted to aggregate the gradient cipher text sent by the client through a server cluster composed of multiple edge servers using a secure multi-party computing protocol, generate the aggregation model cipher text, and send it to the participant client.

Benefits of technology

It effectively improves the security of model aggregation, prevents the leakage and tampering of model parameters during transmission, and protects the data privacy of participants' clients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338029B_ABST
    Figure CN119338029B_ABST
Patent Text Reader

Abstract

The present invention provides a decentralized hierarchical federated learning method and system, and an edge server, the method comprising: a plurality of edge servers respectively receive gradient ciphertexts sent by different participating client terminals; a plurality of edge servers aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregate model ciphertext; the secure multi-party computing protocol refers to a multi-user network in which a plurality of edge servers respectively holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts, each edge server only obtains part of the data in the aggregate model ciphertext, and does not disclose the gradient ciphertext held by itself to other edge servers; the edge server sends the aggregate model ciphertext to the participating client terminals. By using the scheme of the present invention, the security of model aggregation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to a decentralized hierarchical federated learning method and system, and an edge server. Background Art

[0002] In the current information technology era, data has become a valuable resource for driving innovation in artificial intelligence and machine learning models. With the vigorous development of big data, data privacy and security issues have become increasingly prominent. How to make full use of these scattered data resources while protecting user privacy has become an urgent problem to be solved in the field of machine learning. Federated learning is a solution that emerged in this context.

[0003] Federated learning is a new distributed machine learning paradigm that allows multiple participants to jointly train a machine learning model without sharing the original data. This learning method effectively solves the shortcomings of traditional centralized machine learning methods in terms of data privacy and security, while improving the efficiency of data utilization and providing new possibilities for the training and application of machine learning models.

[0004] However, while protecting data privacy, federated learning also faces new challenges. During the process of federated learning, the client needs to upload the locally calculated model parameters to the central server for aggregation. During this process, the model parameters may be intercepted or tampered with, resulting in privacy leakage or model pollution. In addition, the untrustworthiness of the central server is also an important issue that federated learning needs to solve. Once the central server is attacked or abused, it may have a serious impact on the entire learning process. Summary of the invention

[0005] The present invention provides a decentralized hierarchical federated learning method and system, and an edge server to improve the security of model aggregation.

[0006] To this end, the present invention provides the following technical solutions:

[0007] The present invention provides a decentralized hierarchical federated learning method, the method comprising:

[0008] A plurality of edge servers respectively receive gradient ciphertexts sent by different participating clients; the plurality of edge servers form a server cluster and are arranged in sequence;

[0009] The multiple edge servers aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregate model ciphertext; the secure multi-party computing protocol refers to a multi-user network in which multiple edge servers holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts in a mutually distrustful multi-user network, each edge server only obtains part of the data in the aggregate model ciphertext, and does not disclose the gradient ciphertext held by itself to other edge servers;

[0010] The edge server sends the aggregation model ciphertext to the participating client;

[0011] The multiple edge servers aggregate the received gradient ciphertexts based on the secure multi-party computing protocol to obtain the aggregated model ciphertext including:

[0012] The first server among the multiple edge servers selects a random number, and transmits the gradient ciphertext received by itself plus the random number as an accumulated gradient to other servers among the multiple edge servers, so that other servers sequentially add the gradient ciphertext received by themselves to the accumulated gradient, until the last server adds the gradient ciphertext received by itself and returns it to the first server;

[0013] The first server subtracts the random number from the received accumulated gradient, and then divides the gradient by the number of the edge servers to obtain an aggregate model ciphertext;

[0014] The first server publishes the aggregation model ciphertext to the other servers.

[0015] Optionally, the first server is any server of the multiple edge servers.

[0016] Optionally, the method further includes: the participant client performs model training using local data based on any one of the following algorithms to obtain the gradient data: distributed gradient descent algorithm, linear regression algorithm, logistic regression algorithm.

[0017] Optionally, the method also includes: the participant client samples any one of the following encryption algorithms to encrypt the gradient data: Paillier homomorphic encryption algorithm, threshold Paillier homomorphic encryption algorithm, identity-based homomorphic encryption algorithm, lattice homomorphic encryption algorithm.

[0018] Optionally, the method further comprises:

[0019] The edge server determines the contribution of the client of the participant;

[0020] Rewards are issued to corresponding participants according to the contribution.

[0021] Optionally, the edge server determining the contribution of the participant client includes:

[0022] The edge server calculates the participating client Marginal loss :

[0023] ;

[0024] in, and Respectively and The loss on the validation set; represents the global model obtained by aggregating the local models of all participating clients, Indicates that the participating clients are removed by aggregation The global model obtained by the local models of all participating clients except

[0025] ;

[0026] ;

[0027] According to the client side Marginal loss Determine its contribution. The greater the marginal loss, the greater the contribution.

[0028] Optionally, the method further comprises:

[0029] According to the client of each party Marginal loss Screen the clients that will participate in the next round of model training;

[0030] The edge server sends the aggregation model ciphertext to the participant client including:

[0031] The aggregation model ciphertext is sent to the screened clients.

[0032] Optionally, the method further comprises:

[0033] The participating client uses a private key to decrypt the aggregate model ciphertext to obtain an updated model;

[0034] The updated model is trained again based on the local data to obtain a new gradient ciphertext;

[0035] The new gradient ciphertext is uploaded to the edge server.

[0036] The present invention also provides an edge server, wherein the edge server is any server in a server cluster composed of a plurality of edge servers arranged in sequence; the edge server comprises:

[0037] A receiving module, used to receive the gradient ciphertext sent by the participating client;

[0038] An aggregation module is used to aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregate model ciphertext; the secure multi-party computing protocol refers to a multi-user network in which multiple edge servers holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts in a mutually distrustful multi-user network, and each edge server only obtains part of the data in the aggregate model ciphertext and does not disclose the gradient ciphertext it holds to other edge servers;

[0039] When the edge server is used as the first server, the aggregation model ciphertext is obtained in the following manner: a random number is selected, and the gradient ciphertext received by the edge server is added with the random number as the accumulated gradient and transmitted to other servers, so that other servers sequentially add the gradient ciphertext received by the edge server to the accumulated gradient, and receive the accumulated gradient returned by the last server, subtract the random number from the accumulated gradient, and then divide it by the number of edge servers to obtain the aggregation model ciphertext, and publish the aggregation model ciphertext to other servers;

[0040] When the edge server is used as a server other than the first server, the aggregation model ciphertext is obtained in the following manner: receiving the accumulated gradient sent by the previous server, adding the gradient ciphertext received by itself to the accumulated gradient and sending it to the next server or the first server, and receiving the aggregation model ciphertext published by the first server;

[0041] The model sending module is used to send the aggregate model ciphertext to the participating party client.

[0042] Optionally, the edge server further includes: a reward processing module, configured to determine the contribution of the participant client and issue a reward to the participant client according to the contribution.

[0043] The present invention also provides a decentralized hierarchical federated learning system, the system comprising: a central server, and a plurality of edge servers;

[0044] The central server is used to initialize the federated learning system, set system parameters, secure multi-party computing protocol, and encryption algorithm;

[0045] The multiple edge servers are used to respectively receive gradient ciphertexts sent by different participating clients, aggregate the received gradient ciphertexts based on a secure multi-party computing protocol, obtain aggregated model ciphertexts, and send the aggregated model ciphertexts to the participating clients; the gradient ciphertexts are obtained by the participating clients using local data to perform model training and encrypting the obtained gradient data using the encryption algorithm.

[0046] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the decentralized hierarchical federated learning method are executed.

[0047] The decentralized hierarchical federated learning method and system, and edge server provided by the present invention utilize encryption algorithms and secure multi-party computing technology to achieve secure encryption of the gradient data of the participating client and model aggregation between edge servers, thereby solving the problems of data leakage and model contamination in traditional federated learning. In federated learning, the participating client obtains gradient data through local data training, and these gradient data contain sensitive information of the participating client data. In order to protect this information from being leaked, the participating client uses an encryption algorithm to encrypt the gradient data into ciphertext and upload it to the edge server, thereby protecting the privacy of the data.

[0048] Furthermore, the encrypted gradient ciphertext is uploaded to the nearest edge server. Model aggregation is performed between edge servers based on the secure multi-party computing protocol. Secure multi-party computing technology enables multiple edge servers to jointly complete model verification and aggregation without decryption and generate ciphertext of the aggregated model, thereby effectively preventing the model parameters from being intercepted or tampered with during transmission, and improving the security of model aggregation.

[0049] Furthermore, in order to motivate the participation of clients, the model also introduces an incentive mechanism. By evaluating the contribution of each participating client and distributing rewards reasonably, the enthusiasm of the participants is improved, which is beneficial to the efficiency of model training.

[0050] Furthermore, the clients participating in the next round of model training can be screened based on the marginal loss, which can better ensure the quality of model training. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0052] Figure 1It is a flow chart of a decentralized hierarchical federated learning method provided by an embodiment of the present invention;

[0053] Figure 2 is another flow chart of the decentralized hierarchical federated learning method provided by an embodiment of the present invention;

[0054] Figure 3 It is a structural diagram of an edge server provided by an embodiment of the present invention;

[0055] Figure 4 It is a structural diagram of a decentralized hierarchical federated learning system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0057] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0058] In response to the challenges of existing federated learning in protecting data privacy, an embodiment of the present invention provides a decentralized hierarchical federated learning method and system, which uses encryption algorithms and secure multi-party computing technology to achieve secure encryption of gradient data of participating clients and model aggregation between edge servers, thereby solving the problems of data leakage and model contamination in traditional federated learning and protecting the privacy of participating clients' data.

[0059] like Figure 1 FIG. 1 is a flow chart of a decentralized hierarchical federated learning method provided by an embodiment of the present invention, comprising the following steps:

[0060] Step 101: multiple edge servers respectively receive gradient ciphertexts sent by different participating clients.

[0061] It should be noted that the multiple edge servers form a server cluster and are arranged in sequence.

[0062] The gradient ciphertext is the ciphertext data obtained by encrypting the obtained gradient data after the client of the participant uses the local data to train the model. The model training can adopt but is not limited to any of the following algorithms: distributed gradient descent algorithm, linear regression algorithm, and logistic regression algorithm.

[0063] Taking the distributed gradient descent algorithm as an example, the model training process is as follows:

[0064] (1) Participant Client The initial model is obtained through network communication, and the stochastic gradient descent algorithm is used to train the initial model based on the data it has. The loss function value is calculated according to the following formula :

[0065]

[0066] Among them, ω is the weight of the model, is the loss function, which is used to calculate the gap between the output of the initial model and the real data sample. Represents the size of the entire data sample. The participants Pi participating in the training calculate the local gradient descent , train a local model on the local dataset :

[0067] ;

[0068] in, η is the learning rate for distributed gradient descent.

[0069] Gradient data can be encrypted by, for example, using but not limited to any of the following algorithms: distributed gradient descent algorithm, linear regression algorithm, and logistic regression algorithm.

[0070] It should be noted that the algorithm used for model training and the encryption algorithm can be pre-set by the central server, and this embodiment of the present invention does not limit this.

[0071] In addition, the initial model and the participants in federated learning can also be determined by the central server. For example, each participant applies for registration to the central server through the client. The central server determines whether the client that applied for registration is eligible to participate in federated learning based on certain standards (such as the computing resources and network conditions of the participant). The initial model is sent to each edge server, which then sends it to the corresponding client of the participant that has successfully registered.

[0072] The participating client uploads the encrypted gradient ciphertext to the nearest edge server.

[0073] The edge server is a distributed computing architecture in which data processing is performed at the edge of the network, that is, close to the data source. This server is designed to improve response speed and reduce bandwidth usage, and is usually deployed where users access the network, such as the edge of the network of a telecommunications operator, or directly in the user's device. The main functions of the edge server include: reducing latency, reducing bandwidth usage, reducing dependence on central servers, fault tolerance and resilience, real-time data processing and analysis, and saving resources.

[0074] In an embodiment of the present invention, a distributed computing architecture composed of multiple edge servers is utilized, so that the participating client can upload the encrypted gradient ciphertext to the nearest edge server, thereby improving the efficiency of data transmission and processing, and can effectively improve the security and privacy protection of data, and improve the security of gradient ciphertext transmission.

[0075] It should be noted that an edge server can receive gradient ciphertexts sent by one or more participating clients.

[0076] In step 102, multiple edge servers aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregated model ciphertext.

[0077] The secure multi-party computing protocol refers to a multi-user network in which multiple edge servers holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts in a mutually distrustful network. Each edge server only obtains part of the data in the aggregate model ciphertext and does not disclose the gradient ciphertext it holds to other edge servers.

[0078] For example, there are Participating Clients , each holding a gradient ciphertext , send to Different edge servers, these edge servers use the set function Calculate the aggregate model ciphertext together , Only get the results , and not disclose To other participants.

[0079] Specifically, in one non-limiting embodiment, Edge Servers , the gradient ciphertexts received by each are , where the first server Pick a random number r , the gradient ciphertext you receive Add random number r As the accumulated gradient The data is passed to other servers in the multiple edge servers, so that other servers add the gradient ciphertexts they receive to the accumulated gradient in turn, until the last server adds the gradient ciphertext it receives and returns it to the first server, that is:

[0080] (1) Edge Server Will Send to edge server ;

[0081] (2) Edge Server Will Send to edge server ;

[0082] (3) Edge Server Continue to perform the same operation;

[0083] (4) Edge Server Will Send to edge server ;

[0084] (5) Edge Server Will Subtract random number r Divide by the bus of participants n , get the aggregate model ciphertext .

[0085] (6) Edge Server To edge server Publish the aggregation model ciphertext.

[0086] It should be noted that the above-mentioned first server can be any one of multiple edge servers, and the order of transmission of the aggregation model ciphertext by different servers can be pre-agreed, for example, set by the central server in the system configuration, which is not limited in this embodiment of the present invention.

[0087] In the above example, each edge server receives a gradient ciphertext sent by a participating client. When the edge servers closest to multiple participating clients are the same edge server, the edge server can also receive the gradient ciphertexts of multiple participating clients at the same time. Accordingly, when multiple edge servers jointly calculate the aggregate model ciphertext using the set function in the above manner, the edge server needs to add the accumulated gradient received from other servers to the gradient ciphertexts sent by all participating clients, and then send it to the next server.

[0088] Of course, other secure multi-party computing methods can also be used, as long as each edge server only obtains part of the data in the aggregate model ciphertext and does not leak its own gradient ciphertext to other edge servers.

[0089] Step 103: The edge server sends the aggregation model ciphertext to the participating client.

[0090] Correspondingly, each participating client uses a private key to decrypt the aggregate model ciphertext to obtain an updated model; the updated model is trained again based on local data to obtain a new gradient ciphertext, and the new gradient ciphertext is uploaded to the edge server.

[0091] The decentralized hierarchical federated learning method provided by the present invention utilizes encryption algorithms and secure multi-party computing technology to achieve secure encryption of gradient data of participating clients and model aggregation between edge servers, thereby solving the problems of data leakage and model contamination existing in traditional federated learning and effectively protecting the privacy of data.

[0092] like Figure 2 , which is another flow chart of the decentralized hierarchical federated learning method provided by an embodiment of the present invention.

[0093] and Figure 1 Compared with the embodiment shown, in this embodiment, the method further includes the following steps:

[0094] Step 104: The edge server determines the contribution of the participating client.

[0095] For example, in a non-limiting embodiment, each edge server may evaluate the contribution of the corresponding participant based on the marginal loss as a basis for awarding rewards.

[0096] The edge server can calculate the participating clients as follows Marginal loss :

[0097] ;

[0098] in, and Respectively and The loss on the validation set; represents the global model obtained by aggregating the local models of all participating clients, Indicates that the participating clients are removed by aggregation The global model obtained by the local models of all participating clients except

[0099] ;

[0100] ;

[0101] According to the client side Marginal loss Determine its contribution. The greater the marginal loss, the greater the contribution.

[0102] Step 105: issuing rewards to corresponding participants according to the contribution.

[0103] The decentralized hierarchical federated learning method provided by the embodiment of the present invention ensures the quality and efficiency of model training by evaluating the contribution of each participating client and reasonably issuing rewards.

[0104] Furthermore, for the marginal loss calculated above , you can also set the corresponding threshold δ to filter The participating clients participate in the next round of model training, so as to better ensure the quality of the model.

[0105] It should be noted that the above threshold Dynamic adjustment is required, that is, after obtaining the corresponding gradient data in each round of model training and encrypting the gradient data and sending it to the edge server, the edge server needs to re-determine the threshold δ to ensure that the selected participating clients have good data quality and model training capabilities, thereby ensuring the quality of the model obtained by joint training.

[0106] Accordingly, the present invention also provides an edge server, such as Figure 3 FIG. 1 is a schematic diagram of the structure of an edge server provided by an embodiment of the present invention.

[0107] The edge server 300 is any server in a server cluster composed of multiple edge servers arranged in sequence, and includes the following modules:

[0108] The receiving module 301 is used to receive the gradient ciphertext sent by the client of the participant;

[0109] Aggregation module 302, used to aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregate model ciphertext; the secure multi-party computing protocol refers to a multi-user network in which multiple edge servers holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts in a mutually distrustful network, each edge server only obtains part of the data in the aggregate model ciphertext, and does not disclose the gradient ciphertext it holds to other edge servers;

[0110] When the edge server is used as the first server, the aggregation model ciphertext is obtained in the following manner: a random number is selected, and the gradient ciphertext received by the edge server is added with the random number as the accumulated gradient and transmitted to other servers, so that other servers sequentially add the gradient ciphertext received by the edge server to the accumulated gradient, and receive the accumulated gradient returned by the last server, subtract the random number from the accumulated gradient, and then divide it by the number of edge servers to obtain the aggregation model ciphertext, and publish the aggregation model ciphertext to other servers;

[0111] When the edge server is used as a server other than the first server, the aggregation model ciphertext is obtained in the following manner: receiving the accumulated gradient sent by the previous server, adding the gradient ciphertext received by itself to the accumulated gradient and sending it to the next server or the first server, and receiving the aggregation model ciphertext published by the first server;

[0112] The model sending module 303 is used to send the aggregate model ciphertext to the participating client.

[0113] The edge server provided by the present invention adopts a distributed structure and aggregates the received gradient data of the participating clients based on a secure multi-party computing method, thereby effectively protecting the privacy of the data of each participating party.

[0114] In another non-limiting embodiment, the edge server 300 may further include: a reward processing module (not shown in the figure), which is used to determine the contribution of the participant client and issue rewards to the participant client according to the contribution.

[0115] The reward processing module can determine the contribution of the participating client according to the marginal loss. The calculation method of the marginal loss can refer to the description in the previous embodiment of the method of the present invention, which will not be repeated here.

[0116] In another non-limiting embodiment, the edge server 300 may further include: a screening module (not shown in the figure), which is used to screen the clients participating in the next round of model training according to the marginal loss of each participating client, such as the participating client Marginal loss Greater than or equal to the set threshold , then the client of the participant As the client of the participant in the next round of model training, otherwise the client of the participant The next round of model training will not be performed.

[0117] Accordingly, the model delivery module 303 only delivers the aggregate model ciphertext to the selected clients that participate in the next round of model training. That is, if the screening module determines that the corresponding participant client is eligible to participate in the next round of model training, the model delivery module 303 delivers the aggregate model ciphertext to the participant client; otherwise, the aggregate model ciphertext will no longer be delivered to the participant client.

[0118] Through the above screening of participating clients, the quality of the model can be better guaranteed.

[0119] Accordingly, the embodiment of the present invention also provides a decentralized hierarchical federated learning system, such as Figure 4 , which is a structural diagram of a decentralized hierarchical federated learning system provided by an embodiment of the present invention.

[0120] In this example, the decentralized hierarchical federated learning system 40 includes a central server 400 and multiple edge servers 30. Among them:

[0121] The central server 400 is used to initialize the federated learning system, set system parameters, secure multi-party computing protocols, and encryption algorithms;

[0122] Multiple edge servers 300 are used to respectively receive gradient ciphertexts sent by different participating clients, aggregate the received gradient ciphertexts based on a secure multi-party computing protocol, obtain aggregated model ciphertexts, and send the aggregated model ciphertexts to the participating clients; the gradient ciphertexts are obtained by the participating clients using local data to perform model training and encrypting the obtained gradient data using the encryption algorithm.

[0123] Each of the above-mentioned edge servers 300 can receive gradient ciphertexts sent by one or more participating clients. Multiple different edge servers 300 aggregate the received gradient ciphertexts and then send them to the corresponding participating clients.

[0124] The specific working mode and data sharing process of each part in the above-mentioned decentralized hierarchical federated learning system 40 can be referred to the description in the previous embodiment of the method of the present invention, and will not be repeated here.

[0125] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0126] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0127] In several embodiments provided by the present invention, it should be understood that the disclosed device can be implemented in other ways.

[0128] The present invention also provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the computer program can be executed when it is run. Figure 1 or Figure 2 The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. The storage medium may also include a non-volatile memory (non-volatile) or a non-transitory memory, etc.

[0129] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data provider to another website site, a computer, a server or a data provider by wired or wireless means.

[0130] The embodiments of the present invention are described in detail above. The present invention is described in detail using specific implementation methods herein. The description of the above embodiments is only used to help understand the method and system of the present invention. It is only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should belong to the scope of protection of the present invention, and the content of this specification should not be understood as limiting the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A decentralized hierarchical federated learning method, characterized in that: The method comprises: A plurality of edge servers respectively receive gradient ciphertexts sent by different participating clients; the plurality of edge servers form a server cluster and are arranged in sequence; The multiple edge servers aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregate model ciphertext; the secure multi-party computing protocol refers to a multi-user network in which multiple edge servers holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts in a mutually distrustful multi-user network, each edge server only obtains part of the data in the aggregate model ciphertext, and does not disclose the gradient ciphertext held by itself to other edge servers; The edge server sends the aggregation model ciphertext to the participating client; The multiple edge servers aggregate the received gradient ciphertexts based on the secure multi-party computing protocol to obtain the aggregated model ciphertext including: The first server among the multiple edge servers selects a random number, and transmits the gradient ciphertext received by itself plus the random number as an accumulated gradient to other servers among the multiple edge servers, so that other servers sequentially add the gradient ciphertext received by themselves to the accumulated gradient, until the last server adds the gradient ciphertext received by itself and returns it to the first server; The first server subtracts the random number from the received accumulated gradient, and then divides the gradient by the number of the edge servers to obtain an aggregate model ciphertext; The first server publishes the aggregation model ciphertext to the other servers; The method further comprises: The edge server determines the contribution of the client of the participant; Distribute rewards to corresponding participants according to the contribution; The edge server determines the contribution of the participant client including: The edge server calculates the participating client Marginal loss : ; in, and Respectively and The loss on the validation set; represents the global model obtained by aggregating the local models of all participating clients, Indicates that the participating clients are removed by aggregation The global model obtained by the local models of all participating clients except ; ; According to the client side Marginal loss Determine its contribution. The greater the marginal loss, the greater the contribution.

2. The decentralized hierarchical federated learning method according to claim 1, characterized in that: The first server is any server of the multiple edge servers.

3. The decentralized hierarchical federated learning method according to claim 1, characterized in that: The method further comprises: The participating client uses local data to perform model training based on any one of the following algorithms to obtain gradient data: distributed gradient descent algorithm, linear regression algorithm, and logistic regression algorithm.

4. The decentralized hierarchical federated learning method according to claim 3, characterized in that: The method further comprises: The participant client samples any one of the following encryption algorithms to encrypt the gradient data: Paillier homomorphic encryption algorithm, threshold Paillier homomorphic encryption algorithm, identity-based homomorphic encryption algorithm, and lattice-based homomorphic encryption algorithm.

5. The decentralized hierarchical federated learning method according to claim 1, characterized in that: The method further comprises: According to the client of each party Marginal loss Screen the clients that will participate in the next round of model training; The edge server sends the aggregation model ciphertext to the participant client including: The aggregation model ciphertext is sent to the screened clients.

6. The decentralized hierarchical federated learning method according to claim 1, characterized in that: The method further comprises: The participating client uses a private key to decrypt the aggregate model ciphertext to obtain an updated model; The updated model is trained again based on the local data to obtain a new gradient ciphertext; The new gradient ciphertext is uploaded to the edge server.

7. An edge server, characterized in that: The edge server is any server in a server cluster consisting of a plurality of edge servers arranged in sequence; The edge server comprises: A receiving module, used to receive the gradient ciphertext sent by the participating client; An aggregation module is used to aggregate the received gradient ciphertexts based on a secure multi-party computing protocol to obtain an aggregate model ciphertext; the secure multi-party computing protocol refers to a multi-user network in which multiple edge servers holding different gradient ciphertexts jointly calculate an aggregate model ciphertext based on these gradient ciphertexts in a mutually distrustful multi-user network, and each edge server only obtains part of the data in the aggregate model ciphertext and does not disclose the gradient ciphertext it holds to other edge servers; When the edge server is used as the first server, the aggregation model ciphertext is obtained in the following manner: a random number is selected, and the gradient ciphertext received by the edge server is added with the random number as the accumulated gradient and transmitted to other servers, so that other servers sequentially add the gradient ciphertext received by the edge server to the accumulated gradient, and receive the accumulated gradient returned by the last server, subtract the random number from the accumulated gradient, and then divide it by the number of edge servers to obtain the aggregation model ciphertext, and publish the aggregation model ciphertext to other servers; When the edge server is used as a server other than the first server, the aggregation model ciphertext is obtained in the following manner: receiving the accumulated gradient sent by the previous server, adding the gradient ciphertext received by itself to the accumulated gradient and sending it to the next server or the first server, and receiving the aggregation model ciphertext published by the first server; A model sending module, used for sending the aggregate model ciphertext to the client of the participant; The edge server also includes: A reward processing module, used to determine the contribution of the participant client and issue rewards to the participant client according to the contribution; Determining the contribution of the participating client includes: The edge server calculates the participating client Marginal loss : ; in, and Respectively and The loss on the validation set; represents the global model obtained by aggregating the local models of all participating clients, Indicates that the participating clients are removed by aggregation The global model obtained by the local models of all participating clients except ; ; According to the client side Marginal loss Determine its contribution. The greater the marginal loss, the greater the contribution.

8. A decentralized hierarchical federated learning system, characterized in that: The system comprises: a central server, and a plurality of edge servers as claimed in claim 7; The central server is used to initialize the federated learning system, set system parameters, secure multi-party computing protocol, and encryption algorithm; The multiple edge servers are used to respectively receive gradient ciphertexts sent by different participating clients, aggregate the received gradient ciphertexts based on a secure multi-party computing protocol, obtain aggregated model ciphertexts, and send the aggregated model ciphertexts to the participating clients; the gradient ciphertexts are obtained by the participating clients using local data to perform model training and encrypting the obtained gradient data using the encryption algorithm.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the decentralized hierarchical federated learning method according to any one of claims 1 to 6 are performed.