CN115963980A - Method, device, medium and electronic equipment for dynamically allocating storage resources - Google Patents
Method, device, medium and electronic equipment for dynamically allocating storage resources Download PDFInfo
- Publication number
- CN115963980A CN115963980A CN202111191019.5A CN202111191019A CN115963980A CN 115963980 A CN115963980 A CN 115963980A CN 202111191019 A CN202111191019 A CN 202111191019A CN 115963980 A CN115963980 A CN 115963980A
- Authority
- CN
- China
- Prior art keywords
- code rate
- value
- resource block
- resource
- storage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application discloses a method, a device, a medium and electronic equipment for dynamically allocating storage resources. The method comprises the following steps: determining a target code rate value of the shooting equipment; wherein the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data; and allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value. According to the technical scheme, the storage resources can be allocated to the shooting equipment according to the target code rate value, the storage randomness of the shooting equipment is reduced, and the management efficiency of the system is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of storage resource processing, in particular to a method, a device, a medium and electronic equipment for dynamically allocating storage resources.
Background
Media data such as videos and pictures are stored in an NVR (Network Video Recorder), and most commonly, mechanical hard disks are used. For mechanical hard disks, it is desirable to read and write continuously and to read and write relatively large content once, so as to exert the performance of the mechanical hard disk to a relatively large extent, and the design of the file system usually focuses on how to make the application perform continuous reading and writing as much as possible, or at least not to have too large positional deviation for each reading and writing.
The block storage techniques that are currently more commonly used in NVR include dynamic application schemes. The dynamic allocation scheme is that after the initialization of the storage resource is completed, the storage resource is divided into a plurality of spaces (blocks) with the same size for management. When IPC (IPCAMERA, network camera) stores, one block is dynamically allocated to the storage resource pool.
The current storage scheme adopts a scheme with a fixed block size, the randomness of IPC video storage is easily increased when the IPC code rates are different, the IPC of different code rates cannot be changed by the management granularity, and the management efficiency is low.
Disclosure of Invention
The embodiment of the application provides a method, a device, a medium and an electronic device for dynamically allocating storage resources, which allocate storage resources to a shooting device according to a target code rate value, reduce the randomness of storage of the shooting device, and improve the management efficiency of a system.
In a first aspect, an embodiment of the present application provides a method for dynamically allocating storage resources, where the method includes:
determining a target code rate value of the shooting equipment; the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
and allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value.
In a second aspect, an embodiment of the present application provides an apparatus for dynamically allocating storage resources, where the apparatus includes:
the target code rate value determining module is used for determining a target code rate value of the shooting equipment; wherein the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
and the resource block allocation module is used for allocating at least one resource block for the shooting equipment from the pre-divided resource blocks of the storage resources according to the target code rate value.
In a third aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for dynamic allocation of storage resources according to the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable by the processor, where the processor executes the computer program to implement the method for dynamically allocating memory resources according to the embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, the target code rate value of the shooting equipment is determined; and allocating at least one resource block for the shooting device from the resource blocks of the pre-divided storage resources according to the target code rate value. According to the technical scheme, the storage resources can be allocated to the shooting equipment according to the target code rate value, the storage randomness of the shooting equipment is reduced, and the management efficiency of the system is improved.
Drawings
FIG. 1 is a flowchart of a method for dynamically allocating memory resources according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a process of dynamic allocation of storage resources according to a second embodiment of the present application;
FIG. 3 is a schematic diagram of an index provided in the second embodiment of the present application;
FIG. 4 is a schematic diagram of memory resource partitioning according to a second embodiment of the present application;
FIG. 5 is a diagram of a superblock and index location provided in accordance with example two of the present application;
FIG. 6 is a schematic diagram of a super-block structure provided in the second embodiment of the present application;
FIG. 7 is a schematic structural diagram of an apparatus for dynamically allocating storage resources according to a third embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but could have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, subprograms, and the like.
Example one
Fig. 1 is a flowchart of a method for dynamically allocating storage resources according to an embodiment of the present application, where this embodiment is applicable to a case where storage resources are dynamically allocated to shooting devices with different code rates, and the method may be executed by an apparatus for dynamically allocating storage resources provided in this embodiment of the present application, where the apparatus may be implemented in a software and/or hardware manner, and may be integrated in a device such as an intelligent terminal for allocating storage resources.
As shown in fig. 1, the method for dynamically allocating storage resources includes:
s110, determining a target code rate value of the shooting equipment; wherein the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
in the present embodiment, the photographing apparatus may include a camera, a web camera, an analog camera, and the like. Preferably, the photographing apparatus may be IPC (IP Camera).
The code rate may refer to the number of data bits transmitted per unit time during data transmission. The code rate configuration value is determined according to the structure of the shooting equipment, and the code rate configuration value of each shooting equipment can be obtained from the bottom-layer storage information. The code rate calculation value can be obtained by calculation according to historical code rate data stored at the bottom layer.
In the scheme, when the system is initialized, the target code rate value of the shooting device is determined to only contain the code rate configuration value. After the shooting equipment works for a period of time, code rate calculation values can be obtained through real-time collection of code rate data of the shooting equipment in the period of time and calculation based on the code rate data.
And S120, distributing at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value.
In this scheme, the entire storage resource may be divided into a number of resource blocks of the same size. For example 64MB or 32MB.
In this embodiment, when the upper system applies for the storage resource, the system allocates a plurality of continuous resource blocks to the shooting device according to the size of the target code rate value, and may virtualize the resource blocks into one logic block, that is, one logic block includes a plurality of resource blocks allocated to the same shooting device. The larger the target code rate value is, the larger the number of resource blocks to be allocated is.
After the resource blocks are distributed to the shooting equipment, the storage state of the system is monitored, if the situation that the shooting equipment has a flow break is monitored, and if the flow break time does not exceed a preset threshold value, the storage state can be ignored; and if the current interruption time exceeds a preset threshold value, canceling the group of data.
In the scheme, alarm plan setting can be carried out according to the image data stored in the resource block. If 24 groups of data in 24 hours are too little, the 24-hour data can be converted into 7-day data for alarm plan setting. The alarm data will typically have a periodic pattern on a daily basis. The alarm plan may refer to analyzing and processing stored data.
In this technical solution, optionally, allocating at least one resource block to the shooting device from resource blocks of pre-divided storage resources according to the target code rate value includes:
determining a minimum code rate configuration value from the code rate configuration values of all shooting devices, and taking the minimum code rate configuration value as a reference value;
and determining the proportional relation between the target code rate value and a reference value, and allocating at least one resource block for the shooting equipment from resource blocks of pre-divided storage resources based on the proportional relation.
In this embodiment, if there are multiple shooting devices during system initialization, the code rate configuration values of the shooting devices are obtained from the bottom layer, and at the allocation time, the minimum code rate configuration value is determined based on the code rate configuration values of the shooting devices. And carrying out quotient calculation on the target code rate value and the reference value to obtain a proportional relation between the target code rate value and the reference value, and allocating at least one resource block to the shooting equipment based on the proportional relation. For example, the proportional relationship between the target code rate value and the reference value is N, and if the resource block applied by the shooting device with the minimum code rate configuration value is 1 resource block, N resource blocks may be allocated to the shooting device based on the proportional relationship; if the resource block applied by the shooting device with the smallest code rate configuration value is 2 resource blocks, 2N resource blocks can be allocated to the shooting device based on the proportional relationship.
In this scheme, if only one shooting device exists during system initialization, a resource block may be allocated to the shooting device according to a preset allocation rule. For example, the N value may be calculated per 1GB size resource block.
The storage resources are allocated to the shooting equipment according to the target code rate value, and the image data of the multiple shooting equipment can be stored and concentrated in a small part of range of the storage resources, so that the method is favorable for the situation that the bottom layer resources are mechanical hard disks, avoids the swing of the magnetic head in a large range, and further improves the storage performance. On the other hand, for shooting equipment with a part of large code rates, the managed logic block is large, the continuity is good during reading, the number of management nodes is reduced, and the management efficiency of the system is improved.
In this technical solution, optionally, allocating at least one resource block to the shooting device from resource blocks of pre-divided storage resources according to the target code rate value includes:
under the condition that the resource blocks are allocated for the first time, allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources based on the code rate configuration value;
and under the condition that the resource blocks are not allocated for the first time, allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources based on the code rate calculation value.
In this embodiment, when the system is initialized, only the code rate configuration value of the shooting device may be obtained, and at least one resource block is allocated to the shooting device from the resource blocks of the pre-divided storage resources based on the proportional relationship between the code rate configuration value and the reference value. And in the working process of the shooting equipment, the code rate value can dynamically change along with the operation, and at least one resource block is allocated to the shooting equipment from the pre-divided resource blocks of the storage resources on the basis of the comparison relation between the code rate calculation value and the reference value.
In the scheme, if the system is restarted, the code rate calculation value is compared with the current configuration value of the shooting equipment, and if the deviation of the two values is greater than the preset threshold value, at least one resource block is allocated to the shooting equipment from the resource blocks of the pre-divided storage resources again based on the current configuration value. The preset threshold value can be set according to the resource block allocation requirement. For example, the threshold may be set to 20%, that is, after the system is restarted, if the deviation between the code rate calculation value and the current configuration value of the shooting device exceeds 20%, the resource block is allocated again based on the current configuration value.
The resource blocks applied by the shooting equipment are dynamically allocated, so that the management efficiency of the system can be improved.
In this technical solution, optionally, the code rate calculation value includes a code rate average value and a code rate variation value; the code rate average value is used for representing the average value of historical code rate data in a preset time period; and the code rate change value is used for representing the average value of historical code rate data in a preset change time period.
The preset time period can be set according to the dynamic allocation requirement of the storage resources. For example, the time period may be set to 12 hours or 24 hours or the like. Preferably, the time period may be set to 24 hours. If the shooting device is not arranged in the all-day plan, the weight can be taken according to the ratio of the storage time to the 24 hours, so that the influence of the non-all-day calculation on the allocation of the resource blocks is reduced.
In this embodiment, the preset change time period may be determined according to a change point with large code rate fluctuation, and the time from the change point to the current time is referred to as the change time period.
According to the scheme, historical code rate data in a preset time period can be collected in real time, and the historical code rate data are averaged to obtain a code rate average value. Or collecting effective number of code rate data in a preset time period, and calculating to obtain a code rate average value based on the code rate data. For example, the code rate average value may be calculated based on the code rate data of 24 hours, or may be calculated based on the code rate data of the effective number within 24 hours.
In this embodiment, when the code rate value changes greatly during the operation of the shooting device, a code rate change point may be determined, and a code rate change value is calculated based on code rate data after the change point.
By dynamically allocating the resource blocks of the shooting equipment, the accuracy of resource block allocation can be improved, and the management efficiency of the system can be improved.
In this technical solution, optionally, allocating at least one resource block to the shooting device from resource blocks of pre-divided storage resources based on the code rate calculation value includes:
acquiring a current code rate value of the shooting equipment;
if the current code rate value meets the code rate fluctuation constraint condition, allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources based on the code rate average value;
and if the current code rate value does not meet the code rate fluctuation constraint condition, allocating at least one resource block for the shooting equipment from the pre-divided resource blocks of the storage resources based on the code rate change value.
The code rate waveform constraint condition may refer to a threshold value set according to code rate fluctuation of the shooting device. For example, the code rate waveform constraint can be set to be 5% of the average value of the code rates.
In this embodiment, the current code rate value of the shooting device may be collected in real time, whether the current code rate value exceeds a threshold value compared with the code rate fluctuation in the previous preset time period is judged, and if not, at least one resource block is allocated to the shooting device from the pre-divided resource blocks of the storage resource based on the proportional relationship between the code rate average value and the reference value. And if the code rate change value exceeds the reference value, allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources based on the proportional relation between the code rate change value and the reference value. Illustratively, the preset time period is set to be 24 hours, the threshold value is 5%, and if the current code rate value is not more than 5% of the code rate fluctuation in the previous 24 hours, the code rate average value in the 24 hours is taken to calculate the proportional relation; if the current code rate value is more than 5% of the code rate fluctuation in the previous 24 hours, determining a change point in the 24 groups of data, taking the average value after the change point as the code rate change value of the shooting equipment, and calculating a proportional relation based on the code rate change value.
By dynamically adjusting the allocation of the resource blocks, the management efficiency of the system can be improved.
According to the technical scheme provided by the embodiment of the application, the target code rate value of the shooting equipment is determined; and allocating at least one resource block for the shooting device from the resource blocks of the pre-divided storage resources according to the target code rate value. By executing the technical scheme, the image data of a plurality of shooting devices can be stored and concentrated in a small part of range of storage resources, which is more beneficial to the condition that the bottom layer resources are mechanical hard disks, the magnetic head is prevented from swinging in a large range, and the storage performance is further improved. On the other hand, for shooting equipment with a part of large code rates, the managed logic block is large, the continuity is good during reading, the number of management nodes is reduced, and the management efficiency of the system is improved.
Example two
Fig. 2 is a schematic diagram of a process of dynamically allocating storage resources according to a second embodiment of the present application, where the second embodiment is further optimized based on the first embodiment. The specific optimization is as follows: allocating at least one resource block for the photographing apparatus from resource blocks of pre-divided storage resources, including: creating a resource block index for at least one resource block of the shooting equipment; the resource block index comprises shooting equipment identification information, a starting resource block serial number, the number of resource blocks, image data storage starting time, image data storage ending time and a storage serial number; the storage sequence number is used for representing the storage sequence of the image data. The details which are not described in detail in this embodiment are shown in the first embodiment. As shown in fig. 2, the method comprises the steps of:
s210, determining a target code rate value of the shooting equipment; the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
s220, distributing at least one resource block for the shooting equipment from pre-divided resource blocks of storage resources according to the target code rate value, and creating a resource block index for the at least one resource block of the shooting equipment; the resource block index comprises shooting equipment identification information, a starting resource block serial number, the number of resource blocks, image data storage starting time, image data storage ending time and a storage serial number; and the storage sequence number is used for representing the sequence of image data storage.
The resource block index is used for recording the summary information after the resource block is used. If the shooting equipment allocates a plurality of resource blocks, 1 logic block is created for the plurality of resource blocks, and the summary information of the logic block is recorded by using one index. If the shooting device allocates one resource block, 1 logic block is created for the resource block, and summary information of the logic block is also recorded by one index.
Exemplarily, fig. 3 is an index schematic diagram provided in the second embodiment of the present application, and as shown in fig. 3, the resource block index includes shooting device identification information, a starting resource block number, a number of resource blocks, image data storage start time, image data storage end time, and a storage number; the storage sequence number is used for representing the storage sequence of the image data.
In the scheme, the storage resource is divided into a plurality of resource blocks with the same size, and the first resource block is used for storing the summary information of the storage resource. Including the total capacity of the storage resources, the number of blocks, the version control information of the storage system, and the resource block index. When the system is initialized, if the first resource block is not enough to store the index information, the second resource block is used for storing the storage index in a sequential manner.
For example, fig. 4 is a schematic diagram of dividing storage resources according to a second embodiment of the present application, as shown in fig. 4, the storage resources are divided into a plurality of resource blocks with the same size according to 64MB, and finally, a part of the tail portion of the hard disk, which is less than 64MB, is discarded and not used. The sequence numbers 1-N are used to indicate resource blocks.
Exemplarily, fig. 5 is a schematic diagram of a super block and an index position provided in the second embodiment of the present application, as shown in fig. 5, a 1 st (serial number is 0) 64MB block stores the super block and a resource block index, and 12KB is reserved between the super block and the resource block index, so as to be used by a subsequent super block expansion; the unused portion of 64MB continues to be reserved. The super block is a first block of the file system, stores the structural information of the file system itself to describe a data structure of the whole information of the file system, mainly describes a directory of the file system and a static distribution condition of files, and describes the size, the number and the like of various constituent structures of the file system.
For example, fig. 6 is a schematic view of a super-block structure provided in the second embodiment of the present application, and as shown in fig. 6, the super-block design includes a magic word commonly used in a file system, a version number, a check of a data area, a capacity size of an entire storage resource, a block number, a UUID (universal Unique Identifier), and the like, and an index area size, an index area start position, a data area start position, and the like used in conjunction with the scheme.
In this technical solution, optionally, the method further includes:
and if the idle space of the resource block of the storage resource is used up, deleting the resource block corresponding to the at least one shooting device according to a preset rule based on the size of the storage resource.
In the scheme, after the space of the storage resource is allocated (the storage can be continued for a period of time), the image coverage logic is triggered, 1% -5% of the resource blocks of the whole storage resource are deleted in advance, and preparation is made for the application of the subsequent image storage space. When the resource block is deleted, all the resource blocks in the logic block corresponding to the resource block are deleted synchronously in order to avoid modifying the management structure. When the storage resource space is small, a minimum deletable value can be specified, and the situation that no enough space is available for reintegration after deletion is avoided; when the storage resource space is large, a maximum deletable value can be specified, so that excessive images can be prevented from being deleted once. After deletion, if the last application of the storage resource is insufficient, the deletion action can be triggered in advance.
In this embodiment, when a small quota is set for a small number of shooting devices, in order to keep the storage locations concentrated in a small range, after the storage of these shooting devices reaches the quota, new image data of these shooting devices may be stored in a new storage resource space, and old image data may be marked for deletion. When the image data is covered to the position, the image data can be directly recycled. When the quota set for the shooting devices is large and reaches the total storage resource amount, such as more than 50%, the shooting devices with the over-quota are directly subjected to cyclic coverage storage on the used storage positions, and the phenomenon that excessive image data are pre-deleted for preparing a continuous space in advance is reduced.
By setting a deletion rule for the storage resource, the validity of image data storage can be ensured, and the condition of insufficient storage resource is avoided.
According to the technical scheme provided by the embodiment of the application, the target code rate value of the shooting equipment is determined; and allocating at least one resource block for the shooting device from the resource blocks of the pre-divided storage resources according to the target code rate value. A resource block index is created for at least one resource block of the photographing apparatus. By executing the technical scheme, the storage resource can be allocated to the shooting equipment according to the target code rate value, and the resource block index is established for at least one resource block allocated to the shooting equipment, so that the randomness of image data storage can be reduced, and the storage performance can be improved. And the management efficiency of the system is improved.
EXAMPLE III
Fig. 7 is a schematic structural diagram of an apparatus for dynamically allocating storage resources according to a third embodiment of the present application, and as shown in fig. 7, the apparatus for dynamically allocating storage resources includes:
a target code rate value determining module 710 for determining a target code rate value of the photographing apparatus; the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
a resource block allocation module 720, configured to allocate at least one resource block for the shooting device from resource blocks of pre-divided storage resources according to the target code rate value.
In this technical solution, optionally, the resource block allocating module 720 includes:
a resource block first allocation unit, configured to allocate, based on the code rate configuration value, at least one resource block to the shooting device from resource blocks of pre-divided storage resources in a case where the resource block is allocated for the first time;
and the resource block non-primary allocation unit is used for allocating at least one resource block to the shooting equipment from the resource blocks of the pre-divided storage resources based on the code rate calculation value under the condition that the resource blocks are not allocated for the first time.
In this technical solution, optionally, the code rate calculation value includes a code rate average value and a code rate variation value; the code rate average value is used for representing the average value of historical code rate data in a preset time period; the code rate change value is used for representing the average value of historical code rate data in a preset change time period.
In this technical solution, optionally, the resource block is not a first allocation unit, and is specifically configured to:
acquiring a current code rate value of the shooting equipment;
if the current code rate value meets the code rate fluctuation constraint condition, distributing at least one resource block for the shooting equipment from the resource blocks of pre-divided storage resources based on the code rate average value;
and if the current code rate value does not meet the code rate fluctuation constraint condition, allocating at least one resource block for the shooting equipment from the pre-divided resource blocks of the storage resources based on the code rate change value.
In this technical solution, optionally, the resource block allocating module 720 is specifically configured to:
determining a minimum code rate configuration value from the code rate configuration values of all shooting devices, and taking the minimum code rate configuration value as a reference value;
and determining a proportional relation between the target code rate value and a reference value, and allocating at least one resource block for the shooting equipment from resource blocks of pre-divided storage resources based on the proportional relation.
In this technical solution, optionally, the resource block allocation module 720 is further configured to:
creating a resource block index for at least one resource block of the shooting equipment; the resource block index comprises shooting equipment identification information, a starting resource block serial number, the number of resource blocks, image data storage starting time, image data storage ending time and a storage serial number; and the storage sequence number is used for representing the sequence of image data storage.
In this technical solution, optionally, the apparatus further includes:
and the resource block deleting module is used for deleting the resource block corresponding to the at least one shooting device according to a preset rule based on the size of the storage resource if the idle space of the resource block of the storage resource is used up.
The product can execute the method provided by the embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Embodiments of the present application also provide a medium containing computer-executable instructions, which when executed by a computer processor, perform a method for dynamic allocation of storage resources, the method comprising:
determining a target code rate value of the shooting equipment; the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
and allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value.
Media-any of various types of memory devices or storage devices. The term "media" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The media may also include other types of memory or combinations thereof. In addition, the medium may reside on a computer system on which the program is executed, or may reside on a different second computer system connected to the computer system via a network (such as the Internet). The second computer system may provide the program instructions to the computer for execution. The term "media" may include two or more media that may reside in different locations, such as in different computer systems that are connected by a network. The media may store program instructions (e.g., embodied as computer programs) that are executable by one or more processors.
Of course, the medium provided in this embodiment of the present application includes computer-executable instructions, where the computer-executable instructions are not limited to the operation of dynamically allocating storage resources described above, and may also perform related operations in the method for dynamically allocating storage resources provided in any embodiment of the present application.
EXAMPLE five
The embodiment of the application provides electronic equipment, and the device for dynamically allocating the storage resources, which is provided by the embodiment of the application, can be integrated in the electronic equipment. Fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application. As shown in fig. 8, the present embodiment provides an electronic device 800, which includes: one or more processors 820; the storage 810 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 820, the one or more processors 820 are enabled to implement the method for dynamically allocating storage resources provided in the embodiment of the present application, the method includes:
determining a target code rate value of the shooting equipment; the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
and allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value.
Of course, those skilled in the art will understand that the processor 820 may also implement the technical solution of the method for dynamically allocating storage resources provided in any embodiment of the present application.
The electronic device 800 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 8, the electronic device 800 includes a processor 820, a storage 810, an input device 830, and an output device 840; the number of the processors 820 in the electronic device may be one or more, and one processor 820 is taken as an example in fig. 8; the processor 820, storage 810, input 830, and output 840 in the electronic device may be connected by a bus or other means, such as by bus 850 in fig. 8.
The storage device 810 is a computer readable medium, and can be used for storing software programs, computer executable programs, and module units, such as program instructions corresponding to the method for dynamically allocating storage resources in the embodiment of the present application.
The storage device 810 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 810 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 810 may further include memory located remotely from processor 820, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 830 may be used to receive input numbers, character information, or voice information, and generate key signal inputs related to user settings and function control of the electronic apparatus. The output device 840 may include a display screen, a speaker, and other electronic devices.
The electronic equipment provided by the embodiment of the application can achieve the purposes of reducing the storage randomness of the shooting equipment and improving the management efficiency of a system.
The device, medium, and electronic device for dynamically allocating storage resources provided in the foregoing embodiments may execute the method for dynamically allocating storage resources provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For the technical details not described in detail in the above embodiments, reference may be made to the method for dynamically allocating storage resources provided in any embodiment of the present application.
It is to be noted that the foregoing is only illustrative of the presently preferred embodiments and application of the principles of the present invention. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims (10)
1. A method for dynamic allocation of storage resources, comprising:
determining a target code rate value of the shooting equipment; the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
and allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value.
2. The method of claim 1, wherein allocating at least one resource block for the photographing device from resource blocks of a pre-partitioned storage resource according to the target code rate value comprises:
under the condition that the resource blocks are allocated for the first time, allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources based on the code rate configuration value;
and under the condition that the resource blocks are not allocated for the first time, allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources based on the code rate calculation value.
3. The method of claim 1, wherein the code rate calculation value comprises a code rate average value and a code rate variation value; the code rate average value is used for representing the average value of historical code rate data in a preset time period; and the code rate change value is used for representing the average value of historical code rate data in a preset change time period.
4. The method of claim 3, wherein allocating at least one resource block for the photographing device from resource blocks of a pre-partitioned storage resource based on the code rate calculation value comprises:
acquiring a current code rate value of the shooting equipment;
if the current code rate value meets the code rate fluctuation constraint condition, distributing at least one resource block for the shooting equipment from the resource blocks of pre-divided storage resources based on the code rate average value;
and if the current code rate value does not meet the code rate fluctuation constraint condition, allocating at least one resource block for the shooting equipment from the pre-divided resource blocks of the storage resources based on the code rate change value.
5. The method of claim 1, wherein allocating at least one resource block for the photographing device from resource blocks of a pre-partitioned storage resource according to the target code rate value comprises:
determining a minimum code rate configuration value from the code rate configuration values of all shooting devices, and taking the minimum code rate configuration value as a reference value;
and determining a proportional relation between the target code rate value and a reference value, and allocating at least one resource block for the shooting equipment from resource blocks of pre-divided storage resources based on the proportional relation.
6. The method of claim 1, wherein allocating at least one resource block for the photographing device from among resource blocks of pre-divided storage resources comprises:
creating a resource block index for at least one resource block of the shooting equipment; the resource block index comprises shooting equipment identification information, a starting resource block serial number, the number of resource blocks, image data storage starting time, image data storage ending time and a storage serial number; and the storage sequence number is used for representing the sequence of image data storage.
7. The method of claim 1, further comprising:
and if the idle space of the resource block of the storage resource is used up, deleting the resource block corresponding to the at least one shooting device according to a preset rule based on the size of the storage resource.
8. An apparatus for dynamic allocation of storage resources, comprising:
the target code rate value determining module is used for determining a target code rate value of the shooting equipment; wherein the target code rate value comprises a code rate configuration value and a code rate calculation value; the code rate calculation value is determined according to historical code rate data;
and the resource block allocation module is used for allocating at least one resource block for the shooting equipment from the resource blocks of the pre-divided storage resources according to the target code rate value.
9. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of dynamic allocation of storage resources according to any one of claims 1-7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for dynamic allocation of storage resources according to any one of claims 1-7 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111191019.5A CN115963980A (en) | 2021-10-13 | 2021-10-13 | Method, device, medium and electronic equipment for dynamically allocating storage resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111191019.5A CN115963980A (en) | 2021-10-13 | 2021-10-13 | Method, device, medium and electronic equipment for dynamically allocating storage resources |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115963980A true CN115963980A (en) | 2023-04-14 |
Family
ID=87351455
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111191019.5A Pending CN115963980A (en) | 2021-10-13 | 2021-10-13 | Method, device, medium and electronic equipment for dynamically allocating storage resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115963980A (en) |
-
2021
- 2021-10-13 CN CN202111191019.5A patent/CN115963980A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6961844B2 (en) | Storage volume creation method and device, server, and storage medium | |
CN110515539B (en) | Cloud disk mounting method, device, equipment and storage medium based on cloud storage | |
US20200348863A1 (en) | Snapshot reservations in a distributed storage system | |
EP3958107A1 (en) | Storage system, memory management method, and management node | |
CN101799797B (en) | Dynamic allocation method of user disk quota in distributed storage system | |
JP2013509658A (en) | Allocation of storage memory based on future usage estimates | |
US10817380B2 (en) | Implementing affinity and anti-affinity constraints in a bundled application | |
CN103761190A (en) | Data processing method and apparatus | |
CN111737168A (en) | Cache system, cache processing method, device, equipment and medium | |
CN111857992B (en) | Method and device for allocating linear resources in Radosgw module | |
CN106933868A (en) | A kind of method and data server for adjusting data fragmentation distribution | |
CN109582649B (en) | Metadata storage method, device and equipment and readable storage medium | |
US20170123975A1 (en) | Centralized distributed systems and methods for managing operations | |
CN113495889A (en) | Distributed object storage method and device, electronic equipment and storage medium | |
CN113190384A (en) | Data recovery control method, device, equipment and medium based on erasure codes | |
CN111399753B (en) | Method and device for writing pictures | |
CN110471759B (en) | Method for dynamically managing memory of multi-core embedded processor in real time | |
US20070033372A1 (en) | Windowing external block translations | |
US20140351550A1 (en) | Memory management apparatus and method for threads of data distribution service middleware | |
CN108897822A (en) | A kind of data-updating method, device, equipment and readable storage medium storing program for executing | |
CN113064553B (en) | Data storage method, device, equipment and medium | |
CN110162395A (en) | A kind of method and device of Memory Allocation | |
CN115963980A (en) | Method, device, medium and electronic equipment for dynamically allocating storage resources | |
CN112000289B (en) | Data management method for full flash storage server system and related components | |
CN115712581A (en) | Data access method, storage system and storage node |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |