CN114356856A - Data deleting method, device, equipment and storage medium - Google Patents

Data deleting method, device, equipment and storage medium Download PDF

Info

Publication number
CN114356856A
CN114356856A CN202111574503.6A CN202111574503A CN114356856A CN 114356856 A CN114356856 A CN 114356856A CN 202111574503 A CN202111574503 A CN 202111574503A CN 114356856 A CN114356856 A CN 114356856A
Authority
CN
China
Prior art keywords
data
deletion
folder
current folder
current
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.)
Pending
Application number
CN202111574503.6A
Other languages
Chinese (zh)
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.)
Luster LightTech Co Ltd
Suzhou Luster Vision Intelligent Device Co Ltd
Suzhou Lingyunguang Industrial Intelligent Technology Co Ltd
Original Assignee
Luster LightTech Co Ltd
Suzhou Luster Vision Intelligent Device Co Ltd
Suzhou Lingyunguang Industrial Intelligent 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 Luster LightTech Co Ltd, Suzhou Luster Vision Intelligent Device Co Ltd, Suzhou Lingyunguang Industrial Intelligent Technology Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202111574503.6A priority Critical patent/CN114356856A/en
Publication of CN114356856A publication Critical patent/CN114356856A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a data deleting method, a data deleting device, data deleting equipment and a storage medium. The method comprises the following steps: if a data deletion event of the current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder; determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; wherein, the data deleting mode comprises: delete by file and delete by folder; and deleting the target deletion data in the current folder. By the technical scheme provided by the embodiment of the invention, the data to be deleted in the folder can be automatically screened out based on the data deletion mode, the data protection strategy and the data deletion strategy of the folder, so that the storage space can be released in time, more precise data management can be realized, and the manpower can be saved.

Description

Data deleting method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data deleting method, device, equipment and storage medium.
Background
With the development of big data technology, the detection requirements of many detection devices, such as AOI (Automated Optical Inspection) detection devices, are increasing, the size and the amount of data stored in the detection devices are gradually increasing, and therefore, more storage space is needed, but the storage space of a single detection device is limited by the cost.
Therefore, how to automatically delete used data, retain key data, and implement more detailed data management, thereby saving labor cost is a problem to be solved urgently at present.
Disclosure of Invention
The invention provides a data deleting method, a data deleting device, data deleting equipment and a storage medium, which can automatically delete used data, realize more precise data management and are beneficial to saving manpower.
In a first aspect, an embodiment of the present invention provides a data deleting method, where the method includes:
if a data deletion event of the current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder;
determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; wherein, the data deleting mode comprises: delete by file and delete by folder;
and deleting the target deletion data in the current folder.
In a second aspect, an embodiment of the present invention further provides a data deleting device, where the device includes:
the candidate data determining module is used for determining candidate deletion data of the current folder according to the data storage condition of the current folder if a data deletion event of the current folder is detected;
the target data determining module is used for determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; wherein, the data deleting mode comprises: delete by file and delete by folder;
and the deleting module is used for deleting the target deleting data in the current folder.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data deletion method as provided by any of the embodiments of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. Wherein the program when executed by a processor implements a data deletion method as provided by any of the embodiments of the invention.
If a data deletion event of a current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder; determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; the target deletion data is deleted in the current folder, and through the mode, the data needing to be deleted in the folder can be automatically screened out based on the data deletion mode, the data protection strategy and the data deletion strategy of the folder, so that the storage space can be timely released, meanwhile, more precise data management can be realized, and the labor is saved.
Drawings
Fig. 1A is a flowchart of a data deleting method according to an embodiment of the present invention;
fig. 1B is a schematic diagram of a process of determining target deletion data according to an embodiment of the present invention;
fig. 2 is a flowchart of a data deleting method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a data deleting method according to a third embodiment of the present invention;
fig. 4 is a block diagram of a data deleting device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1A is a flowchart of a data deletion method according to a first embodiment of the present invention, and fig. 1B is a schematic diagram of a process of determining target deletion data according to a first embodiment of the present invention. The method may be performed by a data deletion apparatus, which may be implemented in software and/or hardware, and may be integrated in an electronic device with high data storage requirements, for example, an AOI detection device. As shown in fig. 1A, the data deleting method provided in this embodiment specifically includes:
s101, if the data deletion event of the current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder.
The current folder refers to a data folder in which files and/or folders are stored, and specifically, the current folder may only include at least one subfolder, may also only include at least one file, and may also include at least one file and at least one subfolder at the same time; for example, for an AOI detection device, the present embodiment may take each folder under its disk as the current folder in turn. Further, so-called subfolders may also include next level subfolders and/or files. The data deletion event refers to an event of deleting data of the current folder. The data storage situation may include the number, size, storage time, occupied space, and the like of each data file and/or folder stored in the current folder. The candidate deletion data refers to preliminarily determined candidate files and/or candidate folders to be deleted.
Optionally, according to a preset rule about at least one attribute information such as storage amount of a folder, disk capacity, file data storage period and the like, whether a data deletion event is triggered or not may be detected in real time or at intervals of a preset time period for the relevant attribute information of the current folder, if the data deletion event of the current folder is detected, it is considered that an instruction for deleting data of the current folder is received, further according to the data storage condition of the current folder, based on the preset rule, a directory of the current folder is traversed, and data to be deleted is preliminarily screened out from the data in the current folder as candidate deletion data, that is, candidate deletion data of the current folder is determined.
Optionally, the detecting of the data deletion event of the current folder may include at least one of the following: detecting that the current residual capacity of a disk to which the current folder belongs is smaller than a residual capacity threshold; detecting that the current data storage amount of the current folder reaches a data storage amount threshold value; and detecting that the current time reaches the data storage period of the current folder.
The current remaining capacity refers to a capacity that the disk storing the current folder can store in the remaining capacity, and specifically, the current remaining capacity may be determined according to an upper limit of a capacity of the disk to which the current folder belongs and a currently used capacity of the disk. The current data storage capacity refers to the space storage capacity occupied by the data in the current folder. The data storage period refers to a preset data storage period threshold.
Optionally, the remaining capacity threshold, the data storage amount threshold, and the data storage period may be set autonomously by related personnel according to needs, or may be set by default by the data deletion system.
An implementable manner may be to detect, in real time or at intervals of a preset time period, a current remaining capacity of a disk to which a current folder belongs, and determine whether the current remaining capacity of the disk to which the current folder belongs is smaller than a remaining capacity threshold, if so, it is determined that a storage space of the disk to which the current folder belongs is insufficient, and data in the current folder needs to be deleted, that is, a data deletion event of the current folder is detected.
Another implementable manner may be to detect the current data storage amount of the current folder in real time or at preset time intervals, determine the size relationship between the current data storage amount of the current folder and the data storage amount threshold, and if the current data storage amount is greater than or equal to the data storage amount threshold, consider that the current folder has too much stored data and needs to delete the data in the current folder, that is, detect a data deletion event of the current folder.
In another implementable manner, the data storage period of the current folder can be acquired in real time or at preset time intervals, whether the current time reaches the data storage period of the current folder is judged, and if so, the data deletion event of the current folder is considered to be detected.
Optionally, it may be determined that a data deletion event of the current folder is detected separately according to one of the three possible implementations; the data deletion event of the current folder can be determined to be detected according to a plurality of modes of combining the three possible modes, for example, the current data storage amount of the current folder can be detected first, if the current data storage amount of the current folder does not reach the data storage amount threshold, it is further detected that the current time reaches the data storage period of the current folder, and if the current time reaches the data storage period of the current folder, it is determined that the data deletion event of the current folder is detected.
It should be noted that, by setting different conditions for determining and detecting the data deletion event of the current folder, the data deletion event can be evaluated from different dimensions, so that the data in the electronic device can be deleted more timely, and the space sufficiency of the electronic device is ensured.
Optionally, when it is determined that the data deletion event of the current folder is detected, the candidate deletion data of the current folder may be further determined according to the data storage condition of the current folder, and the determining may specifically include: taking the storage data with the preset proportion in the current folder, wherein the storage time of the storage data is earlier than the storage time of the storage data, as candidate deletion data; and/or taking the stored data with the storage time outside the data saving period in the current folder as candidate deletion data.
The storage time refers to the time when the data is generated and stored in the current folder, and may specifically include the year, month and day information of the stored data. The predetermined ratio may be a predetermined percentage, such as thirty percent or fifteen percent.
In an implementation manner, when it is determined that a data deletion event of the current folder is detected, the data in the current folder may be time-sorted according to the storage time of the data in the current folder, and further, the stored data in the current folder, which is stored at a preset ratio (for example, fifteen percent) before the storage time, is used as candidate deletion data.
In another implementation manner, when it is determined that a data deletion event of the current folder is detected, it may be determined whether storage time of each piece of storage data in the current folder is outside a preset data storage period, and if so, it indicates that the corresponding piece of storage data is expired, and may be used as candidate deletion data.
In another embodiment, when it is determined that the data deletion event of the current folder is detected, the above two manners of determining candidate deletion data of the current folder may be performed simultaneously. For example, a part of candidate deletion data may be determined according to the two manners, and then the candidate deletion data determined by the two manners may be subjected to union or intersection processing to obtain final candidate deletion data.
It should be noted that, by setting different manners for determining candidate deletion data, candidate deletion data to be deleted can be preliminarily screened from different angles, and flexibility and comprehensiveness of determination of the candidate deletion data are improved.
Optionally, the various embodiments of determining that the data deletion event of the current folder is detected provided by the embodiment of the present invention may be freely combined with the various manners of determining candidate deletion data of the current folder provided by the embodiment of the present invention, so as to implement the operation described in S101.
Preferably, this embodiment may first detect whether the current remaining capacity of the disk to which the current folder belongs is smaller than a remaining capacity threshold, if so, further determine whether a data deletion event is detected according to a relationship between the current data storage amount of the current folder and the storage amount threshold, determine that the data deletion event of the current folder is detected when the current data storage amount of the current folder is detected to reach the data storage amount threshold, and further may further determine, according to a data storage condition of the current folder, that stored data in the current folder, which is stored at a preset proportion before the storage time is used as candidate deletion data, that is, determine candidate deletion data of the current folder. If the storage amount threshold of the current folder is not preset, whether the storage time until the current moment reaches the data storage period of the current folder or not can be judged, if so, the data deletion event of the current folder is considered to be detected, and the storage data of which the storage time in the current folder is beyond the data storage period can be further used as candidate deletion data.
S102, determining target deleted data from the candidate deleted data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder.
The data deleting mode comprises the following steps: delete by file and delete by folder. Specifically, delete by file means a method of deleting a file by the minimum deletion unit, and delete by folder means a method of deleting a folder by the minimum deletion unit.
The data deletion strategy comprises the following steps: a keyword deletion policy and/or a path deletion policy. Specifically, the keyword deletion policy refers to a deletion policy based on a keyword string in a file name of a data file and/or a folder. The path deletion policy refers to a deletion policy based on storage path information of the data file and/or the folder. The data protection strategy comprises the following steps: the protection policy includes a keyword protection policy and/or a path protection policy, and specifically, the keyword protection policy refers to a protection policy based on a key character string in a file name of a data file and/or a folder. The path protection policy refers to a protection policy based on storage path information of a data file and/or folder. The target deletion data refers to the finally determined data which needs to be deleted from the current folder.
Optionally, referring to fig. 1B, after determining the candidate deletion data, a data deletion mode of the current folder may be determined, a data protection policy of the candidate deletion data is determined according to the corresponding deletion mode, further, the candidate deletion data that does not satisfy the data protection policy is determined according to the data protection policy, the data deletion policy of the current folder is further determined, and the candidate deletion data that does not satisfy the data protection policy and satisfies the data deletion policy is used as the target deletion data, that is, the target deletion data is determined.
Optionally, after determining candidate deletion data of the current folder, the deletion mode of the current folder may be determined, and further, for each candidate deletion data, it is determined whether the candidate deletion data is critical undeletable data, that is, whether the candidate deletion data satisfies a data protection policy, and under the condition that the data protection policy is not satisfied, target deletion data is determined from the candidate deletion data according to the data deletion policy.
Optionally, before determining the target deletion data from the candidate deletion data according to the data deletion mode, the data protection policy, and the data deletion policy of the current folder, the data deletion policy and/or the data protection policy of the current folder may also be determined according to the attribute information of the data stored in the current folder.
The attribute information refers to information that can characterize the attribute characteristics of the data, and may specifically include one or more of a data type, a name, a path, and a storage cycle.
Optionally, the user may autonomously configure a data deletion mode, a data protection policy, and a data deletion policy of the corresponding current folder according to a need of the user and based on attribute information of data stored in the current folder, and further determine target deletion data from the candidate deletion data according to the data deletion mode, the data protection policy, and the data deletion policy of the current folder; before the electronic device leaves a factory, research and development personnel set a corresponding data deletion mode, a data protection strategy and a data deletion strategy for each folder in the electronic device in advance according to the attribute information of the data stored in the current folder, and call the corresponding data deletion mode, the data protection strategy and the data deletion strategy of the current folder after confirming the candidate deletion data of the current folder to further determine the target deletion data.
It should be noted that, by configuring a corresponding data deletion mode, a data protection policy, and a data deletion policy for each folder in the magnetic disk of the electronic device according to the attribute information of the data stored in the current folder, data management, key data protection, and redundant useless data deletion can be better achieved.
S103, deleting the target deletion data in the current folder.
Optionally, after determining the target deletion data from the candidate deletion data, a storage path of the target deletion data may be further obtained, and according to the type of the target deletion data, a corresponding deletion algorithm is called to perform a deletion operation, thereby completing deletion of the target deletion data in the current folder.
Optionally, in this embodiment, a certain cycle interval may be preset by a user or a data deleting system, and the operations of S101 to S103 are executed at preset time intervals to delete the determined target deleting data.
If a data deletion event of a current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder; determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; and deleting the target deletion data in the current folder. By the mode, the data needing to be deleted in the folder can be automatically screened out based on the data deleting mode, the data protecting strategy and the data deleting strategy of the folder, so that the storage space can be released in time, more precise data management can be realized, and the manpower can be saved.
Example two
Fig. 2 is a flowchart of a data deletion method according to a second embodiment of the present invention, and this embodiment further explains in detail "determining target deletion data from candidate deletion data according to a data deletion method, a data protection policy, and a data deletion policy of a current folder", based on the above embodiment, as shown in fig. 2, the data deletion method provided in this embodiment specifically includes:
s201, if the data deletion event of the current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder.
S202, judging whether the data deleting mode of the current folder is deleting according to files, if so, executing S203, and if not, executing S204.
Optionally, after determining candidate deletion data of the current folder, it may be further determined whether the data deletion mode of the current folder is deletion according to a file, if so, the operation of S203 is executed according to the deletion mode of deletion according to a file, if not, the data deletion mode of the current folder is considered to be deletion according to a folder, and further, the operation of S204 is executed according to the deletion mode of deletion according to a folder.
S203, if the data deletion mode of the current folder is deletion according to files, selecting candidate deletion data which do not meet the data protection strategy from the candidate deletion data as preliminary deletion data, and determining target deletion data from the preliminary deletion data according to the data type of the preliminary deletion data and the data deletion strategy.
The data type includes a file type and a folder type, and specifically, the data of the folder type may further include a subfolder and/or a file. The preliminary deletion data refers to data to be deleted which is preliminarily determined according to the protection policy, that is, deletion data which is not within the protection range of the protection policy.
Optionally, after determining the candidate deletion data, if the data deletion mode of the current folder is a mode of deleting with the file as the minimum deletion unit, that is, deleting according to the file, then according to the data protection policy, eliminating the candidate deletion data meeting the protection policy, not performing subsequent operations, and taking the candidate deletion data not meeting the data protection policy as the preliminary deletion data.
The candidate deleted data in the current folder can be traversed, whether the name contains a preset keyword or not is judged according to the name of the candidate deleted data, if yes, the candidate deleted data is considered to meet the keyword protection strategy, the candidate deleted data is removed, subsequent deleting operation is not executed, if not, the candidate deleted data is considered not to meet the keyword protection strategy, and the candidate deleted data is used as preliminary deleted data.
In another implementation manner, the candidate deletion data in the current folder may be traversed, and according to the storage path of the candidate deletion data, it is determined whether the storage path is a storage path required to be protected in a preset path protection policy, if so, the storage path is removed, and a subsequent deletion operation is not performed on the storage path, and if not, the candidate deletion data is considered not to satisfy the path protection policy, and the candidate deletion data is further used as preliminary deletion data.
Optionally, the two embodiments of determining the preliminary deletion data according to different protection policies may be combined to determine the preliminary deletion data. Specifically, candidate deletion data that does not satisfy both the keyword protection policy and the path protection policy may be selected from the candidate deletion data as preliminary deletion data according to the keyword protection policy and according to the path protection policy.
Optionally, after the preliminary deletion data is determined, the data type and the data deletion policy of the preliminary deletion data may be further obtained, and the target deletion data is determined from the preliminary deletion data according to the data type and the data deletion policy of the preliminary deletion data, which specifically includes:
if the data type of the preliminary deletion data is a file type and the preliminary deletion data meets the data deletion strategy of the current file, taking the preliminary deletion data as target deletion data; and if the data type of the preliminary deleted data is the folder type, taking the preliminary deleted data as a subfolder of the current folder, and determining target deleted data from the subfolder according to a data protection strategy and a data deletion strategy of the subfolder.
Optionally, after the preliminary deletion data is determined, the data type of the preliminary deletion data may be determined first, if the data type of the preliminary deletion data is a file type, a data deletion policy corresponding to the preliminary deletion data is further determined, and whether the preliminary deletion data meets the data deletion policy is determined, if so, the preliminary deletion data is used as the target deletion data.
If the data deletion strategy of the current file is the keyword deletion strategy, the preliminary deletion data in the current folder can be further traversed, the name of each preliminary deletion data is obtained, whether the name contains a preset keyword or not is judged, if yes, the preliminary deletion data is determined to meet the data deletion strategy of the current file, and the preliminary deletion data is used as target deletion data.
In another implementation manner, if the data deletion policy of the current file is a path deletion policy, the preliminary deletion data in the current folder may be traversed, and according to the storage path of the preliminary deletion data, it is determined whether the storage path is a storage path that requires deletion in a preset path deletion policy, and if so, the preliminary deletion data is used as the target deletion data.
Optionally, the two above embodiments of determining the target deletion data according to different data deletion policies may be combined to determine the target deletion data. Specifically, the preliminary deletion data satisfying both the keyword deletion policy and the path deletion policy may be selected from the preliminary deletion data as the target deletion data according to the keyword deletion policy and the path deletion policy.
It should be noted that, when the deletion mode is deletion according to a file, the target deletion data is determined by using a corresponding data deletion policy according to the data type of the preliminary deletion data.
Optionally, since the data deletion mode of the current folder is deletion according to a file, after the preliminary deletion data is determined, the data type of the preliminary deletion data may be further obtained, and if the data type of the preliminary deletion data is the folder type, the preliminary deletion data may be used as a subfolder of the current folder, and the target deletion data is determined from the subfolder according to the data protection policy and the data deletion policy of the subfolder. Specifically, determining target deletion data from the subfolder according to the data protection policy and the data deletion policy of the subfolder includes: determining whether the subfolder is an empty folder; if so, taking the subfolder as target deletion data; and if not, determining target deletion data from the storage data of the subfolder according to the data protection strategy and the data deletion strategy of the subfolder.
For example, after the preliminary deletion data is used as the subfolders of the current folder, the subfolders of the current folder may be traversed, and for each subfolder, whether the subfolder is an empty folder is determined. And if the subfolders of the current folder are not empty files, further acquiring a data protection strategy of the subfolders, determining initial deletion data of the subfolders according to the protection strategy of the subfolders, and further determining target deletion data of the subfolders from the storage data of the subfolders according to the data deletion strategy of the subfolders. It should be noted that the data protection policy and the data deletion policy of the subfolder may be the same as or different from the data protection policy and the data deletion policy of the current folder described in this embodiment, which is not limited in this embodiment.
Optionally, when the data protection policy of the current folder is different from the data protection policy of the subfolder, the data protection policy of the subfolder may be used to cover the data protection policy of the current folder, that is, the protection policy of the subfolder is used to determine the preliminary deletion data of the subfolder.
And S204, if the data deletion mode of the current folder is deletion according to the folder, selecting candidate deletion data which does not meet the data protection strategy and meets the data deletion strategy from the candidate deletion data as target deletion data.
Optionally, after determining the candidate deletion data, if the data deletion mode of the current folder is a mode of deleting with the folder as the minimum deletion unit, that is, deleting according to the folder, traversing the candidate deletion data, determining a data protection policy corresponding to the candidate deletion data, according to the corresponding data protection policy, using the candidate deletion data that does not satisfy the data protection policy as preliminary candidate deletion data, according to the preliminary candidate deletion data, determining a data deletion policy corresponding to the preliminary candidate deletion data, and further according to the data deletion policy, using the preliminary candidate deletion data that satisfies the deletion policy as target deletion data.
It should be noted that, when the data deletion mode of the current folder is according to the folder deletion, the determined types of the target deletion data include a folder type and a file type, that is, for a file and a sub-folder in the current folder, the target deletion data is determined according to the same protection policy and deletion policy (that is, the protection policy and the deletion policy of the current folder).
And S205, deleting the target deletion data in the current folder.
The method comprises the steps of determining candidate deletion data of a current folder, judging whether the data deletion mode of the current folder is deletion according to files, if the data deletion mode of the current folder is deletion according to files, selecting candidate deletion data which do not meet a data protection strategy from the candidate deletion data as primary deletion data, determining target deletion data from the primary deletion data according to the data type and the data deletion strategy of the primary deletion data, if the data deletion mode of the current folder is deletion according to the folder, selecting candidate deletion data which do not meet the data protection strategy from the candidate deletion data and meet the data deletion strategy as the target deletion data, and finally deleting the target deletion data from the current folder. According to the embodiment, data can be deleted by adopting different strategies according to different data deleting modes, so that the flexibility and the accuracy of data deletion are improved, more detailed data management is realized, and labor is saved.
EXAMPLE III
Fig. 3 is a flowchart of a data deleting method according to a third embodiment of the present invention, where this embodiment provides a preferred example of deleting data according to different deleting manners when a data deleting event of a current folder is detected based on the above embodiment, and as shown in fig. 3, the data deleting method provided in this embodiment specifically includes:
and S300, starting.
Optionally, a timer may be preset for each folder, and the steps S301 to S310 may be executed at intervals of a preset time by the timer.
S301, judging whether the current residual capacity of the disk to which the current folder belongs is smaller than a residual capacity threshold value, if so, executing S302, and if not, executing S310.
S302, judging whether a relation between the current data storage amount of the current folder and a data storage amount threshold is set or not, determining whether a data deletion event of the current folder is detected or not, if so, executing S303, and if not, executing S304.
S303, judging whether the current data storage amount of the current folder reaches a data storage amount threshold value, if so, executing S304, and if not, executing S310.
Optionally, the detailed description is already given in S101 for the specific process, which is not described herein again.
S304, judging whether the storage time of the file at the current time reaches the data storage period of the current folder, if so, executing S305, and if not, executing S310.
If yes, it is considered that the data deletion event of the current folder is detected, and the process continues to execute S305. If not, the data deletion event of the current folder is not detected, and the step S310 is executed.
S305, determining candidate deletion data of the current folder according to the data storage condition of the current folder.
Optionally, the detailed description is already given in S101 for the specific process, which is not described herein again.
S306, judging whether the data deleting mode of the current folder is deleting according to files, if so, executing S307, and if not, executing S308.
Optionally, the detailed description is already given in S202 for the specific process, which is not described herein again.
S307, if the data deletion mode of the current folder is deletion according to files, selecting candidate deletion data which do not meet the data protection strategy from the candidate deletion data as preliminary deletion data, and determining target deletion data from the preliminary deletion data according to the data type of the preliminary deletion data and the data deletion strategy.
Optionally, if the data type of the preliminary deletion data is a file type and the preliminary deletion data meets the data deletion policy of the current file, using the preliminary deletion data as target deletion data;
optionally, if the data type of the preliminary deletion data is a folder type, using the preliminary deletion data as a subfolder of the current folder, further determining whether the subfolder is an empty folder, and if so, using the subfolder as target deletion data; and if not, determining target deletion data from the storage data of the subfolder according to the data protection strategy and the data deletion strategy of the subfolder.
Optionally, the detailed description of the specific process of the above operation is already given in S203, and is not repeated herein.
And S308, if the data deletion mode of the current folder is deletion according to the folder, selecting the candidate deletion data which does not meet the data protection strategy and meets the data deletion strategy from the candidate deletion data as target deletion data.
Optionally, the detailed description is already given in S204, and is not repeated here.
S309, deleting the target deletion data in the current folder.
Optionally, the detailed description is already given in S103 for the specific process, which is not described herein again.
And S310, ending.
The embodiment of the invention presets the condition of detecting the data deletion event of the current folder, determines the candidate deletion data of the current folder according to the data storage condition of the current folder after determining the data deletion event of the current folder, judges whether the data deletion mode of the current folder is deletion according to files after determining the candidate deletion data of the current folder, selects the candidate deletion data which does not satisfy the data protection strategy from the candidate deletion data as the primary deletion data if the data deletion mode of the current folder is deletion according to files, determines the target deletion data from the primary deletion data according to the data type and the data deletion strategy of the primary deletion data, and selects the candidate deletion data which does not satisfy the data protection strategy from the candidate deletion data if the data deletion mode of the current folder is deletion according to folders, and the candidate deletion data meeting the data deletion strategy is taken as target deletion data, and finally the target deletion data is deleted in the current folder. By the mode, the data needing to be deleted in the folder can be automatically screened out based on the data deleting mode, the data protecting strategy and the data deleting strategy of the folder, so that the storage space can be released in time, more precise data management can be realized, and the manpower can be saved.
Example four
Fig. 4 is a block diagram of a data deleting device according to a fourth embodiment of the present invention, where the data deleting device according to the fourth embodiment of the present invention is capable of executing a data deleting method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the executing method. The data deletion apparatus may include a candidate data determination module 401, a target data determination module 402, and a deletion module 403.
A candidate data determining module 401, configured to determine candidate deletion data of a current folder according to a data storage condition of the current folder if a data deletion event of the current folder is detected;
a target data determining module 402, configured to determine target deletion data from the candidate deletion data according to the data deletion mode, the data protection policy, and the data deletion policy of the current folder; wherein, the data deleting mode comprises: delete by file and delete by folder;
a deleting module 403, configured to delete the target deletion data in the current folder.
If a data deletion event of a current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder; determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; and deleting the target deletion data in the current folder. By the mode, used data can be automatically deleted, more precise data management is realized, and labor is saved.
Further, the detecting of the data deletion event of the current folder includes at least one of:
the candidate data determining module 401 detects that the current remaining capacity of the disk to which the current folder belongs is smaller than a remaining capacity threshold;
the candidate data determining module 401 detects that the current data storage amount of the current folder reaches a data storage amount threshold;
the candidate data determination module 401 detects that the current time reaches the data saving period of the current folder.
Further, the candidate data determination module 401 may be configured to:
taking the storage data with the storage time earlier than the storage time in the current folder in a preset proportion as candidate deletion data; and/or the presence of a gas in the gas,
and taking the stored data with the storage time outside the data storage period in the current folder as candidate deletion data.
Further, the target data determining module 402 is specifically configured to:
if the data deletion mode of the current folder is deletion according to files, selecting candidate deletion data which do not meet the data protection strategy from the candidate deletion data as preliminary deletion data, and determining target deletion data from the preliminary deletion data according to the data type and the data deletion strategy of the preliminary deletion data; wherein the data types include a file type and a folder type.
Further, the determining target deletion data from the preliminary deletion data according to the data type of the preliminary deletion data and the data deletion policy includes:
if the data type of the preliminary deletion data is a file type and the preliminary deletion data meets the data deletion strategy of the current file, taking the preliminary deletion data as target deletion data;
and if the data type of the preliminary deletion data is a folder type, taking the preliminary deletion data as a subfolder of the current folder, and determining target deletion data from the subfolder according to a data protection strategy and a data deletion strategy of the subfolder.
Further, the determining target deletion data from the subfolder according to the data protection policy and the data deletion policy of the subfolder comprises:
determining whether the subfolder is an empty folder;
if so, taking the subfolder as target deletion data;
and if not, determining target deletion data from the storage data of the subfolder according to the data protection strategy and the data deletion strategy of the subfolder.
Further, the target data determining module 402 is specifically configured to:
and if the data deletion mode of the current folder is deletion according to the folder, selecting candidate deletion data which does not meet the data protection strategy and meets the data deletion strategy from the candidate deletion data as target deletion data.
Further, the data deletion policy includes: a keyword deletion policy and/or a path deletion policy; the data protection policy includes: a key protection policy and/or a path protection policy.
Further, the above apparatus is further configured to:
and determining a data deletion strategy and/or a data protection strategy of the current folder according to the attribute information of the data stored in the current folder.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention, and fig. 5 shows a block diagram of an exemplary device suitable for implementing the embodiment of the present invention. The device shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in FIG. 5, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory (cache 32). The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM (Compact disk Read-Only Memory), a DVD-ROM (Digital Video disk-Read-Only Memory), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. This communication may be via an Input/Output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network, such as the Internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, such as implementing a data deletion method provided by an embodiment of the present invention, by executing programs stored in the system memory 28.
EXAMPLE six
The sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program (or referred to as computer-executable instructions) is stored, where the computer program is used for executing the data deleting method provided by the sixth embodiment of the present invention when the computer program is executed by a processor.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A method for deleting data, comprising:
if a data deletion event of the current folder is detected, determining candidate deletion data of the current folder according to the data storage condition of the current folder;
determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; wherein, the data deleting mode comprises: delete by file and delete by folder;
and deleting the target deletion data in the current folder.
2. The method of claim 1, wherein the detecting of the data deletion event of the current folder comprises at least one of:
detecting that the current residual capacity of a disk to which the current folder belongs is smaller than a residual capacity threshold;
detecting that the current data storage amount of the current folder reaches a data storage amount threshold value;
and detecting that the current time reaches the data storage period of the current folder.
3. The method according to claim 1, wherein the determining candidate deletion data of the current folder according to the data storage condition of the current folder comprises:
taking the storage data with the storage time earlier than the storage time in the current folder in a preset proportion as candidate deletion data; and/or the presence of a gas in the gas,
and taking the stored data with the storage time outside the data storage period in the current folder as candidate deletion data.
4. The method according to claim 1, wherein the determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection policy, and the data deletion policy of the current folder comprises:
if the data deletion mode of the current folder is deletion according to files, selecting candidate deletion data which do not meet the data protection strategy from the candidate deletion data as preliminary deletion data, and determining target deletion data from the preliminary deletion data according to the data type and the data deletion strategy of the preliminary deletion data; wherein the data types include a file type and a folder type.
5. The method according to claim 4, wherein the determining target deletion data from the preliminary deletion data according to the data type of the preliminary deletion data and a data deletion policy comprises:
if the data type of the preliminary deletion data is a file type and the preliminary deletion data meets the data deletion strategy of the current file, taking the preliminary deletion data as target deletion data;
and if the data type of the preliminary deletion data is a folder type, taking the preliminary deletion data as a subfolder of the current folder, and determining target deletion data from the subfolder according to a data protection strategy and a data deletion strategy of the subfolder.
6. The method of claim 5, wherein determining target deletion data from the subfolder based on the data protection policy and the data deletion policy of the subfolder comprises:
determining whether the subfolder is an empty folder;
if so, taking the subfolder as target deletion data;
and if not, determining target deletion data from the storage data of the subfolder according to the data protection strategy and the data deletion strategy of the subfolder.
7. The method according to claim 1, wherein the determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection policy, and the data deletion policy of the current folder comprises:
and if the data deletion mode of the current folder is deletion according to the folder, selecting candidate deletion data which does not meet the data protection strategy and meets the data deletion strategy from the candidate deletion data as target deletion data.
8. The method of any of claims 1-7, wherein the data deletion policy comprises: a keyword deletion policy and/or a path deletion policy; the data protection policy includes: a key protection policy and/or a path protection policy.
9. The method of claim 8, further comprising:
and determining a data deletion strategy and/or a data protection strategy of the current folder according to the attribute information of the data stored in the current folder.
10. A data deletion apparatus, comprising:
the candidate data determining module is used for determining candidate deletion data of the current folder according to the data storage condition of the current folder if a data deletion event of the current folder is detected;
the target data determining module is used for determining target deletion data from the candidate deletion data according to the data deletion mode, the data protection strategy and the data deletion strategy of the current folder; wherein, the data deleting mode comprises: delete by file and delete by folder;
and the deleting module is used for deleting the target deleting data in the current folder.
11. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the data deletion method of any one of claims 1-9.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data deletion method according to any one of claims 1 to 9.
CN202111574503.6A 2021-12-21 2021-12-21 Data deleting method, device, equipment and storage medium Pending CN114356856A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111574503.6A CN114356856A (en) 2021-12-21 2021-12-21 Data deleting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111574503.6A CN114356856A (en) 2021-12-21 2021-12-21 Data deleting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114356856A true CN114356856A (en) 2022-04-15

Family

ID=81101399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111574503.6A Pending CN114356856A (en) 2021-12-21 2021-12-21 Data deleting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114356856A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230325083A1 (en) * 2022-04-08 2023-10-12 Hon Hai Precision Industry Co., Ltd. Method for deleting data accumulated by aoi processes in aio, data deletion device, device using method, and non-transitory storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230325083A1 (en) * 2022-04-08 2023-10-12 Hon Hai Precision Industry Co., Ltd. Method for deleting data accumulated by aoi processes in aio, data deletion device, device using method, and non-transitory storage medium

Similar Documents

Publication Publication Date Title
US8429745B1 (en) Systems and methods for data loss prevention on mobile computing systems
US9158631B1 (en) Systems and methods for providing backup interfaces
US9417971B2 (en) Cascade ordering
CN114416667B (en) Method and device for rapidly sharing network disk file, network disk and storage medium
CN110825694A (en) Data processing method, device, equipment and storage medium
US20170262489A1 (en) Method and computing apparatus for managing main memory database
US9342550B1 (en) Systems and methods for preventing data loss via temporary-file generating applications
CN105574163A (en) File processing method and device and electronic equipment
CN114329366B (en) Network disk file control method and device, network disk and storage medium
CN114356856A (en) Data deleting method, device, equipment and storage medium
CN113918999B (en) Method and device for establishing safe ferry channel, network disk and storage medium
CN114995759A (en) Barrel fragment processing method, device, equipment and medium
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
CN115826828B (en) Network disk file operation method, device, terminal and storage medium
US9483535B1 (en) Systems and methods for expanding search results
CN112825098A (en) Data protection method and device, computing equipment and storage medium
US20190065065A1 (en) Data protection method and storage server
CN112181311B (en) Cyclic recording method, equipment and storage medium
CN112395141B (en) Data page management method and device, electronic equipment and storage medium
CN114936189A (en) Application program operation method and device, computer equipment and readable storage medium
CN109947721B (en) Small file processing method and device
CN107741992B (en) Network storage method and device for conference records, intelligent tablet and storage medium
CN111625500A (en) File snapshot method and device, electronic equipment and storage medium
CN106959888B (en) Task processing method and device in cloud storage system
US11335364B1 (en) Secure data erase for tape storage

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