CN115718732A - Disk file management method, device, equipment and storage medium - Google Patents

Disk file management method, device, equipment and storage medium Download PDF

Info

Publication number
CN115718732A
CN115718732A CN202211533831.6A CN202211533831A CN115718732A CN 115718732 A CN115718732 A CN 115718732A CN 202211533831 A CN202211533831 A CN 202211533831A CN 115718732 A CN115718732 A CN 115718732A
Authority
CN
China
Prior art keywords
file
disk
white list
files
determining
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
CN202211533831.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.)
Beijing Wangtai Technology Development Co ltd
Original Assignee
Beijing Wangtai Technology Development 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 Beijing Wangtai Technology Development Co ltd filed Critical Beijing Wangtai Technology Development Co ltd
Priority to CN202211533831.6A priority Critical patent/CN115718732A/en
Publication of CN115718732A publication Critical patent/CN115718732A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a disk file management method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a disk file to be managed, and determining a white list file which can be cleaned in the disk file; monitoring the file storage duration of the white list files and the disk utilization rate of the disk where the white list files are located; and determining a target file in the white list file according to the file storage duration and the disk utilization rate, and deleting the target file. According to the disk file management method disclosed by the invention, important files are protected from being deleted by dividing the white list files, and the rule for determining the deleted files according to the file storage duration and the disk utilization rate of the white list files is set, so that the occupation of the disk storage space can be timely and effectively reduced.

Description

Disk file management method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method, an apparatus, a device, and a storage medium for managing a disk file.
Background
The magnetic disk storage is a storage technology using a magnetic disk as a storage medium, and data storage is performed on a rotating disk coated with a magnetic recording medium by using a magnetic recording technology, so that the magnetic disk storage has the characteristics of large storage capacity, high data transmission rate, long-term storage of stored data and the like. As the storage data is accumulated, the remaining storage space in the disk is gradually reduced, and in order to release the storage space, the stored partial file needs to be deleted.
In the existing disk management strategy, files in a disk are divided into a plurality of levels according to file generation date, file types and importance of the files, and when the utilization rate of the disk reaches a specified threshold, all files below the specified level are removed until the utilization rate of the disk is reduced below the specified threshold.
However, when the usage rate of the disk is too high due to a high-level file, the usage rate of the disk reaches a low-level deletion condition, and at this time, the high-level file is not deleted directly, and the file can be cleared only when the usage rate of the disk reaches a higher-level threshold value. Therefore, the prior art cannot timely and effectively reduce the utilization rate of the disk, and the important files are easily lost without protection of the important files.
Disclosure of Invention
The invention provides a disk file management method, a disk file management device, disk file management equipment and a storage medium, which are used for cleaning disk files and reducing the utilization rate of disks.
According to an aspect of the present invention, there is provided a disk file management method, including:
acquiring the disk files to be managed, and determining white list files which can be cleaned in the disk files;
monitoring the file storage duration of the white list file and the disk utilization rate of a disk where the white list file is located;
and determining a target file in the white list file according to the file storage duration and the disk utilization rate, and deleting the target file.
Further, determining a white list file that can be cleaned in the disk file includes:
determining the file with low importance in the disk file as the white list file which can be cleaned according to a file importance detection mechanism;
wherein the file importance detection mechanism comprises: determining the importance of the disk file according to the attributes of the disk file, wherein the attributes of the disk file comprise at least one of the following: the number of file accesses, the size of the file, the type of the file, and the directory in which the file is located.
Further, determining a target file in the white list file according to the file storage duration and the disk usage rate includes:
acquiring a preset magnetic disk alarm threshold;
when the utilization rate of the disks is greater than the disk alarm threshold, sorting the white list files according to the sequence of the file storage duration from long to short;
and determining the files with the preset number in the file sequence as the target files.
Further, determining a target file in the white list file according to the file storage duration and the disk usage rate includes:
determining the maximum storable time length of the white list file stored in the disk according to the utilization rate of the disk;
and determining the file with the file storage duration being longer than the maximum storable duration in the white list file as the target file.
Further, determining the maximum storable time length of the white list file stored in the disk according to the disk usage rate includes:
acquiring a preset default time length, and determining the default time length as the maximum storable time length;
when the utilization rate of the disk is greater than the disk alarm threshold, reducing the current maximum storable duration by a set amplitude and taking the current maximum storable duration as a new maximum storable duration; and if the utilization rate of the disk is less than or equal to the disk alarm threshold value within a set time length, restoring the maximum storable duration to the default duration.
Further, after deleting the target file, the method further comprises:
and generating a log file, and determining the log file as the white list file.
Further, before acquiring the disk file to be managed, the method further includes:
acquiring a disk configuration file corresponding to the disk file to be managed;
the disk configuration file comprises a disk directory corresponding to the disk file to be managed, the disk alarm threshold, the maximum storable time, a generation path of the log file and a directory where the white list file is located.
According to another aspect of the present invention, there is provided a disk file management apparatus including:
a white list file determining module, configured to obtain the disk file to be managed, and determine a white list file that can be cleaned in the disk file;
the file storage duration and disk utilization rate monitoring module is used for monitoring the file storage duration of the white list file and the disk utilization rate of the disk where the white list file is located;
and the target file deleting module is used for determining a target file in the white list file according to the file storage duration and the disk utilization rate and deleting the target file.
Optionally, the white list file determining module is further configured to:
determining the files with low importance in the disk files as the white list files which can be cleaned according to a file importance detection mechanism;
wherein the file importance detection mechanism comprises: determining the importance of the disk file according to the attributes of the disk file, wherein the attributes of the disk file comprise at least one of the following: the number of file accesses, the size of the file, the type of the file, and the directory in which the file is located.
Optionally, the target file deleting module is further configured to:
acquiring a preset magnetic disk alarm threshold;
when the utilization rate of the disks is greater than the disk alarm threshold, sorting the white list files according to the sequence of the file storage duration from long to short;
and determining the files with the preset number in the file sequence as the target files.
Optionally, the target file deleting module is further configured to:
determining the maximum storable time of the white list file stored in the disk according to the utilization rate of the disk;
and determining the file with the file storage duration being longer than the maximum storable duration in the white list file as the target file.
Optionally, the target file deleting module is further configured to:
acquiring a preset default time length, and determining the default time length as the maximum storable time length;
when the utilization rate of the disk is greater than the disk alarm threshold, reducing the current maximum storable duration by a set amplitude and taking the current maximum storable duration as a new maximum storable duration; and if the utilization rate of the disk is less than or equal to the disk alarm threshold value within a set time length, restoring the maximum storable duration to the default duration.
Optionally, the disk file management apparatus further includes:
and the log file generation module is used for generating a log file and determining the log file as the white list file.
Optionally, the disk file management apparatus further includes:
the disk configuration file acquisition module is used for acquiring a disk configuration file corresponding to the disk file to be managed;
the disk configuration file comprises a disk directory corresponding to the disk file to be managed, the disk alarm threshold, the maximum storable time, a generation path of the log file and a directory where the white list file is located.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the disk file management method according to any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the disk file management method according to any one of the embodiments of the present invention when the computer instructions are executed.
The disk file management method disclosed by the embodiment of the invention comprises the steps of firstly obtaining a disk file to be managed, determining a white list file which can be cleaned in the disk file, then monitoring the file storage time of the white list file and the disk utilization rate of a disk where the white list file is located, finally determining a target file in the white list file according to the file storage time and the disk utilization rate, and deleting the target file. According to the disk file management method disclosed by the invention, the important files are protected from being deleted by dividing the white list files, the rule for deleting the files is determined according to the file storage duration and the disk utilization rate of the white list files, and the occupation of the disk storage space can be timely and effectively reduced.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a disk file management method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a disk file management method according to a second embodiment of the present invention;
FIG. 3 is a diagram of a disk file management process according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a disk file management apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing a disk file management method according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a disk file management method according to an embodiment of the present invention, where the method is applicable to a situation where the utilization rate of a disk is reduced by deleting a part of files in the disk, and the method may be executed by a disk file management apparatus, where the disk file management apparatus may be implemented in a form of hardware and/or software, and the disk file management apparatus may be configured in an electronic device. As shown in fig. 1, the method includes:
s110, obtaining the disk files to be managed, and determining white list files which can be cleaned in the disk files.
The disk file to be managed may be a file in a specified disk directory where there is a management requirement, and the white list file may be a file which is less important and can be deleted in the disk file.
In this embodiment, the manner of acquiring the disk file to be managed may be to acquire a disk directory of the disk file to be managed, and use a file in the directory as the disk file to be managed. The manner of determining the white list file that can be cleaned in the disk file may be to divide the disk file and determine a file with lower importance as the white list file.
Optionally, when determining a white list file that can be cleaned in the disk file, the disk file may be divided into two types, that is, a black list file and a white list file, where the black list file is an important file that cannot be deleted, and other files except the black list file are used as the white list files.
And S120, monitoring the file storage time of the white list file and the disk utilization rate of the disk where the white list file is located.
The file storage duration is the time length of the file stored in the disk, and the disk utilization rate is the ratio of the occupied storage space of the disk to the total storage space of the disk.
In this embodiment, the object of disk file management is mainly a white list file, the storage duration of each file in the white list file and the disk usage rate of the disk in which the file is located can be monitored in real time, and when the two monitored contents meet the set conditions, the subsequent steps can be executed to clean the disk.
Optionally, the monitoring of the storage duration and the disk usage rate may be in real time, or a check period may be set, and the check is performed at intervals.
And S130, determining a target file in the white list file according to the file storage duration and the disc utilization rate, and deleting the target file.
Wherein the target file may be a file that needs to be deleted to free up disk storage space.
In this embodiment, the trigger condition for determining the target file and deleting the target file may be that a file storage duration of the white list file exceeds a set time threshold, and/or a disk usage rate exceeds a set usage rate threshold.
Specifically, when the file storage time of one or more files in the white list files exceeds a set time threshold, the files with overlong storage time can be used as target files to be deleted; when the utilization rate of the magnetic disk where the white list file is located exceeds a set utilization rate threshold value, selecting partial files from the white list file as target files to delete; and determining and deleting the target file in the white list file when the file storage time of one or more files in the white list file exceeds a set time threshold and the disk utilization rate of the disk in which the white list file is located exceeds a set utilization rate threshold, namely the two conditions are met simultaneously.
Further, after deleting the target file, the method can also comprise the following steps: and generating a log file, and determining the log file as a white list file.
In this embodiment, an event in the disk file management process may be recorded in the form of a log file, and the log file may be stored in a specified directory of the disk and is defaulted as a white list file.
For example, the events in the disk file management process may be: and deleting the file, wherein the disk utilization rate exceeds a set utilization rate threshold value to cause disk alarm, and the file storage time length of the file exceeds a set time threshold value to cause storage time length alarm and the like.
The disk file management method disclosed by the embodiment of the invention comprises the steps of firstly obtaining a disk file to be managed, determining a white list file which can be cleaned in the disk file, then monitoring the file storage time of the white list file and the disk utilization rate of a disk where the white list file is located, finally determining a target file in the white list file according to the file storage time and the disk utilization rate, and deleting the target file. According to the disk file management method disclosed by the invention, the important files are protected from being deleted by dividing the white list files, the rule for deleting the files is determined according to the file storage duration and the disk utilization rate of the white list files, and the occupation of the disk storage space can be timely and effectively reduced.
Example two
Fig. 2 is a flowchart of a disk file management method according to a second embodiment of the present invention, which is a refinement of the second embodiment. As shown in fig. 2, the method includes:
s210, acquiring a disk file to be managed.
In this embodiment, the manner of acquiring the disk file to be managed may be to acquire a disk directory of the disk file to be managed, and use a file in the directory as the disk file to be managed.
Optionally, when determining a white list file that can be cleaned in the disk file, the disk file may be divided into two types, that is, a black list file and a white list file, where the black list file is an important file that cannot be deleted, and other files except the black list file are used as the white list files.
And S220, determining the file with low importance in the disk file as a white list file which can be cleaned according to a file importance detection mechanism.
The file importance detection mechanism comprises: determining the importance of the disk file according to the attributes of the disk file, wherein the attributes of the disk file comprise at least one of the following items: the number of file accesses, the size of the file, the type of the file, and the directory in which the file is located.
In this embodiment, an intelligent file importance detection mechanism may be used to automatically add files to the white list directory or the black list directory. Optionally, the file importance detection mechanism may determine the importance of the disk file according to the attribute of the disk file. For example, the importance of each file may be sorted by comprehensively considering the file access times, the file size, the file type, the directory where the file is located, and other characteristics of the disk file, and the file with low importance may be determined as a white list file that can be cleaned and added to the white list directory.
And S230, monitoring the file storage time of the white list file and the disk utilization rate of the disk where the white list file is located.
In this embodiment, the object of disk file management is mainly a white list file, the storage duration of each file in the white list file and the disk usage rate of the disk in which the file is located can be monitored in real time, and when the two monitored contents meet the set conditions, the subsequent steps can be executed to clean the disk.
Optionally, the monitoring of the file storage duration and the disk usage rate may be real-time, or a check period may be set, and the check is performed at intervals.
S240, acquiring a preset disk alarm threshold, and sorting the white list files according to the sequence of the file storage duration from long to short when the disk utilization rate is greater than the disk alarm threshold.
The disk alarm threshold may be a preset value, and when the disk usage rate is greater than the preset value, it indicates that the files stored in the disk need to be cleaned, that is, part of the files are deleted.
In this embodiment, by monitoring the file storage duration of the white list file and the disk usage rate of the disk where the white list file is located, when the disk usage rate is greater than the disk alarm threshold, the file with longer storage time in the disk may be preferentially deleted. Preferably, the files with longer storage time in the disk can be determined by sorting the white list files in the order of the file storage time length from long to short.
And S250, determining the files with the preset number in the file sequence as target files, and deleting the target files.
In this embodiment, after sorting the white list files according to the order of the file storage time length from long to short, the first set number of files in the file sequence, that is, the part of files with long storage time, may be deleted as the target files.
Specifically, by monitoring the file storage duration and the disk utilization rate of the white list files, when the disk utilization rate is greater than the disk alarm threshold, if no file exists in a white list directory, namely, no cleanable white list file exists, the white list files are not processed; if the white list directory has files, deleting part of the files in the white list, preferentially deleting the files with longer storage time when deleting the files, and deleting the set number of files each time until the utilization rate of the disk is less than or equal to the disk alarm threshold.
Optionally, the method for determining the target file in the white list file according to the file storage duration and the disk usage rate may also be: determining the maximum storable time length of the white list file stored in the disk according to the utilization rate of the disk; and determining the file with the file storage time length larger than the maximum storable time length in the white list file as a target file.
Specifically, the target file can be determined according to the maximum storable time length, and the file with the file storage time length longer than the maximum storable time length in the white list file is determined as the target file by monitoring the file storage time length of the white list file.
The method for determining the maximum storable time length of the white list file stored in the disk according to the disk utilization rate may be as follows: acquiring a preset default time length, and determining the default time length as the maximum storable time length; when the utilization rate of the disk is greater than the disk alarm threshold, reducing the current maximum storable duration by a set amplitude and taking the current maximum storable duration as a new maximum storable duration; and if the utilization rate of the disk is less than or equal to the disk alarm threshold value within the set time length, restoring the maximum storable time length to the default time length.
Specifically, the determination of the maximum storable time length is related to the usage rate of the disk, if the usage rate of the disk is greater than the disk alarm threshold, the value of the maximum storable time length is shortened, and if the usage rates of the disk are all less than or equal to the disk alarm threshold within the set time length, that is, the usage rate of the disk is greater than the disk alarm threshold does not occur within the set time length, the maximum storable time length is recovered to the initial default time length.
Fig. 3 is a schematic diagram of a disk file management process according to this embodiment, as shown in the drawing, in this scheme, after obtaining a disk file to be managed, determining a white list file therein, and monitoring a file storage duration and a disk usage rate of the white list file, if the disk usage rate is greater than a disk alarm threshold, removing a part of the files according to the file storage duration and shortening a maximum storable duration of the white list file, then determining whether the file storage duration is greater than the maximum storable duration, and if so, removing the file exceeding the maximum storable duration. And then if the utilization rate of the disk is less than or equal to the disk alarm threshold value within the set time length, restoring the maximum storable time length to the default time length.
Further, before acquiring the disk file to be managed, the method may further include: and acquiring a disk configuration file corresponding to the disk file to be managed. The disk configuration file comprises a disk directory corresponding to a disk file to be managed, a disk alarm threshold, a maximum storable time, a generation path of a log file and a directory of a white list file.
In this embodiment, the rule for managing the disk file may be stored in a specified disk directory in the form of a disk configuration file, where the configured content includes but is not limited to: the method comprises the steps of obtaining a disk directory corresponding to a disk file to be managed, a disk alarm threshold, the maximum storable time, a log file generation path and a white list file directory.
The disk file management method provided by the embodiment of the invention comprises the steps of firstly obtaining disk files to be managed, then determining files with low importance in the disk files as white list files which can be cleaned according to a file importance detection mechanism, then monitoring the file storage time of the white list files and the disk utilization rate of a disk where the white list files are located, then obtaining a preset disk alarm threshold, when the disk utilization rate is greater than the disk alarm threshold, sequencing the white list files according to the sequence of the file storage time from long to short, finally determining the files with the preset number in a file sequence as target files, and deleting the target files. According to the disk file management method disclosed by the invention, important files are protected from being deleted by dividing the white list files, and a rule for determining the deleted files according to the file storage time length and the disk utilization rate of the white list files is set, wherein the maximum storable time length of the files is correspondingly shortened when the disk utilization rate exceeds a threshold value, and the occupation of the disk storage space can be timely and effectively reduced.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a disk file management apparatus according to a third embodiment of the present invention. As shown in fig. 4, the apparatus includes: a white list file determining module 310, a file storage duration and disk usage monitoring module 320 and a target file deleting module 330.
A white list file determining module 310, configured to obtain the disk file to be managed, and determine a white list file that can be cleaned in the disk file.
Optionally, the white list file determining module 310 is further configured to:
and determining the files with low importance in the disk files as white list files which can be cleaned according to a file importance detection mechanism.
The file importance detection mechanism comprises: determining the importance of the disk file according to the attributes of the disk file, wherein the attributes of the disk file comprise at least one of the following: the number of file accesses, the size of the file, the type of the file, and the directory in which the file is located.
The file storage duration and disk usage monitoring module 320 is configured to monitor a file storage duration of the white list file and a disk usage of a disk where the white list file is located.
And the target file deleting module 330 is configured to determine a target file in the white list file according to the file storage duration and the disk usage rate, and delete the target file.
Optionally, the target file deleting module 330 is further configured to:
acquiring a preset magnetic disk alarm threshold; when the utilization rate of the disk is greater than the disk alarm threshold, sorting the white list files according to the sequence of the file storage duration from long to short; and determining the files with the preset number in the file sequence as target files.
Optionally, the target file deleting module 330 is further configured to:
determining the maximum storable time of the white list file stored in the disk according to the utilization rate of the disk; and determining the file with the file storage time length greater than the maximum storable time length in the white list file as a target file.
Optionally, the target file deleting module 330 is further configured to:
acquiring a preset default time length, and determining the default time length as the maximum storable time length; when the utilization rate of the disk is greater than the disk alarm threshold, reducing the current maximum storable duration by a set amplitude and taking the current maximum storable duration as a new maximum storable duration; and if the utilization rate of the disk is less than or equal to the disk alarm threshold value within the set time length, restoring the maximum storable time length to the default time length.
Optionally, the disk file management apparatus further includes a log file generating module 340, configured to generate a log file, and determine the log file as a white list file.
Optionally, the disk file management apparatus further includes a disk configuration file obtaining module 350, configured to obtain a disk configuration file corresponding to the disk file to be managed.
The disk configuration file comprises a disk directory corresponding to a disk file to be managed, a disk alarm threshold, a maximum storable time, a generation path of a log file and a directory of a white list file.
The disk file management device provided by the embodiment of the invention can execute the disk file management method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 5 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as a disk file management method.
In some embodiments, the disk file management method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more of the steps of disk file management described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the disk file management method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on 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 or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A disk file management method is characterized by comprising the following steps:
acquiring the disk files to be managed, and determining white list files which can be cleaned in the disk files;
monitoring the file storage duration of the white list file and the disk utilization rate of a disk where the white list file is located;
and determining a target file in the white list file according to the file storage duration and the disk utilization rate, and deleting the target file.
2. The method of claim 1, wherein determining white list files of the disk files that can be cleaned comprises:
determining the files with low importance in the disk files as the white list files which can be cleaned according to a file importance detection mechanism;
wherein the file importance detection mechanism comprises: determining the importance of the disk file according to the attributes of the disk file, wherein the attributes of the disk file comprise at least one of the following: the number of file accesses, the size of the file, the type of the file, and the directory in which the file is located.
3. The method of claim 1, wherein determining the target file in the white list file according to the file storage duration and the disk usage rate comprises:
acquiring a preset magnetic disk alarm threshold;
when the utilization rate of the disks is greater than the disk alarm threshold, sorting the white list files according to the sequence of the file storage duration from long to short;
and determining the files with the preset number in the file sequence as the target files.
4. The method of claim 3, wherein determining the target file in the white list file according to the file storage duration and the disk usage rate comprises:
determining the maximum storable time length of the white list file stored in the disk according to the utilization rate of the disk;
and determining the file with the file storage duration being longer than the maximum storable duration in the white list file as the target file.
5. The method of claim 4, wherein determining the maximum storable time period for the white list file to be stored in the disk according to the disk usage rate comprises:
acquiring a preset default time length, and determining the default time length as the maximum storable time length;
when the utilization rate of the disk is greater than the disk alarm threshold, reducing the current maximum storable duration by a set amplitude and taking the current maximum storable duration as a new maximum storable duration; and if the utilization rate of the disk is less than or equal to the disk alarm threshold value within a set time length, restoring the maximum storable duration to the default duration.
6. The method of claim 1, wherein after deleting the target file, further comprising:
and generating a log file, and determining the log file as the white list file.
7. The method according to claims 1-6, wherein before obtaining the disk file to be managed, further comprising:
acquiring a disk configuration file corresponding to the disk file to be managed;
the disk configuration file comprises a disk directory corresponding to the disk file to be managed, the disk alarm threshold, the maximum storable time, a generation path of the log file and a directory where the white list file is located.
8. A disk file management apparatus, characterized by comprising:
the white list file determining module is used for acquiring the disk files to be managed and determining white list files which can be cleaned in the disk files;
the file storage duration and disk utilization rate monitoring module is used for monitoring the file storage duration of the white list file and the disk utilization rate of the disk where the white list file is located;
and the target file deleting module is used for determining a target file in the white list file according to the file storage duration and the disk utilization rate and deleting the target file.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the disk file management method of any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the disk file management method according to any one of claims 1 to 7 when executed.
CN202211533831.6A 2022-12-01 2022-12-01 Disk file management method, device, equipment and storage medium Pending CN115718732A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211533831.6A CN115718732A (en) 2022-12-01 2022-12-01 Disk file management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211533831.6A CN115718732A (en) 2022-12-01 2022-12-01 Disk file management method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115718732A true CN115718732A (en) 2023-02-28

Family

ID=85257300

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211533831.6A Pending CN115718732A (en) 2022-12-01 2022-12-01 Disk file management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115718732A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737676A (en) * 2023-08-15 2023-09-12 中移(苏州)软件技术有限公司 File storage method, device, electronic equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737676A (en) * 2023-08-15 2023-09-12 中移(苏州)软件技术有限公司 File storage method, device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN109257200B (en) Method and device for monitoring big data platform
CN106294206B (en) Cache data processing method and device
CN115291806A (en) Processing method, processing device, electronic equipment and storage medium
CN115718732A (en) Disk file management method, device, equipment and storage medium
CN114490160A (en) Method, device, equipment and medium for automatically adjusting data tilt optimization factor
CN114091704A (en) Alarm suppression method and device
CN116594563A (en) Distributed storage capacity expansion method and device, electronic equipment and storage medium
CN116796085A (en) File processing method and device, electronic equipment and storage medium
CN115878035A (en) Data reading method and device, electronic equipment and storage medium
CN114564149A (en) Data storage method, device, equipment and storage medium
CN115774602A (en) Container resource allocation method, device, equipment and storage medium
CN113676531B (en) E-commerce flow peak clipping method and device, electronic equipment and readable storage medium
CN115390993A (en) Virtual machine memory processing method and device, electronic equipment and storage medium
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN114817223A (en) Service data extraction method and device, electronic equipment and storage medium
CN114661562A (en) Data warning method, device, equipment and medium
CN117632027A (en) Disk space processing method, device, equipment and storage medium
CN113220230B (en) Data export method and device, electronic equipment and storage medium
CN116974856B (en) Method, device, equipment and medium for automatically acquiring log file
CN115599634A (en) Data processing method, device, equipment and storage medium
CN115408115A (en) Transaction starting time processing method, device, equipment and storage medium
CN115190097A (en) Message pushing method, device, equipment and storage medium
CN115495016A (en) Log clearing method and device, electronic equipment and storage medium
CN115129538A (en) Event processing method, device, equipment and medium
CN115408195A (en) Batch task management method, equipment and storage medium for heterogeneous platform

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