Data space recovery management method of automatic storage management system, medium and product
By using a preset allocation table for hierarchical management in the automatic storage management system, the problem of space fragmentation caused by AU-based unit management is solved, continuous management of allocation units is achieved, and storage space utilization and I/O performance are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-04-03
AI Technical Summary
In existing automated storage management systems, the use of AU as the basic unit of management leads to severe space fragmentation, which affects storage space utilization and I/O performance.
A preset allocation table is used for data space reclamation management. The allocation table has multiple hierarchical management areas. The first-level management area is used to manage a single allocation unit, while other levels of management areas are used to manage allocation unit segments of different lengths. New allocation units are reclaimed to the corresponding level of management area based on the unit value of the allocation unit, thereby achieving continuous management of allocation units.
It effectively integrates scattered allocation units, reduces the generation of fragmented space, improves the continuous management performance of allocation units, and enhances the efficiency of subsequent space allocation and I/O performance.
Smart Images

Figure CN121786008A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database technology, and in particular to a data space reclamation management method, medium, and product for an automatic storage management system. Background Technology
[0002] An Automated Storage Management System (ASMS) is a user-space distributed file system specifically designed for databases. It replaces traditional file systems, providing both file system and disk management capabilities to help users manage database files more conveniently. In existing ASMSs, disk space is typically divided into fixed-size Allocation Units (AUs). Therefore, the data space occupied by a database file is allocated based on AUs; a database file occupies disk space corresponding to one or more AUs. In other words, in existing ASMSs, the data space occupied by a database file is a set of AUs.
[0003] Because the Automated Storage Management System (AS / RS) uses Entities (AUs) as the basic unit for management, it suffers from severe space fragmentation. Files may be assigned discontinuous AUs during their lifetime, and the AUs released after deletion are also discrete. This results in the system's free space consisting of numerous scattered AUs or small AU fragments, negatively impacting storage space utilization and subsequent I / O performance. Summary of the Invention
[0004] One object of the present invention is to provide a data space reclamation management method, medium, and product for an automatic storage management system that helps improve the performance of continuous management of allocation units.
[0005] Specifically, the present invention provides a data space reclamation management method for an automatic storage management system, comprising: Get the trigger event for reclaiming data space; Obtain all allocation units corresponding to the data space that needs to be reclaimed, and record them as newly added allocation units; Based on the unit values of all newly added allocation units, all newly added allocation units are returned to the management area corresponding to the preset allocation table level; The preset allocation table has multiple hierarchical management areas. The first-level management area is used to manage a single allocation unit, and the other hierarchical management areas are used to manage allocation unit segments of different lengths. The allocation unit segment is composed of multiple allocation units with consecutive unit values. Furthermore, in two adjacent hierarchical management areas, the minimum length of the allocation unit segment managed by the next lower level management area is greater than the maximum length of the allocation unit segment managed by the previous level management area, and the minimum length managed by the next lower level management area and the maximum length managed by the previous level management area are consecutive integers.
[0006] Optionally, the step of returning all allocation units to the management area corresponding to the preset allocation table level based on the unit values of all allocation units includes: All newly added allocation units are returned to the first-level management area; Sort all allocation units in the first-level management area according to their unit values; Merge consecutive allocation units with consecutive unit values in the first-level management area, and record the newly generated allocation unit fragment as the newly added allocation unit fragment; If this is the first recycling operation of the preset allocation table, the newly added allocation unit fragments are recycled to the corresponding level of the management area of the preset allocation table according to the length of each newly added allocation unit fragment.
[0007] Optionally, the step of merging the allocation units with consecutive unit values in the first-level management area includes: If it is a recycling operation other than the first one in the preset allocation table, all the individual newly added allocation units and the newly added allocation unit segments in the first-level management area are allocated in the preset allocation table according to the merging situation of the individual newly added allocation units and the newly added allocation unit segments in the management area outside the first-level management area.
[0008] Optionally, both the individual newly added allocation unit and the fragment of the newly added allocation unit are recorded as judgment objects; The step of allocating all individual newly added allocation units and newly added allocation unit fragments in the preset allocation table based on the merging possibility of individual newly added allocation units and newly added allocation unit fragments in the first-level management area with allocation unit fragments in management areas outside the first-level management area includes: A cyclic detection step is performed on each of the judgment objects one by one, the cyclic detection step including: Traverse all management zones except the first-level management zone; Detect whether there is an allocation unit fragment that can be merged with the judgment object in the traversed management area. If there is a mergeable allocation unit fragment, merge the judgment object with the mergeable allocation unit fragment, and sink the merged fragment to the traversed management area. Detect whether the length of the fragment where the judgment object is located belongs to the management area. If yes, complete the recycling of the judgment object. If no, continue to traverse the remaining management areas. If there are no mergeable allocation unit fragments, check whether the length of the judgment object belongs to the management area being traversed. If so, sink the judgment object to the traversed management area to complete the recycling of the judgment object. If not, continue traversing the remaining management areas.
[0009] Optionally, an allocation unit allocation request is obtained, and the number of allocation units requested in the allocation request is recorded as the request quantity; Check if there is an allocation unit segment in the preset allocation table with a length equal to the number of requests, and denot it as the first allocation unit segment. If yes, allocate the first allocation unit segment to the allocation request; otherwise, allocate the first allocation unit segment to the allocation request. Check if there is an allocation unit segment in the preset allocation table that is longer than the number of requests, and denote it as the second allocation unit segment. If so, divide a portion of the second allocation unit segment that is equal to the number of requests and allocate it to the allocation request, and move the remaining portion of the segment to the management area of the corresponding level in the preset allocation table. If not, allocate the allocation request in descending order of allocation unit segment length until the allocation request is satisfied.
[0010] Optionally, the step of allocating the allocation request in descending order of allocation unit fragment length until the allocation request is satisfied includes: Detect whether there are consecutive allocation units in the disk space that satisfy the allocation request; If so, allocate contiguous allocation units from the disk space for the allocation request; If not, perform the step of allocating the allocation request in descending order of allocation unit fragment length until the allocation request is satisfied.
[0011] Optionally, the triggering events include detecting a data file deletion operation and detecting that a preset delayed recycling condition has been met; The process of obtaining the trigger event for reclaiming data space includes: Get the remaining disk space; If the remaining space is greater than a preset space threshold, the trigger event is configured to indicate that a preset delayed recycling condition has been met; otherwise, the trigger event is configured to indicate that a data file deletion operation has been detected.
[0012] Optionally, the first-level management area of the preset allocation table manages only a single allocation unit; The second-level management area of the preset allocation table only manages allocation unit segments consisting of two consecutive allocation units; The length of the allocation unit segment managed by the Nth level management area (N is an integer greater than or equal to 3) of the preset allocation table is 2^(N-2)+1~2^(N-1).
[0013] According to another aspect of the present invention, a computer-readable storage medium is also provided, on which a computer-executable program is stored, wherein the computer-executable program, when executed by a processor, implements a data space reclamation management method of an automatic storage management system according to any of the preceding claims.
[0014] According to another aspect of the present invention, a computer program product is also provided, comprising a computer executable program that, when executed by a processor, implements a data space reclamation management method of an automatic storage management system according to any of the preceding claims.
[0015] The data space reclamation management method of the automatic storage management system of the present invention utilizes a preset allocation table. This table has multiple hierarchical management areas. The first-level management area manages a single allocation unit, while the remaining hierarchical management areas manage allocation unit fragments of different lengths. Each allocation unit fragment consists of multiple allocation units with consecutive unit values. Upon receiving a trigger event for reclamation of data space, all allocation units corresponding to the data space to be reclaimed are retrieved and recorded as newly added allocation units. Based on the unit values of all newly added allocation units, they are reclaimed to the corresponding level of the management area in the preset allocation table. In this way, each level of the preset allocation table manages allocation unit fragments that meet their respective set length requirements, thereby logically organizing scattered allocation units, achieving integrated management of fragmented space, reducing the generation of fragmented space, and improving the performance of continuous allocation unit management. This facilitates the rapid search for continuous data space that meets the requirements during subsequent space allocation, thus improving the allocation efficiency of subsequent space allocation.
[0016] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description
[0017] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic flowchart of a data space reclamation management method for an automatic storage management system according to an embodiment of the present invention; Figure 2 This is a schematic flowchart of the initial reclamation operation in the data space reclamation management method of an automatic storage management system according to an embodiment of the present invention; Figure 3This is a schematic flowchart of the cyclic detection step in the data space reclamation management method of an automatic storage management system according to an embodiment of the present invention; Figure 4 This is a partial schematic diagram illustrating a specific example of a data space reclamation management method in an automatic storage management system according to an embodiment of the present invention; Figure 5 This is another schematic diagram of a specific example of a recycling process in an automatic storage management system data space recycling management method according to an embodiment of the present invention; Figure 6 This is a partial schematic diagram of another specific example of a data space reclamation management method in an automatic storage management system according to an embodiment of the present invention; Figure 7 This is another schematic diagram of a specific example of a data space reclamation management method in an automatic storage management system according to an embodiment of the present invention; Figure 8 This is a schematic flowchart of a data space reclamation management method for an automatic storage management system according to another embodiment of the present invention; Figure 9 This is a schematic diagram illustrating a specific example of an allocation process in a data space reclamation management method of an automatic storage management system according to an embodiment of the present invention; Figure 10 This is a schematic diagram illustrating another specific example of an allocation process in a data space reclamation management method of an automatic storage management system according to an embodiment of the present invention; Figure 11 This is a schematic flowchart illustrating the setting of trigger events in a data space reclamation management method of an automatic storage management system according to an embodiment of the present invention; Figure 12 This is a schematic diagram of a computer device according to an embodiment of the present invention; Figure 13 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; Figure 14 This is a schematic diagram of a computer program product according to an embodiment of the present invention. Detailed Implementation
[0018] Those skilled in the art should understand that the embodiments described below are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. These partial embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present invention.
[0019] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0020] The flowcharts provided in this invention are not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.
[0021] like Figure 1 As shown, in one embodiment, the data space reclamation management method of the automatic storage management system includes: Step S101: Obtain the trigger event for reclaiming data space.
[0022] Specifically, the triggering event could be the detection of a data file deletion operation, that is, the immediate triggering of data space reclamation upon the detection of a data file deletion operation.
[0023] Alternatively, the triggering event could be the detection of a preset number of data file deletion operations. Specifically, in existing automatic storage management systems, after a data file deletion operation occurs, the data space occupied by the data file may not be immediately reclaimed; instead, it may be marked as reusable, with reclamation occurring later. In other words, data space reclamation is only performed after a preset number of data file deletion operations have occurred.
[0024] Alternatively, the triggering event could be the detection that the size of the data space to be reclaimed has reached a preset threshold.
[0025] Step S102: Obtain all allocation units corresponding to the data space to be reclaimed, and record them as newly added allocation units.
[0026] Specifically, in an automatic storage management system, disk space is divided into fixed-size allocation units (AUs) for management, and data space contains one or more allocation units. After space reclamation is triggered, all allocation units corresponding to the data space to be reclaimed are retrieved; that is, all allocation units contained within the data space to be reclaimed are retrieved.
[0027] Step S103: Based on the unit values of all newly added allocation units, reclaim all newly added allocation units to the management area corresponding to the preset allocation table level.
[0028] The allocation unit's cell value, or AU value, is a unique logical identifier for the allocation unit in the disk space, and it can be mapped to the physical address of the allocation unit in the disk space. Therefore, the contiguousness of allocation units in the disk space can be determined by the cell value of the allocation unit.
[0029] The default allocation table has multiple hierarchical management areas. The first-level management area manages a single allocation unit, while the other levels manage allocation unit segments of different lengths. An allocation unit segment consists of multiple allocation units with consecutive unit values. The length of an allocation unit segment is the number of allocation units contained within that segment.
[0030] Furthermore, in two adjacent hierarchical management areas, the minimum length of the allocation unit segment managed by the lower-level management area is greater than the maximum length of the allocation unit segment managed by the upper-level management area, and the minimum length managed by the lower-level management area and the maximum length managed by the upper-level management area are consecutive integers.
[0031] For example, the maximum length of the allocation unit segment managed by the Nth level management area of the preset allocation table is M, and the minimum length of the allocation unit segment managed by the (N+1)th level management area of the preset allocation table is M+1.
[0032] In other words, each allocation unit segment of any length has its own primary management area.
[0033] Specifically, in one embodiment, the first-level management area of the preset allocation table manages only a single allocation unit. The second-level management area of the preset allocation table manages only allocation unit segments consisting of two consecutive allocation units. The Nth-level management area of the preset allocation table (N is an integer greater than or equal to 3) manages allocation unit segments with lengths ranging from 2^(N-2)+1 to 2^(N-1), that is, from 2^N-2+1 to 2^N-1.
[0034] For example, the length of the allocation unit segments managed by the third-level management area is 3 to 4, meaning that the third-level management area manages allocation unit segments consisting of three consecutive allocation units and allocation unit segments consisting of four consecutive allocation units. The length of the allocation unit segments managed by the fourth-level management area is 5 to 8, meaning that the third-level management area manages allocation unit segments consisting of five consecutive allocation units, six consecutive allocation units, seven consecutive allocation units, and eight consecutive allocation units.
[0035] Because database requests for extremely large storage spaces are typically infrequent, the hierarchical management approach described above ensures that larger allocation unit fragments reside in management areas with longer lengths, while smaller allocation unit fragments reside in management areas with shorter lengths. This facilitates handling more frequent requests for smaller storage spaces, reduces the number of hierarchical levels, and lowers management overhead. Furthermore, the lengths of management areas across multiple levels follow a unified formula, making it easier to find suitable allocation unit fragments based on request size.
[0036] Reference Figure 2 As shown, in one embodiment, this step includes: Step S201: Reclaim all newly added allocation units to the first-level management area.
[0037] Specifically, all newly acquired allocation units will first be recycled to the first-level management area of the preset allocation table.
[0038] Step S202: Sort all allocation units in the first-level management area according to their unit values.
[0039] Specifically, all allocation units in the first-level management area are sorted in ascending order of unit value.
[0040] In the first recycling operation of the preset allocation table, since the preset allocation table was originally empty, all allocation units in the first-level management area are all the newly added allocation units that were put in.
[0041] In the first recycling operation other than the preset allocation table, there may have been some allocation units in the first-level management area of the preset allocation table. Therefore, all allocation units in the first-level management area are all the newly added allocation units and the original allocation units.
[0042] Step S203: Merge the allocation units with consecutive unit values in the first-level management area, and record the newly generated allocation unit fragment as the newly added allocation unit fragment.
[0043] Specifically, after sorting all allocation units in the first-level management area according to their unit values, if multiple allocation units with consecutive unit values exist, these consecutive unit values are combined into an allocation unit fragment. Furthermore, the newly generated allocation unit fragment is recorded as a newly added allocation unit fragment. A newly added allocation unit fragment can be considered as a newly added allocation unit fragment that contains newly added allocation units.
[0044] In the case where the first-level management area only manages a single allocation unit, each allocation unit fragment is a newly added allocation unit fragment.
[0045] If this is the first recycling operation of the preset allocation table, specifically, before the newly added allocation unit is recycled to the first-level management area, the entire preset allocation table is empty. Execute step S204.
[0046] Step S204: Based on the length of each newly added allocation unit fragment, reclaim the newly added allocation unit fragments to the corresponding level of the management area in the preset allocation table.
[0047] Specifically, the newly added allocation unit fragment is returned to the management area whose length covers the length of the newly added allocation unit fragment. Since a single newly added allocation unit is already managed by the first-level management area, no further operations are required for the newly added allocation unit. Only the newly added allocation unit fragment needs to be operated on.
[0048] If it is a recycling operation other than the first one in the preset allocation table, all newly added allocation units and newly added allocation unit fragments are allocated in the preset allocation table according to the merging situation of individual newly added allocation units and newly added allocation unit fragments in the first-level management area and allocation unit fragments in the management area outside the first-level management area.
[0049] Specifically, if this is not the first recycling operation of the preset allocation table, then some allocation unit fragments still exist in management areas outside the first-level management area of the preset allocation table. Newly added allocation unit fragments in the first-level management area and existing single newly added allocation units may be able to be merged with allocation unit fragments in management areas outside the first-level management area. Therefore, it is necessary to check the merging possibility between single newly added allocation units and newly added allocation unit fragments in the first-level management area and allocation unit fragments in management areas outside the first-level management area, thereby allocating all single newly added allocation units and newly added allocation unit fragments in the preset allocation table.
[0050] Reference Figure 3 As shown, in one embodiment, both a single newly added allocation unit and a newly added allocation unit fragment are denoted as judgment objects.
[0051] The steps for allocating all newly added allocation units and newly added allocation unit fragments in the preset allocation table based on the merging possibility of individual newly added allocation units and newly added allocation unit fragments in the first-level management area and allocation unit fragments in management areas outside the first-level management area include: Perform a loop check step for each object to be checked, the loop check step includes: Step S301: Traverse all management areas except for the first-level management area.
[0052] Specifically, the management area where the object is initially located is determined to be the first-level manager, and all management areas outside the first-level management area are traversed and checked level by level, that is, starting from the second-level management area and checking level by level.
[0053] Step S302: Detect whether there is an allocation unit fragment that can be merged with the judgment object in the traversed management area. If yes, proceed to step S303; otherwise, proceed to step S305.
[0054] Each time a first-level management area is traversed, it is checked whether there is an allocation unit segment in the traversed management area that is continuous with the unit value of the object being judged.
[0055] Step S303: Merge the judgment object with the mergeable allocation unit fragment, and sink the merged fragment to the next level management area.
[0056] Specifically, if the traversed management area contains an allocation unit fragment that can be merged with the judgment object, the judgment object is merged with the mergeable allocation unit fragment to obtain a larger allocation unit fragment containing the judgment object, and the merged fragment is then pushed down to the traversed management area. Then, step S304 is executed.
[0057] Step S304: Detect whether the length of the segment containing the object belongs to the management area. If yes, proceed to step S307. If no, return to step S301, that is, continue traversing the remaining management areas.
[0058] Specifically, after descending to the traversed management area, it checks whether the length of the segment containing the object belongs to the management area currently in which it is located. If it does not belong to the management area currently in which it is located, then it is necessary to continue traversing the remaining management areas, that is, return to execute step S301, until it finally descends to a corresponding level.
[0059] Step S305: Detect whether the length of the object belongs to the management area being traversed. If yes, proceed to step S306. If no, return to step S301, that is, continue traversing the remaining management areas.
[0060] Specifically, if there is no allocation unit fragment that can be merged with the judgment object in the traversed management area, it is checked whether the length of the judgment object belongs to the management area that has been traversed. If it does not belong to the management area that has been traversed, then it is necessary to continue traversing the remaining management areas, that is, return to the execution step S301, until it finally sinks to a corresponding level.
[0061] Step S306: Subtract the judgment object from the next level of management area.
[0062] Specifically, if the length of the object being judged belongs to the management area being traversed, then the object being judged is directly moved down to the management area being traversed. Then, step S307 is executed.
[0063] Step S307: Complete the recycling of the identified objects.
[0064] Specifically, if the segment containing the object being judged falls within the current management area, then the current object is recycled, and the processing of the next object begins. Alternatively, the object can be moved down to the traversed management area, where the recycling of the current object is also completed, and the processing of the next object begins.
[0065] By performing a cyclical detection step on each object to be judged, the recycling efficiency can be improved.
[0066] It should be noted that for a single newly added allocation unit, if it remains in a single state after traversing all management areas, it will be retained in the first-level management area.
[0067] It should be noted that, in some other embodiments, the step of allocating all individual newly added allocation units and newly added allocation unit fragments in a preset allocation table based on the merging capability of individual newly added allocation units and newly added allocation unit fragments in the first-level management area with allocation unit fragments in management areas outside the first-level management area may also include directly checking one by one whether there are allocation unit fragments in the summary of management areas outside the first-level management area that can be merged with individual newly added allocation units and newly added allocation unit fragments. If they exist, they are merged into the first-level management area. After all management areas have been traversed, they are then moved to the corresponding level of management area based on the length of the fragment in which the individual newly added allocation unit and newly added allocation unit fragment are located.
[0068] It should be noted that in some other embodiments, unlike the embodiments described above, the cyclic detection step includes, regardless of whether the merged fragments have sunk or the individual object has sunk, detecting whether the management area where the object is located is the last-level management area. If so, the object is moved to the corresponding level management area based on the length of the fragment containing it. If not, the remaining management areas are traversed, that is, the step of continuing to traverse and detect whether there are any allocation unit fragments in the remaining management areas that can be merged with the object. Compared with the embodiments described above, this embodiment has more comprehensive detection but lower recovery efficiency.
[0069] Reference Figures 4 to 7 As shown, the technical solution of this embodiment will be described in detail using a preset allocation table of a three-level management area as an example. The first-level management area manages a single allocation unit. The second-level management area manages allocation unit segments consisting of two consecutive allocation units. The third-level management area manages allocation unit segments consisting of three consecutive allocation units and allocation unit segments consisting of four consecutive allocation units.
[0070] like Figure 4As shown, this is the first reclamation operation of the example preset allocation table, which is empty at the beginning. The newly added allocation units corresponding to the reclaimed data space are AU1, AU7, AU8, and AU9.
[0071] Reference Figure 5 As shown, the newly added allocation units AU1, AU7, AU8, and AU9 are first recycled to the first-level management area. All allocation units in the first-level management area are then sorted according to their unit values. Next, the unit values of AU7, AU8, and AU9 are consecutive and can be merged, forming a newly added allocation unit fragment. The length of this fragment is 3, and it is managed by the third-level management area. Therefore, the newly added allocation unit fragment is recycled to the third-level management area, completing the recycling process.
[0072] like Figure 6 As shown, this is the second recycling operation of the example preset allocation table, where the preset allocation table is not empty. The corresponding newly added allocation units for the recycled data space are AU2, AU10, AU20, and AU21.
[0073] Reference Figure 7 As shown, the newly added allocation units AU2, AU10, AU20, and AU21 are first recycled to the first-level management area. Then, all allocation units in the first-level management area are sorted according to their unit values. Since AU1 already exists in the first-level management area, all allocation units in the first-level management area at this time are AU1, AU2, AU10, AU20, and AU21.
[0074] Then, the unit values of AU1 and AU2, and AU20 and AU21 are consecutive and can be merged into two newly added allocation unit segments. At this time, there is still a single newly added allocation unit AU10 in the first-level management area, as well as a newly added allocation unit segment composed of AU1 and AU2, and a newly added allocation unit segment composed of AU20 and AU21. These three are the judgment objects.
[0075] The three judgment objects need to be checked sequentially using a loop. For AU10, there are no mergeable segments in the second-level management area, so the third-level management area is traversed. There are mergeable segments in the third-level management area, which are merged into a distribution unit segment consisting of AU7, AU8, AU9, and AU10, and then moved down to the third-level management area. The length of the distribution unit segment consisting of AU7, AU8, AU9, and AU10 is 4, and it is managed by the third-level management area, so the recycling process is completed, meaning that the distribution unit segment consisting of AU7, AU8, AU9, and AU10 is retained in the third-level management area.
[0076] For the newly added allocation unit fragment consisting of AU1 and AU2, there are no fragments to merge in the second-level management area. The length of the newly added allocation unit fragment consisting of AU1 and AU2 is 2, which is managed by the second-level management area. Therefore, it is sunk to the second-level management area to complete the recycling process. That is, the newly added allocation unit fragment consisting of AU1 and AU2 is sunk to the second-level management area.
[0077] For the newly added allocation unit fragment consisting of AU20 and AU21, there are no fragments to merge in the second-level management area. The length of the newly added allocation unit fragment consisting of AU20 and AU21 is 2, which is managed by the second-level management area. Therefore, it is sunk to the second-level management area to complete the recycling process. That is, the newly added allocation unit fragment consisting of AU20 and AU21 is sunk to the second-level management area.
[0078] This completes the data space reclamation operation.
[0079] In this embodiment, a preset allocation table is constructed. This table has multiple hierarchical management areas. The first-level management area manages a single allocation unit, while the remaining hierarchical management areas manage allocation unit fragments of different lengths. Each allocation unit fragment consists of multiple allocation units with consecutive unit values. After a trigger event for reclaiming data space is received, all allocation units corresponding to the data space to be reclaimed are obtained and recorded as newly added allocation units. Based on the unit values of all newly added allocation units, all newly added allocation units are reclaimed to the corresponding level of the management area in the preset allocation table. In this way, each level of the preset allocation table manages allocation unit fragments that meet their respective set length requirements, thereby logically organizing scattered allocation units, achieving integrated management of fragmented space, reducing the generation of fragmented space, and helping to improve the performance of allocation unit continuity management. This facilitates the rapid search for continuous data space that meets the requirements during subsequent space allocation, which is beneficial to improving the allocation efficiency of subsequent space allocation.
[0080] Furthermore, by directly recycling all newly added allocation units to the first-level management area, sorting all allocation units in the first-level management area according to their unit values, and merging allocation units with consecutive unit values in the first-level management area—that is, performing the first check and merge directly in the first-level management area—recycling efficiency can be improved.
[0081] like Figure 8 As shown, in one embodiment, the data space reclamation management method of the automatic storage management system generally includes: Step S801: Obtain the allocation unit allocation request. The number of allocation units requested in the allocation request is recorded as the request quantity.
[0082] Specifically, it means receiving a request that a new file needs to be stored in disk space.
[0083] Step S802: Check if there is an allocation unit segment in the preset allocation table with a length equal to the requested number, and record it as the first allocation unit segment. If yes, proceed to step S803; otherwise, proceed to step S804.
[0084] Specifically, check if there are any allocation unit segments in the preset allocation table that contain an allocation unit count equal to the requested number. Because the preset allocation table is hierarchically managed, you can directly search in the management area where the length of the managed segment covers the requested number.
[0085] Step S803: Assign the first allocation unit fragment to the allocation request.
[0086] Specifically, if a first allocation unit fragment exists, the allocation unit corresponding to the first allocation unit fragment is allocated to the allocation request.
[0087] Step S804: Check if there is an allocation unit segment in the preset allocation table with a length greater than the allocation request, and record it as the second allocation unit segment. If yes, proceed to step S805; otherwise, proceed to step S807.
[0088] Specifically, check if there are any allocation unit fragments in the preset allocation table that contain more allocation units than the requested number.
[0089] Step S805: Allocate a portion of the second allocation unit fragment equal to the number of requests to the allocation requests.
[0090] Specifically, if a second allocation unit segment exists, a portion of the segment equal to the number of requests is allocated from the starting allocation unit of the second allocation unit segment and distributed to the allocation requests.
[0091] Step S806: Move the remaining fragments to the management area corresponding to the preset allocation table level.
[0092] Specifically, because the length of the second allocation unit segment is greater than the number of requests, after allocating a portion of the segment equal to the number of requests to the allocation requests, some segments remain. The length of these remaining segments may no longer meet the current management length of the management area. Therefore, the remaining segments are moved to the management area corresponding to the preset allocation table level based on their length.
[0093] It should be noted that the preset allocation table can be configured with statistical information for each level of management area, showing the distribution of recyclables across each level, such as the number of allocation unit segments of each length. This statistical information allows for direct determination of the existence of suitable allocation unit segments, improving search efficiency.
[0094] Step S807: Detect whether there are contiguous allocation units in the disk space that satisfy the allocation request. If yes, proceed to step S808; otherwise, proceed to step S809.
[0095] Specifically, there may be unused contiguous allocation units in the disk space that satisfy the allocation request, and therefore they will not appear in the preset allocation table. Therefore, if there are no allocation unit segments in the preset allocation table with a length greater than or equal to the requested number, the system checks whether there are contiguous allocation units in the disk space that satisfy the allocation request.
[0096] Step S808: Allocate contiguous allocation units from the disk space for the allocation request.
[0097] Specifically, if there are contiguous allocation units in the disk space that satisfy the allocation request, then contiguous allocation units are allocated from the disk space to satisfy the allocation request.
[0098] Step S809: Allocate allocation requests in descending order of allocation unit segment length until the allocation request is satisfied.
[0099] Specifically, if there are no contiguous allocation units in the disk space to satisfy the allocation request, and the preset allocation table does not contain any allocation unit segments with a length greater than or equal to the requested number, then the allocation request will be allocated from the allocation unit segments in the preset allocation table in descending order of allocation unit segment length until the allocation request is satisfied.
[0100] The above allocation method can allocate contiguous allocation units to allocation requests to the greatest extent possible, which means that the files to be stored are contiguous in the disk space, thus facilitating subsequent file reading operations and improving system operating efficiency.
[0101] It should be noted that in some other embodiments, the disk space may not be checked, and allocation requests may be allocated directly in descending order of allocation unit segment length until the allocation request is satisfied.
[0102] Reference Figures 9 to 10 As shown, the technical solution of this embodiment will be described in detail with reference to the example of the preset allocation table of the three-level management area mentioned above.
[0103] like Figure 9 As shown, an allocation unit allocation request is received, with a requested number of allocation units of 2. The default allocation table contains allocation unit fragments of equal length to the requested number. The allocation unit fragment consisting of AU1 and AU2 is allocated to the allocation request.
[0104] like Figure 10As shown, an allocation request was received, requesting 3 allocation units. The default allocation table does not contain any allocation unit fragments with a length equal to the requested number. However, there are allocation unit fragments with a length greater than the requested number, namely AU7, AU8, AU9, and AU10.
[0105] Divide the allocation unit segment consisting of AU7, AU8, AU9, and AU10 into a segment equal to the number of requests, namely the segment consisting of AU7, AU8, and AU9. The remaining AU10 belongs to the first-level management area and is moved to the first-level management area.
[0106] like Figure 11 As shown, in one embodiment, the triggering event includes detecting a data file deletion operation and detecting that a preset recycling condition has been met. The preset delayed recycling condition includes the number of file deletion operations reaching a preset number threshold or the size of the data space to be recycled reaching a preset threshold.
[0107] Before obtaining the trigger event for reclaiming data space, the following must be included: Step S1101: Obtain the remaining disk space.
[0108] Specifically, it means obtaining the available space on the disk.
[0109] Step S1102: Detect whether the remaining space is greater than the preset space threshold. If yes, proceed to step S1103; otherwise, proceed to step S1104.
[0110] Step S1103: Configure the trigger event to detect that a preset delay recycling condition has been met.
[0111] Specifically, if the remaining space is greater than a preset space threshold, meaning there is still a significant amount of disk space available, the trigger event will be configured to detect that a preset delayed reclamation condition has been met. In other words, space reclamation will not be triggered immediately after a file deletion operation is detected; instead, reclamation will be delayed until the preset delayed reclamation condition is met.
[0112] Step S1104: Configure the triggering event to detect a data file deletion operation.
[0113] Specifically, if the remaining disk space is less than or equal to a preset space threshold, meaning the remaining disk space is low, the trigger event will be configured to detect a data file deletion operation. In other words, space reclamation will be triggered immediately after a file deletion operation is detected.
[0114] In this embodiment, by flexibly adjusting the triggering event for space reclamation based on the remaining disk space, reclamation is delayed when the remaining disk space is large and reclaimed immediately when the remaining disk space is small. This helps to balance the resource consumption and timeliness of reclamation, avoiding the problems of untimely space reclamation and excessive operation resources consumed by frequent reclamation.
[0115] This embodiment also provides a computer device and a computer-readable storage medium. Figure 12 This is a schematic diagram of a computer device 10 according to an embodiment of the present invention. Figure 13 This is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention.
[0116] The computer device 10 may include a memory 110, a processor 120, and a computer-executable program 11 stored on the memory 110 and running on the processor 120. When the processor 120 executes the computer-executable program 11, it implements the data space reclamation management method of the automatic storage management system of any of the above embodiments.
[0117] The computer-readable storage medium 20 stores a computer-executable program 11 thereon, which, when executed by a processor, implements the data space reclamation management method of the automatic storage management system of any of the above embodiments.
[0118] This embodiment also provides a computer program product. Figure 14 This is a schematic diagram of a computer program product 30 according to an embodiment of the present invention. The computer program product 30 includes a computer-executable program 11, which, when executed by a processor 120, implements any of the data space reclamation management methods of the automatic storage management system described above.
[0119] Specifically, the computer executable program 11 used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, computer instructions, computer-related instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.
[0120] For the purposes of this embodiment, the computer-readable storage medium 20 can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, the computer-readable storage medium 20 can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0121] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.
[0122] Computer device 10 can be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, computer device 10 can be a cloud acquisition node. Computer device 10 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types. Computer device 10 can be implemented in a distributed cloud acquisition environment where tasks are performed by remote processing devices linked via a communication network. In a distributed cloud acquisition environment, program modules can reside on local or remote acquisition system storage media, including storage devices.
[0123] Computer device 10 may include a processor 120 adapted to execute stored instructions and a memory 110 that provides temporary storage space for the operation of said instructions during operation. Processor 120 may be a single-core processor, a multi-core processor, an acquisition cluster, or any other configuration. Memory 110 may include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.
[0124] The processor 120 can be connected via a system interconnect (e.g., PCI, PCI-Express, etc.) to an I / O interface (input / output interface) suitable for connecting the computer device 10 to one or more I / O devices (input / output devices). I / O devices may include, for example, a keyboard and indicating devices, where indicating devices may include a touchpad or touchscreen, etc. I / O devices may be built into the computer device 10 or may be external devices connected to the acquisition device.
[0125] The processor 120 may also be linked via a system interconnect to a display interface suitable for connecting the computer device 10 to a display device. The display device may include a display screen that is a built-in component of the computer device 10. The display device may also include an external computer monitor, television, or projector connected to the computer device 10. Furthermore, a network interface controller (NIC) may be adapted to connect the computer device 10 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an Internet Minicomputer System Interface) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. Remote devices may connect to the computer device via the network.
[0126] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.
Claims
1. A data space reclamation management method for an automatic storage management system, comprising: Get the trigger event for reclaiming data space; Obtain all allocation units corresponding to the data space that needs to be reclaimed, and record them as newly added allocation units; Based on the unit values of all newly added allocation units, all newly added allocation units are returned to the management area corresponding to the preset allocation table level; The preset allocation table has multiple hierarchical management areas. The first-level management area is used to manage a single allocation unit, and the other hierarchical management areas are used to manage allocation unit segments of different lengths. The allocation unit segment is composed of multiple allocation units with consecutive unit values. Furthermore, in two adjacent hierarchical management areas, the minimum length of the allocation unit segment managed by the next lower level management area is greater than the maximum length of the allocation unit segment managed by the previous level management area, and the minimum length managed by the next lower level management area and the maximum length managed by the previous level management area are consecutive integers.
2. The data space reclamation management method of the automatic storage management system according to claim 1, wherein... The step of returning all allocation units to the management area corresponding to the preset allocation table level based on the unit values of all allocation units includes: All newly added allocation units are returned to the first-level management area; Sort all allocation units in the first-level management area according to their unit values; Merge consecutive allocation units with consecutive unit values in the first-level management area, and record the newly generated allocation unit fragment as the newly added allocation unit fragment; If this is the first recycling operation of the preset allocation table, the newly added allocation unit fragments are recycled to the corresponding level of the management area of the preset allocation table according to the length of each newly added allocation unit fragment.
3. The data space reclamation management method of the automatic storage management system according to claim 2, wherein... The step of merging consecutively allocated units with consecutive unit values in the first-level management area includes: If it is a recycling operation other than the first one in the preset allocation table, all the individual newly added allocation units and the newly added allocation unit segments in the first-level management area are allocated in the preset allocation table according to the merging situation of the individual newly added allocation units and the newly added allocation unit segments in the management area outside the first-level management area.
4. The data space reclamation management method of the automatic storage management system according to claim 3, wherein... Each newly added allocation unit and each fragment of the newly added allocation unit are designated as a judgment object; The step of allocating all individual newly added allocation units and newly added allocation unit fragments in the preset allocation table based on the merging possibility of individual newly added allocation units and newly added allocation unit fragments in the first-level management area with allocation unit fragments in management areas outside the first-level management area includes: A cyclic detection step is performed on each of the judgment objects one by one, the cyclic detection step including: Traverse all management zones except the first-level management zone; Detect whether there is an allocation unit fragment that can be merged with the judgment object in the traversed management area. If there is a mergeable allocation unit fragment, merge the judgment object with the mergeable allocation unit fragment, and sink the merged fragment to the traversed management area. Detect whether the length of the fragment where the judgment object is located belongs to the management area. If yes, complete the recycling of the judgment object. If no, continue to traverse the remaining management areas. If there are no mergeable allocation unit fragments, check whether the length of the judgment object belongs to the management area being traversed. If so, sink the judgment object to the traversed management area to complete the recycling of the judgment object. If not, continue traversing the remaining management areas.
5. The data space reclamation management method of the automatic storage management system according to claim 1, wherein... A request for allocation of allocation units is obtained, and the number of allocation units requested in the allocation request is recorded as the request quantity; Check if there is an allocation unit segment in the preset allocation table with a length equal to the number of requests, and denot it as the first allocation unit segment. If yes, allocate the first allocation unit segment to the allocation request; otherwise, allocate the first allocation unit segment to the allocation request. Check if there is an allocation unit segment in the preset allocation table that is longer than the number of requests, and denote it as the second allocation unit segment. If so, divide a portion of the second allocation unit segment that is equal to the number of requests and allocate it to the allocation request, and move the remaining portion of the segment to the management area of the corresponding level in the preset allocation table. If not, allocate the allocation request in descending order of allocation unit segment length until the allocation request is satisfied.
6. The data space reclamation management method of the automatic storage management system according to claim 5, wherein... Before the step of allocating the allocation request in descending order of allocation unit fragment length until the allocation request is satisfied, the following steps are included: Detect whether there are consecutive allocation units in the disk space that satisfy the allocation request; If so, allocate contiguous allocation units from the disk space for the allocation request; If not, perform the step of allocating the allocation request in descending order of allocation unit fragment length until the allocation request is satisfied.
7. The data space reclamation management method of the automatic storage management system according to claim 1, wherein... The triggering events include detecting a data file deletion operation and detecting that a preset delayed recycling condition has been met; The process of obtaining the trigger event for reclaiming data space includes: Get the remaining disk space; If the remaining space is greater than a preset space threshold, the trigger event is configured to indicate that a preset delayed recycling condition has been met; otherwise, the trigger event is configured to indicate that a data file deletion operation has been detected.
8. The data space reclamation management method of the automatic storage management system according to claim 1, wherein... The first-level management area of the preset allocation table manages only a single allocation unit; The second-level management area of the preset allocation table only manages allocation unit segments consisting of two consecutive allocation units; The length of the allocation unit segment managed by the Nth level management area (N is an integer greater than or equal to 3) of the preset allocation table is 2^(N-2)+1~2^(N-1).
9. A computer-readable storage medium having a computer-executable program stored thereon, wherein the computer-executable program, when executed by a processor, implements the data space reclamation management method of the automatic storage management system according to any one of claims 1 to 8.
10. A computer program product comprising a computer executable program, wherein the computer executable program, when executed by a processor, implements the data space reclamation management method of the automatic storage management system according to any one of claims 1 to 8.