A method and system for securely deleting files in the recycle bin of a cloud disk

By building database tables and judging based on the number of references, the invalid files in the Cloud Disk Recycle Bin are safely deleted, which solves the problems of storage resource occupation and error deletion, and achieves safe and efficient file deletion and data recovery.

CN115757294BActive Publication Date: 2025-07-08E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211447273.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2025-07-08
Estimated Expiration
2042-11-18

AI Technical Summary

Technical Problem

Failed files in the cloud disk recycling bin occupy storage resources, and direct deletion may lead to false deletion of other users' files. The existing technology cannot effectively manage and safely delete invalid files.

Method used

By constructing storage object-file relationship table, user file information backup table, storage object backup table and file deletion record table, logical deletion is performed in the order of invalid files' failure time, and whether physical deletion is performed based on the number of references of the resource pool object ID field is judged, supporting rollback and delayed physical deletion of logical deletion operations.

Benefits of technology

It realizes the secure deletion of failed files in the Cloud Disk Recycle Bin, frees up storage resources, avoids the mistake of deletion of other files, supports rollback of logical deletion and delayed physical deletion to ensure data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757294B_ABST
    Figure CN115757294B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for securely deleting files in the recycle bin of a cloud disk. Data analysis is performed on the invalid files in the recycle bin of the cloud disk to evaluate the additional resources required in the process of deleting the invalid files. A database table for establishing a file-object reference relationship is created. According to the invalid time sequence of the invalid files, the invalid file data in the recycle bin is placed in a logical deletion queue for sequential processing. Based on whether the reference count of the resource pool object ID field is less than 2, the logical data of the invalid files with a reference count of the resource pool object ID field less than 2 is deleted and a physical deletion task is created to delete the physical data of the invalid files. The logical data of the invalid files with a reference count of the resource pool object ID field not less than 2 is only processed by logical data deletion. The technical problems that the invalid files in the recycle bin of the cloud disk occupy storage resources and directly deleting the files with the file status of 3 in the user file information table causes accidental deletion are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud disk data processing, and in particular to a method and system for securely deleting files in a cloud disk recycle bin. Background Art

[0002] When a user performs an operation to delete a cloud disk file, the file is first placed in the recycle bin. If the user does not restore the file within 10 days, the file in the recycle bin will automatically expire and become an invalid file, which is invisible to the user. The amount of recycle bin files in the cloud disk is huge. If the invalid files in the recycle bin are not deleted (including logical deletion and physical deletion), it will occupy storage resources and cause cost waste.

[0003] The cloud disk file storage database design includes a user file information table (fm_user_file), a storage object table (fm_storage_object), and a file quick transfer table (fm_file MD5). The user file information table is used to save user file information, including fields such as file name, file ID, file size, file MD5, file status, and file storage ID. Different file IDs can correspond to the same storgeObjectId (the file storage ID field in the storage object table). After the user recycle bin file expires, the file status will be set to 3, and the file with the file status of 3 is invisible to the user. The storage object table is used to save the object information of the file stored in the resource pool, including fields such as file storage ID, resource pool bucket ID, object size, and object file MD5. The resource pool object ID corresponds one-to-one with the file storage ID in the user file information table, and the object size and object file MD5 are the same as the file size and file MD5 in the user file information table. The file quick transfer table is used to record file quick transfer information, including fields such as file MD5, file size, and file storage ID. When a file is uploaded, the file MD5 and file size are verified. If the file MD5, file size, and file quick transfer table are the same, it is determined that the file exists in the storage object table, and a new record is added to the file information table, and no new record is added to the storage object table. For invalid files with the file status of 3, since the database table structure related to file storage is designed for one-way query, it is impossible to determine the reference count of the file ID in the user file information table and the resource pool object ID in the storage object table, that is, it is impossible to directly query the reference count of the file. If the file with the file status of 3 is directly deleted, other users' files may be accidentally deleted. Therefore, securely deleting the invalid files in the cloud disk recycle bin and releasing the invalid records in the file-related database tables and the storage space resources in the resource pool are technical problems that need to be solved urgently by those skilled in the art. Summary of the Invention

[0004] The present invention provides a method and system for securely deleting files in the recycle bin of a cloud disk, which is used to securely delete expired files in the recycle bin of the cloud disk, release invalid records in the database tables related to the files and storage space resources in the resource pool, and solve the technical problems that the expired files in the recycle bin of the cloud disk occupy storage resources and directly deleting files with the file status of 3 in the user file information table of the user may cause accidental deletion.

[0005] In view of this, the first aspect of the present invention provides a method for securely deleting files in the recycle bin of a cloud disk, including:

[0006] Obtain the user file information table, storage object table, and file instant upload table of the cloud disk;

[0007] Calculate the total number of records and the number of expired file records in the user file information table;

[0008] Evaluate the additional disk storage resources required to perform the deletion operation according to the total number of records and the number of expired file records;

[0009] Configure an additional disk according to the additional disk storage resources required. Based on the user file information table, storage object table, and file instant upload table, construct database tables in the additional disk. The database tables include a storage object - file relationship table, a backup table of user file information, a backup table of storage objects, and a file deletion record table. Among them, the storage object - file relationship table is used to record the reference relationship between storage objects and files. The backup table of user file information is used to back up the logical data of the user file information table that needs to be deleted. The backup table of storage objects is used to back up the logical data of the storage object table that needs to be deleted. The file deletion record table is used to record the deletion operation;

[0010] Put the expired file data in the recycle bin into the logical deletion queue in the order of the expiration time of the expired files. For each message in the logical deletion queue, add a corresponding record to the backup table of user file information and delete a corresponding record from the user file information table. Check the reference count of the resource pool object ID field in the storage object table and compare the file MD5 and file size in the user file information table and the storage object table. If the reference count of the resource pool object ID field is less than 2 and the file MD5 and file size in the user file information table and the storage object table are the same, add a corresponding record to the backup table of storage objects, delete a corresponding record from the backup table of user file information, delete a corresponding record from the storage object table and the file instant upload table, and send the corresponding physical deletion task. If the reference count of the resource pool object ID field is not less than 2, delete a corresponding record from the storage object table;

[0011] When receiving a physical deletion task, a new record is added to the file deletion record table, the deletion status field in the file deletion record table is set to 0, the physical deletion program is started, and the physical deletion program reads the physical deletion task according to the preset delayed deletion time, puts the physical deletion task into the resource pool object deletion queue, so that the resource pool physically deletes the invalid files and sets the deletion status field in the file deletion record table to 1.

[0012] Optionally, the user file information backup table and the storage object backup table support rolling back file deletion operations within the validity period.

[0013] Optionally, the validity period of the user file information backup table and the storage object backup table is 1 month.

[0014] Optionally, the newly added disk storage resources required for performing the deletion operation include computing storage resources and machine storage resources. The calculation formula for the newly added computing storage resources required for performing the deletion operation is:

[0015]

[0016] S = S1 + S2

[0017] Where S is the newly added computing storage resources required for performing the deletion operation, S1 is the newly added computing storage resources required for the full - volume file reference relationship, S2 is the newly added computing storage resources required for all invalid file deletion records, allsum is the total number of records in the user file information table, filesum is the number of records of invalid files in the user file information table, D of is the number of invalid file records to be deleted as the target, S of is the storage resources occupied by the record object - file relationship, S df is the storage resources occupied by the file deletion record.

[0018] Optionally, it further includes:

[0019] Back - up and deletion operations on data generate logs. According to the status code data of the statistical logs, the logical deletion record number, logical deletion success rate, physical deletion space size, and physical deletion success rate are obtained based on the status code data of the logs.

[0020] The second aspect of the present invention provides a cloud disk recycle bin file secure deletion system, including:

[0021] A data acquisition module, configured to acquire the user file information table, storage object table, and file instant transfer table of the cloud disk;

[0022] A calculation module, configured to calculate the total number of records and the number of invalid file records in the user file information table;

[0023] A resource evaluation module, which is used to evaluate the additional disk storage resources required for performing a deletion operation based on the total number of records and the number of records in the failed files;

[0024] A database table construction module, which is used to configure additional disks according to the additional disk storage resources required, and construct database tables in the additional disks based on the user file information table, the storage object table, and the file instant upload table. The database tables include a storage object - file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table. Among them, the storage object - file relationship table is used to record the reference relationship between storage objects and files, the user file information backup table is used to back up the logical data of the user file information table that needs to be deleted, the storage object backup table is used to back up the logical data of the storage object table that needs to be deleted, and the file deletion record table is used to record the deletion operation;

[0025] A logical data deletion module, which is used to put the failed file data in the recycle bin into the logical deletion queue in the order of the failure time of the failed files. For each message in the logical deletion queue, a corresponding record is added to the user file information backup table, and a corresponding record is deleted from the user file information table. The reference count of the resource pool object ID field in the storage object table is verified, and the file MD5 and file size in the user file information table and the storage object table are compared. If the reference count of the resource pool object ID field is less than 2 and the file MD5 and file size in the user file information table and the storage object table are the same, a corresponding record is added to the storage object backup table, a corresponding record is deleted from the user file information backup table, a corresponding record is deleted from the storage object table and the file instant upload table, and a corresponding physical deletion task is sent. If the reference count of the resource pool object ID field is not less than 2, a corresponding record is deleted from the storage object table;

[0026] A physical data deletion module, which is used to add a record to the file deletion record table when receiving a physical deletion task, set the deletion status field in the file deletion record table to 0, start the physical deletion program. The physical deletion program reads the physical deletion tasks according to the preset delayed deletion time, puts the physical deletion tasks into the resource pool object deletion queue, so that the resource pool physically deletes the failed files and sets the deletion status field in the file deletion record table to 1.

[0027] Optionally, the user file information backup table and the storage object backup table support rolling back the file deletion operation within the validity period.

[0028] Optionally, the validity period of the user file information backup table and the storage object backup table is 1 month.

[0029] Optionally, the additional disk storage resources required for performing the deletion operation include computing storage resources and machine storage resources. The calculation formula for the additional computing storage resources required for performing the deletion operation is:

[0030]

[0031] S = S1 + S2

[0032] Where S is the additional computing storage resources required for performing the deletion operation, S1 is the additional computing storage resources required for the full - volume file reference relationship, S2 is the additional computing storage resources required for all invalid file deletion records, allSum is the total number of records in the user file information table, fileSum is the number of records of invalid files in the user file information table, D of is the number of invalid file records to be deleted as the target, S of is the storage resources occupied by the record object - file relationship, S df is the storage resources occupied by the file deletion record.

[0033] Optionally, it further includes a monitoring log module, and the monitoring log module is used for:

[0034] Generating logs for data backup and deletion operations, obtaining the logical deletion record count, logical deletion success rate, physical deletion space size, and physical deletion success rate according to the status code data of the statistical logs.

[0035] From the above technical solutions, it can be seen that the cloud disk recycle bin file secure deletion method and system provided by the present invention have the following advantages:

[0036] The cloud disk recycle bin file secure deletion method provided by the present invention analyzes the data of invalid files in the cloud disk recycle bin, evaluates the additional resources required in the process of deleting invalid files, constructs a storage object - file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table. In the order of the invalid time of invalid files, the invalid file data in the recycle bin is put into the logical deletion queue for processing in sequence. Based on whether the reference count of the resource pool object ID field is less than 2, the logical data of invalid files with the reference count of the resource pool object ID field less than 2 is deleted and a physical deletion task is created, and the physical data of invalid files is deleted. The logical data of invalid files with the reference count of the resource pool object ID field not less than 2 is only processed for logical data deletion, realizing the secure deletion of invalid files in the cloud disk recycle bin, releasing the invalid records in the file - related database tables and the storage space resources of the resource pool, and solving the technical problems that the invalid files in the cloud disk recycle bin occupy storage resources and directly deleting files with the file status of 3 in the user file information table may cause accidental deletion.

[0037] Meanwhile, for the method for securely deleting files in the recycle bin of the cloud disk provided by the present invention, the backup database table records the logical deletion operation, supports rolling back the deletion of invalid file data within the validity period, and delaying the physical deletion enables the recovery of invalid files within the delay time after the logical data deletion.

[0038] The system for securely deleting files in the recycle bin of the cloud disk provided by the present invention is used to execute the method for securely deleting files in the recycle bin of the cloud disk provided by the present invention. Its principle and the obtained technical effects are the same as those of the method for securely deleting files in the recycle bin of the cloud disk provided by the present invention, and will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 1 It is a schematic flowchart of a method for securely deleting files in the recycle bin of the cloud disk provided in the present invention;

[0041] Figure 2 It is a principle block diagram of a method for securely deleting files in the recycle bin of the cloud disk provided in the present invention;

[0042] Figure 3 It is a schematic flowchart of the logical data deletion process of a method for securely deleting files in the recycle bin of the cloud disk provided in the present invention;

[0043] Figure 4 It is a schematic flowchart of the physical data deletion process of a method for securely deleting files in the recycle bin of the cloud disk provided in the present invention;

[0044] Figure 5 It is a schematic structural diagram of a system for securely deleting files in the recycle bin of the cloud disk provided in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] In order to enable those skilled in the art to better understand the solution of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0046] For easy understanding, please refer to Figure 1, an embodiment of a method for securely deleting files in the recycle bin of a cloud disk is provided in the present invention, including:

[0047] Step 101, obtain the user file information table, storage object table, and file quick transfer table of the cloud disk.

[0048] It should be noted that the cloud disk file storage database design includes a user file information table, a storage object table, a file quick transfer table, etc. Therefore, in the embodiment of the present invention, first obtain the user file information table, the storage object table, and the file quick transfer table. User file information table (fm_user_file): used to save user file information. As shown in Table 1, it includes fields such as file name, file size, file MD5, file status, file storage ID, etc. Different fileIds can correspond to the same storageObjectId. After the user recycle bin file expires, fileStatus is set to 3, and files with fileStatus of 3 are invisible to the user.

[0049] Table 1

[0050] Serial Number Field Name Field Description Remarks 1 userId User ID 2 fileId File ID 3 fileName File Name 4 fileType File Type 5 fileSize File Size 6 fileMd5 File MD5 7 fileStatus File Status The file is invalid and the status is 3 8 createTime Creation Time 9 modifyTime Modification Time 10 storgeObjectId File Storage ID

[0051] Storage object table (fm_storage_object): used to save the object information of the file stored in the resource pool. As shown in Table 2, it includes fields such as file storage ID, resource pool bucket ID, resource pool object ID, object size, object MD5, etc. objectId and storageObjectId are in one-to-one correspondence, and objectSize, objectMd5 are the same as fileSize, fileMd5 in the file information table.

[0052] Table 2

[0053] Serial Number Field Name Field Description Remarks 1 storageObjectId File Storage ID 2 containerId Resource Pool Bucket ID 3 objectId Resource Pool Object ID Unique 4 storageType Resource Pool Type 5 objectSize Object Size The size of the file in the resource pool 6 objectMd5 Object MD5 The MD5 of the file in the resource pool

[0054] File quick transfer table (fm_md5): used to record file quick transfer information. As shown in Table 3, it includes fields such as file MD5, file size, file storage ID, etc. When the file is uploaded, the file MD5 and file size are verified. If the file MD5, file size, and file quick transfer table are the same, it is determined that the file exists in the storage object table, and a new record is added to the file information table, and no new record is added to the storage object table.

[0055] Table 3

[0056] Serial Number Field Name Field Description Remarks 1 md5 File MD5 Unique 2 size File Size 3 storageObjectId File Storage ID

[0057] Step 102, calculate the total number of records and the number of records of expired files in the user file information table.

[0058] It should be noted that the database administrator (DBA) calculates the total number of records allSum in the user file information table fm_user_file and the number of records fileSum with fileStatus = 3. The DBA deduplicates the storageObjectId based on the number of records fileSum with fileStatus = 3, and can obtain the total storage size fileSizeSum occupied by the invalid files in the recycle bin.

[0059] Step 103: Evaluate the additional disk storage resources required for the deletion operation based on the total number of records and the number of records of invalid files.

[0060] It should be noted that the additional disk storage resources required for the deletion operation include computing storage resources and machine storage resources. The calculation formula for the additional computing storage resources required for the deletion operation is:

[0061]

[0062] S = S1 + S2

[0063] Where S is the additional computing storage resources required for the deletion operation, S1 is the additional computing storage resources required for the total file reference relationship, S2 is the additional computing storage resources required for all the deletion records of invalid files, allSum is the total number of records in the user file information table, fileSum is the number of records of invalid files in the user file information table, D of is the number of records of invalid files to be deleted as the target, S of is the storage resources occupied by the record object - file relationship, S df is the storage resources occupied by the file deletion record.

[0064] Taking 1 million records of invalid files to be deleted as an example, evaluate the additional disk storage resources required for the deletion operation. The storage resources S of occupied by the record object - file relationship is 100 MB, and the additional computing storage resources required for the total file reference relationship is The additional computing storage resources required for all the deletion records of invalid files is

[0065] The machine storage resources are selected according to the actual situation, as long as they can meet the storage resources for deleting the target number of records of invalid files. Taking 1 million records of invalid files to be deleted as an example, the required machine storage resources are shown in Table 4.

[0066] Table 4

[0067]

[0068] Step 104: Add new disks according to the newly added disk storage resources. Build database tables in the newly added disks based on the user file information table, storage object table, and file instant transfer table. The database tables include a storage object - file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table.

[0069] It should be noted that the storage object - file relationship table (fm_object_file) is used to record the reference relationship between storage objects and files. As shown in Table 5, it includes fields such as the resource pool object ID and file ID.

[0070] Table 5

[0071] Serial Number Field Name Field Description Remarks 1 objectId Resource Pool Object ID Unique 2 fileId File ID

[0072] The user file information backup table (fm_user_file_back) is used to back up the logical data of the user file information table that needs to be deleted. As shown in Table 6, it includes fields such as user ID, file ID, file name, file type, file size, file MD5, file status, creation time, and modification time. The validity period of the user file information backup table (fm_user_file_back) can be set to 1 month.

[0073] Table 6

[0074] Serial Number Field Name Field Description Remarks 1 userId User ID 2 fileId File ID 3 fileName File Name 4 fileType File Type 5 fileSize File Size 6 fileMd5 File MD5 7 fileStatus File Status The file is invalid and the status is 3 8 createTime Creation Time 9 modifyTime Modification Time 10 storageObjectId File Storage ID

[0075] The storage object backup table (fm_storage_object_back) is used to back up the logical data of the storage object table that needs to be deleted. As shown in Table 7, it includes fields such as file storage ID, resource pool bucket ID, resource pool object ID, resource pool type, object size, and object MD5. The validity period of the storage object backup table (fm_storage_object_back) can be set to 1 month.

[0076] Table 7

[0077]

[0078] The file deletion record table (cloud_object_delete_record) is used to record deletion operations and can query and count the file deletion status, deletion quantity, and deletion size. As shown in Table 8, it includes fields such as user ID, file ID, file storage ID, resource pool bucket ID, resource pool object ID, deletion size, deletion status, and deletion time.

[0079] Table 8

[0080]

[0081] Step 105: Place the invalid file data in the recycle bin into the logical deletion queue in the order of the invalidation time of the invalid files. For each message in the logical deletion queue, add a corresponding record to the user file information backup table, and delete a corresponding record from the user file information table. Verify the reference count of the resource pool object ID field in the storage object table and compare the file MD5 and file size in the user file information table and the storage object table. If the reference count of the resource pool object ID field is less than 2 and the file MD5 and file size in the user file information table and the storage object table are the same, add a corresponding record to the storage object backup table, delete a corresponding record from the user file information backup table, delete a corresponding record from the storage object table and the file quick transfer table, and send the corresponding physical deletion task. If the reference count of the resource pool object ID field is not less than 2, delete a corresponding record from the storage object table.

[0082] It should be noted that the API service can automatically place the invalid file data in the recycle bin into the logical deletion queue file_clean_topic in the order of the invalidation time of the invalid files. For each message in the logical deletion queue (i.e., each message corresponds to the data of an invalid file), as Figure 3 shown, add a corresponding record to the user file information backup table fm_user_file_back, delete a corresponding record from the user file information table fm_user_file, verify the reference count of the resource pool object ID (i.e., objectId) in the storage object table fm_object_file, the file MD5 (i.e., md5) and file size (i.e., size) in the user file information table fm_user_file and the storage object table fm_object_file. If the reference count of objectId is less than 2 and the comparison of md5 and size is consistent, add a record to the storage object backup table fm_storage_object_back, delete the corresponding records from the storage object table fm_storage_object and the file quick transfer table fm_md5, and send a physical deletion task. If the reference count of the resource pool object ID field objectId is not less than 2, delete a corresponding record from the storage object table fm_object_file.

[0083] Adding records to the user file information backup table fm_user_file_back and the storage object backup table fm_storage_object_back is to record the logical deletion operation and support rolling back the file deletion operation within the validity period.

[0084] Step 106: When a physical deletion task is received, add a new record to the file deletion record table, set the deletion status field in the file deletion record table to 0, start the physical deletion program. The physical deletion program reads the physical deletion task according to the preset delayed deletion time, and puts the physical deletion task into the resource pool object deletion queue, so that the resource pool physically deletes the invalid files and sets the deletion status field in the file deletion record table to 1.

[0085] It should be noted that the execution process of the physical deletion task is as Figure 4 shown. When a physical deletion task is received, add a new record to the file deletion record table cloud_object_delete_record, set the deletion status field status in the file deletion record table cloud_object_delete_record to 0, start the physical deletion program. The physical deletion program reads the physical deletion task according to the preset delayed deletion time, and puts the physical deletion task into the resource pool object deletion queue object_clean_topic, so that the resource pool physically deletes the invalid files and sets the deletion status field status in the file deletion record table cloud_object_delete_record to 1. Among them, the preset delayed deletion time of the physical deletion task can be selected as 3 days. Within the preset delayed deletion time, the invalid files after logical data deletion support recovery.

[0086] In one embodiment, operations such as backing up and deleting the database table can also be performed to print logs, record the results of the physical deletion executed by the resource pool, distinguish the status codes of the logs, count the status code data, and obtain the logical deletion record count, logical deletion success rate, physical deletion space size, and physical deletion success rate based on the status code data of the logs.

[0087] The method for securely deleting files in the recycle bin of a cloud disk provided by the present invention analyzes the data of invalid files in the recycle bin of the cloud disk, evaluates the additional resources required in the process of deleting invalid files, constructs a storage object-file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table, and places the data of invalid files in the recycle bin into a logical deletion queue in the order of the invalid time of the invalid files for sequential processing. Based on whether the reference count of the resource pool object ID field is less than 2, the logical data of invalid files with a reference count of the resource pool object ID field less than 2 is deleted and a physical deletion task is created to delete the physical data of the invalid files. The logical data of invalid files with a reference count of the resource pool object ID field not less than 2 is only processed for logical data deletion, realizing the secure deletion of invalid files in the recycle bin of the cloud disk, releasing invalid records in the database tables related to files and storage space resources in the resource pool, and solving the technical problems that invalid files in the recycle bin of the cloud disk occupy storage resources and directly deleting files with a file status of 3 in the user file information table may cause accidental deletion.

[0088] Meanwhile, the method for securely deleting files in the recycle bin of a cloud disk provided by the present invention records logical deletion operations by backing up database tables, supports rolling back the deletion of invalid file data within the validity period, and delaying the execution of physical deletion allows the invalid files after logical data deletion to be restored within the delay time.

[0089] For ease of understanding, please refer to Figure 5 , an embodiment of a system for securely deleting files in the recycle bin of a cloud disk provided in the present invention includes:

[0090] A data acquisition module for acquiring the user file information table, the storage object table, and the file instant upload table of the cloud disk;

[0091] A calculation module for calculating the total number of records and the number of records of invalid files in the user file information table;

[0092] A resource evaluation module for evaluating the additional disk storage resources required to execute the deletion operation based on the total number of records and the number of records of invalid files;

[0093] A database table construction module for configuring a new disk according to the additional disk storage resources required, and constructing database tables in the new disk based on the user file information table, the storage object table, and the file instant upload table. The database tables include a storage object-file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table. Among them, the storage object-file relationship table is used to record the reference relationship between storage objects and files, the user file information backup table is used to back up the logical data of the user file information table that needs to be deleted, the storage object backup table is used to back up the logical data of the storage object table that needs to be deleted, and the file deletion record table is used to record deletion operations;

[0094] The logical data deletion module is used to put the invalid file data in the recycle bin into the logical deletion queue according to the invalid time sequence of the invalid files. For each message in the logical deletion queue, a corresponding record is added to the user file information backup table, and a corresponding record is deleted from the user file information table. The reference count of the resource pool object ID field in the storage object table is verified, and the file MD5 and file size in the user file information table and the storage object table are compared. If the reference count of the resource pool object ID field is less than 2 and the file MD5 and file size in the user file information table and the storage object table are the same, a corresponding record is added to the storage object backup table, a corresponding record is deleted from the user file information backup table, a corresponding record is deleted from the storage object table and the file instant transfer table, and the corresponding physical deletion task is sent. If the reference count of the resource pool object ID field is not less than 2, a corresponding record is deleted from the storage object table;

[0095] The physical data deletion module is used to add a record to the file deletion record table when receiving a physical deletion task, set the deletion status field in the file deletion record table to 0, start the physical deletion program. The physical deletion program reads the physical deletion task according to the preset delayed deletion time, puts the physical deletion task into the resource pool object deletion queue, so that the resource pool physically deletes the invalid files and sets the deletion status field in the file deletion record table to 1.

[0096] The user file information backup table and the storage object backup table support rolling back file deletion operations within the validity period.

[0097] The validity period of the user file information backup table and the storage object backup table is 1 month.

[0098] The additional disk storage resources required for performing the deletion operation include computing storage resources and machine storage resources. The calculation formula for the additional computing storage resources required for performing the deletion operation is:

[0099]

[0100] S = S1 + S2

[0101] where S is the additional computing storage resources required for performing the deletion operation, S1 is the additional computing storage resources required for the full - volume file reference relationship, S2 is the additional computing storage resources required for all invalid file deletion records, allSum is the total number of records in the user file information table, fileSum is the number of records of invalid files in the user file information table, D of is the number of invalid file records to be deleted as the target, S of is the storage resources occupied by the record object - file relationship, S dfStorage resources occupied by file deletion records.

[0102] It further includes a monitoring log module, and the monitoring log module is used for:

[0103] Generating logs for data backup and deletion operations, obtaining the logical deletion record count, logical deletion success rate, physical deletion space size, and physical deletion success rate according to the status code data of the statistical logs.

[0104] The cloud disk recycle bin file secure deletion system provided by the present invention is used to execute the cloud disk recycle bin file secure deletion method provided by the present invention. Its principle and the achieved technical effects are the same as those of the cloud disk recycle bin file secure deletion method provided by the present invention, and will not be elaborated here.

[0105] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for securely deleting files in the recycle bin of a cloud disk, characterized in that, Including: Obtain the user file information table, storage object table, and file instant transfer table of the cloud disk; Calculate the total number of records and the number of records of expired files in the user file information table; Evaluate the additional disk storage resources required for the deletion operation based on the total number of records and the number of records of expired files; Configure additional disks according to the additional disk storage resources required. In the additional disks, construct database tables based on the user file information table, storage object table, and file instant transfer table. The database tables include a storage object - file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table. Among them, the storage object - file relationship table is used to record the reference relationship between storage objects and files. The user file information backup table is used to back up the logical data of the user file information table that needs to be deleted. The storage object backup table is used to back up the logical data of the storage object table that needs to be deleted. The file deletion record table is used to record the deletion operation; Put the expired file data in the recycle bin into the logical deletion queue in the order of the expiration time of the expired files. For each message in the logical deletion queue, add a corresponding record to the user file information backup table and delete a corresponding record from the user file information table. Check the reference count of the resource pool object ID field in the storage object table and compare the file MD5 and file size in the user file information table and the storage object table. If the reference count of the resource pool object ID field is less than 2 and the file MD5 and file size in the user file information table and the storage object table are the same, add a corresponding record to the storage object backup table, delete a corresponding record from the user file information backup table, delete a corresponding record from the storage object table and the file instant transfer table, and send the corresponding physical deletion task. If the reference count of the resource pool object ID field is not less than 2, delete a corresponding record from the storage object table; When receiving a physical deletion task, add a record to the file deletion record table, set the deletion status field in the file deletion record table to 0, start the physical deletion program. The physical deletion program reads the physical deletion task according to the preset delayed deletion time, puts the physical deletion task into the resource pool object deletion queue, so that the resource pool physically deletes the expired files and sets the deletion status field in the file deletion record table to 1.

2. The method for securely deleting files in the recycle bin of a cloud disk according to claim 1, wherein The user file information backup table and the storage object backup table support rolling back the file deletion operation within the validity period.

3. The method for securely deleting files in the recycle bin of a cloud disk according to claim 2, wherein The validity period of the user file information backup table and the storage object backup table is 1 month.

4. The method for securely deleting files in the recycle bin of the cloud disk according to claim 1, wherein The additional disk storage resources required for the deletion operation include computing storage resources and machine storage resources. The calculation formula for the additional computing storage resources required for the deletion operation is: S = S1 + S2 Among them, S is the additional computing storage resources required for performing the deletion operation, S1 is the additional computing storage resources required for the full-file reference relationship, S2 is the additional computing storage resources required for all invalid file deletion records, allSum is the total number of records in the user file information table, fileSum is the number of records of invalid files in the user file information table, D of is the number of invalid file records to be deleted as the target, S of is the storage resources occupied by the record object-file relationship, S df is the storage resources occupied by the file deletion records.

5. The method for securely deleting files in the recycle bin of a cloud disk according to claim 1, characterized in that, Also including: Generate logs for data backup and deletion operations. According to the status code data of the statistical logs, obtain the logical deletion record count, logical deletion success rate, physical deletion space size, and physical deletion success rate based on the status code data of the logs.

6. A file secure deletion system for a cloud disk recycle bin, characterized in that, Including: A data acquisition module for obtaining the user file information table, storage object table, and file instant transfer table of the cloud disk; A calculation module for calculating the total number of records in the user file information table and the number of records of invalid files; A resource evaluation module for evaluating the additional disk storage resources required to perform the deletion operation based on the total number of records and the number of records of invalid files; A database table construction module for configuring additional disks according to the additional disk storage resources required, and constructing database tables in the additional disks based on the user file information table, the storage object table, and the file instant transmission table. The database tables include a storage object-file relationship table, a user file information backup table, a storage object backup table, and a file deletion record table. Among them, the storage object-file relationship table is used to record the reference relationship between storage objects and files, the user file information backup table is used to back up the logical data of the user file information table that needs to be deleted, the storage object backup table is used to back up the logical data of the storage object table that needs to be deleted, and the file deletion record table is used to record the deletion operation; A logical data deletion module for putting the invalid file data in the recycle bin into the logical deletion queue in the order of the invalid time of the invalid files. For each message in the logical deletion queue, a corresponding record is added to the user file information backup table, and a corresponding record is deleted from the user file information table. The reference count of the resource pool object ID field in the storage object table is verified, and the file MD5 and file size in the user file information table and the storage object table are compared. If the reference count of the resource pool object ID field is less than 2 and the file MD5 and file size in the user file information table and the storage object table are the same, a corresponding record is added to the storage object backup table, a corresponding record is deleted from the user file information backup table, a corresponding record is deleted from the storage object table and the file instant transmission table, and a corresponding physical deletion task is sent. If the reference count of the resource pool object ID field is not less than 2, a corresponding record is deleted from the storage object table; A physical data deletion module for adding a record to the file deletion record table when receiving a physical deletion task, setting the deletion status field in the file deletion record table to 0, starting the physical deletion program. The physical deletion program reads the physical deletion tasks according to the preset delayed deletion time, puts the physical deletion tasks into the resource pool object deletion queue, so that the resource pool physically deletes the invalid files and sets the deletion status field in the file deletion record table to 1.

7. The cloud disk recycle bin file secure deletion system according to claim 6, wherein The user file information backup table and the storage object backup table support rolling back the file deletion operation within the validity period.

8. The cloud disk recycle bin file secure deletion system according to claim 7, characterized in that, The validity period of the user file information backup table and the storage object backup table is 1 month.

9. The cloud disk recycle bin file secure deletion system according to claim 6, wherein, The additional disk storage resources required to perform the deletion operation include computing storage resources and machine storage resources. The calculation formula for the additional computing storage resources required to perform the deletion operation is: S = S1 + S2 Among them, S is the additional computing and storage resources required for performing the deletion operation, S1 is the additional computing and storage resources required for the full-file reference relationship, S2 is the additional computing and storage resources required for all invalid file deletion records, allSum is the total number of records in the user file information table, fileSum is the number of records of invalid files in the user file information table, D of is the number of invalid file records to be deleted as the target, S of is the storage resources occupied by the record object - file relationship, S df is the storage resources occupied by the file deletion records.

10. The cloud disk recycle bin file secure deletion system according to claim 6, characterized in that, It also includes a monitoring log module, and the monitoring log module is used for: Generating logs for data backup and deletion operations, obtaining the logical deletion record count, logical deletion success rate, physical deletion space size, and physical deletion success rate according to the status code data of the statistical logs.

Citation Information

Patent Citations

  • Recycle bin mechanism and recycle bin system applicable to cloud computing

    CN103473296A

  • Data processing method and device

    CN114372285A