# Replicas Strategy and Cache Optimization of Video Surveillance Systems Based on Cloud Storage
## 4 Dynamic Redundant Replicas Mechanism Based on Security Levels
\(A_{x}\) denotes the analyzing result for the video file \(x\) by using the method introduced in [27]. The intelligent video analysis algorithm used in this paper is the Edge Frame Difference and Gaussian Mixture Model algorithm (EFD-GMM) [27]. EFD-GMM is an improved algorithm based on the Edge Frame Difference and Gaussian Mixture Model. It can model the moving objects and detect the moving objects. The algorithm can help to solve the problem of noise, illumination, and error \begin{table}
\begin{tabular}{c c c} \hline \hline
**Notations** & **Definition** \\ \hline \(x\) & video file \(x\) \\ \(n\) & number of redundant replicas \\ \(S_{x-init}\) & initial security level of video file \(x\) \\ \(S_{x}\) & security level of video file \(x\) \\ \(I_{x}\) & security level defined by users of video file \(x\) \\ \(A_{x}\) & intelligent video analysis result of video file \(x\) \\ \(m_{i}\) & number of accesses to the \(i\)-th replica \\ \(H_{x}\) & access hit of video file \(x\) \\ \(T_{x}\) & effects of retention days on the security level of video file \(x\) \\ \(t\) & retention days of video file \(x\) \\ \(\partial_{i}\) & Constant parameter \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Notations Definition. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Number** & **Level** & **Demotion** & **Upgrade** & **Redundant Replicas** \\ \hline
1 & 0 & N & Y & 0 \\
2 & 1 & Y & Y & 1 \\
3 & 2 & Y & Y & 2 \\
4 & 3 & Y & N & 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Security level definition. target. This algorithm can analyze the moving target in video data. For the results of the intelligent video analysis, if the target is detected in video file \(x\), \(A_{x}=1\); Otherwise the \(A_{x}=0\). There is no retention time, access hit and other factors when the video saved for the first time. Hence, users determine security level of video file and specify security levels and intelligent video analysis results. We propose Formula (1) to calculate the initial security level of the video file. Here, \(A_{x}\) has two kinds of values, 0 means no value and 1 means valuable. \[ \begin{cases}\begin{subarray}{c}S_{x-init}=I_{x}+A_{x}\\ A_{x}\in\{0,1\}\end{subarray}\end{cases} t=1 \tag{1}\]  
With the video files' retention time growing and the number of accesses increasing, the security level will change relatively. Firstly, we give Formula (2) to calculate the access hit of the video file. As shown in Formula (2), \(H_{x}\) will increase as the number of visits increases, also \(H_{x}<1\). \[H_{x}(m)=\frac{\sum_{i=1}^{n+1}m_{i}}{1+\sum_{i=1}^{n+1}m_{i}}\;\;m_{i}\geq 0 \tag{2}\]  
Keeping multiple redundant replicas for a long time can cause a lot of consumption of storage system. As the retention time increases, the effects on the security level will higher, at the same time the security level of the video file will downgrade. Hence, \(t\) and \(T_{x}\) are positively related. The effects of retention time on security level can be defined in Formula (3). The reason we take the logarithmic relationship is that logarithm does not change the nature of the data and the correlation, but the scale of the variable is compressed, such as 800/200 = 4, but log800/log200 = 1.2616, the data is more stable, and it also weakens the collinearity and heteroscedasticity of the model. The logarithmic relationship dramatically reflects the impact of factors on variables. \[T_{x}(t)=\log_{2}\biggl{(}\frac{t}{2}\biggr{)}\;t>1 \tag{3}\]  
In summary, we have considered all the factors that affect the security level of the video file. Finally, we get Formula (4) to calculate the video file security level. The size of the \(\partial_{i}\) needs to consider the application scenario. Users can define weights according to their own needs such as in the case of more cold data, \(\partial_{3}\) occupies a more significant value; if it is a high-access system, \(\partial_{2}\) holds significant weight. They can set a higher value on their more concerned factor which makes the proposed strategy adaptable.