Data storage method and apparatus

By storing security data separately as raw data and index data, and using different compression algorithms and time information to distinguish time sequences, the problems of high index data ratio and disordered time sequence are solved, thereby improving storage efficiency and data accuracy.

CN115705312BActive Publication Date: 2025-11-18ZHEJIANG UNIVIEW TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110913245.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-10
Publication Date
2025-11-18
Estimated Expiration
2041-08-10

AI Technical Summary

Technical Problem

In existing security video and image data storage, indexed data accounts for a high proportion and cannot effectively distinguish time-series changes, leading to playback abnormalities or inaccurate data.

Method used

The video data is divided into frame groups, index data is generated and stored using different compression methods. The appropriate compression algorithm is selected based on the video real-time performance and system CPU utilization. The index data is stored in partitions and time information is added to distinguish the timing sequence.

Benefits of technology

It improves data storage utilization, reduces storage and read/write network bandwidth, and solves the problem of timing disorder in the data storage process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115705312B_ABST
    Figure CN115705312B_ABST
Patent Text Reader

Abstract

The application discloses a data storage method and device. The method comprises the following steps: continuously receiving video data; creating a data file of the received video data; extracting a plurality of frame groups from the received video data; generating index data of each frame group; determining a first compression mode; when the number of the index data reaches a preset number, compressing the index data of the preset number by using the first compression mode, and storing the index data and the first compression mode in an index file. The data storage method and device can store data in a storage format different from the prior art, and can improve data storage utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of security, and more particularly to a data storage method and apparatus. Background Technology

[0002] In the security field, video and image data are typically stored in both a raw copy and an index copy for quick retrieval of the raw data.

[0003] Taking video storage as an example, it's common practice to store index content and data content in the same file, allocated in a fixed ratio. For example, a storage ratio of 1:1024 (i.e., the currently used storage format) is used. Figure 1 As shown in the image, storing 1GB of video data requires 1MB of index data. Relatively speaking, the index accounts for a significant portion of the data. Furthermore, current file organization formats often fail to distinguish between different video segments when there are temporal changes, leading to playback errors or playing data that is not the intended video. Summary of the Invention

[0004] This application provides a data storage method and apparatus that enables data storage in a storage format different from existing technologies and improves data storage utilization.

[0005] This application provides a data storage method, including:

[0006] Continuous reception of video data;

[0007] Create a data file for the received video data;

[0008] Multiple frame groups are extracted from the received video data; index data for each frame group is generated; a first compression method is determined; when the number of index data reaches a preset number, the preset number of index data is compressed using the first compression method and stored in the index file together with the identifier of the first compression method.

[0009] In one exemplary embodiment, before generating the index data for each frame group, the process includes:

[0010] Record the extraction time of I-frames in each frame group;

[0011] For each frame group, determine whether a time jump has occurred;

[0012] The step of determining whether a time jump has occurred for each frame group includes:

[0013] If the extraction time of the I-frame of the current frame group minus the extraction time of the I-frame of the previous frame group is greater than a first preset threshold, or if the extraction time of the I-frame of the current frame group is less than the extraction time of the I-frame of the previous frame group, then it is determined that a time jump has occurred in the current frame group.

[0014] In one exemplary embodiment, when a time jump is determined, the data file and index file are recreated based on the video data received at the time of determination.

[0015] In one exemplary embodiment, determining the first compression method includes:

[0016] The first compression method is determined based on the real-time nature of the video data and the CPU utilization of the system.

[0017] The step of determining the first compression method based on the real-time nature of the video data and the current system CPU utilization includes:

[0018] When the video data is real-time data, the first compression method is determined to be a compression method that includes the first compression algorithm;

[0019] When the video data is non-real-time data and the current system's CPU utilization rate is greater than a preset utilization rate threshold, the first compression method is determined to be a compression method that includes the second compression algorithm.

[0020] The first compression algorithm is an algorithm with a compression ratio lower than a preset compression ratio threshold and a compression throughput greater than or equal to a preset compression throughput threshold; the second compression algorithm is an algorithm with a compression ratio higher than or equal to a preset compression ratio threshold and a compression throughput less than a preset compression throughput threshold.

[0021] In one exemplary embodiment, the index file contains an index region;

[0022] The index region includes one or more index sub-regions;

[0023] Each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region that is different from the one stored previously.

[0024] In one exemplary embodiment, each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region different from the one stored previously, and further includes:

[0025] Determine if the size of the index data stored in the current index sub-region is less than the storage capacity of the current index sub-region. If so, continuously store 0 and / or 1 into the current index sub-region until the size of the data stored in the current index sub-region equals the storage capacity of the current index sub-region.

[0026] In one exemplary embodiment, the index file further includes a file area; the file area includes information about a second compression method and the compressed data file.

[0027] The compressed file information refers to the information of a data file compressed using the second compression method.

[0028] In one exemplary embodiment, the filename of the data file includes the file storage start time and file sequence number;

[0029] The file sequence number is used to distinguish the storage order of files with the same storage start time;

[0030] The file number of the current data file and the file number of the next data file are in an increasing relationship.

[0031] In one exemplary embodiment, the index data further includes the extraction time of the I-frame, the storage location of the I-frame, and the length of the Group of Pictures (GOP).

[0032] This application provides a data storage device, including a memory and a processor.

[0033] The memory is used to store programs for data storage;

[0034] The processor is configured to read and execute the program for data storage, and perform the following operations:

[0035] Continuous reception of video data;

[0036] Create a data file for the received video data;

[0037] Multiple frame groups are extracted from the received video data; index data for each frame group is generated; a first compression method is determined; when the number of index data reaches a preset number, the preset number of index data is compressed using the first compression method and stored in the index file together with the identifier of the first compression method.

[0038] In one exemplary embodiment, before generating the index data for each frame group, the process includes:

[0039] Record the extraction time of I-frames in each frame group;

[0040] For each frame group, determine whether a time jump has occurred;

[0041] The step of determining whether a time jump has occurred for each frame group includes:

[0042] If the extraction time of the I-frame of the current frame group minus the extraction time of the I-frame of the previous frame group is greater than a first preset threshold, or if the extraction time of the I-frame of the current frame group is less than the extraction time of the I-frame of the previous frame group, then it is determined that a time jump has occurred in the current frame group.

[0043] In one exemplary embodiment, when a time jump is determined, the data file and index file are recreated based on the video data received at the time of determination.

[0044] In one exemplary embodiment, determining the first compression method includes:

[0045] The first compression method is determined based on the real-time nature of the video data and the CPU utilization of the system.

[0046] The step of determining the first compression method based on the real-time nature of the video data and the current system CPU utilization includes:

[0047] When the video data is real-time data, the first compression method is determined to be a compression method that includes the first compression algorithm;

[0048] When the video data is non-real-time data and the current system's CPU utilization rate is greater than a preset utilization rate threshold, the first compression method is determined to be a compression method that includes the second compression algorithm.

[0049] The first compression algorithm is an algorithm with a compression ratio lower than a preset compression ratio threshold and a compression throughput greater than or equal to a preset compression throughput threshold; the second compression algorithm is an algorithm with a compression ratio higher than or equal to a preset compression ratio threshold and a compression throughput less than a preset compression throughput threshold.

[0050] In one exemplary embodiment, the index file contains an index region;

[0051] The index region includes one or more index sub-regions;

[0052] Each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region that is different from the one stored previously.

[0053] In one exemplary embodiment, each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region different from the one stored previously, and further includes:

[0054] Determine if the size of the index data stored in the current index sub-region is less than the storage capacity of the current index sub-region. If so, continuously store 0 and / or 1 into the current index sub-region until the size of the data stored in the current index sub-region equals the storage capacity of the current index sub-region.

[0055] In one exemplary embodiment, the index file further includes a file area; the file area includes information about a second compression method and the compressed data file.

[0056] The compressed file information refers to the information of a data file compressed using the second compression method.

[0057] In one exemplary embodiment, the filename of the data file includes the file storage start time and file sequence number;

[0058] The file sequence number is used to distinguish the storage order of files with the same storage start time;

[0059] The file number of the current data file and the file number of the next data file are in an increasing relationship.

[0060] In one exemplary embodiment, the index data further includes the extraction time of the I-frame, the storage location of the I-frame, and the length of the Group of Pictures (GOP).

[0061] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description

[0062] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0063] Figure 1 This is the existing video file storage format;

[0064] Figure 2 This is a schematic diagram of a data storage method according to an embodiment of this application;

[0065] Figure 3 This is a flowchart of a data storage method according to an embodiment of this application;

[0066] Figure 4 This is an example of the index file organization format in an embodiment of this application;

[0067] Figure 5 This is an example of a 4KB file index organization format according to an embodiment of this application;

[0068] Figure 6 This is an example of the organization format of the secondary index of a 4KB file index in an embodiment of this application;

[0069] Figure 7 Another example of an index file organization format in this application embodiment;

[0070] Figure 8 This is a schematic diagram of a data storage device according to an embodiment of this application. Detailed Implementation

[0071] Figure 2 This is a schematic diagram of the data storage method according to an embodiment of this application, such as... Figure 2 As shown, the data storage method of this embodiment includes steps S21-S24:

[0072] S21. Continuously receive video data;

[0073] S22. Create a data file for the received video data;

[0074] S23. Extract multiple frame groups based on the received video data; generate index data for each frame group.

[0075] S24. Determine the first compression method; when the number of index data reaches a preset number, compress the preset number of index data using the first compression method, and store it together with the first compression method identifier in the index file.

[0076] In one exemplary embodiment, the index file can be an existing index file in the current day's directory or an index file created based on the created data file.

[0077] In one exemplary embodiment, before generating the index data for each frame group, the process includes:

[0078] Record the extraction time of I-frames in each frame group;

[0079] For each frame group, determine whether a time jump has occurred.

[0080] In one exemplary embodiment, determining whether a time jump has occurred for each frame group includes:

[0081] If the extraction time of the I-frame of the current frame group minus the extraction time of the I-frame of the previous frame group is greater than a first preset threshold, or if the extraction time of the I-frame of the current frame group is less than the extraction time of the I-frame of the previous frame group, then it is determined that a time jump has occurred in the current frame group.

[0082] In one exemplary embodiment, the first preset threshold can be 10 times the inter-frame interval time of an I-frame.

[0083] In one exemplary embodiment, when a time jump is determined, the data file and index file are recreated based on the video data received at the time of determination.

[0084] In one exemplary embodiment, determining the first compression method includes:

[0085] The first compression method is determined based on the real-time nature of the video data and the system's CPU utilization.

[0086] In one exemplary embodiment, determining the first compression method based on the real-time nature of the video data and the current system CPU utilization includes:

[0087] When the video data is real-time data, the first compression method is determined to be a compression method that includes the first compression algorithm;

[0088] When the video data is non-real-time data and the current system's CPU utilization rate is greater than a preset utilization rate threshold, the first compression method is determined to be a compression method that includes the second compression algorithm.

[0089] The first compression algorithm is an algorithm with a compression ratio lower than a preset compression ratio threshold and a compression throughput greater than or equal to a preset compression throughput threshold; the second compression algorithm is an algorithm with a compression ratio higher than or equal to a preset compression ratio threshold and a compression throughput less than a preset compression throughput threshold.

[0090] In one exemplary embodiment, the index file contains an index region;

[0091] The index region includes one or more index sub-regions;

[0092] Each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region that is different from the one stored previously.

[0093] In one exemplary embodiment, each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region different from the one stored previously, and further includes:

[0094] Determine if the size of the index data stored in the current index sub-region is less than the storage capacity of the current index sub-region. If so, continuously store 0 and / or 1 into the current index sub-region until the size of the data stored in the current index sub-region equals the storage capacity of the current index sub-region.

[0095] In one exemplary embodiment, the index file further includes a file area; the file area includes information about a second compression method and the compressed data file.

[0096] The compressed file information refers to the information of a data file compressed using the second compression method.

[0097] The second compression method can be the same as or different from the first compression method. The second compression method can be any compression method in the prior art.

[0098] In one exemplary embodiment, the filename of the data file includes the file storage start time and file sequence number;

[0099] The file sequence number is used to distinguish the storage order of files with the same storage start time;

[0100] The file number of the current data file and the file number of the next data file are in an increasing relationship.

[0101] In one exemplary embodiment, the index data further includes the extraction time of the I-frame, the storage location of the I-frame, and the length of the Group of Pictures (GOP).

[0102] This application embodiment stores security data separately as raw data and index data. One index file can correspond to multiple data files. The index file includes compression methods, and each index includes time information, which improves storage utilization, reduces network bandwidth for storage and reading / writing, and solves the problem of time sequence disorder in the data storage process.

[0103] Figure 3 This is a flowchart illustrating data storage in an embodiment of this application, such as... Figure 3 As shown, steps S31-S34 are included:

[0104] S31. Continuously receive video data;

[0105] S32. Create a data file in the data directory for the current day;

[0106] S33. Search for the index file for the current day in the index directory corresponding to the data directory. If it exists, add a record to the file area of ​​the index file, which corresponds to the newly created video data file. If the index file does not exist, create the index file in the index directory corresponding to the data directory and add a record to the file area of ​​the index file, which corresponds to the newly created video data file.

[0107] S34. Extract data from each frame of the received video data and assemble them into frame groups; determine if a time jump has occurred in each frame group. If a time jump has occurred, recreate the data file and index file based on the currently received video data. If no time jump has occurred, generate one index data for each frame group, determine the compression method, compress every 16 indexes, and store them in a 4KB file index. To prevent data corruption, refresh the compressed data when it approaches 4KB, padding any data less than 4KB with 0s or 1s.

[0108] In step S32, the data file is named as follows: S000000I0000000x.data, where S represents the storage start time of the data file, and I represents the file sequence number, which is a monotonically increasing number. An example of a logically stored file is shown in Table 1. The monotonically increasing file sequence number determines the storage order of the files. Combined with the storage start time of the data file, the storage order of files within the same time range can be distinguished in the event of time jumps, indirectly inferring which time period the video should belong to.

[0109] Table 1

[0110]

[0111] In step S33, the index file is organized as follows: Figure 3 As shown, Figure 3 The index file shown includes a header area, a file area, and an index area. The header area includes the compression method, version number, device code, and other information (such as the current file storage type). The compression method here refers to the compression method used for the data in the header area. The file area includes the compression method, the total length of the file area, and the compressed file information. Here, the compression method refers to the compression method used for the file information, which includes a list of filenames for the data files. The index area includes one or more 4KB file indexes, each 4KB file index (e.g., ...) Figure 4 (As shown) includes the compression method, the current total effective length of 4KB, the compressed secondary index, and padding with 0s for any length less than 4KB. Each secondary index (e.g.) Figure 5 The index (as shown) includes the index time (i.e., UTC time), the data start position (i.e., the I-frame group storage location), and the data length (i.e., the GOP length). Taking the generation of one index file per day as an example, the index file storage example is as follows: 207.101.67.203:7549 / Index*8383420520_2133D / 17487481501328953349_1 / 20210531 / stor / S000000I000000.index. The 4KB file index is just a specific example; other file sizes can also be used for indexing.

[0112] The organization format of the index file can also be as follows: Figure 6 As shown, Figure 6 The index file shown includes a header area and an index area. The header area includes the compression method, version number, device code, and other information (such as the current file storage type). The compression method here refers to the compression method used for the data in the header area. The index area includes one or more 4KB file indexes, each 4KB file index (e.g., ...) Figure 4 (As shown) includes the compression method, the current total effective length of 4KB, the compressed secondary index, and padding with 0s for any length less than 4KB. Each secondary index (e.g.) Figure 5 The data includes index time (i.e., UTC time), data start position (i.e., I-frame group storage position), and data length (i.e., GOP length).

[0113] In one exemplary embodiment, the compression method for index data can be determined based on the real-time performance of the video data and CPU usage. Generally, first-hand recordings have higher real-time requirements, so an algorithm with a relatively low compression ratio but high compression throughput can be selected. Second-hand recordings have relatively lower real-time requirements, so an algorithm with a relatively high compression ratio but low compression throughput can be selected. When CPU usage exceeds a preset threshold, it is considered that the current CPU usage is high, and an algorithm with low compression throughput and low CPU usage is adopted. Conversely, when CPU usage is below the preset threshold, it is considered that the current CPU usage is low, and an algorithm with high compression throughput and high CPU usage is adopted. Specific compression algorithm selection can be found in Table 2.

[0114] Table 2

[0115] Is it real-time? CPU usage Compression algorithm selection yes high Choose an algorithm with a relatively low compression ratio but high compression throughput, such as the LZ4 algorithm. no high Choose an algorithm with a relatively high compression ratio but low compression throughput, such as the zstd algorithm. yes Low Choose an algorithm with a relatively low compression ratio but high compression throughput, such as the LZ4 algorithm. no Low Choose an algorithm with a relatively low compression ratio but high compression throughput, such as the LZ4 algorithm.

[0116] Due to the unique nature of video data, we store it using one index per Group of Pictures (GOP). Normally, the length of each GOP is also within a certain range. The entire index data follows a pattern. Taking index time as an example, if the video has a frame rate of 25 and 25 GOPs, then storing video data from 20:00:00 to 20:00:10 on May 29, 2021, would generate index times of 1622289600, 1622289601, 1622289602, 1622289603, 1622289604, 1622289605, 1622289606, 1622289607, 1622289608, and 1622289609, with the lengths also roughly fixed within a certain range. The starting position of the data is incremented. This results in a very high compression ratio over a given period. Actual testing showed that the index data compression ratio was approximately 1:4.6. Figure 2The storage structure was optimized. Actual testing showed that the ratio of index data was reduced from 1MB of index data to approximately 18KB of index data per GB of video data, significantly improving storage efficiency.

[0117] In one exemplary embodiment, when data needs to be retrieved, video recordings within the start and end time range of the retrieval input can be found from the recorded logical file.

[0118] In one exemplary embodiment, when data playback is required, all data files can be located based on the start and end times to be played back, and the corresponding index files can also be found. If there are multiple overlapping time periods within the start and end times, all of them are located. The files are then sorted according to the number following the 'I' in their filenames (the number following 'I' corresponds to the storage order). The FILE area of ​​the index file is decompressed, and the data files and index areas are located. The index entries corresponding to the index areas are decompressed, and the start position and total length of the corresponding index in the data file are found. The index data for the time period to be played is retrieved and decompressed. The corresponding content in the data file is found and played based on the records in the index. For overlapping time periods, either all recordings can be played, or only one recording can be played.

[0119] In one exemplary embodiment, the oldest data file can be deleted each time, and the corresponding record in the FILE area of ​​the index file can be marked as invalid. Once all the data files corresponding to the index file have been deleted, the index file itself is deleted. Typically, the index file size is approximately 1MB per day. Therefore, it has almost no impact on the overall retention period.

[0120] This application embodiment stores security data separately as raw data and index data. One index file can correspond to multiple data files. The index file includes compression methods, and each index includes time information, which improves storage utilization, reduces network bandwidth for storage and reading / writing, and solves the problem of time sequence disorder in the data storage process.

[0121] Figure 8 This is a schematic diagram of a data storage device according to an embodiment of this application, such as... Figure 8 As shown, the data storage device in this embodiment includes a memory and a processor.

[0122] The memory is used to store programs for data storage;

[0123] The processor is configured to read and execute the program for data storage and execute the data storage method described above.

[0124] This application embodiment stores security data separately as raw data and index data. One index file can correspond to multiple data files. The index file includes compression methods, and each index includes time information, which improves storage utilization, reduces network bandwidth for storage and reading / writing, and solves the problem of time sequence disorder in the data storage process.

[0125] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.

[0126] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

[0127] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.

[0128] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A data storage method, characterized in that: Continuous reception of video data; Create a data file for the received video data; Extract multiple frame groups from the received video data; generate index data for each frame group. Determine the first compression method; when the number of index data reaches a preset number, compress the preset number of index data using the first compression method, and store it in the index file along with the identifier of the first compression method; Before generating the index data for each frame group, the process includes: Record the extraction time of I-frames in each frame group; For each frame group, determine whether a time jump has occurred; When a time jump is detected, the data file and index file are recreated based on the video data received at the time of the detection.

2. The method as described in claim 1, characterized in that: in, The step of determining whether a time jump has occurred for each frame group includes: If the extraction time of the I-frame of the current frame group minus the extraction time of the I-frame of the previous frame group is greater than a first preset threshold, or if the extraction time of the I-frame of the current frame group is less than the extraction time of the I-frame of the previous frame group, then it is determined that a time jump has occurred in the current frame group.

3. The method as described in claim 1, characterized in that: Determining the first compression method includes: The first compression method is determined based on the real-time nature of the video data and the CPU utilization of the system. The step of determining the first compression method based on the real-time nature of the video data and the current system CPU utilization includes: When the video data is real-time data, the first compression method is determined to be a compression method that includes the first compression algorithm; When the video data is non-real-time data and the current system's CPU utilization rate is greater than a preset utilization rate threshold, the first compression method is determined to be a compression method that includes the second compression algorithm. The first compression algorithm is an algorithm with a compression ratio lower than a preset compression ratio threshold and a compression throughput greater than or equal to a preset compression throughput threshold; the second compression algorithm is an algorithm with a compression ratio higher than or equal to a preset compression ratio threshold and a compression throughput less than a preset compression throughput threshold.

4. The method as described in claim 1, characterized in that: The index file contains an index region; The index region includes one or more index sub-regions; Each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region that is different from the one stored previously.

5. The method as described in claim 4, characterized in that: Each time compressed index data is stored in the index file, it includes storing the compressed index data in an index sub-region different from the one stored previously, and also includes: Determine if the size of the index data stored in the current index sub-region is less than the storage capacity of the current index sub-region. If so, continuously store 0 and / or 1 into the current index sub-region until the size of the data stored in the current index sub-region equals the storage capacity of the current index sub-region.

6. The method as described in claim 4, characterized in that: The index file also includes a file area; the file area includes information about the second compression method and the compressed data file. The compressed file information refers to the information of a data file compressed using the second compression method.

7. The method as described in claim 1, characterized in that: The filename of the data file includes the file storage start time and the file sequence number; The file sequence number is used to distinguish the storage order of files with the same storage start time; The file number of the current data file and the file number of the next data file are in an increasing relationship.

8. The method as described in claim 2, characterized in that: The index data also includes the extraction time of the I-frame, the storage location of the I-frame, and the length of the group of frames (GOP).

9. A data storage device, comprising a memory and a processor, characterized in that: The memory is used to store programs for data storage; The processor is configured to read and execute the program for data storage, and to perform the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Transmission method of compression file

    CN101056252A

  • Data indexing method and equipment

    CN108182209A