CN109597707B - 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 PDF

Info

Publication number
CN109597707B
CN109597707B CN201811252831.2A CN201811252831A CN109597707B CN 109597707 B CN109597707 B CN 109597707B CN 201811252831 A CN201811252831 A CN 201811252831A CN 109597707 B CN109597707 B CN 109597707B
Authority
CN
China
Prior art keywords
volume
data content
data
snapshot
clone volume
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811252831.2A
Other languages
Chinese (zh)
Other versions
CN109597707A (en
Inventor
龙飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811252831.2A priority Critical patent/CN109597707B/en
Publication of CN109597707A publication Critical patent/CN109597707A/en
Application granted granted Critical
Publication of CN109597707B publication Critical patent/CN109597707B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management 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 invention relates to data processing, and discloses a clone volume data copying method, which comprises the following steps: receiving a data access request of a client to a target clone volume, determining an access object corresponding to the request, and searching whether the target clone volume has data content corresponding to the access object; if not, searching from the snapshot volume corresponding to the clone volume; if not, searching data content from the snapshot volume of the previous level step by step according to the snapshot level; if the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client; if no data content exists in the snapshot volumes of each level, searching the data content from the original volume corresponding to the snapshot volume of the highest level and sending the data content to the client; the data content is written to the target clone volume. The invention also provides a clone volume data copying device and a computer readable storage medium. The invention reduces the waste of disk space and the busy read-write business in the clone volume data copy.

Description

Clone volume data copying method, device and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a clone volume data copying method, apparatus, and computer readable storage medium.
Background
The accelerated development of information technology makes the scale of key business data of enterprises expand increasingly, and enterprises not only require larger and larger storage capacity, but also require higher and higher data security. As the demand for storage applications increases, users need to backup and protect data online. Snapshot and cloning techniques can effectively implement online data protection and online data backup. A snapshot is a fully available copy of the original volume that includes an image of the original volume at some point in time. The designated data set is referred to as an original volume and the image at a point in time is referred to as a snapshot volume.
Typically, a snapshot volume has a read-only property, and when a user needs to modify the data content on the snapshot volume or write new data on the snapshot volume, a clone volume of the snapshot volume needs to be established, and a write operation is implemented on the clone volume. Since no data copy is made when a snapshot is taken of the original volume, there is no data copy on the clone volume of the snapshot volume and when a user accesses data that is not on the clone volume, it is necessary to copy from the original volume. The existing solution is to copy all the data on the original volume and the data not on the clone volume into the clone volume at one time, but the copy mode can cause that the system is busy in reading and writing in a period of time to influence the operation of the service, and in practical application, only a small part of storage space in the original volume often stores meaningful data, and most of storage space stores data which cannot be accessed by the clone volume, so that a large amount of meaningless data is copied in the clone volume, and the disk space is wasted.
Disclosure of Invention
The invention provides a clone volume data copying method, a clone volume data copying device and a computer readable storage medium, which mainly aim to reduce the waste of disk space and the busy condition of read-write business in clone volume data copying.
In order to achieve the above object, the present invention further provides a clone volume data copying method, which includes:
When a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not;
If the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume;
If the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level;
If the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client;
If the data content is not contained in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client;
and writing the data content into the target clone volume.
Optionally, before the step of writing the data content to the target clone volume, the method further comprises the steps of:
determining a time point when the data access request is received, and judging the accumulated access times of the data content in a preset time interval until the time point;
And if the accumulated access times are greater than or equal to a first preset threshold value, executing the step of writing the data content into the target clone volume.
Optionally, before the step of writing the data content to the target clone volume, the method further comprises the steps of:
acquiring recorded accumulated access times of the data content;
and if the accumulated access times are greater than or equal to a second preset threshold, executing the step of writing the data content into the target clone volume:
And if the accumulated access times are smaller than the second preset threshold value, updating the accumulated access times.
Optionally, the method further comprises the steps of:
And resetting the accumulated access times recorded in each clone volume for each preset time interval.
Optionally, after the step of determining the snapshot volume corresponding to the clone volume and searching the data content from the snapshot volume, the method further includes the steps of:
and if the data content corresponding to the access object is found out from the snapshot volume, acquiring the data content and sending the data content to the client.
In addition, in order to achieve the above object, the present invention provides a clone volume data copying device, which includes a memory and a processor, wherein a data copying program capable of being executed on the processor is stored in the memory, and the data copying program is executed by the processor to implement the following steps:
When a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not;
If the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume;
If the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level;
If the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client;
If the data content is not contained in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client;
and writing the data content into the target clone volume.
Optionally, the data copy program is further executable by the processor to, prior to the step of writing the data content to the target clone volume, further implement the steps of:
acquiring recorded accumulated access times of the data content;
and if the accumulated access times are greater than or equal to a second preset threshold, executing the step of writing the data content into the target clone volume:
And if the accumulated access times are smaller than the second preset threshold value, updating the accumulated access times.
Optionally, the data copy program may be further executable by the processor to implement the steps of:
And resetting the accumulated access times recorded in each clone volume for each preset time interval.
Optionally, the data copy program may be further executed by the processor to implement, after the step of determining a snapshot volume corresponding to the clone volume and searching for the data content from the snapshot volume, the steps of:
and if the data content corresponding to the access object is found out from the snapshot volume, acquiring the data content and sending the data content to the client.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a data copy program executable by one or more processors to implement the steps of the clone volume data copy method as described above.
When receiving a data access request of a client to a target clone volume, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not; if the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume; if the current snapshot volume has no data content, searching the data content corresponding to the access object from the parent mirror image of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the parent mirror image of one level; if the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client; if no data content exists in the snapshot volumes of each level, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client; the data content is written to the target clone volume. According to the scheme, for the data content which is accessed for the first time by a user and is not in the clone volume, the data content is searched from the father mirror image layer by layer and then sent to the client, and the data content is copied to the clone volume only.
Drawings
FIG. 1 is a flowchart illustrating a method for cloning volume data copy according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of association between a clone volume and a snapshot volume in a clone volume data copy method according to an embodiment of the present invention;
FIG. 3 is a schematic view of a snapshot hierarchy of a method for copying data of a clone volume according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating an internal structure of a clone volume data copying device according to an embodiment of the present invention;
Fig. 5 is a schematic block diagram of a data copying program in a clone volume data copying device according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a clone volume data copying method. Referring to fig. 1, a flowchart of a clone volume data copying method according to an embodiment of the present invention is shown. The method may be performed by an apparatus, which may be implemented in software and/or hardware.
In this embodiment, the clone volume data copy method includes:
Step S10, when a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not.
Step S20, if the target clone volume has no data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume.
A snapshot refers to a mirror image of a particular file system that has read-only properties for a particular time. Taking a snapshot at a point in time, the data from accessing the snapshot is the data of the system at that point in time. Based on such a principle, the information already stored in the parent image is not stored in the snapshot volume that is initially created, and after the snapshot time point, no physical data duplication occurs, only metadata of the physical location of the original data is duplicated. Thus, snapshot creation is very fast and can be accomplished instantaneously. Then, the original volume data changes are tracked, once the original volume data blocks are updated for the first time, the original volume data blocks are read out and written into the snapshot volume, and then the original volume is covered with new data blocks. However, the snapshot volume has a read-only property, and a user cannot modify data on the snapshot volume through a client, and cannot write new data. Thus, when a user needs to write on a snapshot volume, a clone volume of the snapshot volume is created, the clone volume having readable and writable properties.
Step S30, if the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level.
Step S40, if the data content is found from the snapshot volumes of any hierarchy, the data content is sent to the client.
And step S50, if the data content is not in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client.
Step S60, writing the data content into the target clone volume.
Referring to fig. 3, snapshot volumes C1, C2, and C3 are snapshot volumes of original volume C created at three different times, respectively, all of which have only read-only properties for the user, assuming that the user is to write to snapshot volume C2, clone volume D1 of snapshot volume C2 may be created at this time. When a user accesses data on the clone volume D1, the clone volume is taken as a target clone volume, a data access request for the target clone volume is sent to a server through a client, the server determines an access object corresponding to the data access request after receiving the data access request, and whether the target clone volume has the data corresponding to the access object or not is searched.
For the server, after a snapshot volume of the original volume is established, the snapshot volume is a mirror image with only read properties, when a user modifies data in the original volume, the corresponding data is copied to the snapshot volume, and then the data blocks in the original volume are covered with new data blocks. And data that has not been modified is not copied to the snapshot volume. Since clone volume D1 is backing up all of the current data on snapshot volume C2. That is, there is no data content on snapshot volume C2, nor on clone volume D1. Thus, when a user accesses data in a clone volume, there may not be specific data content corresponding to the access object in the clone volume, and a copy from the parent image of the clone volume is required. Specifically, searching data content corresponding to an access object from a snapshot volume corresponding to a target clone volume, if the data content is not found, searching the data content corresponding to the access object from a snapshot volume of a previous level step by step according to a current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level, if the data content is searched from the snapshot volume of any level, sending the data content to the client, and if the data content is not found in the snapshot volumes of all levels, searching the data content from an original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client.
Since the user can also create snapshot volumes of the snapshot volumes as desired, a multi-level snapshot is formed, as shown with reference to FIG. 4.
When the snapshot level is too high, the parent image of one snapshot volume may be the clone volume of the snapshot volume or the original volume. For example, referring to the above figure, snapshot volume C2 is a snapshot of original volume C created at time T2, snapshot volume C21 is a snapshot of snapshot volume C2 created at time T2, and when snapshot is made for the snapshot volume, a clone volume is made based on the snapshot volume first, and then snapshot is made for the clone volume. Therefore, to create a snapshot of snapshot volume C2, clone volume C2 'is created for it first, and then snapshot volume C21 of clone volume C2' is created, i.e., the parent image of snapshot volume C21 is clone volume C2', the parent image of clone volume C2' is snapshot volume C2, and the parent image of snapshot volume C2 is original volume C. The figure shows a case with two levels of snapshots, in practical application, the user can create more levels of snapshots as needed. When the server cannot find the data content corresponding to the access object from the snapshot volume C21, it needs to find the data content from its parent mirror, i.e. from the clone volume C2' of the snapshot volume C2, then from the snapshot volume C2, and if the data content is still not found from the snapshot volume C2, then from its parent mirror, i.e. the original volume C. If the needed data content cannot be found from the target snapshot volume when the multi-level snapshot exists, searching from the parent mirror image of the previous level by level according to the current snapshot level of the target snapshot volume until the needed data content is found.
Furthermore, it will be appreciated that after the step of determining the snapshot volume corresponding to the clone volume and searching for the data content from the snapshot volume, the method further includes the steps of:
and if the data content corresponding to the access object is found out from the snapshot volume, acquiring the data content and sending the data content to the client. If the required data content can be found from the snapshot volume C21 or the snapshot volume C2, the data content is directly sent to the client.
Further, in an embodiment, before the step of writing the data content to the target clone volume, the method further comprises the step of: acquiring recorded accumulated access times of the data content; and if the accumulated access times are greater than or equal to a second preset threshold, executing the step of writing the data content into the target clone volume: and if the accumulated access times are smaller than the second preset threshold value, updating the accumulated access times.
In this embodiment, the number of times of access to the access object is counted in the clone volume, after the data content is obtained and sent to the client, the accumulated number of times of access to the recorded data content is obtained, and whether the number of times is greater than or equal to a second preset threshold is determined, if yes, the data can be determined to be accessed multiple times, the possibility of future access is relatively high, in order to enable the user to quickly obtain the accessed data content, the data content is written into the target clone volume, and when the user accesses next time, the data can be directly obtained from the clone volume and returned to the client. If the accumulated access times are smaller than the second preset threshold, the data do not need to be copied, and only the accumulated access times need to be updated.
In this way, an access count is set in the clone volume for each object that exists only in the parent image if the set threshold is exceeded for a certain period of time. The object data is automatically copied from the parent image to the clone volume. For data which does not exist in the clone volume but is accessed frequently in a certain period of time, the speed of accessing the data can be increased, and the problem that the business operation is influenced due to busy system reading and writing in a period of time caused by once copying the data from the parent mirror image to the clone volume is avoided.
Further, the method comprises the following steps: and resetting the accumulated access times recorded in the snapshot volume and the clone volume of each level at preset time intervals.
The significance of the access count is to indicate how frequently the data is accessed over a period of time. The significance of resetting the accumulated access times per preset time interval is that: if not cleared, this value represents the number of accesses since the system began to run. In this way, if some data accumulates for half a year before reaching the second preset threshold, then it is accessed less frequently and it is not actually necessary to copy such data onto the clone volume, avoiding taking up additional storage space.
Or in other embodiments, determining a time point when the data access request is received, and judging the accumulated access times to the data content in a preset time interval until the time point; and if the accumulated access times are greater than or equal to a first preset threshold value, executing the step of writing the data content into the target clone volume.
And counting the access time of each data content, counting the number of times that the data content is accessed in a preset time interval after the client accesses the data content, and writing the data content into a target clone volume if the number of times is larger than or equal to a first preset threshold value.
According to the clone volume data copying method, when a data access request of a client to a target clone volume is received, an access object corresponding to the data access request is determined, and whether data content corresponding to the access object exists on the target clone volume or not is searched; if the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume; if the current snapshot volume has no data content, searching the data content corresponding to the access object from the parent mirror image of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the parent mirror image of one level; if the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client; if no data content exists in the snapshot volumes of each level, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client; the data content is written to the target clone volume. According to the scheme, for the data content which is accessed for the first time by a user and is not in the clone volume, the data content is searched from the father mirror image layer by layer and then sent to the client, and the data content is copied to the clone volume only.
The invention also provides a clone volume data copying device. Referring to fig. 4, an internal structure of a clone volume data copying device according to an embodiment of the present invention is shown.
In this embodiment, the clone volume data copying device 1 may be a PC (Personal Computer ), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer. The clone volume data copying device 1 comprises at least a memory 11, a processor 12, a network interface 13 and a communication bus.
The memory 11 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the clone volume data copy device 1, e.g. a hard disk of the clone volume data copy device 1. The memory 11 may also be an external storage device of the clone volume data copying device 1 in other embodiments, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like provided on the clone volume data copying device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the clone volume data copying device 1. The memory 11 can be used not only for storing application software installed in the clone volume data copying device 1 and various types of data, such as codes of the data copying program 01, but also for temporarily storing data that has been output or is to be output.
Processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for executing program code or processing data stored in memory 11, such as for executing data copy program 01, etc.
The network interface 13 may optionally comprise a standard wired interface, a wireless interface (e.g. WI-FI interface), typically used to establish a communication connection between the apparatus 1 and other electronic devices.
The communication bus is used to enable connected communication between these components.
Optionally, the device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. Wherein the display may also be appropriately referred to as a display screen or display unit for displaying information processed in the clone volume data copying device 1 and for displaying a visual user interface.
Fig. 4 shows only a clone volume data copying device 1 having components 11-13 and a data copying program 01, it will be appreciated by those skilled in the art that the structure shown in fig. 1 is not limiting of clone volume data copying device 1 and may include fewer or more components than shown, or may combine some of the components, or a different arrangement of components.
In the embodiment of the apparatus 1 shown in fig. 4, the memory 11 has stored therein a data copy program 01; the processor 12 performs the following steps when executing the data copy program 01 stored in the memory 11:
when a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not.
And if the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume.
A snapshot refers to a mirror image of a particular file system that has read-only properties for a particular time. Taking a snapshot at a point in time, the data from accessing the snapshot is the data of the system at that point in time. Based on such a principle, the information already stored in the parent image is not stored in the snapshot volume that is initially created, and after the snapshot time point, no physical data duplication occurs, only metadata of the physical location of the original data is duplicated. Thus, snapshot creation is very fast and can be accomplished instantaneously. Then, the original volume data changes are tracked, once the original volume data blocks are updated for the first time, the original volume data blocks are read out and written into the snapshot volume, and then the original volume is covered with new data blocks. However, the snapshot volume has a read-only property, and a user cannot modify data on the snapshot volume through a client, and cannot write new data. Thus, when a user needs to write on a snapshot volume, a clone volume of the snapshot volume is created, the clone volume having readable and writable properties.
If the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of the one level.
And if the data content is found from the snapshot volume of any hierarchy, sending the data content to the client.
If the data content is not found in the snapshot volumes of each level, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client.
And writing the data content into the target clone volume.
Referring to fig. 3, snapshot volumes C1, C2, and C3 are snapshot volumes of original volume C created at three different times, respectively, all of which have only read-only properties for the user, assuming that the user is to write to snapshot volume C2, clone volume D1 of snapshot volume C2 may be created at this time. When a user accesses data on the clone volume D1, the clone volume is taken as a target clone volume, a data access request for the target clone volume is sent to a server through a client, the server determines an access object corresponding to the data access request after receiving the data access request, and whether the target clone volume has the data corresponding to the access object or not is searched.
For the server, after a snapshot volume of the original volume is established, the snapshot volume is a mirror image with only read properties, when a user modifies data in the original volume, the corresponding data is copied to the snapshot volume, and then the data blocks in the original volume are covered with new data blocks. And data that has not been modified is not copied to the snapshot volume. Since clone volume D1 is backing up all of the current data on snapshot volume C2. That is, there is no data content on snapshot volume C2, nor on clone volume D1. Thus, when a user accesses data in a clone volume, there may not be specific data content corresponding to the access object in the clone volume, and a copy from the parent image of the clone volume is required. Specifically, searching data content corresponding to an access object from a snapshot volume corresponding to a target clone volume, if the data content is not found, searching the data content corresponding to the access object from a snapshot volume of a previous level step by step according to a current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level, if the data content is searched from the snapshot volume of any level, sending the data content to the client, and if the data content is not found in the snapshot volumes of all levels, searching the data content from an original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client.
Since the user can also create snapshot volumes of the snapshot volumes as desired, a multi-level snapshot is formed, as shown with reference to FIG. 4.
When the snapshot level is too high, the parent image of one snapshot volume may be the clone volume of the snapshot volume or the original volume. For example, referring to the above figure, snapshot volume C2 is a snapshot of original volume C created at time T2, snapshot volume C21 is a snapshot of snapshot volume C2 created at time T2, and when snapshot is made for the snapshot volume, a clone volume is made based on the snapshot volume first, and then snapshot is made for the clone volume. Therefore, to create a snapshot of snapshot volume C2, clone volume C2 'is created for it first, and then snapshot volume C21 of clone volume C2' is created, i.e., the parent image of snapshot volume C21 is clone volume C2', the parent image of clone volume C2' is snapshot volume C2, and the parent image of snapshot volume C2 is original volume C. The figure shows a case with two levels of snapshots, in practical application, the user can create more levels of snapshots as needed. When the server cannot find the data content corresponding to the access object from the snapshot volume C21, it needs to find the data content from its parent mirror, i.e. from the clone volume C2' of the snapshot volume C2, then from the snapshot volume C2, and if the data content is still not found from the snapshot volume C2, then from its parent mirror, i.e. the original volume C. If the needed data content cannot be found from the target snapshot volume when the multi-level snapshot exists, searching from the parent mirror image of the previous level by level according to the current snapshot level of the target snapshot volume until the needed data content is found.
Furthermore, it will be appreciated that the data copy program 01 may also be executed by the processor 12 to perform the following steps after the step of determining the snapshot volume corresponding to the clone volume and looking up the data content from the snapshot volume:
and if the data content corresponding to the access object is found out from the snapshot volume, acquiring the data content and sending the data content to the client. If the required data content can be found from the snapshot volume C21 or the snapshot volume C2, the data content is directly sent to the client.
Further, in an embodiment, the data copy program 01 is further executable by the processor 12 to, prior to the step of writing the data content to the target clone volume, further implement the steps of: acquiring recorded accumulated access times of the data content; and if the accumulated access times are greater than or equal to a second preset threshold, executing the step of writing the data content into the target clone volume: and if the accumulated access times are smaller than the second preset threshold value, updating the accumulated access times.
In this embodiment, the number of times of access to the access object is counted in the clone volume, after the data content is obtained and sent to the client, the accumulated number of times of access to the recorded data content is obtained, and whether the number of times is greater than or equal to a second preset threshold is determined, if yes, the data can be determined to be accessed multiple times, the possibility of future access is relatively high, in order to enable the user to quickly obtain the accessed data content, the data content is written into the target clone volume, and when the user accesses next time, the data can be directly obtained from the clone volume and returned to the client. If the accumulated access times are smaller than the second preset threshold, the data do not need to be copied, and only the accumulated access times need to be updated.
In this way, an access count is set in the clone volume for each object that exists only in the parent image if the set threshold is exceeded for a certain period of time. The object data is automatically copied from the parent image to the clone volume. For data which does not exist in the clone volume but is accessed frequently in a certain period of time, the speed of accessing the data can be increased, and the problem that the business operation is influenced due to busy system reading and writing in a period of time caused by once copying the data from the parent mirror image to the clone volume is avoided.
Further, the data copy program 01 may also be executed by the processor 12 to implement the following steps: and resetting the accumulated access times recorded in the snapshot volume and the clone volume of each level at preset time intervals.
The significance of the access count is to indicate how frequently the data is accessed over a period of time. The significance of resetting the accumulated access times per preset time interval is that: if not cleared, this value represents the number of accesses since the system began to run. In this way, if some data accumulates for half a year before reaching the second preset threshold, then it is accessed less frequently and it is not actually necessary to copy such data onto the clone volume, avoiding taking up additional storage space.
Or in other embodiments, determining a time point when the data access request is received, and judging the accumulated access times to the data content in a preset time interval until the time point; and if the accumulated access times are greater than or equal to a first preset threshold value, executing the step of writing the data content into the target clone volume.
And counting the access time of each data content, counting the number of times that the data content is accessed in a preset time interval after the client accesses the data content, and writing the data content into a target clone volume if the number of times is larger than or equal to a first preset threshold value.
When receiving a data access request of a client to a target clone volume, the clone volume data copying device determines an access object corresponding to the data access request and searches whether the target clone volume has data content corresponding to the access object; if the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume; if the current snapshot volume has no data content, searching the data content corresponding to the access object from the parent mirror image of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the parent mirror image of one level; if the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client; if no data content exists in the snapshot volumes of each level, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client; the data content is written to the target clone volume. According to the scheme, for the data content which is accessed for the first time by a user and is not in the clone volume, the data content is searched from the father mirror image layer by layer and then sent to the client, and the data content is copied to the clone volume only.
Alternatively, in other embodiments, the data copy program may be divided into one or more modules, and one or more modules are stored in the memory 11 and executed by one or more processors (the processor 12 in this embodiment) to perform the present invention, where the modules refer to a series of computer program instruction segments capable of performing specific functions for describing the execution of the data copy program in the clone volume data copy device.
For example, referring to fig. 5, a schematic program module of a data copying program in an embodiment of the clone volume data copying device according to the present invention is shown, where the data copying program may be divided into a data searching module 10, a data transmitting module 20 and a data copying module 30, and the following are exemplary:
the data search module 10 is configured to: when a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not;
The data lookup module 10 is also for: if the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume;
If the current snapshot volume does not contain the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level;
the data transmission module 20 is configured to: if the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client;
the data lookup module 10 is also for: if the data content is not found in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level;
the data transmission module 20 is further configured to: transmitting the data content searched from the original volume to the client;
the data copy module 30 is configured to: and writing the data content into the target clone volume.
The functions or operation steps implemented when the program modules such as the data searching module 10, the data transmitting module 20, and the data copying module 30 are executed are substantially the same as those of the foregoing embodiments, and will not be described herein.
In addition, an embodiment of the present invention also proposes a computer-readable storage medium having stored thereon a data copy program executable by one or more processors to implement the following operations:
When a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not;
If the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume;
If the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level;
If the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client;
If the data content is not contained in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client;
and writing the data content into the target clone volume.
The computer-readable storage medium embodiments of the present invention are substantially the same as the above-described clone volume data copying apparatus and method embodiments, and are not described in detail herein.
It should be noted that, the foregoing reference numerals of the embodiments of the present invention are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (7)

1. A method of cloning a volume data copy, the method comprising:
When a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not;
If the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume;
If the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level;
If the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client;
If the data content is not contained in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client;
writing the data content into the target clone volume;
Wherein:
Before the step of writing the data content to the target clone volume, the method further comprises the steps of: determining a time point when the data access request is received, and judging the accumulated access times of the data content in a preset time interval until the time point; if the accumulated access times are greater than or equal to a first preset threshold, executing the step of writing the data content into the target clone volume; or alternatively
Before the step of writing the data content to the target clone volume, the method further comprises the steps of: acquiring recorded accumulated access times of the data content; if the accumulated access times are greater than or equal to a second preset threshold, executing the step of writing the data content into the target clone volume; and if the accumulated access times are smaller than the second preset threshold value, updating the accumulated access times.
2. The clone volume data copy method of claim 1, wherein the method further comprises the steps of:
And resetting the accumulated access times recorded in each clone volume for each preset time interval.
3. The clone volume data copy method of any one of claims 1 to 2, wherein after the step of determining a snapshot volume corresponding to the clone volume and looking up the data content from the snapshot volume, the method further comprises the steps of:
and if the data content corresponding to the access object is found out from the snapshot volume, acquiring the data content and sending the data content to the client.
4. A clone volume data copying device, said device comprising a memory and a processor, said memory having stored thereon a data copying program running on said processor, said data copying program when executed by said processor performing the steps of:
When a data access request of a client to a target clone volume is received, determining an access object corresponding to the data access request, and searching whether the target clone volume has data content corresponding to the access object or not;
If the target clone volume does not have the data content corresponding to the access object, determining a snapshot volume corresponding to the clone volume, and searching the data content from the snapshot volume;
If the current snapshot volume does not have the data content, searching the data content corresponding to the access object from the snapshot volume of the previous level step by step according to the current snapshot level until the data content corresponding to the access object is searched from the snapshot volume of one level;
If the data content is found from the snapshot volume of any hierarchy, the data content is sent to the client;
If the data content is not contained in the snapshot volumes of all the levels, searching the data content from the original volume corresponding to the snapshot volume of the highest level, and sending the data content to the client;
writing the data content into the target clone volume;
Wherein:
When the data copy program is executed by the processor, the step of writing the data content to the target clone volume is further performed prior to the step of: determining a time point when the data access request is received, and judging the accumulated access times of the data content in a preset time interval until the time point; if the accumulated access times are greater than or equal to a first preset threshold, executing the step of writing the data content into the target clone volume; or alternatively
When the data copy program is executed by the processor, the step of writing the data content to the target clone volume is further performed prior to the step of: acquiring recorded accumulated access times of the data content; if the accumulated access times are greater than or equal to a second preset threshold, executing the step of writing the data content into the target clone volume; and if the accumulated access times are smaller than the second preset threshold value, updating the accumulated access times.
5. The clone volume data copying device of claim 4, wherein the data copying program when executed by the processor further performs the steps of:
And resetting the accumulated access times recorded in each clone volume for each preset time interval.
6. The clone volume data copying device according to any one of claims 4-5, wherein the data copying program, when executed by the processor, further implements the steps of, after the steps of determining a snapshot volume corresponding to the clone volume and looking up the data content from the snapshot volume:
and if the data content corresponding to the access object is found out from the snapshot volume, acquiring the data content and sending the data content to the client.
7. A computer readable storage medium having stored thereon a data copy program which when executed by one or more processors implements the clone volume data copy method of any one of claims 1 to 3.
CN201811252831.2A 2018-10-25 2018-10-25 Clone volume data copying method, device and computer readable storage medium Active CN109597707B (en)

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 CN109597707A (en) 2019-04-09
CN109597707B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN110795389B (en) * 2019-10-28 2022-09-30 深信服科技股份有限公司 Storage snapshot based copying method, user equipment, storage medium and device
CN111399774B (en) * 2020-03-09 2021-09-14 星辰天合(北京)数据科技有限公司 Data processing method and device based on snapshot under distributed storage system

Citations (14)

* Cited by examiner, † Cited by third party
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

Patent Citations (14)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN109597707A (en) 2019-04-09

Similar Documents

Publication Publication Date Title
CN109597707B (en) Clone volume data copying method, device and computer readable storage medium
WO2019153592A1 (en) User authority data management device and method, and computer readable storage medium
US20230205755A1 (en) Methods and systems for improved search for data loss prevention
CN110989937B (en) Data storage method, device and equipment and computer readable storage medium
EP3497586A1 (en) Discovery of calling application for control of file hydration behavior
CN110352410B (en) Tracking access patterns of index nodes and pre-fetching index nodes
US10437838B2 (en) Search navigation element
US10467190B2 (en) Tracking access pattern of inodes and pre-fetching inodes
CN111475100B (en) Method, apparatus and computer readable medium for managing a storage system
CN114880289A (en) File grouping display method and computing device
CN113297409A (en) Image searching method and device, electronic equipment and storage medium
CN106156050B (en) Data processing method and device
US11392546B1 (en) Method to use previously-occupied inodes and associated data structures to improve file creation performance
EP3343395B1 (en) Data storage method and apparatus for mobile terminal
CN107886008B (en) File management method, system, device and computer readable storage medium
CN109582638B (en) Snapshot volume data copying method, device and computer readable storage medium
US20130332698A1 (en) Data preservation method
CN110209351B (en) Distributed storage data processing method and device
US11500837B1 (en) Automating optimizations for items in a hierarchical data store
US20180089086A1 (en) Tracking access pattern of inodes and pre-fetching inodes
US10776376B1 (en) Systems and methods for displaying search results
CN113806107B (en) Object copying method, device, equipment and storage medium
CN109582496B (en) Method and device for creating consistent snapshot group and computer readable storage medium
JP2017045106A (en) Information processing device and information processing program
CN107209882B (en) Multi-stage de-registration for managed devices

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