## 2 System Model
### Baseline Scheduling Algorithm with Sub-Flow Division
#### 2.4.1 Stream Preprocessing, Filtering, and Sub-Flow Division
However, by activating the sub-flow division mechanism, the high-bandwidth Data Stream 1 is automatically segmented into smaller, more flexible sub-flows. This segmentation creates the necessary scheduling gaps in the timeline, allowing the deadline-critical stream to be successfully placed. This example clearly demonstrates how the integrated sub-flow division capability directly enhances the schedulability of complex stream sets, making it a vital component of the baseline algorithm. \begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline
**Data** & **Priority** & **Send Delay** & **Cycle** & **Deadline** & **Inter-Cycle** & **E2E Latency** & **Jitter** \\
**Name** & **(PCP-0-7)** & **(μs)** & **Period (μs)** & **(μs)** & **Send Offset (μs)** & **Target (μs)** & **Constraint (μs)** \\ \hline Data Stream 0 & 1 & 20 & 125 & 40 & 125 & 125 & 250 \\ Data Stream 1 & 2 & 200 & 250 & 250 & 250 & 250 & 250 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters for the sub-flow division illustrative example. ```
1:Set of all input data streams \(\mathcal{F}_{all}=\{F_{1},\ldots,F_{m}\}\). 2:Hyperperiod \(\mathcal{T}\); For each \(F_{i}\in\mathcal{S}_{sched}\): Available time \(A_{i}\), Sub-stream count \(N_{i}\), Sub-stream times \(\{a_{i,x}\}\). 3:\(\mathcal{S}_{sched}\leftarrow\emptyset\). 4:\(\mathcal{P}_{all\_periods}\leftarrow\emptyset\). 5:List to collect periods of all schedulable streams
6:for all each unique path \(P_{k}\) present in \(\mathcal{F}_{all}\)do
7:\(\mathcal{S}_{path}\leftarrow\{F_{i}\in\mathcal{F}_{all}\mid F_{i}\text{ uses path }P_{k}\}\). 8:while\(\mathcal{S}_{path}\
eq\emptyset\)do
9:\(U_{util}\leftarrow\sum_{F_{i}\in\mathcal{S}_{path}}(t_{i}/T_{j})\). 10: Calculate path utilization, Equation (\(\mathcal{T}\))
11:if\(0<U_{util}<1\)then
12:\(\mathcal{S}_{sched}\leftarrow\mathcal{S}_{sched}\cup\mathcal{S}_{path}\). 13:Add periods of streams in \(\mathcal{S}_{path}\) to \(\mathcal{P}_{all\_periods}\). 14:break while. 15:\(\triangleright\) Path is schedulable with current streams
16:else
17:\(F_{remove}\leftarrow\) null. 18:if streams in \(\mathcal{S}_{path}\) have distinct \(PCP_{j}\)then
19:\(F_{remove}\leftarrow\) stream in \(\mathcal{S}_{path}\) with lowest \(PCP_{j}\). 20:elseif\(|\mathcal{S}_{path}|>0\)then
21:\(F_{remove}\leftarrow\) stream in \(\mathcal{S}_{path}\) with largest \((t_{j}/T_{j})\) ratio. 22:if\(F_{remove}\
eq\) nullthen
23:\(\mathcal{S}_{path}\leftarrow\mathcal{S}_{path}\setminus\{F_{remove}\}\). 24:\(\triangleright\) Cull stream
25:else
26:break while. 27:\(\triangleright\) Cannot prune further or path empty
28:if\(\mathcal{S}_{sched}=\emptyset\)then return Error: No schedulable streams found after filtering. 29:\(\mathcal{T}\leftarrow\) lcm of unique periods in \(\mathcal{P}_{all\_periods}\). 30:Sort \(\mathcal{S}_{sched}\) into \(\mathcal{S}_{ordered}=(F_{(1)},\ldots,F_{(N_{s})})\) by increasing period \(T_{(i)}\). 31:Let \(T_{first\_period}\gets T_{(1)}\) (period of the first stream in sorted list). 32:for all\(F_{(i)}=(L_{(i)},t_{(i)},T_{(i)},\ldots)\in\mathcal{S}_{ordered}\) (iterating \(idx\) from \(1\) to \(N_{s}\))do
33:if\(idx=1\)then
34:\(A_{(idx)}\gets T_{(idx)}\). 35:else
36:\(A_{(idx)}\leftarrow(1-\sum_{k=1}^{idx-1}(t_{(k)}/T_{(k)}))\cdot T_{(idx)}\). 47:\(\triangleright\) Calculate available time based on prior streams
48:\(N_{(idx)}\gets 1\). 49:if\(A_{(idx)}>0\)and\(T_{first\_period}>0\)and\(T_{(idx)}>0\)then
50:\(avg\_substream\_slots\_in\_Ai\leftarrow[T_{(idx)}/T_{first\_period}]\). 61:\(\triangleright\) Ratio of periods, effectively number of \(T_{first\_period}\) intervals in \(T_{(idx)}\)
62:if\(avg\_substream\_slots\_in\_Ai>0\)then
63:\(target\_substream\_duration\gets A_{(idx)}/avg\_substream\_slots\_in\_Ai\).