CN113608672A - Data synchronization method, device, equipment and readable medium - Google Patents

Data synchronization method, device, equipment and readable medium Download PDF

Info

Publication number
CN113608672A
CN113608672A CN202110682315.9A CN202110682315A CN113608672A CN 113608672 A CN113608672 A CN 113608672A CN 202110682315 A CN202110682315 A CN 202110682315A CN 113608672 A CN113608672 A CN 113608672A
Authority
CN
China
Prior art keywords
water level
source volume
data
copied
data block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110682315.9A
Other languages
Chinese (zh)
Inventor
马杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202110682315.9A priority Critical patent/CN113608672A/en
Publication of CN113608672A publication Critical patent/CN113608672A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a device, equipment and a readable medium for data synchronization, wherein the method comprises the following steps: establishing a water level, initializing the water level to 0, and judging a data synchronization mode; responding to the background copy of the snapshot in a data synchronization mode, and judging whether the data block in the source volume is copied; adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume; in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended. By using the scheme of the invention, the speed of background copying can be improved, the occupation of the background copying on computer resources can be reduced, and the influence of the background copying on the performance of the host can be reduced.

Description

Data synchronization method, device, equipment and readable medium
Technical Field
The field relates to the field of computers, and more particularly to a method, an apparatus, a device and a readable medium for data synchronization.
Background
A snapshot is a replication of a given data set at a particular point in time, which is a fully usable copy. The snapshot technology can realize the protection of data and is widely applied to the field of disaster recovery. The snapshot technique divides a volume into data blocks (called gains) of equal size, and after a snapshot is generated for a certain volume, data synchronization from a source volume to a target volume is performed, and the data synchronization is divided into two Copy-On-Write (COW) and background Copy modes. Copy-on-write refers to copying the data of a certain grain of a source volume to a target volume when the data of the grain of the source volume is modified for the first time, and then modifying the grain of the source volume, wherein background copy refers to copying the grains of the source volume to the target volume according to the specified rate in sequence from small to large in position in the volume.
Whether copy-on-write or background, a bitmap is needed, each bit corresponding to a grain of the volume, to mark whether each grain has been copied, thereby avoiding duplicate copies of the same grain. Each time of data synchronization, the index of the graph is calculated according to the position of the graph, then the value of the bitmap is read according to the index, whether the graph needs to be copied or not is judged, the bitmap needs to be updated after the copying is finished, and the fact that the current graph is copied is recorded. This has the following disadvantages: (1) when the host modifies the source volume, there is a great possibility that a plurality of continuous grains are modified at one time, so that a plurality of COWs are required, and a plurality of times of reading bitmaps are required for judgment and updating. The background copy performs a bitmap update each time after processing a grain. (2) Whether the copy-on-write or the background copy is performed, after each copy is completed, it is necessary to determine whether all the grains of the volume have been copied, so as to complete the snapshot. The basis for judging the completion of all the grain copies is the bitmap, the whole bitmap needs to be traversed, and all the bits of the bitmap are marked to indicate the completion of all the grain copies. The reading and updating operations of the bitmap occupy the resources of the computer, reduce the data copying speed and have great performance influence on the reading and writing operations of the host.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable medium for data synchronization, which can improve the speed of background copy, reduce the occupation of computer resources by the background copy, and reduce the influence of the background copy on the performance of a host.
In view of the above object, an aspect of the embodiments of the present invention provides a method of data synchronization, including the steps of:
establishing a water level, initializing the water level to 0, and judging a data synchronization mode;
responding to the background copy of the snapshot in a data synchronization mode, and judging whether the data block in the source volume is copied;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
According to an embodiment of the present invention, further comprising:
in response to the water level being less than the total number of data blocks in the source volume, determining whether a next data block in the source volume has completed copying;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
According to an embodiment of the present invention, further comprising:
in response to the data blocks in the source volume not being copied, the data blocks in the source volume not being copied are copied to the data blocks in the target volume.
According to an embodiment of the present invention, in response to the data synchronization mode being snapshot background copy, determining whether the data block in the source volume has already been copied includes:
and judging whether the data block is copied or not based on the bitmap corresponding to the data block.
According to an embodiment of the present invention, further comprising:
responding to the data synchronization mode of snapshot copy-on-write, comparing the index value of the data block with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
According to an embodiment of the present invention, further comprising:
and in response to the current data block not completing copying, copying the data blocks which are not copied in the source volume into the data blocks in the target volume and updating the bitmap.
According to an embodiment of the present invention, further comprising:
in response to the data blocks in the source volume not all completing copying, comparing the index value of the next data block in the source volume with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
In another aspect of the embodiments of the present invention, there is also provided an apparatus for data synchronization, including:
the creating module is configured to create a water level, initialize the water level to 0 and judge a data synchronization mode;
the judging module is configured to respond to the data synchronization mode of snapshot background copying and judge whether the data block in the source volume is copied or not;
the comparison module is configured to add 1 to the water level after judgment and compare the water level with the total number of the data blocks in the source volume;
a shutdown module configured to end data synchronization in response to the water level equaling a total number of data blocks in the source volume.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any one of the above-mentioned methods.
The invention has the following beneficial technical effects: according to the data synchronization method provided by the embodiment of the invention, the water level is established and initialized to 0, and the data synchronization mode is judged; responding to the background copy of the snapshot in a data synchronization mode, and judging whether the data block in the source volume is copied; adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume; and in response to the water level being equal to the total number of the data blocks in the source volume, ending the technical scheme of data synchronization, improving the speed of background copying, reducing the occupation of the background copying on computer resources and reducing the influence of the background copying on the performance of the host.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method of data synchronization in accordance with one embodiment of the present invention;
FIG. 2 is a schematic diagram of an apparatus for data synchronization according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 4 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above object, a first aspect of embodiments of the present invention proposes an embodiment of a method of data synchronization. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1 creates and initializes a water level to 0, and judges the manner of data synchronization.
The water level is defined as an integer value, is initialized to 0, and is added with 1 every time a data block of a source volume is processed until a preset condition is reached, which indicates the end of data copying. When data synchronization is performed, after a snapshot is generated on a certain volume, data synchronization from a source volume to a target volume is performed, and the data synchronization is divided into two copy modes of copy-on-write and background copy, wherein the copy-on-write refers to that when data of a certain grain of the source volume is modified for the first time, the data of the grain of the source volume is copied to the target volume, then the grain of the source volume is modified, the background copy refers to that the grains of the source volume are sequentially copied to the target volume according to the specified speed from small to large positions in the volume, and the water level judgment in the two copy modes is different. When the water level is created, a snapshot mapping relationship between the source volume and the target volume needs to be created, a bitmap is created, the bit number of the bitmap is the size of the source volume divided by the size of the grain, all bits of the bitmap are initialized to 0, and whether the data block grain is copied or not can be judged according to the value of the bitmap.
S2 responds to the data synchronization mode being snapshot background copy, and judges whether the data block in the source volume is copied.
S3 adds 1 to the water level after the determination and compares the water level with the total number of data chunks in the source volume.
S4 ends the data synchronization in response to the water level being equal to the total number of data chunks in the source volume.
When the snapshot background copy starts, a thread is required to be started for background copy tasks, traversal is started from the 1 st grain of a source volume until the last 1 grain, whether the current grain is copied is finished or not is judged according to a bitmap, if the current grain is copied, the grain is not processed, the water level is increased by 1, if the grain is not copied, the data of the source volume grain is copied to the corresponding grain of a target volume, and the water level is increased by 1. And after processing each grain, comparing the water level with the total number of the data blocks in the source volume, when the water level is equal to the total number of the grains, indicating that the snapshot is synchronously completed, closing the thread to finish the background copying task, and if the water level is less than the total number of the grains, continuing the processing of the next grain until the water level is equal to the total number of the grains, closing the thread to finish the background copying task.
By the technical scheme, the speed of background copying can be increased, the occupation of computer resources by the background copying is reduced, and the influence of the background copying on the performance of the host is reduced.
In a preferred embodiment of the present invention, the method further comprises:
in response to the water level being less than the total number of data blocks in the source volume, determining whether a next data block in the source volume has completed copying;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended. Adding 1 to the water level after each data block in the source volume is judged, then finishing data synchronization when the water level is equal to the total number of the data blocks in the source volume, and if the water level is not equal to the total number of the data blocks in the source volume, continuing to process the next data block.
In a preferred embodiment of the present invention, the method further comprises:
in response to the data blocks in the source volume not being copied, the data blocks in the source volume not being copied are copied to the data blocks in the target volume.
In a preferred embodiment of the present invention, in response to the data synchronization mode being snapshot background copy, determining whether the data block in the source volume has already been copied includes:
and judging whether the data block is copied or not based on the bitmap corresponding to the data block. The bitmap of the data block in the source volume is initialized to 0, and the value will be marked as 1 when the data block is copied, indicating that the data block has been copied.
In a preferred embodiment of the present invention, the method further comprises:
responding to the data synchronization mode of snapshot copy-on-write, comparing the index value of the data block with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
When the data synchronization mode is snapshot copy-on-write, after a request of a host for modifying the data of a source volume is received, circularly processing the data modification of all the grains according to the sequence of the index values of the grains from large to small, sequentially comparing the index values of each grain with the water level, if the index value of the grain is less than or equal to the water level, indicating that all the grains of the request are completely copied, not processing, directly ending the request of the host, if the index value of the grain is greater than the water level, judging whether the current grain is completely copied according to a bitmap, if the current grain is completely copied, not processing the grain, adding 1 to the water level, if the current grain is not completely copied, copying the data of the source volume to the corresponding grain of a target volume, updating the corresponding position of the bitmap, and adding 1 to the water level. After each time of processing a grain, the water level needs to be compared with the index value of the grain, if the condition that the index value of the grain is smaller than the water level is not met, the processing of the next grain is continued until the condition is met, and the host request is ended.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the current data block not completing copying, copying the data blocks which are not copied in the source volume into the data blocks in the target volume and updating the bitmap.
In a preferred embodiment of the present invention, the method further comprises:
in response to the data blocks in the source volume not all completing copying, comparing the index value of the next data block in the source volume with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
The technical scheme of the invention adds the water level as the basis for judging whether the grain is copied and whether the snapshot is finished. Compared with the conventional bitmap, the direct advantages are that: (1) it is more efficient to determine whether the grain copy is complete. Judging whether the gain is copied through a bitmap needs 3 steps: calculating the position of the grain in the bitmap according to the grain index, reading the content of the position corresponding to the bitmap, judging whether the content of the position corresponding to the bitmap is marked, judging whether the grain is copied through the water level only by 1 step, and comparing the grain index with the water level. (2) Recording the snapshot progress is more efficient. Recording the snapshot progress through the bitmap, traversing each bit in the bitmap, determining the snapshot progress by dividing the number of marked bits by the total number of bits, indicating the end of the snapshot if all the marked bits are marked, recording the snapshot progress through the water level, determining the snapshot progress by dividing the water level by the total number of the grains, and indicating the end of the snapshot if the water level is equal to the total number of the grains.
In specific application, the step of bitmap updating is omitted in the background copying process, only the water level is updated, the speed of background copying is improved, the occupation of computer resources by the background copying is reduced, and the influence of the background copying on the performance of a host is reduced. Whether the graph is copied is judged according to the water level preferentially in the copy-on-write process, if the graph is copied in background copy, judgment of the bitmap is not needed, the judgment process is more efficient, especially for scenes with multiple continuous data block modifications, the host request can be ended only by comparing the water level once, and multiple operations on the bitmap are reduced. For a system with frequent host read-write, the technical scheme of the invention can improve the performance of the host to a great extent.
By the technical scheme, the speed of background copying can be increased, the occupation of computer resources by the background copying is reduced, and the influence of the background copying on the performance of the host is reduced.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for data synchronization, as shown in fig. 2, the apparatus 200 includes:
the creating module is configured to create a water level, initialize the water level to 0 and judge a data synchronization mode;
the judging module is configured to respond to the data synchronization mode of snapshot background copying and judge whether the data block in the source volume is copied or not;
the comparison module is configured to add 1 to the water level after judgment and compare the water level with the total number of the data blocks in the source volume;
a shutdown module configured to end data synchronization in response to the water level equaling a total number of data blocks in the source volume.
In a preferred embodiment of the present invention, the determining module is further configured to:
in response to the water level being less than the total number of data blocks in the source volume, determining whether a next data block in the source volume has completed copying;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
In a preferred embodiment of the present invention, the system further comprises a copy module configured to:
in response to the data blocks in the source volume not being copied, the data blocks in the source volume not being copied are copied to the data blocks in the target volume.
In a preferred embodiment of the present invention, the determining module is further configured to:
and judging whether the data block is copied or not based on the bitmap corresponding to the data block.
In a preferred embodiment of the present invention, the determining module is further configured to:
responding to the data synchronization mode of snapshot copy-on-write, comparing the index value of the data block with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
In a preferred embodiment of the invention, the copy module is further configured to:
and in response to the current data block not completing copying, copying the data blocks which are not copied in the source volume into the data blocks in the target volume and updating the bitmap.
In a preferred embodiment of the present invention, the determining module is further configured to:
in response to the data blocks in the source volume not all completing copying, comparing the index value of the next data block in the source volume with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the method of:
establishing a water level, initializing the water level to 0, and judging a data synchronization mode;
responding to the background copy of the snapshot in a data synchronization mode, and judging whether the data block in the source volume is copied;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
In a preferred embodiment of the present invention, the method further comprises:
in response to the water level being less than the total number of data blocks in the source volume, determining whether a next data block in the source volume has completed copying;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
In a preferred embodiment of the present invention, the method further comprises:
in response to the data blocks in the source volume not being copied, the data blocks in the source volume not being copied are copied to the data blocks in the target volume.
In a preferred embodiment of the present invention, in response to the data synchronization mode being snapshot background copy, determining whether the data block in the source volume has already been copied includes:
and judging whether the data block is copied or not based on the bitmap corresponding to the data block.
In a preferred embodiment of the present invention, the method further comprises:
responding to the data synchronization mode of snapshot copy-on-write, comparing the index value of the data block with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the current data block not completing copying, copying the data blocks which are not copied in the source volume into the data blocks in the target volume and updating the bitmap.
In a preferred embodiment of the present invention, the method further comprises:
in response to the data blocks in the source volume not all completing copying, comparing the index value of the next data block in the source volume with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer readable storage medium stores S31 a computer program that, when executed by a processor, performs the method as described above S32.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method of data synchronization, comprising the steps of:
establishing a water level, initializing the water level to 0, and judging a data synchronization mode;
responding to the background copy of the snapshot in a data synchronization mode, and judging whether the data block in the source volume is copied;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
2. The method of claim 1, further comprising:
in response to the water level being less than the total number of data blocks in the source volume, determining whether a next data block in the source volume has completed copying;
adding 1 to the water level after judgment, and comparing the water level with the total number of the data blocks in the source volume;
in response to the water level being equal to the total number of data blocks in the source volume, data synchronization is ended.
3. The method of claim 1, further comprising:
in response to the data blocks in the source volume not being copied, the data blocks in the source volume not being copied are copied to the data blocks in the target volume.
4. The method of claim 1, wherein determining whether the data blocks in the source volume have been copied in response to the data synchronization being in the form of a snapshot background copy comprises:
and judging whether the data block is copied or not based on the bitmap corresponding to the data block.
5. The method of claim 1, further comprising:
responding to the data synchronization mode of snapshot copy-on-write, comparing the index value of the data block with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
6. The method of claim 5, further comprising:
and in response to the current data block not completing copying, copying the data blocks which are not copied in the source volume into the data blocks in the target volume and updating the bitmap.
7. The method of claim 5, further comprising:
in response to the data blocks in the source volume not all completing copying, comparing the index value of the next data block in the source volume with the water level and adding 1 to the water level;
judging whether the current data block is copied or not according to the bitmap of the current data block in response to the fact that the index value of the data block is larger than the water level;
responding to the completion of copying of the current data block, and judging whether all the data blocks in the source volume are completely copied;
data synchronization ends in response to the data blocks in the source volume all completing the copy.
8. An apparatus for data synchronization, the apparatus comprising:
the creating module is configured to create a water level, initialize the water level to 0 and judge a data synchronization mode;
the judging module is configured to respond to the background copy of the snapshot in a data synchronization mode and judge whether the data block in the source volume is copied or not;
a comparison module configured to add 1 to the water level after the determination and compare the water level with the total number of data blocks in the source volume;
a shutdown module configured to end data synchronization in response to the water level equaling a total number of data blocks in the source volume.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110682315.9A 2021-06-20 2021-06-20 Data synchronization method, device, equipment and readable medium Pending CN113608672A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110682315.9A CN113608672A (en) 2021-06-20 2021-06-20 Data synchronization method, device, equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110682315.9A CN113608672A (en) 2021-06-20 2021-06-20 Data synchronization method, device, equipment and readable medium

Publications (1)

Publication Number Publication Date
CN113608672A true CN113608672A (en) 2021-11-05

Family

ID=78336620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110682315.9A Pending CN113608672A (en) 2021-06-20 2021-06-20 Data synchronization method, device, equipment and readable medium

Country Status (1)

Country Link
CN (1) CN113608672A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023206950A1 (en) * 2022-04-29 2023-11-02 苏州元脑智能科技有限公司 Cascaded snapshot processing method and apparatus, and device and storage medium
CN117215501A (en) * 2023-11-08 2023-12-12 苏州元脑智能科技有限公司 Bitmap synchronization method, device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120198150A1 (en) * 2011-01-28 2012-08-02 International Business Machines Corporation Assigning device adaptors and background tasks to use to copy source extents to target extents in a copy relationship
CN104360953A (en) * 2014-10-16 2015-02-18 华为技术有限公司 Data copying method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120198150A1 (en) * 2011-01-28 2012-08-02 International Business Machines Corporation Assigning device adaptors and background tasks to use to copy source extents to target extents in a copy relationship
CN104360953A (en) * 2014-10-16 2015-02-18 华为技术有限公司 Data copying method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023206950A1 (en) * 2022-04-29 2023-11-02 苏州元脑智能科技有限公司 Cascaded snapshot processing method and apparatus, and device and storage medium
CN117215501A (en) * 2023-11-08 2023-12-12 苏州元脑智能科技有限公司 Bitmap synchronization method, device, equipment and medium
CN117215501B (en) * 2023-11-08 2024-02-09 苏州元脑智能科技有限公司 Bitmap synchronization method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US9240209B1 (en) Pass-through tape access in a disk storage environment
CN113608672A (en) Data synchronization method, device, equipment and readable medium
US11042453B2 (en) Database journaling method and apparatus
US8347052B2 (en) Initializing of a memory area
US20140068216A1 (en) Storage system for supporting copy command and move command and operation method of storage system
CN113608695A (en) Data processing method, system, device and medium
US9116853B1 (en) Tape backup and restore in a disk storage environment
US10042570B2 (en) Tape backup and restore in a disk storage environment with intelligent data placement
US9952771B1 (en) Method and system for choosing an optimal compression algorithm
US11380356B2 (en) Flexible on-cylinder limit for drive performance management
CN112988880B (en) Data synchronization method, device, electronic equipment and computer storage medium
US11880277B2 (en) Selecting an error correction code type for a memory device
US20120059986A1 (en) Disk apparatus, data replicating method onto disk apparatus and program recording medium
CN110348245B (en) Data integrity protection method, system and device based on NVM and storage medium
CN114661243A (en) Method, device, equipment and medium suitable for adjusting visible capacity of SSD
CN113868026A (en) Cloud backup method and related device
CN115129253A (en) Snapshot processing method, device, equipment and medium
CN111240900B (en) Data backup method based on virtual tape library
CN113805799B (en) Method, device, equipment and readable medium for RAID array latest write record management
CN114138198B (en) Method, device, equipment and readable medium for deleting data
CN113467716B (en) Method, device, equipment and readable medium for data storage
CN112148523B (en) Verification method and device for data files in embedded system
US10963186B2 (en) Latent multiplicity detection
CN117234436B (en) Method, device, storage system and product for expanding capacity of disk array
CN112463460B (en) Erasure code-based small block data recovery method and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211105