A method, device, and storage medium for cleaning NAS storage resource residues

By building a NAS resource database and periodically detecting, residual resources in NAS storage devices are automatically cleaned up, and the performance problems caused by resource residues are solved to ensure the stable operation of the equipment.

CN115373604BActive Publication Date: 2025-07-04INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211041913.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2025-07-04
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

NAS storage devices are prone to resource residues under system abnormalities or other reasons, occupying system resources, affecting user usage and system performance, and cannot be cleaned up in time.

Method used

Build a NAS resource database, periodically detect resource status, judge residual resources through resource name and type, generate a cleanup and update list, and automatically clean and update the resource database.

Benefits of technology

Effectively clean up residual resources, reduce resource occupation, avoid performance degradation, and ensure normal operation of NAS storage devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373604B_ABST
    Figure CN115373604B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device and storage medium for cleaning residual NAS storage resources, which can automatically clean the residual resources in the device, reduce resource occupation, and avoid the reduction of device performance and the impact on user use caused by excessive residual resources. In the present invention, a NAS resource database for maintaining resource information of NAS resources is constructed, and during relatively idle business time, NAS resources in a non-creating state or a non-deleting state are periodically compared and analyzed with the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether the NAS resources are residual; according to the residual and resource information conditions, a resource residual list, a database residual list and a database update list for controlling residual cleaning and NAS resource database update are statistically calculated; corresponding operations are performed according to the data in the resource residual list, the database residual list and the database update list to clean the residuals and update the NAS resource database, so as to realize automatic cleaning of the residual resources in the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of NAS resource residue cleaning, and in particular, to a method, device and storage medium for cleaning NAS storage resource residues. Background Art

[0002] NAS (Network Attached Storage) storage is usually designed directly for users, and can provide users with file-level user storage. Users can remotely access and perform data storage and retrieval services through protocols such as NFS, CIFS, and FTP.

[0003] When a user uses NAS storage, the server itself usually automatically creates the resources required by the file system in the background and automatically performs preprocessing to provide services for the user. In addition to the file system, other services related to NAS, such as NAS snapshots and NAS disaster recovery, can also complete the resource creation work without the user's awareness. Since NAS storage directly provides file-level storage services for users, users' perception of background resources is not intuitive enough. When the system encounters an exception or other reasons (such as system power failure, storage disk being unplugged, etc.) that cause the NAS service to be interrupted during the service provision process, various types of resource residues are likely to be generated, and users may not be aware of it. As the running time of the NAS storage device accumulates, more and more accumulated resource residues are generated. The residual resources not only occupy the resource specifications of the system, affect user usage, but also may reduce the system performance, affect the creation of other resources, and cause the NAS storage to be unable to provide services normally, resulting in losses. Summary of the Invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present invention provides a method, device and storage medium for cleaning NAS storage resource residues.

[0005] In a first aspect, the present invention provides a method for cleaning NAS storage resource residues, including: constructing a NAS resource database for maintaining resource information of NAS resources, where the resource information includes: the resource name and resource type of the NAS resources;

[0006] During relatively idle business hours, periodically compare and analyze the NAS resources in a non-creating or non-deleting state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether the NAS resources are residual; when it is found that all subtype resources related to the NAS resources are residual and there is no corresponding resource information in the NAS resource database, identify them as resource residues and record them in the resource residue list; when it is found that there is resource information in the NAS resource database but the NAS resource cannot be found, record it in the database residue list; when it is found that all subtype resources of the NAS resource exist and the status is normal, but there is no corresponding resource information in the NAS resource database, record it in the database update list; perform corresponding operations according to the data in the resource residue list, the database residue list, and the database update list to clean up the residual resources and update the NAS resource database.

[0007] Furthermore, configure status attributes for the NAS resources, and the status attributes include the deleting state and the creating state; during the creation process of the NAS resource, before the creation of the last subtype resource involved in the NAS resource is completed, the NAS resource is in the creating state; during the deletion process of the NAS resource, before the deletion of the last subtype resource involved in the NAS resource is completed, the NAS resource is in the deleting state.

[0008] Furthermore, when deleting the NAS resource, starting from the data of the first subtype resource of the deleted NAS resource, clear the resource information related to all subtype resources involved in the NAS resource from the NAS resource database.

[0009] Furthermore, when creating the NAS resource, after all subtype resources involved in the NAS resource are created, verify the integrity of the NAS resource. After verification, record the corresponding resource information in the NAS resource database.

[0010] Furthermore, comparing and analyzing the NAS resources in a non-creating or non-deleting state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether there are residues includes: setting different integrity verification schemes according to the different types of NAS resources and the different subtype resources required by different types of NAS resources to judge the residual resources. The different types of NAS resources include: NAS resources of the NAS file system type, NAS shared resources, NAS user resources, and NAS snapshots.

[0011] Further, comparing and analyzing the NAS resources in a non-creating state or a non-deleting state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether there are residues includes: when subtype resources can be found in the NAS resource database, but there is no record of the NAS resources in the NAS resource database, after the deletion process updates the NAS resource database, the deletion process of the subtype resources of the NAS resources is not completed, or during the creation of the NAS resources, the creation process of the subtype resources of the NAS resources is not completed, and as a result, the creation process is interrupted and the database is not updated. The queried subtype resources are identified as residual resources.

[0012] Further, perform corresponding operations according to the data in the resource residue list, the database residue list, and the database update list, and clean the residual resources and update the NAS resource database, including:

[0013] Delete the corresponding residual resources in the system according to the content of each item in the resource residue list; delete the corresponding resource information in the NAS resource database according to the content of each item in the database residue list; add the corresponding resource information to the NAS resource database according to the content of each item in the database update list.

[0014] Further, record the NAS resources in a creating state or a deleting state that have not been detected for residues through the undetected list; monitor the creation or deletion status of the NAS resources in the undetected list, and when the creation or deletion is completed, perform residue detection on the NAS resources that have completed creation or deletion.

[0015] In a second aspect, the present invention provides a NAS storage resource residue cleaning device, including: at least one processing unit, a storage unit, and a bus unit. The bus unit connects the processing unit and the storage unit. The storage unit stores computer programs and data, and the processing unit executes the computer programs to process the data to implement the NAS storage resource residue cleaning method described above.

[0016] In a third aspect, the present invention provides a storage medium for implementing the NAS storage resource residue cleaning method. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the NAS storage resource residue cleaning method described above.

[0017] The above technical solutions provided by the embodiments of the present invention have the following advantages compared with the prior art:

[0018] The present invention constructs and maintains a NAS resource database for resource information of NAS resources, and at a time when the service is relatively idle, periodically compares and analyzes the NAS resources in a non-creating state or a non-deleting state and the resource information status in the NAS resource database according to a residual resource determination scheme to determine whether they are residuals; counts a resource residual list, a database residual list, and a database update list for controlling residual cleaning and NAS resource database update according to the residual and resource information conditions; performs corresponding operations according to the data in the resource residual list, the database residual list, and the database update list, cleans the residuals, and updates the NAS resource database. It realizes automatic cleaning of residual resources in the device, reduces resource occupation, avoids excessive resource residuals from reducing the device performance and affecting user use. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0021] Figure 1 It is a flowchart of a method for cleaning NAS storage resource residuals provided by an embodiment of the present invention;

[0022] Figure 2 It is a flowchart of maintaining the resource information of NAS resources to be integrity-verified in the NAS resource database when creating NAS resources provided by an embodiment of the present invention;

[0023] Figure 3 It is a flowchart of comparing and analyzing the NAS resources in a non-creating state or a non-deleting state and the resource information status in the NAS resource database according to a residual resource determination scheme to determine whether they are residuals provided by an embodiment of the present invention;

[0024] Figure 4 It is a schematic diagram of a device for cleaning NAS storage resource residuals provided by an embodiment of the present invention;

[0025] Figure 5 It is a schematic diagram of a system for cleaning NAS storage resource residuals provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0027] It should be noted that, in this document, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0028] Embodiment 1

[0029] Refer to Figure 1 As shown, the present invention provides a method for cleaning NAS storage resource residues, which includes:

[0030] S100. Build a NAS resource database for maintaining the resource information of NAS resources, where the resource information includes the resource name and resource type of the NAS resources. During the specific implementation process, a modification interface for the NAS resource database is reserved, and the design modification of the NAS resource database can be made according to requirements during later maintenance.

[0031] Refer to Figure 2 As shown, when creating a NAS resource, the resource information of the NAS resource for verifying integrity is maintained in the NAS resource database:

[0032] S101. All the sub-type resources involved in the NAS resource are created. During the creation of the NAS resource, the creation of several sub-type resources is involved. For example, a NAS resource involves three sub-type resources: a file system volume, a volume mapping relationship, and a file system resource. Only when all three sub-type resources are created can the NAS resource be created.

[0033] S102. Verify the integrity of the created NAS resource. If the verification is complete, execute S103. Specifically, when all subtype resources are created, judge the integrity of the created NAS resource by checking the existence and status of the subtype resources involved in the NAS resource. For example, for a NAS resource involving three subtype resources: file system volume, volume mapping relationship, and file system resource, the NAS resource is considered complete only when all three subtype resources of file system volume, volume mapping relationship, and file system resource exist and are in normal status.

[0034] S103. Automatically record the corresponding resource information of the NAS resource into the NAS resource database.

[0035] If the created NAS resource is verified to be complete, record the resource information of the NAS resource into the NAS database.

[0036] When deleting a NAS resource, delete the corresponding resource information of the NAS resource in the NAS resource database: When deleting a NAS resource, start from the data of the first subtype resource of the deleted NAS resource, that is, automatically clear all the resource information related to the subtype resources involved in the NAS resource from the NAS resource database.

[0037] S200. At a time when the business is relatively idle, periodically compare and analyze the NAS resources in a non-creating or non-deleting state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether there is a residue.

[0038] In the specific implementation process, since traversing the NAS resources in the system for residue detection takes up some CPU resources, and the residue generation rate itself is a small probability event, in order to reduce the CPU occupancy rate during the residue detection and cleaning process, it is set to execute at 3:00 am every day when the business is relatively idle, and execute once a day to reduce the impact on the normal business of the NAS storage and avoid excessive accumulation of resource residues. A feasible method for timing the residue detection uses the crontab timing command.

[0039] In the specific implementation process, refer to Figure 3 As shown, comparing and analyzing the NAS resources in a non-creating or non-deleting state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether there is a residue includes:

[0040] S201. When performing NAS resource residue detection, obtain the status attributes of NAS resources. In the specific implementation process, configure status attributes for NAS resources. The status attributes include the deleting status and the creating status. During the creation process of a NAS resource, before the last subtype resource involved in the NAS resource is created, the NAS resource is in the creating status. During the deletion process of a NAS resource, before the last subtype resource involved in the NAS resource is deleted, the NAS resource is in the deleting status.

[0041] S202. After excluding NAS resources in the deleting status and the creating status according to the status attributes, perform residue detection on the remaining NAS resources. For NAS resources in the deleting status or the creating status, do not perform residue detection to avoid abnormal situations caused by repeatedly deleting resources that are in the process of being deleted or deleting NAS resources that are in the process of being created.

[0042] Furthermore, record NAS resources in the creating status or the deleting status that have not undergone residue detection through an undetected list; monitor the creation or deletion status of NAS resources in the undetected list, and when the creation or deletion is completed, perform residue detection on the NAS resources that have completed creation or deletion. Comparing and analyzing the resource information status of NAS resources that are not in the creating status or the deleting status and the resources in the NAS resource database according to the residue resource identification scheme to determine whether it is a residue includes:

[0043] S203. Use an integrity verification scheme to judge residue resources for different types of NAS resources. Specifically, according to the different types of NAS resources and the different subtype resources required by different types of NAS resources, set different integrity verification schemes to judge residue resources. The different types of NAS resources include: NAS resources of the NAS file system type, NAS shared resources, NAS user resources, and NAS snapshots. For example, for NAS resources of the NAS file system type, the included subtype resources include file system volumes, volume mapping relationships, and file system resources. Only when all three subtype resources are working properly and there are corresponding resource information records in the NAS database, the NAS resource is non-defective; otherwise, judge the NAS resource as a residue resource. Furthermore, when the subtype resources of a NAS resource can be found in the NAS resource database but there is no record of the NAS resource, after the deletion process updates the NAS resource database, the deletion process of the subtype resources of the NAS resource is not completed, or during the creation process of the NAS resource, the creation process of the subtype resources of the NAS resource is not completed and the creation process of the NAS resource is interrupted without updating the database, the queried subtype resources are identified as residue resources.

[0044] S300. Statistically generate a resource residue list, a database residue list, and a database update list for controlling residue cleanup and NAS resource database updates based on the residue and resource information:

[0045] When it is found that residues exist for all subtype resources related to NAS resources and corresponding resource information does not exist in the NAS resource database, they are identified as resource residues and included in the resource residue list.

[0046] When it is found that resource information exists in the NAS resource database but the NAS resource cannot be found, it is included in the database residue list.

[0047] When it is found that all subtype resources of the NAS resource exist and the status is normal, but they do not exist in the NAS resource database, they are included in the database update list.

[0048] S400. Perform corresponding operations based on the data in the resource residue list, the database residue list, and the database update list to clean up the residues and update the NAS resource database. In the specific implementation process, performing corresponding operations based on the data in the resource residue list, the database residue list, and the database update list to clean up the residual resources and update the NAS resource database includes:

[0049] Delete the corresponding residual resources in the system according to the content of each item in the resource residue list; delete the corresponding resource information in the NAS resource database according to the content of each item in the database residue list; add the corresponding resource information to the NAS resource database according to the content of each item in the database update list.

[0050] Embodiment 2

[0051] Refer to Figure 4 As shown, an embodiment of the present invention provides a NAS storage resource residue cleanup device, including: at least one processing unit, a storage unit, and a bus unit. The bus unit connects the processing unit and the storage unit. The storage unit stores computer programs and data. The processing unit executes the computer programs to process the data to implement the NAS storage resource residue cleanup method.

[0052] Embodiment 3

[0053] An embodiment of the present invention provides a storage medium for implementing the NAS storage resource residue cleanup method. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the NAS storage resource residue cleanup method.

[0054] Embodiment 4

[0055] Refer to Figure 5As shown in the figure, an embodiment of the present invention provides a system for implementing NAS storage resource residue cleaning, including: a NAS resource statistics module, which maintains the NAS resource database. When creating a NAS resource, it maintains the resource information of the NAS resource that has been verified to be complete in the NAS resource database. When deleting a NAS resource, starting from the deletion of the resource data of the first subtype of the NAS resource, it automatically clears all the resource information related to the sub-type resources involved in the NAS resource from the NAS resource database.

[0056] A NAS residual resource automatic detection module, which, during a relatively idle time of the service, periodically compares and analyzes the status of NAS resources that are not in the creation state or the deletion state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether they are residues. And according to the residual and resource information conditions, it statistically controls the resource residual list, database residual list, and database update list for residual cleaning and NAS resource database update.

[0057] A NAS residual resource deletion module, which performs corresponding operations according to the resource residual list, database residual list, and database update list generated by the NAS residual resource automatic detection module, cleans the residues and updates the NAS resource database. It deletes the corresponding residual resources in the system according to the content of each item in the resource residual list; deletes the corresponding resource information in the NAS resource database according to the content of each item in the database residual list; and adds the corresponding resource information to the NAS resource database according to the content of each item in the database update list.

[0058] In several embodiments provided by the present invention, it should be understood that the disclosed modules and units can be implemented in other ways. For example, the structural embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection shown or discussed with each other can be through some interfaces. The indirect coupling or communication connection of the system or unit can be in an electrical, mechanical or other form.

[0059] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0060] In addition, in each embodiment of the present invention, each functional unit may be integrated into a processing unit, may exist physically alone for each unit, or two or more units may be integrated into one unit.

[0061] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, those of ordinary skill in the art can make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions should all be within the scope of the present invention / Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for cleaning residual NAS storage resources, characterized in that, Including: Constructing a NAS resource database for maintaining resource information of NAS resources, where the resource information includes: the resource name and resource type of the NAS resources; During relatively idle business time, periodically comparing and analyzing the NAS resources in a non-creating or non-deleting state and the resource information status in the NAS resource database according to the residual resource identification scheme to determine whether the NAS resources are residuals, including: setting different integrity verification schemes according to different types of NAS resources and different types of subtype resources required by different types of NAS resources to perform residual resource judgment. Different types of NAS resources include: NAS resources of the NAS file system type, NAS shared resources, NAS user resources, and NAS snapshots; when the subtype resources can be found in the NAS resource database, but there is no record of the NAS resource in the NAS resource database, after the deletion process updates the NAS resource database, the deletion process of the subtype resources of the NAS resource is not completed, or during the creation process of the NAS resource, the creation process of the subtype resources of the NAS resource is not completed, and the creation process of the NAS resource is interrupted and the database is not updated, the queried subtype resources are identified as residual resources; When it is found that all subtype resources related to the NAS resource are residual and there is no corresponding resource information in the NAS resource database, it is identified as a resource residual and recorded in the resource residual list; when it is found that there is resource information in the NAS resource database but the NAS resource cannot be found, it is recorded in the database residual list; when it is found that all subtype resources of the NAS resource exist and are in normal state, but there is no corresponding resource information in the NAS resource database, it is recorded in the database update list; corresponding operations are performed according to the data in the resource residual list, the database residual list, and the database update list to clean up the residual resources and update the NAS resource database.

2. The NAS storage resource residual cleaning method according to claim 1, wherein, Configuring status attributes for the NAS resources, where the status attributes include the deleting state and the creating state; during the creation process of the NAS resource, before the creation of the last subtype resource involved in the NAS resource is completed, the NAS resource is in the creating state; during the deletion process of the NAS resource, before the last subtype resource involved in the NAS resource is deleted, the NAS resource is in the deleting state.

3. The NAS storage resource residual cleaning method according to claim 1, characterized in that When deleting a NAS resource, starting from the data of the first subtype resource of the deleted NAS resource, the resource information related to all subtype resources involved in the NAS resource is cleared from the NAS resource database.

4. The NAS storage resource residual cleaning method according to claim 1, wherein When creating a NAS resource, when all subtype resources involved in the NAS resource are created, verify the integrity of the NAS resource. After verification is complete, record the corresponding resource information in the NAS resource database.

5. The NAS storage resource residual cleaning method according to claim 1, wherein Performing corresponding operations according to the data in the resource residual list, the database residual list, and the database update list to clean up the residual resources and update the NAS resource database includes: Delete the corresponding residual resources in the system according to the content of each item in the resource residual list; delete the corresponding resource information in the NAS resource database according to the content of each item in the database residual list; add the corresponding resource information to the NAS resource database according to the content of each item in the database update list.

6. The NAS storage resource residual cleaning method according to claim 1, wherein, Record the NAS resources in the creating or deleting state that have not been subjected to residual detection through the undetected list; monitor the creating or deleting state of the NAS resources in the undetected list, and when the creation or deletion is completed, perform residual detection on the NAS resources that have completed creation or deletion.

7. A NAS storage resource residue cleaning device, characterized in that, Include: At least one processing unit, a storage unit, and a bus unit, where the bus unit connects the processing unit and the storage unit, the storage unit stores computer programs and data, and the processing unit executes the computer programs to process the data to implement the NAS storage resource residual cleaning method according to any one of claims 1-6.

8. A storage medium for implementing a method for cleaning up NAS storage resource residues, wherein the storage medium stores a computer program, characterized in that When the computer program is executed by a processor, it implements the NAS storage resource residual cleaning method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Residual file uninstallation processing method and apparatus as well as terminal

    CN105243102A

  • Optimization method, device and equipment for preventing all-flash stack NAS (Network Attached Storage) snapshot from remaining

    CN114780294A