# Replicas Strategy and Cache Optimization of Video Surveillance Systems Based on Cloud Storage
## 4 Dynamic Redundant Replicas Mechanism Based on Security Levels  
To ensure the security and storage time of the video data segments, it is necessary to store several data replicas in different nodes when storing the video data segment. However, in various situations, the requirements of the security for video files are different. Even in the same scene, security requirements may differ in different monitoring locations. For example, a checkout counter needs a high security level. Users [5; 6] define the replicas mechanism in the distributed surveillance system, and users set the number of redundant replicas in advance. This mechanism can effectively guarantee the security of the video data. However, the coarse-grained redundant replicas mechanism does not accurately reflect the security level of video files [26]. Keeping meaningless video data will cause the storage resources to be wasted. Besides, man-made definition replicas mechanism may lose critical data. From the above analysis, we put forward a dynamic redundant replicas mechanism based on the video file security levels (SL-DRM). It keeps different redundant replicas based on different security levels. The security level can be dynamically adjusted according to some influencing factors. In the current surveillance field, the factors affecting the number of replicas of the video data only are the retention time, man-made definition, access hit of video files, and intelligent video analysis results. Intelligent video analysis directly indicates whether the video file has saved value; when the video data is saved for the first time, the user-defined security level shows the importance of the data to the user. With the increase of the retention time, the security level of video data needs to consider the retention time, and access hit. Access hit can measure the importance of video files to users; storing redundant copies for a long time may result in the consumption of a significant amount of storage space. Hence, the retention time also has a considerable influence on the video security level. There is no direct correlation between the factors, but their changes affect the security level of the video file. Table 1 shows the notations that we will use. The replica management strategy can divide into static and the dynamic replica management strategy based on the number of copies and the fixed position of the replica placement. In the current business system, the static replica strategy is adopted; for example, HDFS creates three copies of each file by default in the number of backups. The cost of data management would increase with the number of replicas increasing. Too many copies may significantly enhance the availability, but it also brings unnecessary consumption [20]. Hence, we take the default copy number of HDFS as the maximum number of copies and define four security levels for video files. As shown in Table 2, Level 0 is the lowest level of security, and it does not retain redundant replica of the video file; level 1 only saves one redundant replica of the video file; level 2 and level 3 increase the number of redundant replicas in turn. Then, according to the various factors that affect the security level of video files, the security levels of each file will downgrade or upgrade through some formulas. When calculating the security levels of video files, we mainly consider the following four factors:  
1. \(I_{x}\) represents User-specify security levels. It can be divided into three levels: lower, normal, and important. As shown in Table 3, 0 represents lower, 1 represents normal, and 2 represents important. 2. \(T_{x}\) denotes effects of retention days on video file \(x\) security levels. As the number of days of video data storage increases, the security levels of the data will gradually decrease, but the video file does not need to be considered for the first time. 3. \(H_{x}\) denotes the access hit of the video file \(x\).The more frequent access to video files, the more critical the video files, and the higher the security levels are. 4.