CN108762678B - Storage space recovery method, system, device and readable storage medium - Google Patents

Storage space recovery method, system, device and readable storage medium Download PDF

Info

Publication number
CN108762678B
CN108762678B CN201810538966.9A CN201810538966A CN108762678B CN 108762678 B CN108762678 B CN 108762678B CN 201810538966 A CN201810538966 A CN 201810538966A CN 108762678 B CN108762678 B CN 108762678B
Authority
CN
China
Prior art keywords
storage space
acquiring
unallocated
disk block
interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810538966.9A
Other languages
Chinese (zh)
Other versions
CN108762678A (en
Inventor
冯瑞鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810538966.9A priority Critical patent/CN108762678B/en
Publication of CN108762678A publication Critical patent/CN108762678A/en
Application granted granted Critical
Publication of CN108762678B publication Critical patent/CN108762678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks

Abstract

The application discloses a storage space recovery method, which is applied to a self-simplified configured host file system and comprises the following steps: acquiring an idle storage space in a disk block according to metadata of a host file system; judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space; wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold. The method and the device are applied to the self-simplified configuration system, the idle storage space is effectively identified and acquired by using the metadata, and then the idle storage space meeting the recovery requirement is recovered, so that the utilization rate of the storage space is further improved. Correspondingly, the application also discloses a storage space recycling system, a storage space recycling device and a readable storage medium.

Description

Storage space recovery method, system, device and readable storage medium
Technical Field
The present invention relates to the field of thin provisioning, and in particular, to a method, a system, an apparatus, and a readable storage medium for storage space reclamation.
Background
With the rapid development of technologies such as cloud computing, mobile internet, internet of things and the like, mass data is increasing exponentially, and the IT market enters a big data era. Mass data and data mining become new opportunity points and gold mines for enterprises, and higher requirements are put forward for data centers and storage planning of the enterprises and also higher requirements are put forward for storage systems. In order to reduce the upgrading and operation and maintenance costs and improve the utilization rate of a storage space, the early investment of a client is protected, and self-compaction configuration is introduced into a storage virtualization system. The self-compaction configuration technology is distributed according to needs and is distributed along with writing, the storage space can be utilized to the maximum extent, and the problem of low space utilization rate of enterprise storage equipment is solved. However, when the thin provisioning technique is applied, since the file path is modified and deleted without completely clearing the file in the storage space, the consistency of the stored data cannot be ensured, and the storage space is idle.
Therefore, how to provide a solution to the above technical problems is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the present invention provides a method, a system, a device and a readable storage medium for recovering a storage space, so as to recover an idle storage space. The specific scheme is as follows:
a storage space recovery method is applied to a self-thin configured host file system, and comprises the following steps:
acquiring an idle storage space in a disk block according to metadata of a host file system;
judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space;
wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold.
Preferably, the process of obtaining the free storage space in the disk block according to the metadata of the host file system includes:
acquiring an actually unallocated interval in the disk block according to the metadata;
and obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval.
Preferably, the process of obtaining the actually unallocated extents in the disk block according to the metadata specifically includes:
acquiring a bit diagram of the storage condition of the disk block according to the metadata;
judging the area which is continuously a preset code in the bit diagram as an unallocated area, and acquiring the position information of the unallocated area; the location information includes a start location and a length of the unallocated area; and acquiring the actually unallocated intervals in the disk blocks according to the position information and the mapping relation between the bit map and the disk blocks.
Preferably, the obtaining the free storage space according to the cache data of the host file system and the actually unallocated interval specifically includes:
obtaining a cache write-in interval in the disk block according to the cache data;
acquiring the intersection of the actual distribution interval and the cache writing interval;
and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
Preferably, the process of acquiring the free storage space in the disk block specifically includes:
and according to the first preset acquisition frequency and the metadata of the host file system, regularly acquiring the idle storage space in the disk block.
Preferably, the process of determining whether the free storage space meets the recycling requirement specifically includes:
and according to a second preset acquisition frequency, regularly judging whether the idle storage space meets the recovery requirement.
Correspondingly, the invention also discloses a storage space recovery system, which is applied to a self-thin configured host file system and comprises the following components:
the information acquisition module is used for acquiring the idle storage space in the disk block according to the metadata of the host file system;
the judging module is used for judging whether the idle storage space meets the recycling requirement or not; if yes, triggering a recovery module;
the recovery module is used for recovering the idle storage space;
wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold.
Correspondingly, the invention also discloses a storage space recovery device, which is applied to a self-simplified configured host file system and comprises:
a memory for storing a computer program;
a processor for implementing the steps of the memory space reclamation method as described above when executing the computer program.
Correspondingly, the invention also discloses a readable storage medium applied to the self-thin provisioning of the host file system, wherein the readable storage medium stores a computer program, and the computer program realizes the steps of the storage space recycling method when being executed by a processor.
The invention discloses a storage space recovery method, which is applied to a self-simplified configured host file system and comprises the following steps: acquiring an idle storage space in a disk block according to metadata of a host file system; judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space; wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold. The method is applied to a self-simplification configuration system, effectively identifies and acquires the idle storage space by using the metadata, and then recovers the idle storage space meeting the recovery requirement, thereby further improving the utilization rate of the storage space.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart illustrating steps of a method for reclaiming storage space according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating specific steps of a method for recovering storage space according to an embodiment of the present invention;
FIG. 3 is a block diagram of a memory reclamation system according to an embodiment of the present invention;
fig. 4 is a structural distribution diagram of a storage space recycling apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, although the application of the self-thin configuration technology improves the utilization rate of the storage space, the storage space still has an idle storage space; the invention effectively identifies the idle space and recovers the idle storage space, thereby further improving the utilization rate of the storage space in the self-simplified configured host file system.
The embodiment of the invention discloses a storage space recovery method, which is applied to a self-thin configured host file system and is shown in figure 1, and comprises the following steps:
s1: acquiring an idle storage space in a disk block according to metadata of a host file system;
generally, prior to step S1, an action of identifying the host file system on the storage array side is also performed.
The metadata is responsible for managing and recording disk space allocation, and the specific access authority, the file owner, the distribution mapping information of the file data blocks and the like are all managed and recorded by the metadata; and the free storage space in the disk block actually refers to the free storage space of the thin volume.
S2; judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space;
wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold.
It can be understood that it is not uncommon for idle storage spaces to occur in a disk block, and the cumulative size of the idle storage spaces exceeds a certain limit, which may cause a significant impact on the space allocation and affect the utilization of the disk block. Therefore, in consideration of time cost, resource allocation and the like, a specific recovery requirement is set, and once the recovery requirement is met, the free storage space is recovered, and if the recovery requirement is not met, the free storage space can be temporarily reserved.
The invention discloses a storage space recovery method, which is applied to a self-simplified configured host file system and comprises the following steps: acquiring an idle storage space in a disk block according to metadata of a host file system; judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space; wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold. The method is applied to a self-simplification configuration system, effectively identifies and acquires the idle storage space by using the metadata, and then recovers the idle storage space meeting the recovery requirement, thereby further improving the utilization rate of the storage space.
The embodiment of the invention discloses a specific storage space recovery method, and compared with the previous embodiment, the embodiment further describes and optimizes the technical scheme. Referring to fig. 2, specifically:
the process of acquiring the free storage space in the disk block according to the metadata of the host file system in step S1 includes:
s11: acquiring an actually unallocated interval in the disk block according to the metadata;
wherein, the actual distribution interval obtained according to the metadata does not have a storage object in the record data of the metadata; however, the host actually has cache data, and the cache data falls into the disk, which may affect the identification of the actually unallocated space.
Specifically, the step of obtaining the actually unallocated extent in the disk block according to the metadata in step S11 specifically includes:
s111: acquiring a bit diagram of the storage condition of the disk block according to the metadata;
it will be appreciated that the bit map records space allocation and storage for disk blocks, where the code of the bit map corresponds to the storage area of the disk block.
Acquiring a bit diagram of the storage condition of the disk block according to the metadata;
judging the area which is continuously a preset code in the bit diagram as an unallocated area, and acquiring the position information of the unallocated area; the location information includes a start location and a length of the unallocated area;
s112: judging the area which is continuously a preset code in the bit diagram as an unallocated area, and acquiring the position information of the unallocated area; the location information includes a start location and a length of the unallocated area;
the allocation status is usually represented in the bit map by codes 0 and 1, one case is that code 0 represents no allocation, code 1 represents allocated, and the other is just the opposite. The preset code corresponds to a code that indicates no assignment, and may be 1 or 0.
Specifically, two or more preset codes appear in a string of codes at intervals, which is the case of continuous preset codes. The code is the preset code, which means that the system does not allocate a storage object to the corresponding disk block, and theoretically, the unallocated area has no storage object.
S113: and acquiring the actually unallocated intervals in the disk blocks according to the position information and the mapping relation between the bit map and the disk blocks.
It will be appreciated that this step ultimately results in location information for the actually unallocated extents in the disk blocks for storage, the determination of which are still likely to be affected by the writing of the buffered data to disk.
S12: and obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval.
As shown in step S11, there are many possible situations in the actually unallocated space, and the actually unallocated space cannot be directly regarded as an idle storage space only by the metadata record. And considering various possible situations, and eliminating the disk intervals which are not actually allocated and should not be recycled again to obtain the final free storage space.
Specifically, the step S12 of obtaining the free storage space according to the cache data of the host file system and the actually unallocated interval includes:
s121: obtaining a cache write-in interval in the disk block according to the cache data;
specifically, the obtaining process of this step may further include an action of recording the buffer write interval. The buffer write interval is actually a buffer IO write disk interval located in a disk block.
S122: acquiring the intersection of the actual distribution interval and the cache writing interval;
s123: and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
The embodiment of the invention discloses a specific storage space recovery method, and compared with the previous embodiment, the embodiment further describes and optimizes the technical scheme.
Further, the operation frequency of each step is set.
The process of acquiring the free storage space in the disk block in step S1 specifically includes:
and according to the first preset acquisition frequency and the metadata of the host file system, regularly acquiring the idle storage space in the disk block.
Correspondingly, the step of determining whether the free storage space meets the recycling requirement in step S2 specifically includes:
and according to a second preset acquisition frequency, regularly judging whether the idle storage space meets the recovery requirement.
Usually, the first preset acquisition frequency is higher than the second preset acquisition frequency, the actions of acquiring the idle storage space and judging the recovery are executed at regular time, and the purpose of recovering the storage space is automatically realized through a program.
Correspondingly, the embodiment of the present invention further discloses a storage space recycling system, which is applied to a self-thin configured host file system, and as shown in fig. 3, the storage space recycling system includes:
the information acquisition module 01 is used for acquiring an idle storage space in a disk block according to metadata of a host file system;
the judging module 02 is used for judging whether the idle storage space meets the recycling requirement or not; if yes, triggering a recovery module 03;
the recovery module 03 is configured to recover the free storage space;
wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold.
Therefore, the method is applied to a self-simplified configuration system, the metadata is utilized to effectively identify and acquire the idle storage space, and then the idle storage space meeting the recovery requirement is recovered, so that the utilization rate of the storage space is further improved.
In some specific embodiments, the information obtaining module 01 is specifically configured to:
a first obtaining module 011 configured to obtain an actually unallocated interval in the disk block according to the metadata;
a second obtaining module 012, configured to obtain the free storage space according to the cache data of the host file system and the actually unallocated interval.
In some specific embodiments, the first obtaining module 011 is specifically configured to: acquiring a bit diagram of the storage condition of the disk block according to the metadata; wherein code 0 in the bit map indicates unallocated code 1 indicates allocated code; judging the continuous 0 areas in the bit map as unallocated areas, and acquiring the position information of the unallocated areas; the location information includes a start location and a length of the unallocated area; and acquiring the actually unallocated intervals in the disk blocks according to the position information and the mapping relation between the bit map and the disk blocks.
In some embodiments, the second obtaining module 012 is specifically configured to: obtaining a cache write-in interval in the disk block according to the cache data; acquiring the intersection of the actual distribution interval and the cache writing interval; and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
In some specific embodiments, the information obtaining module 01 is specifically configured to: and according to the first preset acquisition frequency and the metadata of the host file system, regularly acquiring the idle storage space in the disk block.
In some specific embodiments, the determining module 02 is specifically configured to: and according to a second preset acquisition frequency, regularly judging whether the idle storage space meets the recovery requirement.
The embodiment of the present invention further discloses a storage space recycling device, which is applied to a self-thin configured host file system, and as shown in fig. 4, the storage space recycling device includes:
a memory 11 for storing a computer program;
a processor 12 for implementing the following steps when executing the computer program:
acquiring an idle storage space in a disk block according to metadata of a host file system;
judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space;
wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold.
Therefore, the method is applied to a self-simplified configuration system, the metadata is utilized to effectively identify and acquire the idle storage space, and then the idle storage space meeting the recovery requirement is recovered, so that the utilization rate of the storage space is further improved.
In some specific embodiments, when the processor 12 executes the computer subprogram stored in the memory 11, the following steps are specifically implemented: acquiring an actually unallocated interval in the disk block according to the metadata; and obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval.
In some specific embodiments, when the processor 12 executes the computer subprogram stored in the memory 11, the following steps are specifically implemented: acquiring a bit diagram of the storage condition of the disk block according to the metadata; wherein code 0 in the bit map indicates unallocated code 1 indicates allocated code; judging the continuous 0 areas in the bit map as unallocated areas, and acquiring the position information of the unallocated areas; the location information includes a start location and a length of the unallocated area; and acquiring the actually unallocated intervals in the disk blocks according to the position information and the mapping relation between the bit map and the disk blocks.
In some specific embodiments, when the processor 12 executes the computer subprogram stored in the memory 11, the following steps are specifically implemented: obtaining a cache write-in interval in the disk block according to the cache data; acquiring the intersection of the actual distribution interval and the cache writing interval; and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
In some specific embodiments, when the processor 12 executes the computer subprogram stored in the memory 11, the following steps are specifically implemented: the process of obtaining the idle storage space in the disk block specifically includes: and according to the first preset acquisition frequency and the metadata of the host file system, regularly acquiring the idle storage space in the disk block.
In some specific embodiments, when the processor 12 executes the computer subprogram stored in the memory 11, the following steps are specifically implemented: and according to a second preset acquisition frequency, regularly judging whether the idle storage space meets the recovery requirement.
Further, the storage space recycling device in this embodiment may further include:
the input interface 13 is configured to obtain a computer program imported from the outside, store the obtained computer program in the memory 11, and also be configured to obtain various instructions and parameters transmitted by an external terminal device, and transmit the instructions and parameters to the processor 12, so that the processor 12 performs corresponding processing by using the instructions and parameters. In this embodiment, the input interface 13 may specifically include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, and the like.
And the output interface 14 is used for outputting various data generated by the processor 12 to the terminal equipment connected with the output interface 14, so that other terminal equipment connected with the output interface 14 can acquire various data generated by the processor 12. In this embodiment, the output interface 14 may specifically include, but is not limited to, a USB interface, a serial interface, and the like.
And a communication unit 15 for establishing a remote communication connection between the storage space reclamation apparatus and the external server so that the storage space reclamation apparatus can mount the image file to the external server. In this embodiment, the communication unit 15 may specifically include, but is not limited to, a remote communication unit based on a wireless communication technology or a wired communication technology.
And the keyboard 16 is used for acquiring various parameter data or instructions input by a user through real-time key cap knocking.
And the display 17 is used for displaying relevant information of the folder hanging process in real time so that a user can know the operation condition of the storage space recovery device in time.
The mouse 18 may be used to assist the user in entering data and to simplify the user's operation.
Correspondingly, the invention also discloses a readable storage medium, which is applied to the self-thin configuration host file system, wherein a computer program is stored on the readable storage medium, and when being executed by a processor, the computer program realizes the following steps:
acquiring an idle storage space in a disk block according to metadata of a host file system;
judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space;
wherein the reclamation requirement comprises that the size of the free storage space exceeds a preset threshold.
Therefore, the method is applied to a self-simplified configuration system, the metadata is utilized to effectively identify and acquire the idle storage space, and then the idle storage space meeting the recovery requirement is recovered, so that the utilization rate of the storage space is further improved.
In some specific embodiments, when executed by a processor, the computer sub-program stored in the readable storage medium may specifically implement the following steps: acquiring an actually unallocated interval in the disk block according to the metadata; and obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval.
In some specific embodiments, when executed by a processor, the computer sub-program stored in the readable storage medium may specifically implement the following steps: acquiring a bit diagram of the storage condition of the disk block according to the metadata; wherein code 0 in the bit map indicates unallocated code 1 indicates allocated code; judging the continuous 0 areas in the bit map as unallocated areas, and acquiring the position information of the unallocated areas; the location information includes a start location and a length of the unallocated area; and acquiring the actually unallocated intervals in the disk blocks according to the position information and the mapping relation between the bit map and the disk blocks.
In some specific embodiments, when executed by a processor, the computer sub-program stored in the readable storage medium may specifically implement the following steps: obtaining a cache write-in interval in the disk block according to the cache data; acquiring the intersection of the actual distribution interval and the cache writing interval; and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
In some specific embodiments, when executed by a processor, the computer sub-program stored in the readable storage medium may specifically implement the following steps: and according to the first preset acquisition frequency and the metadata of the host file system, regularly acquiring the idle storage space in the disk block.
In some specific embodiments, when executed by a processor, the computer sub-program stored in the readable storage medium may specifically implement the following steps: and according to a second preset acquisition frequency, regularly judging whether the idle storage space meets the recovery requirement.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for a method, a system, a device and a readable storage medium for recovering a storage space, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (6)

1. A storage space recovery method is applied to a self-thin configured host file system, and is characterized by comprising the following steps:
acquiring an idle storage space in a disk block according to metadata of a host file system;
judging whether the idle storage space meets the recovery requirement, and if so, recovering the idle storage space;
wherein the recycling requirement comprises that the size of the free storage space exceeds a preset threshold;
the process of obtaining the idle storage space in the disk block according to the metadata of the host file system includes:
acquiring an actually unallocated interval in the disk block according to the metadata;
obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval;
the process of obtaining the actually unallocated extents in the disk block according to the metadata specifically includes:
acquiring a bit diagram of the storage condition of the disk block according to the metadata;
judging the area which is continuously a preset code in the bit diagram as an unallocated area, and acquiring the position information of the unallocated area; the location information includes a start location and a length of the unallocated area;
acquiring an actually unallocated interval in the disk block according to the position information and the mapping relationship between the bit map and the disk block;
the process of obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval specifically includes:
obtaining a cache write-in interval in the disk block according to the cache data;
acquiring the intersection of the actual distribution interval and the cache writing interval;
and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
2. The method for recycling storage space according to claim 1, wherein the process of acquiring free storage space in a disk block specifically comprises:
and according to the first preset acquisition frequency and the metadata of the host file system, regularly acquiring the idle storage space in the disk block.
3. The method for recycling storage space according to claim 2, wherein the step of determining whether the free storage space meets the recycling requirement specifically comprises:
and according to a second preset acquisition frequency, regularly judging whether the idle storage space meets the recovery requirement.
4. A storage space recovery system is applied to a self-thin configured host file system, and is characterized by comprising:
the information acquisition module is used for acquiring the idle storage space in the disk block according to the metadata of the host file system;
the judging module is used for judging whether the idle storage space meets the recycling requirement or not; if yes, triggering a recovery module;
the recovery module is used for recovering the idle storage space;
wherein the recycling requirement comprises that the size of the free storage space exceeds a preset threshold;
the information acquisition module is specifically configured to:
acquiring an actually unallocated interval in the disk block according to the metadata;
obtaining the idle storage space according to the cache data of the host file system and the actually unallocated interval;
the process of acquiring, by the information acquisition module, the actually unallocated interval in the disk block according to the metadata specifically includes:
acquiring a bit diagram of the storage condition of the disk block according to the metadata;
judging the area which is continuously a preset code in the bit diagram as an unallocated area, and acquiring the position information of the unallocated area; the location information includes a start location and a length of the unallocated area;
acquiring an actually unallocated interval in the disk block according to the position information and the mapping relationship between the bit map and the disk block;
the process of obtaining the idle storage space by the information obtaining module according to the cache data of the host file system and the actually unallocated interval specifically includes:
obtaining a cache write-in interval in the disk block according to the cache data;
acquiring the intersection of the actual distribution interval and the cache writing interval;
and taking the part of the non-actual distribution interval except the intersection as the idle storage space.
5. A storage space recycling device applied to a self-thin configured host file system is characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the storage space reclamation method as claimed in any one of claims 1 to 3 when executing said computer program.
6. A readable storage medium for a self-thin provisioning host file system, wherein the readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the storage space reclamation method as recited in any one of claims 1 to 3.
CN201810538966.9A 2018-05-30 2018-05-30 Storage space recovery method, system, device and readable storage medium Active CN108762678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810538966.9A CN108762678B (en) 2018-05-30 2018-05-30 Storage space recovery method, system, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810538966.9A CN108762678B (en) 2018-05-30 2018-05-30 Storage space recovery method, system, device and readable storage medium

Publications (2)

Publication Number Publication Date
CN108762678A CN108762678A (en) 2018-11-06
CN108762678B true CN108762678B (en) 2021-11-09

Family

ID=64004087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810538966.9A Active CN108762678B (en) 2018-05-30 2018-05-30 Storage space recovery method, system, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN108762678B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109739688B (en) * 2018-12-18 2021-01-26 杭州宏杉科技股份有限公司 Snapshot resource space management method and device and electronic equipment
CN111078920B (en) * 2019-11-22 2021-09-03 北京云宽志业网络技术有限公司 Data processing method, device, equipment and computer readable storage medium
CN113032351B (en) * 2021-03-31 2023-01-13 中国建设银行股份有限公司 Recovery method and device of network file system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677674A (en) * 2013-12-27 2014-03-26 华为技术有限公司 Data processing method and device
CN104317742A (en) * 2014-11-17 2015-01-28 浪潮电子信息产业股份有限公司 Automatic thin-provisioning method for optimizing space management
CN104820575A (en) * 2015-04-27 2015-08-05 西北工业大学 Method for realizing thin provisioning of storage system
CN107368260A (en) * 2017-06-30 2017-11-21 北京奇虎科技有限公司 Memory space method for sorting, apparatus and system based on distributed system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6094605A (en) * 1998-07-06 2000-07-25 Storage Technology Corporation Virtual automated cartridge system
US9678681B2 (en) * 2015-06-17 2017-06-13 International Business Machines Corporation Secured multi-tenancy data in cloud-based storage environments

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677674A (en) * 2013-12-27 2014-03-26 华为技术有限公司 Data processing method and device
CN104317742A (en) * 2014-11-17 2015-01-28 浪潮电子信息产业股份有限公司 Automatic thin-provisioning method for optimizing space management
CN104820575A (en) * 2015-04-27 2015-08-05 西北工业大学 Method for realizing thin provisioning of storage system
CN107368260A (en) * 2017-06-30 2017-11-21 北京奇虎科技有限公司 Memory space method for sorting, apparatus and system based on distributed system

Also Published As

Publication number Publication date
CN108762678A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN108762678B (en) Storage space recovery method, system, device and readable storage medium
EP3258397A1 (en) Text address processing method and apparatus
US9443082B2 (en) User evaluation
CN112559306B (en) User behavior track obtaining method and device and electronic equipment
EP3364303B1 (en) Data arrangement method, storage apparatus, storage controller and storage array
CN106648938B (en) Linux system application program memory management method and system
CN108153594B (en) Resource fragment sorting method of artificial intelligence cloud platform and electronic equipment
CN109683825B (en) Storage system online data compression method, device and equipment
WO2016148738A1 (en) File management
CN111382126B (en) System and method for deleting file and preventing file recovery
US9122402B2 (en) Increasing efficiency of block-level processes using data relocation awareness
CN112817962B (en) Data storage method and device based on object storage and computer equipment
US10228885B2 (en) Deallocating portions of data storage based on notifications of invalid data
CN113297409A (en) Image searching method and device, electronic equipment and storage medium
CN113626882A (en) Method, device and medium for generating equipment identifier
CN103902468A (en) Data elimination method and device for storage system
JP5956064B2 (en) Computer system, data management method, and computer
US9606909B1 (en) Deallocating portions of provisioned data storage based on defined bit patterns indicative of invalid data
CN110879764B (en) Bitmap setting method, device and equipment and readable storage medium
CN107577433B (en) Storage medium and file data migration method, device and equipment
CN109753222B (en) Data deleting method, server and computer readable medium
Malik Android system call analysis for malicious application detection
CN113064553B (en) Data storage method, device, equipment and medium
CN115098877A (en) File encryption and decryption method and device, electronic equipment and medium
KR101539617B1 (en) File wiping method according to file type structure in mobile system, and apparatus thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant