Data storage method and apparatus, electronic device, and storage medium
By determining the time granularity and full coverage threshold in the multiple-channel monitoring device, and staggering the time when the device reaches the full coverage state, the problem of insufficient storage performance caused by the multiple-channel equipment entering the full coverage state at the same time is solved, and normal storage and performance of data are achieved. promote.
Patent Information
- Application Number
- PCT/CN2023/142586
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-16
- Filing Date
- 2023-12-28
- Publication Date
- 2024-11-21
AI Technical Summary
In the video data storage of multiple monitoring devices, the pre-configured retention period of video data causes multiple devices to enter a full coverage state at the same time, resulting in insufficient storage space and the need to batch delete historical video data, affecting the storage performance of normal video data.
By determining the time granularity and the full coverage threshold matched by each shooting device, dynamically equalize the full coverage pressure to avoid insufficient centralized storage performance, use different full coverage thresholds to stagger the time when the device reaches the full coverage state, disperse the pressure, and ensure normal data storage.
It realizes dynamic equalization of full coverage pressure during multiple storage, avoids the problem of insufficient storage performance, ensures normal storage of data, reduces disk erasing and rewriting pressure, and improves read and write performance.
Smart Images

Figure CN2023142586_21112024_PF_FP_ABST
Abstract
Description
Data storage method, device, electronic device, and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 16, 2023, with application number 202310559310.6, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of data processing technology, for example, to a data storage method, device, electronic device and storage medium. Background Art
[0003] In the field of video data storage for surveillance equipment, the retention period of video data is often pre-configured. The retention period is the maximum time that video data can exist. Typically, the same retention period is configured for multiple surveillance devices, for example, 30 days.
[0004] This unified retention period configuration can easily lead to multiple surveillance devices reaching full coverage almost simultaneously after a certain stage of video data storage. Full coverage, in other words, insufficient storage space, necessitates deleting the oldest or less valuable historical video data to free up storage space. Multiple surveillance devices experiencing full coverage require batch deletion of historical video data. This deletion of historical video data occurs simultaneously with normal video data storage, requiring disk erasure and rewriting. This increases disk write pressure, hinders read and write performance, and impacts the storage of normal real-time video data.
[0005] Summary of the Invention
[0006] The present application provides a data storage method, device, electronic device and storage medium to achieve dynamic balancing of full coverage pressure during multi-channel storage, avoid insufficient storage performance caused by full coverage concentration, and thus ensure normal data storage.
[0007] An embodiment of the present application provides a data storage method, the method comprising:
[0008] Determine the time granularity and the full coverage threshold that matches multiple shooting devices according to the preset number of storage channels;
[0009] Determine the number of fully covered devices within each time granularity, wherein the fully covered devices are shooting devices whose remaining memory is less than or equal to a full coverage threshold that matches the fully covered devices;
[0010] When it is determined that the number of fully covered devices within the target time granularity is less than a preset fully covered device number threshold, data is stored according to the full coverage thresholds respectively matched with the plurality of shooting devices.
[0011] The present application also provides a data storage device, which includes:
[0012] A time granularity determination module is configured to determine a time granularity and a full coverage threshold value that matches each of the multiple shooting devices according to a preset number of storage paths;
[0013] a fully covered device number determination module, configured to determine the number of fully covered devices within each time granularity, wherein the fully covered devices are shooting devices whose remaining memory is less than or equal to a full coverage threshold that matches the fully covered devices;
[0014] The data storage module is configured to store data according to full coverage thresholds respectively matched with multiple shooting devices when it is determined that the number of full coverage devices within the target time granularity is less than a preset full coverage device number threshold.
[0015] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data storage method as described in any one of the embodiments of the present application is implemented.
[0016] An embodiment of the present application further provides a storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to execute the data storage method as described in any one of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The following will introduce the drawings required for the description of the embodiments. The drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] FIG1 is a flow chart of a data storage method provided in Example 1 of the present application;
[0019] FIG2 is a schematic diagram of a centralized full coverage method for data storage provided in Example 1 of the present application;
[0020] FIG3 is a flow chart of another data storage method provided in Example 2 of the present application;
[0021] FIG4 is a schematic diagram of full coverage pressure balancing when multiple shooting devices have the same bit rate, provided in Example 2 of the present application;
[0022] FIG5 is a flowchart of another data storage method provided in Example 3 of the present application;
[0023] FIG6 is a schematic diagram of full coverage pressure balancing when multiple shooting devices have different bit rates, provided in Example 3 of the present application;
[0024] FIG7 is a schematic structural diagram of a data storage device provided in Example 4 of the present application;
[0025] FIG8 is a schematic structural diagram of an electronic device provided in Example 5 of the present application. DETAILED DESCRIPTION
[0026] The following will describe the technical solutions in the embodiments of this application in conjunction with the drawings in the specification of this application. The embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. The numbers used in this way can be interchanged where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units listed, but may include other steps or units that are not listed or inherent to these processes, methods, products or devices.
[0028] Example 1
[0029] Figure 1 is a flowchart of a data storage method provided in Example 1 of the present application. This embodiment is applicable to the situation where video data of multiple monitoring devices are stored simultaneously. The method can be executed by a data storage device, which can be implemented in the form of hardware and / or software. The data storage device can be configured in an electronic device.
[0030] As shown in FIG1 , the method includes the following steps.
[0031] S110: Determine a time granularity and full coverage thresholds respectively matching multiple shooting devices according to a preset number of storage paths.
[0032] The number of storage paths refers to the number of cameras storing files simultaneously. Figure 2 provides a schematic diagram of centralized full coverage during data storage. As shown in Figure 2, when multiple cameras have the same bit rate of 2 megabits per second (Mbps), the same full coverage threshold, and 5 gigabytes (G) of storage space reserved, ideally, multiple cameras will reach full coverage at the same time and begin deleting historical data at the same time. However, even if multiple cameras have the same bit rate, full coverage threshold, and the same size of data to be stored, the time at which multiple cameras reach full coverage will not usually be completely consistent due to device anomalies and network fluctuations. Therefore, this embodiment provides the concept of time granularity to characterize the synchronization of cameras reaching full coverage. If the time at which two cameras reach full coverage is within the same time granularity, they are considered to have reached full coverage at the same time. The full coverage threshold is used to determine whether a camera has reached full coverage. For example, when the remaining memory of a camera is less than or equal to the full coverage threshold, the camera is considered to have reached full coverage.
[0033] In this embodiment, the time granularity is determined based on the preset number of storage channels, and the number of time granularities is the same as the number of storage channels. The greater the number of storage channels, and therefore the greater the number of cameras, the greater the impact of full coverage of the cameras on data storage performance. Therefore, a shorter time granularity should be set to balance the full coverage pressure of multiple cameras. However, this embodiment does not limit the method of determining the time granularity based on the number of storage channels.
[0034] For example, an increasing full coverage threshold or a decreasing full coverage threshold can be set for each of the multiple cameras. However, this embodiment does not restrict the manner in which the full coverage thresholds corresponding to different cameras are set, nor does it limit the relationship between the full coverage thresholds of different cameras. In this embodiment, different full coverage thresholds are determined for different cameras. This setting can stagger the time it takes for different cameras to reach full coverage, initially allocating the full coverage pressure of different cameras.
[0035] S120: Determine the number of fully covered devices within each time granularity.
[0036] The fully covered device is a photographing device whose remaining memory is less than or equal to a full coverage threshold that matches the fully covered device.
[0037] In this embodiment, when multiple cameras are simultaneously storing video data, the number of fully covered devices that reach full coverage within the time granularity of the multiple cameras can be pre-calculated. For example, the time granularity at which the multiple cameras reach full coverage can be calculated based on the standard data size of the video data, the bit rates of the multiple cameras, and the full coverage thresholds of the multiple cameras. The number of fully covered devices that reach full coverage within each time granularity can then be counted.
[0038] S130: If it is determined that the number of fully covered devices within the target time granularity is less than a preset fully covered device number threshold, data is stored according to the full coverage thresholds respectively matched with the plurality of shooting devices.
[0039] The threshold value of the number of full coverage devices is used to determine whether the number of full coverage devices that reach the full coverage state at the same time is too large. When the number of full coverage devices in a time granularity is less than the threshold value of the number of full coverage devices, it is considered that the impact of the number of full coverage devices in the time granularity on the normal data storage performance is within an acceptable range. For example, when the number of full coverage devices in another time granularity is greater than or equal to the threshold value of the number of full coverage devices, it is considered that the number of full coverage devices in the time granularity is too large and relatively concentrated, and the full coverage pressure of the excessive full coverage devices in the time granularity can be dispersed to other time granularities with smaller full coverage pressure. Among them, when the number of full coverage devices in the target time granularity is equal to the preset threshold value of the number of full coverage devices, the solution of dispersing the full coverage pressure of the excessive full coverage devices in the time granularity to other time granularities with smaller full coverage pressure can be adopted, or the solution of normal caching can be adopted. Both solutions are acceptable.
[0040] Exemplarily, the process of setting the threshold of the number of fully covered devices may include: determining a first number of fully covered devices based on a preset number of storage paths and a full coverage ratio; and taking the maximum value between the first number of fully covered devices and the preset second number of fully covered devices as the threshold of the number of fully covered devices.
[0041] The full coverage ratio can be flexibly set according to the actual needs of data storage. For example, the full coverage ratio can be 5%. The second full coverage device number is used to represent the minimum value of the full coverage device number threshold. For example, the second full coverage device number can be set to 2, that is, the full coverage device number threshold is max(n*5%, 2), where n is the number of storage paths.
[0042] In this embodiment, different full coverage thresholds are set for different cameras, and the number of fully covered cameras within each time granularity is counted. When the number of fully covered cameras within the target time granularity is less than the full coverage threshold, that is, the number of cameras reaching full coverage at the same time does not affect the normal storage of video data, data is stored according to the full coverage thresholds of different cameras. This setting can stagger the time when different cameras reach full coverage, reduce the number of cameras reaching full coverage at the same time, and reduce the pressure of centralized full coverage.
[0043] The technical solution of the embodiment of the present application determines the corresponding time granularity and full coverage threshold of multiple shooting devices for a preset number of storage channels, and calculates the number of fully covered devices within each time granularity. When the number of fully covered devices within the target time granularity is less than the preset full coverage device number threshold, data is stored according to the full coverage thresholds that match the multiple shooting devices. The technical solution of the present application achieves dynamic balancing of full coverage pressure during multi-channel storage, avoids insufficient storage performance caused by concentrated full coverage, and thus ensures normal data storage.
[0044] Example 2
[0045] Figure 3 is a flowchart of a data storage method provided in Example 2 of the present application. Based on the above embodiments, this embodiment of the present application explains the process of determining the time granularity and the full coverage threshold of multiple shooting devices, the process of determining the threshold of the number of full coverage devices, the process of determining the full coverage devices to be adjusted, and the process of adjusting the full coverage threshold of the full coverage devices to be adjusted when the bit rates of multiple shooting devices are the same.
[0046] As shown in FIG3 , the method includes the following steps.
[0047] S210: Determine a time granularity according to a standard data size, a preset number of storage channels, and bit rates of multiple shooting devices.
[0048] This embodiment illustrates a data storage method when the bit rates of multiple shooting devices are the same. For example, when the bit rates of multiple shooting devices are the same, the standard data size can be divided by the bit rates of the multiple shooting devices to obtain the total time required to store the standard video data, and the total time can be divided by the preset number of storage channels to obtain the time granularity.
[0049] For example, when the number of storage channels is 100, the standard data size is 2G, and the bit rates of multiple shooting devices are all 2Mbps, the time granularity can be calculated to be 2G÷2Mbps÷100=81.92s.
[0050] S220. Determine the full - coverage thresholds respectively matched with multiple shooting devices according to the standard data size, the preset number of storage channels, and the number of identifiers respectively matched with the multiple shooting devices.
[0051] Exemplarily, when the bitrates of multiple shooting devices are the same, divide the standard data size by the preset number of storage channels to calculate the minimum adjustment amplitude of the full - coverage threshold. Determine the full - coverage thresholds respectively matched with the multiple shooting devices according to the minimum adjustment amplitude and the number of identifiers respectively matched with the multiple shooting devices.
[0052] Exemplarily, the full - coverage thresholds respectively matched with multiple shooting devices can be calculated by the following formula: Among them, f represents the full - coverage threshold, s represents the standard data size, n represents the number of storage channels, d is the number of identifiers matched with the shooting device, and 0 ≤ d < n. The meaning of s×2 is to reserve the memory of the standard data size of two video data to ensure that when historical data is deleted, it does not affect the performance of normal data storage. The number of identifiers matched with the shooting device can be obtained by hashing the device serial number, or can be calculated from the device serial number by other calculation methods, or can be calculated from the device identifier of the shooting device, etc. This embodiment does not limit the determination method of the number of identifiers matched with the shooting device.
[0053] S230. Determine the number of full - coverage devices within each time granularity.
[0054] S240. Judge whether the number of full - coverage devices within the target time granularity is greater than or equal to the preset full - coverage device number threshold. If so, execute S250; otherwise, execute S280.
[0055] The setting method of the full - coverage device number threshold has been described in the above embodiments, and will not be elaborated herein.
[0056] S250. Determine the number of devices to be adjusted according to the number of full - coverage devices within the target time granularity and the preset full - coverage device number threshold.
[0057] In this embodiment, the number of full coverage devices within the target time granularity is subtracted from the full coverage device number threshold to obtain the number of full coverage devices to be adjusted. The full coverage devices to be adjusted are the full coverage devices whose number exceeds the full coverage device number threshold among the multiple full coverage devices within the target time granularity. In this embodiment, the full coverage pressure of the excessive full coverage devices within the target time granularity is dispersed to other time granularities with smaller full coverage pressure, so that the number of full coverage devices within the target time granularity is reduced to not more than the full coverage device number threshold. This can reduce the full coverage pressure within the target time granularity and avoid excessive concentration of full coverage pressure, thereby ensuring normal data storage. For example, when the full coverage device number threshold is max(n*5%, 2), n is 100, the full coverage device number threshold is 5. If the number of full coverage devices within the target time granularity is 7, the number to be adjusted is 2.
[0058] S260: Determine, among multiple full coverage devices within the target time granularity, a number of full coverage devices to be adjusted as full coverage devices to be adjusted.
[0059] Exemplarily, among multiple full coverage devices within the target time granularity, the number of full coverage devices to be adjusted is determined. For example, if the threshold value for the number of full coverage devices is 5 and the number of full coverage devices within the target time granularity is 7, then the number to be adjusted is 2. Two full coverage devices to be adjusted are determined among the 7 full coverage devices within the target time granularity. The full coverage devices to be adjusted may be determined by random selection or by sorting the multiple full coverage devices according to their identification numbers and selecting the first two full coverage devices with the smaller or larger ranking. This embodiment does not limit the method for determining the full coverage devices to be adjusted.
[0060] S270: Adjust the full coverage threshold of the full coverage device to be adjusted according to the number of full coverage devices in each time granularity, and store data according to the multiple shooting devices after the full coverage threshold is adjusted.
[0061] In this embodiment, based on the number of fully covered devices within each time granularity, it is possible to determine a time granularity with a smaller number of fully covered devices, that is, a time granularity with a smaller full coverage pressure. The full coverage threshold of the full coverage device to be adjusted is adjusted so that the adjusted full coverage device to be adjusted reaches the full coverage state within the time granularity with a smaller full coverage pressure. After adjusting the full coverage threshold of the full coverage device to be adjusted, the time granularity at which the full coverage device to be adjusted reaches the full coverage state will not be within the target time granularity. If the full coverage threshold of the full coverage device to be adjusted is lowered, the time when the full coverage device to be adjusted reaches the full coverage state will be delayed. If the full coverage threshold of the full coverage device to be adjusted is raised, the time when the full coverage device to be adjusted reaches the full coverage state will be advanced.
[0062] In this embodiment, for the time granularity where the number of fully covered devices is greater than or equal to the threshold value of the number of full coverage devices, the number of fully covered devices exceeding the threshold value of the number of full coverage devices is determined as the full coverage devices to be adjusted, and the full coverage threshold value of the full coverage devices to be adjusted is adjusted so that the full coverage pressure of the time granularity with a larger number of full coverage devices is dispersed to the time granularity with a smaller number of full coverage devices, thereby avoiding concentrated full coverage of the target time granularity. Exemplarily, the adjustment principle of the full coverage threshold value of the full coverage devices to be adjusted is that the full coverage devices after the full coverage threshold value is adjusted reach the full coverage state within the time granularity with smaller full coverage pressure, thereby ensuring that the corresponding time granularity when the full coverage devices after the full coverage threshold value is adjusted reach the full coverage state also avoids concentrated full coverage. The full coverage pressure of multiple time granularities is balanced, thereby reducing the impact of the concentrated full coverage of multiple devices on the performance of normal data storage.
[0063] Exemplarily, S270 may further include: determining the time granularity with the minimum number of fully covered devices based on the number of fully covered devices within each time granularity; determining the full coverage threshold of the fully covered devices to be adjusted based on the standard data size, the preset number of storage paths, and the number of identifiers matching the time granularity with the minimum number of fully covered devices.
[0064] In this embodiment, the number of fully covered devices is the smallest, which means that the full coverage pressure of this time granularity is the smallest. The fully covered devices to be adjusted are adjusted to reach the full coverage state within this time granularity, thereby achieving the balance of full coverage pressure within multiple time granularities.
[0065] According to the calculation formula of the full coverage threshold above For example, the adjusted full coverage threshold is where d min The number of identifiers that matches the minimum time granularity for the number of fully covered devices.
[0066] During the data storage process, this embodiment performs real-time statistics on the number of fully covered devices within the same time granularity. When the time granularity at which some shooting devices actually reach the full coverage state is inconsistent with the pre-calculated time granularity due to device abnormalities, network delays, etc., this embodiment can perform adaptive adjustment of the full coverage state and re-adjust the full coverage threshold of the shooting device according to the actual number of fully covered devices in multiple time granularities.
[0067] FIG4 is a schematic diagram of full coverage pressure balancing when multiple shooting devices have the same bit rate, provided by an embodiment of the present application. As shown in FIG4 , when multiple shooting devices have the same bit rate, taking the case where the number of storage channels is 100, the standard data size is 2G, and the bit rate of multiple shooting devices is 2Mbps as an example, the time granularity is 81.92s, and the full coverage threshold of the shooting device is 4+d / 50, where d is the identification number of the shooting device. Ideally, when the remaining memory of multiple shooting devices is 5.98G, the full coverage threshold of the shooting device with identification number 99 is 4+99 / 50=5.98G, which just reaches the full coverage state and triggers the second full coverage after 81.92×100=8192s. The full coverage threshold for a camera with an ID of 98 is 4 + 98 / 50 = 5.96G, triggering the first full coverage after (5.98G - 5.96G) ÷ 2Mbps = 81.92s. Similarly, the full coverage threshold for a camera with an ID of 0 is 4G, triggering the first full coverage after (5.98G - 4G) ÷ 2Mbps ≈ 8110s. As shown in Figure 4, full coverage of the cameras is evenly distributed, preventing concentrated triggering of full coverage from affecting normal data storage.
[0068] In this embodiment, regardless of whether the bit rate of multiple shooting devices is fixed, or the actual time granularity at which the shooting device reaches the full coverage state is inconsistent with the pre-calculated time granularity due to abnormal factors such as device abnormality or network delay during the storage process, the technical solution of this embodiment can disperse the shooting devices that reach the full coverage state within the time granularity with greater full coverage pressure to the time granularity with less full coverage pressure, thereby ensuring that the number of full coverage devices that reach the full coverage state within multiple time granularities does not exceed the threshold value of the number of full coverage devices, thereby achieving balanced full coverage of multiple shooting devices during the storage process and avoiding the impact of concentrated full coverage on the normal storage performance of data.
[0069] S280: Storing data according to full coverage thresholds respectively matched with the plurality of shooting devices.
[0070] Example 3
[0071] Figure 5 is a flowchart of a data storage method provided in Example 3 of the present application. Based on the above embodiments, this embodiment of the present application explains the process of determining the time granularity and the full coverage threshold of multiple shooting devices, the process of determining the threshold of the number of full coverage devices, the process of determining the full coverage devices to be adjusted, and the process of adjusting the full coverage threshold of the full coverage devices to be adjusted when the bit rates of multiple shooting devices are different.
[0072] As shown in FIG5 , the method includes the following steps.
[0073] S310: Determine the standard storage time.
[0074] This embodiment describes a data storage method when the bit rates of multiple shooting devices are different. For example, when the bit rates of multiple shooting devices are different, the storage time is usually fixed to the standard storage time t.
[0075] S320: Determine a time granularity according to the standard storage time and the preset number of storage paths.
[0076] For example, the time granularity is obtained by dividing the standard storage time by the preset number of storage paths. That is, the time granularity is calculated by the following formula: Where w is the time granularity and t is the standard storage time.
[0077] S330: Determine full coverage thresholds that match the multiple shooting devices respectively according to the standard storage time, the preset number of storage channels, the bit rates of the multiple shooting devices, and the number of identifiers that match the multiple shooting devices respectively.
[0078] In this embodiment, the data size of multiple cameras is calculated based on the product of the standard storage time and the bit rate of the multiple cameras. Similarly, the data size is divided by the preset number of storage channels to calculate the minimum adjustment range for the full coverage threshold of the camera. Based on the minimum adjustment range for the multiple cameras and the number of identifiers matching the multiple cameras, the full coverage threshold matching the multiple cameras is determined.
[0079] For example, the full coverage thresholds that match multiple shooting devices can be determined using the following formula: Where y is the bit rate of the shooting device.
[0080] S340: Determine the number of fully covered devices within each time granularity.
[0081] S350: Determine whether the number of fully covered devices within the target time granularity is greater than or equal to a preset fully covered device number threshold. If so, execute S360; otherwise, execute S390.
[0082] S360: Determine the number to be adjusted based on the number of fully covered devices within the target time granularity and a preset threshold value of the number of fully covered devices.
[0083] S370: Determine a number of full coverage devices to be adjusted among multiple full coverage devices within the target time granularity as full coverage devices to be adjusted.
[0084] When the bit rates of multiple shooting devices are different, the method for determining the number of fully covered devices within each time granularity, the method for setting the threshold of the number of fully covered devices, and the method for determining the fully covered devices to be adjusted are all the same as when the bit rates of multiple shooting devices are the same, and this embodiment will not be repeated here.
[0085] S380: Adjust the full coverage threshold of the full coverage device to be adjusted according to the number of full coverage devices in each time granularity, and store data according to the multiple shooting devices after the full coverage threshold is adjusted.
[0086] Exemplarily, S380 may further include: determining the time granularity with the minimum number of fully covered devices based on the number of fully covered devices within each time granularity; determining the full coverage threshold of the full coverage devices to be adjusted based on the standard storage time, the preset number of storage paths, the bit rate of the full coverage devices to be adjusted, and the number of identifiers matching the time granularity with the minimum number of full coverage devices.
[0087] When the bit rates of multiple shooting devices are different, the method of determining the time granularity with the minimum number of fully covered devices is the same as when the bit rates of multiple shooting devices are the same, and this embodiment will not be repeated here.
[0088] According to the calculation formula of the full coverage threshold above For example, the adjusted full coverage threshold is where d min The number of identifiers that matches the minimum time granularity for the number of fully covered devices.
[0089] Similarly, during the data storage process, this embodiment performs real-time statistics on the number of fully covered devices within the same time granularity. When the time granularity at which some shooting devices actually reach the full coverage state is inconsistent with the pre-calculated time granularity due to equipment abnormalities, network delays, etc., this embodiment can perform adaptive adjustment of the full coverage state and re-adjust the full coverage threshold of the shooting device according to the actual number of fully covered devices in multiple time granularities.
[0090] FIG6 is a schematic diagram of full coverage pressure balancing when the bit rates of multiple shooting devices are different provided by an embodiment of the present application. As shown in FIG6, when the bit rates of multiple shooting devices are different, taking the number of storage channels as 100 and the standard storage time as 3600s as an example, the time granularity is 3600 / 100=36s. According to the bit rates of the multiple shooting devices and the identification numbers of the multiple shooting devices, the full coverage threshold of the multiple shooting devices is determined as follows: y is the bitrate of the camera, and d is the camera ID number. Ideally, the full coverage threshold for a camera with ID number 99 is 7200 × 2Mbps + 36 × 2Mbps × 99 ≈ 2.62G. It has just reached full coverage and will trigger a second full coverage after 3600 seconds. The full coverage threshold for a camera with ID number 98 is 7200 × 8Mbps + 36 × 8Mbps × 98 ≈ 10.47G, triggering the first full coverage after (10.505G - 10.47G) ÷ 8Mbps ≈ 36 seconds. Similarly, the full coverage threshold for a camera with ID number 0 is 7200 × 16Mbps ≈ 14.06G, triggering the first full coverage after (21.02G - 14.06G) ÷ 16Mbps ≈ 3564 seconds. As shown in Figure 6, full coverage is evenly distributed across the cameras, preventing concentrated full coverage triggering and impacting normal data storage.
[0091] S390: Storing data according to full coverage thresholds respectively matched with the plurality of shooting devices.
[0092] In this embodiment, when the bit rates of multiple shooting devices are not fixed but the storage time is fixed, or when the actual time granularity of the shooting device reaching the full coverage state is inconsistent with the pre-calculated time granularity due to abnormal factors such as device abnormality or network delay during the storage process, the technical solution of this embodiment can disperse the shooting devices that reach the full coverage state within the time granularity with greater full coverage pressure to reach the full coverage state within the time granularity with less full coverage pressure, thereby ensuring that the number of full coverage devices that reach the full coverage state within multiple time granularities does not exceed the full coverage device number threshold, achieving balanced full coverage of multiple shooting devices during the storage process, and avoiding the impact of concentrated full coverage on the normal data storage performance.
[0093] Example 4
[0094] FIG7 is a schematic diagram of the structure of a data storage device provided in Example 4 of the present application. As shown in FIG7 , the device includes: a time granularity determination module 410 , a full coverage device quantity determination module 420 , and a data storage module 430 .
[0095] A time granularity determination module 410 is configured to determine a time granularity and a full coverage threshold respectively matched with a plurality of shooting devices according to a preset number of storage paths;
[0096] a fully covered device number determination module 420, configured to determine the number of fully covered devices within each time granularity, wherein the fully covered devices are imaging devices whose remaining memory is less than or equal to a full coverage threshold matching the fully covered devices;
[0097] The data storage module 430 is configured to store data according to the full coverage thresholds respectively matched with the plurality of shooting devices if it is determined that the number of fully covered devices within the target time granularity is less than a preset full coverage device number threshold.
[0098] The technical solution of the embodiment of the present application determines the corresponding time granularity and full coverage threshold of multiple shooting devices for a preset number of storage channels, and calculates the number of fully covered devices within each time granularity. When the number of fully covered devices within the target time granularity is less than the preset full coverage device threshold, data is stored according to the full coverage thresholds that match the multiple shooting devices. The technical solution of the present application achieves dynamic balancing of full coverage pressure during multi-channel storage, avoids insufficient storage performance caused by the concentrated full coverage of multiple devices, and thus ensures normal data storage.
[0099] Based on the above embodiment, the device further includes:
[0100] The module for determining the number of devices to be adjusted is configured to determine the number of devices to be adjusted based on the number of devices with full coverage within the target time granularity and the preset threshold value of the number of devices with full coverage if it is determined that the number of devices with full coverage within the target time granularity is greater than or equal to the preset threshold value of the number of devices with full coverage;
[0101] a module for determining full coverage devices to be adjusted, configured to determine a number of full coverage devices to be adjusted from a plurality of full coverage devices within a target time granularity as full coverage devices to be adjusted;
[0102] The full coverage threshold adjustment module is configured to adjust the full coverage threshold of the full coverage device to be adjusted according to the number of full coverage devices in each time granularity, and store data based on multiple shooting devices after the full coverage threshold is adjusted.
[0103] Based on the above embodiment, the device further includes:
[0104] a first fully covered device number determining module, configured to determine the first fully covered device number according to a preset number of storage paths and a full coverage ratio;
[0105] The full coverage device number threshold determination module is configured to use the maximum value between the first full coverage device number and a preset second full coverage device number as the full coverage device number threshold.
[0106] Based on the above embodiment, the time granularity determination module 410 includes:
[0107] a first time granularity determination unit configured to determine the time granularity according to a standard data size, a preset number of storage channels, and the bit rates of the multiple shooting devices if it is determined that the bit rates of the multiple shooting devices are the same;
[0108] The first full coverage threshold determination unit is configured to determine full coverage thresholds that match multiple shooting devices respectively based on a standard data size, a preset number of storage paths, and a number of identifiers that match multiple shooting devices respectively.
[0109] Based on the above embodiment, the full coverage threshold adjustment module includes:
[0110] a minimum time granularity determination unit configured to determine a time granularity with a minimum number of fully covered devices based on the number of fully covered devices within each time granularity;
[0111] The first full coverage threshold adjustment unit is configured to determine the full coverage threshold of the full coverage device to be adjusted according to the standard data size, the preset number of storage paths and the identification number matching the time granularity with the minimum number of full coverage devices.
[0112] Based on the above embodiment, the time granularity determination module 410 includes:
[0113] a standard storage time determining unit configured to determine a standard storage time if it is determined that the bit rates of the plurality of shooting devices are different;
[0114] a second time granularity determination unit, configured to determine the time granularity according to the standard storage time and a preset number of storage paths;
[0115] The second full coverage threshold determination unit is configured to determine the full coverage thresholds that match multiple shooting devices respectively based on the standard storage time, the preset number of storage paths, the bit rates of multiple shooting devices, and the number of identifications that match multiple shooting devices respectively.
[0116] Based on the above embodiment, the full coverage threshold adjustment module includes:
[0117] The second full coverage threshold adjustment unit is configured to determine the full coverage threshold of the full coverage device to be adjusted based on the standard storage time, the preset number of storage paths, the bit rate of the full coverage device to be adjusted, and the number of identifiers that matches the time granularity with the minimum number of full coverage devices.
[0118] The data storage device provided in the embodiments of the present application can execute the data storage method provided in any embodiment of the present application, and has the corresponding functional modules and effects of the execution method.
[0119] Example 5
[0120] FIG8 shows a block diagram of an electronic device 10 that can be used to implement an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only provided as examples.
[0121] As shown in FIG8 , the electronic device 10 includes at least one processor 11 and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12 and a random access memory (RAM) 13. The memory stores a computer program that can be executed by the at least one processor 11. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the ROM 12 or the computer program loaded from the storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0122] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0123] The processor 11 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 11 include a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the data storage method.
[0124] In some embodiments, the data storage method may be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data storage method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data storage method in any other suitable manner (e.g., by means of firmware).
[0125] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0126] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0127] In the context of the present application, computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage medium can include electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage medium can be a machine-readable signal medium. Machine-readable storage medium includes an electrical connection based on one or more lines, a portable computer disk, a hard disk, RAM, ROM, erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device or any suitable combination of the foregoing. Storage medium can be a non-transitory storage medium.
[0128] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0129] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0130] A computing system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship arises through computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of physical hosts and virtual private server (VPS) services.
[0131] The various forms of processes shown above can be used to reorder, add, or delete steps. For example, the multiple steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of this application can be achieved.
Claims
1. A data storage method, include: According to the preset number of storage channels, determine the time granularity and the full coverage thresholds that match the multiple shooting devices respectively; Determine the number of fully covered devices within each time granularity, wherein the fully covered devices are shooting devices whose remaining memory is less than or equal to a full coverage threshold matching the fully covered devices; When it is determined that the number of fully covered devices within the target time granularity is less than a preset threshold of the number of fully covered devices, data is stored according to the full coverage thresholds respectively matched with the plurality of shooting devices.
2. The method according to claim 1, in, After determining the number of fully covered devices in each time granularity, the method further includes: In the case where it is determined that the number of fully covered devices within the target time granularity is greater than or equal to the preset threshold number of fully covered devices, the number to be adjusted is determined according to the number of fully covered devices within the target time granularity and the preset threshold number of fully covered devices; Determine, among the multiple full coverage devices within the target time granularity, a number of full coverage devices to be adjusted as the full coverage devices to be adjusted; According to the number of full coverage devices in each time granularity, the full coverage threshold of the full coverage device to be adjusted is adjusted, and data is stored according to the plurality of shooting devices after the full coverage threshold is adjusted.
3. The method according to claim 1 or 2, in, The process of setting the threshold of the number of fully covered devices includes: Determining the first full coverage device number according to the preset storage path number and full coverage ratio; The maximum value between the first number of fully covered devices and the preset second number of fully covered devices is used as the threshold value of the number of fully covered devices.
4. The method according to claim 2, in, The step of determining the time granularity and the full coverage thresholds respectively matched with the plurality of shooting devices according to the preset number of storage paths includes: When it is determined that the bit rates of the multiple shooting devices are the same, determining the time granularity according to the standard data size, the preset number of storage channels, and the bit rates of the multiple shooting devices; Full coverage thresholds that match the multiple shooting devices respectively are determined according to the standard data size, the preset number of storage paths, and the number of identifications that match the multiple shooting devices respectively.
5. The method according to claim 4, in, The adjusting the full coverage threshold of the to-be-adjusted full coverage device according to the number of the full coverage devices in each time granularity includes: According to the number of fully covered devices in each time granularity, determine the time granularity with the minimum number of fully covered devices; The full coverage threshold of the full coverage device to be adjusted is determined according to the standard data size, the preset number of storage paths, and the number of identifiers that matches the minimum time granularity of the number of the full coverage devices.
6. The method according to claim 2, in, The step of determining the time granularity and the full coverage thresholds respectively matched with the plurality of shooting devices according to the preset number of storage paths includes: In the case where it is determined that the bit rates of the plurality of photographing devices are different, determining a standard storage time; Determining the time granularity according to the standard storage time and the preset number of storage paths; Full coverage thresholds that match the multiple shooting devices respectively are determined according to the standard storage time, the preset number of storage paths, the bit rates of the multiple shooting devices, and the number of identifications that match the multiple shooting devices respectively.
7. The method according to claim 6, in, The adjusting the full coverage threshold of the to-be-adjusted full coverage device according to the number of the full coverage devices in each time granularity includes: According to the number of fully covered devices in each time granularity, determine the time granularity with the minimum number of fully covered devices; The full coverage threshold of the full coverage device to be adjusted is determined according to the standard storage time, the preset number of storage paths, the bit rate of the full coverage device to be adjusted, and the identification number matching the minimum time granularity of the number of full coverage devices.
8. A data storage device, include: A time granularity determination module is configured to determine the time granularity and full coverage thresholds respectively matched with multiple shooting devices according to a preset number of storage paths; A fully covered device quantity determination module, configured to determine the quantity of fully covered devices within each time granularity, wherein the fully covered devices are photographing devices whose remaining memory is less than or equal to a full coverage threshold matching the fully covered devices; The data storage module is configured to store data according to full coverage thresholds respectively matched with multiple shooting devices when it is determined that the number of full coverage devices within the target time granularity is less than a preset full coverage device number threshold.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, in, When the processor executes the computer program, the data storage method according to any one of claims 1 to 7 is implemented.
10. A storage medium storing computer executable instructions, in, The computer executable instructions are used to perform the data storage method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Patent Citations
Data storage method and device, electronic equipment and storage medium
CN119011595A
Data storage method and data query method and device
CN105912703A
Video data storage method and system and video access method and node
CN108076317A
Monitoring system and monitoring method
CN109996031A
Data retention management method and device, storage medium and equipment
CN114968945A
Cited By
Data migration method and device, computer equipment and readable storage medium
CN119201011A
