CN109656876A - Storing method, device, electronic equipment and the machine readable storage medium of snapshot - Google Patents

Storing method, device, electronic equipment and the machine readable storage medium of snapshot Download PDF

Info

Publication number
CN109656876A
CN109656876A CN201811495699.8A CN201811495699A CN109656876A CN 109656876 A CN109656876 A CN 109656876A CN 201811495699 A CN201811495699 A CN 201811495699A CN 109656876 A CN109656876 A CN 109656876A
Authority
CN
China
Prior art keywords
snapshot
retention
rule
creation time
retained
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811495699.8A
Other languages
Chinese (zh)
Inventor
上官应兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Sequoia Polytron Technologies Inc
Original Assignee
Hangzhou Sequoia Polytron Technologies Inc
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 Hangzhou Sequoia Polytron Technologies Inc filed Critical Hangzhou Sequoia Polytron Technologies Inc
Priority to CN201811495699.8A priority Critical patent/CN109656876A/en
Publication of CN109656876A publication Critical patent/CN109656876A/en
Pending legal-status Critical Current

Links

Abstract

Storing method, device, electronic equipment and the machine readable storage medium of the application offer snapshot.In this application, production volume is preset with snapshot policy, is that production volume generates a series of snapshots by the snapshot policy, configures the retention strategy of the snapshot;Obtain the correspondence creation time for having generated snapshot;Based on the creation time, by the retention strategy, retention processing is executed to the snapshot that generated, it realizes to be configured according to user demand and retains strategy and its include multiple retention rule, it is regular according to the multiple retention, it has generated snapshot execution retention to described and has handled, when not needing additionally to configure multiple snapshot policies, the demand that user flexibly controls snapshot remaining time and memory space is met, snapshot storage efficiency is improved, while reducing the consumption to system resource.

Description

Storing method, device, electronic equipment and the machine readable storage medium of snapshot
Technical field
This application involves the storing method of technical field of memory more particularly to snapshot, device, electronic equipments and machine readable Storage medium.
Background technique
In big data era, data volume is increasing, and data are also more and more important, stores the data in special storage and sets In standby, and the data protection characteristic by storing equipment improves data reliability and has become main way.
Snapshot is one of the data protection characteristic for storing equipment, and the common scheme of reply " soft disaster ".Soft disaster, therefore Name is conceived, and refers to the disaster of " soft ", be often referred to cause due to maloperation, software Bug, virus etc. creation data damage in logic or It cannot read.Legacy data can be saved before new data is written by snapping technique, in this way when soft calamity occurs for data It when difficult, can be restored using previously stored legacy data, make data-backoff to an available time plane.
Summary of the invention
The application provides a kind of storing method of snapshot, and it is institute by the snapshot policy that production volume, which is preset with snapshot policy, It states production volume and generates a series of snapshots, which comprises
Configure the retention strategy of the snapshot;
Obtain the correspondence creation time for having generated snapshot;
Based on the creation time, by the retention strategy, retention processing is executed to the snapshot that generated.
Optionally, the retention strategy includes at least two preset retention rules.
Optionally, the retention rule includes at least: rule numbers, retain interval at influencing timeslice, wherein the rule is compiled Number mark retention rule prioritization.
Optionally, described to be based on the creation time, by the retention strategy, the snapshot that generated is executed at retention Reason, comprising:
The N articles retention rule is read, the initial value of N is 1;
The N articles is handled, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, is retained by the N articles The corresponding retention interval of rule is determined in the snapshot number that the influencing timeslice domestic demand is retained, and is deleted the snapshot for being not required to retain and is compiled Number corresponding snapshot;
Judge whether N is the last item, if it is, terminating;If it is not, N=N+1, returns and reads the N articles retention rule Then.
Optionally, the snapshot number is successive by snapshot creation time, is numbered with being incremented by from small to large;The deletion It is not required to the snapshot retained number and is greater than the snapshot number that need to be retained.
The application also provides a kind of retention device of snapshot, and production volume is preset with snapshot policy, is by the snapshot policy The production volume generates a series of snapshots, and described device includes:
Configuration module, for configuring the retention strategy of the snapshot;
Module is obtained, the correspondence creation time for having generated snapshot is obtained;
Module is retained, the creation time is based on, by the retention strategy, the snapshot that generated is executed at retention Reason.
Optionally, the retention strategy includes at least two preset retention rules.
Optionally, the retention rule includes at least: rule numbers, retain interval at influencing timeslice, wherein the rule is compiled Number mark retention rule prioritization.
Optionally, described to be based on the creation time, by the retention strategy, the snapshot that generated is executed at retention Reason, the retention module further,
The N articles retention rule is read, the initial value of N is 1;
The N articles is handled, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, is retained by the N articles The corresponding retention interval of rule is determined in the snapshot number that the influencing timeslice domestic demand is retained, and is deleted the snapshot for being not required to retain and is compiled Number corresponding snapshot;
Judge whether N is the last item, if it is, terminating;If it is not, N=N+1, returns and reads the N articles retention rule Then.
Optionally, the snapshot number is successive by snapshot creation time, is numbered with being incremented by from small to large;It is described to be not required to The snapshot number of retention is greater than the snapshot number that need to be retained.
The application also provides a kind of electronic equipment, including communication interface, processor, memory and bus, and the communication connects Pass through bus between mouth, the processor and the memory to be connected with each other;
Machine readable instructions are stored in the memory, the processor is executed by calling the machine readable instructions Above-mentioned method.
The application also provides a kind of machine readable storage medium, and the machine readable storage medium is stored with machine readable finger It enables, the machine readable instructions realize the above method when being called and being executed by processor.
By above embodiments, production volume is preset with snapshot policy, is that production volume generates one by the snapshot policy Serial snapshot configures the retention strategy of the snapshot;Obtain the correspondence creation time for having generated snapshot;When based on the creation Between, by the retention strategy, retention processing is executed to the snapshot that generated, realizes to be configured according to user demand and retains strategy And its include multiple retention rules, according to the multiple retention rule, retention processing is executed to the snapshot that generated, simultaneously It does not need in the case of additionally configuring multiple snapshot policies, meets what user flexibly controlled snapshot remaining time and memory space Demand improves snapshot storage efficiency, while reducing the consumption to system resource.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the storing method for snapshot that an exemplary embodiment provides.
Fig. 2 is a kind of retention process flow diagram that an exemplary embodiment provides.
Fig. 3 is a kind of block diagram of the retention device for snapshot that an exemplary embodiment provides.
Fig. 4 is the hardware structure diagram for a kind of electronic equipment that an exemplary embodiment provides.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the application.
It is only to be not intended to be limiting the application merely for for the purpose of describing particular embodiments in term used in this application. It is also intended in the application and the "an" of singular used in the attached claims, " described " and "the" including majority Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from In the case where the application range, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination ".
In order to make those skilled in the art more fully understand the technical solution in the embodiment of the present application, below first to this Shen Please the snapshot the relevant technologies that are related to of embodiment, be briefly described.
Currently used snapping technique includes: to write to copy and write redirection.It is so-called to write copy i.e. COW (Copy On Write), COW is oldest one of snapping technique, and way is after creating new snapshot, when creation data is rolled up (referred to as Production volume) data when changing for the first time, before new data is written to production volume, legacy data is copied to other areas In domain, legacy data in original region is then covered again;Copied legacy data is provided to newest snapshot and uses, also referred to as Snapshot data is generally held in the additional Snapshot Resources for being not belonging to production volume.So-called write redirects i.e. ROW (Redirect On Write), it is another snapping technique arranged side by side with COW, way is after creating new snapshot, when production volume When data change for the first time, one piece of region write-in additionally is distributed for new data, rather than it is corresponding original to cover production volume data Region, meanwhile, production volume data correspond to legacy data in original region and become snapshot data, be supplied to it is newest fastly According to using.Either COW snapshot or ROW snapshot, are incremental snapshots, and the incremental snapshot is exactly that each new snapshot only records Changed data, the data changed for the first time do not need for the first time on production volume after the creation time of the new snapshot Old snapshot is recorded.Incremental snapshot advantage is: the snapshot data volume to be recorded is few, and formation speed is fast;The disadvantage is that: data restore multiple Miscellaneous, data are rolled up in the production to be restored to the corresponding creation time of specified snapshot, it is necessary to before having current time, be specified fastly It could restore according to all snapshots after corresponding creation time.Such as: there are a snapshots for 8 o'clock production volume (referred to as fastly According to 1), 9 o'clock production volume is there are another snapshot (referred to as snapshot 2), and there are another snapshots for 10 o'clock production volume (referred to as Snapshot 3);During 8 o'clock to current time, there are data variations for production volume;Current time is 10 thirty, user's plan Resume production roll up data to 8 o'clock state, then store equipment need to have it is fast to all snapshots-between 10 points at 8 o'clock According to 1, snapshot 2, snapshot 3, could finally resume production roll up data to 8 o'clock state.
Equipment is stored according to default snapshot policy, rolls up creation snapshot for production, each snapshot records the snapshot creation time And the data changed for the first time between next snapshot creation time, such as: 8 o'clock was a snapshot creation time, and 9 o'clock was another One snapshot creation time, 10 o'clock are another snapshot creation times, and corresponding creation time is the snapshot at 8 o'clock, record Be 8 o'clock to the data changed for the first time between 9 o'clock;Corresponding creation time is the snapshot at 9 o'clock, and record was 9 o'clock To the data changed for the first time between 10 o'clock;Corresponding creation time is the snapshot at 10 o'clock, the head after being 10 o'clock of record The data of secondary variation.
Common snapshot policy includes: the maximum snapshot number of production volume and temporally creation snapshot is regular, wherein by In the limited storage space that snapshot occupies, so the storage that the maximum snapshot number control snapshot for needing to be arranged production volume occupies is empty Between.The temporally creation snapshot rule includes: by period generation strategy, by timing strategies;It is wherein described by period generation strategy, such as: Since sometime, new snapshot is automatically created every some cycles threshold value;It is described press timing strategies, such as: daily/week One/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday given time, automatically creates new snapshot.All foundation snapshot policies The snapshot of creation will be managed collectively by storage equipment, when storage equipment is that production volume creates new snapshot according to default snapshot policy When, it will judge that the production rolls up whether upper already present snapshot number reaches maximum snapshot number, if had reached, will be automatically deleted The corresponding snapshot of oldest creation time, then create the corresponding snapshot of new creation time.
In some scenes, user has following demand, specific as follows shown:
A, a snapshot is generated daily, and each snapshot retains one week;
B, a weekly-generated snapshot, each snapshot retain one month;
Need to realize that snapshot is generated and retained by the intersection of a, b condition described.
In such a scenario, it is realized based on above-mentioned common snapshot policy, closest to the existing scheme of user demand: configuring one A snapshot policy, temporally creating snapshot rule is periodically to generate a snapshot daily, and maximum retains 30 snapshots.This side More problems existing for case, such as: for the mode of incremental snapshot, each snapshot only records the snapshot creation time and next The data changed for the first time between snapshot creation time;According to the demand b of user, only need to retain one weekly in non-nearest one week Snapshot records data changed for the first time in corresponding week by the snapshot;According to this scheme, it is still in non-nearest one week A daily snapshot, from the point of view of the use of memory space, a daily snapshot is actually saved in daily and is changed for the first time Data, if data hot spot compares concentration, weekly in data frequently change in some address space range, daily Recording the data changed for the first time will make snapshot data occupy more memory space, and the hardware cost of user is caused to get higher; If snapshot space unreasonable allocation, oldest snapshot may be also resulted in because the reason of space anxiety is automatically left out, thus, Because leading to not the requirement for meeting snapshot guard time beyond expected space consuming.And when the creation of multiple snapshot policies Between when being overlapped, the upper snapshot that redundancy may be created at the same time or in the very short time of the same production volume;Because of strategy overlapping Probability become larger, part producing volume is different surely in expected moment creation time, it is also possible to snapshot occurs and generate delay.
Based on this, the application proposes that a kind of retention technical solution of snapshot, the program include: that production volume is preset with snapshot plan Slightly, it is that production volume generates a series of snapshots by the snapshot policy, configures the retention strategy of the snapshot;Acquisition has generated The correspondence creation time of snapshot;The snapshot that generated is executed at retention by the retention strategy based on the creation time Reason realizes to be configured according to user demand and retains strategy and its include that multiple retentions are regular, regular according to the multiple retention, Retention processing is executed to the snapshot that generated, when not needing additionally to configure multiple snapshot policies, meets user To the demand that snapshot remaining time and memory space flexibly control, realization is more apart from the nearlyr snapshot retention number of current time, It is fewer apart from the remoter snapshot retention number of current time, snapshot storage efficiency is improved, while reducing and disappearing to system resource Consumption.
The application is described below by specific embodiment and in conjunction with specific application scenarios.
Referring to FIG. 1, Fig. 1 is a kind of storing method for snapshot that one embodiment of the application provides, application memory equipment;It is raw It produces volume and is preset with snapshot policy, be that production volume generates a series of snapshots by the snapshot policy;The above method executes following Step:
The retention strategy of step 102, the configuration snapshot.
Here snapshot refers to that production volume is preset with snapshot policy, is one that the production volume generates by the snapshot policy Serial snapshot.It should be noted that in one example, the number of the snapshot contains at least one or is the snapshot plan The maximum snapshot number of slightly preset.The snapshot policy generates the time parameter method of snapshot in this application without especially limiting It is fixed, it can specifically include at least by period generation strategy, press timing strategies.In snapshot described herein, mould is implemented Formula may include COW, ROW etc., in this application without being particularly limited to.
Specifically, storage equipment is that the snapshot policy configures the corresponding retention strategy for generating snapshot.Retain strategy extremely It less include two preset retention rules, wherein the field for retaining rule definition includes at least: rule numbers, stay influencing timeslice Interval is deposited, wherein the rule numbers identify the retention rule prioritization, the influencing timeslice indicates that the rule corresponds to shadow The creation time range of loud snapshot, the retention time interval are in the time range of the influencing timeslice, by certain time The interval of threshold value retains the number of corresponding time snapshot.
In a kind of embodiment shown, the retention rule that strategy is included is retained, is referred to exemplified by table 1:
Table 1
Strategy is retained shown in table 1 and includes two retention rules: rule 1, rule 2, wherein the priority of rule 1 is higher than rule 2, it, can be preferentially by the corresponding condition pair for retaining interval 1 in the corresponding influencing timeslice of rule 1 when which is executed by storage equipment The snapshot executes retention processing.It can be seen that in this case, there is no overlapping for the influencing timeslice of rule 1 and rule 2.
In the another embodiment shown, the retention rule that strategy is included is retained, is referred to exemplified by table 2:
Table 2
Strategy is retained shown in table 2 and includes three retention rules: rule 11, rule 22, rule 33, wherein the rule precedence Grade from high to low sequence are as follows: rule 11 > rule 22 > rule 33.It can be seen that in this case, rule 11, rule 22, rule Then 33 influencing timeslice exists overlapping, can be preferentially by the corresponding influencing timeslice of rule 11 when which is executed by storage equipment The interior corresponding condition for retaining interval 11 is executed;Exist overlapping to rule 22 and regular 33 influencing timeslices and belongs to rule 22 Influencing timeslice and be not belonging to rule 11 influencing timeslice snapshot by rule 22 execute retention processing;To the influencing timeslice of rule 33 And it is not belonging to the snapshot of the influencing timeslice of rule 22, it is preferential to execute retention processing by rule 33.
It can be seen that rule numbers are bigger, corresponding in the case where multiple influence time sections for retaining rule have overlapping The creation time of the snapshot of period is more early.Overlapping period is subject to regular N in regular N and rule N+1, and non-overlapping periods are with rule Subject to N+1.For convenience of description, the corresponding influencing timeslice of rule N is called influencing timeslice N, regular N is corresponding to be retained every referred to as retention It is spaced N;Wherein influencing timeslice N includes at least a period, is also possible to multiple periods, temporally period generation strategy side of specific moment Formula is not especially limited;It retains interval N and includes at least one, be also possible to multiple, temporally period generation strategy mode of specific moment It is not especially limited, retains the corresponding snapshot number saved of interval N and include at least one, be also possible to multiple, detailed number is not Make specific limit.
Step 104, acquisition have generated the correspondence creation time of snapshot.
Here the snapshot of generation refers to that storage equipment is preset with snapshot policy according to production volume, is by the snapshot policy A series of snapshots that the production volume actually generates.When each of this series of snapshot impinges upon creation fastly, corresponding wound is had It builds the time, such as: 8 o'clock was a snapshot creation time, and 9 o'clock was another snapshot creation time, and 10 o'clock was for another Snapshot creation time, corresponding each snapshot creation time, can be by being numbered by snapshot genesis sequence.
It is to store equipment at interval of one snapshot of generation in one hour with snapshot policy in a kind of embodiment shown The corresponding corresponding relationship for obtaining snapshot creation time and snapshot number, refers to exemplified by table 3:
Table 3
Specifically, storage equipment is based on some cycles threshold value, continues to monitor and obtain the creation time of the snapshot, and phase The snapshot that should be corresponding creation time generates corresponding snapshot number, and the snapshot number is successive by snapshot creation time, with from It is small to be numbered to big be incremented by.Storing equipment can also number when generating new snapshot for the new snapshot order-assigned.Above-mentioned point The rule on opportunity and snapshot number with snapshot number is merely illustrative, and user can use different distribution opportunitys, or Using different Base Serial Numbers, numbers incremental step value etc. and be all not specifically limited in this application.
Step 106 is based on the creation time, by the retention strategy, executes retention processing to the snapshot that generated.
Here to it is described generated snapshot execute retention processing, refer to storage equipment it is more based on what is obtained in step 104 It is a to have generated snapshot and its snapshot creation time, snapshot number, by a plurality of retention in the retention strategy configured in step 102 Rule, is continued to monitor and retention is handled.
It include a shared M rule to retain strategy in a kind of embodiment shown, corresponding wherein a certain rule It is indicated with N, wherein there is no for overlapping period in rule N and rule N+1.For convenience of description, when influence that rule N is corresponding Section is known as influencing timeslice N, and regular N is corresponding to be retained every being known as retaining interval N.
Specifically, example shown in Figure 2, storage equipment are executed in the business procedure of a retention processing task, are executed Following steps:
Step 202, in current time Curtim, the snapshot and its creation time of minimum snapshot number are obtained, by retaining N in strategy is first retention rule detection, if in the influencing timeslice of retention rule.
If being located at, show being impinged upon in the influencing timeslice 1 that first is retained rule fastly for oldest creation time, without special Processing can terminate this and retain processing task;If not being located at, step 204 is continued to execute.
Step 204 handles the N articles, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, presses The corresponding retention interval of the N articles retention rule determines that, in the snapshot number that the influencing timeslice domestic demand is retained, deletion is not required to retain Snapshot number corresponding snapshot.
In a kind of embodiment shown, storage equipment presets snapshot policy to be that production volume generates one every 1 hour A snapshot, it is described to press the corresponding retention interval of the N articles retention rule, determine that the snapshot retained in the influencing timeslice domestic demand is compiled Number, it deletes the snapshot for being not required to retain and numbers corresponding snapshot, such as: it is rule 2 exemplified by table 1 when the N articles retention is regular, influences Period: for nearest 3 days -2 days nearest, retention interval are as follows: every one snapshot of reservation in 2 hours, store equipment and press default snapshot plan Slightly, a snapshot was generated for production volume every 1 hour, for a series of snapshots that production volume generates, a series of above-mentioned snapshots are corresponding A series of snapshot number P1, P2, P3, P4, P5, P6 etc., the creation time of the snapshot of corresponding above-mentioned snapshot number is all nearest 3 It-it is 2 days nearest in, i.e., in influencing timeslice.If needing to delete not by interval setting is retained i.e. every one snapshot of reservation in 2 hours The snapshot that need to be retained, correspondence need to preferentially delete the big corresponding snapshot of snapshot number, thus retain before deleting, a series of existing Snapshot has: P1, P2, P3, P4, P5, P6;It retains after deleting, a series of existing snapshots have: P1, P3, P5, it is seen that P2, P4, P6 Opposite P1, P3, P5 snapshot namely described are deleted not after creation time respectively in the respectively opposite interval of retention in 2 hours The snapshot number that need to be retained is greater than the snapshot number that need to be retained.
It stores equipment according to the above method, after completion carries out retention processing to the N articles retention rule, judges whether N is last One retention rule, if so, continuing to execute step 206;If it is not, then N=N+1, return step 202 read the N articles retention Rule continues to execute.
Step 206 checks for the snapshot that creation time retains regular influencing timeslice earlier than the last item, if deposited The snapshot that the creation time retains regular influencing timeslice earlier than the last item is being deleted, is terminating this and retains processing task.
In a kind of embodiment shown, storage equipment can start one after creating new snapshot success every time immediately A or multiple retention processing tasks, acceptable periodicity start by set date one or more retain processing task, in this application not Make specific limit.
So far, process shown in FIG. 1 is completed, production volume can be seen that by process shown in FIG. 1 and be preset with snapshot plan Slightly, storage equipment is that production volume generates a series of snapshots by the snapshot policy, configures the retention strategy of the snapshot;It obtains Take the correspondence creation time for having generated snapshot;The snapshot that generated is held by the retention strategy based on the creation time Row retention processing.
Using the embodiment of the present application, realizes to be configured according to user demand and retain strategy and its include that multiple retentions are advised Then, according to the multiple retention rule, retention processing is executed to the snapshot that generated, it is multiple fast not needing additionally to configure According to the demand under strategy scenarios, meeting user and flexibly controlling snapshot remaining time and memory space, snapshot storage is improved Efficiency, while reducing the consumption to system resource.
In order to make those skilled in the art more fully understand technical solution provided by the embodiments of the present application, below with reference to specific Application scenarios are illustrated technical solution provided by the embodiments of the present application.
LUN-A is rolled up for creation data, storage equipment is preset with snapshot policy, and the snapshot policy includes: most reservations 1024 snapshots;Since the 00:00:00 on the 1st of August in 2018, snapshot is automatically created every 1 hour.For above-mentioned snapshot plan Slightly, storage device configurations retain strategy, the retention strategy, including 5 retention rules, as follows:
Rule 1: in nearest 1 day, retain whole snapshots.
Rule 2: in nearest 3 days, retain 1 snapshot every 2 hours.
Rule 3: in nearest 7 days, retain 1 snapshot every 4 hours.
Rule 4: in nearest 14 days, retain 1 snapshot every 8 hours.
Rule 5: in the last 30 days, retain 1 snapshot every 12 hours.
For above-mentioned retention rule, it can be seen that in the retention strategy, retain the influencing timeslice between rule in the presence of overlapping. After storage equipment is pre-processed, generates and retains rule list, refer to exemplified by table 4:
Table 4
Since the 00:00:00 on the 1st of August in 2018, storage equipment presses above-mentioned snapshot policy, is LUN-A every 1 hour Snapshot is automatically created, each snapshot has corresponding creation time and snapshot number, and the snapshot number presses snapshot creation time Successively, with from small to large be incremented by be numbered, such as: a series of snapshots of generation correspond to a series of snapshot number P1, P2, P3..., wherein the creation time of above-mentioned snapshot all differs 1 hour.Storage equipment can after creating the success of new snapshot every time, Starting immediately is one or more to retain processing task, and acceptable periodicity start by set date one or more retains processing task.It deposits It stores up equipment and is based on a series of snapshots and its corresponding creation time, snapshot number, by the retention strategy and its include to stay Rule is deposited, and according to the priority for retaining rule, retention processing is executed to the snapshot that generated, comprising:
Specifically, retention processing is executed to the snapshot that generated, the storage equipment is further pressed retention rule and carried out Processing method is retained, following steps are referred to:
The N articles retention rule is read, the initial value of N is 1;
The N articles is handled, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, is retained by the N articles The corresponding retention interval of rule is determined in the snapshot number that the influencing timeslice domestic demand is retained, and is deleted the snapshot for being not required to retain and is compiled Number corresponding snapshot;The snapshot number is successive by snapshot creation time, is numbered with being incremented by from small to large;The deletion is not required to The snapshot number of retention is greater than the snapshot number that need to be retained.
Judge whether N is the last item, retains regular shadow earlier than the last item if so, checking for creation time The snapshot of period is rung, if it does, deleting the snapshot that the creation time retains regular influencing timeslice earlier than the last item, is terminated This retains processing task;If it is not, N=N+1, returns and reads the N articles retention rule.
In a kind of embodiment shown, storage equipment is by retaining rule to having created snapshot, by above-mentioned storing method, The detailed process for retain processing, refers to and illustrates as follows:
1) when having created snapshot and being P1, P2, P3... to snapshot P24, storage equipment is based on retaining described in 1 pair of rule It generates snapshot and executes retention processing, since oldest snapshot P1 is in influencing timeslice 1 as shown in table 4, storage equipment is without special Processing.After above-mentioned retention rule process, snapshot is retained as P1, P2... to P24 snapshot.
2) after snapshot P25 is created successfully, the creation time of oldest snapshot P1 in influencing timeslice 2 as shown in table 4 and Interval only has mono- snapshot of P1 where P1;Based on retaining rule 1 and retaining rule 2, storage equipment is without other processing.Based on upper It states after retaining rule process, retains snapshot as P1, P2, P3... to P25 snapshot.
3) after snapshot P26 is created successfully, the creation time of oldest snapshot P1 in influencing timeslice 2 as shown in table 4 and P2 and P1 is in same retention interval, and based on retaining rule 1 and retaining rule 2, storage equipment deletes P2, i.e. the retention interval Inside only retain P1;After above-mentioned retention rule process, P3 to P26 is retained, and retaining snapshot at this time is that P1, P3... are fast to P26 According to.
4) snapshot creation P27 success after, the creation time of oldest snapshot P1 in influencing timeslice 2 as shown in table 4 and It is retained where P1 and there was only mono- snapshot of P1 in interval;The creation time of secondary old snapshot P3 is in influencing timeslice 2 and where P3 such as table 4 Shown in retain interval in only mono- snapshot of P3, based on retain rule 1 and retain rule 2, storage equipment without other handle. After above-mentioned retention rule process, snapshot is retained as P1, P3... to P27 snapshot.
5) after snapshot P28 is created successfully, the creation time of oldest snapshot P1 in influencing timeslice 2 as shown in table 4 and Interval is retained where P1 there was only mono- snapshot of P1;The creation time of secondary old snapshot P3 is in influencing timeslice 2 and between P4 and P3 retention Every identical, based on retaining rule 1 and retaining rule 2, storage equipment deletes P4, i.e., only retains P3 in the interval.It is stayed based on above-mentioned After depositing rule process, snapshot is retained as P1, P3, P5... to P28 snapshot.
6) such as above-mentioned steps, and so on, when snapshot P73 is created successfully, the creation time of oldest snapshot P1 is in such as table 4 Shown in retain interval in influencing timeslice 3 and where P1 and there was only mono- snapshot of P1, based on retaining rule 1, retain rule 2 and retain Rule 3, storage equipment is without other processing;Other snapshots are without processing.After above-mentioned retention rule process, retaining snapshot is Snapshot, the P50... to P73 snapshot of odd number snapshot number in P1 to P49.
7) after snapshot P74 is created successfully, the creation time of oldest snapshot P1 in influencing timeslice 3 as shown in table 4 and Interval is retained where P1 and there was only mono- snapshot of P1, without other processing;P49 is in influencing timeslice 2 and P50 and P49 retains interval Identical, based on retaining rule 1, retaining rule 2 and retaining rule 3, storage equipment deletes P50, i.e., only retains in the retention interval P49.Store equipment be based on above-mentioned retention rule process after, retain snapshot be P1 to P49 in odd number snapshot number snapshot, P51... to P74 snapshot.
8) snapshot creation P75 success after, the creation time of oldest snapshot P1 in influencing timeslice 3 as shown in table 4 and P3 and P1 retain that interval is identical, and storage equipment deletes P3, i.e., only retain P1P51 in the retention interval in influencing timeslice 2 and P51 Place retains interval and there was only mono- snapshot of P51, and based on retaining rule 1, retaining rule 2 and retaining rule 3, storage equipment is not necessarily to it He is handled.After above-mentioned retention rule process, snapshot, the P52... that snapshot is odd number snapshot number in P1, P5 to P51 are retained To P75 snapshot.
9) such as above-mentioned steps, and so on, retention processing is carried out to all snapshots.
Based on the above-mentioned technical proposal, production volume is preset with snapshot policy, and storage equipment is the life by the snapshot policy It produces volume and generates a series of snapshots, configure the retention strategy of the snapshot;Obtain the correspondence creation time for having generated snapshot;Based on institute Creation time is stated, by the retention strategy, retention processing is executed to the snapshot that generated.
Using the technical program, realizes to be configured according to user demand and retains strategy and its include that multiple retentions are regular, According to the multiple retention rule, retention processing is executed to the snapshot that generated, is not needing additionally to configure multiple snapshots Under strategy scenarios, the demand that user flexibly controls snapshot remaining time and memory space is met, improves snapshot storage effect Rate.
Specifically, it on the basis of existing snapshot policy, keeps existing snapshot policy rule constant, only increases and retain Strategy and retention rule, and check and handle according to default retention rule when creating new snapshot.On the one hand, can according to Requirement definition any number of snapshots in family retain rule, and various demands can be flexibly met;On the other hand, it does not need to increase additionally Snapshot policy further reduces the consumption to system resource.
Fig. 3 is a kind of block diagram of the retention device for snapshot that one exemplary embodiment of the application provides.With above method reality Apply that example is corresponding, present invention also provides a kind of embodiments of the retention device of snapshot, please refer to a kind of snapshot exemplified by Fig. 3 Retention device 30, it is that a series of snapshots of generation, institute are rolled up in the production by the snapshot policy that production volume, which is preset with snapshot policy, Stating device includes:
Configuration module 301, for configuring the retention strategy of the snapshot;
Module 302 is obtained, the correspondence creation time for having generated snapshot is obtained;
Module 303 is retained, the creation time is based on, by the retention strategy, retention is executed to the snapshot that generated Processing.
In the present embodiment, the retention strategy includes at least two preset retention rules.
In the present embodiment, the retention rule includes at least: rule numbers, retain interval at influencing timeslice, wherein described Rule numbers identify the retention rule prioritization.
In the present embodiment, described to be based on the creation time, by the retention strategy, the snapshot that generated is executed Retention processing, the retention module 303 further,
The N articles retention rule is read, the initial value of N is 1;
The N articles is handled, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, is retained by the N articles The corresponding retention interval of rule is determined in the snapshot number that the influencing timeslice domestic demand is retained, and is deleted the snapshot for being not required to retain and is compiled Number corresponding snapshot;
Judge whether N is the last item, if it is, terminating;If it is not, N=N+1, returns and reads the N articles retention rule Then.
In the present embodiment, the snapshot number is successive by snapshot creation time, is numbered with being incremented by from small to large;Institute It states the snapshot number for being not required to retain and is greater than the snapshot number that need to be retained.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The module of explanation may or may not be physically separated, and the component shown as module can be or can also be with It is not physical module, it can it is in one place, or may be distributed on multiple network modules.It can be according to actual The purpose for needing to select some or all of the modules therein to realize application scheme.Those of ordinary skill in the art are not paying Out in the case where creative work, it can understand and implement.
System, device, module or the module that above-described embodiment illustrates can specifically realize by computer chip or entity, Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment The combination of any several equipment.
The embodiment of the retention device of the snapshot of the application can be using on electronic equipment shown in Fig. 4.Device is implemented Example can also be realized by software realization by way of hardware or software and hardware combining.Taking software implementation as an example, as Device on one logical meaning is by the processor of electronic equipment where it by meter corresponding in machine readable storage medium Calculation machine program instruction runs the machine-executable instruction of formation after reading.For hardware view, as shown in figure 4, being the application Snapshot retain device where electronic equipment a kind of hardware structure diagram, in addition to processor shown in Fig. 4, communication interface, total Except line and machine readable storage medium, the reality of electronic equipment in embodiment where device generally according to the electronic equipment Function can also include other hardware, repeat no more to this.
Accordingly, it the embodiment of the present application also provides the hardware configuration of a kind of electronic equipment of Fig. 3 shown device, refers to Fig. 4, Fig. 4 are the hardware structural diagram of a kind of electronic equipment provided by the embodiments of the present application.The equipment includes: communication interface 401, processor 402, machine readable storage medium 403 and bus 404;Wherein, communication interface 401, processor 402, machine can It reads storage medium 403 and mutual communication is completed by bus 404.Wherein, communication interface 401, for carrying out network communication.Place Reason device 402 can be a central processing unit (CPU), and processor 402 can execute to be stored in machine readable storage medium 403 Machine readable instructions, to realize above-mentioned method shown in FIG. 1.
Machine readable storage medium 403 referred to herein can be any electronics, magnetism, optics or other physical stores Device may include or store information, such as executable instruction, data, etc..For example, machine readable storage medium may is that easily Lose memory, nonvolatile memory or similar storage medium.Specifically, machine readable storage medium 403 can be RAM (Radom Access Memory, random access memory), flash memory, memory driver (such as hard disk drive), solid state hard disk, Any kind of storage dish (such as CD, DVD) perhaps similar storage medium or their combination.
So far, hardware configuration description shown in Fig. 4 is completed.
In addition, the embodiment of the present application also provides a kind of machine readable storage medium including machine-executable instruction, example Such as the machine-readable readable storage medium storing program for executing 403 in Fig. 4, the machine-executable instruction can be by data processing equipment Device 402 is managed to execute to realize data processing method described above.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus Realization process, details are not described herein.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the application Its embodiment.This application is intended to cover any variations, uses, or adaptations of the application, these modifications, purposes or Person's adaptive change follows the general principle of the application and including the undocumented common knowledge in the art of the application Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the application are by following Claim is pointed out.
It should be understood that the application is not limited to the precise structure that has been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.Scope of the present application is only limited by the accompanying claims.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.

Claims (12)

1. a kind of storing method of snapshot, which is characterized in that production volume is preset with snapshot policy, is described by the snapshot policy Production volume generates a series of snapshots, which comprises
Configure the retention strategy of the snapshot;
Obtain the correspondence creation time for having generated snapshot;
Based on the creation time, by the retention strategy, retention processing is executed to the snapshot that generated.
2. the method according to claim 1, wherein retention strategy includes at least two preset retention rule Then.
3. according to the method described in claim 2, it is characterized in that, the retention rule includes at least: when rule numbers, influence Section retains interval, wherein the rule numbers identify the retention rule prioritization.
4. it is tactful by the retention according to the method described in claim 3, it is characterized in that, described be based on the creation time, Retention processing is executed to the snapshot that generated, comprising:
The N articles retention rule is read, the initial value of N is 1;
The N articles is handled, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, by the N articles retention rule Corresponding retention interval determines in the snapshot number that the influencing timeslice domestic demand is retained, deletes the snapshot number pair for being not required to retain Answer snapshot;
Judge whether N is the last item, if it is, terminating;If it is not, N=N+1, returns and reads the N articles retention rule.
5. according to the method described in claim 4, it is characterized in that, the snapshot number by snapshot creation time it is successive, with from It is small to be numbered to big be incremented by;The deletion is not required to the snapshot retained number and is greater than the snapshot number that need to be retained.
6. a kind of retention device of snapshot, which is characterized in that production volume is preset with snapshot policy, is described by the snapshot policy Production volume generates a series of snapshots, and described device includes:
Configuration module, for configuring the retention strategy of the snapshot;
Module is obtained, the correspondence creation time for having generated snapshot is obtained;
Module is retained, the creation time is based on, by the retention strategy, retention processing is executed to the snapshot that generated.
7. device according to claim 6, which is characterized in that the retention strategy includes at least two preset retention rule Then.
8. device according to claim 7, which is characterized in that the retention rule includes at least: when rule numbers, influence Section retains interval, wherein the rule numbers identify the retention rule prioritization.
9. device according to claim 8, which is characterized in that it is described to be based on the creation time, it is tactful by the retention, To it is described generated snapshot execute retention processing, the retention module further,
The N articles retention rule is read, the initial value of N is 1;
The N articles is handled, if the creation time is fallen in the influencing timeslice that the N articles is retained rule, by the N articles retention rule Corresponding retention interval determines in the snapshot number that the influencing timeslice domestic demand is retained, deletes the snapshot number pair for being not required to retain Answer snapshot;
Judge whether N is the last item, if it is, terminating;If it is not, N=N+1, returns and reads the N articles retention rule.
10. device according to claim 9, which is characterized in that snapshot number is successive by snapshot creation time, with from It is small to be numbered to big be incremented by;The snapshot the retained number that is not required to is greater than the snapshot number that need to be retained.
11. a kind of electronic equipment, which is characterized in that including communication interface, processor, memory and bus, the communication interface, It is connected with each other between the processor and the memory by bus;
Machine readable instructions are stored in the memory, the processor is executed by calling the machine readable instructions as weighed Benefit requires 1 to 5 described in any item methods.
12. a kind of machine readable storage medium, which is characterized in that the machine readable storage medium is stored with machine readable finger It enables, the machine readable instructions realize method described in any one of claim 1 to 5 when being called and being executed by processor.
CN201811495699.8A 2018-12-07 2018-12-07 Storing method, device, electronic equipment and the machine readable storage medium of snapshot Pending CN109656876A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811495699.8A CN109656876A (en) 2018-12-07 2018-12-07 Storing method, device, electronic equipment and the machine readable storage medium of snapshot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811495699.8A CN109656876A (en) 2018-12-07 2018-12-07 Storing method, device, electronic equipment and the machine readable storage medium of snapshot

Publications (1)

Publication Number Publication Date
CN109656876A true CN109656876A (en) 2019-04-19

Family

ID=66113065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811495699.8A Pending CN109656876A (en) 2018-12-07 2018-12-07 Storing method, device, electronic equipment and the machine readable storage medium of snapshot

Country Status (1)

Country Link
CN (1) CN109656876A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001345B2 (en) * 2007-05-10 2011-08-16 Dot Hill Systems Corporation Automatic triggering of backing store re-initialization
US8121981B2 (en) * 2008-06-19 2012-02-21 Microsoft Corporation Database snapshot management
JP5574774B2 (en) * 2010-03-25 2014-08-20 日本電信電話株式会社 File server, continuous snapshot management method, and continuous snapshot management program
US20160203056A1 (en) * 2015-01-09 2016-07-14 Fujitsu Limited Apparatus, snapshot management method, and recording medium
CN107632899A (en) * 2017-08-08 2018-01-26 山东中创软件商用中间件股份有限公司 A kind of snapshot service method and device of application server
CN107918650A (en) * 2017-11-14 2018-04-17 郑州云海信息技术有限公司 A kind of snapshot creation method, device, system and computer-readable recording medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001345B2 (en) * 2007-05-10 2011-08-16 Dot Hill Systems Corporation Automatic triggering of backing store re-initialization
US8121981B2 (en) * 2008-06-19 2012-02-21 Microsoft Corporation Database snapshot management
JP5574774B2 (en) * 2010-03-25 2014-08-20 日本電信電話株式会社 File server, continuous snapshot management method, and continuous snapshot management program
US20160203056A1 (en) * 2015-01-09 2016-07-14 Fujitsu Limited Apparatus, snapshot management method, and recording medium
CN107632899A (en) * 2017-08-08 2018-01-26 山东中创软件商用中间件股份有限公司 A kind of snapshot service method and device of application server
CN107918650A (en) * 2017-11-14 2018-04-17 郑州云海信息技术有限公司 A kind of snapshot creation method, device, system and computer-readable recording medium

Similar Documents

Publication Publication Date Title
CN109766701A (en) For the processing method of abnormal process end operation, device and electronic device
CN109901920A (en) Method for scheduling task and device, electric terminal
CN104636375B (en) A kind of automated back-up application data and the method and device restored on demand
CN107710215A (en) The method and apparatus of mobile computing device safety in test facilities
CN108415759A (en) Processing method, device and the electronic equipment of message
US8943127B2 (en) Techniques for capturing data sets
US20050273557A1 (en) Storage system and method for acquisition and utilisation of snapshots
CN106933747B (en) Data-storage system and date storage method based on multithread
CN102047234A (en) Ranking and prioritizing point in time snapshots
CN110019502A (en) Synchronous method, Database Systems and equipment between primary database and standby database
CN109614055B (en) Snapshot creating method and device, electronic equipment and machine-readable storage medium
CN105487940B (en) The standby end of calamity, the manufacturing side and data reconstruction method between the two
CN109684271A (en) Snapshot data management method, device, electronic equipment and machine readable storage medium
CN108089926A (en) A kind of method, apparatus, equipment and readable storage medium storing program for executing for obtaining distributed lock
CN113760513A (en) Distributed task scheduling method, device, equipment and medium
CN104252386B (en) The locking method and equipment of data renewal
EP3287911A1 (en) Method and device for data processing
CN110737504B (en) Fault-tolerant method, system, terminal and storage medium for deep learning model training
US10261718B1 (en) Adaptively controlling data copy operations that copy data in an electronic environment
CN109656876A (en) Storing method, device, electronic equipment and the machine readable storage medium of snapshot
CN108108126A (en) A kind of data processing method, device and equipment
CN111880910A (en) Data processing method and device, server and storage medium
CN109213636A (en) A kind of storage snapshot creation method, device, equipment and storage medium
CN103678677A (en) Operation method and system of intelligent terminal
CN109656901A (en) Data processing method and device, electronic equipment

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