Communication configuration method, federated learning method, device, electronic equipment and medium
By automatically configuring communication domain names and certificates based on task identifiers and location domain names in federated learning, the tedious problem of manual configuration is solved, enabling flexible configuration and efficient operation of federated learning clusters.
Patent Information
- Application Number
- CN202211436167.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-11-16
AI Technical Summary
The process of manually configuring a federated learning cluster in the existing technology is cumbersome and time-consuming, especially when adding a participant, which requires changing the configuration of each party in the cluster and updating the communication certificate, causing inconvenience.
By determining the communication domain name and communication certificate of each party based on the task identifier and the location domain name of each party, the communication connection of each party can be automatically configured. The communication certificate is generated by using domain name access and wildcards, which simplifies the configuration process.
While ensuring communication security and reliability, the configuration process of the federated learning cluster has been simplified, supporting the parallel execution of multiple tasks and improving task execution efficiency.
Smart Images

Figure CN115913933B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of federated learning tasks, and in particular to a communication configuration method, a federated learning method, an apparatus, an electronic device and a medium. BACKGROUND
[0002] Federated learning is a machine learning framework that can effectively help multiple participants to use data and build machine learning models while meeting user privacy protection and data security requirements. A federated learning cluster generally consists of a central service party and several federated participant parties, and completes various federated learning training tasks under the coordination of the central service party.
[0003] The existing technical solutions generally first deploy a central service party, and then deploy a set of systems at each federated participant party, manually configure the network connection with the central service party and configure the network connection between each participant party, and finally form a federated learning cluster.
[0004] The manual fixed configuration brings many inconveniences to subsequent changes of the federated learning cluster. When a participant party needs to be added, the configurations of each party in the cluster need to be changed, and the corresponding communication certificates need to be updated, which is a tedious and time-consuming process. SUMMARY
[0005] The present application provides a communication configuration method, a federated learning method, an apparatus, an electronic device and a medium to solve the defects of the prior art that manually fixed configuration of the connection between each party in the federated learning task brings many inconveniences.
[0006] The present application provides a communication configuration method, comprising:
[0007] determining a task identifier of a federated learning task and a positioning domain name of each party participating in the federated learning task;
[0008] determining a communication domain name of each party based on the task identifier and the positioning domain name of each party;
[0009] determining a communication certificate between each party based on the positioning domain name of each party;
[0010] configuring the communication domain name of each party and the communication certificate between each party to each party, so that each party establishes a communication connection and performs the federated learning task based on the communication connection.
[0011] According to the communication configuration method provided by the present application, the parties include a central service party and at least two participant parties, and the positioning domain name determination step comprises:
[0012] determining the positioning domain name of the central service party;
[0013] The central service party allocates a positioning domain name from a participant domain name pool to obtain positioning domain names of at least two participants.
[0014] According to the communication configuration method provided by the application, the parties establish a communication connection in the form of domain name access, and the communication domain names of the parties are determined based on the task identifier and the positioning domain names of the parties, and the method comprises the following steps of:
[0015] In the case that the central service party is the accessed party, the communication domain name of the central service party is determined based on the task identifier and the positioning domain name of the central service party.
[0016] In the case that any participant in the at least two participants is the accessed party, the communication domain name of the any participant is determined based on the task identifier and the positioning domain name of the any participant.
[0017] According to the communication configuration method provided by the application, the communication credentials between the parties are determined based on the positioning domain names of the parties, and the method comprises the following steps of:
[0018] The communication credentials between the central service party and the at least two participants are determined based on the wildcard and the positioning domain name of the central service party.
[0019] The communication credentials between the at least two participants are determined based on the wildcard and all the positioning domain names in the participant domain name pool.
[0020] According to the communication configuration method provided by the application, the positioning domain names of the at least two participants are obtained, and the method further comprises the following steps of:
[0021] The central service party binds the positioning domain names of the at least two participants with the addresses of the at least two participants and stores the binding records, so that the at least two participants perform domain name resolution based on the binding records.
[0022] The application further provides a federated learning method, which comprises the following steps of:
[0023] Based on the communication connection between the local end and the rest of the parties in the federated learning task, the federated learning task is performed.
[0024] The communication connection is established based on the preconfigured communication domain names of the parties and the communication credentials between the parties, the communication domain names of the parties are determined based on the task identifier of the federated learning task and the positioning domain names of the parties, and the communication credentials between the parties are determined based on the positioning domain names of the parties.
[0025] The application further provides a communication configuration device, which comprises the following steps of:
[0026] The positioning domain name determination unit is configured to determine a task identifier of a federated learning task and positioning domain names of parties participating in the federated learning task.
[0027] The communication domain name determination unit is configured to determine communication domain names of the parties based on the task identifier and the positioning domain names of the parties.
[0028] The communication certificate determination unit is configured to determine communication certificates between the parties based on the positioning domain names of the parties.
[0029] The configuration unit is configured to configure the communication domain names of the parties and the communication certificates between the parties to the parties, so that the parties establish a communication connection and perform the federated learning task based on the communication connection.
[0030] The present application also provides a federated learning device, comprising:
[0031] The task execution unit is configured to perform the federated learning task based on a communication connection between a local end and the rest of the parties in the federated learning task.
[0032] The communication connection is established based on pre-configured communication domain names of the parties and communication certificates between the parties, the communication domain names of the parties are determined based on a task identifier of the federated learning task and positioning domain names of the parties, and the communication certificates between the parties are determined based on the positioning domain names of the parties.
[0033] The present application also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the communication configuration method or the federated learning method according to any one of the above when executing the program.
[0034] The present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the communication configuration method or the federated learning method according to any one of the above.
[0035] The present application also provides a computer program product comprising a computer program, wherein the computer program is executable by a processor to implement the communication configuration method or the federated learning method according to any one of the above.
[0036] The communication configuration method, the federated learning method, the device, the electronic equipment and the medium provided by the application determine the communication domain name of each party based on the task identifier and the positioning domain name of each party, and determine the communication certificate between each party based on the positioning domain name of each party, so that each party in the federated learning task establishes a communication connection according to the pre-configured communication domain name and communication certificate, and executes the federated learning task based on the communication connection. The configuration of the communication connection of each party can be automatically realized, and the configuration process of the federated learning cluster is greatly simplified under the premise of ensuring the communication security and reliability.
[0037] In addition, the application supports multiple federated learning tasks in parallel, and uses one port forwarding request, so that each participant only needs to expose one port to the outside, and multiple requests can be realized by one port proxy, thereby greatly improving the task running efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0039] Figure 1 It is a flowchart of the communication configuration method provided by the application;
[0040] Figure 2 It is a flowchart of the determination method of the positioning domain name provided by the application;
[0041] Figure 3 It is a flowchart of step 120 in the communication configuration method provided by the application;
[0042] Figure 4 It is a flowchart of step 130 in the communication configuration method provided by the application;
[0043] Figure 5 It is an architecture diagram of the federated learning method provided by the application;
[0044] Figure 6 It is a structure diagram of the communication configuration device provided by the application;
[0045] Figure 7 It is a structure diagram of the federated learning device provided by the application;
[0046] Figure 8 It is a structure diagram of the electronic equipment provided by the application. DETAILED DESCRIPTION
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0048] Federated learning is a distributed machine learning framework with privacy protection and secure encryption technologies. It aims to enable decentralized participants to collaboratively perform federated learning tasks without disclosing private data to other participants. A federated learning task can be, for example, the training of a machine learning model.
[0049] When performing federated learning tasks, communication is required between the parties. For example, the central service provider transmits the aggregated model parameters to each participant, or the participants transmit encrypted calculation results to other participants and receive encrypted calculation results sent by other participants.
[0050] To enable communication between the parties, the relevant technologies typically deploy a central service provider first, and then deploy a system on each participating party. By manually configuring the network connection between each participating party and the central service provider, as well as the network connection between each participating party, a federated learning cluster is finally formed.
[0051] However, this manual configuration method brings many inconveniences to subsequent changes to the federated learning cluster. When a new participant needs to be added, the configuration of each party in the cluster needs to be changed, and the corresponding communication certificates need to be updated. The process is cumbersome and time-consuming.
[0052] To address the aforementioned problems, embodiments of the present invention provide a communication configuration method, which can be applied to configuring communication connections between parties in a federated learning task. The technical concept of this method lies in determining the communication domain names of each party based on the task identifier and the location domain names of each party, and determining the communication certificates between the parties based on the location domain names of each party, enabling the parties in the federated learning task to establish communication connections according to the pre-configured communication domain names and communication certificates, and to execute the federated learning task based on these communication connections.
[0053] By adopting the communication configuration method provided in the embodiments of the present invention, the parties can automatically configure the communication connection. Especially when adding a new participant, there is no need to manually change the network connection and update the communication certificate. Under the premise of ensuring communication security and reliability, participants can be added or deleted more flexibly, which greatly simplifies the configuration change process of the federated learning cluster.
[0054] The technical solution of the communication configuration method of the present invention will be described in detail below with reference to the accompanying drawings.Figure 1 This is a flowchart illustrating the communication configuration method provided by the present invention. The execution entity of this method can be a communication configuration device, which can be implemented through software and / or hardware. This device can be integrated into an electronic device, which can be a personal computer or a server. Figure 1 As shown, the communication configuration method provided in this embodiment of the invention may include the following steps:
[0055] Step 110: Determine the task identifier for the federated learning task and the location domain name for each party participating in the federated learning task.
[0056] Specifically, within a federated learning framework, one or more federated learning tasks can run simultaneously, each task having a task identifier. A federated learning task can be initiated by any participating party or by the central service provider. The task identifier uniquely identifies the federated learning task; it can be the task name, task sequence number, or task ID (Identity document), etc., and this embodiment of the invention does not impose specific limitations on this. When multiple federated learning tasks exist, they can run in parallel or sequentially.
[0057] The parties involved in the federal learning task can be the central service provider and at least two participating parties under this framework.
[0058] Each party's geolocation domain name uniquely identifies its address on the Internet. Also known as a domain name, a geolocation domain name is a string of names separated by dots on the Internet, used to locate a computer or other device during data transmission.
[0059] The domain names for each party can be pre-configured. For example, the domain name for the central service provider could be server.iflearner.com, and the domain names for each participating party could be a.party.iflearner.com and z.party.iflearner.com, respectively. Understandably, the domain names for each party can also be other pre-defined unique identifiers.
[0060] Step 120: Determine the communication domain names of each party based on the task identifier and the location domain names of each party.
[0061] Specifically, when each party initiates its corresponding service to participate in the federated learning task, data transmission occurs between them, requiring the establishment of a communication channel. Under the federated learning framework of this invention, communication between parties can be conducted via domain name access. Here, the communication domain name of each party can be the data receiving address of the party corresponding to the task identifier within the federated learning task.
[0062] Therefore, the communication domain name can be determined based on the task identifier and the location domain names of each party. For example, the task identifier can be combined with the location domain names of each party to obtain the communication domain name of each party. Specifically, the task identifier can be added before the location domain name.
[0063] In one embodiment, if the task identifier is job1 and the location domain of the central service provider is server.iflearner.com, then when the central service provider executes the job1 task, the communication domain for communicating with other parties can be job1.server.iflearner.com.
[0064] Step 130: Determine the communication certificates between the parties based on their location domains.
[0065] Specifically, during communication, to ensure data is not leaked during network transmission, parties can encrypt data using communication certificates. These certificates can be, but are not limited to, TLS (Transport Layer Security) certificates; for example, SSL (Secure Socket Layer) certificates can also be used. Communication certificates ensure data confidentiality while also guaranteeing data integrity. TLS certificates are based on the TLS protocol, which is decoupled from higher-level application layer protocols such as gRPC (Google Remote Procedure Call) and HTTP (Hypertext Transfer Protocol). Application layer protocols run transparently on top of the TLS protocol, with the TLS protocol handling the negotiation and authentication required to create the encrypted channel. Data transmitted by application layer protocols is encrypted when passing through the TLS protocol, thus ensuring the confidentiality of communication.
[0066] In this step, communication between the parties can specifically include communication between the central service provider and any participating party, as well as communication between the participating parties themselves. Therefore, when designing the communication certificates, two sets of certificates can be designed: one for communication between the central service provider and any participating party, and the other for communication between the participating parties. These two sets of certificates prevent the central service provider from intercepting the communication content between the participating parties. In other words, when any participating party communicates with other participating parties, the central service provider cannot intercept the communication content between those two participating parties.
[0067] To obtain these two sets of communication certificates, it is possible to determine them based on the location domains of each party. For example, when generating the communication certificates, the common name (CN) of the certificates can be bound to the location domains of each party.
[0068] Preferably, considering that the location domains of each participant are different, a unified communication authentication (Subject Alternative Names, SAN) method can be used when generating communication certificates between the participants. SAN supports adding multiple domains and allows multiple domains to be written into the same certificate. For example, the location domains of each participant can be added to the SAN certificate, which can protect multiple domains, thereby reducing the management cost for operation and maintenance personnel and improving certificate management efficiency.
[0069] Step 140: Configure the communication domain names of each party and the communication certificates between each party to enable the parties to establish a communication connection and perform federated learning tasks based on the communication connection.
[0070] Specifically, the operation of federated learning tasks is based on the ability of all parties to achieve encrypted transmission of network data. This can be achieved by configuring the communication domain names and communication certificates of each party to enable communication between them.
[0071] Therefore, based on the communication domain names of the parties performing the federated learning task obtained through the above steps 110-130, as well as the communication certificates between the parties, the parties can establish a communication connection and perform the federated learning task based on the communication connection.
[0072] Understandably, any party can execute multiple federated learning tasks simultaneously, and for each federated learning task, the communication configuration method provided in this invention can be used to achieve communication between the parties. In other words, this invention supports multiple federated learning tasks running in parallel, all using a single port for request forwarding, with each participant only needing to expose one port. This invention, by designing a unique domain name routing mechanism and corresponding TLS certificates for the domain names, enables multiple requests to be proxied on a single port, which can significantly improve task execution efficiency.
[0073] The communication configuration method provided by this invention determines the communication domain names of each party based on the task identifier and the location domain names of each party, and determines the communication certificates between the parties based on the location domain names of each party. This enables the parties in a federated learning task to establish a communication connection based on the pre-configured communication domain names and communication certificates, and to execute the federated learning task based on the communication connection. This method enables automatic configuration of communication connections by each party, greatly simplifying the configuration process of a federated learning cluster while ensuring communication security and reliability.
[0074] Furthermore, this invention supports multiple federated learning tasks running in parallel, all using a single port to forward requests. Each participant only needs to expose one port, enabling one port to proxy multiple requests, thereby greatly improving task efficiency.
[0075] Based on the above embodiments,Figure 2 This is a flowchart illustrating the method for determining the location domain name provided by the present invention, as shown below. Figure 2 As shown, the steps for determining the location domain name for each party include:
[0076] Step 210: Determine the location domain name of the central service provider;
[0077] Step 220: The central service provider allocates location domains from the participant domain pool to obtain location domains for at least two participants.
[0078] Specifically, the parties may include a central server and at least two participating parties. The central server and its domain name can be determined first; the domain name of the central server reflects its address on the Internet.
[0079] The central service provider not only has a dedicated location domain (e.g., server.iflearner.com), but also a pool of participant domains. The participant domain pool can pre-configure location domains for at least two participants, and there is no specific limit to the number of location domains it includes.
[0080] For example, the participant domain name pool may include 26 participant domain names, where each participant's domain name can be represented as a~z.party.iflearner.com, i.e., a.party.iflearner.com, b.party.iflearner.com, ..., z.party.iflearner.com. Of course, in addition to using the letters a~z to distinguish each participant, other naming methods that can distinguish each participant can also be used, such as numbers and characters. This embodiment of the invention does not specifically limit this.
[0081] When deploying the federated learning framework, the central service provider assigns a location domain name to each participant from the participant domain name pool, thus obtaining the location domain name for each participant. For example, a.party.iflearner.com can be assigned to participant a, b.party.iflearner.com can be assigned to participant b, and so on, thereby creating an assignment record table.
[0082] Preferably, the number of pre-set location domains in the participant domain pool can be greater than the number of participants in the current federated learning framework. When a new participant is added, the central service provider will select an unused location domain from the participant domain pool and assign it to the new participant. Understandably, if a participant withdraws, the central service provider can reassign its location domain to another newly joined participant.
[0083] The method provided by this invention enables the configuration of location domain names for each participant through a participant domain name pool. In particular, when adding a new participant, there is no need to manually change the network connection and update the communication certificate. Under the premise of ensuring communication security and reliability, participants can be added or deleted more flexibly, which greatly simplifies the configuration change process.
[0084] Based on any of the above embodiments, the parties establish a communication connection by accessing the communication domain name. Figure 3 This is a flowchart illustrating step 120 of the communication configuration method provided by the present invention, as follows: Figure 3 As shown, step 120 specifically includes:
[0085] Step 121: When the central service provider is the accessed party, determine the communication domain name of the central service provider based on the task identifier and the location domain name of the central service provider.
[0086] Step 122: If any of the at least two participants is the accessed party, determine the communication domain name of any participant based on the task identifier and the location domain name of any participant.
[0087] Specifically, during the operation of this federated learning task, communication between the parties is conducted via domain name access. When the central service provider is the accessed party, meaning any participating party accesses the central service provider, the communication domain name of the central service provider can be determined based on the task identifier and the central service provider's location domain name. In other words, each participating party executing the task can establish a communication connection with the central service provider through its communication domain name.
[0088] For example, during the execution of job1, the communication domain name for the participants (party) to access the central service provider (server) can be job1.server.iflearner.com.
[0089] When any participant is the accessed party, there are two scenarios: either the central service provider accesses the participant, or another participant accesses the participant. In this case, the participant's communication domain name can be determined based on the task identifier and the participant's location domain name. In other words, the central service provider or other participants can establish a communication connection with the participant through the participant's communication domain name.
[0090] For example, during the operation of job2, the communication domain name for the central service provider (server) to access participant b is job2.b.party.iflearner.com, the domain name for participant a to access participant b is job2.b.party.iflearner.com, and the domain name for participant b to access participant a is job2.a.party.iflearner.com.
[0091] The method provided in this invention determines the communication domain name by using task identifier and location domain name, supports multiple federated learning tasks in parallel, and all of them use a single port to forward requests. Each participant only needs to expose one port to the outside world, so that one port can proxy multiple requests, which can greatly improve the task running efficiency.
[0092] Based on any of the above embodiments Figure 4 This is a flowchart illustrating step 130 of the communication configuration method provided by the present invention, as follows: Figure 4 As shown, step 130 specifically includes:
[0093] Step 131: Based on wildcards and the location domain name of the central service provider, determine the communication certificates between the central service provider and at least two participating parties;
[0094] Step 132: Determine the communication certificates between at least two participants based on wildcards and all location domains in the participant domain pool.
[0095] Specifically, when designing communication certificates, two sets of certificates can be designed: one set for communication between the central service provider and any participating party, and the other set for communication between the participating parties.
[0096] The certificate used for communication between the central service provider and at least two participating parties can be generated based on wildcards and the central service provider's location domain name. The public name of this communication certificate is set to *.server.iflearner.com. The wildcard here can be used to match the task identifiers of various tasks to meet the needs of different tasks.
[0097] Certificates used for communication between participants can be generated based on wildcards and various location domains in the participant's domain pool. Considering the different location domains of each participant, this communication certificate can use a SAN certificate. This involves adding wildcards to all location domains in the participant's domain pool (e.g., *.a.party.iflearner.com, *.b.party.iflearner.com, ..., *.z.party.iflearner.com) and then writing them into the SAN to obtain a unified communication certificate between all participants. The wildcards here can be matched with the task identifiers of various tasks to meet the needs of different tasks.
[0098] Since the participant domain pool contains the location domains of all participants, all participants can use the same unified communication certificate, thereby reducing the management cost for operations and maintenance personnel and improving certificate management efficiency.
[0099] The method provided in this invention, by generating two sets of certificates, can prevent the central service provider from stealing communication content between federated participants, thereby improving communication security and privacy. Furthermore, the method of generating communication certificates between participants based on wildcards and all location domains in the participant's domain name pool can reduce management costs for operations and maintenance personnel and improve certificate management efficiency.
[0100] Based on any of the above embodiments, step 220 obtains the location domains of at least two participating parties, and then further includes:
[0101] The central service provider binds the location domains of at least two participants to the addresses of at least two participants and stores the binding records so that at least two participants can perform domain name resolution based on the binding records.
[0102] Specifically, after the central service provider assigns location domain names to each participant, it can also bind the location domain names of at least two participants to their addresses and store the binding records.
[0103] The address here could be, for example, an IP address. An IP address is a standardized address format provided by the IP protocol. Every computer and other device on the internet has a unique IP address, thus masking differences in physical addresses. IP addresses enable computers and other devices on the internet to be found efficiently and easily, allowing communication connections to be established.
[0104] Understandably, the addresses of at least two participating parties are not limited to IP addresses and can be configured according to the specific application network, which will not be limited here.
[0105] Because IP addresses are inconvenient to remember and cannot display the name and nature of the address organization, binding records can map domain names and IP addresses to each other, making Internet communication more convenient, without having to remember the number of IP address strings that can be directly read by machines.
[0106] Here, a binding record can be understood as a routing table, and it can be stored in a DNS (Domain Name System) server. A binding record can be displayed in the form shown in Table 1:
[0107] Table 1
[0108]
[0109]
[0110] In Table 1, participant a's domain name a.party.iflearner.com is bound to its IP address 192.168.0.1; participant b's domain name b.party.iflearner.com is bound to its IP address 192.168.0.2, and so on.
[0111] During the operation of the federated learning task, the central service provider can act as a DNS server, enabling participants to correctly resolve domain names based on the binding records in the DNS server. After domain name resolution, the addresses of each participant, such as IP addresses, can be obtained to establish communication connections.
[0112] Based on any of the above embodiments, this invention provides a federated learning method, including:
[0113] The federated learning task is executed based on the communication connection between this end and the other parties in the federated learning task; wherein, the communication connection is established based on the pre-configured communication domain names of the parties and the communication certificates between the parties, the communication domain names of the parties are determined based on the task identifier of the federated learning task and the location domain names of the parties, and the communication certificates between the parties are determined based on the location domain names of the parties.
[0114] Specifically, the federated learning method provided in this embodiment of the invention can be applied to any party participating in the federated learning task, such as the central service provider or a participating party.
[0115] The "local party" here can be any party participating in the federated learning task, while the other parties refer to the parties that need to establish a communication connection with the local party when carrying out the federated learning task.
[0116] The communication connection is established based on the pre-configured communication domain names of each party and the communication certificates between the parties. The communication domain names of each party are determined based on the task identifier of the federated learning task and the location domain names of each party. The communication certificates between the parties are determined based on the location domain names of each party.
[0117] Each party's geolocation domain name uniquely identifies its address on the Internet. Also known as a domain name, a geolocation domain name is a string of names separated by dots on the Internet, used to locate a computer or other device during data transmission.
[0118] The domain names for each party can be pre-configured. For example, the domain name for the central service provider could be server.iflearner.com, and the domain names for each participating party could be a.party.iflearner.com and z.party.iflearner.com, respectively. Understandably, the domain names for each party can also be other pre-defined unique identifiers.
[0119] Within a federated learning framework, one or more federated learning tasks can run simultaneously, each with a task identifier. A federated learning task can be initiated by any participating party or by the central service provider. The task identifier uniquely identifies the federated learning task; it can be the task name, task sequence number, or task ID (Identity document), etc., though this embodiment of the invention does not impose specific limitations on this. When multiple federated learning tasks exist, they can run in parallel or sequentially.
[0120] The communication domain name can be determined based on the task identifier and the location domain names of each party. For example, the task identifier can be combined with the location domain names of each party to obtain the communication domain name of each party. Specifically, the task identifier can be added to the beginning of the location domain name.
[0121] In one embodiment, if the task identifier is job1 and the location domain of the central service provider is server.iflearner.com, then when the central service provider executes the job1 task, the communication domain for communicating with other parties can be job1.server.iflearner.com.
[0122] Communication between the parties can specifically include communication between the central service provider and any participating party, as well as communication between the participating parties themselves. Therefore, when designing communication certificates, two sets of certificates can be designed: one for communication between the central service provider and any participating party, and the other for communication between the participating parties. These two sets of certificates prevent the central service provider from intercepting the communication content between the participating parties. In other words, when any participating party communicates with other participating parties, the central service provider cannot intercept the communication content between those two participating parties.
[0123] To obtain these two sets of communication certificates, it is possible to determine them based on the location domains of each party. For example, when generating the communication certificates, the common name (CN) of the certificates can be bound to the location domains of each party.
[0124] Preferably, considering that the location domains of each participant are different, a unified communication authentication (Subject Alternative Names, SAN) method can be used when generating communication certificates between the participants. SAN supports adding multiple domains and allows multiple domains to be written into the same certificate. For example, the location domains of each participant can be added to the SAN certificate, which can protect multiple domains, thereby reducing the management cost for operation and maintenance personnel and improving certificate management efficiency.
[0125] Once the communication domain names of the parties executing the federated learning task and the communication certificates between the parties are obtained, a communication connection can be established between this end and the other parties in the federated learning task to execute the federated learning task.
[0126] The federated learning method provided in this invention establishes a communication connection between parties in a federated learning task using pre-configured communication domain names and certificates, and executes the task based on this connection. This method enables automatic configuration of communication connections by all parties, greatly simplifying the configuration process of the federated learning cluster while ensuring communication security and reliability.
[0127] Based on any of the above embodiments Figure 5 This is a schematic diagram of the architecture of the federated learning method provided by the present invention, as shown below. Figure 5 As shown, the architecture includes a central service provider, participant a, and participant b, and has two federated learning tasks, job1 and job2.
[0128] This federated learning framework is deployed using Kubernetes. Iflearner-job1-svc is a Kubernetes service used to proxy instances of Kubernetes pods; Iflearner-aggregator2-pod is an instance of the central service provider's federated tasks running on Kubernetes; and Iflearner-job1-pod is an instance of our participating parties' federated tasks running on Kubernetes.
[0129] The central service provider's domain name is server.iflearner.com, participant A's domain name is a.party.iflearner.com, and participant B's domain name is b.party.iflearner.com.
[0130] When running job1, participant a accesses the central service provider's communication domain name using job1.server.iflearner.com, participant b accesses the central service provider's communication domain name using job1.server.iflearner.com, participant a accesses participant b's communication domain name using job1.b.party.iflearner.com, and participant b accesses participant a's communication domain name using job1.a.party.iflearner.com.
[0131] When running job2, participant a accesses the central service provider's communication domain name using job2.server.iflearner.com, participant b accesses the central service provider's communication domain name using job2.server.iflearner.com, participant a accesses participant b's communication domain name using job2.b.party.iflearner.com, and participant b accesses participant a's communication domain name using job2.a.party.iflearner.com.
[0132] The communication certificate between the central service provider and each participating party is *.server.iflearner.com; the communication certificates between participant A and participant B are *.a.party.iflearner.com and *.b.party.iflearner.com.
[0133] As shown in the figure, the application layer protocol adopts the gRPC protocol. gRPC is a high-performance, open-source and general-purpose RPC (Remote Procedure Call) framework. It features high efficiency and low latency, supports TLS, and is very suitable for microservices, point-to-point real-time communication, and multi-language mixed development environments. The data transmission protocol adopts gRPC, which has the advantages of high efficiency and low latency, and can also be transmitted through TLS.
[0134] The communication configuration device provided by the present invention is described below. The communication configuration device described below and the communication configuration method described above can be referred to in correspondence.
[0135] Based on any of the above embodiments Figure 6 This is a schematic diagram of the communication configuration device provided by the present invention, as shown below. Figure 6 As shown, the communication configuration device includes: a location domain name determination unit 610, a communication domain name determination unit 620, a communication certificate determination unit 630, and a configuration unit 640, wherein:
[0136] The domain name determination unit 610 is used to determine the task identifier of the federated learning task and the domain names of the parties participating in the federated learning task.
[0137] The communication domain name determination unit 620 is used to determine the communication domain name of each party based on the task identifier and the location domain name of each party;
[0138] The communication certificate determination unit 630 is used to determine the communication certificates between the parties based on the location domain names of the parties.
[0139] Configuration unit 640 is configured to configure the communication domain names of the parties and the communication certificates between the parties to the parties, so that the parties can establish a communication connection and perform the federated learning task based on the communication connection.
[0140] The communication configuration device provided in this embodiment of the invention determines the communication domain names of each party based on the task identifier and the location domain names of each party, and determines the communication certificates between the parties based on the location domain names of each party. This enables the parties in the federated learning task to establish a communication connection based on the pre-configured communication domain names and communication certificates, and to execute the federated learning task based on the communication connection. It can realize the automatic configuration of communication connections by each party, and greatly simplifies the configuration process of the federated learning cluster while ensuring communication security and reliability.
[0141] Furthermore, this invention supports multiple federated learning tasks running in parallel, all using a single port to forward requests. Each participant only needs to expose one port, enabling one port to proxy multiple requests, thereby greatly improving task efficiency.
[0142] Based on any of the above embodiments, the domain name determination unit is specifically used for:
[0143] Determine the location domain name of the central service provider;
[0144] The central service provider allocates location domains from the participant domain pool to obtain location domains for at least two participants.
[0145] Based on any of the above embodiments, the communication domain name determination unit is specifically used for:
[0146] When the central service provider is the accessed party, the communication domain name of the central service provider is determined based on the task identifier and the location domain name of the central service provider.
[0147] If any one of the at least two participants is the accessed party, the communication domain name of the any participant is determined based on the task identifier and the location domain name of the any participant.
[0148] Based on any of the above embodiments, the communication certificate determination unit is specifically used for:
[0149] Based on wildcards and the location domain name of the central service provider, determine the communication certificates between the central service provider and the at least two participating parties;
[0150] Based on wildcards and all location domains in the participant domain pool, the communication certificate between the at least two participants is determined.
[0151] Based on any of the above embodiments, a domain name binding unit is further included, for:
[0152] The central service provider binds the location domains of the at least two participants to the addresses of the at least two participants and stores the binding records, so that the at least two participants can perform domain name resolution based on the binding records.
[0153] Based on any of the above embodiments Figure 7 This is a schematic diagram of the structure of the federated learning device provided by the present invention, as shown below. Figure 7 As shown, the federated learning device includes a task determination unit 710 and a task execution unit 720, wherein,
[0154] Task determination unit 710 is used to determine the federated learning task to be performed;
[0155] The task execution unit 720 is used to execute the federated learning task based on the communication connection between the local end and the other parties in the federated learning task;
[0156] The communication connection is established based on the pre-configured communication domain names of each party and the communication certificates between the parties. The communication domain names of each party are determined based on the task identifier of the federated learning task and the location domain names of each party. The communication certificates between the parties are determined based on the location domain names of each party.
[0157] The federated learning device provided in this invention allows parties in a federated learning task to establish a communication connection through pre-configured communication domain names and certificates, and then execute the federated learning task based on this communication connection. This enables automatic configuration of communication connections by all parties, greatly simplifying the configuration process of the federated learning cluster while ensuring communication security and reliability.
[0158] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can invoke logical instructions in the memory 830 to execute a communication configuration method, which includes: determining a task identifier for a federated learning task and location domain names of the parties participating in the federated learning task; determining communication domain names of the parties based on the task identifier and the location domain names of the parties; determining communication certificates between the parties based on the location domain names of the parties; and configuring the communication domain names of the parties and the communication certificates between the parties to the parties, so that the parties establish a communication connection and execute the federated learning task based on the communication connection.
[0159] The processor can also invoke logical instructions in memory to execute a federated learning method, which includes: executing the federated learning task based on the communication connection between the local end and the other parties in the federated learning task; the communication connection is established based on the pre-configured communication domain names of the parties and the communication certificates between the parties, the communication domain names of the parties are determined based on the task identifier of the federated learning task and the location domain names of the parties, and the communication certificates between the parties are determined based on the location domain names of the parties.
[0160] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0161] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the communication configuration method provided by the above methods. The method includes: determining a task identifier for a federated learning task and location domain names of the parties participating in the federated learning task; determining communication domain names of the parties based on the task identifier and the location domain names of the parties; determining communication certificates between the parties based on the location domain names of the parties; and configuring the communication domain names of the parties and the communication certificates between the parties to the parties, so that the parties establish a communication connection and execute the federated learning task based on the communication connection.
[0162] When the computer program is executed by the processor, the computer is able to execute the federated learning method provided by the above methods. The method includes: executing the federated learning task based on the communication connection between the local end and the other parties in the federated learning task; the communication connection is established based on the pre-configured communication domain names of the parties and the communication certificates between the parties, the communication domain names of the parties are determined based on the task identifier of the federated learning task and the location domain names of the parties, and the communication certificates between the parties are determined based on the location domain names of the parties.
[0163] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a communication configuration method provided by the methods described above. The method includes: determining a task identifier for a federated learning task and location domain names of the parties participating in the federated learning task; determining communication domain names of the parties based on the task identifier and the location domain names of the parties; determining communication certificates between the parties based on the location domain names of the parties; and configuring the communication domain names of the parties and the communication certificates between the parties to the parties, so that the parties establish a communication connection and execute the federated learning task based on the communication connection.
[0164] When executed by a processor, the computer program implements the federated learning method provided by the above methods, the method comprising: executing the federated learning task based on the communication connection between the local end and the other parties in the federated learning task; the communication connection is established based on the pre-configured communication domain names of the parties and the communication certificates between the parties, the communication domain names of the parties are determined based on the task identifier of the federated learning task and the location domain names of the parties, and the communication certificates between the parties are determined based on the location domain names of the parties.
[0165] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A communication configuration method, characterized in that, include: The task identifier for the federated learning task and the location domain names of the parties participating in the federated learning task are determined; the parties include the central service provider and at least two participating parties. Based on the task identifier and the location domain names of the parties, the communication domain names of the parties are determined; Based on the location domains of the parties, determine the communication certificates between the parties; Configure the communication domain names and communication certificates between the parties to enable the parties to establish a communication connection and perform the federated learning task based on the communication connection; Multiple federated learning tasks can be performed in parallel. Multiple federated learning tasks share the same communication port for request forwarding. Each participant only needs to expose one communication port to proxy the requests of multiple federated learning tasks through the communication port.
2. The communication configuration method according to claim 1, characterized in that, The steps for determining the location domain name for each party include: Determine the location domain name of the central service provider; The central service provider allocates location domain names from the participant domain name pool to obtain location domain names for at least two participants.
3. The communication configuration method according to claim 2, characterized in that, The parties establish a communication connection using a communication domain name access method. The determination of the communication domain names of each party based on the task identifier and the location domain names of each party includes: When the central service provider is the accessed party, the communication domain name of the central service provider is determined based on the task identifier and the location domain name of the central service provider. If any one of the at least two participants is the accessed party, the communication domain name of the any participant is determined based on the task identifier and the location domain name of the any participant.
4. The communication configuration method according to claim 2, characterized in that, The determination of communication certificates between the parties based on their location domains includes: Based on wildcards and the location domain name of the central service provider, determine the communication certificates between the central service provider and the at least two participating parties; Based on wildcards and all location domains in the participant domain pool, the communication certificate between the at least two participants is determined.
5. The communication configuration method according to any one of claims 2-4, characterized in that, After obtaining the location domains of the at least two participating parties, the process further includes: The central service provider binds the location domains of the at least two participants to the addresses of the at least two participants and stores the binding records, so that the at least two participants can perform domain name resolution based on the binding records.
6. A federated learning method, characterized in that, include: The federated learning task is executed based on the communication connection between this terminal and the other parties in the federated learning task; the parties include the central service provider and at least two participating parties. The communication connection is established based on the pre-configured communication domain names of each party and the communication certificates between the parties. The communication domain names of each party are determined based on the task identifier of the federated learning task and the location domain names of each party. The communication certificates between the parties are determined based on the location domain names of each party. Multiple federated learning tasks can be performed in parallel. Multiple federated learning tasks share the same communication port for request forwarding. Each participant only needs to expose one communication port to proxy the requests of multiple federated learning tasks through the communication port.
7. A communication configuration device, characterized in that, include: The location domain name determination unit is used to determine the task identifier of the federated learning task and the location domain name of each party participating in the federated learning task; the parties include the central service provider and at least two participating parties; A communication domain name determination unit is used to determine the communication domain name of each party based on the task identifier and the location domain name of each party; A communication certificate determination unit is used to determine the communication certificates between the parties based on the location domain names of the parties. A configuration unit is configured to configure the communication domain names of the parties and the communication certificates between the parties to the parties, so that the parties can establish a communication connection and execute the federated learning task based on the communication connection; Multiple federated learning tasks can be performed in parallel. Multiple federated learning tasks share the same communication port for request forwarding. Each participant only needs to expose one communication port to proxy the requests of multiple federated learning tasks through the communication port.
8. A federated learning device, characterized in that, include: The task execution unit is used to execute the federated learning task based on the communication connection between the local end and the other parties in the federated learning task; The parties mentioned include the central service provider and at least two participating parties; The communication connection is established based on the pre-configured communication domain names of each party and the communication certificates between the parties. The communication domain names of each party are determined based on the task identifier of the federated learning task and the location domain names of each party. The communication certificates between the parties are determined based on the location domain names of each party. Multiple federated learning tasks can be performed in parallel. Multiple federated learning tasks share the same communication port for request forwarding. Each participant only needs to expose one communication port to proxy the requests of multiple federated learning tasks through the communication port.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the communication configuration method as described in any one of claims 1 to 5 or the federated learning method as described in claim 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the communication configuration method as described in any one of claims 1 to 5 or the federated learning method as described in claim 6.
Citation Information
Patent Citations
Communication method and device in federated learning, electronic equipment and storage medium
CN113973125A
Communication authentication method and device, electronic equipment and storage medium
CN114666112A