# Traffic-Aware Optimization of Task Offloading and Content
## 3 System Model and Problem Formulation  
### System Framework  
Figure 1 illustrates a robust three-tier cloud-edge-vehicular network framework designed to cater to diverse tasks across different regions. The framework comprises three layers: the vehicle terminal layer, the Mobile Edge Computing (MEC) layer, and the cloud computing layer. In the cloud computing layer, cloud servers cover the entire area, providing extensive coverage. The MEC layer consists of edge servers along the roadside, covering an area. The vehicle terminal layer comprises vehicles traversing the road, communicating with both the MEC layer and the cloud computing layer via wireless channels. During operation, the vehicle terminal layer undertakes one or more computing tasks with varying probabilities, taking advantage of time gaps to execute the tasks efficiently. Three possible destinations for task offloading are available: local processing (i.e., handling tasks on the computing device within the vehicle), processing by the edge server, or processing by the cloud server. The edge server is equipped with the capability to cache popular content, further enhancing the task offloading efficiency.  
A region's traffic stream is the count of vehicles passing through it in a given time slot, such as one minute. Let \(Tr\) denote the set of vehicle trajectories at the \(t^{th}\) time slot. The vehicle traffic stream in region \(i\) during the \(t^{th}\) time slot can be determined by \(TS_{i}(t)\triangleq\sum_{tr\in\mathbb{T}}\mathbb{I}(tr)\), where \(tr=<s_{1},s_{2},\ldots,s_{|tr|}>\) is an ordered set representing the discrete trajectory of a user multimedia request over time; \(s_{i}\) represents the geographical position of the user's multimedia request at certain times; and \(\mathbb{I}(tr)\) is a binary variable that equals \(1\) if \(s_{k}\) in region \(i\) exists in \(tr\). Otherwise, it equals \(0\). The problem of predicting the stream of vehicles can be defined as follows: given the historical traffic stream \(\{TS_{i}(t)|1\leq i\leq I,1\leq t\leq T\}\), the goal is to predict the future traffic stream \(\{TS_{i}(T+1)|1\leq i\leq I\}\).  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \multirow{2}{*}{**Reference**} & **Cloud** & \multirow{2}{*}{**Edge Servers**} & **Internet of** & **Task** & **Content** & **Energy** & \\  & & & **Vehicles** & **Offloading** & **Cache** & **Consumption** & **Latency** \\ \hline
[4] & & & ✓ & & ✓ & & ✓ \\  
25; 26] & & & ✓ & ✓ & & & \\
[27] & & ✓ & ✓ & ✓ & & ✓ & ✓ \\
[28] & & ✓ & ✓ & ✓ & ✓ & ✓ & ✓ \\ \hline \end{tabular}
\end{table}
Table 1: Related work comparison. The check mark indicates that the paper has addressed a specific aspect.  
In a partitioned region, we assume \(N>Q\), where \(N\) is the number of vehicles and \(Q\) is the number of tasks. This assumption accounts for prevalent tasks that are repeatedly requested and executed. Each vehicle can perform only one task at a time, and multiple vehicles may request the same task based on their preferences. To simplify notation, we define \(q_{i,n}\) as the task \(q\) generated by the \(n^{th}\) vehicle in region \(i\).  
To characterize different computational tasks, a triple is employed as the computational task model: \(q_{i,n}=(c_{q}^{j,n},d_{q}^{i,n},DDL_{q}^{i,n})\). Task \(q_{i,n}\) can be partially offloaded to either the MEC server or the cloud computing server for processing. The parameter \(c_{q}^{i,n}\) is the amount of CPU cycles required to accomplish task \(q_{i,n}\). The parameter \(d_{q}^{i,n}\) represents the input data size required for processing task \(q_{i,n}\), while \(DDL_{q}^{i,n}\) signifies the maximum deadline for completing the task. It is assumed that the value of \(c_{q}^{j,n}\) remains constant regardless of whether task \(q_{i,n}\) is processed locally, offloaded to the MEC server, or executed on the cloud computing server. Furthermore, MEC servers within the region are assumed to have limited computation capacity, denoted as \(cc_{m}\), and a cache size of \(cs_{m}\).