## 3 Algorithm Design
### Performance Analysis  
#### 3.1.1 Delay Analysis  
1. [label=0]
2. Caching Stage  
The key to analyzing this stage is to obtain the distribution of the number of data packets \(k\) cached by the MEC server at the end of the caching duration \(D_{1}\). By applying the diffusion process analysis method proposed in [13], the conditional probability density function of \(k\) can be expressed as:  
\[p(k,D_{1}|0)=\frac{1}{\sqrt{2\pi\beta_{1}t_{1}}}\cdot\left\{\exp\left[-\frac{( k-\alpha_{1}D_{1})^{2}}{2\beta_{1}D_{1}}\right]-\exp\left[\frac{2\alpha_{1}b_{1}}{ \beta_{1}}-\frac{(k-2b_{1}-\alpha_{1}D_{1})^{2}}{2\beta_{1}D_{1}}\right]\right\} \tag{5}\]  
where \(\alpha_{1}\) and \(\beta_{1}\) are the drift coefficient and diffusion coefficient for the transmission from the cloud server to the MEC server, respectively, satisfying \(\alpha_{1}=\lambda_{1}\) and \(\beta_{1}=\alpha_{1}^{3}V_{1}\)[13]; \(b_{1}=D_{1}fMN\lceil BC_{\text{r}}/s\rceil\) represents the maximum number of data packets that the MEC server can cache for all \(MN\) tiles during the caching duration \(D_{1}\). Here,\(f\) denotes the video frame rate, \(B\) is the data size per tile per frame, and \(C_{\text{r}}\) is the ratio of the data size after compression to the data size before compression. Furthermore, we can obtain the probability mass function of the number of tiles \(G_{l}\) cached by the MEC server at the end of the caching stage:  
\[P(G_{l}=g)=\int_{D_{1}f\lceil g(g+1)\lceil BC_{\text{r}}/s\rceil}^{D_{1}f \lceil g(g+1)\lceil BC_{\text{r}}/s\rceil}p(k,D_{1}|0)dk \tag{6}\]  
2. Computation Sub-stage of the MEC Server  
When the MEC server applies the proportional computing resource allocation strategy proposed in Section 2.2.3, the computing resource allocated to the tiles cached by the MEC server and hit by \(q\) users satisfies Equation (2), and the total data size for computing offloading is \(M_{q}=\left|B_{q}\right|D_{1}fB\), which is determined by the number of these tiles, \(\left|B_{q}\right|\). Therefore, the computation delay \(D_{2,l}^{(i)}\) required by the MEC server can be expressed as:  
\[D_{2,l}^{(i)}=\frac{M_{q}}{W_{q}}=\frac{D_{1}fB\Sigma_{q=1}^{-l}\left|B_{q} \right|}{W_{\text{M}}} \tag{7}\]  
It is noteworthy that, similar to [20,21], the computation delay is assumed to be proportional to the size of the raw video data to be processed. As seen from Equation (7), the delay in this stage for the MEC server is independent of the users. Therefore, the conditional probability mass function of the computation sub-stage delay \(D_{2,l}^{(i)}\) for the MEC server can be expressed as:  
\[P(D_{2,l}^{(i)}=\frac{D_{1}fB\sum_{q=1}^{l}\bigl{|}B_{q}\bigr{|}}{W_{\text{M}}} \bigl{|}\mathbf{A}_{\text{c},l},\mathbf{A}_{\text{r},l})=1 \tag{8}\]  
where \(\mathbf{A}_{\text{c},l}=\bigl{[}a_{\text{c},l}(n,m)\bigr{]}_{N\times M}\) is the caching matrix, with elements \(a_{\text{c},l}(n,m)\in\{0,1\}\) representing the caching status of the tile at coordinate (\(n\), \(m\)) in the MEC server at the end of the caching stage of the \(l\)-th period; \(\mathbf{A}_{\text{r},l}=\Bigl{\{}\mathbf{A}_{\text{r},l}^{(i)}\Bigr{|}x_{i}=1,i=1,2,\ldots,I\Bigr{\}}\) represents the set of request matrices for all accessed users at the start of the computation sub-phase in the \(l\)-th period, with elements \(\mathbf{A}_{\text{r},l}^{(i)}=\Bigl{[}a_{\text{r},l}^{(i)}(n,m)\Bigr{]}_{N \times M}\) being the request matrix of accessed user \(i\), and \(a_{\text{r},l}^{(i)}(n,m)\in\{0,1\}\) indicating whether the tile at coordinate (\(n\), \(m\)) is within the FoV of user \(i\) at that time. 3.