# Deadline-Aware Scheduling for Transmitted RSU Packets in Cooperative Vehicle-Infrastructure Systems
## 4 Lyapunov Optimization Model
\begin{array}{rl}\Delta(G(t))\leq&\frac{1}{2}\sum\limits_{n=1}^{N}E\Big{\{} \left(h_{n}^{H}(t)-B_{n}^{H}(t)\right)^{2}\Big{|}G(t)\Big{\}}+\sum\limits_{n =1}^{N}Q_{n}^{H}(t)E\big{\{}\left(h_{n}^{H}(t)-B_{n}^{H}(t)\right)\big{|}G(t) \big{\}}\\ &+\frac{1}{2}\sum\limits_{n=1}^{N}E\Big{\{}\left(h_{n}^{L}(t)-B_{n}^{L}(t) \right)^{2}\Big{|}G(t)\Big{\}}+\sum\limits_{n=1}^{N}Q_{n}^{L}(t)E\big{\{} \left(h_{n}^{L}(t)-B_{n}^{L}(t)\right)\big{|}G(t)\big{\}}\\ &\hskip 14.226378 pt\text{Through }\alpha\cdot\overline{h}=E\big{[}h_{n}^{H}(t) \big{]},(1-\alpha)\cdot\overline{h}=E\big{[}h_{n}^{L}(t)\big{]},\text{ and }B_{n}(t)=\big{\{}B_{n}^{H}(t),B_{n}^{L}(t)\big{\}}\leq S,\text{ we can obtain the following relations:}\\ &\sum\limits_{n=1}^{N}E\Big{\{}\left(h_{n}^{H}(t)-B_{n}^{H}(t)\right)^{2}\Big{|}G( t)\Big{\}}+\sum\limits_{n=1}^{N}E\Big{\{}\left(h_{n}^{L}(t)-B_{n}^{L}(t) \right)^{2}\Big{|}G(t)\Big{\}}\\ &\leq\sum\limits_{n=1}^{N}\max\biggl{\{}\left(\alpha\cdot\overline{h}\right) ^{2},\left(S-\alpha\cdot\overline{h}\right)^{2}\biggr{\}}+\sum\limits_{n=1}^{N} \max\biggl{\{}\left[(1-\alpha)\cdot\overline{h}\right]^{2},\left[S-(1-\alpha )\cdot\overline{h}\right]^{2}\biggr{\}}\\ \end{array}  \tag{34}\]  
\[ \begin{split}&\min\limits_{d_{n}(t)\sum\limits_{n=1}^{N}d_{n}(t) \cdot\left[b_{n}^{*}(t)\cdot\left(V^{\frac{\tau_{n}^{H}(t)}{t_{n}^{H}}}-Q_{n}^{H }(t)\right)+(1-b_{n}^{*}(t))\cdot\left(V^{\frac{\tau_{n}^{L}(t)}{t_{n}^{L}}}-Q _{n}^{L}(t)\right)\right]\\ & s.t.\left\{\begin{array}{ll}0\leq d_{n}(t)\leq S,1\leq n\leq N \\ \sum\limits_{n=1}^{N}d_{n}(t)\leq S\cdot\kappa(t),\forall n,t\end{array}\right. \end{split}  \tag{41}\]  
When we set \(\sigma_{n}(t)=b_{n}^{*}(t)\cdot\left(Q_{n}^{H}(t)-V^{\frac{H}{H}(t)}\right)+(1 -b_{n}^{*}(t))\cdot\left(Q_{n}^{L}(t)-V^{\frac{L}{H}(t)}\right)\), the system optimization model is described as  
\[ \begin{split}&\max\limits_{d_{n}(t)\sum\limits_{n=1}^{N}d_{n}(t) \cdot\sigma_{n}(t)\\ & s.t.\left\{\begin{array}{ll}0\leq d_{n}(t)\leq S,1\leq n\leq N \\ \sum\limits_{n=1}^{N}d_{n}(t)\leq S\cdot\kappa(t),\forall n,t\end{array}\right. \end{split}  \tag{42}\]  
The purpose of the optimization model was to maximize its value based on limited packet scheduling decisions (resource space). Therefore, we obtained optimal data scheduling by transforming the model into a knapsack problem [21]. In the knapsack problem, the system optimization model's system value is expressed by \(\sigma_{n}(t)\). The system first arranges the values of \(\sigma_{n}(t)\) in descending order, then inserts them into the \"knapsack\". However, this process can be interrupted. The optimal solution to the system optimization problem depends on the system state at the time of interruption. Therefore, the key to the knapsack problem is to find the breakpoint. Typical interruption conditions in knapsack problems are as follows:  
The remaining \"weight\" space is 0. The value of the \"item\" inserted into the \"backpack\" is negative. Optimal packet scheduling decisions can be determined by the break point of the knapsack problem. Define \(\Omega\) as the interruption index parameter of the system knapsack problem, and \(\Omega=\{\xi_{1},\xi_{2}\}\), of which \(\xi_{1}\), \(\xi_{2}\) satisfies the following relation:  
\[ \begin{cases}\xi_{1}=\underset{n}{\operatorname{argmin}}\sum\limits_{j=1}^{n}d _{j}(t)\geq\kappa(t)S\\ \xi_{2}=\underset{n}{\operatorname{argmin}}\sigma_{n}(t)<0\end{cases}  \tag{43}\]  
Then, the optimal solution for packet scheduling decisions \(d_{n}^{*}(t)\) is supplied as follows:  
\[d_{n}^{*}(t)= \begin{cases}S&n<\Omega\\ \min\{\kappa(t)S-(\Omega-1)S,d_{\Omega}(t)\}&n=\Omega\\ 0&\text{otherwise}\end{cases}  \tag{44}\]