CN108646987B - File volume management method and device, storage medium and terminal - Google Patents

File volume management method and device, storage medium and terminal Download PDF

Info

Publication number
CN108646987B
CN108646987B CN201810489298.5A CN201810489298A CN108646987B CN 108646987 B CN108646987 B CN 108646987B CN 201810489298 A CN201810489298 A CN 201810489298A CN 108646987 B CN108646987 B CN 108646987B
Authority
CN
China
Prior art keywords
file
time
volume
stored
file volume
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810489298.5A
Other languages
Chinese (zh)
Other versions
CN108646987A (en
Inventor
钟昌寿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201810489298.5A priority Critical patent/CN108646987B/en
Publication of CN108646987A publication Critical patent/CN108646987A/en
Application granted granted Critical
Publication of CN108646987B publication Critical patent/CN108646987B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket

Abstract

The invention discloses a method, a device, a storage medium and a terminal for managing a file volume, wherein the method comprises the following steps: setting types of a plurality of file volumes, and determining the corresponding expiration time of each type of file volume, wherein the expiration times of different types of file volumes are different; when the files are stored, storing the files to be stored into the file volumes of the corresponding types according to the expiration time of the files to be stored; and deleting the file volume according to the expiration time of the file volume. The types of the file volumes are set, the files to be stored are stored into the file volumes of the corresponding types according to different expiration times of the files to be stored, when the files are required to be deleted, the whole file volumes can be deleted only according to the expiration time of the file volumes of the corresponding types, and operations such as traversing the expiration times of all the stored files in the file volumes, then transferring, deleting and the like are not required, so that the read-write times of the disk are greatly reduced, and the efficiency of managing and deleting and the use experience of a user are improved.

Description

File volume management method and device, storage medium and terminal
Technical Field
The present invention relates to the field of data storage, and in particular, to a method and an apparatus for managing a file volume, a storage medium, and a terminal.
Background
Object storage is also file storage. The general file system is not friendly to the storage mode of mass files, so that the file is merged into a file volume for storage by the object storage service generally. So as to reduce the number of files on the disk and reduce the generation of disk fragments. However, the files are merged into the file volume for storage, and the problem of deleting the expired files exists. A file volume may consist of hundreds or thousands of files that are inconsistent in expiration time, may be never expired, and may be expired for some time.
The expired file management method in the prior art is as follows: and starting a deleting program regularly or manually, sequentially traversing the whole file volume, taking out the expiration time of each file, moving the unexpired files to a new file volume, and after the traversal of the whole file volume is finished, moving all the unexpired files to the new file volume and then deleting the old file volume. However, in this way, the whole file volume needs to be traversed, which causes a large amount of read-write operations, and when only a small number of expired files exist in the file volume, the whole file volume still needs to be traversed, which has low efficiency of managing and deleting, and affects the use experience of the user.
Disclosure of Invention
The invention provides a file volume management method, a file volume management device, a storage medium and a terminal, which are used for solving the following problems in the prior art: in the prior art, the whole file volume needs to be traversed, a large amount of read-write operations are caused, the efficiency of managing and deleting files is too low, and the use experience of a user is influenced.
To solve the above technical problem, in one aspect, the present invention provides a method for managing a file volume, including: setting types of a plurality of file volumes, and determining the corresponding expiration time of each type of file volume, wherein the expiration times of different types of file volumes are different; when a file is stored, storing the file to be stored into a file volume of a corresponding type according to the expiration time of the file to be stored; and deleting the file volume according to the expiration time of the file volume.
Further, the setting the types of the plurality of file volumes and determining the expiration time corresponding to each type of file volume includes: setting a plurality of time periods; setting a plurality of file volume types which are in one-to-one correspondence with each time period in the plurality of time periods according to the plurality of time periods; and determining the expiration time of the file volume type corresponding to each time period according to the time upper limit of each time period in the plurality of time periods.
Further, the storing the file to be stored into the file volume of the corresponding type according to the expiration time of the file to be stored includes: determining the time period to which the expiration time of the file to be stored belongs; and storing the file to be stored into a file volume of a type corresponding to the time period according to the time period to which the expiration time of the file to be stored belongs.
Further, the deleting the file volume according to the expiration time of the file volume includes: determining a time difference between the last modification time and the current time of the file volume; deleting the file volume if the time difference is greater than an expiration time of the file volume.
In another aspect, the present invention provides a file volume management apparatus including: the device comprises a setting module, a storage module and a processing module, wherein the setting module is used for setting the types of a plurality of file volumes and determining the corresponding expiration time of each type of file volume, and the expiration times of different types of file volumes are different; the storage module is used for storing the files to be stored into the file volumes of the corresponding types according to the expiration time of the files to be stored when the files are stored; and the deleting module is used for deleting the file volume according to the expiration time of the file volume.
Further, the setting module is specifically configured to: setting a plurality of time periods; setting a plurality of file volume types which are in one-to-one correspondence with each time period in the plurality of time periods according to the plurality of time periods; and determining the expiration time of the file volume type corresponding to each time period according to the time upper limit of each time period in the plurality of time periods.
Further, the storage module is specifically configured to: determining the time period to which the expiration time of the file to be stored belongs; and storing the file to be stored into a file volume of a type corresponding to the time period according to the time period to which the expiration time of the file to be stored belongs.
Further, the deletion module is specifically configured to: determining a time difference between the last modification time of the file volume and the current time; and deleting the file volume when the time difference is larger than the expiration time of the file volume.
In another aspect, the present invention provides a storage medium storing a computer program, wherein the computer program is configured to implement the steps of the method for managing a file volume when executed by a processor.
In another aspect, the present invention further provides a terminal, which at least includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the file volume management method when executing the computer program on the memory.
The types of the file volumes are set, the files to be stored are stored into the file volumes of the corresponding types according to different expiration times of the files to be stored, when the files are required to be deleted, the whole file volumes can be deleted only according to the expiration time of the file volumes of the corresponding types, and operations such as traversing the expiration times of all the stored files in the file volumes, then transferring, deleting and the like are not required, so that the read-write times of the disk are greatly reduced, and the efficiency of managing and deleting and the use experience of a user are improved.
Drawings
FIG. 1 is a flowchart of a file volume management method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for managing file volumes according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a file volume management method according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a file volume management method according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a file volume management apparatus according to a fifth embodiment of the present invention.
Detailed Description
In order to solve the following problems in the prior art: in the prior art, a large number of read-write operations are caused by traversing the whole file volume, and the efficiency of managing and deleting files is too low, which affects the use experience of users. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
A first embodiment of the present invention provides a method for managing a file volume, which is applied to an object storage system, and a flowchart of the method is shown in fig. 1, and specifically includes steps S101 to S103:
s101, setting types of a plurality of file volumes, and determining corresponding expiration time of each type of file volume, wherein the expiration times of different types of file volumes are different.
In the object storage system, a plurality of file volumes are set, different types are set for the file volumes respectively, the file volumes of different types are used for storing files to be stored with different expiration times, the corresponding expiration time is determined according to the type of each file volume, and the expiration times of the file volumes of different types are different.
S102, when the file is stored, the file to be stored is stored into the file volume of the corresponding type according to the expiration time of the file to be stored.
Since the number of file volumes is set according to the type, when storing the file, the file should be stored in the file volume of the corresponding type according to the expiration time of the file to be stored. Specifically, files to be stored with the same expiration time are stored in the same file volume, so that all files in the file volume are in an expiration state when the file volume is subsequently managed or deleted.
And S103, deleting the file volume according to the expiration time of the file volume.
When managing file volumes, the object storage system deletes file volumes according to different expiration times of different types of file volumes. When the state of the file volume meets the deletion condition, all files stored in the file volume are proved to reach the expiration time, so that traversing operation on each file volume is not needed to screen the files needing to be deleted, and only the whole corresponding expired file volume is deleted.
The file deletion method has the advantages that the types of the file volumes are set, the files to be stored are stored into the file volumes of the corresponding types according to different expiration times of the files, when the files need to be deleted, the whole file volumes can be deleted only according to the expiration time of the file volumes of the corresponding types, operations such as traversing the expiration times of all the stored files in the file volumes, then transferring, deleting and the like are not needed, the read-write times of the magnetic disk are greatly reduced, and the management deletion efficiency and the use experience of a user are improved.
A second embodiment of the present invention provides a method for managing a file volume, which is applied to an object storage system, and a flowchart thereof is shown in fig. 2, and specifically includes steps S201 to S205:
s201, setting a plurality of time periods.
S202, according to the plurality of time periods, a plurality of file volume types which are in one-to-one correspondence with each time period in the plurality of time periods are set.
The expiration time of files to be stored typically varies from a few days to tens of days, and there may be longer term or permanently valid files. Therefore, in order to store files of different expiration times, when setting a plurality of types of file volumes, a plurality of time periods may be set first, and the time periods should be consecutive but have no time intersection with each other. And then setting corresponding file volume types according to time periods, wherein each time period has a corresponding file volume type, and the file volume of the type is used for storing files to be stored, the expiration time of which falls within the time period.
S203, determining the expiration time of the file volume type corresponding to each time slot according to the time upper limit of each time slot in the plurality of time slots.
In order to manage and delete a file volume, after a plurality of types of file volumes are set, the expiration time corresponding to each type of file volume needs to be determined, so that the file volume can be managed according to the expiration time of the file volume. Since each file volume type corresponds to a set time period, and the expiration time of the saved file does not exceed the time limit of the time period, the upper limit of each time period should be used as the expiration time of the file volume of the corresponding type. For example, first, four time periods are set, which are 0 to 7 days, 7 to 15 days, 15 to 30 days, 30 to 90 days and more than 90 days, respectively, then five types of file volumes are correspondingly set, the first type of file volume is used for storing files with expiration time greater than 0 day and less than or equal to 7 days, and the expiration time of the first type of file volume is 7 days; the second type file volume is used for storing files with expiration time of more than 7 days and less than or equal to 15 days, and the expiration time of the second type file volume is 15 days; the third type file volume is used for storing files with expiration time of more than 15 days and less than or equal to 30 days, and the expiration time of the third type file volume is 30 days; the fourth type file volume is used for storing files with expiration time of more than 30 days and less than or equal to 90 days, and the expiration time of the fourth type file volume is 90 days; the fifth type file volume is used for storing files with expiration time larger than 90 days, and the fifth type file volume does not set the expiration time. It should be understood that in the process of setting the type of the file volume, a file volume with a time limit being infinite should be always included, such as a file volume of the fifth type, for storing all files with expiration time exceeding 90 days, and since there is no time limit, the expiration time of the file volume of the type is not set.
It should be understood that the above time period and file volume type dividing method are not limited to the above time nodes, and may be flexibly set according to the expiration time and the number of files to be stored in actual use.
And S204, when the file is stored, storing the file to be stored into the file volume of the corresponding type according to the expiration time of the file to be stored.
Since the number of file volumes is set according to the type, when storing the file, the file should be stored in the file volume of the corresponding type according to the expiration time of the file to be stored. Specifically, files to be stored with the same expiration time are stored in the same file volume, so that all files in the file volume are in an expiration state when the file volume is subsequently managed or deleted.
And S205, deleting the file volume according to the expiration time of the file volume.
When managing file volumes, the object storage system deletes file volumes according to different expiration times of different types of file volumes. When the state of the file volume meets the deletion condition, all files stored in the file volume are proved to reach the expiration time, so that traversing operation on each file volume is not needed to screen the files needing to be deleted, and only the whole corresponding expired file volume is deleted.
The file deletion method has the advantages that the types of the file volumes are set, the files to be stored are stored into the file volumes of the corresponding types according to different expiration times of the files, when the files need to be deleted, the whole file volumes can be deleted only according to the expiration time of the file volumes of the corresponding types, operations such as traversing the expiration times of all the stored files in the file volumes, then transferring, deleting and the like are not needed, the read-write times of the magnetic disk are greatly reduced, and the management deletion efficiency and the use experience of a user are improved.
A third embodiment of the present invention provides a method for managing a file volume, which is applied to an object storage system, and a flowchart thereof is shown in fig. 3, and specifically includes steps S301 to S306:
s301, a plurality of time periods are set.
S302, according to a plurality of time periods, a plurality of file volume types which are in one-to-one correspondence with each time period in the plurality of time periods are set.
The expiration time of files to be stored typically varies from a few days to tens of days, and there may be longer term or permanently valid files. Therefore, in order to store files of different expiration times, when setting a plurality of types of file volumes, a plurality of time periods may be set first, and the time periods should be consecutive but have no time intersection with each other. And then setting corresponding file volume types according to time periods, wherein each time period has a corresponding file volume type, and the file volume of the type is used for storing files to be stored, the expiration time of which falls within the time period.
S303, determining the expiration time of the file volume type corresponding to each time period according to the time upper limit of each time period in the plurality of time periods.
In order to manage and delete a file volume, after a plurality of types of file volumes are set, the expiration time corresponding to each type of file volume needs to be determined, so that the file volume can be managed according to the expiration time of the file volume. Since each file volume type corresponds to a set time period, and the expiration time of the saved file does not exceed the time limit of the time period, the upper limit of each time period should be used as the expiration time of the file volume of the corresponding type.
S304, determining the time period to which the expiration time of the file to be stored belongs.
S305, storing the file to be stored into the file volume of the type corresponding to the time period according to the time period to which the expiration time of the file to be stored belongs.
When storing files, firstly acquiring the expiration time of the files to be stored, determining the time period to which the files to be stored belong according to the expiration time of the files to be stored and the preset time period, and then storing the files to be stored in the file volumes of the types corresponding to the time period. For example, the expiration time of the file a to be stored is 20 days, and the time period to which the file a should be attributed is 15 days to 30 days, that is, the file a should be stored in the third type file volume.
And S306, deleting the file volume according to the expiration time of the file volume.
When managing file volumes, the object storage system deletes file volumes according to different expiration times of different types of file volumes. When the state of the file volume meets the deletion condition, all files stored in the file volume are proved to reach the expiration time, so that traversing operation is not required to be carried out on each file volume to screen the files needing to be deleted, and only the whole corresponding expired file volume is deleted.
According to the embodiment, the files to be stored are classified and stored according to the expiration time, the files with the expiration times belonging to the same time period are stored in the same type of file volume, and it is guaranteed that all the files stored in the file volume are in the expiration state when the expiration time of the file volume reaches, so that the same deletion management can be realized, the read-write times of a disk are reduced, and the deletion management efficiency and the use experience of a user are improved.
A fourth embodiment of the present invention provides a method for managing a file volume, which is applied to an object storage system, and a flowchart of the method is shown in fig. 4, and specifically includes steps S401 to S404:
s401, setting types of a plurality of file volumes, and determining corresponding expiration time of each type of file volume, wherein the expiration times of different types of file volumes are different.
In the object storage system, a plurality of file volumes are set, different types are set for the file volumes respectively, the file volumes of different types are used for storing files to be stored with different expiration times, the corresponding expiration time is determined according to the type of each file volume, and the expiration times of the file volumes of different types are different.
S402, when the files are stored, the files to be stored are stored into the file volumes of the corresponding types according to the expiration time of the files to be stored.
Since the number of file volumes is set according to the type, when storing the file, the file should be stored in the file volume of the corresponding type according to the expiration time of the file to be stored. Specifically, files to be stored with the same expiration time are stored in the same file volume, so that all files in the file volume are in an expiration state when the file volume is subsequently managed or deleted.
S403, determining the time difference between the last modification time and the current time of the file volume.
S404, deleting the file volume when the time difference is larger than the expiration time of the file volume.
In this embodiment, the object storage system continuously stores files in a certain type of file volume, so that the modification time of the file volume is continuously changed, when a deletion operation is required, it is first required to determine a time difference between the last modification time of the file volume and the current time, and determine whether the time difference is greater than the expiration time of the file volume, and when the time difference is greater than the expiration time of the file volume, it is proved that the last written file in the file volume has expired, and then other files stored in the file volume before the file have also expired, and at this time, the file volume may be deleted, together with the expired file in the file volume. For example, if the current time is 18 days in 2018, 4 months, and the last modification time of the first-type file volume is 10 days in 2018, 4 months, and 10 days in 2018, the time difference between the last modification time of the first-type file volume and the current time is 8 days, and the expiration time of the first-type file volume is already exceeded by 7 days, at this time, all files in the first-type file volume are necessarily in an expiration state, and the first-type file volume is deleted.
Alternatively, for a file volume with an expiration time not set, such as a fifth-type file volume, a default management policy may be adopted, that is, all files in the fifth-type file volume are traversed, and whether each file is expired or not is determined, and for an expired file, the expired file may be transferred to another file volume, and after the traversal and the transfer are completed, the file volume is deleted. Although traversal operation is required to be performed on the fifth-type file volume, a considerable part of files are already stored in other four types of file volumes, only files with expiration time longer than 90 days are stored in the fifth-type file volume, the number of traversed files is reduced, the expiration time of the files stored in the fifth-type file volume is long, and deletion is not required to be performed too frequently, so that frequent read-write operation is not performed, and efficiency is further influenced.
It should be understood that after a file volume of a certain type is deleted, in order to ensure that a file subsequently stored in the file volume of the certain type can be normally stored, a file volume of the certain type should be reset after the file volume of the original type is deleted, and the expiration time of the newly set file volume of the certain type is the same as that of the original file volume.
According to the embodiment, the file volume is deleted through the last modification time of the file volume and the expiration time of the file volume, and all files in the file volume are deleted along with the deletion of the file volume, so that operations such as traversal and transfer of the files in the file volume are not needed, the read-write times of a disk are reduced, and the efficiency of managing deletion and the use experience of a user are improved.
A fifth embodiment of the present invention provides a file volume management apparatus provided in an object storage system, the apparatus having a configuration as shown in fig. 5, and including:
the setting module 10 is configured to set types of a plurality of file volumes, and determine expiration times corresponding to the file volumes of each type, where the expiration times of different types of file volumes are different; the storage module 20 is coupled with the setting module 10 and is used for storing the files to be stored into the file volumes of the corresponding types according to the expiration time of the files to be stored when the files are stored; and the deleting module 30 is coupled with the storage module 20 and is used for deleting the file volume according to the expiration time of the file volume.
In the object storage system, a setting module 10 sets a plurality of file volumes, and sets different types for the plurality of file volumes, the different types of file volumes are used for storing files to be stored with different expiration times, and the corresponding expiration times of the file volumes are determined according to the types of the file volumes, and the expiration times of the different types of file volumes are different.
Specifically, since the expiration time of the file to be stored generally varies from several days to several tens of days, and there may be a file that is valid for a longer period or is permanently, the setting module 10 may set, when setting a plurality of file volumes, a plurality of time periods that should be consecutive but have no time intersection with each other first; then the setting module 10 sets the corresponding file volume type according to the time periods, each time period has a corresponding file volume type, and the file volume of the type is used for storing the file to be stored whose expiration time falls within the time period; in order to manage and delete a file volume, after a plurality of types of file volumes are set, the setting module 10 needs to determine the expiration time corresponding to each type of file volume, so as to facilitate subsequent management of the file volume according to the expiration time of the file volume. Because the type of each file volume corresponds to a set time period, and the expiration time of the stored files does not exceed the time limit of the time period, the upper limit of each time period should be used as the expiration time of the corresponding type file volume, and the expiration time is not set for the time period without the time limit.
Since a plurality of file volumes are set according to types, when storing a file, the storage module 20 stores the file into a file volume of a corresponding type according to the expiration time of the file to be stored. Specifically, the storage module 20 first obtains the expiration time of the file to be stored, determines the time period to which the file to be stored should belong according to the expiration time of the file to be stored in combination with a preset time period, and then stores the file to be stored into the file volume of the type corresponding to the time period, where the files to be stored with the same expiration time are stored into the same file volume, so as to ensure that all files in the file volume are in an expired state when the file volume is subsequently managed or deleted.
When managing the file volume, the deleting module 30 may delete the file volume according to different expiration times of different types of file volumes. When the state of the file volume meets the deletion condition, all files stored in the file volume are proved to reach the expiration time, so that traversing operation on each file volume is not needed to screen the files needing to be deleted, and only the files corresponding to the expiration time need to be deleted integrally. Specifically, the storage module 20 continuously stores files in a certain type of file volume, so that the modification time of the files is changed continuously, when a deletion operation needs to be performed, the deletion module 30 needs to first determine a time difference between the last modification time of the file volume and the current time, and determine whether the time difference is greater than the expiration time of the file volume, and in the case that the time difference is greater than the expiration time of the file volume, it is proved that the last written file in the file volume is expired, and then other files stored in the file volume before the file are also expired, and at this time, the deletion module 30 may delete the file volume together with the expired files in the file volume.
Alternatively, for a file volume for which the expiration time is not set, a default management policy may be adopted, that is, all files in the file volume are traversed, whether each file is expired or not is determined, and for an expired file, the file may be transferred to another file volume, and after the traversal and the transfer are completed, the other file volume is deleted. Although traversal operation is required to be performed on a file volume without setting the expiration time, as a considerable part of files are stored in other types of file volumes, the number of traversed files is reduced, the expiration time of the files stored in the file volume without setting the expiration time is long, and deletion is not required to be performed too frequently, so that frequent read-write operation is not performed, and further efficiency is affected.
It should be understood that after a file volume of a certain type is deleted, in order to ensure that a file subsequently stored in the file volume of the certain type can be normally stored, a file volume of the certain type should be reset after the file volume of the original type is deleted, and the expiration time of the newly set file volume of the certain type is the same as that of the original file volume.
The file deletion method has the advantages that the types of the file volumes are set, the files to be stored are stored into the file volumes of the corresponding types according to different expiration times of the files, when the files need to be deleted, the whole file volumes can be deleted only according to the expiration time of the file volumes of the corresponding types, operations such as traversing the expiration times of all the stored files in the file volumes, then transferring, deleting and the like are not needed, the read-write times of the magnetic disk are greatly reduced, and the management deletion efficiency and the use experience of a user are improved.
A sixth embodiment of the present invention provides a storage medium storing a computer program that, when executed by a processor, realizes steps S11 to S13 as follows:
s11, setting the types of a plurality of file volumes, and determining the corresponding expiration time of each type of file volume, wherein the expiration times of different types of file volumes are different;
s12, when storing the file, storing the file to be stored into the file volume of the corresponding type according to the expiration time of the file to be stored;
and S13, deleting the file volume according to the expiration time of the file volume.
In the present embodiment, the storage medium may be installed in an object storage system. Since the method for managing a file volume has been described in detail in the first embodiment, no further description is given in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes. Optionally, in this embodiment, the processor executes the method steps described in the above embodiments according to the program code stored in the storage medium. Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again. It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
A seventh embodiment of the present invention provides a terminal including at least a memory having a computer program stored thereon, and a processor that implements the following steps S21 to S23 when executing the computer program on the memory:
s21, setting the types of a plurality of file volumes, and determining the corresponding expiration time of each type of file volume, wherein the expiration times of different types of file volumes are different;
s22, when storing the file, storing the file to be stored into the file volume of the corresponding type according to the expiration time of the file to be stored;
and S23, deleting the file volume according to the expiration time of the file volume.
In this embodiment, the terminal may be an object storage system. Since the method for managing a file volume has been described in detail in the first embodiment, no further description is given in this embodiment.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and that the scope of the present invention is not limited to the embodiments disclosed.

Claims (8)

1. A method for managing a file volume, comprising:
setting types of a plurality of file volumes, and determining the expiration time corresponding to each type of file volume, wherein the expiration times of different types of file volumes are different, and the expiration time corresponding to any type of file volume comprises the time upper limit of the time period corresponding to the type of file volume;
when a file is stored, storing the file to be stored into a file volume of a corresponding type according to the expiration time of the file to be stored;
deleting the file volume according to the expiration time of the file volume;
deleting the file volume according to the expiration time of the file volume comprises the following steps:
determining a time difference between the last modification time and the current time of the file volume;
and deleting the file volume when the time difference is larger than the expiration time of the file volume.
2. The method for managing according to claim 1, wherein the setting of the types of the plurality of file volumes and the determining of the expiration time corresponding to each type of file volume comprises:
setting a plurality of time periods;
according to the time periods, setting a plurality of file volume types which are in one-to-one correspondence with each time period in the time periods;
and determining the expiration time of the file volume type corresponding to each time period according to the time upper limit of each time period in the plurality of time periods.
3. The method for managing according to claim 2, wherein the storing the file to be stored into the file volume of the corresponding type according to the expiration time of the file to be stored comprises:
determining the time period to which the expiration time of the file to be stored belongs;
and storing the file to be stored into a file volume of a type corresponding to the time period according to the time period to which the expiration time of the file to be stored belongs.
4. A file volume management device, comprising:
the device comprises a setting module, a storage module and a processing module, wherein the setting module is used for setting the types of a plurality of file volumes and determining the expiration time corresponding to each type of file volume, wherein the expiration times of different types of file volumes are different, and the expiration time corresponding to any type of file volume comprises the time upper limit of the time period corresponding to the type of file volume;
the storage module is used for storing the files to be stored into the file volumes of the corresponding types according to the expiration time of the files to be stored when the files are stored;
the deleting module is used for deleting the file volume according to the expiration time of the file volume;
the deletion module is specifically configured to:
determining a time difference between the last modification time and the current time of the file volume;
and deleting the file volume when the time difference is larger than the expiration time of the file volume.
5. The management device according to claim 4, wherein the setting module is specifically configured to:
setting a plurality of time periods;
setting a plurality of file volume types which are in one-to-one correspondence with each time period in the plurality of time periods according to the plurality of time periods;
and determining the expiration time of the file volume type corresponding to each time period according to the time upper limit of each time period in the plurality of time periods.
6. The management apparatus according to claim 5, wherein the storage module is specifically configured to:
determining the time period to which the expiration time of the file to be stored belongs;
and storing the file to be stored into a file volume of a type corresponding to the time period according to the time period to which the expiration time of the file to be stored belongs.
7. A storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the file volume management method according to any one of claims 1 to 3.
8. A terminal device comprising at least a memory on which a computer program is stored, and a processor, characterized in that the processor implements the steps of the file volume management method according to any one of claims 1 to 3 when executing the computer program on the memory.
CN201810489298.5A 2018-05-21 2018-05-21 File volume management method and device, storage medium and terminal Active CN108646987B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810489298.5A CN108646987B (en) 2018-05-21 2018-05-21 File volume management method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810489298.5A CN108646987B (en) 2018-05-21 2018-05-21 File volume management method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN108646987A CN108646987A (en) 2018-10-12
CN108646987B true CN108646987B (en) 2022-05-31

Family

ID=63757179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810489298.5A Active CN108646987B (en) 2018-05-21 2018-05-21 File volume management method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN108646987B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069457A (en) * 2019-04-24 2019-07-30 苏州浪潮智能科技有限公司 One kind is based on scratch file delet method and system in distributed file storage system
CN112214503A (en) * 2020-10-10 2021-01-12 深圳壹账通智能科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114780484A (en) * 2021-12-30 2022-07-22 上海川源信息科技有限公司 Implementation method for file life cycle management for object storage

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893152A (en) * 2016-03-31 2016-08-24 广东欧珀移动通信有限公司 Memory management method and device and mobile terminal

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7478096B2 (en) * 2003-02-26 2009-01-13 Burnside Acquisition, Llc History preservation in a computer storage system
JP5652220B2 (en) * 2011-01-20 2015-01-14 富士ゼロックス株式会社 File management apparatus and program
JP5871583B2 (en) * 2011-11-22 2016-03-01 キヤノン株式会社 Document management apparatus, control method therefor, and program
EP2807584A2 (en) * 2012-04-25 2014-12-03 Hitachi, Ltd. File storage system and file cloning method
CN106250386A (en) * 2016-07-08 2016-12-21 乐视控股(北京)有限公司 The method and apparatus deleting object in object storage
CN107016099A (en) * 2017-04-10 2017-08-04 国家电网公司 The folder space monitoring maintenance system and method for class Unix system server
CN107451248A (en) * 2017-07-28 2017-12-08 福建中金在线信息科技有限公司 A kind of date storage method, device and electronic equipment
CN107766463A (en) * 2017-09-28 2018-03-06 北京北信源软件股份有限公司 A kind of storage processing method and device of the middleware system of multi-service driving
CN107832470A (en) * 2017-11-29 2018-03-23 郑州云海信息技术有限公司 A kind of object storage method and device based on storage system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893152A (en) * 2016-03-31 2016-08-24 广东欧珀移动通信有限公司 Memory management method and device and mobile terminal

Also Published As

Publication number Publication date
CN108646987A (en) 2018-10-12

Similar Documents

Publication Publication Date Title
US10740308B2 (en) Key_Value data storage system
US11023448B2 (en) Data scrubbing method and apparatus, and computer readable storage medium
CN108646987B (en) File volume management method and device, storage medium and terminal
CN105354315B (en) Method, sublist node and the system of distributed data base neutron table splitting
CN110445828B (en) Data distributed processing method based on Redis and related equipment thereof
EP3575968A1 (en) Method and device for synchronizing active transaction lists
KR101766790B1 (en) Method and computing apparatus for maniging main memory database
CN109446177B (en) Method and device for realizing number quota of directory files of distributed file system
CN104158858A (en) Method and system for accessing distributed cluster file system
US10795579B2 (en) Methods, apparatuses, system and computer program products for reclaiming storage units
CN102609466A (en) Method and system for controlling shared memory
CN109684292A (en) A kind of method that flash memory database quickly carries out data recovery
CN114218238A (en) Data storage method, system and application for recording complete change information of data
CN111694505B (en) Data storage management method, device and computer readable storage medium
CN111143113A (en) Method, electronic device and computer program product for copying metadata
CN102298560A (en) Equipment managing apparatus, equipment managing method, and equipment managing system
US10747438B1 (en) Reporting using archived data
CN110941436A (en) Data storage method and device of application program, storage medium and terminal equipment
CN111857556A (en) Method, apparatus and computer program product for managing metadata of storage objects
US20100030885A1 (en) Method and device for connection management in a telecommunication network
CN114036104A (en) Cloud filing method, device and system for re-deleted data based on distributed storage
CN110990394B (en) Method, device and storage medium for counting number of rows of distributed column database table
CN113254271A (en) Data sequence recovery method, device, equipment and storage medium
CN105095197A (en) Method and device for processing data
CN112468317A (en) Cluster topology updating method, system, equipment and computer storage medium

Legal Events

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