Video cloud storage method, system, computer device and storage medium

By sharding, compressing and frequency evaluation of video data, combined with Redis storage, the problems of limited storage capacity and low access efficiency in traditional video storage methods are solved, and efficient video data storage and fast access are achieved.

CN118612471BActive Publication Date: 2024-11-19SHENZHEN TIANNUO SECURITY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411073894.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-19
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

Traditional video storage methods rely on a single server or hard disk storage, lack distributed storage technology and efficient data compression algorithms, resulting in limited storage capacity and inability to meet the efficient storage and fast access requirements of large-scale video data.

Method used

By sharding and compressing the input video data, determining the storage location based on the video access frequency evaluation, and using Redis instances for data storage and management, setting expiration time to optimize storage resource allocation and data life cycle.

Benefits of technology

It significantly reduces storage space requirements, improves data transmission efficiency and system response speed, ensures fast access to high-priority data, realizes efficient storage and automatic cleaning of data, and adapts to changes in different data volumes and access frequency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612471B_ABST
    Figure CN118612471B_ABST
Patent Text Reader

Abstract

The present application relates to a video cloud storage method, system, computer equipment and storage medium, the method comprising obtaining input video data, slicing the input video data to obtain multiple video data slicing, and compressing the multiple video data slicing to obtain multiple slicing compressed data corresponding to the input video data; evaluating the access frequency of the input video data to obtain the video access priority, and determining the data storage location of the slicing compressed data according to the video access priority; setting corresponding expiration times for the multiple slicing compressed data according to the video access priority, and storing the multiple slicing compressed data and the expiration times corresponding to the slicing compressed data to the corresponding Redis instance according to the data storage location. The present application has the effect of improving the efficiency of video storage and access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital information transmission, and in particular to a video cloud storage method, system, computer equipment and storage medium. Background Art

[0002] At present, with the development of the Internet and mobile Internet, the production and consumption of video data have shown explosive growth, and the storage and management of video content are facing huge challenges. Traditional video storage methods rely on a single server or hard disk storage, lack distributed storage technology and efficient data compression algorithms, resulting in limited storage capacity and inability to flexibly expand to adapt to the growing amount of data. It is difficult to meet the current needs of efficient storage and fast access to large-scale video data.

[0003] The above-mentioned existing technical solutions have the following defects: the traditional video storage method relies on a single server or hard disk storage, lacks distributed storage technology and efficient data compression algorithms, resulting in low efficiency in storage and access, so there is room for improvement. Summary of the invention

[0004] In order to improve the efficiency of video storage and access, the present application provides a video cloud storage method, system, computer device and storage medium.

[0005] The above-mentioned invention objective of the present application is achieved through the following technical solutions:

[0006] A video cloud storage method, the video cloud storage method comprising:

[0007] Acquire input video data, slice the input video data to obtain a plurality of video data slices, and compress the plurality of video data slices to obtain a plurality of slice compressed data corresponding to the input video data;

[0008] Performing access frequency evaluation on the input video data to obtain a video access priority, and determining a data storage location of the sliced ​​compressed data according to the video access priority;

[0009] Corresponding expiration times are set for the plurality of slice compressed data according to the video access priority, and the plurality of slice compressed data and the expiration times corresponding to the slice compressed data are stored in corresponding Redis instances according to the data storage location.

[0010] By adopting the above technical solution, by obtaining input video data, slicing and compressing it, the storage space requirement can be significantly reduced, while the data transmission efficiency is improved, the efficiency of video data processing is improved, and the system can maintain good performance when processing large amounts of video data; the access frequency of the input video data is evaluated to obtain the video access priority, and the data storage location of the slicing compressed data is determined according to the video access priority, which can optimize the allocation of storage resources, enable high-priority data to be quickly accessed, and improve the system's response speed and user experience; by setting the corresponding expiration time and storing multiple slicing compressed data and their corresponding expiration times in the corresponding multiple Redis instances, the high read and write performance of Redis can be used to achieve fast data access, and at the same time, the expiration time is set to manage the data life cycle, automatically clean up data that is no longer needed, and maintain efficient system operation and reasonable use of resources.

[0011] In one example, the present application may be further configured as follows: the input video data is sliced ​​to obtain a plurality of video data slices, and the plurality of video data slices are compressed, specifically including:

[0012] Acquire a video storage space for the input video, and if the video storage space does not exceed a preset storage space, slice the input video data according to a preset time slicing strategy, and compress the plurality of video data slices using a low compression rate algorithm;

[0013] When the video storage space reaches the preset storage space, the input video data is sliced ​​according to a preset space slicing strategy, and a high compression rate algorithm is used to compress the multiple video data slices.

[0014] By adopting the above technical solution, when the video storage space does not exceed the preset storage space, the input video data is sliced ​​according to the preset time slicing strategy, and a low compression rate algorithm is used to compress multiple video data slices, so that the processing speed can be guaranteed, and at the same time, the integrity and quality of the video data are guaranteed when the storage space is sufficient, thereby improving the processing efficiency of the video data during initial storage and adapting to the needs of real-time processing and rapid response; and when the video storage space reaches the preset storage space, the input video data is sliced ​​according to the preset space slicing strategy, and a high compression rate algorithm is used to compress multiple video data slices, which can effectively reduce the storage space occupation and optimize the utilization of storage resources. Although the high compression rate algorithm has a slow compression and decompression speed, it can significantly reduce the data volume, so that the system can still accommodate more video data when storage resources are tight, thereby ensuring the stability of the system and the persistent preservation of data.

[0015] In one example, the present application may be further configured as follows: the access frequency evaluation of the input video data to obtain the video access priority specifically includes:

[0016] The video length data and the video type data of the input video are obtained, and the video length data and the video type data are analyzed according to a preset access evaluation rule to obtain the video access priority.

[0017] By adopting the above technical solution, by obtaining the video length data and video type data of the input video and analyzing the video length data and video type data according to preset access evaluation rules, the access priority of the video can be preliminarily determined, providing an initial basis for determining the data storage location of subsequent video data.

[0018] In one example, the present application may be further configured as follows: after evaluating the access frequency of the input video data to obtain the video access priority, the application may further include:

[0019] The video access record of the input video is acquired in real time, and a secondary evaluation is performed according to the video access record, and the video access priority is updated according to the secondary evaluation result.

[0020] By adopting the above technical solution, by obtaining the video access records of the input video in real time, performing a secondary evaluation based on the video access records, and updating the video access priority based on the secondary evaluation results, the priority of the video can be dynamically adjusted, so that the system can reflect the actual usage of the user in real time, ensuring that hot video data can be accessed quickly and preferentially, thereby improving the user experience and system response speed.

[0021] In one example, the present application may be further configured as follows: determining the data storage location of the slice compressed data according to the video access priority specifically includes:

[0022] In a case where the video access priority reaches a preset priority threshold, determining that the data storage location is a memory location;

[0023] In a case where the video access priority is lower than a preset priority threshold, the data storage location is determined to be a disk location.

[0024] By adopting the above technical solution, when the video access priority reaches a preset priority threshold, the data storage location is determined to be a memory location, so that fast access to high-priority video data can be guaranteed, and the high read and write speed of the memory can be utilized to enable frequently accessed data to be quickly provided to users; and when the video access priority is lower than the preset priority threshold, the data storage location is determined to be a disk location, so that memory resources can be saved, low-priority video data can be stored in the disk, and the large storage capacity and low cost of the disk can be utilized to achieve long-term storage of data.

[0025] In one example, the present application may be further configured as follows: storing the plurality of shard compressed data and their corresponding expiration times in a corresponding Redis instance according to the data storage location specifically includes:

[0026] According to the amount of the sharded compressed data, a corresponding number of the Redis instances are generated in the corresponding data storage locations;

[0027] According to the data storage location, the plurality of sharded compressed data are stored in a corresponding number of Redis instances.

[0028] By adopting the above technical solution, by generating a corresponding number of Redis instances in the corresponding data storage location according to the number of sharded compressed data, the number of Redis instances can be dynamically adjusted according to the change in data volume, ensuring the load balancing of each instance and improving the scalability and flexibility of the system; according to the data storage location, multiple sharded compressed data are stored in the corresponding memory location or disk location of the corresponding multiple Redis instances, and the distributed characteristics of Redis can be used to achieve efficient storage and access of data, ensuring that the system can still maintain high performance when processing large-scale data, thereby adapting to changes in different data volumes and access frequencies, and improving the stability of the system and data processing capabilities.

[0029] In one example, the present application may be further configured as follows: the video cloud storage method further includes:

[0030] A multi-layer cache architecture is adopted, and the shard compressed data is stored in the second cache space while the shard compressed data is stored in the multiple Redis instances.

[0031] By adopting the above technical solution and a multi-layer cache architecture, while storing sharded compressed data in multiple Redis instances, the sharded compressed data is stored in the second cache space. This can provide an additional cache layer to ensure data availability and fast access when a Redis instance fails, thereby improving the overall performance and stability of the system, ensuring that users can always quickly obtain the required data, and optimizing the user experience.

[0032] The second object of the invention is achieved by the following technical solutions:

[0033] A video cloud storage system, the video cloud storage system comprising:

[0034] A slice compression module is used to obtain input video data, slice the input video data to obtain multiple video data slices, and compress the multiple video data slices to obtain multiple slice compressed data corresponding to the input video data;

[0035] A location confirmation module, used to evaluate the access frequency of the input video data, obtain the video access priority, and determine the data storage location of the slice compressed data according to the video access priority;

[0036] The data storage module is used to set corresponding expiration times for the plurality of slice compressed data according to the video access priority, and store the plurality of slice compressed data and the expiration times corresponding to the slice compressed data in corresponding Redis instances according to the data storage location.

[0037] By adopting the above technical solution, by obtaining input video data, slicing and compressing it, the storage space requirement can be significantly reduced, while the data transmission efficiency is improved, the efficiency of video data processing is improved, and the system can maintain good performance when processing large amounts of video data; the access frequency of the input video data is evaluated to obtain the video access priority, and the data storage location of the slicing compressed data is determined according to the video access priority, which can optimize the allocation of storage resources, enable high-priority data to be quickly accessed, and improve the system's response speed and user experience; by setting the corresponding expiration time and storing multiple slicing compressed data and their corresponding expiration times in the corresponding multiple Redis instances, the high read and write performance of Redis can be used to achieve fast data access, and at the same time, the expiration time is set to manage the data life cycle, automatically clean up data that is no longer needed, and maintain efficient system operation and reasonable use of resources.

[0038] The third objective of the present application is achieved through the following technical solutions:

[0039] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned video cloud storage method when executing the computer program.

[0040] The fourth objective of the present application is achieved through the following technical solutions:

[0041] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned video cloud storage method when executed by a processor.

[0042] In summary, this application includes the following beneficial technical effects:

[0043] 1. By acquiring input video data, slicing and compressing it, the storage space requirement can be significantly reduced, while improving the data transmission efficiency and the processing efficiency of video data, so that the system can maintain good performance when processing large amounts of video data; by evaluating the access frequency of input video data, obtaining the video access priority, and determining the data storage location of the slicing compressed data according to the video access priority, the allocation of storage resources can be optimized, so that high-priority data can be quickly accessed, and the system response speed and user experience can be improved; by setting the corresponding expiration time and storing multiple slicing compressed data and their corresponding expiration times in the corresponding multiple Redis instances, the high read and write performance of Redis can be used to achieve fast data access, and at the same time, by setting the expiration time to manage the data life cycle, automatically clean up data that is no longer needed, and maintain efficient system operation and reasonable use of resources;

[0044] 2. By slicing the input video data according to the preset time slicing strategy when the video storage space does not exceed the preset storage space, and using a low compression rate algorithm to compress multiple video data slices, the processing speed can be guaranteed, and at the same time, the integrity and quality of the video data can be guaranteed when the storage space is sufficient, thereby improving the processing efficiency of the video data during initial storage and adapting to the needs of real-time processing and rapid response; and when the video storage space reaches the preset storage space, the input video data is sliced ​​according to the preset space slicing strategy, and a high compression rate algorithm is used to compress multiple video data slices, which can effectively reduce the storage space occupation and optimize the use of storage resources. Although the high compression rate algorithm has a slow compression and decompression speed, it can significantly reduce the data volume, so that the system can still accommodate more video data when storage resources are tight, thereby ensuring the stability of the system and the persistent preservation of data;

[0045] 3. By generating a corresponding number of Redis instances in the corresponding data storage location according to the amount of sharded compressed data, the number of Redis instances can be dynamically adjusted according to changes in the amount of data to ensure load balancing of each instance and improve the scalability and flexibility of the system. By storing multiple sharded compressed data in the corresponding memory location or disk location according to the data storage location, the distributed characteristics of Redis can be used to achieve efficient storage and access of data, ensuring that the system can still maintain high performance when processing large-scale data, thereby adapting to changes in different data volumes and access frequencies and improving the stability of the system and data processing capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a flow chart of a video cloud storage method in one embodiment of the present application;

[0047] Figure 2 It is a flowchart for implementing step S10 in the video cloud storage method in one embodiment of the present application;

[0048] Figure 3 It is a flowchart for implementing step S20 in the video cloud storage method in one embodiment of the present application;

[0049] Figure 4 is another flow chart of step S20 in the video cloud storage method in one embodiment of the present application;

[0050] Figure 5 It is a flowchart for implementing step S30 in the video cloud storage method in one embodiment of the present application;

[0051] Figure 6 This is another implementation flow chart of the video cloud storage method in one embodiment of the present application;

[0052] Figure 7 This is a principle block diagram of a video cloud storage system in one embodiment of the present application;

[0053] Figure 8 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The present application is further described in detail below in conjunction with the accompanying drawings.

[0055] In one embodiment, if Figure 1 As shown, the present application discloses a video cloud storage method, which specifically includes the following steps:

[0056] S10: Acquire input video data, slice the input video data to obtain a plurality of video data slices, and compress the plurality of video data slices to obtain a plurality of slice compressed data corresponding to the input video data.

[0057] Specifically, when obtaining input video data, a video processing library such as FFmpeg is used to divide the video file into multiple segments according to time period or size, and the input video data is fragmented. The fragmented video data is compressed using an efficient compression algorithm such as LZ4 or Zstandard to reduce storage space and transmission bandwidth, and after compression processing, multiple fragmented compressed data are obtained.

[0058] S20: Evaluate the access frequency of the input video data to obtain the video access priority, and determine the data storage location of the sliced ​​compressed data according to the video access priority.

[0059] In this embodiment, the data storage location refers to the location where the slice compressed data needs to be stored, such as a memory and a hard disk.

[0060] Specifically, the access frequency is evaluated by analyzing the metadata and user behavior data of the video, the length data and type data of the input video are obtained, and these data are analyzed according to the preset access evaluation rules, so as to preliminarily determine the access priority of the video. For example, hot news or popular movie trailers are usually set to a higher priority. The corresponding priority rules can be set in advance according to different usage needs. At the same time, the access record of the video will be obtained in real time after the video is released, including the number of times the user plays it, the viewing time and other information, and then a secondary evaluation is performed based on these records, and the access priority of the video is further updated to dynamically adjust the storage priority of the video to ensure that the video data with high frequency access can be quickly obtained by users, and the location where the fragmented compressed data should be stored is determined according to different priorities.

[0061] S30: setting corresponding expiration times for the plurality of slice compressed data according to the video access priority, and storing the plurality of slice compressed data and the expiration times corresponding to the slice compressed data in corresponding Redis instances according to the data storage location.

[0062] In this embodiment, the expiration time refers to the time data that the slice compressed data needs to be stored.

[0063] Specifically, video data with high video access priority usually requires a longer expiration time to ensure that it is kept in memory for a longer time to facilitate quick access. According to the video access priority, the expiration time of each shard compressed data is set, and then it is stored in multiple Redis instances according to the data storage location. The configuration and use of Redis instances should be adjusted according to the number of shard compressed data, and a corresponding number of Redis instances should be generated, and the shard compressed data and its corresponding expiration time should be stored in these instances.

[0064] In one embodiment, if Figure 2As shown, in step S10, the input video data is sliced ​​to obtain a plurality of video data slices, and the plurality of video data slices are compressed, which specifically includes:

[0065] S11: Obtain a video storage space for the input video, and when the video storage space does not exceed a preset storage space, slice the input video data according to a preset time slicing strategy, and compress the multiple video data slices using a low compression rate algorithm.

[0066] Specifically, first check whether the current video storage space exceeds the preset storage space threshold. If not, the input video data is segmented according to the preset time segmentation strategy, such as one segment every 5 minutes. These segmented video data will be compressed using a low compression rate algorithm such as LZ4 to ensure that while ensuring a certain compression effect, the time overhead of compression and decompression is minimized to improve the processing efficiency of the system.

[0067] S12: When the video storage space reaches the preset storage space, the input video data is sliced ​​according to the preset space slicing strategy, and a high compression rate algorithm is used to compress the multiple video data slices.

[0068] Specifically, when the video storage space reaches or exceeds the preset storage space threshold, in order to utilize the storage space more efficiently, it is necessary to segment the input video data according to the preset space segmentation strategy, for example, one segment per 100MB, and then use a high compression algorithm such as Zstandard to compress these video data segments. Although the compression and decompression speed of this algorithm is relatively slow, it can significantly reduce the storage volume of the data, thereby storing more video data in a limited storage space.

[0069] In one embodiment, if Figure 3 As shown, in step S20, the access frequency of the input video data is evaluated to obtain the video access priority, which specifically includes:

[0070] S21: Obtain video length data and video type data of an input video, and analyze the video length data and video type data according to a preset access evaluation rule to obtain a video access priority.

[0071] Specifically, when video data is stored for the first time, the system will obtain the length data and type data of the video, such as news, movie trailers, user-generated content, etc. It can also set corresponding priority rules in advance according to different usage requirements, set the priorities of different video types, and analyze these data according to preset access evaluation rules to determine the initial access priority of the video. For example, shorter videos or hot news videos may be set to a higher priority.

[0072] S22: Obtain the video access record of the input video in real time, perform a secondary evaluation based on the video access record, and update the video access priority based on the secondary evaluation result.

[0073] Specifically, the system will continuously monitor and record the access status of the video, including the number of times the user plays it, the viewing time, the access frequency and other information. By performing real-time analysis on these access records, the access priority of the video can be dynamically adjusted. For example, if a video that was initially set to a low priority has a surge in visits within a short period of time, the system will increase its access priority based on the secondary evaluation results in order to improve the access efficiency of the video.

[0074] In one embodiment, if Figure 4 As shown, in step S20, the data storage location of the slice compressed data is determined according to the video access priority, which specifically includes:

[0075] S23: When the video access priority reaches a preset priority threshold, determining that the data storage location is a memory location.

[0076] Specifically, when the system evaluates that the video access priority reaches or exceeds the preset priority threshold, the system will store these high-priority video shard data in memory. Memory storage usually uses high-performance Redis instances to ensure fast read and write speeds and low-latency access to meet frequent access needs.

[0077] S24: When the video access priority is lower than a preset priority threshold, determining the data storage location to be a disk location.

[0078] Specifically, for video segment data whose access priority is assessed to be lower than a preset priority threshold, the system will store it on disk. Disk storage can use a persistent Redis instance or other disk storage solutions to provide larger storage capacity while reducing memory usage and storage costs.

[0079] In one embodiment, if Figure 5 As shown, in step S30, multiple sharded compressed data and their corresponding expiration times are stored in corresponding Redis instances according to the data storage location, specifically including:

[0080] S31: Generate a corresponding number of Redis instances in corresponding data storage locations according to the number of sharded compressed data.

[0081] Specifically, according to the amount of compressed data in the video fragments, multiple Redis instances are generated in the corresponding data storage location such as memory or disk. For example, if the number of fragments after the video is fragmented is 3 and it is a high-priority video, the system will generate 3 Redis instances in memory to store this data to balance the load and improve storage performance.

[0082] S32: According to the data storage location, the plurality of shard compressed data are stored in a corresponding number of Redis instances.

[0083] Specifically, according to the previously determined data storage location, the sharded compressed data is stored in the corresponding multiple Redis instances. For example, high-priority video shard data will be stored in the Redis instance in the memory location, while low-priority data will be stored in the Redis instance in the disk location. At the same time, a corresponding expiration time is set for each data fragment to ensure that expired data is automatically cleaned up after a certain period of time to release storage space.

[0084] In one embodiment, if Figure 6 As shown, the video cloud storage method also includes:

[0085] S40: A multi-layer cache architecture is adopted to store the sharded compressed data in a second cache space while storing the sharded compressed data in multiple Redis instances.

[0086] Specifically, in order to further improve data access efficiency and system reliability, the system adopts a multi-layer cache architecture. While storing sharded compressed data in multiple Redis instances, it also stores these data in a second cache space, such as a local cache or other cache system. This can provide an additional cache layer to ensure data availability and fast access when a Redis instance fails, effectively improving data access speed and reliability.

[0087] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0088] In one embodiment, a video cloud storage system is provided, which corresponds one-to-one to the video cloud storage method in the above embodiment. Figure 7 As shown, the video cloud storage system includes a fragment compression module, a location confirmation module, and a data storage module. The detailed description of each functional module is as follows:

[0089] A slice compression module is used to obtain input video data, slice the input video data to obtain multiple video data slices, and compress the multiple video data slices to obtain multiple slice compression data corresponding to the input video data;

[0090] A location confirmation module, used to evaluate the access frequency of the input video data, obtain the video access priority, and determine the data storage location of the slice compressed data according to the video access priority;

[0091] The data storage module is used to set corresponding expiration times for the plurality of slice compressed data according to the video access priority, and store the plurality of slice compressed data and the expiration times corresponding to the slice compressed data in corresponding Redis instances according to the data storage location.

[0092] Optionally, the fragment compression module specifically includes:

[0093] A small space processing submodule is used to obtain a video storage space of the input video, and when the video storage space does not exceed a preset storage space, slice the input video data according to a preset time slicing strategy, and compress the multiple video data slices using a low compression rate algorithm;

[0094] The large space processing submodule is used to slice the input video data according to a preset space slicing strategy when the video storage space reaches a preset storage space, and compress the multiple video data slices using a high compression rate algorithm.

[0095] Optionally, the location confirmation module includes:

[0096] An initial priority submodule, used to obtain video length data and video type data of the input video, and analyze the video length data and the video type data according to a preset access evaluation rule to obtain the video access priority;

[0097] The priority updating submodule is used to obtain the video access record of the input video in real time, perform a secondary evaluation based on the video access record, and update the video access priority based on the secondary evaluation result.

[0098] Optionally, the location confirmation module includes:

[0099] A high priority processing submodule, configured to determine that the data storage location is a memory location when the video access priority reaches a preset priority threshold;

[0100] The low priority processing submodule is used to determine that the data storage location is a disk location when the video access priority is lower than a preset priority threshold.

[0101] Optionally, the data storage module specifically includes:

[0102] An instance generation submodule, used to generate a corresponding number of the Redis instances in the corresponding data storage location according to the number of the sharded compressed data;

[0103] The data storage submodule is used to store the plurality of shard compressed data in a corresponding number of Redis instances according to the data storage location.

[0104] Optionally, the video cloud storage system also includes:

[0105] The multi-layer storage module is used to adopt a multi-layer cache architecture, and at the same time as the slice compressed data is stored in the multiple Redis instances, the slice compressed data is stored in the second cache space.

[0106] For the specific definition of the video cloud storage system, please refer to the definition of the video cloud storage method above, which will not be repeated here. Each module in the above video cloud storage system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0107] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video cloud storage method is implemented.

[0108] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0109] Acquire input video data, slice the input video data to obtain multiple video data slices, and compress the multiple video data slices to obtain corresponding multiple slice compressed data;

[0110] Evaluate the access frequency of input video data to obtain video access priority, and determine the data storage location of the sliced ​​compressed data according to the video access priority;

[0111] Corresponding expiration times are set for the multiple shard compressed data according to the video access priority, and the multiple shard compressed data and their corresponding expiration times are stored in corresponding multiple Redis instances according to the data storage location.

[0112] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0113] Acquire input video data, slice the input video data to obtain multiple video data slices, and compress the multiple video data slices to obtain corresponding multiple slice compressed data;

[0114] Evaluate the access frequency of input video data to obtain video access priority, and determine the data storage location of the sliced ​​compressed data according to the video access priority;

[0115] Corresponding expiration times are set for the multiple shard compressed data according to the video access priority, and the multiple shard compressed data and their corresponding expiration times are stored in corresponding multiple Redis instances according to the data storage location.

[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0117] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

[0118] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A video cloud storage method, characterized in that: The video cloud storage method comprises: Obtain input video data, slice the input video data to obtain a plurality of video data slices, and compress the plurality of video data slices to obtain a plurality of slice compressed data corresponding to the input video data; the slice of the input video data to obtain a plurality of video data slices, and compressing the plurality of video data slices specifically comprises: obtaining a video storage space for the input video data, and when the video storage space does not exceed a preset storage space, slicing the input video data according to a preset time slicing strategy, and compressing the plurality of video data slices using a low compression rate algorithm; when the video storage space reaches the preset storage space, slicing the input video data according to a preset space slicing strategy, and compressing the plurality of video data slices using a high compression rate algorithm; Performing access frequency evaluation on the input video data to obtain a video access priority, and determining a data storage location of the sliced ​​compressed data according to the video access priority; performing access frequency evaluation on the input video data to obtain a video access priority specifically includes: obtaining video length data and video type data of the input video data, and analyzing the video length data and the video type data according to a preset access evaluation rule to obtain the video access priority; Corresponding expiration times are set for the plurality of slice compressed data according to the video access priority, and the plurality of slice compressed data and the expiration times corresponding to the slice compressed data are stored in corresponding Redis instances according to the data storage location.

2. The video cloud storage method according to claim 1, characterized in that: After evaluating the access frequency of the input video data to obtain the video access priority, the method further includes: The video access record of the input video data is acquired in real time, and a secondary evaluation is performed according to the video access record, and the video access priority is updated according to the secondary evaluation result.

3. The video cloud storage method according to claim 1, characterized in that: Determining the data storage location of the slice compressed data according to the video access priority specifically includes: In a case where the video access priority reaches a preset priority threshold, determining that the data storage location is a memory location; In a case where the video access priority is lower than a preset priority threshold, the data storage location is determined to be a disk location.

4. The video cloud storage method according to claim 3, characterized in that: The storing the plurality of shard compressed data and their corresponding expiration times in the corresponding Redis instance according to the data storage location specifically includes: According to the amount of the sharded compressed data, a corresponding number of the Redis instances are generated in the corresponding data storage locations; According to the data storage location, the plurality of sharded compressed data are stored in a corresponding number of Redis instances.

5. The video cloud storage method according to claim 1, characterized in that: The video cloud storage method also includes: A multi-layer cache architecture is adopted, and the shard compressed data is stored in the second cache space while the shard compressed data is stored in the multiple Redis instances.

6. A video cloud storage system, characterized in that: The video cloud storage system comprises: A slice compression module is used to obtain input video data, slice the input video data to obtain multiple video data slices, and compress the multiple video data slices to obtain multiple slice compressed data corresponding to the input video data; A location confirmation module, used to evaluate the access frequency of the input video data, obtain the video access priority, and determine the data storage location of the slice compressed data according to the video access priority; A data storage module, used for setting corresponding expiration times for the plurality of slice compressed data according to the video access priority, and storing the plurality of slice compressed data and the expiration times corresponding to the slice compressed data in a corresponding Redis instance according to the data storage location; The fragment compression module specifically includes: A small space processing submodule, used for obtaining a video storage space for the input video data, slicing the input video data according to a preset time slicing strategy when the video storage space does not exceed a preset storage space, and compressing a plurality of the video data slices using a low compression rate algorithm; A large space processing submodule, configured to slice the input video data according to a preset space slicing strategy when the video storage space reaches a preset storage space, and compress a plurality of the video data slices using a high compression rate algorithm; The location confirmation module comprises: An initial priority submodule, used to obtain video length data and video type data of the input video data, and analyze the video length data and the video type data according to a preset access evaluation rule to obtain the video access priority; The priority updating submodule is used to obtain the video access record of the input video data in real time, perform a secondary evaluation based on the video access record, and update the video access priority based on the secondary evaluation result.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the video cloud storage method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the video cloud storage method according to any one of claims 1 to 5 are implemented.