CN107590283A - A kind of file recovery method, device, server and computer-readable recording medium - Google Patents

A kind of file recovery method, device, server and computer-readable recording medium Download PDF

Info

Publication number
CN107590283A
CN107590283A CN201710912466.2A CN201710912466A CN107590283A CN 107590283 A CN107590283 A CN 107590283A CN 201710912466 A CN201710912466 A CN 201710912466A CN 107590283 A CN107590283 A CN 107590283A
Authority
CN
China
Prior art keywords
file
creation time
threshold value
metadata bucket
bucket
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.)
Granted
Application number
CN201710912466.2A
Other languages
Chinese (zh)
Other versions
CN107590283B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201710912466.2A priority Critical patent/CN107590283B/en
Publication of CN107590283A publication Critical patent/CN107590283A/en
Application granted granted Critical
Publication of CN107590283B publication Critical patent/CN107590283B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a kind of file recovery method, device, server and computer-readable recording medium, this method includes:When it is determined that user residual memory space deficiency when, by the memory space of the user have identical life cycle file be divided into a metadata bucket;For each metadata bucket, according to the life cycle of file in the metadata bucket, and the reduction parameter currently preserved, determine remaining corresponding to the metadata bucket to retain duration;According to current time, and remaining reservation duration corresponding to the metadata bucket, determine the first creation time threshold value corresponding to the metadata bucket;The first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value, and recovery creation time is no more than the file of the target creation time threshold value.In embodiments of the present invention, the not out of date file in the memory space of user can be reclaimed, so as to further discharge the residual memory space of user.

Description

A kind of file recovery method, device, server and computer-readable recording medium
Technical field
The present invention relates to technical field of data storage, more particularly to a kind of file recovery method, device, server and calculating Machine readable storage medium storing program for executing.
Background technology
Under normal circumstances, the number of disks of a set of video cloud storage system (hereinafter referred to as system) determines, overall system capacity Fixed, system is also certain for the active volume of each user configuration.As user uses the time growth of system, Yong Hu The data volume stored in system be possible to it is bigger, if the memory space that user has used be reached for its configuration active volume During the upper limit, or when the reason such as disk failure due to system causes the overall system capacity to reduce, it may appear that the remaining storage of user is empty Between insufficient situation, and when the active volume SC service ceiling for reaching system using capacity of system, system can face industry The risk that business stops, so as to which service can not be provided the user.
In order to ensure that system there are enough memory spaces to provide the user service, hardware can be used to expand in the prior art The mode of appearance increases the free memory of system, such as increases disk, but system is the active volume of each user configuration It is certain, even if the total capacity increase of system, although because the active volume distributed for user can also increase, has worked as user When the memory space used is reached for the active volume upper limit of its configuration, however it remains the feelings of user's residual memory space deficiency Condition, system can not still provide the user service.
Free memory except being increased system using dilatation, can also be by deleting file Free up Memory to increase The free memory of adding system, specifically, the structural representation of the file deleting system provided as shown in Figure 1 for prior art Scheme, the arrange parameter data module in this document deletion system sets the numerical value of the expiration parameters of Backup Data, wherein expired ginseng Number includes the preservation number of days that version preserves number and/or Backup Data, and data acquisition module obtains the expiration parameters of Backup Data Data, the first judge module be used for judge obtain the data whether there is more than set the expiration parameters number Value, if it is present stale data determination module is using the data of acquisition as stale data, scan module every predetermined period, Every disk tape is scanned, the proportional numerical value of often stale data on disk tape is obtained, if the second judge module judges institute To state proportional numerical value and exceed recovery threshold value, then space reclamation module moves to the valid data on corresponding tape in determined magnetic band, And deleted the scratch file in corresponding tape, if after the scratch file of whole has been deleted, however it remains user remains The situation of remaining memory space inadequate, then subsequent video cloud storage system still can not be that user continues offer service.
The content of the invention
The present invention provides a kind of file recovery method, device, server and computer-readable recording medium, existing to solve Have after scratch file has been deleted in technology, however it remains user's residual memory space deficiency the problem of.
The invention provides a kind of file recovery method, this method includes:
When it is determined that user residual memory space deficiency when, will there is identical life cycle in the memory space of the user File be divided into a metadata bucket;
For each metadata bucket, according to the life cycle of file in the metadata bucket, and the reduction parameter currently preserved, Determine remaining reservation duration corresponding to the metadata bucket;According to current time, and remaining reservation duration corresponding to the metadata bucket, Determine the first creation time threshold value corresponding to the metadata bucket;
The first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value, and recovery creates Time is no more than the file of the target creation time threshold value.
Further, the life cycle according to file in the metadata bucket, and the reduction parameter currently preserved, it is determined that The remaining duration that retains includes corresponding to the metadata bucket:
According to the life cycle of file in the metadata bucket, and reduction duration set in advance, determine that the metadata bucket is right The remaining reservation duration answered;Or
According to the life cycle of file in the metadata bucket, and the reduction ratio determined, determine corresponding to the metadata bucket Residue retains duration.
Further, the determination reduction ratio includes:
According to the use ratio of the memory space of presently described user and default recovery proportion threshold value, reduction gear ratio is determined Example;
The life cycle according to file in the metadata bucket, and the reduction ratio determined, determine that the metadata bucket is right The remaining duration that retains answered includes:
Determine the product of the life cycle of file and the reduction ratio in the metadata bucket;By file in the metadata bucket Life cycle and the difference of the product be defined as corresponding in the metadata bucket remaining retaining duration.
Further, the life cycle according to file in the metadata bucket, and the reduction parameter currently preserved, it is determined that Before remaining reservation duration corresponding to the metadata bucket, methods described also includes:
According to the recovered frequency currently preserved, the reduction parameter currently preserved is updated;
After the recovery creation time is no more than the file of the target creation time threshold value, methods described also includes:
Judge whether the residual memory space of the user is insufficient;
If it is, the recovered frequency currently preserved is updated;If not, the recovered frequency currently preserved is reverted to Initial value.
Further, the first creation time threshold value corresponding to each metadata bucket of the basis, determines target creation time After threshold value, before recovery creation time is no more than the file of the target creation time threshold value, methods described also includes:
In the memory space of the user, the earliest file of creation time is chosen as file destination;
According to the recovery stream control value pre-saved, and the creation time of the file destination, the second creation time threshold is determined Value;
Judge whether the second creation time threshold value is no more than the target creation time threshold value;
If it is, according to the second creation time threshold value, the target creation time threshold value is updated.
Further, the file that the recovery creation time is no more than the target creation time threshold value includes:
In the file to be recycled that creation time is no more than the target creation time, when recovery preserves duration more than setting The file of long threshold value.
Further, it is determined that after the residual memory space deficiency of user, will there is phase in the memory space of the user With life cycle file be divided into a metadata bucket before, methods described also includes:
Judge file recovery whether was carried out in the preset time range before current time;
If not, carry out subsequent step.
The invention provides a kind of file retracting device, the device includes:
Monitoring module, for judging whether the residual memory space of user is insufficient;
Enabled module, for when the judged result of the monitoring module is is, will have in the memory space of the user The file for having identical life cycle is divided into a metadata bucket;For each metadata bucket, according to metadata bucket Chinese The life cycle of part, and the reduction parameter currently preserved, determine remaining reservation duration corresponding to the metadata bucket;According to it is current when Between, and remaining reservation duration corresponding to the metadata bucket, determine the first creation time threshold value corresponding to the metadata bucket;According to every First creation time threshold value corresponding to individual metadata bucket, determines target creation time threshold value;
Recycling module, the file of the target creation time threshold value is no more than for reclaiming creation time.
Further, the enabled module, specifically for the life cycle according to file in the metadata bucket, and set in advance Fixed reduction duration, determine corresponding remaining reservation duration in the metadata bucket;Or the life according to file in the metadata bucket Cycle, and the reduction ratio determined, determine corresponding remaining reservation duration in the metadata bucket.
Further, the enabled module, specifically for the use ratio of the memory space according to presently described user And default recovery proportion threshold value, determine reduction ratio;The life cycle according to file in the metadata bucket, and determine Reduction ratio, determine that the corresponding remaining duration that retains includes in the metadata bucket:Determine the Life Cycle of file in the metadata bucket Phase and the product of the reduction ratio;The life cycle of file in the metadata bucket and the difference of the product are defined as this yuan Corresponding remaining reservation duration in data bucket.
Further, the enabled module, it is additionally operable to according to the recovered frequency currently preserved, the reduction currently preserved is joined Number is updated;
The enabled module, it is additionally operable to the file that the recovery creation time is no more than the target creation time threshold value Afterwards, when the judged result of the monitoring module is is, the recovered frequency currently preserved is updated;When the monitoring module Judged result for it is no when, the recovered frequency currently preserved is reverted into initial value.
Further, the enabled module, is additionally operable in the memory space of the user, and it is earliest to choose creation time File is as file destination;According to the recovery stream control value pre-saved, and the creation time of the file destination, the second wound is determined Build time threshold;Judge whether the second creation time threshold value is no more than the target creation time threshold value;If it is, according to The second creation time threshold value, update the target creation time threshold value.
Further, the recycling module, specifically for being no more than treating back for the target creation time in creation time In message in-coming part, recovery preserves the file that duration exceedes setting duration threshold value.
Further, the enabled module, the judged result being additionally operable in the monitoring module are after being, when judging current Between before preset time range in whether carried out file recovery;If not, will there is phase in the memory space of the user File with life cycle is divided into a metadata bucket.
The invention provides a kind of server, including processor, communication interface, memory and communication bus, wherein, processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for depositing computer program;
Processor, during for performing the program deposited on memory, realize the method and step described in any of the above-described.
The invention provides a kind of computer-readable recording medium, the computer-readable recording medium internal memory contains calculating Machine program, the computer program realize the method and step described in any of the above-described when being executed by processor.
The invention provides a kind of file recovery method, device, server and computer-readable recording medium, this method bag Include:When it is determined that user residual memory space deficiency when, will in the memory space of the user have identical life cycle text Part is divided into a metadata bucket;For each metadata bucket, according to the life cycle of file in the metadata bucket, and currently The reduction parameter of preservation, determine remaining reservation duration corresponding to the metadata bucket;According to current time, and the metadata bucket is corresponding It is remaining retain duration, determine the first creation time threshold value corresponding to the metadata bucket;According to corresponding to each metadata bucket One creation time threshold value, determines target creation time threshold value, and recovery creation time is no more than the target creation time threshold value File.In embodiments of the present invention, the file for having identical life cycle in the memory space of user is divided into one by server In individual metadata bucket, according to the life cycle of file in each metadata bucket, and the reduction parameter currently preserved, it is determined that each member First creation time threshold value corresponding to data bucket, so that it is determined that target creation time threshold value, creation time is created no more than target The file recovery of time threshold is built, by reducing parameter, the life cycle of each file is in a disguised form reduced, can reclaim user's Not out of date file in memory space, so as to further discharge the residual memory space of user.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the structural representation for the file deleting system that prior art provides;
Fig. 2A is a kind of schematic diagram for file removal process that the embodiment of the present invention 1 provides;
Fig. 2 B are a kind of schematic diagram for file removal process that the embodiment of the present invention 3 provides;
Fig. 3 A are a kind of schematic diagram for file removal process that the embodiment of the present invention 4 provides;
Fig. 3 B are a kind of process schematic for file recovery that the embodiment of the present invention 5 provides;
Fig. 4 is a kind of server schematic diagram that the embodiment of the present invention 6 provides;
Fig. 5 is a kind of file retracting device schematic diagram provided in an embodiment of the present invention.
Embodiment
In order to reclaim the not out of date file in the memory space of user, user's residual memory space, this hair are further discharged Bright embodiment provides a kind of file recovery method, device, server and computer-readable recording medium.
In order that the object, technical solutions and advantages of the present invention are clearer, make below in conjunction with the accompanying drawing present invention into one It is described in detail on step ground, it is clear that described embodiment is only the part of the embodiment of the present invention, rather than whole implementation Example.Based on the embodiment in the present invention, what those of ordinary skill in the art were obtained under the premise of creative work is not made Every other embodiment, belongs to the scope of protection of the invention.
Embodiment 1:
Fig. 2A is a kind of schematic diagram of file removal process provided in an embodiment of the present invention, and the process comprises the following steps:
S201:When it is determined that user residual memory space deficiency when, will there is identical life in the memory space of the user The file in life cycle is divided into a metadata bucket.
File recovery method provided in an embodiment of the present invention is applied to server, and the server disposition is in video cloud storage system In system, and the server can be managed to the file in the memory space of user.
Server carries out cutting division using user as unit in video cloud storage system to overall system capacity, is each User distributes single memory space, different user is independent of each other using same video cloud storage system storage file.Service Device can distribute memory space or other memory nodes in video cloud storage system in self EMS memory for user In for user distribute memory space.The file preserved in the memory space of user can be video file, or text text The other kinds of file such as part.
Server can be when when a certain user's storage file into memory space, determine that user's residual memory space is It is no deficiency or at set time intervals, determine user's residual memory space whether deficiency or in fixation Time point, determine user's residual memory space whether deficiency etc..
When user's storage file into video cloud storage system, server can record the file size of this document simultaneously. Therefore each file that server can store according to the user, determine that the user of the user uses memory space.
Server can use memory space according to the memory space for user's distribution and user, determine that user's is surplus Whether remaining memory space is insufficient.Specifically, when can be storage threshold value that user has reached setting using memory space, server The residual memory space deficiency of user is determined, wherein the storage threshold value set pre-saves in the server, the storage threshold of setting It is worth for any number no more than the memory space distributed for user;Can also be that user is divided using memory space and for user When the ratio for the memory space matched somebody with somebody reaches the fractional threshold of setting, server determines the residual memory space deficiency of user, wherein The fractional threshold of setting, which pre-saves, in the server, sets fractional threshold as the positive number no more than 1, and such as 0.9 or 0.95.
Life cycle corresponding to each file is preserved in server, therefore server can be by the memory space of user File with identical life cycle is divided into a metadata bucket, that is to say, that metadata bucket is with identical life cycle File set.
Certainly, in order to save internal memory and disk space, server can also according to corresponding to each file life cycle and The setting of user, at least one metadata bucket is created in the memory space of user in advance, wherein each metadata bucket corresponding one Individual life cycle, according to the life cycle of file to be stored, file is saved in and its life cycle identical metadata bucket In, because file and the metadata bucket of the preservation have identical life cycle, such server is just without being each file Life cycle corresponding to storage, only preserve the life cycle of each metadata bucket.
Life cycle corresponding to the file preserved in server can be that acquiescence or user are set.Specifically Can be, if server receives user and is directed to the life cycle that some file is set, the life cycle that user is set , can if server is not received by user and is directed to the life cycle that some file is set as the life cycle of this document Using the life cycle using acquiescence as the life cycle of this document, wherein the life cycle given tacit consent to can be any, normal conditions Under, the life cycle of acquiescence is endless, and user can be configured when setting life cycle in units of day.
S202:For each metadata bucket, according to the life cycle of file in the metadata bucket, and the reduction currently preserved Parameter, determine remaining reservation duration corresponding to the metadata bucket;According to current time, and remaining reservation corresponding to the metadata bucket Duration, determine the first creation time threshold value corresponding to the metadata bucket.
Because the file with identical life cycle is divided into a metadata bucket by server, therefore according to each member The life cycle of file in data bucket, it may be determined that the life cycle of each metadata bucket.Server is directed to each metadata bucket, According to the life cycle of file in the metadata bucket, when determining the life cycle of the metadata bucket, the metadata bucket can be selected In any one file life cycle of the life cycle as the metadata bucket because being directed to each metadata bucket, this yuan The file preserved in data bucket has identical life cycle, then no matter selects which file, can represent the metadata bucket In each file life cycle, and the life cycle of the metadata bucket can be represented, therefore in embodiments of the present invention To the life cycle according to which of metadata bucket file, determine that the life cycle of the metadata bucket does not limit.
For each metadata bucket, the file in the metadata bucket is all the file after division, therefore server is true It is that the file after the division in the metadata bucket determines during the life cycle of the fixed metadata bucket.
Reduction parameter is preserved in server, therefore server can be directed to each metadata bucket, according to the metadata bucket The life cycle of middle file, and the reduction parameter currently preserved, determine remaining reservation duration corresponding to the metadata bucket.Server It is determined that the remaining duration that retains is to reduce the life cycle of each metadata bucket corresponding to each metadata bucket, covert shortening is every The life cycle of each file in individual metadata bucket, reach the purpose for reclaiming not out of date file.
Server can be according to current time, and residue corresponding to each metadata bucket retains duration, it is determined that each first number According to the first creation time threshold value corresponding to bucket.
S203:The first creation time threshold value according to corresponding to each metadata bucket, target creation time threshold value is determined, reclaimed Creation time is no more than the file of the target creation time threshold value.
Server first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value, can To be in the first creation time threshold value corresponding to each metadata bucket, the first maximum creation time threshold value is chosen as target Creation time threshold value, can be the first establishment that minimum is chosen in the first creation time threshold value corresponding to each metadata bucket Time threshold is as target creation time threshold value etc., or server is in the first creation time threshold corresponding to each metadata bucket In value, median is selected, using the median as target creation time threshold value etc., maximum of which the first creation time threshold value For near the first creation time threshold value of current time, the i.e. first creation time threshold minimum with the time difference of current time Value, the first minimum creation time threshold value are the first creation time threshold value maximum with the time difference of current time.
When user's storage file into video cloud storage system, server can record the creation time of this document simultaneously, The file that creation time in the memory space of user is no more than target creation time threshold value by server is reclaimed, specifically literary The creation time of part is represented with Tc, target creation time threshold value TLimit, files of the Tc earlier than TLimit is reclaimed.For example, Target creation time threshold value TLimit is August in 2017 20, and the creation time of a certain file is on May 20th, 2017, this article The creation time of part reclaims this document earlier than target creation time threshold value, then server.
If server is in the first creation time threshold value corresponding to each metadata bucket, the first establishment of maximum is chosen Time threshold is as target creation time threshold value, and if the life cycle of a certain metadata bucket is endless, then this yuan of number Current time is leveled off to according to the first creation time threshold value corresponding to bucket, so in file removal process, life cycle is unlimited Long metadata bucket is not involved in the determination of the first creation time threshold value, and life cycle is the text in the metadata bucket of endless Part can be not involved in reclaiming, that is to say, that not reclaim the file that life cycle is endless.
Can directly delete file when server reclaims the file in the memory space of user.When user is to video In cloud storage system during storage file, server can record the file type of this document simultaneously, so if server is to be recycled File be video file, then can also fade from memory technology using video to carry out file recovery, specifically, video fades from memory technology and is Frame is taken out to video file, lowers the size of video file, so as to realize the recovery of file.The process that frame is taken out to video file belongs to Prior art, do not repeat in embodiments of the present invention.
File recovery method provided in an embodiment of the present invention can both be reclaimed for scratch file, can also be directed to not Scratch file is reclaimed.It is of course also possible to use the scratch file in the memory space of prior art recovery user, when expired After file is deleted, when user's residual memory space is still insufficient, returned using the file recovery method provided in the embodiment of the present invention Receive not out of date file.
In embodiments of the present invention, the file for having identical life cycle in the memory space of user is divided into a member In data bucket, according to the life cycle of file in each metadata bucket, and the reduction parameter currently preserved, it is determined that each metadata First creation time threshold value of bucket, so that it is determined that target creation time threshold value, is no more than target creation time threshold by creation time The file recovery of value, by reducing parameter, in a disguised form reduces the life cycle of each file, can reclaim the memory space of user In not out of date file, so as to further discharge user residual memory space.
Embodiment 2:
On the basis of above-described embodiment, in the embodiment of the present invention, the Life Cycle according to file in the metadata bucket Phase, and the reduction parameter currently preserved, determine that the remaining duration that retains includes corresponding to the metadata bucket:
According to the life cycle of file in the metadata bucket, and reduction duration set in advance, determine that the metadata bucket is right The remaining reservation duration answered;Or
According to the life cycle of file in the metadata bucket, and the reduction ratio determined, determine corresponding to the metadata bucket Residue retains duration.
By different reduction strategies in the embodiment of the present invention, to determine remaining reservation duration corresponding to metadata bucket.
Specifically, at least two reduction strategies are provided in the embodiment of the present invention:Deng time reduction strategy and equal proportion contracting Subtracting strategy etc., its medium while reduction strategy is i.e. according to reduction duration set in advance, it is determined that the reduction parameter currently preserved, etc. Scaled down strategy is the reduction ratio according to determination, it is determined that the reduction parameter currently preserved.
Server using reduce strategy determine it is remaining corresponding to metadata bucket retain duration, the time reduction such as can use Strategy, equal proportion reduction strategy can also be used, if preserving above two reduction strategy in server, specifically be contracted in selection Can be that server is selected according to own service demand or server prompts user is selected when subtracting strategy.
Reduction duration set in advance is preserved in server, using reduction duration set in advance, that is, waits time reduction Strategy can ensure that the file under the longer metadata bucket of life cycle is eliminated the latest.Specifically, server can be by each The life cycle of file in data bucket, the difference with reduction duration set in advance, it is defined as remaining corresponding to each metadata bucket Remaining reservation duration, i.e., the remaining life cycle-pre- for retaining file in duration=each metadata bucket corresponding to each metadata bucket The reduction duration first set.
Server can ensure different metadata under same user using the reduction ratio determined, i.e. equal proportion reduction strategy File in bucket is removed in a file removal process to be completed.
Reduction ratio can be fixed or be determined according to the use ratio of the memory space of user, such as Fruit reduction ratio is fixed, then reduction ratio can pre-save in the server, and server is according in each metadata bucket The difference of the product of the life cycle of file in the life cycle of file, with the reduction ratio pre-saved and each metadata bucket Value, it is determined that the remaining of each metadata bucket retains duration, i.e., residue corresponding to each metadata bucket retains duration=each first number According to the life cycle of file in each metadata of reduction ratio * of the life cycle-pre-save of file in bucket.
If reduction ratio is to use ratio-dependent, the determination reduction ratio bag according to the memory space of user Include:
According to the use ratio of the memory space of presently described user and default recovery proportion threshold value, reduction gear ratio is determined Example;
The life cycle according to file in the metadata bucket, and the reduction ratio determined, determine that the metadata bucket is right The remaining duration that retains answered includes:
Determine the product of the life cycle of file and the reduction ratio in the metadata bucket;By file in the metadata bucket Life cycle and the difference of the product be defined as that the metadata bucket is corresponding remaining to retain duration.I.e. corresponding to the data bucket Residue retain the duration=metadata bucket in file life cycle-(use ratio of the memory space of presently described user- Default recovery proportion threshold value) life cycle of file in the * metadata buckets.
Because in the embodiment of the present invention, server reduces parameter by determining, it is determined that remaining corresponding to metadata bucket to protect Duration is stayed, so as to reduce the life cycle of each metadata bucket, so as to be reclaimed to the file in the memory space of user, It ensure that the abundance of user's residual memory space, and cloud storage system can provide the user service.
Embodiment 3:
On the basis of the various embodiments described above, in the embodiment of the present invention, the life according to file in the metadata bucket Cycle, and the reduction parameter currently preserved, before determining remaining reservation duration corresponding to the metadata bucket, methods described is also wrapped Include:
According to the recovered frequency currently preserved, the reduction parameter currently preserved is updated;
After the recovery creation time is no more than the file of the target creation time threshold value, methods described also includes:
Judge whether the residual memory space of the user is insufficient;
If it is, the recovered frequency currently preserved is updated;If not, the recovered frequency currently preserved is reverted to Initial value.
Server updates reduction parameter by recovered frequency in the embodiment of the present invention so that according to recovered frequency, adjusts back The quantity of message in-coming part, further ensure the abundance of user's residual memory space.
Current recovered frequency is preserved in server, can be to currently preserving according to the recovered frequency currently preserved Reduction parameter is updated.Specifically, server is carried out according to the recovered frequency currently preserved to the reduction parameter currently preserved Renewal, it can be according to the recovered frequency currently preserved, the reduction parameter currently preserved is increased or decreased to the numerical value of setting, can According to the recovered frequency currently preserved and the product of the reduction parameter currently preserved, to be carried out more to the reduction parameter currently preserved It is new etc..
As each file reclaims, the recovered frequency currently preserved is changed, can be by the quantity increasing of each recovery fiel It is more, so it is preferred that server according to the recovered frequency currently preserved, the process being updated to the reduction parameter currently preserved According to the recovered frequency currently preserved and the product of the reduction parameter currently preserved, to be carried out to the reduction parameter currently preserved Renewal, can be the product of the recovered frequency that will currently preserve and the reduction parameter currently preserved, after being defined as renewal specifically Reduction parameter.
If by the recovered frequency currently preserved and the product of the reduction parameter currently preserved, the contracting being defined as after renewal Subtract parameter, then it is specifically, remaining corresponding to the metadata bucket to retain duration=metadata bucket Chinese for each metadata bucket The recovered frequency that the life cycle of part-reduction set in advance duration * is currently preserved;Or remaining reservation corresponding to the metadata bucket The life cycle of file-(use ratio of the memory space of presently described user-default time in the duration=metadata bucket Receive proportion threshold value) the life cycle * of file is currently preserved in the * metadata buckets recovered frequency.
In order to ensure to adjust the quantity of recovery fiel, then server is reclaimed with each file, can all change current preservation Recovered frequency, specifically, server every time to the file recovery in the memory space of user after, judge that the storage of the user is empty Between whether deficiency, if the memory space of the user is still insufficient, need to be carried out continuously next time file recovery, in order to ensure The quantity of recovery fiel next time is adjusted, then the recovered frequency currently preserved is updated;If the memory space of the user Abundance, then file recovery next time need not be carried out continuously, in order to which the quantity reclaimed to later file does not impact, then will The recovered frequency currently preserved reverts to initial value.
Server is updated to the recovered frequency currently preserved, can increase the recovered frequency currently preserved to add deduct Number set less etc..Can be by the recovered frequency currently preserved increase to ensure the increasing number of each recovery fiel The number of setting, the number of setting pre-save in the server, and the number of setting can be the positive counts such as 1,2 or 5, preferably Ground, the recovered frequency currently preserved is added 1.
Initial value pre-saves in the server, and initial value can be the positive counts such as 1,2 or 3, it is preferred that initial value is 1。
Server, just can be to recovery only after the completion of recovery creation time is no more than the file of target creation time threshold value Number is updated or recovered.If exception occurs during recovery fiel in server, recovery creation time is no more than mesh The file of mark creation time threshold value is not completed, then keeps the recovered frequency that currently preserves constant.
The embodiment of the present invention is illustrated with a specific embodiment below, Fig. 2 B are provided in an embodiment of the present invention A kind of schematic diagram of file removal process, comprises the following steps:
S21:When it is determined that user residual memory space deficiency when, will there is identical life in the memory space of the user The file in cycle is divided into a metadata bucket.
S22:According to the recovered frequency currently preserved, the reduced degree currently preserved is updated;For each first number According to bucket, according to the reduction parameter after the life cycle of file in the metadata bucket, and renewal, determine to remain corresponding to the metadata bucket Remaining reservation duration.
For each metadata bucket, according to the reduction parameter after the life cycle of file in the metadata bucket, and renewal, really It is remaining corresponding to the fixed metadata bucket to retain duration, be specially:It is remaining corresponding to the metadata bucket to retain the duration=metadata The recovered frequency that life cycle-reduction set in advance duration * of file is currently preserved in bucket;Or remained corresponding to the metadata bucket The remaining life cycle-(use ratio of the memory space of presently described user-pre- for retaining file in the duration=metadata bucket If recovery proportion threshold value) the life cycle * of file is currently preserved in the * metadata buckets recovered frequency, wherein after renewal Reduction parameter is the recovered frequency that reduction duration * set in advance is currently preserved, or the reduction parameter after renewal is (presently described The use ratio of the memory space of user-default recovery proportion threshold value) the life cycle * of file works as in the * metadata buckets The recovered frequency of preceding preservation.
S23:According to current time, and remaining reservation duration corresponding to each metadata bucket, it is determined that each metadata bucket is right The the first creation time threshold value answered.
S24:The first creation time threshold value according to corresponding to each metadata bucket, target creation time threshold value is determined, reclaimed Creation time is no more than the file of the target creation time threshold value.
S25:Judge whether the residual memory space of the user is insufficient;If it is, S26 is carried out, if not, carrying out S27.
S26:The recovered frequency currently preserved is updated, returns to S22.
S27:The recovered frequency currently preserved is reverted into initial value.
Because server updates reduction parameter by recovered frequency in the embodiment of the present invention so that according to recovered frequency, adjust The quantity of whole recovery fiel, further ensure the abundance of user's residual memory space.
Embodiment 4:
In order to which ensure will not be to causing excessive performance burden, on the basis of the various embodiments described above in video cloud storage system On, in the embodiment of the present invention, the first creation time threshold value corresponding to each metadata bucket of basis, determine target creation time After threshold value, before recovery creation time is no more than the file of the target creation time threshold value, methods described also includes:
In the memory space of the user, the earliest file of creation time is chosen as file destination;
According to the recovery stream control value pre-saved, and the creation time of the file destination, the second creation time threshold is determined Value;
Judge whether the second creation time threshold value is no more than the target creation time threshold value;
If it is, according to the second creation time threshold value, the target creation time threshold value is updated.
Server uses the second creation time threshold value determined according to the recovery stream control value pre-saved, when being created to target Between threshold value be updated, avoid and disposably reclaim excessive file, so as to video cloud storage system will not be caused it is excessive Performance burden.
Server is in the first creation time threshold value according to corresponding to each metadata bucket, after determining target creation time, In the memory space of user, the earliest file of creation time is chosen as file destination.
Recovery stream control value pre-saves in the server, and recovery stream control value can be 3,5 or 10 etc..
Server determines the second creation time threshold value according to recovery stream control value and the creation time of file destination.Server Judge whether the second creation time threshold value is no more than target creation time threshold value, if it is, thinking with target creation time value The quantity of recovery fiel is excessive, then according to the second creation time threshold value, more fresh target creation time threshold value, with the target after renewal Creation time reclamation thresholds file;If server judges the recovery of the second creation time, threshold value exceedes target creation time threshold value, Then keep the target creation time threshold value that currently preserves constant, directly according to target creation time reclamation thresholds file.
Server can directly be created second according to the second creation time threshold value, more fresh target creation time threshold value Time threshold is as target creation time threshold value or according to the second creation time threshold value, by target creation time threshold value Reduce the time of setting.
The embodiment of the present invention is illustrated with a specific embodiment below, Fig. 3 A are provided in an embodiment of the present invention A kind of schematic diagram of file removal process, comprises the following steps:
S3001:When it is determined that user residual memory space deficiency when, will there is identical life in the memory space of the user The file in life cycle is divided into a metadata bucket.
S3002:According to the recovered frequency currently preserved, the reduced degree currently preserved is updated;For each member Data bucket, according to the reduction parameter after the life cycle of file in the metadata bucket, and renewal, determine corresponding to the metadata bucket Residue retains duration.
S3003:According to current time, and remaining reservation duration corresponding to each metadata bucket, it is determined that each metadata bucket Corresponding first creation time threshold value.
S3004:The first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value.
S3005:In the memory space of the user, the earliest file of creation time is chosen as file destination;According to The recovery stream control value pre-saved, and the creation time of the file destination, determine the second creation time threshold value;Judge described Whether two creation time threshold values are no more than the target creation time threshold value;If it is, carry out S3006;If not, carry out S3007。
S3006:According to the second creation time threshold value, the target creation time threshold value is updated;Carry out S3008.
S3007:Keep current goal creation time threshold value constant.
S3008:Reclaim the file that creation time is no more than the target creation time threshold value.
S3009:Judge whether the residual memory space of the user is insufficient;If it is, S3010 is carried out, if not, carrying out S3011。
S3010:The recovered frequency currently preserved is updated, returns to S3002.
S3011:The recovered frequency currently preserved is reverted into initial value.
Due to when the second creation time threshold value that server determines according to the recovery stream control value pre-saved creates to target Between threshold value be updated, ensure that file is divided into the recovery of multiple batches of, more periods, video cloud storage system will not be caused More performance burdens, while ensure that all files for meeting former target need not be deleted, that is, deleting a small amount of file, you can ensure The abundance of the memory space of user.
Embodiment 5:
In order to which the file ensured in a period of time being newly written will not be recovered, on the basis of the various embodiments described above, In the embodiment of the present invention, the file that the recovery creation time is no more than the target creation time threshold value includes:
In the file to be recycled that creation time is no more than the target creation time, when recovery preserves duration more than setting The file of long threshold value.
Server it is determined that creation time be no more than target creation time file to be recycled after, in file to be recycled Recovery preserves the file that duration exceedes setting duration threshold value, and the file that preservation duration is no more than setting duration threshold value is not recovered, The file in a period of time that can ensure to be newly written will not be recovered.
Setting duration threshold value pre-saves in the server, and setting duration threshold value can be 3,5 or 10 etc..
Under normal circumstances, server can have delayed deletion in recovery fiel, and in order to avoid due to even It is continuous that file is reclaimed for a long time, caused by video cloud storage system it is unstable, it is determined that the residual memory space deficiency of user Afterwards, before the file in the memory space of the user with identical life cycle is divided into a metadata bucket, institute Stating method also includes:
Judge file recovery whether was carried out in the preset time range before current time;
If not, carry out subsequent step.
Preset time range pre-saves in the server, and default time range can be 30 minutes, 1 hour etc..
Server is identical that will have in the memory space of the user it is determined that after the residual memory space deficiency of user Before the file of life cycle is divided into a metadata bucket, current time is obtained, during default before judging current time Between in the range of whether carried out file recovery, if it is, think the also unrecovered completion of last file, then returned without file Receive, continue to determine whether the residual memory space of user is insufficient;If server judges the preset time model before current time File recovery was not carried out in enclosing, then current video cloud storage system is relatively stable, can carry out subsequent step, completes file and returns Receive.
When it is determined that user residual memory space deficiency after, in the preset time range before judging current time whether Before carrying out file recovery, methods described also includes:
According to the memory space of the user, the memory space whether user allows itself to reclaim the user is judged In file;If it is, carry out subsequent step.
In order to further improve the experience of user, then when being reclaimed for the file in the memory space of user, it is necessary to User is authorized to file recovery, and user can be authorized before the recovery of each file or only once be awarded Power etc..If user authorizes, illustrate the file in the memory space that the user allows server to reclaim the user, work as server When determining the memory space inadequate of user, the file in the memory space of the user is reclaimed, if user's with no authorized, says The bright user does not allow server to reclaim the file in the memory space of the user, when server determines the memory space of user not When sufficient, the file in the memory space of the user will not also be reclaimed.
Certainly, if the server determine that the memory space inadequate of active user, and current time carries out file recovery, Then ignore the determination result of this time;Until after the completion of the recovery of this file, if server still determines the memory space of user not Foot, then just carry out the file recovery of a wheel.
The various embodiments described above are illustrated with a specific embodiment below, Fig. 3 B are provided in an embodiment of the present invention A kind of process schematic of file recovery, comprises the following steps:
S301:When it is determined that user residual memory space deficiency after, judge in the preset time range before current time Whether file recovery was carried out;If not, carry out S302.
If the server determine that file recovery was carried out in preset time range before current time, then without file Recovery, continue to determine whether the residual memory space of user is insufficient, and device to be serviced determines the preset time model before current time File recovery was not carried out in enclosing, carries out S302.
S302:The file for having identical life cycle in the memory space of the user is divided into a metadata bucket In.
S303:According to the recovered frequency currently preserved, the reduced degree currently preserved is updated;For each first number According to bucket, according to the reduction parameter after the life cycle of file in the metadata bucket, and renewal, determine to remain corresponding to the metadata bucket Remaining reservation duration.
S304:According to current time, and remaining reservation duration corresponding to each metadata bucket, it is determined that each metadata bucket is right The the first creation time threshold value answered.
S305:The first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value.
S306:In the memory space of the user, the earliest file of creation time is chosen as file destination;According to pre- The recovery stream control value first preserved, and the creation time of the file destination, determine the second creation time threshold value;Judge described second Whether creation time threshold value is no more than the target creation time threshold value;If it is, carry out S307;If not, carry out S308.
S307:According to the second creation time threshold value, the target creation time threshold value is updated, carries out S309.
S308:Keep current target creation time threshold value constant.
S309:In the file to be recycled that creation time is no more than the target creation time, recovery preserves duration and exceeded Set the file of duration threshold value.
S310:Judge whether the residual memory space of the user is insufficient;If it is, S311 is carried out, if not, carrying out S312。
S311:The recovered frequency currently preserved is updated, returns to S303.
S312:The recovered frequency currently preserved is reverted into initial value.
Due to server it is determined that creation time be no more than target creation time file to be recycled after, in text to be recycled Recovery preserves the file that duration exceedes setting duration threshold value in part, and the file that preservation duration is no more than setting duration threshold value is not returned Receive, it is ensured that the file in a period of time being newly written will not be recovered.
Embodiment 6:
A kind of server is additionally provided on the basis of the various embodiments described above, in the embodiment of the present invention, as shown in figure 4, bag Include:Processor 401, communication interface 402, memory 403 and communication bus 404, wherein, processor 401, communication interface 402, deposit Reservoir 403 completes mutual communication by communication bus 404;
Computer program is stored with the memory 403, when described program is performed by the processor 401 so that The processor 401 performs following steps:
When it is determined that user residual memory space deficiency when, will there is identical life cycle in the memory space of the user File be divided into a metadata bucket;
For each metadata bucket, according to the life cycle of file in the metadata bucket, and the reduction parameter currently preserved, Determine remaining reservation duration corresponding to the metadata bucket;According to current time, and remaining reservation duration corresponding to the metadata bucket, Determine the first creation time threshold value corresponding to the metadata bucket;
The first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value, and recovery creates Time is no more than the file of the target creation time threshold value.
Based on same inventive concept, a kind of server is additionally provided in the embodiment of the present invention, because above-mentioned server solves The principle of problem is similar to file recovery method, therefore the implementation of above-mentioned server may refer to the implementation of method, repeats part Repeat no more.
The communication bus that above-mentioned server is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or EISA (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc..For just Only represented in expression, figure with a thick line, it is not intended that an only bus or a type of bus.
The communication that communication interface 402 is used between above-mentioned server and other equipment.
Memory can include random access memory (Random Access Memory, RAM), can also include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Alternatively, memory may be used also To be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit, network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), special collection Into circuit, field programmable gate array either other PLDs, discrete gate or transistor logic, discrete hard Part component etc..
During the program deposited in embodiments of the present invention on computing device memory, realize the memory space of user In have identical life cycle file be divided into a metadata bucket, according to the Life Cycle of file in each metadata bucket Phase, and the reduction parameter currently preserved, it is determined that the first creation time threshold value corresponding to each metadata bucket, so that it is determined that target is created Time threshold is built, the file that creation time is no more than to target creation time threshold value reclaims, and by reducing parameter, in a disguised form reduces The life cycle of each file, so as to be reclaimed to the file in the memory space of user, the storage that can reclaim user is empty Between in not out of date file, so as to further discharge user residual memory space.
Embodiment 7:
On the basis of the various embodiments described above, the embodiment of the present invention additionally provides a kind of computer storage readable storage medium Matter, the computer-readable recording medium internal memory contains the computer program that can be performed by electronic equipment, when described program is in institute State when being run on electronic equipment so that the electronic equipment realizes following steps when performing:
When it is determined that user residual memory space deficiency when, will there is identical life cycle in the memory space of the user File be divided into a metadata bucket;
For each metadata bucket, according to the life cycle of file in the metadata bucket, and the reduction parameter currently preserved, Determine remaining reservation duration corresponding to the metadata bucket;According to current time, and remaining reservation duration corresponding to the metadata bucket, Determine the first creation time threshold value corresponding to the metadata bucket;
The first creation time threshold value according to corresponding to each metadata bucket, determines target creation time threshold value, and recovery creates Time is no more than the file of the target creation time threshold value.
Based on same inventive concept, a kind of computer-readable recording medium is additionally provided in the embodiment of the present invention, due to place Reason device solves the principle of problem in the computer program stored on performing above computer readable storage medium storing program for executing and file reclaims Method is similar, therefore processor may refer in the implementation for the computer program for performing the storage of above computer readable storage medium storing program for executing The implementation of method, repeat part and repeat no more.
Above computer readable storage medium storing program for executing can be any usable medium that the processor in electronic equipment can access Or data storage device, including but not limited to magnetic storage such as floppy disk, hard disk, tape, magneto-optic disk (MO) etc., optical memory Such as CD, DVD, BD, HVD and semiconductor memory such as ROM, EPROM, EEPROM, nonvolatile memory (NAND FLASH), solid state hard disc (SSD) etc..
The computer-readable recording medium memory storage computer program provided in embodiments of the present invention, computer program quilt Realized during computing device and the file for having identical life cycle in the memory space of user be divided into a metadata bucket, According to the life cycle of file in each metadata bucket, and the reduction parameter currently preserved, it is determined that corresponding to each metadata bucket First creation time threshold value, so that it is determined that target creation time threshold value, is no more than target creation time threshold value by creation time File reclaims, and by reducing parameter, the life cycle of each file is in a disguised form reduced, in the memory space that can reclaim user Not out of date file, so as to further discharge the residual memory space of user.
Fig. 5 is a kind of file retracting device schematic diagram provided in an embodiment of the present invention, and the device includes:
Monitoring module 51, for judging whether the residual memory space of user is insufficient;
Enabled module 52, for when the judged result of the monitoring module is is, by the memory space of the user File with identical life cycle is divided into a metadata bucket;For each metadata bucket, according in the metadata bucket The life cycle of file, and the reduction parameter currently preserved, determine remaining reservation duration corresponding to the metadata bucket;According to current Time, and remaining reservation duration corresponding to the metadata bucket, determine the first creation time threshold value corresponding to the metadata bucket;According to First creation time threshold value corresponding to each metadata bucket, determines target creation time threshold value;
Recycling module 53, the file of the target creation time threshold value is no more than for reclaiming creation time.
The enabled module 52, specifically for the life cycle according to file in the metadata bucket, and contracting set in advance Subtract duration, determine corresponding remaining reservation duration in the metadata bucket;Or the life cycle according to file in the metadata bucket, and The reduction ratio of determination, determine corresponding remaining reservation duration in the metadata bucket.
The enabled module 52, use ratio specifically for the memory space according to presently described user and default Proportion threshold value is reclaimed, determines reduction ratio;The life cycle according to file in the metadata bucket, and the reduction gear ratio determined Example, determine that the corresponding remaining duration that retains includes in the metadata bucket:Determine the life cycle of file and institute in the metadata bucket State the product of reduction ratio;The life cycle of file in the metadata bucket and the difference of the product are defined as the metadata bucket In corresponding remaining retain duration.
The enabled module 52, it is additionally operable to according to the recovered frequency currently preserved, the reduction parameter currently preserved is carried out Renewal;
The enabled module 52, it is additionally operable to the file that the recovery creation time is no more than the target creation time threshold value Afterwards, when the judged result of the monitoring module is is, the recovered frequency currently preserved is updated;When the monitoring module Judged result for it is no when, the recovered frequency currently preserved is reverted into initial value.
The enabled module 52, is additionally operable in the memory space of the user, chooses the earliest file of creation time and makees For file destination;According to the recovery stream control value pre-saved, and the creation time of the file destination, the second creation time is determined Threshold value;Judge whether the second creation time threshold value is no more than the target creation time threshold value;If it is, according to described Two creation time threshold values, update the target creation time threshold value.
The recycling module 53, the file to be recycled specifically for being no more than the target creation time in creation time In, recovery preserves the file that duration exceedes setting duration threshold value.
The enabled module 52, after being additionally operable to the judged result in the monitoring module to be, before judging current time Preset time range in whether carried out file recovery;If not, will there is identical life in the memory space of the user The file in cycle is divided into a metadata bucket.
In the embodiment of the present invention, the file for having identical life cycle in the memory space of user is divided into one by server In individual metadata bucket, according to the life cycle of file in each metadata bucket, and the reduction parameter currently preserved, it is determined that each member First creation time threshold value corresponding to data bucket, so that it is determined that target creation time threshold value, creation time is created no more than target The file recovery of time threshold is built, by reducing parameter, the life cycle of each file is in a disguised form reduced, can reclaim user's Not out of date file in memory space, so as to further discharge the residual memory space of user.
For systems/devices embodiment, because it is substantially similar to embodiment of the method, so the comparison of description is simple Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program Product.Therefore, the application can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Apply the form of example.Moreover, the application can use the computer for wherein including computer usable program code in one or more The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The application is with reference to the flow according to the method for the embodiment of the present application, equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
Although having been described for the preferred embodiment of the application, those skilled in the art once know basic creation Property concept, then can make other change and modification to these embodiments.So appended claims be intended to be construed to include it is excellent Select embodiment and fall into having altered and changing for the application scope.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (16)

1. a kind of file recovery method, it is characterised in that this method includes:
When it is determined that user residual memory space deficiency when, will in the memory space of the user have identical life cycle text Part is divided into a metadata bucket;
For each metadata bucket, according to the life cycle of file in the metadata bucket, and the reduction parameter currently preserved, it is determined that It is remaining corresponding to the metadata bucket to retain duration;According to current time, and remaining reservation duration corresponding to the metadata bucket, it is determined that First creation time threshold value corresponding to the metadata bucket;
The first creation time threshold value according to corresponding to each metadata bucket, target creation time threshold value is determined, reclaim creation time No more than the file of the target creation time threshold value.
2. the method as described in claim 1, it is characterised in that the life cycle according to file in the metadata bucket, and The reduction parameter currently preserved, determine that the remaining duration that retains includes corresponding to the metadata bucket:
According to the life cycle of file in the metadata bucket, and reduction duration set in advance, determine corresponding to the metadata bucket Residue retains duration;Or
According to the life cycle of file in the metadata bucket, and the reduction ratio determined, determine remaining corresponding to the metadata bucket Retain duration.
3. method as claimed in claim 2, it is characterised in that the determination reduction ratio includes:
According to the use ratio of the memory space of presently described user and default recovery proportion threshold value, reduction ratio is determined;
The life cycle according to file in the metadata bucket, and the reduction ratio determined, are determined corresponding to the metadata bucket Residue retains duration and included:
Determine the product of the life cycle of file and the reduction ratio in the metadata bucket;By the life of file in the metadata bucket The life cycle is defined as corresponding remaining reservation duration in the metadata bucket with the difference of the product.
4. the method as described in claim 1, it is characterised in that the life cycle according to file in the metadata bucket, and The reduction parameter currently preserved, before determining remaining reservation duration corresponding to the metadata bucket, methods described also includes:
According to the recovered frequency currently preserved, the reduction parameter currently preserved is updated;
After the recovery creation time is no more than the file of the target creation time threshold value, methods described also includes:
Judge whether the residual memory space of the user is insufficient;
If it is, the recovered frequency currently preserved is updated;If not, the recovered frequency currently preserved is reverted to initially Value.
5. method as claimed in claim 1 or 2, it is characterised in that first creates corresponding to each metadata bucket of basis Time threshold, after determining target creation time threshold value, it is no more than the text of the target creation time threshold value in recovery creation time Before part, methods described also includes:
In the memory space of the user, the earliest file of creation time is chosen as file destination;
According to the recovery stream control value pre-saved, and the creation time of the file destination, the second creation time threshold value is determined;
Judge whether the second creation time threshold value is no more than the target creation time threshold value;
If it is, according to the second creation time threshold value, the target creation time threshold value is updated.
6. the method as described in claim 1, it is characterised in that the recovery creation time is no more than the target creation time The file of threshold value includes:
In the file to be recycled that creation time is no more than the target creation time, recovery preserves duration and exceedes setting duration threshold The file of value.
7. the method as described in claim 1, it is characterised in that after the residual memory space deficiency for determining user, by described in Before the file with identical life cycle is divided into a metadata bucket in the memory space of user, methods described is also wrapped Include:
Judge file recovery whether was carried out in the preset time range before current time;
If not, carry out subsequent step.
8. a kind of file retracting device, it is characterised in that the device includes:
Monitoring module, for judging whether the residual memory space of user is insufficient;
Enabled module, for when the judged result of the monitoring module is is, will to there is phase in the memory space of the user File with life cycle is divided into a metadata bucket;For each metadata bucket, according to file in the metadata bucket Life cycle, and the reduction parameter currently preserved, determine remaining reservation duration corresponding to the metadata bucket;According to current time, And remaining reservation duration corresponding to the metadata bucket, determine the first creation time threshold value corresponding to the metadata bucket;According to each First creation time threshold value corresponding to metadata bucket, determine target creation time threshold value;
Recycling module, the file of the target creation time threshold value is no more than for reclaiming creation time.
9. device as claimed in claim 8, it is characterised in that the enabled module, specifically for according in the metadata bucket The life cycle of file, and reduction duration set in advance, determine corresponding remaining reservation duration in the metadata bucket;Or according to The life cycle of file in the metadata bucket, and the reduction ratio determined, when determining corresponding remaining reservation in the metadata bucket It is long.
10. device as claimed in claim 9, it is characterised in that the enabled module, specifically for according to presently described user Memory space use ratio and default recovery proportion threshold value, determine reduction ratio;It is described according in the metadata bucket The life cycle of file, and the reduction ratio determined, determine that the corresponding remaining duration that retains includes in the metadata bucket:It is determined that should The product of the life cycle of file and the reduction ratio in metadata bucket;By the life cycle of file and institute in the metadata bucket The difference for stating product is defined as corresponding remaining reservation duration in the metadata bucket.
11. device as claimed in claim 8, it is characterised in that the enabled module, be additionally operable to according to the recovery currently preserved Number, the reduction parameter currently preserved is updated;
The enabled module, after being additionally operable to the recovery creation time no more than the file of the target creation time threshold value, when The judged result of the monitoring module is that when being, the recovered frequency currently preserved is updated;When sentencing for the monitoring module When disconnected result is no, the recovered frequency currently preserved is reverted into initial value.
12. device as claimed in claim 8 or 9, it is characterised in that the enabled module, be additionally operable to depositing in the user Store up in space, choose the earliest file of creation time as file destination;According to the recovery stream control value pre-saved, and the mesh The creation time of file is marked, determines the second creation time threshold value;It is described to judge whether the second creation time threshold value is no more than Target creation time threshold value;If it is, according to the second creation time threshold value, the target creation time threshold value is updated.
13. device as claimed in claim 8, it is characterised in that the recycling module, specifically for being no more than in creation time In the file to be recycled of the target creation time, recovery preserves the file that duration exceedes setting duration threshold value.
14. device as claimed in claim 8, it is characterised in that the enabled module, be additionally operable to sentencing in the monitoring module After disconnected result is is, judge file recovery whether was carried out in the preset time range before current time;If not, by described in The file with identical life cycle is divided into a metadata bucket in the memory space of user.
A kind of 15. server, it is characterised in that including processor, communication interface, memory and communication bus, wherein, processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for depositing computer program;
Processor, during for performing the program deposited on memory, realize the method step described in claim any one of 1-7 Suddenly.
16. a kind of computer-readable recording medium, it is characterised in that the computer-readable recording medium internal memory contains computer Program, the computer program realize the method and step described in claim any one of 1-7 when being executed by processor.
CN201710912466.2A 2017-09-29 2017-09-29 File recovery method and device, server and computer readable storage medium Active CN107590283B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710912466.2A CN107590283B (en) 2017-09-29 2017-09-29 File recovery method and device, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710912466.2A CN107590283B (en) 2017-09-29 2017-09-29 File recovery method and device, server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107590283A true CN107590283A (en) 2018-01-16
CN107590283B CN107590283B (en) 2019-12-24

Family

ID=61052440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710912466.2A Active CN107590283B (en) 2017-09-29 2017-09-29 File recovery method and device, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107590283B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108776664A (en) * 2018-04-19 2018-11-09 北京立思辰计算机技术有限公司 Force file recovery method and system
CN109144426A (en) * 2018-09-07 2019-01-04 郑州云海信息技术有限公司 A kind of memory space management of object storage system, system and associated component
CN110287146A (en) * 2019-06-19 2019-09-27 上海连尚网络科技有限公司 Using the method, equipment and computer storage medium of downloading
CN110365780A (en) * 2019-07-19 2019-10-22 南京世竹软件科技有限公司 A kind of cloud computing architecture system for Internet of Things storage
CN110716924A (en) * 2018-07-13 2020-01-21 杭州海康威视***技术有限公司 Method and device for deleting expired data
CN110879764A (en) * 2019-11-14 2020-03-13 浪潮(北京)电子信息产业有限公司 Bitmap setting method, device and equipment and readable storage medium
CN111027405A (en) * 2019-11-15 2020-04-17 浙江大华技术股份有限公司 Method and device for estimating space ratio of article, terminal and storage device
CN112002130A (en) * 2020-10-30 2020-11-27 武汉中科通达高新技术股份有限公司 Data management method, device, server and computer readable storage medium
CN112035066A (en) * 2020-09-02 2020-12-04 中国银行股份有限公司 Method and device for calculating log retention time
CN112214482A (en) * 2019-07-10 2021-01-12 阿里巴巴集团控股有限公司 Data processing method and device, security chip, storage medium and computer equipment
CN112765046A (en) * 2019-10-21 2021-05-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for reclaiming storage space
CN112817912A (en) * 2021-02-20 2021-05-18 平安科技(深圳)有限公司 File management method and device, computer equipment and storage medium
CN113190175A (en) * 2021-04-28 2021-07-30 杭州海康威视***技术有限公司 Object data processing method, device and equipment
CN113625951A (en) * 2021-06-30 2021-11-09 济南浪潮数据技术有限公司 Bucket life cycle configuration method, device, equipment and medium
CN114217740A (en) * 2021-11-30 2022-03-22 浙江大华技术股份有限公司 Storage management method, equipment, system and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012850A (en) * 2010-12-09 2011-04-13 首都师范大学 Hardware monitoring and micro-packet protocol-based key data restoration method
CN102799395A (en) * 2012-06-29 2012-11-28 华为技术有限公司 Dynamic balancing processing method and device for disk spaces and disk system
US20170032008A1 (en) * 2012-09-12 2017-02-02 International Business Machines Corporation Secure deletion operations in a wide area network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012850A (en) * 2010-12-09 2011-04-13 首都师范大学 Hardware monitoring and micro-packet protocol-based key data restoration method
CN102799395A (en) * 2012-06-29 2012-11-28 华为技术有限公司 Dynamic balancing processing method and device for disk spaces and disk system
US20170032008A1 (en) * 2012-09-12 2017-02-02 International Business Machines Corporation Secure deletion operations in a wide area network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
齐婵颖等: "NTFS 文件***空间回收方法的研究", 《计算机工程》 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108776664A (en) * 2018-04-19 2018-11-09 北京立思辰计算机技术有限公司 Force file recovery method and system
CN110716924A (en) * 2018-07-13 2020-01-21 杭州海康威视***技术有限公司 Method and device for deleting expired data
CN109144426A (en) * 2018-09-07 2019-01-04 郑州云海信息技术有限公司 A kind of memory space management of object storage system, system and associated component
CN110287146A (en) * 2019-06-19 2019-09-27 上海连尚网络科技有限公司 Using the method, equipment and computer storage medium of downloading
CN110287146B (en) * 2019-06-19 2021-07-20 上海连尚网络科技有限公司 Method, device and computer storage medium for downloading application
CN112214482A (en) * 2019-07-10 2021-01-12 阿里巴巴集团控股有限公司 Data processing method and device, security chip, storage medium and computer equipment
CN110365780A (en) * 2019-07-19 2019-10-22 南京世竹软件科技有限公司 A kind of cloud computing architecture system for Internet of Things storage
CN112765046A (en) * 2019-10-21 2021-05-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for reclaiming storage space
CN110879764A (en) * 2019-11-14 2020-03-13 浪潮(北京)电子信息产业有限公司 Bitmap setting method, device and equipment and readable storage medium
CN110879764B (en) * 2019-11-14 2022-04-22 浪潮(北京)电子信息产业有限公司 Bitmap setting method, device and equipment and readable storage medium
CN111027405A (en) * 2019-11-15 2020-04-17 浙江大华技术股份有限公司 Method and device for estimating space ratio of article, terminal and storage device
CN111027405B (en) * 2019-11-15 2023-09-01 浙江大华技术股份有限公司 Method and device for estimating space occupancy of article, terminal and storage device
CN112035066A (en) * 2020-09-02 2020-12-04 中国银行股份有限公司 Method and device for calculating log retention time
CN112002130B (en) * 2020-10-30 2021-01-08 武汉中科通达高新技术股份有限公司 Data management method, device, server and computer readable storage medium
CN112002130A (en) * 2020-10-30 2020-11-27 武汉中科通达高新技术股份有限公司 Data management method, device, server and computer readable storage medium
CN112817912A (en) * 2021-02-20 2021-05-18 平安科技(深圳)有限公司 File management method and device, computer equipment and storage medium
CN112817912B (en) * 2021-02-20 2023-05-26 平安科技(深圳)有限公司 File management method, device, computer equipment and storage medium
CN113190175A (en) * 2021-04-28 2021-07-30 杭州海康威视***技术有限公司 Object data processing method, device and equipment
CN113625951A (en) * 2021-06-30 2021-11-09 济南浪潮数据技术有限公司 Bucket life cycle configuration method, device, equipment and medium
CN113625951B (en) * 2021-06-30 2023-12-26 济南浪潮数据技术有限公司 Barrel life cycle configuration method, device, equipment and medium
CN114217740A (en) * 2021-11-30 2022-03-22 浙江大华技术股份有限公司 Storage management method, equipment, system and computer readable storage medium

Also Published As

Publication number Publication date
CN107590283B (en) 2019-12-24

Similar Documents

Publication Publication Date Title
CN107590283A (en) A kind of file recovery method, device, server and computer-readable recording medium
CN103677977B (en) Method and device for cleaning temporary files in mobile terminal and the mobile terminal
CN108632365A (en) Service Source method of adjustment, relevant apparatus and equipment
CN103902333A (en) Method for automatically unloading application of mobile terminal and mobile terminal
CN105242983B (en) A kind of date storage method and a kind of data storage management service device
CN101673192B (en) Method for time-sequence data processing, device and system therefor
CN108777033A (en) A kind of shared charger baby leasing method, device, readable storage medium storing program for executing and its terminal device based on shared leased equipment
CN106502578B (en) Capacity changes suggesting method and device
CN107396125A (en) Decoder resources distribution method and device
CN107506136A (en) A kind of method and apparatus of garbage reclamation
CN106292998A (en) The management method of a kind of running background program and terminal
CN107066349A (en) A kind of method and system of cluster file system data protection
CN107734336A (en) A kind of compression method and device of video memory space
CN113725864A (en) Method and system for orderly charging of station area intelligent integration terminal management and control charging pile
CN111213343B (en) Host upgrading method and device
CN102023821A (en) Disc space management method and system
CN102820679A (en) Charge control method and electronic equipment
CN103593300A (en) Memory allocating and collecting method
CN105183558B (en) The management method of intelligent terminal and its containment system
CN108710686A (en) A kind of date storage method, device, storage medium and terminal
CN104795602A (en) Method for intelligently charging battery, and apparatus thereof
CN107315658A (en) A kind of data back up method and device, computer installation and readable storage medium storing program for executing
CN107424240A (en) A kind of storage method of drive recorder data, apparatus and system
CN106557434A (en) A kind of interface caching method and system
CN112561427A (en) Material transportation method and device

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