Communication method and apparatus
By calculating preset probability values based on network status parameters in federated learning and controlling the number of uploaded devices, the problems of high number of devices and unbalanced data are solved, and the efficiency and accuracy of federated learning are improved.
Patent Information
- Application Number
- PCT/CN2025/074301
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-01
- Filing Date
- 2025-01-23
- Publication Date
- 2025-08-07
AI Technical Summary
During the federated learning process, the high number of participating devices, uneven data and instable network communication status lead to low efficiency.
The network status parameters are determined by the first device, the preset probability value is calculated and sent to the second device to control the probability value of the second device to upload the local model during model training, adjust the number of uploaded devices, and optimize the network status.
This improves the efficiency and accuracy of federated learning, reduces model training time, and optimizes the accuracy of network state parameters.
Smart Images

Figure CN2025074301_07082025_PF_FP_ABST
Abstract
Description
Communication method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on February 1, 2024, with application number 202410154197.8 and application name "A Communication Method and Device", the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of communications, and in particular to a communication method and device. Background Art
[0004] Federated learning is a distributed learning paradigm that requires the participation of a central server and multiple client devices. During the federated learning process, client devices are coordinated and configured by the central server, enabling joint training between the central server and multiple client devices. After each round of model training, the client device reports the resulting model to the central server. The central server aggregates the models received from multiple client devices to initiate the next round of model training.
[0005] Currently, in the federated learning process, in the reporting stage of each round of model, there may be the following problems: the number of client devices participating in the federated learning (for example: 10 10 The magnitude of the problem is high, resulting in a high number of client devices reporting models. The amount of local data on different client devices is uneven, leading to different training times. Furthermore, network communication between the central server and multiple client devices can be unstable. These issues can lead to low efficiency in federated learning. Therefore, improving the efficiency of federated learning is an urgent issue that needs to be addressed. Summary of the Invention
[0006] The embodiments of the present application provide a communication method and apparatus for improving the efficiency of federated learning.
[0007] In a first aspect, the present application provides a communication method, which is applied to a first device, or a component (such as a processor, chip, chip system, circuit, or other, etc.) in the first device, or a software module. Taking the application of the method to the first device as an example, the method may include: in a federated learning process, the first device determines a network status parameter of a first cycle; the network status parameter is determined based on the reception and / or processing of data packets in the first cycle; the first device sends a preset probability value to the second device; the preset probability value is determined based on the network status parameter, and the preset probability value is used to determine the probability value of the second device uploading a local model in any round of model training of at least one round of model training in a second cycle, where the second cycle is the cycle next to the first cycle.
[0008] Using this method, in any round of model training in the second cycle, the first device sends a preset probability value to the second device, so that the second device can determine the probability value of uploading the local model in any round of model training based on the aforementioned preset probability value; in this way, the number of second devices uploading local models can be controlled based on the preset probability value, and the preset probability value is determined by the first device according to the network status parameters of the first cycle. That is to say, the first device can adjust (for example, reduce) the number of second devices uploading local models in real time based on the network status, thereby adjusting (for example, reducing) the time of this round of model training and improving the efficiency of federated learning.
[0009] In one possible design, the network status parameters may include at least one of the following: average waiting time, average queue length, average service time, business intensity or service time variance coefficient; wherein the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packet in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one second device; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio between the average service time and the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packet in the first period and the average service time.
[0010] This design allows network state parameters to be represented by different data (e.g., average waiting time), providing flexibility. Furthermore, the aforementioned design can represent network state parameters through multiple data points, which can improve the accuracy of network state parameters, thereby improving the accuracy of preset probability values and enhancing the efficiency of federated learning.
[0011] In a possible design, the average waiting time, business intensity, average service time, service time variance, and preset probability value can satisfy the following formula:
[0012] in, It is used to represent the average waiting time, ρ is used to represent the business intensity, h is used to represent the average service time, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0013] With this design, the first device can calculate the preset probability value based on the aforementioned formula, thereby improving the efficiency of federated learning.
[0014] In a possible design, the average queue length, traffic intensity, service time variance, and the preset probability value can satisfy the following formula:
[0015] in, It is used to represent the average queue length, ρ is used to represent the service intensity, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0016] With this design, the first device can calculate the preset probability value based on the aforementioned formula, thereby improving the efficiency of federated learning.
[0017] In one possible design, the first device may also send a preset disturbance value to the second device; the preset disturbance value is used to determine the probability value of uploading the local model in any round of model training.
[0018] With this design, the first device can specify a preset disturbance value and send the preset disturbance value to the second device, so that the second device can determine the probability value of any round of model training in combination with the preset disturbance value from the first device, thereby improving the efficiency of federated learning.
[0019] In one possible design, the first device may also receive a local model corresponding to a first round of model training from a second device; the local model corresponding to the first round of model training is a local model sent by the second device based on a first probability value; and / or, the first device may also receive a local model corresponding to a second round of model training from the second device; the local model corresponding to the second round of model training is a local model sent by the second device based on a second probability value; wherein the first round of model training is any round of model training of at least one round of model training, and the second round of model training is any round of model training of at least one round of model training; the first round of model training is different from the second round of model training; the first probability value is the probability value of the second device uploading the local model in the first round of model training, and the second probability value is the probability value of the second device uploading the local model in the second round of model training.
[0020] With this design, the first device can receive the local model corresponding to any round of model training of at least one round of model training in the second cycle from the second device, thereby realizing federated learning.
[0021] In a second aspect, the present application provides a communication method, which is applied to a second device, or a component in the second device (such as a processor, chip, chip system, circuit or other, etc.), or a software module. Taking the application of this method to the second device as an example, the method may include: during the federated learning process, the second device receives a preset probability value from the first device; the preset probability value is determined based on the network status parameter of the first cycle, and the network status parameter is determined based on the reception and / or processing of the data packet in the first cycle; the second device determines, based on the preset probability value, a first probability value of the second device uploading a local model in the first round of model training; the first round of model training is any round of model training of at least one round of model training in the second cycle, and the second cycle is the next cycle of the first cycle; the second device sends the local model corresponding to the first round of model training to the first device based on the first probability value.
[0022] Using this method, the second device determines the first probability value of uploading the local model in the first round of model training based on the preset probability value. The first probability value is determined based on the preset probability value, and the preset probability value is determined by the first device based on the network status parameters of the first cycle. That is to say, the first probability value can be determined in combination with the network status, which can improve the efficiency of federated learning.
[0023] In one possible design, the network status parameters may include at least one of the following: average waiting time, average queue length, average service time, business intensity or service time variance coefficient; wherein the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packet in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one second device; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio between the average service time and the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packet in the first period and the average service time.
[0024] In one possible design, the preset probability value may be equal to the first probability value. With this design, the second device directly uses the preset probability value from the first device as the probability value for uploading the local model corresponding to any round of model training in the second cycle. For the second device, the deployment is relatively simple and the computational load is very low. In addition, since the preset probability value is determined based on the network status of the first device in the previous cycle (i.e., the first cycle), the second device uploads the local model based on the preset probability value, that is, uploads the local model based on the network status of the previous cycle, which can improve the efficiency of federated learning.
[0025] In one possible design, the method in which the second device determines the first probability value based on a preset probability value includes: the second device may determine the first probability value based on the preset probability value and a preset disturbance value.
[0026] With this design, the second device can determine the probability value (i.e., the first probability value) for the first round of model training based on the preset probability value and the preset disturbance value, thereby improving the flexibility of federated learning.
[0027] In one possible design, the second device may also receive a preset disturbance value from the first device. With this design, the first device may specify the preset disturbance value and send it to the second device. The second device can then determine the first probability value based on the preset disturbance value from the first device, thereby improving the accuracy of the first probability value.
[0028] In one possible design, the method for the second device to determine the first probability value based on the preset probability value and the preset disturbance value includes: the second device can determine the probability interval based on the preset probability value and the preset disturbance value; the second device can determine the first probability value based on the probability interval.
[0029] With this design, the second device can select the first probability value based on the probability interval, taking into account local training conditions, thereby improving the efficiency of federated learning. Furthermore, because the probability interval is determined based on a preset probability value and a preset disturbance value, and the preset probability value is determined based on the network status of the first device in the previous cycle (i.e., the first cycle), the second device selects the first probability value based on the probability interval, that is, uploads the local model based on the network status of the previous cycle, which can improve the efficiency of federated learning.
[0030] In one possible design, when the weight value of the training data in the first round of model training is greater than or equal to the weight threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the weight value of the training data in the first round of model training is less than the weight threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
[0031] With this design, the second device can adjust the first probability value in combination with the weight value of the training data of the first round of training data, thereby improving the accuracy of the first probability value.
[0032] In one possible design, when the amount of training data in the first round of model training is greater than or equal to the data amount threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the amount of training data in the first round of model training is less than the data amount threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
[0033] With this design, the second device can adjust the first probability value based on the amount of training data in the first round of model training, thereby improving the accuracy of the first probability value.
[0034] In one possible design, when the relative entropy between the training data in the first round of model training and the training data in the third round of model training is greater than or equal to a relative entropy threshold, the first probability value is greater than or equal to a preset probability value and belongs to a probability interval; when the relative entropy is less than the relative entropy threshold, the first probability value is less than the preset probability value and belongs to the probability interval; wherein the third round of model training is the previous round of model training.
[0035] With this design, the second device can adjust the first probability value based on the relative entropy of the training data in the first round of model training relative to the training data in the previous round of model training, thereby improving the accuracy of the first probability value.
[0036] In one possible design, the process of the second device sending the local model to the first device includes: when it is determined that the random number is less than or equal to the first probability value, the second device can send the local model to the first device; the random number is generated in the first round of model training, and the random number is greater than 0 and less than or equal to 1.
[0037] With this design, the second device can determine whether to send the local model to the first device based on the random number and the first probability value generated in the first round of model training, thereby improving the efficiency of federated learning.
[0038] In one possible design, the second device can also determine a second probability value of uploading the local model by the second device in the second round of model training based on a preset probability value; the second round of model training is any round of model training of at least one round of model training within the second period, and the second round of model training is different from the first round of model training; the second device can also send the local model corresponding to the second round of model training to the first device based on the second probability value.
[0039] With this design, in the second cycle of multiple rounds of model training, in addition to determining the first probability value corresponding to the first round of model training based on the preset probability value, the second device can also determine the second probability value corresponding to the second round of model training based on the preset probability value. The first probability value and the second probability value can be different, which can improve the flexibility of the probability value of uploading the local model in each round of model training. In addition, the first device does not limit the probability value of any second device uploading the local model in each round of model training, which can be understood as not limiting the number of second devices that upload the local model in each round of model training. At least one second device can determine the probability value of any round of model training based on the local training situation, which can improve the efficiency of federated learning.
[0040] In a third aspect, the present application further provides a communication device. The communication device can execute the method described in the first or second aspect or the solutions in each possible design. The communication device can be a chip or circuit capable of executing the functions corresponding to the above method, or a device including the chip or circuit.
[0041] In one possible design, the communication device includes a communication unit for receiving and / or sending data; the communication device also includes a processing unit for implementing the method in any possible design described in the first or second aspects above. The aforementioned functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the aforementioned functions.
[0042] In a fourth aspect, the present application further provides a communication device. The communication device can execute the method described in the first or second aspect above, or the solutions in each possible design. The communication device includes: a processor. When the processor executes instructions, the communication device or a device equipped with the communication device executes the method described in any possible design in the first or second aspect above.
[0043] Optionally, the communication device may further include a memory for storing computer-executable program code, which may include the aforementioned instructions. The memory may be located inside or outside the communication device, which is not limited in this application. The memory may be coupled to the processor.
[0044] The communication device may further include a communication interface. Optionally, if the communication device is a chip or a circuit, the communication interface may be an input / output interface of the chip, such as an input / output pin.
[0045] In a fifth aspect, the present application provides a communication system, the communication system comprising: a first device for executing the method of the first aspect and a second device for executing the method of the second aspect.
[0046] In a sixth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes a method in any possible design shown in the first or second aspect above.
[0047] In a seventh aspect, the present application provides a computer program product, in which a computer-readable storage medium stores instructions, and when the instructions are called by a computer, the computer executes a method in any possible design shown in the first aspect or the second aspect above.
[0048] In an eighth aspect, the present application provides a chip, comprising a processor configured to execute the method of any one of the possible designs described in the first or second aspects above. Optionally, the chip may further comprise a communication interface configured to input and / or output signaling or data. Optionally, the chip may further comprise a memory configured to store the aforementioned computer program; the processor is coupled to the memory, and the processor may read the computer program stored in the memory to execute the method of any one of the possible designs described in the first or second aspects above.
[0049] In addition, the technical effects brought about by the third to eighth aspects can be found in the descriptions of the various possible solutions in the first to second aspects above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] FIG1 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application;
[0051] FIG2 is a flow chart of a communication method provided in an embodiment of the present application;
[0052] FIG3 is an example diagram of a communication method provided in an embodiment of the present application;
[0053] FIG4 is a diagram illustrating an example of communication interaction provided in an embodiment of the present application;
[0054] FIG5 is an example diagram of another communication method provided in an embodiment of the present application;
[0055] FIG6 is another example diagram of communication interaction provided in an embodiment of the present application;
[0056] FIG7 is a schematic structural diagram of a communication device provided in an embodiment of the present application;
[0057] FIG8 is a schematic structural diagram of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and beneficial effects of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0059] In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this application is merely a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of this application, “at least one” means one or more items, and “multiple items” means two or more items. In the description of this application, words such as “first” and “second” are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0060] The embodiments of the present application can be applied to various communication systems, such as: global system for mobile communications (GSM) system, code division multiple access (CDMA) system, wideband code division multiple access (WCDMA) system, general packet radio service (GPRS), long term evolution (LTE) system, LTE frequency division duplex (FDD) system, LTE time division duplex (TDD) system, universal mobile telecommunication system (UMTS), world-wide interoperability for microwave access (WIMAX) communication system, fifth generation (5G) system, sixth generation (6G) mobile communication system or new radio (NR), or applied to future communication systems or other similar communication systems. In addition, the embodiments of the present application can also be applied to many fields such as mobile edge computing, network-computing integration and intelligent Internet of Things.
[0061] For example, FIG1 is a schematic diagram of the architecture of a communication system applicable to an embodiment of the present application. The architecture of the communication system shown in FIG1 may include a central server (or central server) and client devices corresponding to N users. Among them, FIG1 only shows the client devices corresponding to some users, such as user 1, user 2, ..., and the client device corresponding to user k, k≤N, k is a positive integer, and N is a positive integer. Each client device stores its own local data. Among them, the central server can be an access network device, and the client device can be a terminal device.
[0062] Terminal devices can be user equipment (UE), mobile stations, mobile terminals, etc. Terminal devices can be widely used in various scenarios, such as device-to-device (D2D), vehicle-to-everything (V2X) communication, machine-type communication (MTC), the Internet of Things (IoT), virtual reality, augmented reality, industrial control, autonomous driving, telemedicine, smart grids, smart furniture, smart offices, smart wearables, smart transportation, and smart cities. Terminal devices can be mobile phones, tablets, computers with wireless transceiver capabilities, wearable devices, vehicles, urban air vehicles (such as drones and helicopters), ships, robots, robotic arms, smart home devices, etc.
[0063] The access network device may be a radio access network (RAN) device. For example: a base station, an evolved NodeB (eNodeB), a transmission reception point (TRP), a next generation NodeB (gNB) in a 5G mobile communication system, a next generation base station in a sixth generation (6G) mobile communication system, a base station in a future mobile communication system, or an access node in a wireless fidelity (WiFi) system, etc.; it may also be a module or unit that performs part of the functions of a base station, for example, a centralized unit (CU) or a distributed unit (DU). The radio access network device may be a macro base station, a micro base station or an indoor station, a relay node or a donor node, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the radio access network device.
[0064] Access network equipment and terminal devices can be fixed or mobile. They can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; on water; or in the air on aircraft, balloons, and satellites. The embodiments of this application do not limit the application scenarios of access network equipment and terminal devices.
[0065] The following is an explanation of the basic technical concepts involved in this application:
[0066] 1. Initial model: The model sent by the central server to at least one client device in any round of model training.
[0067] 2. Local model: The model generated by the client device in any round of model training based on the initial model and the training data stored locally.
[0068] 3. Model aggregation: technology for aggregating multiple local models.
[0069] 4. Global model: The model obtained by the central server aggregating the local models from multiple client devices in the last round of model training.
[0070] Based on the aforementioned concepts, the following is an illustrative description of any round of model training (cycle) in federated learning.
[0071] As shown in Figure 1, the central server can select k client devices corresponding to k users from the client devices corresponding to N users to participate in this federated learning; the central server can send an initial model to at least one (for example, k) client devices. Each client device generates a local model based on the training data stored locally and the initial model. At least one (for example, less than or equal to k) client device sends the generated local model to the central server. The central server aggregates the local models of at least one client device in a (weighted) averaging manner to generate the initial model required for the next round of training or generate a global model (i.e., the model generated in the last round of training).
[0072] To improve the efficiency of federated learning, an embodiment of the present application provides a communication method. This communication method can be implemented in the communication system shown in Figure 1 . The communication method involves a first device and at least one second device. The first device can be the central server shown in Figure 1 , and the second device can be any one of the k client devices shown in Figure 1 .
[0073] The following describes the communication method provided by the embodiment of the present application in conjunction with the accompanying drawings. FIG2 shows a communication method provided by the embodiment of the present application, which may include the following steps:
[0074] S201: During the federated learning process, the first device determines network status parameters for the first cycle. The network status parameters are determined based on the reception and / or processing of data packets during the first cycle. In this application, step S201 may also be referred to as the network status monitoring phase. Thus, the network status parameters determined by the first device based on its reception and / or processing of data packets can reflect the network status during the first cycle.
[0075] It should be understood that the length of a cycle in this application is determined based on any method that can segment the federated learning process, and this application does not impose any restrictions on the length of a cycle. For example, a cycle may include only one round of model training, a cycle may include multiple rounds of model training, or a cycle may include any predetermined time period.
[0076] Optionally, the network status parameters include at least one of the following: average waiting time, average queue length, average service time, business intensity or service time variance coefficient; wherein, the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packet in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one second device; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio between the average service time and the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packets in the first period and the average service time. The aforementioned data packets in the first period may include one or more data packets, which is not limited in this application.
[0077] S202: The first device sends a preset probability value to the second device; the preset probability value is determined based on network status parameters, and the preset probability value is used to determine a probability value for the second device to upload a local model in any one round of model training within a second cycle, where the second cycle is the cycle following the first cycle. In this way, the first device can determine the preset probability value corresponding to the second cycle based on the network status parameters of the first cycle, and send the preset probability value to the second device, so that the second device can determine whether to upload the local model corresponding to any one round of model training based on the preset probability value.
[0078] In one possible design, the first device may calculate a preset probability value based on the average waiting time, the service intensity, the average service time, and the service time variance. For example, the first device may calculate the preset probability value using the following method 1 or method 2.
[0079] Method 1: The average waiting time, business intensity, average service time, service time variance, and preset probability value satisfy the following formula:
[0080] in, It is used to represent the average waiting time, ρ is used to represent the business intensity, h is used to represent the average service time, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0081] Optionally, the first device may set an expected waiting time based on the average waiting time. It should be understood that the expected waiting time may be the expected average value of the time difference between the time when the data packet is received and the time when processing begins within the second period, set by the first device based on the average waiting time of the first period. Based on this, the first device may also calculate the preset probability value using the following method 2.
[0082] Method 2: The expected waiting time, business intensity, average service time, service time variance, and preset probability value satisfy the following formula:
[0083] in, It is used to represent the expected waiting time, ρ is used to represent the service intensity, h is used to represent the average service time, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0084] In another possible design, the first device may calculate the preset probability value based on the average queue length, service intensity, and service time variance. For example, the first device may calculate the preset probability value using the following methods 3 and 4.
[0085] Method 3: The average queue length, service intensity, service time variance, and the preset probability value satisfy the following formula:
[0086] in, It is used to represent the average queue length, ρ is used to represent the service intensity, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0087] Optionally, the first device may set an expected queue length based on the average queue length. It should be understood that the expected queue length may be the expected average value of the total amount of data packets corresponding to at least one second device during the second period, set by the first device based on the average queue length of the first period. Based on this, the first device may further calculate a preset probability value using the following method 4.
[0088] Method 4: The expected queue length, service intensity, service time variance, and the preset probability value satisfy the following formula:
[0089] in, It is used to represent the expected queue length, ρ is used to represent the service intensity, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0090] It should be noted that the first device can repeatedly execute S202 to send the aforementioned preset probability value to multiple different second devices. Based on this, in any round of model training within the second cycle, multiple second devices can each determine whether to upload the local model corresponding to that round of model training based on the preset probability value; that is, in the same round of model training, only some of the multiple second devices may upload the local model corresponding to that round of model training, thereby reducing (or optimizing) the number of second devices that upload local models in that round of model training and improving the efficiency of federated learning.
[0091] S203: The second device determines, based on a preset probability value, a first probability value for uploading the local model during a first round of model training, where the first round of model training is any one of at least one round of model training within the second period. The first probability value is used to determine whether the second device needs to upload the local model corresponding to the first round of model training.
[0092] Optionally, before executing S203, the second device may also perform some necessary operations for the first round of model training, which is not limited in this application. For example, the second device may receive an initial model corresponding to the first round of model training from the first device, and generate a local model corresponding to the first round of model training based on the initial model and the training data stored locally.
[0093] In one possible design, the preset probability value is equal to the first probability value. In this application, the solution corresponding to the aforementioned design is also referred to as a central unified management solution. Among them, central unified management is an application scenario in which a precise probability value (within any period) is uniformly specified by a central server for adaptive use. In the central unified management solution, the second device directly uses the preset probability value from the first device as the probability value for uploading the local model corresponding to any round of model training in the second period, that is, the upload probability of the local model corresponding to each round of model training in the second period is the same. In other words, the first probability value and the preset probability value satisfy the following formula: p1=p
[0094] Here, p1 is used to represent a first probability value; and p is used to represent a preset probability value.
[0095] With this design, the second device directly uses the preset probability value from the first device as the probability value for uploading the local model corresponding to any round of model training in the second cycle. For the second device, the deployment is relatively simple and the computational load is very low. In addition, since the preset probability value is determined based on the network status of the first device in the previous cycle (i.e., the first cycle), the second device uploads the local model based on the preset probability value, that is, uploads the local model based on the network status of the previous cycle, which can improve the efficiency of federated learning.
[0096] In another possible design, the method by which the second device determines the first probability value may be: the second device determines the first probability value based on a preset probability value and a preset disturbance value. In this application, the solution corresponding to the aforementioned design is also referred to as a local personalized management solution. Local personalized management is an application scenario in which a central server specifies an allowable range of probability values within any cycle, and the client device personalizes the probability values in any round of model training based on this allowable range.
[0097] Optionally, the preset disturbance value can be understood as the preset disturbance value corresponding to the second period. In different periods, the value of the preset disturbance value may be the same or different, and this application does not limit it. In other words, the preset disturbance value can be applied to multiple periods of federated learning (including the second period), or it can be applied only to any one period (for example, the second period).
[0098] Optionally, the second device may determine the aforementioned preset disturbance value by including but not limited to the following method A or method B.
[0099] Mode A: The first device may send a preset disturbance value to the second device; correspondingly, the second device may receive the preset disturbance value from the first device.
[0100] Mode B: The first device and the second device may pre-agree on a preset disturbance value for any period.
[0101] In some examples, the second device may add the preset probability value to the preset disturbance value to obtain the first probability value. That is, the first probability value, the preset probability value, and the preset disturbance value satisfy the following formula: p1 = p + p′
[0102] Among them, p1 is used to represent the first probability value; p is used to represent the preset probability value; and p′ is used to represent the preset disturbance value.
[0103] In other examples, the second device may determine a probability interval (i.e., an allowable range of probability values) based on a preset probability value and a preset disturbance value; the second device may also determine the first probability value based on the probability interval. In this example, during the second cycle, when the second device first determines the probability interval (e.g., during the first round of model training), the second device may also store the probability interval, thereby reducing the computational cost of the second device in subsequent rounds of model training during the second cycle and improving the efficiency of federated learning.
[0104] For example, the first probability value may be determined based on a preset formula and the aforementioned probability interval. For example, the probability interval may be represented by a maximum probability value and a minimum probability value, and the aforementioned preset formula may be: p1=m1+g|m1-m2|
[0105] Among them, p1 is used to represent the first probability value; m1 is used to represent the minimum probability value; m2 is used to represent the maximum probability value; and g is used to represent a preset value greater than 0 and less than or equal to 1.
[0106] For another example, the first probability value may fall within the aforementioned probability interval; in this case, the first device indicates the permissible range of probability values within the second period (i.e., the probability interval) by using a preset probability value and a preset perturbation value, and the second device performs personalized fine-tuning on the probability value (e.g., the first probability value) of any round of model training within the probability interval. The relationship between the first probability value and the probability interval may include, but is not limited to, the following cases 1, 2, or 3.
[0107] Case 1: When the weight value of the training data in the first round of model training is greater than or equal to the weight threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the weight value of the training data in the first round of model training is less than the weight threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
[0108] Case 2: When the amount of training data in the first round of model training is greater than or equal to the data amount threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the amount of training data in the first round of model training is less than the data amount threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
[0109] Case 3: When the relative entropy between the training data in the first round of model training and the training data in the third round of model training is greater than or equal to the relative entropy threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the relative entropy is less than the relative entropy threshold, the first probability value is less than the preset probability value and belongs to the probability interval; wherein, the third round of model training is the previous round of model training.
[0110] It should be noted that in the embodiments of the present application, relative entropy may also be referred to as Kullback-Leibler (KL) divergence (also known as KL divergence or KLD). The calculation method of relative entropy can refer to the traditional technology in this field, which will not be expanded in this application.
[0111] By adopting such a design (e.g., any one of Cases 1 to 3), the second device can select the first probability value based on the probability interval in combination with the local training situation (e.g., weight value, data volume, and relative entropy), thereby improving the efficiency of federated learning. In addition, since the probability interval is determined based on the preset probability value and the preset disturbance value, and the preset probability value is determined based on the network status of the first device in the previous cycle (i.e., the first cycle), the second device selects the first probability value based on the probability interval, that is, uploads the local model based on the network status of the previous cycle, which can improve the efficiency of federated learning.
[0112] In some examples, S203 may be replaced by the following steps: the first device may send a probability interval to the second device; and the second device may determine, based on the probability interval, a first probability value for uploading the local model on the second device during the first round of model training. Alternatively, the relationship between the first probability value and the probability interval may refer to the aforementioned designs (e.g., Case 1, Case 2, or Case 3), and similarities are not repeated here.
[0113] S204: The second device sends the local model corresponding to the first round of model training to the first device based on the first probability value; correspondingly, the first device receives the local model corresponding to the first round of model training from the second device.
[0114] In one possible design, when the second device determines that the random number is less than or equal to a first probability value, the second device sends the local model to the first device; the random number is generated in the first round of model training and is greater than 0 and less than or equal to 1. Conversely, when the second device determines that the random number is greater than the first probability value, the second device does not need to send the local model to the first device; meanwhile, the first and second devices can continue to perform the next round of federated training.
[0115] Optionally, when performing the first round of model training, the second device may also generate the aforementioned random number.
[0116] Optionally, after executing S204, when the first device receives a local model reported by at least one second device, the first device may aggregate the models to generate a model required for the next round of training or generate a global model.
[0117] Using the aforementioned communication method of S201 to S204, in any round of model training in the second cycle, the first device sends a preset probability value to the second device, so that the second device can determine the probability value of uploading the local model in any round of model training based on the aforementioned preset probability value; in this way, the number of second devices uploading local models can be controlled based on the preset probability value, and the preset probability value is determined according to the network status parameters of the first cycle. In this way, the number of second devices uploading local models can be adjusted (for example, reduced) in real time in combination with the network status, thereby adjusting (for example, reducing) the time of this round of model training and improving the efficiency of federated learning.
[0118] Optionally, after executing S204, the first device and the second device may further execute the following S205 and S206.
[0119] S205: The second device may further determine, based on a preset probability value, a second probability value for uploading the local model in a second round of model training. The second round of model training is any round of model training in at least one round of model training within the second period, and the second round of model training is different from the first round of model training. The second probability value may be denoted by p2.
[0120] It should be understood that the method for determining the second probability value in S205 may refer to the method for determining the first probability value in S203, and similarities are not repeated here.
[0121] S206: The second device sends the local model corresponding to the second round of model training to the first device based on the second probability value; accordingly, the first device receives the local model corresponding to the second round of model training within the second counting period from the second device.
[0122] It should be understood that the method in which the second device sends the local model corresponding to the second round of model training in S206 can refer to the method in which the second device sends the local model corresponding to the first round of model training in the aforementioned S204, and the similarities are not repeated here.
[0123] Using the method shown in S201 to S206 above, in the multiple rounds of model training in the second cycle, in addition to determining the first probability value corresponding to the first round of model training based on the preset probability value, the second device can also determine the second probability value corresponding to the second round of model training based on the preset probability value. The first probability value and the second probability value can be different, which can improve the flexibility of the probability value of uploading the local model in each round of model training in multiple rounds of model training. In addition, the first device does not limit the probability value of any second device uploading the local model in each round of model training, that is, it can be understood that there is no limit on the number of second devices that upload the local model in each round of model training. At least one second device can determine the probability value of any round of model training based on the local training situation, thereby improving the efficiency of federated learning.
[0124] Based on the same concept, referring to the communication method shown in S201 to S206 above, assuming that the length of each cycle only includes one round of model training, the embodiments of the present application also provide the following two possible communication method embodiments.
[0125] Example 1:
[0126] FIG3 is an example diagram of a communication method provided in an embodiment of the present application. As shown in FIG3 , the communication method includes the following steps:
[0127] Step 1 (Initialization): In the first round of model training, the central server determines the initial model for the first round of model training.
[0128] Step 2: Assuming this is the first round of model training, the central server can determine the preset probability value for the first round of model training. If this is not the first round of model training, the central server can detect the network status during the previous round of model training and determine the preset probability value for the current round of model training based on the network status. In other words, the central server can perform the "detect network status" operation shown in Figure 4 to dynamically adjust the preset probability value for the current round of model training.
[0129] Optionally, based on the initial model in step 1 and the preset probability value in step 2, the central server may perform a “global setting” operation as shown in FIG4 .
[0130] Optionally, if this round of model training is not the first round of model training, the central server may also use the model obtained by aggregating the previous round of model training as the initial model for this round of model training. Furthermore, the central server may also send the initial model to at least one client device.
[0131] In one possible design, the operations in step 2 may specifically include:
[0132] Step 2-1: During the previous round of model training, the central server records the reception and / or processing of data packets. For example, the central server records the arrival interval between any two adjacent data packets, the service time and waiting time of each data packet, and the total data volume of the data packets corresponding to each client device.
[0133] Step 2-2: The central server determines the network status parameters based on the information recorded in step 2-1 (eg, average waiting time, average queue length). The calculation method of the network status parameters can refer to the above S201 and will not be repeated here.
[0134] Step 2-3: The central server determines and sets the expected information (eg, expected waiting time, expected queue length) based on the aforementioned network status parameters. It should be noted that the actions in step 2-3 are optional.
[0135] Step 2-4: The central server calculates the preset probability value for this round of model training according to a pre-configured formula (eg, method 1, method 2, method 3, or method 4). The calculation method of the preset probability value can refer to the above-mentioned S202.
[0136] Step 3: The central server sends the aforementioned preset probability value to at least one client device (ie, the central server distributes the global setting, as shown in FIG4 ).
[0137] Optionally, based on the initial model in step 1 and the preset probability value in step 3, at least one client device may perform a “local setting” operation as shown in FIG. 4 .
[0138] Furthermore, after executing step 3, at least one client device can determine a local model based on the initial model of this round of model training and the locally stored training data; that is, at least one client device can perform the "local training" operation shown in Figure 4.
[0139] Step 4: At least one client device may upload the local model corresponding to the current round of model training to the central server based on the preset probability value. In the first embodiment, the method for the client device to determine the probability value for the current round of model training can refer to the method for the second device to determine the first probability value described above. In other words, at least one client device may perform the "model sampling" operation shown in Figure 4. Step 4 can refer to S203 and S204 described above.
[0140] Optionally, at least one client device may also selectively upload a local model according to the results of model sampling; that is, at least one client device may also perform the "selective upload" operation shown in FIG. 4 according to the results of model sampling.
[0141] For example, assuming that at least one client device includes client 1, client 2, client 3, and client 4, and assuming a preset probability value of 0.5, the following situations may exist for the at least one client device:
[0142] Client 1 generates a random number 0.2. At this time, the random number (0.2) is less than the preset probability value (0.5). Client 1 uploads the local model corresponding to this round of model training;
[0143] Client 2 generates a random number 0.8. At this time, the random number (0.8) is greater than the preset probability value (0.5). Client 2 does not upload the local model corresponding to this round of model training;
[0144] Client 3 generates a random number 0.7. At this time, the random number (0.7) is greater than the preset probability value (0.5). Client 3 does not upload the local model corresponding to this round of model training;
[0145] Client 4 generates a random number 0.1. At this time, the random number (0.1) is less than the preset probability value (0.5). Client 4 uploads the local model corresponding to this round of model training.
[0146] That is to say, among at least one client device, only 50% (0.5) of the client devices upload local models; in this way, the number of client devices that upload local models in this round of model training can be reduced, thereby improving the efficiency of federated learning.
[0147] Step 5: The central server performs model aggregation on the received local models to obtain model X. That is, the central server can perform the “model aggregation” operation shown in FIG4 .
[0148] Optionally, when this round of model training is the last round of model training, the model X is the global model; when this round of model training is not the last round of model training, the model X can be used as the initial model for the next round of model training.
[0149] Step 6: The central server may send the aforementioned model X to at least one client device. In other words, the central server may perform the “sending global model” operation as shown in FIG4 .
[0150] Optionally, after receiving model X, at least one client device may store the model X (the initial model for the next round of model training or the global model). It can also be understood that at least one client device may perform the "update local model" operation shown in FIG4 .
[0151] Step 7: The central server determines whether the federated learning task is complete. This determination can be based on conventional techniques in the field and is not limited in this application. If completed, the process ends; if not, the process jumps to step 2 and continues with the next round of model training, thus completing the iterative cycle.
[0152] Optionally, the method for the central server to determine whether the federated learning task is completed may be: when the characteristics of model X (such as convergence) meet the preset conditions, the central server determines that the federated learning task is completed; otherwise, the central server determines that the federated learning task is not completed.
[0153] In traditional federated learning methods, the reporting decision of the local model depends on the local information of the client device (such as local data distribution, device status, etc.), and it is impossible to perform system-level monitoring of federated learning tasks.
[0154] By adopting the method shown in Example 1 (central unified management solution), the reporting probability of the local model can be adjusted in real time (adaptively) based on the network status (such as the average waiting time of data packets, the average queue length, etc.), that is, the reporting probability can be determined in combination with the overall network status, and system-level monitoring of federated learning tasks can be achieved, which can improve the efficiency of federated learning. The deployment method is simple and effective, the algorithm is robust (stable), and it can be applied to various federated architectures or model structures.
[0155] Example 2:
[0156] FIG5 is an example diagram of another communication method provided in an embodiment of the present application. As shown in FIG5 , the communication method includes the following steps:
[0157] The actions of step a (initialization) can refer to the aforementioned step 1.
[0158] Step b: Assuming this is the first round of model training, the central server can determine the probability interval for the first round of model training. If this is not the first round of model training, the central server can detect the network status during the previous round of model training and determine the probability interval for the current round of model training based on the network status. In other words, the central server can perform the "detect network status" operation shown in Figure 6 to dynamically adjust the probability interval for the current round of model training.
[0159] Optionally, based on the initial model in step a and the probability interval in step b, the central server may perform the “global setting” operation as shown in FIG6 .
[0160] Optionally, if this round of model training is not the first round of model training, the central server may also use the model obtained by aggregating the previous round of model training as the initial model for this round of model training. Furthermore, the central server may also send the initial model to at least one client device.
[0161] In one possible design, the operations in step b may specifically include:
[0162] The preset probability value is determined through steps b-1 to b-4; steps b-1 to b-4 can refer to the aforementioned steps 2-1 to 2-4.
[0163] Step b-5: The central server may determine a probability interval based on the preset probability value and the preset disturbance value. The calculation method of the probability interval may refer to any of the designs in the above S203.
[0164] Step c: The central server sends the aforementioned probability interval to at least one client device (ie, the central server distributes global settings, as shown in FIG6 ).
[0165] Optionally, based on the initial model in step a and the probability interval in step c, at least one client device may perform a “local setting” operation as shown in FIG6 .
[0166] Furthermore, after executing step c, at least one client device can determine a local model based on the initial model of this round of model training and the locally stored training data; that is, at least one client device can perform the "local training" operation shown in Figure 6.
[0167] Step d: At least one client device can select a probability value for this round of model training within a probability interval based on local training conditions (e.g., weight values, data volume, and relative entropy). In other words, at least one client device can perform the "personalized fine-tuning" operation shown in Figure 6.
[0168] Under the influence of distributed non-iid data, each client device contributes differently to global convergence. Therefore, the personalized fine-tuning method described above can quantify each client device's contribution to the global update, thereby assigning higher probability values to client devices that contribute significantly to global convergence and lower probability values to client devices that contribute less to global convergence or are detrimental to global convergence. The method for selecting the probability value can refer to any of the designs described in S203 (e.g., Case 1, Case 2, or Case 3).
[0169] Step e: Based on the probability values from this round of model training, at least one client device can upload the local model corresponding to this round of model training to the central server. In other words, at least one client device can perform the "model sampling" operation shown in Figure 6. The actions in step e can be referenced to step 4 above, and any repetitions are omitted here.
[0170] Optionally, at least one client device may also selectively upload a local model according to the results of model sampling; that is, at least one client device may also perform the "selective upload" operation shown in FIG6 according to the results of model sampling.
[0171] The actions of step f to step h can refer to the aforementioned steps 5 to step 7 and will not be repeated here.
[0172] Compared with the first embodiment, the differences of the second embodiment include: (1) on the central server side, the central server obtains not the preset probability value (precise value) by monitoring the network status, but the probability interval (allowable range) of the current round of model training; (2) on the local client device side, the client device needs to allocate computing resources for personalized fine-tuning of the probability value of the current round of model training based on the local training situation.
[0173] The applicable scenarios of Example 2 may include: the local computing resources of the client device are sufficient to withstand the computing load generated by the personalized fine-tuning algorithm; the current federated learning task is more sensitive to communication costs, and it is necessary to use as few communication rounds as possible to make the global model converge to stability; local heterogeneity is more serious, and the training results are greatly affected by factors such as non-iid data distribution and device performance differences. In this way, when the local computing power of the client device is sufficient, by introducing additional computing load on the client device side, the purpose of "computing for communication" is achieved, and adaptive personalized adjustment is achieved in combination with the local training situation, further reducing the number of communication cycles required for algorithm convergence. Among them, "computing for communication" can be understood as: reducing the waste of communication resources between the client device and the central server by occupying the computing resources of the client device.
[0174] Using the method shown in Example 2 (local personalized management solution), the central server can adjust the probability interval (allowable range) of the local model's reporting probability in real time based on network status, and the client device can fine-tune the local model's reporting probability based on local training conditions (such as local data distribution, device computing performance, local model update amplitude, etc.). In this way, the network status and local training conditions can be fully combined to improve the efficiency of federated learning.
[0175] In the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.
[0176] The method provided in the embodiment of the present application is introduced above in conjunction with the accompanying drawings. The communication device provided in the embodiment of the present application is introduced below in conjunction with the accompanying drawings.
[0177] Based on the same technical concept, this application also provides a communication device for implementing the communication method provided in the above embodiments. Referring to FIG. 7 , the communication device 700 includes a communication unit 701 and a processing unit 702 . The communication unit 701 is configured to receive and / or transmit data, etc., and the processing unit 702 is configured to implement the steps of the communication method shown in FIG. 2 .
[0178] In a possible example, when the communication device 700 is used to implement the function of the first device shown in Figure 2 above, the processing unit 702 is used to: determine the network status parameters of the first cycle during the federated learning process; the network status parameters are determined based on the reception and / or processing of data packets within the first cycle; the communication unit 701 is used to: send a preset probability value to the second device; the preset probability value is determined based on the network status parameters, and the preset probability value is used to determine the probability value of the second device uploading a local model in any round of model training of at least one round of model training within the second cycle, and the second cycle is the next cycle of the first cycle.
[0179] In one possible design, the network status parameters include at least one of the following: average waiting time, average queue length, average service time, business intensity or service time variance coefficient; wherein the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packet in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one second device; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio between the average service time and the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packet in the first period and the average service time.
[0180] In a possible design, the average waiting time, traffic intensity, average service time, service time variance, and a preset probability value satisfy the following formula:
[0181] in, It is used to represent the average waiting time, ρ is used to represent the business intensity, h is used to represent the average service time, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0182] In a possible design, the average queue length, traffic intensity, service time variance, and a preset probability value satisfy the following formula:
[0183] in, It is used to represent the average queue length, ρ is used to represent the service intensity, C is used to represent the service time variance, and p is used to represent the preset probability value.
[0184] In one possible design, the communication unit 701 is further used to: send a preset disturbance value to the second device; the preset disturbance value is used to determine the probability value of uploading the local model in any round of model training.
[0185] In one possible design, the communication unit 701 is also used to: receive a local model corresponding to a first round of model training from a second device; the local model corresponding to the first round of model training is a local model sent by the second device based on a first probability value; and / or, the communication unit 701 is also used to: receive a local model corresponding to a second round of model training from the second device; the local model corresponding to the second round of model training is a local model sent by the second device based on a second probability value; wherein the first round of model training is any round of model training of at least one round of model training, and the second round of model training is any round of model training of at least one round of model training; the first round of model training is different from the second round of model training; the first probability value is the probability value of the second device uploading the local model in the first round of model training, and the second probability value is the probability value of the second device uploading the local model in the second round of model training.
[0186] In a possible example, when the communication device 700 is used to implement the function of the second device shown in Figure 2 above, the communication unit 701 is used to: receive a preset probability value from the first device during the federated learning process; the preset probability value is determined based on the network status parameters of the first cycle, and the network status parameters are determined based on the reception and / or processing of data packets within the first cycle; the processing unit 702 is used to: determine, based on the preset probability value, the first probability value of the communication device 700 uploading the local model in the first round of model training; the first round of model training is any round of model training of at least one round of model training within the second cycle, and the second cycle is the next cycle of the first cycle; the processing unit 702 is also used to perform the following steps through the communication unit 701: send the local model corresponding to the first round of model training to the first device based on the first probability value.
[0187] In one possible design, the network status parameters include at least one of the following: average waiting time, average queue length, average service time, business intensity or service time variance coefficient; wherein the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packet in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one communication device 700; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio between the average service time and the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packet in the first period and the average service time.
[0188] In one possible design, the preset probability value is equal to the first probability value.
[0189] In a possible design, the processing unit 702 is specifically configured to determine a first probability value according to a preset probability value and a preset disturbance value.
[0190] In a possible design, the communication unit 701 is further used to: receive a preset disturbance value from the first device.
[0191] In a possible design, the processing unit 702 is specifically configured to: determine a probability interval according to a preset probability value and a preset disturbance value; and determine a first probability value according to the probability interval.
[0192] In one possible design, when the weight value of the training data in the first round of model training is greater than or equal to the weight threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the weight value of the training data in the first round of model training is less than the weight threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
[0193] In one possible design, when the amount of training data in the first round of model training is greater than or equal to the data amount threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the amount of training data in the first round of model training is less than the data amount threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
[0194] In one possible design, when the relative entropy between the training data in the first round of model training and the training data in the third round of model training is greater than or equal to a relative entropy threshold, the first probability value is greater than or equal to a preset probability value and belongs to a probability interval; when the relative entropy is less than the relative entropy threshold, the first probability value is less than the preset probability value and belongs to the probability interval; wherein the third round of model training is the previous round of model training.
[0195] In one possible design, the processing unit 702 is specifically used to: when it is determined that the random number is less than or equal to the first probability value, perform the following steps through the communication unit 701: send the local model to the first device; the random number is generated in the first round of model training, and the random number is greater than 0 and less than or equal to 1.
[0196] In one possible design, the processing unit 702 is also used to: determine, based on a preset probability value, a second probability value of the communication device 700 uploading the local model in the second round of model training; the second round of model training is any round of model training of at least one round of model training within the second period, and the second round of model training is different from the first round of model training; the processing unit 702 is also used to perform the following steps through the communication unit 701: based on the second probability value, send the local model corresponding to the second round of model training to the first device.
[0197] Based on the same technical concept, an embodiment of the present application also provides another communication device 800, which can implement the communication method provided in the above embodiment. Referring to Figure 8, the communication device 800 includes at least one processor 801. Optionally, the communication device 800 also includes a memory 802 and / or a communication interface 803. The memory can be placed inside the communication device or outside the communication device, which is not limited in this application. Among them, the communication interface 803, the processor 801 and the memory 802 are interconnected. Exemplarily, the communication device 800 can be the first device or the second device shown in the embodiment of the present application.
[0198] Optionally, the communication interface 803, the processor 801, and the memory 802 are interconnected via a bus 804. The bus 804 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, FIG8 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0199] The communication interface 803 is used to receive and / or send data, signals or information, etc., to achieve communication with other devices other than the communication device.
[0200] The processor 801 can implement the functions of the aforementioned first device or second device. For details, please refer to the description in the above embodiments and will not be repeated here. Among them, the processor 801 can be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP, etc. The processor 801 can further include a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. When implementing the above-mentioned functions, the processor 801 can be implemented through hardware, and of course, it can also execute the corresponding software implementation through hardware.
[0201] The memory 802 is used to store program instructions, etc. Specifically, the program instructions may include program code, which includes computer operating instructions. The memory 802 may include random access memory (RAM) or non-volatile memory (non-volatile memory), such as at least one disk storage device. The processor 801 executes the program instructions stored in the memory 802 to implement the above functions, thereby implementing the methods provided in the above embodiments.
[0202] Based on the same technical concept, an embodiment of the present application further provides a computer program product, which stores instructions. When the instructions are called by a computer, the computer executes the method provided in the above embodiment.
[0203] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes the method provided in the above embodiment.
[0204] The storage medium may be any available medium that can be accessed by a computer. By way of example and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.
[0205] Based on the same technical concept, an embodiment of the present application further provides a chip, which is used to read a computer program stored in a memory to implement the method provided in the above embodiment.
[0206] Based on the same technical concept, an embodiment of the present application also provides a chip system, which includes a processor for supporting a computer device to execute the method provided in the above embodiment. In one possible design, the chip system also includes a memory for storing the necessary programs and data for the computer device. The chip system can be composed of a chip or can include a chip and other discrete devices.
[0207] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0208] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more flow charts and / or one or more boxes in the block diagram.
[0209] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0211] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A communication method, applied to a first device, characterized in that: The method comprises: During the federated learning process, determining a network state parameter for a first period; the network state parameter is determined based on receiving and / or processing data packets in the first period; Send a preset probability value to the second device; the preset probability value is determined based on the network status parameter, and the preset probability value is used to determine the probability value of the second device uploading the local model in any round of model training of at least one round of model training within the second cycle, and the second cycle is the next cycle of the first cycle.
2. The method according to claim 1, wherein The network status parameter includes at least one of the following: average waiting time, average queue length, average service time, traffic intensity or service time variance coefficient; Among them, the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packets in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one second device; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio of the average service time to the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packets in the first period and the average service time.
3. The method according to claim 2, wherein The average waiting time, the service intensity, the average service time, the service time variance, and the preset probability value satisfy the following formula: in, is used to represent the average waiting time, ρ is used to represent the service intensity, h is used to represent the average service time, C is used to represent the service time variance, and p is used to represent the preset probability value.
4. The method according to claim 2, wherein The average queue length, the service intensity, the service time variance, and the preset probability value satisfy the following formula: in, is used to represent the average queue length, ρ is used to represent the service intensity, C is used to represent the service time variance, and p is used to represent the preset probability value.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: A preset disturbance value is sent to the second device; the preset disturbance value is used to determine the probability value of uploading the local model in any round of model training.
6. The method according to any one of claims 1 to 5, wherein: The method further comprises: Receiving a local model corresponding to a first round of model training from the second device; the local model corresponding to the first round of model training is a local model sent by the second device based on a first probability value; and / or, Receiving a local model corresponding to the second round of model training from the second device; the local model corresponding to the second round of model training is the local model sent by the second device based on the second probability value; Among them, the first round of model training is any round of model training of the at least one round of model training, and the second round of model training is any round of model training of the at least one round of model training; the first round of model training is different from the second round of model training; the first probability value is the probability value of the second device uploading the local model in the first round of model training, and the second probability value is the probability value of the second device uploading the local model in the second round of model training.
7. A communication method, applied to a second device, characterized in that: The method comprises: During the federated learning process, a preset probability value is received from the first device; the preset probability value is determined based on a network state parameter of a first period, and the network state parameter is determined based on receiving and / or processing a data packet in the first period; Determining, based on the preset probability value, a first probability value that the second device uploads the local model in a first round of model training; the first round of model training is any round of model training of at least one round of model training within a second period, and the second period is a period subsequent to the first period; According to the first probability value, the local model corresponding to the first round of model training is sent to the first device.
8. The method according to claim 7, wherein The network status parameter includes at least one of the following: average waiting time, average queue length, average service time, traffic intensity or service time variance coefficient; Among them, the average waiting time is the average value of the time difference between the reception time and the start processing time of the data packets in the first period; the average queue length is the average value of the total data volume of the data packets corresponding to at least one second device; the average service time is the average value of the service time of the data packets in the first period, and the service time of any data packet is the time difference between the start processing time and the end processing time of any data packet; the business intensity is the ratio of the average service time to the average arrival interval, and the average arrival interval is the average value of the time difference between the reception time of any two adjacent data packets in the first period; the service time variance coefficient is the ratio between the standard deviation of the service time of the data packets in the first period and the average service time.
9. The method according to claim 7 or 8, wherein The preset probability value is equal to the first probability value.
10. The method according to claim 7 or 8, characterized in that The determining, according to the preset probability value, the first probability value of uploading the local model by the second device in the first round of model training includes: The first probability value is determined according to the preset probability value and the preset disturbance value.
11. The method according to claim 10, wherein The method further comprises: The preset disturbance value is received from the first device.
12. The method according to claim 10 or 11, wherein: The determining the first probability value according to the preset probability value and the preset disturbance value includes: Determining a probability interval according to the preset probability value and the preset disturbance value; The first probability value is determined according to the probability interval.
13. The method according to claim 12, wherein: When the weight value of the training data in the first round of model training is greater than or equal to the weight threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; When the weight value of the training data in the first round of model training is less than the weight threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
14. The method according to claim 12, wherein: When the amount of training data in the first round of model training is greater than or equal to a data amount threshold, the first probability value is greater than or equal to the preset probability value and falls within the probability interval; When the amount of training data in the first round of model training is less than the data amount threshold, the first probability value is less than the preset probability value and belongs to the probability interval.
15. The method according to claim 12, wherein When the relative entropy between the training data in the first round of model training and the training data in the third round of model training is greater than or equal to the relative entropy threshold, the first probability value is greater than or equal to the preset probability value and belongs to the probability interval; when the relative entropy is less than the relative entropy threshold, the first probability value is less than the preset probability value and belongs to the probability interval; wherein, the third round of model training is the previous round of model training of the first round of model training.
16. The method according to any one of claims 7 to 15, wherein: The sending, according to the first probability value, the local model corresponding to the first round of model training to the first device includes: When it is determined that the random number is less than or equal to the first probability value, the local model is sent to the first device; the random number is generated in the first round of model training, and the random number is greater than 0 and less than or equal to 1.
17. The method according to any one of claims 7 to 16, wherein: The method further comprises: Determining, based on the preset probability value, a second probability value of the second device uploading the local model in a second round of model training; the second round of model training is any round of model training of at least one round of model training within the second period, and the second round of model training is different from the first round of model training; According to the second probability value, the local model corresponding to the second round of model training is sent to the first device.
18. A communication device, characterized in that: include: a communication unit and a processing unit; The communication unit is used to receive and / or send data; The processing unit is configured to execute the method according to any one of claims 1 to 6.
19. A communication device, characterized in that: include: a communication unit and a processing unit; The communication unit is used to receive and / or send data; The processing unit is configured to execute the method according to any one of claims 7 to 17.
20. A communication device, characterized in that: include: at least one processor; The at least one processor is configured to execute the method according to any one of claims 1 to 6.
21. A communication device, characterized in that: include: at least one processor; The at least one processor is configured to execute the method according to any one of claims 7 to 17.
22. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when called by a computer, enable the computer to execute the method according to any one of claims 1 to 6.
23. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when called by a computer, enable the computer to execute the method according to any one of claims 7 to 17.
24. A computer program product, characterized in that The invention comprises instructions, which, when executed on a computer, cause the method according to any one of claims 1 to 6 to be performed.
25. A computer program product, characterized in that The invention comprises instructions, which, when executed on a computer, cause the method according to any one of claims 7 to 17 to be performed.
26. A chip system, characterized in that: Including processor; The processor is configured to execute a computer-executable program, so that a device equipped with the chip system is configured to execute the method according to any one of claims 1 to 6.
27. A chip system, characterized in that: Including processor; The processor is used to execute a computer-executable program, so that a device equipped with the chip system is used to execute the method according to any one of claims 7 to 17.
28. A communication system, characterized in that: comprising a first device and a second device; The first device is used to execute the method according to any one of claims 1 to 6; the second device is used to execute the method according to any one of claims 7 to 17.
Citation Information
Patent Citations
Lightweight federated learning method and system for spatio-temporal data heterogeneous scene
CN115775025A
Federal learning method, system and device and storage medium
CN116484922A
Distributed learning processes
WO2023217363A1