## 3 Federated Learning for Space-Air-Ground Integrated Networks
### Privacy-Preserving Federated Learning
#### 3.5.2 Local Aggregation at Edge Nodes
The device's upload priority \(P_{\text{priority},i}\) is dynamically scheduled based on factors such as cache time and network status, prioritizing devices with longer cache times or more stable network connections for upload, specifically represented as  
\[P_{\text{priority},i}=\frac{\zeta_{1}\cdot cache\_time_{i}+\zeta_{2}\cdot status _{i}}{\sum\limits_{i=1}^{N}\left(\zeta_{1}\cdot cache\_time_{i}+\zeta_{2} \cdot status_{i}\right)+\epsilon} \tag{44}\]  
where \(cache\_time_{i}\) is the cache time of device \(i\), reflecting the timeliness of model upload, \(status_{i}\) represents the connection status of device \(i\), giving higher priority if the device connection is stable, \(\zeta_{1}\) and \(\zeta_{2}\) are weight coefficients used to adjust the influence of cache time and connection status, and \(\epsilon\) is a small constant used to avoid division by zero errors. The purpose of priority scheduling is to ensure that devices upload models in a reasonable order according to timeliness, avoiding delays in important model updates. Considering that the periodic connection time interval between satellites and edge nodes is too long, which affects the accuracy of local and global models, this paper introduces a spatio-temporal redundancy mechanism to ensure that data are not lost during satellite communication interruptions by transmitting model data through other devices. The Spatio-Temporal Redundancy Mechanism proposed in this paper refers to when communication between a specific device (such as a satellite) and an edge node is completely interrupted or experiences excessive delays, and the system activates alternative devices (such as ground base stations or neighboring devices) within proximity that have stable connections to temporarily upload cached model parameters on behalf of the disconnected device. This mechanism ensures model updates are not lost during communication interruptions by working along both spatial dimensions (utilizing reliably connected devices in geographical proximity) and temporal dimensions (preserving and delaying data transmission during communication gaps). The spatio-temporal redundancy device set \(D_{\text{redundant}}\) is represented as  
\[D_{\text{redundant}}=\{D_{j}|\text{connection}(D_{j})=\text{ground\_and\_distance}(D_{i},D_{j}) \leq\delta\} \tag{45}\]  
where \(\delta\) is the maximum distance between devices, ensuring that devices have sufficient physical or communication connection capabilities for spatio-temporal redundancy. When a device's network connection is restored, the device uploads the cached model parameters \(\theta_{i}\) according to cache time and priority scheduling. The optimization strategy for device upload is as follows:  
\[\theta_{i}\leftarrow\text{Upload}(\theta_{\text{cache},i})\text{ if }P_{\text{priority},i}\geq\text{ threshold} \tag{46}\]  
The timing of device uploads is adjusted according to the results of priority scheduling. Edge nodes sort devices according to their priority \(P_{\text{priority},i}\), prioritizing devices with long cache times and stable connections for model uploads. When a device cannot connect to an edge node, a spatio-temporal redundancy device \(D_{\text{redundant}}\) is selected to upload the cached model. This is specifically represented as  
\[D_{\text{selected}}= \begin{cases}\text{argmax}_{i}P_{\text{priority},i},&status _{i}=1,\\ D_{\text{redundant}},&status_{i}=0.\end{cases}  \tag{47}\]  
where \(D_{\text{selected}}\) is the set of devices selected to participate in the upload, and the status status\({}_{i}\) of a device being \(1\) indicates that the device has a normal connection with the edge node. After the selected devices upload model parameters, the edge node performs local aggregation. Model aggregation is a weighted summation aggregation process based on the device's priority and data volume.