## 4 AOS Elastic Slot Scheduling Strategy  
To accommodate the scheduling requirements of synchronous data with isochronous period constraints, asynchronous real-time data with priority and delay requirements, and asynchronous non-real-time data with fairness considerations, and to improve scheduling efficiency, this paper proposes an AOS elastic slot scheduling strategy. To allocate the scheduling slots within the VC scheduling cycle, a portion is dedicated to synchronous VC transmissions, another portion is allocated to asynchronous non-real-time VC transmissions, and the remaining portion is assigned to asynchronous real-time VC transmissions. Let us assume that at any given scheduling moment \(\left(r,k\right)_{\mathit{sclc}}\), the total number of slots assigned to the three types of traffic is \(w_{t1}\), \(w_{t2}\), and \(w_{t3}\), respectively. The available slot counts are \(w_{t1\_{\mathit{srn}}}\), \(w_{t2\_{\mathit{srn}}}\), and \(w_{t3\_{\mathit{srua}}}\), and the used slot counts are \(w_{t1\_{\mathit{sused}}}\), \(w_{t2\_{\mathit{used}}}\), and \(w_{t3\_{\mathit{used}}}\), respectively. For any \(n\) (where \(n=1,2,3\)), the following relationships holds:  
\[w_{tn}=w_{tn\_{\mathit{srua}}}+w_{tn\_{\mathit{used}}} \tag{17}\]  
The total number of slots in each scheduling cycle is \(K\). To ensure fairness, we assume that the minimum number of slots allocated to synchronous VCs and asynchronous non-real-time VCs are \(W_{t1\_{\mathit{min}}}\) and \(W_{t3\_{\mathit{min}}}\), respectively. The slot allocation and initial values at the scheduling moment \(\left(r,0\right)_{\mathit{sclc}}\) are set as shown in Figure 2.  
From the figure, it can be observed that after the allocation of slots for the three types of data, there are two slot boundaries on the left and right. During the scheduling process, based on the initial slot allocation, the slots can be dynamically adjusted according to the data request status and the current slot allocation situation, allowing for mutual preemption of the scheduling slots by the three types of data. Through the elastic preemption mechanism, the slot boundaries of the three types of data dynamically shift as the available and used slot numbers are updated, thereby adapting to the actual channel conditions and achieving a better overall scheduling effect. In the scheduling process, assuming that type \(i\) data VC preempts the slot of type \(j\) data VC, the dynamic slot adjustment calculation formula is as follows:  
\[\left\{ \begin{array}{rcl}w_{tj}&=&w_{tj}-1\\ w_{ti}&=&w_{ti}+1\end{array} \right. \tag{18}\]  
Assuming that at any scheduling moment the transmission request states for the three types of traffic are \(R1\), \(R2\), \(R3\), with a value of 1 indicating a request and 0 indicating no request, the pseudocode for the fixed time slot scheduling algorithm and the elastic time slot scheduling algorithm are shown in Algorithm 1 and Algorithm 2, respectively. Figure 2: Initial slot allocation for the scheduling algorithm. ```
01: Input: For the three types of traffic, the number of available time slots \(w_{t1\_area}\), \(w_{t2\_area}\), \(w_{t3\_area}\), and the transmission request states \(R1,R2,R3\). 02: Output: Scheduling results for three types of traffic. 03: if (\(R1==1\)&& \(w_{t1\_area}>0\)) then
04: Schedule synchronous traffic. 05: else if (\(R2==1\)&& \(w_{t2\_area}>0\)) then
06: Schedule asynchronous real-time traffic. 07: else if (\(R3==1\)&& \(w_{t3\_area}>0\)) then
08: Schedule asynchronous non-real-time traffic. 09: else then
10: Send padding frame. 11: end if
```  
**Algorithm 1** Fixed Time Slot Scheduling Algorithm  
```
01: Input: For the three types of traffic, the number of available time slots \(w_{t1\_area}\), \(w_{t2\_area}\), \(w_{t3\_area}\), the number of used time slots \(w_{t1\_used}\), \(w_{t2\_used}\), \(w_{t3\_used}\), and the transmission request states \(R1,R2,R3\). 02: Output: The total number of time slots dynamically allocated for three types of traffic \(w_{t1},w_{t2},w_{t3}\).