File distribution method based on file storage cluster and related device
By dividing the storage devices in the file storage cluster into static and dynamic files, calculating the available storage capacity and allocating it reasonably, the problem of uneven storage space utilization is solved, and more efficient storage resource utilization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2025-12-16
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the storage space utilization rate of various storage devices in a file storage cluster is unevenly distributed, resulting in low storage resource utilization efficiency.
By dividing the allocated files in the storage device into static files and dynamic files, the available storage capacity is calculated using the current storage capacity of static files and the future storage capacity of dynamic files. Appropriate storage devices are then selected for file allocation, ensuring a balanced utilization of storage space.
It improves the balance of storage space utilization in storage devices and enhances the overall utilization efficiency of storage resources.
Smart Images

Figure CN122018782A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer storage technology, and in particular to a file allocation method and related apparatus based on a file storage cluster. Background Technology
[0002] File allocation based on a file storage cluster aims to assign files to a storage device within the cluster. To maximize the storage capacity of the file storage cluster, it's crucial to ensure balanced storage space utilization across all storage devices. However, current file allocation methods often result in an uneven distribution of storage space utilization across different devices. Summary of the Invention
[0003] This application provides a file allocation method and related apparatus based on a file storage cluster, which can solve the problem of improving the balance of storage space utilization distribution among various storage devices.
[0004] This application provides a file allocation method based on a file storage cluster, the file storage cluster including multiple storage devices, comprising: in response to receiving an allocation request for a file to be allocated, for each storage device, dividing the allocated files stored in the storage device into static files and dynamic files according to the stability of the storage capacity of each allocated file stored in the storage device, wherein the stability of static files is higher than that of dynamic files; calculating the current storage capacity of each static file stored in the storage device to obtain the static storage capacity, and calculating the future storage capacity of each dynamic file stored in the storage device to obtain the dynamic storage capacity; subtracting the static storage capacity and dynamic storage capacity from the total storage capacity of the storage devices to obtain the available storage capacity of the storage devices; and allocating the file to be allocated to a storage device whose available storage capacity meets the storage capacity condition.
[0005] This application provides a file allocation device, including a partitioning module, a statistics module, a subtraction module, and an allocation module. The partitioning module, in response to receiving an allocation request for a file to be allocated, partitions the allocated files stored in each storage device into static files and dynamic files based on the stability of the storage capacity of each allocated file stored in the storage device, with static files having a higher stability than dynamic files. The statistics module calculates the current storage capacity of each static file stored in the storage device to obtain the static storage capacity, and calculates the future storage capacity of each dynamic file stored in the storage device to obtain the dynamic storage capacity. The subtraction module subtracts the static and dynamic storage capacities from the total storage capacity of the storage device to obtain the available storage capacity of the storage device. The allocation module allocates the file to be allocated to a storage device whose available storage capacity meets the storage capacity requirements.
[0006] This application provides a file allocation system, including a file storage cluster and a file allocation device, wherein the file allocation device is used to implement the aforementioned method.
[0007] This application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-described method.
[0008] This application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-described method.
[0009] This application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0010] The above scheme first divides the allocated files stored in the storage device into static files and dynamic files. Then, it calculates the available storage capacity of the storage device using the current storage capacity of static files and the future storage capacity of dynamic files. Since the storage capacity of static files is more stable than that of dynamic files, and the future storage capacity is a predicted value with a high risk of distortion but strong global applicability, while the current storage capacity is a deterministic value with no risk of distortion but weak global applicability, the calculation of the available storage capacity uses the current storage capacity of static files and the future storage capacity of dynamic files. This improves the global applicability of the available storage capacity to a certain extent (adapting to changes in storage capacity caused by subsequent data writing to dynamic files) and also maintains the determinism of the available storage capacity to a certain extent (reducing the risk of distortion caused by predicted values). Therefore, the available storage capacity more accurately reflects the storage space utilization rate of the storage device. Storage devices selected based on the available storage capacity are more suitable, and allocating files to be allocated to these more suitable storage devices improves the balance of storage space utilization distribution across different storage devices.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0013] Figure 1 This is a schematic diagram of the structure of an embodiment of the file storage system provided in this application; Figure 2 This is a flowchart illustrating an embodiment of the file allocation method based on a file storage cluster provided in this application; Figure 3 This is a flowchart illustrating another embodiment of the file allocation method based on a file storage cluster provided in this application; Figure 4 This is a schematic diagram of the candidate static categories in this application; Figure 5 This is a schematic diagram of an embodiment of the file distribution device provided in this application; Figure 6 This is a schematic diagram of the structure of an embodiment of the electronic device of this application; Figure 7 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0014] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0015] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0016] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. The term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. Finally, the term "several" in this document means any integer greater than 0, such as 1, 2, 3, 4, 5, ...
[0017] File allocation based on a file storage cluster aims to assign files to a storage device within the cluster. To maximize the utilization of the cluster's storage capacity, it's crucial to ensure balanced storage space utilization across all storage devices. Some related technologies randomly assign files to a storage device within the cluster, while others allocate files to the device with the largest available storage capacity.
[0018] Through long-term research, the inventors of this application have discovered that: Random allocation methods cannot guarantee a balanced utilization of storage space across all storage devices.
[0019] While allocating storage capacity with the minimum available capacity can maintain a certain degree of balance in the distribution of storage space utilization across storage devices, the degree of balance is limited. This is because the current available storage capacity of a storage device equals the total storage capacity of the storage device minus the sum of the current storage capacities of all allocated files on the storage device. However, after an allocated file is stored on the storage device, data is written to it. The amount of data written is not fixed; as the amount of data written increases, the storage capacity of the allocated file increases. Therefore, after an allocated file is stored on the storage device, its storage capacity is not fixed but changes dynamically. This dynamic change causes a certain degree of imbalance, thus limiting the degree of balance.
[0020] Therefore, this application provides a novel file allocation method based on a file storage cluster.
[0021] The file allocation method provided in this application is applied to file storage systems. Figure 1 This is a schematic diagram of the structure of an embodiment of the file storage system provided in this application. Figure 1 As shown, the file storage system includes a file storage cluster and a file allocation device. The file storage cluster includes multiple storage devices, and the file allocation device can communicate with the storage devices to execute file allocation methods.
[0022] Figure 2 This is a flowchart illustrating an embodiment of the file allocation method based on a file storage cluster provided in this application. The file storage cluster includes multiple storage devices. For example... Figure 2 As shown, in this embodiment, file allocation may include the following steps: S110: In response to receiving an allocation request for the currently unallocated file, for each storage device, based on the stability of the storage capacity of each allocated file stored in the storage device, the allocated files stored in the storage device are divided into static files and dynamic files.
[0023] Static files are more stable than dynamic files.
[0024] The execution entity in this embodiment is a file allocation device. The file allocation device can be any electronic device with file allocation capabilities.
[0025] The file to be assigned can be, but is not limited to, a newly created file.
[0026] The storage capacity of an allocated file refers to the storage space occupied by the allocated file. The stability of the storage capacity of an allocated file can be determined based on the last write time of the allocated file and the historical changes in its storage capacity. For example, the closer the last write time is to the current time and the greater the historical changes in storage capacity, the lower the stability; conversely, the further apart the last write time is from the current time, the higher the stability.
[0027] S120: Calculate the current storage capacity of each static file stored in the storage device to obtain the static storage capacity, and calculate the future storage capacity of each dynamic file stored in the storage device to obtain the dynamic storage capacity.
[0028] Current storage capacity refers to the storage capacity currently in use; it is the actual value at present. Future storage capacity refers to the storage capacity that may be used in the future; it is a predicted value for the future.
[0029] S130: Subtract the static storage capacity and dynamic storage capacity from the total storage capacity of the storage device to obtain the usable storage capacity of the storage device.
[0030] The available storage capacity of a storage device refers to the remaining capacity of the storage device that can be used for storage.
[0031] S140: Allocate the currently unallocated file to a storage device whose available storage capacity meets the storage capacity requirements.
[0032] In some embodiments, the storage capacity condition is the maximum available storage capacity.
[0033] In some embodiments, the storage capacity condition is a central tendency statistic, such as the available storage capacity being greater than the storage capacity of each storage device. The central tendency statistic can be the mean, mode, median, etc.
[0034] The above scheme first divides the allocated files stored in the storage device into static files and dynamic files. Then, it calculates the available storage capacity of the storage device using the current storage capacity of static files and the future storage capacity of dynamic files. Since the storage capacity of static files is more stable than that of dynamic files, and the future storage capacity is a predicted value with a high risk of distortion but strong global applicability, while the current storage capacity is a deterministic value with no risk of distortion but weak global applicability, the calculation of the available storage capacity uses the current storage capacity of static files and the future storage capacity of dynamic files. This improves the global applicability of the available storage capacity to a certain extent (adapting to changes in storage capacity caused by subsequent data writing to dynamic files) and also maintains the determinism of the available storage capacity to a certain extent (reducing the risk of distortion caused by predicted values). Therefore, the available storage capacity more accurately reflects the storage space utilization rate of the storage device. Storage devices selected based on the available storage capacity are more suitable, and allocating files to be allocated to these more suitable storage devices improves the balance of storage space utilization distribution across different storage devices.
[0035] Figure 3 This is a flowchart illustrating another embodiment of the file allocation method based on a file storage cluster provided in this application. The future storage capacity of the allocated files is obtained during the process of the allocated files being allocated to the storage device as historical files to be allocated, such as... Figure 3 As shown, in this embodiment, the step of obtaining the future storage capacity of the allocated files includes: S210: In the process of allocating allocated files as historical files to be allocated to the corresponding storage devices, the static files stored in each storage device are divided into several static file sets according to the file attributes of each static file stored in each storage device.
[0036] A collection of static files belongs to a candidate static category.
[0037] The file attributes of a static file can include at least one of the following: current storage capacity, file name, and file content field name. When a static file's file attributes include two or more of these attributes, the two attributes can be merged to obtain the static file's feature vector. The static files are then grouped according to the similarity between their feature vectors; files with a similarity higher than a similarity threshold are grouped into the same set of static files.
[0038] In some embodiments, S210 includes: for each static file stored in each storage device, fusing the current storage capacity, file name, and file content field name of the static file to obtain a feature vector of the static file; and dividing each static file stored in each storage device into several static file sets based on the similarity between the feature vectors.
[0039] S220: For each candidate static category, the storage capacity of each static file in the set of static files belonging to the candidate static category is statistically analyzed to obtain the reference storage capacity of the candidate static category.
[0040] The reference storage capacity for a candidate static category can be any one of the storage capacities of all static files within the set of static files belonging to that candidate category. For example, it could be the minimum, maximum, or central tendency statistic of the storage capacity, or any other value. The central tendency statistic can be the mean, mode, median, etc.
[0041] In some embodiments, S220 includes: obtaining the central tendency statistics of the storage capacity of each static file belonging to the candidate static category, as a reference storage capacity for the candidate static category.
[0042] S230: Based on the file attributes of the allocated file, determine the target static category to which the allocated file belongs from several candidate static categories.
[0043] In some embodiments, S230 includes: for each candidate static category, determining reference file attributes of the candidate static category based on the file attributes of each static file in the set of static files belonging to the candidate static category; obtaining the similarity between the file attributes of the allocated files and the reference file attributes of each candidate static category; and taking the candidate static category corresponding to the reference file attribute with the highest similarity as the target static category.
[0044] In some embodiments, the file attributes of a static file belonging to a set of static files in a candidate static category can be used as the reference file attributes for the candidate static category.
[0045] In some embodiments, the file attributes of each static file in the set of static files belonging to the candidate static category can be merged to obtain the reference file attributes of the candidate static category.
[0046] S240: Use the reference storage capacity corresponding to the target static category as the future storage capacity of the allocated file.
[0047] The above scheme can dynamically predict the future storage capacity of allocated files based on the static files stored in each storage device before the allocated files are allocated to the storage device as historical files to be allocated.
[0048] Furthermore, in some embodiments, S120 includes: adding the current storage capacities of each static file stored in the storage device to obtain the static storage capacity, and adding the future storage capacities of each dynamic file stored in the storage device to obtain the dynamic storage capacity.
[0049] Further, in some embodiments, S110 includes: for each allocated file stored in the storage device, determining whether the time difference between the last write time of the allocated file and the current time is greater than a preset time difference threshold; in response to the time difference being greater than the preset time difference threshold, determining that the allocated file is a static file; in response to the time difference not being greater than the preset time difference threshold, determining that the allocated file is a dynamic file. The preset time difference threshold can be in the range of hours, in the unit of days, etc. For example, it can be 1 day.
[0050] Furthermore, in some embodiments, before S110, the method includes: identifying, from the allocated files stored in the storage device, allocated files whose current storage capacity is greater than a storage capacity threshold, as reference files. Based on this, S110 includes: for each storage device, dividing each reference file in the storage device into static files and dynamic files according to the stability of the storage capacity of each reference file in the storage device. The storage capacity threshold can be 1GB, etc.
[0051] The above scheme only processes allocated files whose current storage capacity is greater than the storage capacity threshold in the storage device to obtain the available storage capacity. Since allocated files whose current storage capacity is not greater than the storage capacity threshold have little impact on the available storage capacity and are not included in the calculation of available storage capacity, the computational load of file allocation can be reduced while keeping the impact on available storage capacity under control.
[0052] To facilitate understanding, the file allocation method provided in this application is illustrated below with a specific example. The file storage cluster includes storage devices 1-3. The steps performed by the file allocation device include: 1. In response to receiving an allocation request for the currently pending file, obtain the available storage capacity of storage devices 1-3 respectively.
[0053] 1. Determine the file attributes of each allocated file stored in storage device 1. File attributes include file name, file content field name, current storage capacity, future storage capacity, total data volume, etc. Allocated files in storage device 1 with a current storage capacity greater than 1GB are used as reference files. The processing for storage device BE is similar. The future storage capacity of an allocated file is obtained during the process of allocating the allocated file to the storage device as a historical file to be allocated.
[0054] 2. For each reference file in storage device 1, determine whether the time difference between the last write time of the reference file and the current time is greater than 1 day; if it is greater than 1 day, determine that the reference file is a static file; if it is not greater than 1 day, determine that the reference file is a dynamic file.
[0055] 3. Add up the current storage capacity of each static file in storage device 1 to get the static storage capacity B, and add up the future storage capacity of each dynamic file in storage device 1 to get the dynamic storage capacity C.
[0056] 4. Subtract the static storage capacity B and the dynamic storage capacity C from the total storage capacity A of storage device 1 to obtain the usable storage capacity I of storage device 1.
[0057] Similarly, the available storage capacity I of storage device 2-3 can be obtained.
[0058] 2. Allocate the currently unallocated file to the storage device with the largest available storage capacity among storage devices 1-3.
[0059] 3. Obtain the future storage capacity of the files to be allocated, so as to use for the allocation of new files to be allocated in the future.
[0060] 1. For each static file stored in storage devices 1-3, a machine learning algorithm is used to fuse the current storage capacity, file name, and file content field names of the static files to obtain the feature vector of the static files.
[0061] 2. Using machine learning algorithms, based on the similarity between feature vectors, the static files stored in storage devices 1-3 are divided into several static file sets, and each static file set belongs to a candidate static category. Figure 4 This is a schematic diagram of the candidate static categories in this application. For example... Figure 4 As shown, the file storage system includes a file allocation device and storage devices 1-3. The static files stored in storage devices 1-3 are divided into static file set 1, static file set 2, and static file set 3. Static file set 1 belongs to candidate static category 1. Figure 4 (Category 1) and static file set 2 belong to candidate static category 2 ( Figure 4(Category 2) and static file set 3 belong to candidate static category 3 ( Figure 4 (hereinafter referred to as Category 3). The static files of candidate static category 1 are distributed on storage device 1, storage device 2, and storage device 3; the static files of candidate static category 2 are distributed on storage device 1, storage device 2, and storage device 3; and the static files of candidate static category 3 are distributed on storage device 1 and storage device 2.
[0062] 3. For each candidate static category, obtain the average storage capacity of each static file in the static file set belonging to the candidate static category, and use this as the reference storage capacity for the candidate static category. Also, obtain the file attribute fusion of each static file in the static file set belonging to the candidate static category to obtain the reference file attributes for the candidate static category.
[0063] 4. Use machine learning algorithms to obtain the similarity between the file attributes of the file to be assigned and the reference file attributes of each candidate static category, and determine the candidate static category with the highest similarity as the target static category to which the file to be assigned belongs.
[0064] 5. Use the reference storage capacity corresponding to the target static category as the future storage capacity of the file to be allocated.
[0065] Figure 5 This is a schematic diagram of an embodiment of the file distribution device provided in this application. Figure 5 As shown, the file allocation device includes a partitioning module, a statistics module, a subtraction module, and an allocation module. Among them: The partitioning module is used to respond to the received allocation request for the currently unallocated file. For each storage device, based on the stability of the storage capacity of each allocated file stored in the storage device, the allocated files are divided into static files and dynamic files. The stability of static files is higher than that of dynamic files.
[0066] The statistics module is used to calculate the current storage capacity of each static file stored in the storage device to obtain the static storage capacity, and to calculate the future storage capacity of each dynamic file stored in the storage device to obtain the dynamic storage capacity.
[0067] The subtraction module is used to subtract the static storage capacity and dynamic storage capacity from the total storage capacity of the storage device to obtain the usable storage capacity of the storage device.
[0068] The allocation module is used to allocate the currently unallocated file to a storage device whose available storage capacity meets the storage capacity requirements.
[0069] For further detailed descriptions of this embodiment, please refer to the preceding embodiments, which will not be repeated here.
[0070] Figure 6 This is a schematic diagram of the structure of an embodiment of the electronic device of this application. Figure 6 As shown, the electronic device 50 includes a memory 51 and a processor 52. The processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above method embodiments. In a specific implementation scenario, the electronic device 50 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 50 may also include a laptop computer, a tablet computer, or other carrier device, which is not limited here.
[0071] Specifically, processor 52 controls itself and memory 51 to implement the steps in any of the above method embodiments. Processor 52 may also be referred to as a CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 may also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 52 may be implemented using integrated circuit chips.
[0072] Please see Figure 7 , Figure 7 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 60 stores program instructions 601 thereon, which, when executed by a processor, implement the steps in any of the above method embodiments.
[0073] This application also provides a computer program product comprising a computer program that, when executed by a processor, can implement the steps of the methods described in any of the foregoing embodiments. Specifically, the computer program product can be a software or program product containing a computer program, capable of running on a computing device or stored on any available medium.
[0074] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0075] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0076] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. In another image location, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0077] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A file allocation method based on a file storage cluster, characterized in that, The file storage cluster includes multiple storage devices, including: In response to receiving an allocation request for a currently unallocated file, for each of the storage devices, based on the stability of the storage capacity of each allocated file stored in the storage device, each of the allocated files stored in the storage device is divided into static files and dynamic files, wherein the stability of the static files is higher than that of the dynamic files. The current storage capacity of each static file stored in the storage device is calculated to obtain the static storage capacity, and the future storage capacity of each dynamic file stored in the storage device is calculated to obtain the dynamic storage capacity. The available storage capacity of the storage device is obtained by subtracting the static storage capacity and the dynamic storage capacity from the total storage capacity of the storage device. The currently unallocated file is allocated to a storage device whose available storage capacity meets the storage capacity requirements.
2. The method according to claim 1, characterized in that, The future storage capacity of the allocated file is obtained during the process of the allocated file being allocated to the storage device as a historical file to be allocated. The steps for obtaining the future storage capacity of the allocated file include: In the process of allocating the allocated files as historical files to be allocated to the corresponding storage devices, the static files stored in each storage device are divided into several static file sets according to the file attributes of each static file stored in each storage device, and each static file set belongs to a candidate static category. For each of the candidate static categories, the storage capacity of each static file in the set of static files belonging to the candidate static category is statistically analyzed to obtain the reference storage capacity of the candidate static category; Based on the file attributes of the allocated file, determine the target static category to which the allocated file belongs from the plurality of candidate static categories; The reference storage capacity corresponding to the target static category is used as the future storage capacity of the allocated file.
3. The method according to claim 2, characterized in that, The step of calculating the storage capacity of each static file in the set of static files belonging to the candidate static category to obtain the reference storage capacity of the candidate static category includes: Obtain the central tendency statistics of the storage capacity of each static file belonging to the candidate static category, and use it as the reference storage capacity of the candidate static category.
4. The method according to claim 2, characterized in that, The step of dividing the static files stored in each of the storage devices into several static file sets based on the file attributes of each of the static files stored in each of the storage devices includes: For each static file stored in each of the aforementioned storage devices, the current storage capacity, file name, and file content field names of the static file are fused to obtain the feature vector of the static file; Based on the similarity between the feature vectors, the static files stored in each of the storage devices are divided into several sets of static files.
5. The method according to claim 1, characterized in that, The process of calculating the current storage capacity of each static file stored in the storage device to obtain the static storage capacity, and calculating the future storage capacity of each dynamic file stored in the storage device to obtain the dynamic storage capacity, includes: The static storage capacity is obtained by adding the current storage capacities of each static file stored in the storage device, and the dynamic storage capacity is obtained by adding the future storage capacities of each dynamic file stored in the storage device. And / or, the step of dividing the allocated files stored in the storage device into static files and dynamic files based on the stability of the storage capacity of each allocated file stored in the storage device includes: For each of the allocated files stored in the storage device, determine whether the time difference between the last write time of the allocated file and the current time is greater than a preset time difference threshold. In response to a time difference exceeding the preset time difference threshold, the allocated file is determined to be a static file; In response to a time difference not exceeding the preset time difference threshold, the allocated file is determined to be the dynamic file.
6. The method according to claim 1, characterized in that, The storage capacity condition is that the available storage capacity is at its maximum. And / or, Before dividing the allocated files stored in the storage device into static files and dynamic files based on the stability of the storage capacity of each allocated file, the method further includes: From the allocated files stored in the storage device, determine the allocated files whose current storage capacity is greater than the storage capacity threshold, and use them as reference files; The step of dividing the allocated files stored in the storage device into static files and dynamic files based on the stability of the storage capacity of each allocated file in the storage device includes: For each of the aforementioned storage devices, based on the stability of the storage capacity of each of the aforementioned reference files in the storage device, each of the aforementioned reference files in the storage device is divided into static files and dynamic files.
7. A file allocation system, characterized in that, It includes a file storage cluster and a file allocation device, the file allocation device being used to perform the method of any one of claims 1-6.
8. An electronic device, characterized in that, It includes a memory and a processor, the processor being configured to execute program instructions stored in the memory to implement the method of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, It stores program instructions that, when executed by a processor, implement the method of any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-6.