## 2 Adaptive Streaming Algorithm for Internet of Autonomous Vehicles
### Streaming Service Support for an Autonomous Vehicle
This module evaluates whether the base stations along the route can meet the requirements for preloading each video clip of the streaming service using the following equations: \[\sum_{\mu}\left(\Delta\cdot\sum_{\theta}d\phi^{\sigma,\alpha}_{\tau^{\sigma, \alpha}_{g^{\sigma,\alpha}}+\mu\cdot\Delta}\right)\geq\mathrm{SS}^{\sigma, \alpha}_{g^{\sigma,\alpha}}\left(sbr^{\sigma,\alpha}_{g^{\sigma,\alpha}},sel^{ \sigma,\alpha}_{g^{\sigma,\alpha}}\right),\;\;1\leq s^{\sigma,\alpha}\leq S^{ \sigma,\alpha}\] (24) \[pt^{\sigma,\alpha}_{1}\leq\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}<\tau^{ \sigma,\alpha}_{g^{\sigma,\alpha}}+\mu\cdot\Delta<pt^{\sigma,\alpha}_{g^{ \sigma,\alpha}},\;1\leq s^{\sigma,\alpha}\leq S^{\sigma,\alpha}\] (25) \[sbr^{\sigma,\alpha}_{g^{\sigma,\alpha}}=\mathrm{br}^{\sigma,\alpha}_{g^{ \sigma,\alpha}},\;1\leq s^{\sigma,\alpha}\leq S^{\sigma,\alpha}\] (26) \[pt^{\sigma,\alpha}_{g^{\sigma,\alpha}-1}\leq pt^{\sigma,\alpha}_{g^{\sigma, \alpha}},\;\;1<s^{\sigma,\alpha}\leq S^{\sigma,\alpha}\] (27) \[at_{p^{\sigma}_{1}}\leq pt^{\sigma,\alpha}_{1}\] (28) \[buf^{\sigma^{\sigma}_{g^{\sigma,\alpha}}}_{\tau^{\sigma,\alpha}_{g^{\sigma, \alpha}}}+\mathrm{SS}^{\sigma,\alpha}_{g^{\sigma,\alpha}}\left(sbr^{\sigma, \alpha}_{g^{\sigma,\alpha}},sel^{\sigma,\alpha}_{g^{\sigma,\alpha}}\right) \leq buf^{\sigma^{\sigma}},\;\;pt^{\sigma,\alpha}_{1}\leq\tau^{\sigma,\alpha}_ {g^{\sigma,\alpha}}<pt^{\sigma,\alpha}_{s},\quad 1<s^{\sigma,\alpha}\leq S^{\sigma,\alpha},\] (29)  
In this context, \(S^{\sigma,\alpha}\) represents the number of video clips in on-demand streaming or 360-degree streaming. \(\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}\) signifies the time at which video clip \(s^{\sigma,\alpha}\) is preloaded. \(pt^{\sigma,\alpha}_{g^{\sigma,\alpha}}\) denotes the playback time of video clip \(s\). \(\mathrm{SS}^{\sigma,\alpha}_{g^{\sigma,\alpha}}(\cdot)\) represents the size of video clip \(s^{\sigma,\alpha}\), while \(sbr^{\sigma,\alpha}_{g^{\sigma,\alpha}}\) and \(sel^{\sigma,\alpha}_{g^{\sigma,\alpha}}\) correspond to the resolution and duration of video clip \(s\), respectively. \(d\phi^{\sigma,\alpha}_{\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}}\) indicates the bandwidth allocated by base station \(\theta\) to video clip \(s^{\sigma,\alpha}\) at time \(\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}\) during a time interval \(\Delta\). \(\mu\) represents the number of consecutive time slots used to download video clips commencing at time \(\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}\). \(pt^{\sigma,\alpha}_{1}\) and \(pt^{\sigma,\alpha}_{g^{\sigma,\alpha}}\), respectively, stand for the starting and ending times for on-demand streaming or 360-degree streaming. \(\mathrm{br}^{\sigma,\alpha}_{g^{\sigma,\alpha}}\) signifies the video screen resolution requirement set by the autonomous vehicle passenger for level \(q^{\sigma,\alpha}\). \(buf^{\alpha}_{\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}}\) represents the remaining buffer capacity of \(\sigma\) at time \(\tau^{\sigma,\alpha}_{g^{\sigma,\alpha}}\). \(buf^{\sigma}\) indicates the size of \(\sigma\)'s buffer. * In scenarios where the calculated bandwidth for any video clip, whether intended for on-demand streaming or 360-degree streaming, falls below the minimum required download bandwidth threshold as the video clip traverses a road segment, this module activates an alert targeted at the supervising RSU of the corresponding road segment. The objective of this alert is to foster synchronization among other autonomous vehicles, prompting them to preload the essential video clips essential to the streaming service. Upon receipt of this alert, the overseeing RSU initiates the \"Video Clip Preloading\" module. This module's role is to orchestrate other autonomous vehicles, ensuring the preloading of the requisite video clips. This guarantees their availability prior to the commencement of the streaming service playback. The autonomous vehicle utilizing the streaming service is also informed about the status of these preloaded video clips.