## 2 Adaptive Streaming Algorithm for Internet of Autonomous Vehicles
### Video Clip Preloading at the RSU  
When confronted with limited bandwidth for on-demand streaming or 360-degree streaming, the RSU initially assesses the road segments along the route traversed by the streaming-enabled autonomous vehicle before the occurrence of the bandwidth deficiency. It explores the presence of base stations within the autonomous vehicle's route coverage area capable of allocating the necessary bandwidth for preloading the required video clips. In situations where the base stations along the route cannot provide the necessary bandwidth, the system turns to other autonomous vehicles that are passing through the same road segments within the streaming service's operational timeframe. The objective is to identify the base stations capable of providing the necessary capacity for preloading the essential video clips. Once a suitable base station is pinpointed, the RSU selects an autonomous vehicle capable of accessing the coverage range provided by that specific base station. This chosen vehicle is then tasked with preloading the required video clips from the identified base station. The preloaded video clip is subsequently stored in the onboard storage of the autonomous vehicle responsible for the preloading. As a result, when the autonomous vehicle that performed the preloading and the autonomous vehicle requesting the video clip come into proximity, the preloaded video clip is sent to the inquiring vehicle via V2V communication. The following steps are executed by this module:  
1. Recognizing that the base stations along the route segment of the autonomous vehicle are insufficient to meet the playback requirements for video clip requested by the vehicle's passenger, the RSU initiates an investigation into road segments the autonomous vehicle has previously passed through. The aim is to identify base stations within the coverage area that possess sufficient bandwidth to facilitate the preloading of essential video clips for the passenger of the autonomous vehicle. \[\sum_{\mu}\left(\Lambda\cdot\sum_{\theta^{\prime}}db^{\phi^{\prime}, \sigma,\alpha}_{\tau^{\rho,\alpha}_{\rho,\alpha}+\mu\cdot\Delta}\right) \geq\mathrm{SS}^{\sigma,\alpha}_{\sigma^{\prime},\alpha}\left( sbr^{\rho,\alpha}_{\sigma^{\prime},\alpha},sel^{\rho,\alpha}_{\sigma^{\prime}, \alpha}\right),\ 1\leq s^{\sigma,\alpha}\leq S^{\sigma,\alpha}\] (40) \[sel^{\sigma,\alpha}_{\sigma^{\prime},\alpha} =\mathrm{el}^{\sigma,\alpha}_{\sigma^{\prime},\alpha},\ 1\leq s^{\sigma,\alpha}\leq S^{\sigma,\alpha}\] (41)\[pt_{1}^{\sigma,A}\leq\tau_{g^{\sigma,A}}^{\sigma,A}<\tau_{g^{\sigma,A}}^{\sigma,A}+ \mu\cdot\Delta<pt_{g^{\sigma,A}}^{\sigma,A},\ 1\leq g^{\sigma,A}\leq S^{\sigma,A} \tag{42}\]  
\[buf_{\tau_{g^{\sigma,A}}^{\sigma,A}}^{\sigma,A}+\text{SS}_{g^{\sigma,A}}^{\sigma,A}\big{(}br_{g^{\sigma,A}}^{\sigma,A},sel_{g^{\sigma,A}}^{\sigma,A}\big{)} \leq buf^{\sigma},\ \ p_{1}^{\sigma,A}\leq\tau_{g^{\sigma,A}}^{\sigma,A}< pt_{s}^{\sigma,A},\ \ \ 1<s^{\sigma,A}\leq S^{\sigma,A}, \tag{43}\]  
where \(\tau_{g^{\sigma,A}}^{\sigma,A}\) represents the time at which autonomous vehicle \(\sigma\) traveling through the base station \(\theta^{\prime}\), which has the capability to supply the necessary bandwidth for preloading the video clip. * If any base stations capable of furnishing adequate bandwidth for preloading the required video clip before playback are identified along the vehicle's route, the relevant RSU overseeing that specific route segment is informed, and the execution of this module comes to an end. If no such base stations are located, then we advance to the subsequent step. * On the route of autonomous vehicle \(\sigma\), we evaluate whether other autonomous vehicles traveling through the same segments and arriving simultaneously possess the capability to conduct preloading of the video clip from base stations positioned along the vehicle's path.