D2D-assisted wireless federated learning relay method and system

By introducing a D2D network as a relay in D2D-assisted wireless federated learning, the terminal measures the channel quality and uploads it to the base station. The base station calculates the minimum latency to determine the data upload scheme, which solves the problems of model training latency and aggregation bias caused by poor channel quality in cellular networks and improves model training efficiency.

CN119277472APending Publication Date: 2025-01-07ZHEJIANG UNIV CITY COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411371532.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In D2D-assisted wireless federated learning, how to design a reasonable relay-based model training algorithm to reduce model training latency and convergence bias, optimize spectrum resource allocation, and improve spectrum utilization efficiency, especially when the cellular network channel quality is poor.

Method used

By introducing a D2D network as a relay, the terminal measures the channel quality and uploads it to the base station. The base station calculates the minimum latency to determine the data upload scheme, including mode selection, relay node selection, and radio resource allocation. The terminal uploads local model parameters to the parameter server according to the scheme. The parameter server aggregates the parameters and broadcasts the global model.

Benefits of technology

It effectively reduces model training latency, improves model training efficiency, solves the problems of model convergence bias and huge training latency caused by poor channel quality in cellular networks, and makes full use of the short-distance transmission advantages of D2D networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277472A_ABST
    Figure CN119277472A_ABST
Patent Text Reader

Abstract

The invention discloses a D2D-assisted wireless federated learning relay method and system, the system comprises a base station and terminals, the base station and the terminals form a cellular network, the terminals form a D2D network, and the terminals measure channel quality information of the D2D network and the cellular network and upload the channel quality information to the base station before each round of training. The base station calculates a minimum time delay based on the channel quality information, determines a data uploading scheme of each terminal according to the minimum time delay or a preset strategy and issues the data uploading scheme to the terminal, and the data uploading scheme comprises mode selection, relay node selection and wireless resource allocation; the terminal uploads local model parameter data to the parameter server equipped on the base station based on the data uploading scheme, the parameter server aggregates the received model parameter data to obtain a global model and broadcasts the global model to each terminal through a cellular network, and a round of federated learning is completed, so that the training time delay of the model can be reduced, and the training efficiency is improved. And the model training efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of combining communication with edge computing, and specifically relates to a D2D-assisted wireless federated learning relay method and system. Background Art

[0002] D2D (Device-to-Device) communication is a direct communication method between mobile devices, which allows smartphones, tablets or other devices to exchange information directly without base stations or network infrastructure. This technology is of great significance in the field of wireless communications because it can increase data transmission rates, reduce network latency, and reduce dependence on central networks.

[0003] Wireless federated learning is a distributed machine learning technology that allows multiple devices or nodes to collaboratively train machine learning models while maintaining data privacy. In this learning mode, individual devices can process and analyze their own data locally, and then send updated model parameters or gradient information to a central server to update the global model. This approach helps protect user privacy because there is no need to directly upload raw data.

[0004] Applying D2D communication technology to wireless federated learning can further improve the efficiency of model interaction. In a wireless federated learning system, some terminals may have poor link quality to the base station due to factors such as long distance or obstruction, which may cause large transmission delays or even transmission interruptions, affecting the convergence rate and accuracy of the model. D2D-assisted wireless federated learning can alleviate this problem by utilizing short-range communication between devices. Some terminals can select other terminals to relay model parameters or gradients through D2D links to avoid large delays or model deviations caused by sending directly to the base station.

[0005] In D2D-assisted wireless federated learning, how to design a reasonable relay-based model training algorithm is a key issue. Secondly, the system also needs to determine the working mode of the terminal based on the channel quality and spectrum resources of the D2D network and the cellular network: that is, whether to choose relay transmission or direct transmission over the cellular network. In addition, the spectrum resource allocation of the two networks needs to be optimized to improve spectrum utilization efficiency.

[0006] With the development of 5G and IoT technologies, D2D-assisted wireless federated learning has broad application prospects in smart cities, health monitoring, autonomous driving and other fields. For example, in smart cities, multiple sensors and monitoring devices can use D2D communication to exchange data and jointly train a model for traffic flow prediction or environmental monitoring. In the field of health monitoring, personal health devices can share anonymous health data through D2D communication to train a model for disease prediction and health management.

[0007] In summary, D2D-assisted wireless federated learning is an emerging technology that combines the advantages of D2D communication and federated learning, and it has great potential in improving data processing efficiency, protecting user privacy, and reducing communication costs. Summary of the invention

[0008] In view of the above, the purpose of the present invention is to provide a D2D-assisted wireless federated learning relay method and system, which utilizes the D2D network to assist in uploading local models, and by selecting appropriate transmission modes and relay nodes, can reduce the training delay of the model and improve the training efficiency of the model.

[0009] To achieve the above-mentioned purpose of the invention, an embodiment provides a D2D-assisted wireless federated learning relay method and system, including a base station and a terminal, the base station and the terminal form a cellular network, the terminal and the terminal form a D2D network, and the terminal in the D2D network serves as a relay node for another terminal.

[0010] The terminal is used to measure the channel quality information of the D2D network and the cellular network and upload the channel quality information to the base station before each round of training. The base station is used to calculate the minimum delay based on the channel quality information, determine the data upload scheme of each terminal according to the minimum delay or the preset strategy, and send it to the terminal, wherein the data upload scheme includes mode selection, relay node selection, and wireless resource allocation;

[0011] The terminal is also used to upload local model parameter data to a parameter server equipped with the base station based on a data upload scheme. The parameter server is also used to aggregate the received model parameter data to obtain a global model and broadcast the global model to each terminal through a cellular network, thereby completing a round of federated learning.

[0012] In a possible implementation manner, the D2D network and the cellular network both reuse system spectrum resources through Underlay or Overlay.

[0013] In a possible implementation, the mode selection included in the data upload solution includes:

[0014] Cellular link mode: The cellular link provided by the cellular network. In this case, the terminal needs to directly upload the local model parameter data to the parameter server through the cellular link;

[0015] Relay link mode: A relay link consisting of a D2D link provided by a D2D network and a cellular link provided by a cellular network. In this case, the terminal needs to upload the local model parameters to the parameter server through the relay link.

[0016] In one possible implementation, the terminal needs to upload the local model parameters to the parameter server through the relay link, including:

[0017] Direct forwarding strategy: The local model parameters must first be transmitted to the relay node through the D2D link. The relay node does not process the received local model parameters, and then directly uploads the received local model parameters to the parameter server through the cellular link;

[0018] Or model aggregation and forwarding strategy: the local model parameters must first be transmitted to the relay node through the D2D link. The relay node aggregates the received local model parameters with its own local model parameters to form new model parameters, and then directly uploads the new model parameters to the parameter server through the cellular link.

[0019] In one possible implementation, the parameter server and the relay node use a weighted average aggregation method to aggregate the model parameters, and the weight of each terminal is determined by the amount of local data of the terminal, specifically the ratio between the amount of data participating in the training of the terminal and the total amount of data of all terminals participating in federated learning.

[0020] In a possible implementation, the mode selection and relay node selection in the data upload solution are determined by the system single model training delay. When the system single model training delay is the lowest, the mode selection and relay node selection scheme are optimal. When the single model training delay T corresponding to the direct forwarding strategy is expressed as:

[0021]

[0022] Among them, a i,k represents the relay node selection of terminal i, a i,k =1 indicates that terminal i selects terminal k to forward local model parameters and satisfies represents the terminal set. When i=k, it indicates whether the cellular communication mode is selected. represents the latency of local computing, which is determined by the local computing capacity f i , the number of samples required to be calculated b, and the amount of calculation required by the model f O related, represents the communication delay, which consists of two parts: the D2D link delay from terminal i to terminal k and the cellular link delay from terminal k to the base station, which can be expressed as: and M represents the number of parameters of the model, and represents the time slot ratio allocation from terminal i to terminal k in the D2D link, and the time slot ratio allocation when terminal k relays the model parameters of terminal i through the cellular network, B D and B C represents the bandwidth occupied by the D2D network and the cellular network, and They represent the signal-to-noise ratio from terminal i to terminal k in the D2D link and the signal-to-noise ratio of terminal k in the cellular network respectively;

[0023] In a possible implementation, the single model training delay T corresponding to the model convergence forwarding strategy is expressed as:

[0024]

[0025] Minimize delay to find the solution This problem is a mixed nonlinear programming problem, and its suboptimal solution can be obtained through iterative optimization.

[0026] In a possible implementation, determining a data upload scheme for each terminal according to a preset strategy includes:

[0027] Terminal i compares its own cellular link signal-to-noise ratio The signal-to-noise ratio of the D2D link when terminal k is selected as the relay node and cellular link signal-to-noise ratio The harmonic mean of is taken as the relay link signal-to-noise ratio. When the cellular link signal-to-noise ratio is greater than the relay link signal-to-noise ratio, the cellular link mode is selected as the data upload scheme; otherwise, the relay link mode with terminal k as the relay node is selected as the data upload scheme, which is described by the formula:

[0028]

[0029] In a possible implementation, before performing local model training, the terminal also uploads local computing power and the amount of local data used for training the model.

[0030] To achieve the above-mentioned object of the invention, an embodiment of the present invention further provides a D2D-assisted wireless federated learning relay method, which adopts the above-mentioned system and includes the following steps:

[0031] The terminal measures the channel quality information of the D2D network and the cellular network and uploads the channel quality information to the base station before each round of training;

[0032] The base station calculates the minimum delay based on the channel quality information, determines the data upload scheme of each terminal according to the minimum delay or the preset strategy, and sends it to the terminal, wherein the data upload scheme includes mode selection, relay node selection, and wireless resource allocation;

[0033] The terminal uploads the local model parameter data to a parameter server equipped by the base station based on the data uploading scheme;

[0034] The parameter server aggregates the received model parameter data to obtain a global model and broadcasts the global model to each terminal through the cellular network, thus completing a round of federated learning.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] In the D2D-assisted wireless federated learning relay system and method provided by the present invention, D2D-assisted wireless federated learning can fully utilize the advantages of short-distance transmission of the D2D network according to the conditions of the D2D network and the cellular network, solve the problems of model convergence deviation and huge training delay caused by the local cellular network channel quality, and improve the model training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] Figure 1 is a structural diagram of a D2D-assisted wireless federated learning relay system provided in an embodiment;

[0039] Figure 2 It is a schematic diagram of interaction between a terminal and a base station in federated learning in a D2D-assisted wireless federated learning relay system provided in an embodiment;

[0040] Figure 3 is a flow chart of federated learning based on a direct forwarding strategy provided by an embodiment;

[0041] Figure 4 is a flow chart of federated learning based on a model convergence and forwarding strategy provided by an embodiment;

[0042] Figure 5 It is a flowchart of a D2D-assisted wireless federated learning relay method provided in an embodiment. DETAILED DESCRIPTION

[0043] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0044] The inventive concept of the present invention is: to solve the problem of model convergence deviation and huge training delay caused by the local cellular network channel quality, the embodiment of the present invention provides a D2D-assisted wireless federated learning relay solution, which introduces the D2D network according to the conditions of the D2D network and the cellular network, and fully utilizes the advantages of the short-distance transmission of the D2D network to perform optimal transmission of client model parameter data, reduce the training delay of the model, and improve the training efficiency of the model.

[0045] like Figure 1 As shown, the D2D-assisted wireless federated learning relay system provided in the embodiment includes two parts: a cellular network and a D2D network, wherein both the D2D network and the cellular network reuse system spectrum resources through Underlay or Overlay, and the cellular communication can be an existing mobile communication network, namely, LTE (Long-term Evolution) or a 5G network. In the cellular network, the base station is equipped with a parameter server, and all terminals can communicate with the base station and share uplink wireless channel resources. In the D2D network, terminals can establish D2D links with each other for communication. Most of the coverage of the D2D network overlaps with the base station, that is, the terminal has two types of communication: cellular communication and D2D communication, and the terminal can choose one of the communication modes for communication. Based on these two types of networks, the terminal completes the federated learning training of the neural network model together with the base station based on local training data.

[0046] Among them, the processor power of the edge server far exceeds the computing power of the local terminal, and has the ability to independently perform model training. The processor can be a general-purpose central processing unit (CPU), a graphics processing unit (GPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for executing the above-mentioned model training programs. The terminal can be a modern smart phone, tablet computer, notebook, self-driving car, or other mobile terminal that can support model training, equipped with a wireless communication system, and can access mainstream wireless communication networks such as mobile communication networks and WiFi.

[0047] In the embodiment, Figure 2As shown, before the model starts training, the terminal uploads the local computing power and the amount of data used to train the model. The terminal also measures the channel quality information (i.e., channel state information) of the D2D network and the cellular network and uploads the channel quality information to the base station before each round of training. After receiving the channel quality information, the base station calculates the minimum delay based on the channel quality information, determines the data upload plan for each terminal based on the minimum delay, and sends it to the terminal, where the data upload plan includes mode selection, relay node selection, and wireless resource allocation.

[0048] The terminal completes a local model update training based on the current local data and labels. After completing the local training, the local model parameter data is uploaded to the parameter server equipped with the base station based on the data upload solution. The parameter server aggregates the received model parameter data to obtain the global model and broadcasts the global model to each terminal through the cellular network. This completes a round of federated learning. After multiple rounds of training, the model convergence training ends, which can achieve efficient model training.

[0049] In an embodiment, the terminal is in a D2D network and a cellular network, and the data upload scheme determined for the terminal includes a cellular link mode and a relay link mode, wherein the relay link mode refers to a cellular link provided by a cellular network, and the terminal can directly upload the local model parameter data to the parameter server through the cellular link. The relay link mode refers to a relay link composed of a D2D link provided by a D2D network and a cellular link provided by a cellular network, and the terminal acts as a relay node for another terminal in the relay link. At this time, the terminal needs to upload the local model parameters to the parameter server through the relay link. When the channel quality of the terminal is relatively poor, the terminal can select other terminals for relay transmission.

[0050] In an embodiment, the relay link mode includes a direct forwarding strategy and a model aggregation forwarding strategy. When the direct forwarding strategy is selected, the local model parameters must first be transmitted to the relay node via the D2D link. The relay node does not process the received local model parameters, and then directly uploads the received local model parameters to the parameter server via the cellular link; when the model aggregation forwarding strategy is selected, the local model parameters must first be transmitted to the relay node via the D2D link. The relay node aggregates the received local model parameters with its own local model parameters to form new model parameters, and then directly uploads the new model parameters to the parameter server via the cellular link.

[0051] The link mode and data forwarding strategy used by the terminal to upload model parameter data are obtained by executing the optimization algorithm of the base station. When the direct forwarding strategy is adopted, if the terminal receives relay information from other terminals, it will be directly uploaded to the base station through the cellular link. Therefore, it is an asynchronous relay process, and there is no need to wait for the local calculation to be completed before transmission. At this time, the delay T of a single round of model training can be expressed as:

[0052]

[0053] Among them, a i,k represents the relay node selection of terminal i, a i,k =1 indicates that terminal i selects terminal k to forward local model parameters and satisfies represents the terminal set. When i=k, it indicates whether the cellular communication mode is selected. represents the latency of local computing, which is determined by the local computing capacity f i , the number of samples required to be calculated b, and the amount of calculation required by the model f O related, represents the communication delay, which consists of two parts: the D2D link delay from terminal i to terminal k and the cellular link delay from terminal k to the base station, which can be expressed as: and M represents the number of parameters of the model, and represents the time slot ratio allocation from terminal i to terminal k in the D2D link, and the time slot ratio allocation when terminal k relays the model parameters of terminal i through the cellular network, B D and B C represents the bandwidth occupied by the D2D network and the cellular network, and They represent the signal-to-noise ratio from terminal i to terminal k in the D2D link and the signal-to-noise ratio of terminal k in the cellular network respectively;

[0054] By solving the minimum delay T, that is, The selection of relay nodes and wireless resource allocation are obtained by solving the problem. This problem is a hybrid nonlinear programming problem, and its suboptimal solution can be obtained through iterative optimization.

[0055] Specifically, Figure 3 As shown in Figure 1, the model training process using the direct forwarding strategy is:

[0056] 301. The local terminal uses local data and labels to perform local modeling;

[0057] 302. The terminal transmits model parameters according to the results of the mode selection and the relay selection;

[0058] 303. Determine whether to select cellular communication mode transmission;

[0059] 304. If the transmission is in cellular communication mode, the terminal directly uploads the local model parameters to the base station according to the wireless resource allocation result;

[0060] 305. If the transmission is in D2D mode, the terminal uploads the local model parameters to the relay node via the D2D network;

[0061] 306. After receiving the model parameters, the relay node directly forwards them to the base station through the cellular network;

[0062] 307. After receiving all local model parameters, the base station averages and aggregates them to obtain a global model.

[0063] 308. Broadcast the global model to each terminal via the cellular network to complete a round of model training.

[0064] When the model aggregation and forwarding strategy is adopted, if the terminal receives relay information from other terminals, it will first aggregate the local model and then upload it to the base station. Therefore, it is a synchronous relay process, which needs to wait for the local calculation to be completed before transmission. At this time, the delay T of a single round of model training can be expressed as:

[0065]

[0066] By solving the minimum delay T, that is, The selection of relay nodes and wireless resource allocation are obtained by solving the problem. This problem is a hybrid nonlinear programming problem, and its suboptimal solution can be obtained through iterative optimization.

[0067] Specifically, Figure 4 As shown in the figure, the model training process using the model convergence forwarding strategy is:

[0068] 401. The local terminal uses local data and labels to perform local modeling;

[0069] 402. The terminal transmits model parameters according to the results of the mode selection and the relay selection;

[0070] 403. Determine whether to select cellular communication mode transmission;

[0071] 404. If the transmission is in cellular communication mode, the terminal directly uploads the local model parameters to the base station according to the wireless resource allocation result;

[0072] 405. The terminal uploads the local model parameters to the relay node via the D2D network;

[0073] 406. After receiving the model parameters, the relay node performs a local model aggregation, and then uploads it to the base station via the cellular network;

[0074] 407. After receiving all local model parameters, the base station averages and aggregates them to obtain a global model.

[0075] 408. Broadcast the global model to each terminal via the cellular network to complete a round of model training.

[0076] In the embodiment, the data upload scheme of each terminal can also be determined according to the preset strategy. Terminal i compares its own cellular link signal-to-noise ratio The signal-to-noise ratio of the D2D link when terminal k is selected as the relay node and cellular link signal-to-noise ratio The harmonic mean of is used as the relay link signal-to-noise ratio of. When the cellular link signal-to-noise ratio of the cellular link is greater than the relay link signal-to-noise ratio, the cellular link mode is selected as the data upload scheme; otherwise, the relay link mode with terminal k as the relay node is selected as the data upload scheme, which is expressed by the formula:

[0077]

[0078] In an embodiment, the parameter server and the relay node adopt a weighted average aggregation method when aggregating model parameters, and the weight of each terminal is determined by the amount of local data of the terminal, specifically, the ratio between the amount of data participating in the training of the terminal and the total amount of data of all terminals participating in federated learning.

[0079] like Figure 5 As shown, the embodiment further provides a D2D-assisted wireless federated learning relay method, the characteristic value of which is that the method adopts the above system and includes the following steps:

[0080] S1, the terminal measures the channel quality information of the D2D network and the cellular network and uploads the channel quality information to the base station before each round of training;

[0081] S2, the base station calculates the minimum delay based on the channel quality information, determines the data upload scheme of each terminal according to the minimum delay or the preset strategy, and sends it to the terminal, wherein the data upload scheme includes mode selection, relay node selection, and wireless resource allocation;

[0082] S3, the terminal uploads the local model parameter data to the parameter server equipped with the base station based on the data upload solution;

[0083] S4, the parameter server aggregates the received model parameter data to obtain a global model and broadcasts the global model to each terminal through the cellular network, thus completing a round of federated learning.

[0084] The D2D-assisted wireless federated learning relay solution provided in the above embodiment coexists with the cellular network in the wireless federated learning scenario. The terminal uses the D2D network for relaying to complete the training of the network model with the base station equipped with a parameter server. The terminal can upload local model parameters by using the asynchronous relay method of direct forwarding or the synchronous relay method of model convergence forwarding. The base station obtains the terminal's mode selection, relay node selection, and wireless resource allocation solutions by minimizing the delay. The terminal can also obtain the transmission solution by using a pure strategy method that compares the channel quality of the local cellular communication link and the relay equivalent link. This can reduce the model training delay, improve the reliability of model transmission, and solve the problem of large delay and model convergence deviation caused by poor channel quality in the local terminal.

[0085] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A D2D-assisted wireless federated learning relay system, characterized in that: It includes base stations and terminals, wherein the base stations and terminals form a cellular network, and the terminals form a D2D network. The terminals in the D2D network act as relay nodes for another terminal. The terminal is used to measure the channel quality information of the D2D network and the cellular network and upload the channel quality information to the base station before each round of training. The base station is used to calculate the minimum delay based on the channel quality information, determine the data upload scheme of each terminal according to the minimum delay or the preset strategy, and send it to the terminal, wherein the data upload scheme includes mode selection, relay node selection, and wireless resource allocation; The terminal is also used to upload local model parameter data to a parameter server equipped with the base station based on a data upload scheme. The parameter server is also used to aggregate the received model parameter data to obtain a global model and broadcast the global model to each terminal through a cellular network, thereby completing a round of federated learning.

2. The D2D-assisted wireless federated learning relay system according to claim 1, characterized in that: The D2D network and the cellular network both reuse system spectrum resources through Underlay or Overlay.

3. The D2D-assisted wireless federated learning relay system according to claim 1, characterized in that: The data upload scheme includes the following mode selections: Cellular link mode: The cellular link provided by the cellular network. In this case, the terminal needs to directly upload the local model parameter data to the parameter server through the cellular link; Relay link mode: A relay link consisting of a D2D link provided by a D2D network and a cellular link provided by a cellular network. In this case, the terminal needs to upload the local model parameters to the parameter server through the relay link.

4. The D2D-assisted wireless federated learning relay system according to claim 3, characterized in that: The terminal needs to upload the local model parameters to the parameter server through the relay link, including: Direct forwarding strategy: The local model parameters must first be transmitted to the relay node through the D2D link. The relay node does not process the received local model parameters, and then directly uploads the received local model parameters to the parameter server through the cellular link; Or model aggregation and forwarding strategy: the local model parameters must first be transmitted to the relay node through the D2D link. The relay node aggregates the received local model parameters with its own local model parameters to form new model parameters, and then directly uploads the new model parameters to the parameter server through the cellular link.

5. The D2D-assisted wireless federated learning relay system according to claim 1 or 4, characterized in that: The parameter server and relay nodes use weighted average aggregation to aggregate model parameters, and the weight of each terminal is determined by the amount of local data of the terminal, specifically the ratio between the amount of data participating in the training of the terminal and the total amount of data of all terminals participating in federated learning.

6. The D2D-assisted wireless federated learning relay system according to claim 4, characterized in that: When the single model training delay T corresponding to the direct forwarding strategy is expressed as: Among them, a i,k represents the relay node selection of terminal i, a i,k =1 indicates that terminal i selects terminal k to forward local model parameters and satisfies represents the terminal set. When i=k, it indicates whether the cellular communication mode is selected. represents the latency of local computing, which is determined by the local computing capacity f i , the number of samples required to be calculated b, and the amount of calculation required by the model f O related, represents the communication delay, which consists of two parts: the D2D link delay from terminal i to terminal k and the cellular link delay from terminal k to the base station, which can be expressed as: and M represents the number of parameters of the model, and represents the time slot ratio allocation from terminal i to terminal k in the D2D link, and the time slot ratio allocation when terminal k relays the model parameters of terminal i through the cellular network, B D and B C represents the bandwidth occupied by the D2D network and the cellular network, and They represent the signal-to-noise ratio from terminal i to terminal k in the D2D link and the signal-to-noise ratio of terminal k in the cellular network respectively; Minimize delay to find the solution 7. The D2D-assisted wireless federated learning relay system according to claim 4, characterized in that: When the model convergence forwarding strategy corresponds to a single model training delay T, it is expressed as: Among them, a i,k represents the relay node selection of terminal i, a i,k =1 indicates that terminal i selects terminal k to forward local model parameters and satisfies represents the terminal set. When i=k, it indicates whether the cellular communication mode is selected. and represents the latency of local computing, which is determined by the local computing capacity f i and f k , the number of samples required to be calculated b, and the amount of calculation required by the model f O They can be expressed as: represents the D2D link delay from terminal i to terminal k, represents the cellular link delay from terminal k to the base station, M represents the parameter of the model, and represents the time slot ratio allocation from terminal i to terminal k in the D2D link, and the time slot ratio allocation when terminal k relays the model parameters of terminal i through the cellular network, B D and B C represents the bandwidth occupied by the D2D network and the cellular network, and They represent the signal-to-noise ratio from terminal i to terminal k in the D2D link and the signal-to-noise ratio of terminal k in the cellular network respectively; Minimize delay to find the solution 8. The D2D-assisted wireless federated learning relay system according to claim 3, characterized in that: Determine the data upload plan for each terminal according to the preset strategy, including: Terminal i compares its own cellular link signal-noise ratio with the harmonic mean of the D2D link signal-noise ratio and the cellular link signal-noise ratio when terminal k is selected as the relay node as the relay link signal-noise ratio. When its own cellular link signal-noise ratio is greater than the relay link signal-noise ratio, the cellular link mode is selected as the data upload solution; otherwise, the relay link mode with terminal k as the relay node is selected as the data upload solution.

9. The D2D-assisted wireless federated learning relay system according to claim 1, characterized in that: Before performing local model training, the terminal also uploads local computing power and the amount of local data used for training the model.

10. A D2D-assisted wireless federated learning relay method, whose characteristic value is: The method adopts the system according to any one of claims 1 to 9, comprising the following steps: The terminal measures the channel quality information of the D2D network and the cellular network and uploads the channel quality information to the base station before each round of training; The base station calculates the minimum delay based on the channel quality information, determines the data upload scheme of each terminal according to the minimum delay or the preset strategy, and sends it to the terminal, wherein the data upload scheme includes mode selection, relay node selection, and wireless resource allocation; The terminal uploads the local model parameter data to a parameter server equipped by the base station based on the data uploading scheme; The parameter server aggregates the received model parameter data to obtain a global model and broadcasts the global model to each terminal through the cellular network, thus completing a round of federated learning.