## 4 Mechanisms and Optimizations
### Preference-Based Scheduling Strategies
Therefore, in IPCRSA, the SN employs a roulette-selection algorithm for CRN selection. In this algorithm, the SN randomly selects CRNs with scores from high to low in descending order of probability, simultaneously balancing the load of CRNs and meeting user preferences. \[\left\{ \begin{aligned} C=\left\{a\in A\right\}\\ a\textbf{s.t.}& CRS\_ID\_T_{x}\text{ {Requested}}== CRS\_ID\_T_{x}\text{ {Available}}\\ & Scheduling\_Delay\geq\text{ Total Communication\_Delay}\\ & Max\_Price\geq\text{Price}\\ & RRQ\_Core\leq Available\_CPU\_Cores\\ & RRQ\_Memory\leq Available\_Memory\\ & RRQ\_Storage\leq Available\_Storage\\ & RRQ\_Bandwidth\leq Available\_Bandwidth\\ \end{aligned} \right. \tag{20}\]  
The roulette-selection algorithm is commonly used in genetic algorithms, where the probability of selecting a candidate node is directly proportional to its composite score. Firstly, the probability \(p_{i}\) of selecting each of the \(n^{*}\) candidate CRNs is calculated based on their scores. Subsequently, the cumulative probabilities \(q_{i}\) for each candidate CRN are computed. Finally, a uniformly distributed random number \(r\) is generated within \([0,1]\), and the range in which \(r\) falls determines the ultimately selected CRN. The overall process is illustrated by Equations (21)-(23). \[p_{i}=\frac{s_{i}}{\Sigma_{k=1}^{n^{*}}s_{k}},\ i\in N^{*} \tag{21}\]  
\[q_{i}=\Sigma_{j=1}^{i}p_{j},\ i\in N^{*} \tag{22}\]  
\[select=\left\{ \begin{aligned} 1,\ when\ \ r\leq q_{1}\\ k,\ when\ \ q_{k-1}<r\leq q_{k}\ (2\leq k\leq n^{*})\end{aligned} \right. \tag{23}\]  
Based on the aforementioned scoring and selection algorithms of CRNs, the preference-based computing resource scheduling algorithm in IPCRSA is formulated in Algorithm 1. ```
0:\(CRS\_ID\_T_{x}\)Requested; Scheduling_Delay; Max_Price; \(RRQ\_Core;RRQ\_Memory;RRQ\_Storage;RRQ\_Bandwidth;RRP_{x}\); \(CRNs\) with Status Information Table;
0:\(CRN\) that meets the User's resource requirements
1:if\(RRP_{x}=RRP_{1}\)then
2: score each \(CRN\) in \(CRNs\) with Equations (1)-(4)
3:else
4: score each \(CRN\) in \(CRNs\) with Equations (5)-(19)
5:endif
6:for\(CRN\) in \(CRNs\)do
7:if\(CRN\) can satisfy the constraint of Condition (20) then
8: add \(CRN\) to the set of Candidate \(CRNs\)
9:endif
10:endfor
11:for\(CRN\) in Candidate \(CRNs\)do
12: calculate the probability that the \(CRN\) may be selected with Equation (21)
13: calculate the cumulative probability of the \(CRN\) with Equation (22)
14:endfor
15:\(r\gets rand()/RAND\_MAX\)
16:\(//RAND\_MAX\) is the largest number that the \(rand()\) function can return
17:for\(CRN\) in Candidate \(CRNs\)do
18:if\(r\) is in the probability interval of \(CRN\)then
19:return\(CRN\)
20:endif
21:endfor
22:returnNULLAdditionally, it is important to note that the resource scheduling in IPCRSA is not limited solely to the user preferences and corresponding scheduling strategies shown in Table 5. It has the flexibility to incorporate additional user preference options and corresponding scheduling strategies based on new user requirements, demonstrating high scalability. Finally, the key variables involved in this section are summarized in Table 6 below for reference. ### Processing and Forwarding Mechanisms for Resource Request Packets

Upon receiving a computing resource request packet in the data plane, the SN first reads the IS_Scheduled, CRS_ID_T\({}_{x}\), and RRP\({}_{x}\) parameters in the packet header to confirm the status of the request, the resource service type requested by the User, and the user preferences. If the request has not been scheduled, the scheduling strategy corresponding to user preferences is executed, which aims to search for a CRN that satisfies the User's resource demands in all dimensions. * If a non-local CRN is found, the Destination IP field of the packet is modified to the destination CRN's Source_IP, the IS_Scheduled is set to 1, the Scheduling Target field is modified to the destination CRN's Sequence_Number, and the packet is finally forwarded.