## 3 Network Architecture and System Model
### Computation Task Offloading Model  
We assume that there are \(n\) latency-sensitivity and computation-intensive tasks offloaded to nearby BSs, where the set of tasks is denoted as \(\mathcal{N}=\{1,2,\cdots,N\}\). Moreover, each task is characterized by certain parameters, denoted as \(\left(n_{i}^{up},n_{i}^{comp},n_{i}^{down}\right),i\in\mathcal{N}\), where \(n^{up}\) denotes the size of the input and uploaded data; \(n^{comp}\) denotes the number of CPU cycles required to process the data; \(n^{down}\) denotes the size of the processed and downloaded data. In this research, the objective was to study the 3C and total costs of tasks while maintaining the atomicity of the tasks, i.e., each task could only be served by one processing ECN. In our proposed SAGIN system, there are four offload destinations: BSs, UAVs, LEO satellites, and CDC. We assume that \(x^{BS}\), \(x^{ULAV}\), and \(x^{LEO}\) are three binary parameters, where \(x^{BS}_{ib}\) denotes whether task \(i\) selects BS \(b\) as the offload target, \(x^{ULAV}_{iu}\) denotes whether task \(i\) selects UAV \(u\) as the offload target, and \(x^{LEO}_{is}\) denotes whether task \(i\) selects the LEO satellite \(s\) as the offload target. \[\sum_{b=1}^{B}x^{BS}_{ib}+\sum_{u=1}^{U}x^{ULAV}_{iu}+\sum_{s=1}^{S}x^{LEO}_{is }=1,\forall i\in\mathcal{N} \tag{2}\]  
\[x^{BS}_{ib},x^{ULAV}_{iu},x^{LEO}_{is}\in\{0,1\},b\in\mathcal{B},u\in\mathcal{ U},s\in\mathcal{S} \tag{3}\]  
The above equation indicates that each task would be offloaded to one ECN in the SAGIN architecture. \(x^{BS}_{ib}=1\) if task \(n_{i}\) is offloaded to BS \(b\) and \(x^{BS}_{ib}=0\) otherwise; \(x^{ULAV}_{iu}=1\) if task \(n_{i}\) is offloaded to UAV \(u\) and \(x^{ULAV}_{iu}=0\) otherwise; moreover, \(x^{LEO}_{is}=1\) if task \(n_{i}\) is offloaded to LEO satellite \(s\) and \(x^{LEO}_{is}=0\) otherwise. These three different computing units own different computing power and storage resources. \(f^{BS}_{ib}\), \(f^{ULAV}_{iu}\), and \(f^{SAT}_{is}\) denote the number of computing resources requested by task \(i\) per second from BSs, UAVs, and LEO satellites, respectively. We assume that tasks are uploaded to the nearest base station first and then propagate them from the base station to the target computing nodes. Since the propagation delay of tasks directly to edge computing nodes is much greater than the upload delay of tasks to the nearest base station, we will ignore the upload delay of tasks. The time taken by a task to be uploaded and downloaded between ECNs and the latency taken to calculate the task can be expressed as follows:  
\[T^{up}=\frac{n^{up}}{k^{up}}=\frac{n^{up}}{B\text{log}_{2}(1+\frac{P\times 10 ^{-[Lp/10]}}{N})} \tag{4}\]  
\[T^{down}=\frac{n^{down}}{k^{down}}=\frac{n^{down}}{B\text{log}_{2}(1+\frac{P \times 10^{-[Lp/10]}}{N})} \tag{5}\]  
\[T^{comp}=L^{time}-T^{up}-T^{down} \tag{6}\]  
where \(T^{comp}\) is the time to execute the task, \(T^{up}\) and \(T^{down}\) represent the time of uploading and downloading the task message. The overall latency of the tasks offloaded to the BSs comprises the transfer delay to the target BS, the computation delay of the BS, and the transfer delay of the result download. \[T^{BS}_{ib}=T^{up}_{ib}+T^{comp}_{ib}+T^{down}_{ib},i\in\mathcal{N} \tag{7}\]  
One option is to upload tasks to the UAVs when the computing resources on the ground are insufficient to handle the high influx of tasks. \[T^{ULAV}_{iu}=T^{up}_{iu}+T^{comp}_{iu}+T^{down}_{iu},i\in\mathcal{N} \tag{8}\]The task process changes with the calculations involved in offloading tasks to LEO satellites. Task information must be uploaded to the nearest UAV before spreading to satellites. After the task processing is completed, the data are returned to the original path.