# Resource Mapping Allocation Scheme in 6G Satellite Twin Network
## 4 System Optimization Scheme Based on A Multi-Constraint Multi-Objective Genetic Algorithm
### Problem Formulation
#### Load balancing  
There are two main components in the 6G satellite twin network, namely, distribution balancing of load among individual servers and distribution balancing of load among different docker containers within the same server. The former is used to prevent overloading  
Figure 3: Function–resource three-dimensional packing model. of individual servers, and the latter is used to prevent overloading of docker containers to ensure efficient utilization of resources. Moreover, when the CPU or memory of a server or docker container is exhausted, the remaining resources, no matter how much is left, can no longer provide services. The load balancing of all servers can be expressed as  
\[loadS=(\psi(cap)+\psi(mem)+\psi(ban))\times e^{Acvs(D)}, \tag{17}\]  
\[\psi(cap)=\sqrt{\frac{1}{P}\cdot\sum_{p=1}^{P}{(\text{cap}F^{\prime}/\sum_{q=1} ^{Q}{\text{caps}_{pq}-\overline{capF^{\prime}/\text{cap}S})}^{2}}}, \tag{18}\]  
\[\psi(mem)=\sqrt{\frac{1}{P}\cdot\sum_{p=1}^{P}{(memF^{\prime}/\sum_{q=1}^{Q}{ mems_{pq}-\overline{memF^{\prime}/memS})}}}, \tag{19}\]  
\[\psi(ban)=\sqrt{\frac{1}{P}\cdot\sum_{p=1}^{P}{(banF^{\prime}/\sum_{q=1}^{Q}{ bans_{pq}-\overline{banF^{\prime}/banS})}}}, \tag{20}\]  
where \(\text{cap}F^{\prime}/\sum_{q=1}^{Q}{\text{caps}_{pq}}\), \(memF^{\prime}/\sum_{q=1}^{Q}{mems_{pq}}\), \(banF^{\prime}/\sum_{q=1}^{Q}{bans_{pq}}\) denote the utilization of CPU, the utilization of memory, and the utilization of bandwidth in the server p, respectively. \(\overline{capF^{\prime}/\text{cap}S}\), \(\overline{memF^{\prime}/memS}\), \(\overline{banF^{\prime}/\overline{banS}}\) denote the average utilization of CPU, the average utilization of memory, and the average utilization of bandwidth, respectively, which can be obtained by calculating the average resource in all servers and the average requirements of all functions. Load balancing of the docker containers in server q can be expressed as  
\[loadC=\frac{1}{Q}\cdot\sum_{q=1}^{Q}{(\text{max}\bigg{(}\frac{capF^{\prime}}{ caps_{pq}},\frac{memF^{\prime}}{mems_{pq}},\frac{banF^{\prime}}{bans_{pq}} \bigg{)}}-\text{min}(\frac{capF^{\prime}}{caps_{pq}},\frac{memF^{\prime}}{ mems_{pq}},\frac{banF^{\prime}}{bans_{pq}})), \tag{21}\]  
where \(\frac{capF^{\prime}}{caps_{pq}}\), \(\frac{memF^{\prime}}{mems_{pq}}\), \(\frac{banF^{\prime}}{bans_{pq}}\) denote the utilization of CPU, the utilization of memory, and the utilization of bandwidth in the docker container p of the server q, respectively  
(3) \(\quad\)**Total cost**  
In this paper, the cost of the 6G satellite twin network is divided into two main parts: one part is the cost of power, software, and equipment, and the other part is the increased cost due to the execution time of the function beyond the specified acceptable time. The total cost required for this network can be expressed as  
\[\cos\mathfrak{t}=\sum_{p=1}^{P}{\sum_{q=1}^{Q}{\cos\mathfrak{t}_{pq}+\sum_{j= 1}^{I}{\cos\mathfrak{t}f_{j}^{S}}}}, \tag{22}\]  
The three optimization objectives in this paper can be formally expressed as follows:  
\[\text{max}(\text{utl}F^{\prime})=max\sum_{j=1}^{J}{\frac{1}{J}\cdot\text{level }f_{j}^{S}}\cdot(\sum_{i=1}^{4}{w_{ij}\cdot\frac{QoS_{i}-QoS_{j}}{QoS_{i}}}), \tag{23}\]  
The shared function SH represents the relationship between the non-dominated solution \((F_{m}^{\prime},S_{m})\) and other non-dominated solutions within this layer, denoted as  
\[\mathrm{SH}(\mathrm{d}(\mathrm{m},\mathrm{n}))= \begin{cases}1-\left(\frac{d(m,n)} {r_{ave}}\right)^{\beta}&d(m,n)<r_{ave}\\ 0&other\end{cases} , \tag{31}\]  
where the \(r_{ave}\) is the average of the non-dominated solution \((F_{m}^{\prime},S_{m})\) and the radii of other non-dominated solutions within this layer, and \(\beta\) is a constant.