CN109597707A - Clone volume data copying method, device and computer readable storage medium - Google Patents
Clone volume data copying method, device and computer readable storage medium Download PDFInfo
- Publication number
- CN109597707A CN109597707A CN201811252831.2A CN201811252831A CN109597707A CN 109597707 A CN109597707 A CN 109597707A CN 201811252831 A CN201811252831 A CN 201811252831A CN 109597707 A CN109597707 A CN 109597707A
- Authority
- CN
- China
- Prior art keywords
- volume
- data
- data content
- snapped
- clone
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 235000015170 shellfish Nutrition 0.000 claims 1
- 238000012545 processing Methods 0.000 abstract description 6
- 239000002699 waste material Substances 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000035508 accumulation Effects 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 2
- 238000010009 beating Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000003825 pressing Methods 0.000 description 2
- 238000000151 deposition Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to data processings, disclose a kind of clone volume data copying method, comprising: receive client to the data access request of target clone volume, determine and request corresponding access object, whether search has the corresponding data content of access object on target clone volume;If no, being searched from snapped volume corresponding with clone volume;If no, searching data content from the snapped volume of a upper level step by step according to snapshot level;If finding data content from the snapped volume of any level, data content is sent to client;If searching data content from the corresponding original volume of snapped volume of highest level without data content in the snapped volume of each level and being sent to client;Data content is written in target clone volume.The present invention also proposes a kind of clone volume data copy device and a kind of computer readable storage medium.The case where The present invention reduces the waste of disk space in clone volume data copy and read-write heavy traffics.
Description
Technical field
The present invention relates to technical field of data processing more particularly to a kind of clone volume data copying methods, device and calculating
Machine readable storage medium storing program for executing.
Background technique
The accelerated development of information technology, so that the scale of the key business data of enterprise increasingly expands, enterprise is not required nothing more than
Memory capacity is increasing, and the requirement to data safety is also higher and higher.With the raising of storage application demand, user needs
The backup and protection data of line.Snapshot and clone technology can effectively realize online data protection and online data backup.Fastly
According to a completely available copy for being original volume, which includes the image of original volume at some time point.Specified data acquisition system
The image of referred to as original volume, some time point is known as snapped volume.
Usual snapped volume has read only attribute, when user needs to modify to the data content on snapped volume or fast
When according to new data being written on volume, needs to establish the clone volume of the snapped volume, write operation is realized on clone volume.Due to original
When beginning volume beats snapshot, data copy can't be done, therefore there will not be data copy on the clone volume of snapped volume, when user accesses
On clone volume without data when, need to copy from original volume.Existing solution is that will have in original volume and clone
No data disposably all copy in clone volume on volume, but this copy mode will cause system in a period of time
Busy, traffic affecting operation is read and write, and in practical applications, often only has small part memory space to store in original volume
Significant data, and the storage of most of memory space is data that clone volume will not access, therefore frequently can lead to clone
A large amount of nonsensical data have been copied in volume, lead to the waste of disk space.
Summary of the invention
The present invention provides a kind of clone volume data copying method, device and computer readable storage medium, main purpose
It is the case where reducing the waste of disk space in clone volume data copy and read-write heavy traffic.
To achieve the above object, the present invention also provides a kind of clone volume data copying methods, this method comprises:
When receiving data access request of the client to target clone volume, determine that the data access request is corresponding
Object is accessed, and searches whether have the corresponding data content of the access object on the target clone volume;
If there is no the corresponding data content of the access object on the target clone volume, it is determined that with the clone volume pair
The snapped volume answered, and the data content is searched from the snapped volume;
If there is no the data content on current snapped volume, according to current snapshot level step by step from a upper level
The corresponding data content of the access object is searched in snapped volume, until finding the access from the snapped volume of a level
The corresponding data content of object;
If finding the data content from the snapped volume of any level, the data content is sent to the visitor
Family end;
If corresponding original from the snapped volume of highest level without the data content in the snapped volume of each level
The data content is searched in volume, and the data content is sent to the client;
The data content is written in the target clone volume.
Optionally, before the step data content being written in the target clone volume, the method is also
Comprising steps of
It determines and receives time point of the data access request, and determine between the preset time until the time point
Every interior, to the accumulative access times of the data content;
If the accumulative access times are greater than or equal to the first preset threshold, execute and the data content is written to institute
State the step in target clone volume.
Optionally, before the step data content being written in the target clone volume, the method is also
Comprising steps of
Obtain the accumulative access times of the data content of record;
If the accumulative access times are greater than or equal to the second preset threshold, execute and described the data content is written
To the step in the target clone volume:
If the accumulative access times are less than second preset threshold, the accumulative access times are updated.
Optionally, the method also includes steps:
At interval of preset duration, the accumulative access times recorded in each clone volume are reset.
Optionally, determination snapped volume corresponding with the clone volume, and the data are searched from the snapped volume
After the step of content, this method further includes following steps:
If finding the corresponding data content of the access object from the snapped volume, the data content is obtained,
And it is sent to the client.
In addition, to achieve the above object, the present invention also provides a kind of clone volume data copy device, which includes storage
Device and processor are stored with the data copy program that can be run on the processor, the data copy in the memory
Program realizes following steps when being executed by the processor:
When receiving data access request of the client to target clone volume, determine that the data access request is corresponding
Object is accessed, and searches whether have the corresponding data content of the access object on the target clone volume;
If there is no the corresponding data content of the access object on the target clone volume, it is determined that with the clone volume pair
The snapped volume answered, and the data content is searched from the snapped volume;
If there is no the data content on current snapped volume, according to current snapshot level step by step from a upper level
The corresponding data content of the access object is searched in snapped volume, until finding the access from the snapped volume of a level
The corresponding data content of object;
If finding the data content from the snapped volume of any level, the data content is sent to the visitor
Family end;
If corresponding original from the snapped volume of highest level without the data content in the snapped volume of each level
The data content is searched in volume, and the data content is sent to the client;
The data content is written in the target clone volume.
Optionally, the data copy program can also be executed by the processor, to write the data content described
Enter to before the step in the target clone volume, also realization following steps:
Obtain the accumulative access times of the data content of record;
If the accumulative access times are greater than or equal to the second preset threshold, execute and described the data content is written
To the step in the target clone volume:
If the accumulative access times are less than second preset threshold, the accumulative access times are updated.
Optionally, the data copy program can also be executed by the processor, to realize following steps:
At interval of preset duration, the accumulative access times recorded in each clone volume are reset.
Optionally, the data copy program can also be executed by the processor, in the determination and the clone volume
Corresponding snapped volume, and after the step of searching the data content from the snapped volume, also realize following steps:
If finding the corresponding data content of the access object from the snapped volume, the data content is obtained,
And it is sent to the client.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
Data copy program is stored on storage medium, the data copy program can be executed by one or more processor, with reality
Now the step of clone volume data copying method as described above.
Clone volume data copying method, device and computer readable storage medium proposed by the present invention, when receiving client
When holding the data access request to target clone volume, the corresponding access object of data access request is determined, and search target clone
Whether access object corresponding data content is had on volume;If without accessing the corresponding data content of object on target clone volume,
It determines snapped volume corresponding with clone volume, and searches data content from snapped volume;If not having in data on current snapped volume
Hold, then searches the corresponding data content of access object from father's mirror image of a upper level step by step according to current snapshot level, directly
The corresponding data content of object is accessed to finding from father's mirror image of a level;If being searched from the snapped volume of any level
To data content, then data content is sent to client;If without data content in the snapped volume of each level, from most
Data content is searched in the corresponding original volume of the snapped volume of high-level, and data content is sent to client;By data content
It is written in target clone volume.The data content that the program accesses user for the first time and do not have in clone volume, from his father's mirror image
In successively find after be sent to client, and be copied to what clone volume was merely able to, can if user accesses again
Directly to get data from clone volume, clone volume is improved for the response speed of data access request, and the program
Without disposably all copying in snapped volume the total data in original volume to, reduce disk in clone volume data copy
The waste in space.
Detailed description of the invention
Fig. 1 is the flow diagram for the clone volume data copying method that one embodiment of the invention provides;
Clone volume shows with snapped volume incidence relation in the clone volume data copying method that Fig. 2 provides for one embodiment of the invention
It is intended to;
Fig. 3 is the snapshot level schematic diagram for the clone volume data copying method that one embodiment of the invention provides;
Fig. 4 is the schematic diagram of internal structure for the clone volume data copy device that one embodiment of the invention provides;
The module signal of data copy program in the clone volume data copy device that Fig. 5 provides for one embodiment of the invention
Figure.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of clone volume data copying method.It is gram that one embodiment of the invention provides shown in referring to Fig.1
The flow diagram of grand volume data copying method.This method can be executed by device, which can be by software and/or hard
Part is realized.
In the present embodiment, clone volume data copying method includes:
Step S10 determines that the data access is asked when receiving data access request of the client to target clone volume
Corresponding access object is sought, and searches whether have the corresponding data content of the access object on the target clone volume.
Step S20, if not having the corresponding data content of the access object on the target clone volume, it is determined that with it is described
The corresponding snapped volume of clone volume, and the data content is searched from the snapped volume.
Snapshot refers to one to some specific file system in some specific time mirror with read only attribute
Picture.Snapshot is in order to save the system for field at some time point and beat a snapshot at some time point, then what access snapshot obtained
Data are exactly the data of system in that time point.Based on the principle that there is no storage fathers in the snapped volume of initial creation
Stored information in mirror image does not have physical data duplication, only replicates initial data after Snapshot time point
The metadata of physical location.Therefore, snapshot creation is very fast, can be completed with moment.Then, the data variation of original volume is tracked,
Once the generation of original volume data block updates for the first time, then original volume data block is first read and be written snapped volume, then use new data
Block covers original volume.But the snapped volume has read only attribute, user can not carry out the data on snapped volume by client
Modification, can not also be written new data.Therefore, when user needs to establish gram of the snapped volume in the enterprising row write operation of snapped volume
Grand volume, clone volume have readable writeable attribute.
Step S30, if not having the data content on current snapped volume, according to current snapshot level step by step from upper
The corresponding data content of the access object is searched in the snapped volume of one level, until finding from the snapped volume of a level
The corresponding data content of the access object.
Step S40 sends the data content if finding the data content from the snapped volume of any level
To the client.
Step S50, if without the data content in the snapped volume of each level, from the snapped volume pair of highest level
The data content is searched in the original volume answered, and the data content is sent to the client.
The data content is written in the target clone volume by step S60.
Referring to shown in Fig. 3, snapped volume C1, snapped volume C2, snapped volume C3 respectively create in three different moments original
Roll up C snapped volume, these three snapped volumes for a user, all only have read only attribute, it is assumed that user will to snapped volume C2 into
Row write operation, can create the clone volume D1 of snapped volume C2 at this time.When user accesses the data on clone volume D1, with the clone
Volume is target clone volume, sends the data access request to target clone volume by user end to server, server is receiving
To after data access request, the corresponding access object of data access request is determined, whether search on the target clone volume has access
The corresponding data of object.
For server, after establishing the snapped volume of original volume, which, which is one, only has reading attribute
Mirror image can be covered after corresponding data copy to snapped volume with new data block when user modifies the data in original volume
Data block in lid original volume.And those will not be then copied into snapped volume there is no crossing the data of modification.Due to
Clone volume D1 is backed up to total data current on snapped volume C2.That is, in data no on snapped volume C2
Hold, does not also have on clone volume D1.Therefore, when user accesses the data in clone volume, may and access be not present in clone volume
The corresponding specific data content of object then needs to copy from father's mirror image of the clone volume.Specifically, corresponding from target clone volume
Snapped volume in search the corresponding data content of access object and be sent to client if finding, if searching less than pressing
The corresponding data content of access object is searched from the snapped volume of a upper level step by step according to current snapshot level, until from one
The corresponding data content of access object is found in the snapped volume of level, if finding in data from the snapped volume of any level
Hold, then data content is sent to client, if without the data content in the snapped volume of each level, from top
Data content is searched in the corresponding original volume of snapped volume of grade, and data content is sent to the client.
Since user can also establish the snapped volume of snapped volume as needed, multi-layer snapshot will form in this way, referring to Fig. 4
It is shown.
When snapshot level is excessive, father's mirror image of a snapped volume may be the clone volume of snapped volume, it is also possible to original
Volume.For example, referring to shown in upper figure, snapped volume C2 is the snapshot of the original volume C created at the T2 moment, and snapped volume C21 is to create at the T2 moment
The snapshot of the snapped volume C2 built first does a clone volume based on snapped volume, then beat fastly to clone volume when beating snapshot for snapped volume
According to.Therefore, the snapshot of snapped volume C2 is created, first to create clone volume C2 ' for it, then create the snapped volume of clone volume C2 '
C21. the father's mirror image for being snapped volume C21 is clone volume C2 ', and father's mirror image of clone volume C2 ' is snapped volume C2, father's mirror of snapped volume C2
As being original volume C.The figure is one and has the case where there are two level snapshots, and in practical applications, user can according to need wound
Build the snapshot of more levels.When server is searched from snapped volume C21 less than the access corresponding data content of object, need from
It is searched on his father's mirror image, i.e., searches from the clone volume C2 ' of snapped volume C2, then searched from snapped volume C2, if from snapped volume
It is still searched less than then being searched from his father's mirror image, i.e. original volume C on C2.I.e. when there are multi-layer snapshot, if fast from target
According on volume search less than needs data content, then according to the target snapshot roll up current snapshot level successively from upper one layer
It is searched in grade father's mirror image, until finding the data content of needs.
Further, it is to be appreciated that determination snapped volume corresponding with the clone volume, and looked into from the snapped volume
After the step of looking for the data content, this method further includes following steps:
If finding the corresponding data content of the access object from the snapped volume, the data content is obtained,
And it is sent to the client.If the data content of needs can be found from snapped volume C21 or snapped volume C2, directly
Data content is sent to client.
Further, in one embodiment, the step being written to the data content in the target clone volume it
Before, this method further comprises the steps of: the accumulative access times for obtaining the data content of record;If the accumulative access times are big
In or equal to the second preset threshold, then execute the step data content being written in the target clone volume: if
The accumulative access times are less than second preset threshold, then update the accumulative access times.
In this embodiment, the accessed number of access object is counted in clone volume, is being got in data
Hold and be sent to after client, obtain the accumulative access times of the data content of record, and judge the number whether be greater than or
Equal to the second preset threshold, if so, can be determined that the data are repeatedly accessed, following a possibility that being accessed, is bigger, is
Allow the user rapidly to get the data content of access, then the data content be written in target clone volume,
When user accesses next time, data can be obtained directly from clone volume and return to client.If accumulative access times are less than the
Two preset thresholds need to only update the accumulative access times then without copying data.
In this way, an access is arranged to those each objects for existing only in father's mirror image in clone volume to count
Number, if within certain time being more than the threshold values set.Just automatically by the object data from father mirror-image copies to clone volume in.
For the data that those are not present in clone volume but often access within certain time, the speed for accessing this data can be improved
Degree, avoid data disposably from father mirror-image copies to clone volume in, cause the busy influence of system read-write in a period of time
Service operation.
Further, this method further includes following steps: at interval of preset duration, by the snapped volume of each level and clone
The accumulative access times recorded in volume are reset.
The meaning of access count is the frequent degree for showing that the data are accessed in certain time.At interval of it is default when
Long, the meaning that accumulative access times are zeroed out is: if do not reset, what this value represented is exactly to bring into operation from system
Since the number that accesses.In this case, if certain data accumulations half a year just reaches the second preset threshold, its is accessed
Frequency and infrequently does not need actually in such data copy to clone volume, avoiding occupying additional memory space yet.
Alternatively, in other embodiments, when determining the time point for receiving the data access request, and determining described
Between put until prefixed time interval in, to the accumulative access times of the data content;If the accumulative access times are greater than
Or be equal to the first preset threshold, then execute the step data content being written in the target clone volume.
The access time of each data content is counted, after client accesses a data content, to the data
The accessed number of content within a preset time interval is counted, if it is greater than or equal to the first preset threshold, by the number
It is written in target clone volume according to content.
The clone volume data copying method that the present embodiment proposes, when receiving client to the data access of target clone volume
When request, the corresponding access object of data access request is determined, and whether search on target clone volume has access object corresponding
Data content;If without the corresponding data content of access object on target clone volume, it is determined that snapped volume corresponding with clone volume,
And data content is searched from snapped volume;If there is no data content on current snapped volume, according to current snapshot level by
Grade searches the corresponding data content of access object from father's mirror image of a upper level, until searching from father's mirror image of a level
To the corresponding data content of access object;If finding data content from the snapped volume of any level, data content is sent out
It send to client;If corresponding original from the snapped volume of highest level without data content in the snapped volume of each level
Data content is searched in volume, and data content is sent to client;Data content is written in target clone volume.The program
The data content for accessing for user and not having for the first time in clone volume, is sent to client after successively finding in his father's mirror image
End, and it is copied to what clone volume was merely able to, if user accesses again, number can be directly got from clone volume
According to improving clone volume for the response speed of data access request, and the program is not necessarily to the total data in original volume
It is disposable all to copy in snapped volume, reduce the waste of disk space in clone volume data copy.
The present invention also provides a kind of clone volume data copy devices.Referring to shown in Fig. 4, provided for one embodiment of the invention
The schematic diagram of internal structure of clone volume data copy device.
In the present embodiment, clone volume data copy device 1 can be PC (Personal Computer, PC),
It is also possible to the terminal devices such as smart phone, tablet computer, portable computer.The clone volume data copy device 1 includes at least
Memory 11, processor 12, network interface 13 and communication bus.
Wherein, memory 11 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory,
Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Memory 11
It can be the internal storage unit of clone volume data copy device 1, such as clone volume data copy dress in some embodiments
Set 1 hard disk.Memory 11 is also possible to the External memory equipment of clone volume data copy device 1 in further embodiments,
Such as the plug-in type hard disk being equipped on clone volume data copy device 1, intelligent memory card (Smart Media Card, SMC), peace
Digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, memory 11 can also be wrapped both
The internal storage unit for including clone volume data copy device 1 also includes External memory equipment.Memory 11 can be not only used for depositing
Storage is installed on application software and Various types of data, such as the code of data copy program 01 of clone volume data copy device 1 etc., also
It can be used for temporarily storing the data that has exported or will export.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit,
CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 11
Code or processing data, such as execute data copy program 01 etc..
Network interface 13 optionally may include standard wireline interface and wireless interface (such as WI-FI interface), be commonly used in
Communication connection is established between the device 1 and other electronic equipments.
Communication bus is for realizing the connection communication between these components.
Optionally, which can also include user interface, and user interface may include display (Display), input
Unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface and wireless interface.It is optional
Ground, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch-control liquid crystal display and OLED
(Organic Light-Emitting Diode, Organic Light Emitting Diode) touches device etc..Wherein, display can also be appropriate
Referred to as display screen or display unit, for be shown in the information handled in clone volume data copy device 1 and for show can
Depending on the user interface changed.
Fig. 4 illustrates only the clone volume data copy device 1 with component 11-13 and data copy program 01, ability
Field technique personnel, can be with it is understood that structure shown in fig. 1 does not constitute the restriction to clone volume data copy device 1
Including perhaps combining certain components or different component layouts than illustrating less perhaps more components.
In 1 embodiment of device shown in Fig. 4, data copy program 01 is stored in memory 11;Processor 12 executes
Following steps are realized when the data copy program 01 stored in memory 11:
When receiving data access request of the client to target clone volume, determine that the data access request is corresponding
Object is accessed, and searches whether have the corresponding data content of the access object on the target clone volume.
If there is no the corresponding data content of the access object on the target clone volume, it is determined that with the clone volume pair
The snapped volume answered, and the data content is searched from the snapped volume.
Snapshot refers to one to some specific file system in some specific time mirror with read only attribute
Picture.Snapshot is in order to save the system for field at some time point and beat a snapshot at some time point, then what access snapshot obtained
Data are exactly the data of system in that time point.Based on the principle that there is no storage fathers in the snapped volume of initial creation
Stored information in mirror image does not have physical data duplication, only replicates initial data after Snapshot time point
The metadata of physical location.Therefore, snapshot creation is very fast, can be completed with moment.Then, the data variation of original volume is tracked,
Once the generation of original volume data block updates for the first time, then original volume data block is first read and be written snapped volume, then use new data
Block covers original volume.But the snapped volume has read only attribute, user can not carry out the data on snapped volume by client
Modification, can not also be written new data.Therefore, when user needs to establish gram of the snapped volume in the enterprising row write operation of snapped volume
Grand volume, clone volume have readable writeable attribute.
If there is no the data content on current snapped volume, according to current snapshot level step by step from a upper level
The corresponding data content of the access object is searched in snapped volume, until finding the access from the snapped volume of a level
The corresponding data content of object.
If finding the data content from the snapped volume of any level, the data content is sent to the visitor
Family end.
If corresponding original from the snapped volume of highest level without the data content in the snapped volume of each level
The data content is searched in volume, and the data content is sent to the client.
The data content is written in the target clone volume.
Referring to shown in Fig. 3, snapped volume C1, snapped volume C2, snapped volume C3 respectively create in three different moments original
Roll up C snapped volume, these three snapped volumes for a user, all only have read only attribute, it is assumed that user will to snapped volume C2 into
Row write operation, can create the clone volume D1 of snapped volume C2 at this time.When user accesses the data on clone volume D1, with the clone
Volume is target clone volume, sends the data access request to target clone volume by user end to server, server is receiving
To after data access request, the corresponding access object of data access request is determined, whether search on the target clone volume has access
The corresponding data of object.
For server, after establishing the snapped volume of original volume, which, which is one, only has reading attribute
Mirror image can be covered after corresponding data copy to snapped volume with new data block when user modifies the data in original volume
Data block in lid original volume.And those will not be then copied into snapped volume there is no crossing the data of modification.Due to
Clone volume D1 is backed up to total data current on snapped volume C2.That is, in data no on snapped volume C2
Hold, does not also have on clone volume D1.Therefore, when user accesses the data in clone volume, may and access be not present in clone volume
The corresponding specific data content of object then needs to copy from father's mirror image of the clone volume.Specifically, corresponding from target clone volume
Snapped volume in search the corresponding data content of access object and be sent to client if finding, if searching less than pressing
The corresponding data content of access object is searched from the snapped volume of a upper level step by step according to current snapshot level, until from one
The corresponding data content of access object is found in the snapped volume of level, if finding in data from the snapped volume of any level
Hold, then data content is sent to client, if without the data content in the snapped volume of each level, from top
Data content is searched in the corresponding original volume of snapped volume of grade, and data content is sent to the client.
Since user can also establish the snapped volume of snapped volume as needed, multi-layer snapshot will form in this way, referring to Fig. 4
It is shown.
When snapshot level is excessive, father's mirror image of a snapped volume may be the clone volume of snapped volume, it is also possible to original
Volume.For example, referring to shown in upper figure, snapped volume C2 is the snapshot of the original volume C created at the T2 moment, and snapped volume C21 is to create at the T2 moment
The snapshot of the snapped volume C2 built first does a clone volume based on snapped volume, then beat fastly to clone volume when beating snapshot for snapped volume
According to.Therefore, the snapshot of snapped volume C2 is created, first to create clone volume C2 ' for it, then create the snapped volume of clone volume C2 '
C21. the father's mirror image for being snapped volume C21 is clone volume C2 ', and father's mirror image of clone volume C2 ' is snapped volume C2, father's mirror of snapped volume C2
As being original volume C.The figure is one and has the case where there are two level snapshots, and in practical applications, user can according to need wound
Build the snapshot of more levels.When server is searched from snapped volume C21 less than the access corresponding data content of object, need from
It is searched on his father's mirror image, i.e., searches from the clone volume C2 ' of snapped volume C2, then searched from snapped volume C2, if from snapped volume
It is still searched less than then being searched from his father's mirror image, i.e. original volume C on C2.I.e. when there are multi-layer snapshot, if fast from target
According on volume search less than needs data content, then according to the target snapshot roll up current snapshot level successively from upper one layer
It is searched in grade father's mirror image, until finding the data content of needs.
Further, it is to be appreciated that data copy program 01 can also be executed by processor 12, with the determination with it is described
The corresponding snapped volume of clone volume, and after the step of searching the data content from the snapped volume, also realize following steps:
If finding the corresponding data content of the access object from the snapped volume, the data content is obtained,
And it is sent to the client.If the data content of needs can be found from snapped volume C21 or snapped volume C2, directly
Data content is sent to client.
Further, in one embodiment, data copy program 01 can also be executed by processor 12, by the data
Content is written to before the step in the target clone volume, also realization following steps: obtaining the data content of record
Accumulative access times;If the accumulative access times be greater than or equal to the second preset threshold, execute it is described will be in the data
Hold the step being written in the target clone volume: if the accumulative access times are less than second preset threshold, updating
The accumulative access times.
In this embodiment, the accessed number of access object is counted in clone volume, is being got in data
Hold and be sent to after client, obtain the accumulative access times of the data content of record, and judge the number whether be greater than or
Equal to the second preset threshold, if so, can be determined that the data are repeatedly accessed, following a possibility that being accessed, is bigger, is
Allow the user rapidly to get the data content of access, then the data content be written in target clone volume,
When user accesses next time, data can be obtained directly from clone volume and return to client.If accumulative access times are less than the
Two preset thresholds need to only update the accumulative access times then without copying data.
In this way, an access is arranged to those each objects for existing only in father's mirror image in clone volume to count
Number, if within certain time being more than the threshold values set.Just automatically by the object data from father mirror-image copies to clone volume in.
For the data that those are not present in clone volume but often access within certain time, the speed for accessing this data can be improved
Degree, avoid data disposably from father mirror-image copies to clone volume in, cause the busy influence of system read-write in a period of time
Service operation.
Further, data copy program 01 can also be executed by processor 12, to realize following steps: at interval of it is default when
It is long, the accumulative access times recorded in the snapped volume and clone volume of each level are reset.
The meaning of access count is the frequent degree for showing that the data are accessed in certain time.At interval of it is default when
Long, the meaning that accumulative access times are zeroed out is: if do not reset, what this value represented is exactly to bring into operation from system
Since the number that accesses.In this case, if certain data accumulations half a year just reaches the second preset threshold, its is accessed
Frequency and infrequently does not need actually in such data copy to clone volume, avoiding occupying additional memory space yet.
Alternatively, in other embodiments, when determining the time point for receiving the data access request, and determining described
Between put until prefixed time interval in, to the accumulative access times of the data content;If the accumulative access times are greater than
Or be equal to the first preset threshold, then execute the step data content being written in the target clone volume.
The access time of each data content is counted, after client accesses a data content, to the data
The accessed number of content within a preset time interval is counted, if it is greater than or equal to the first preset threshold, by the number
It is written in target clone volume according to content.
The clone volume data copy device that the present embodiment proposes, when receiving client to the data access of target clone volume
When request, the corresponding access object of data access request is determined, and whether search on target clone volume has access object corresponding
Data content;If without the corresponding data content of access object on target clone volume, it is determined that snapped volume corresponding with clone volume,
And data content is searched from snapped volume;If there is no data content on current snapped volume, according to current snapshot level by
Grade searches the corresponding data content of access object from father's mirror image of a upper level, until searching from father's mirror image of a level
To the corresponding data content of access object;If finding data content from the snapped volume of any level, data content is sent out
It send to client;If corresponding original from the snapped volume of highest level without data content in the snapped volume of each level
Data content is searched in volume, and data content is sent to client;Data content is written in target clone volume.The program
The data content for accessing for user and not having for the first time in clone volume, is sent to client after successively finding in his father's mirror image
End, and it is copied to what clone volume was merely able to, if user accesses again, number can be directly got from clone volume
According to improving clone volume for the response speed of data access request, and the program is not necessarily to the total data in original volume
It is disposable all to copy in snapped volume, reduce the waste of disk space in clone volume data copy.
Optionally, in other examples, data copy program can also be divided into one or more module, and one
A or multiple modules are stored in memory 11, and are held by one or more processors (the present embodiment is by processor 12)
For row to complete the present invention, the so-called module of the present invention is the series of computation machine program instruction section for referring to complete specific function,
For describing implementation procedure of the data copy program in clone volume data copy device.
It is the data copy program in one embodiment of clone volume data copy device of the present invention for example, referring to shown in Fig. 5
Program module schematic diagram, in the embodiment, data copy program can be divided into data search module 10, data transmission blocks
20 and data copy module 30, illustratively:
Data search module 10 is used for: when receiving data access request of the client to target clone volume, determining institute
The corresponding access object of data access request is stated, and searches whether have the corresponding number of the access object on the target clone volume
According to content;
Data search module 10 is also used to: if not having in the corresponding data of the access object on the target clone volume
Hold, it is determined that snapped volume corresponding with the clone volume, and the data content is searched from the snapped volume;
And if there is no the data content on current snapped volume, according to current snapshot level step by step from upper one
The corresponding data content of the access object is searched in the snapped volume of level, until finding institute from the snapped volume of a level
State the corresponding data content of access object;
Data transmission blocks 20 are used for:, will be described if finding the data content from the snapped volume of any level
Data content is sent to the client;
Data search module 10 is also used to: if without the data content in the snapped volume of each level, from highest
The data content is searched in the corresponding original volume of the snapped volume of level;
Data transmission blocks 20 are also used to: the data content found from original volume is sent to the client;
Data copy module 30 is used for: the data content is written in the target clone volume.
The program modules such as above-mentioned data search module 10, data transmission blocks 20 and data copy module 30 are performed institute
Functions or operations step and above-described embodiment of realization are substantially the same, and details are not described herein.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
On be stored with data copy program, the data copy program can be executed by one or more processors, to realize following operation:
When receiving data access request of the client to target clone volume, determine that the data access request is corresponding
Object is accessed, and searches whether have the corresponding data content of the access object on the target clone volume;
If there is no the corresponding data content of the access object on the target clone volume, it is determined that with the clone volume pair
The snapped volume answered, and the data content is searched from the snapped volume;
If there is no the data content on current snapped volume, according to current snapshot level step by step from a upper level
The corresponding data content of the access object is searched in snapped volume, until finding the access from the snapped volume of a level
The corresponding data content of object;
If finding the data content from the snapped volume of any level, the data content is sent to the visitor
Family end;
If corresponding original from the snapped volume of highest level without the data content in the snapped volume of each level
The data content is searched in volume, and the data content is sent to the client;
The data content is written in the target clone volume.
Computer readable storage medium specific embodiment of the present invention and above-mentioned clone volume data copy device and method are each
Embodiment is essentially identical, does not make tired state herein.
It should be noted that the serial number of the above embodiments of the invention is only for description, do not represent the advantages or disadvantages of the embodiments.And
The terms "include", "comprise" herein or any other variant thereof is intended to cover non-exclusive inclusion, so that packet
Process, device, article or the method for including a series of elements not only include those elements, but also including being not explicitly listed
Other element, or further include for this process, device, article or the intrinsic element of method.Do not limiting more
In the case where, the element that is limited by sentence "including a ...", it is not excluded that including process, device, the article of the element
Or there is also other identical elements in method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of clone volume data copying method, which is characterized in that the described method includes:
When receiving data access request of the client to target clone volume, the corresponding access of the data access request is determined
Object, and search whether have the corresponding data content of the access object on the target clone volume;
If there is no the corresponding data content of the access object on the target clone volume, it is determined that corresponding with the clone volume
Snapped volume, and the data content is searched from the snapped volume;
If there is no the data content on current snapped volume, according to current snapshot level step by step from the snapshot of a upper level
The corresponding data content of the access object is searched in volume, until finding the access object from the snapped volume of a level
Corresponding data content;
If finding the data content from the snapped volume of any level, the data content is sent to the client
End;
If without the data content in the snapped volume of each level, from the corresponding original volume of snapped volume of highest level
The data content is searched, and the data content is sent to the client;
The data content is written in the target clone volume.
2. clone volume data copying method as described in claim 1, which is characterized in that described to be written to the data content
Before step in the target clone volume, the method also includes steps:
It determines and receives time point of the data access request, and determine the prefixed time interval until the time point
It is interior, to the accumulative access times of the data content;
If the accumulative access times are greater than or equal to the first preset threshold, execute and the data content is written to the mesh
Mark the step in clone volume.
3. clone volume data copying method as described in claim 1, which is characterized in that described to be written to the data content
Before step in the target clone volume, the method also includes steps:
Obtain the accumulative access times of the data content of record;
If the accumulative access times are greater than or equal to the second preset threshold, execute and described the data content is written to institute
State the step in target clone volume:
If the accumulative access times are less than second preset threshold, the accumulative access times are updated.
4. clone volume data copying method as claimed in claim 3, which is characterized in that the method also includes steps:
At interval of preset duration, the accumulative access times recorded in each clone volume are reset.
5. clone volume data copying method according to any one of claims 1 to 4, which is characterized in that the determination and institute
The corresponding snapped volume of clone volume is stated, and after the step of searching the data content from the snapped volume, this method further includes
Following steps:
If finding the corresponding data content of the access object from the snapped volume, the data content is obtained, concurrently
It send to the client.
6. a kind of clone volume data copy device, which is characterized in that described device includes memory and processor, the memory
On be stored with the data copy program that can be run on the processor, when the data copy program is executed by the processor
Realize following steps:
When receiving data access request of the client to target clone volume, the corresponding access of the data access request is determined
Object, and search whether have the corresponding data content of the access object on the target clone volume;
If there is no the corresponding data content of the access object on the target clone volume, it is determined that corresponding with the clone volume
Snapped volume, and the data content is searched from the snapped volume;
If there is no the data content on current snapped volume, according to current snapshot level step by step from the snapshot of a upper level
The corresponding data content of the access object is searched in volume, until finding the access object from the snapped volume of a level
Corresponding data content;
If finding the data content from the snapped volume of any level, the data content is sent to the client
End;
If without the data content in the snapped volume of each level, from the corresponding original volume of snapped volume of highest level
The data content is searched, and the data content is sent to the client;
The data content is written in the target clone volume.
7. clone volume data copy device as claimed in claim 6, which is characterized in that the data copy program can also be by institute
Processor execution is stated, also to realize such as before the step that the data content is written in the target clone volume
Lower step:
Obtain the accumulative access times of the data content of record;
If the accumulative access times are greater than or equal to the second preset threshold, execute and described the data content is written to institute
State the step in target clone volume:
If the accumulative access times are less than second preset threshold, the accumulative access times are updated.
8. clone volume data copy device as claimed in claim 7, which is characterized in that the data copy program can also be by institute
Processor execution is stated, to realize following steps:
At interval of preset duration, the accumulative access times recorded in each clone volume are reset.
9. the clone volume data copy device as described in any one of claim 6 to 8, which is characterized in that the data copy
Program can also be executed by the processor, in determination snapped volume corresponding with the clone volume, and from the snapped volume
After the step of upper lookup data content, following steps are also realized:
If finding the corresponding data content of the access object from the snapped volume, the data content is obtained, concurrently
It send to the client.
10. a kind of computer readable storage medium, which is characterized in that be stored with data on the computer readable storage medium and copy
Shellfish program, the data copy program can be executed by one or more processor, to realize as any in claim 1 to 5
The step of clone volume data copying method described in item.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811252831.2A CN109597707B (en) | 2018-10-25 | 2018-10-25 | Clone volume data copying method, device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811252831.2A CN109597707B (en) | 2018-10-25 | 2018-10-25 | Clone volume data copying method, device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109597707A true CN109597707A (en) | 2019-04-09 |
CN109597707B CN109597707B (en) | 2024-04-23 |
Family
ID=65957458
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811252831.2A Active CN109597707B (en) | 2018-10-25 | 2018-10-25 | Clone volume data copying method, device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109597707B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110008067A (en) * | 2019-04-15 | 2019-07-12 | 苏州浪潮智能科技有限公司 | A kind of method, apparatus and distributed memory system of writeable snapshot chain type clone |
CN110750496A (en) * | 2019-10-23 | 2020-02-04 | 深信服科技股份有限公司 | File copying method, system, equipment and computer readable storage medium |
CN110795389A (en) * | 2019-10-28 | 2020-02-14 | 深信服科技股份有限公司 | Storage snapshot based copying method, user equipment, storage medium and device |
CN111399774A (en) * | 2020-03-09 | 2020-07-10 | 星辰天合(北京)数据科技有限公司 | Data processing method and device based on snapshot under distributed storage system |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102043687A (en) * | 2009-10-20 | 2011-05-04 | 杭州华三通信技术有限公司 | Copy on first write device for realizing data snapshot and control method |
CN102411524A (en) * | 2011-12-30 | 2012-04-11 | 云海创想信息技术(天津)有限公司 | Snapshot volume data copying method |
CN102834811A (en) * | 2010-05-25 | 2012-12-19 | 国际商业机器公司 | Multiple cascaded backup process |
CN103038767A (en) * | 2010-07-30 | 2013-04-10 | 国际商业机器公司 | Data sharing for file clones |
CN103180852A (en) * | 2012-08-09 | 2013-06-26 | 华为技术有限公司 | Distributed data processing method and apparatus |
CN104463014A (en) * | 2014-12-10 | 2015-03-25 | 上海爱数软件有限公司 | Snapshot-based Oracle database protection method |
US9009106B1 (en) * | 2011-08-10 | 2015-04-14 | Nutanix, Inc. | Method and system for implementing writable snapshots in a virtualized storage environment |
CN105446831A (en) * | 2015-11-09 | 2016-03-30 | 上海爱数信息技术股份有限公司 | Server-Free backup method in conjunction with SAN |
CN105893186A (en) * | 2016-04-01 | 2016-08-24 | 浪潮电子信息产业股份有限公司 | Method, device and system for verifying stored disaster recovery data |
CN107015761A (en) * | 2015-10-12 | 2017-08-04 | 国际商业机器公司 | The time point cloned using chain is copied |
CN107256182A (en) * | 2017-05-03 | 2017-10-17 | 上海上讯信息技术股份有限公司 | A kind of method and apparatus of database restoration |
CN107291883A (en) * | 2017-06-20 | 2017-10-24 | 郑州云海信息技术有限公司 | The Snapshot Method and device of a kind of distributed memory system |
CN107291391A (en) * | 2017-06-21 | 2017-10-24 | 郑州云海信息技术有限公司 | A kind of data processing method and system for distributed memory system |
CN107924293A (en) * | 2015-09-21 | 2018-04-17 | 国际商业机器公司 | Copy on write redirects |
-
2018
- 2018-10-25 CN CN201811252831.2A patent/CN109597707B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102043687A (en) * | 2009-10-20 | 2011-05-04 | 杭州华三通信技术有限公司 | Copy on first write device for realizing data snapshot and control method |
CN102834811A (en) * | 2010-05-25 | 2012-12-19 | 国际商业机器公司 | Multiple cascaded backup process |
CN103038767A (en) * | 2010-07-30 | 2013-04-10 | 国际商业机器公司 | Data sharing for file clones |
US9009106B1 (en) * | 2011-08-10 | 2015-04-14 | Nutanix, Inc. | Method and system for implementing writable snapshots in a virtualized storage environment |
CN102411524A (en) * | 2011-12-30 | 2012-04-11 | 云海创想信息技术(天津)有限公司 | Snapshot volume data copying method |
CN103180852A (en) * | 2012-08-09 | 2013-06-26 | 华为技术有限公司 | Distributed data processing method and apparatus |
CN104463014A (en) * | 2014-12-10 | 2015-03-25 | 上海爱数软件有限公司 | Snapshot-based Oracle database protection method |
CN107924293A (en) * | 2015-09-21 | 2018-04-17 | 国际商业机器公司 | Copy on write redirects |
CN107015761A (en) * | 2015-10-12 | 2017-08-04 | 国际商业机器公司 | The time point cloned using chain is copied |
CN105446831A (en) * | 2015-11-09 | 2016-03-30 | 上海爱数信息技术股份有限公司 | Server-Free backup method in conjunction with SAN |
CN105893186A (en) * | 2016-04-01 | 2016-08-24 | 浪潮电子信息产业股份有限公司 | Method, device and system for verifying stored disaster recovery data |
CN107256182A (en) * | 2017-05-03 | 2017-10-17 | 上海上讯信息技术股份有限公司 | A kind of method and apparatus of database restoration |
CN107291883A (en) * | 2017-06-20 | 2017-10-24 | 郑州云海信息技术有限公司 | The Snapshot Method and device of a kind of distributed memory system |
CN107291391A (en) * | 2017-06-21 | 2017-10-24 | 郑州云海信息技术有限公司 | A kind of data processing method and system for distributed memory system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110008067A (en) * | 2019-04-15 | 2019-07-12 | 苏州浪潮智能科技有限公司 | A kind of method, apparatus and distributed memory system of writeable snapshot chain type clone |
CN110008067B (en) * | 2019-04-15 | 2020-07-07 | 苏州浪潮智能科技有限公司 | Method and device for writable snapshot chain clone and distributed storage system |
CN110750496A (en) * | 2019-10-23 | 2020-02-04 | 深信服科技股份有限公司 | File copying method, system, equipment and computer readable storage medium |
CN110795389A (en) * | 2019-10-28 | 2020-02-14 | 深信服科技股份有限公司 | Storage snapshot based copying method, user equipment, storage medium and device |
CN110795389B (en) * | 2019-10-28 | 2022-09-30 | 深信服科技股份有限公司 | Storage snapshot based copying method, user equipment, storage medium and device |
CN111399774A (en) * | 2020-03-09 | 2020-07-10 | 星辰天合(北京)数据科技有限公司 | Data processing method and device based on snapshot under distributed storage system |
CN111399774B (en) * | 2020-03-09 | 2021-09-14 | 星辰天合(北京)数据科技有限公司 | Data processing method and device based on snapshot under distributed storage system |
Also Published As
Publication number | Publication date |
---|---|
CN109597707B (en) | 2024-04-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102240557B1 (en) | Method, device and system for storing data | |
US11853549B2 (en) | Index storage in shingled magnetic recording (SMR) storage system with non-shingled region | |
CN109597707A (en) | Clone volume data copying method, device and computer readable storage medium | |
CN1517885B (en) | Method and system for updating central cache by atomicity | |
CN104699423B (en) | The method and apparatus that drive is bound in linux system | |
CN109902255B (en) | Page mixed browsing record generation method, device, equipment and storage medium | |
CN110989937B (en) | Data storage method, device and equipment and computer readable storage medium | |
CN109804359A (en) | For the system and method by write back data to storage equipment | |
CN107592118A (en) | The coding/decoding method and device of Variable Length Code file | |
CN109491962A (en) | A kind of file directory tree management method and relevant apparatus | |
CN112000971B (en) | File permission recording method, system and related device | |
CN105653539A (en) | Index distributed storage implement method and device | |
CN109783321A (en) | Monitoring data management method, device, terminal device | |
CN113836116A (en) | Data migration method and device, electronic equipment and readable storage medium | |
CN114385657A (en) | Data storage method, device and storage medium | |
US11580128B2 (en) | Preventing DBMS deadlock by eliminating shared locking | |
CN108804258A (en) | Data reconstruction method, device, mobile terminal and storage medium | |
CN112036133B (en) | File storage method and device, electronic equipment and storage medium | |
CN114860380A (en) | Data synchronization method and device, electronic equipment and computer readable storage medium | |
CN110209351B (en) | Distributed storage data processing method and device | |
CN109582638A (en) | Snapshot volume data copying method, device and computer readable storage medium | |
CN113485642A (en) | Data caching method and device | |
CN114428790A (en) | Data concurrent processing method and device, electronic equipment and storage medium | |
WO2015058628A1 (en) | File access method and device | |
CN113805787A (en) | Data writing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |