## 2 Adaptive Streaming Algorithm for Internet of Autonomous Vehicles
### Real-Time Driving Speed and Time Calculation for an Autonomous Vehicle  
This module is initiated by autonomous vehicle passengers prior to the vehicle's departure. The passengers input the departure location, time, and intended destination, initiating the vehicle's operation. Subsequently, the vehicle retrieves traffic data and utilizes the Dijkstra algorithm [35] to calculate the most efficient driving path from the point of origin to the final destination. The estimation is based on average travel times for individual road segments. Autonomous vehicle passengers have the flexibility to spontaneously modify their travel plans. Furthermore, the arrival times and speeds of autonomous vehicles on various road segments can be influenced by real-time traffic conditions, which can vary over time and deviate from the initially estimated times and speeds. This module periodically receives updates on traffic conditions for different road segments and gathers relevant data regarding the vehicle's average speed from RSUs. It then proceeds to reevaluate the expected arrival times of autonomous vehicles at each road segment to align with the updated conditions. If the disparity between the revised arrival times and the originally projected times is significant, this module transmits the revised arrival information to the RSUs tasked with monitoring the respective road sections. The steps executed by this module are as follows:  
1. [label=Step 0:]
2. Before the autonomous vehicle sets off, it retrieves road traffic data. Once the departure location, time, and destination are inputted, this module utilizes the Dijkstra algorithm [35] to compute the most efficient path from the initial location to the endpoint. This computation considers the average travel duration for each segment of the roadway as the foundation for travel cost. 3. [label=Step 0:]
4. Estimate the anticipated segment-specific arrival times using real-time traffic data from the autonomous vehicle's database. \[at_{p^{\sigma}_{i+1}}=at_{p^{\sigma}_{i}}+\frac{sl_{p^{\sigma}_{i},p^{\sigma} _{i+1}}}{sp_{p^{\sigma}_{i},p^{\sigma}_{i+1}}\left(at_{p^{\sigma}_{i}}\right)},1\leq i<h^{\sigma},\] (10) where \(p^{\sigma}_{1}\), \(p^{\sigma}_{i}\), and \(p^{\sigma}_{i}\), respectively, represent the starting point of autonomous vehicle \(\sigma\), the point where the road segment linking \(p^{\sigma}_{i}\) to \(p^{\sigma}_{i+1}\), and the final destination of \(\sigma\)'s route. \(at_{p^{\sigma}_{i}}\) is the time \(\sigma\) arrives at \(p^{\sigma}_{i}\). \(sl_{p^{\sigma}_{i},p^{\sigma}_{i+1}}\) denotes the length of the segment connecting \(p^{\sigma}_{i}\) and \(p^{\sigma}_{i+1}\). \(sp_{p^{\sigma}_{i},p^{\sigma}_{i+1}}\left(at_{p^{\sigma}_{i}}\right)\) stands for the average vehicle speed through  
Figure 3: A BILSTM architecture. the segment connecting \(p_{i}^{\sigma}\) and \(p_{i+1}^{\sigma}\) after the autonomous vehicle arrives at \(p_{i}^{\sigma}\) at time \(at_{p_{i}^{\sigma}}\). * The calculated arrival times for each road segment, along with the travel route of the autonomous vehicle, are sent to the RSUs responsible for managing those segments. * This component operates in the background. In the event of a modification to the itinerary by the autonomous vehicle passenger, the process reverts to Step 1 to recompute the travel route. * At predetermined intervals established by the system, this module retrieves the most recent road traffic data from the overseeing RSUs situated along the route. Subsequently, it proceeds to recalculate the estimated arrival times for each segment of the travel route.