CN109144418A - A kind of method of data synchronization and device - Google Patents

A kind of method of data synchronization and device Download PDF

Info

Publication number
CN109144418A
CN109144418A CN201810934585.2A CN201810934585A CN109144418A CN 109144418 A CN109144418 A CN 109144418A CN 201810934585 A CN201810934585 A CN 201810934585A CN 109144418 A CN109144418 A CN 109144418A
Authority
CN
China
Prior art keywords
storage region
data
memory
data modification
storage
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
CN201810934585.2A
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810934585.2A priority Critical patent/CN109144418A/en
Publication of CN109144418A publication Critical patent/CN109144418A/en
Pending legal-status Critical Current

Links

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/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
    • 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
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices

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)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This application discloses a kind of method of data synchronization and devices, it is replication relation between first memory and second memory, first memory is divided into the first storage region of the first number, second memory is divided into the second storage region of the first number, first storage region and the second storage region correspond, replication relation each other between the first storage region and the second storage region corresponding with the first storage region;It include: the data modification mark of acquisition the first storage region of the first number, and, the data modification for obtaining the second storage region of the first number identifies;It is identified using the data modification mark of the first storage region and the data modification of the second storage region, determines the variance data between the data stored in first memory and the data stored in second memory;Processing is synchronized to variance data, so that the data stored in first memory and the data stored in second memory are identical.To effectively improve the synchronous efficiency of data.

Description

A kind of method of data synchronization and device
Technical field
This application involves data processing fields, more particularly to a kind of method of data synchronization and device.
Background technique
Within the storage system, replication relation can be established between two memories, passes through the number between two memories Realize the backup of data, according to duplication to achieve the purpose that disaster tolerance.
In some scenes, when the replication relation between two memories stops, two memories can become can Read writeable state.That is, the data in two memories have when the replication relation between two memories stops It may have occurred variation.And when being again started up replication relation, it needs to synchronize processing to the data in two memories, with Realize the backup to data.
How rapidly and efficiently processing is synchronized to the data in two synchronizers, be current urgent problem.
Summary of the invention
Technical problems to be solved in this application be how the data in two synchronizers are synchronized rapidly and efficiently Processing provides a kind of method of data synchronization and device.
In a first aspect, the embodiment of the present application provides a kind of method of data synchronization, first memory and second memory it Between be replication relation, the first memory is divided into the first number the first storage region, and the second memory is drawn It is divided into the first number the second storage region, first storage region and second storage region correspond, and described the Replication relation each other between one storage region and the second storage region corresponding with first storage region;Include:
Obtain the data modification mark of the first storage region of first number;And obtain first number The data modification of second storage region identifies;
It is identified using the data modification mark of first storage region and the data modification of second storage region, really The data stored in the fixed first memory and the data stored in the second memory are with the presence or absence of variance data;
If it exists, processing is synchronized to the variance data, so that the data stored in the first memory and institute It is identical to state the data stored in second memory.
Optionally, the data of the data modification mark and second storage region using first storage region Modified logo determines the data stored in the first memory and the data stored in second storage with the presence or absence of difference Data, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained;
If the calculated result is not equal to initial value, it is determined that the data stored in the first memory and described second The data stored in storage have differences data.
Optionally, the initial value is 0, and the data modification mark includes 1 or 0;If first storage region Data modification is identified as 1, then it represents that the data stored in first storage region are changed, if first memory block The data modification in domain is identified as 0, then it represents that the data stored in first storage region do not change;If described second deposits The data modification in storage area domain is identified as 1, then it represents that and the data stored in second storage region are changed, if described The data modification of two storage regions is identified as 0, then it represents that the data stored in second storage region do not change;
It is described that the data modification mark of first storage region and corresponding with first storage region second are deposited The data modification mark in storage area domain is calculated, and calculated result is obtained, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is carried out or is calculated, and obtains calculated result.
Optionally, the initial value is 1, and the data modification mark includes 0 or 1;If first storage region Data modification is identified as 0, then it represents that the data stored in first storage region are changed, if first memory block The data modification in domain is identified as 1, then it represents that the data stored in first storage region do not change;If described second deposits The data modification in storage area domain is identified as 0, then it represents that and the data stored in second storage region are changed, if described The data modification of two storage regions is identified as 1, then it represents that the data stored in second storage region do not change;
It is described that the data modification mark of first storage region and corresponding with first storage region second are deposited The data modification mark in storage area domain is calculated, and calculated result is obtained, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is carried out and is calculated, and obtains calculated result.
Optionally, it is described obtain calculated result after, the method also includes:
The data modification mark of the data modification mark of first storage region and/or second storage region is repaired It is changed to the initial value.
Optionally, the method also includes:
If the replication relation of the first memory and the second memory stop, and the first memory and/or The second memory be in it is readable can write state when, if the data in first storage region change, and described the The data modification of one storage region is identified as the initial value, then modifies the data modification mark of first storage region;With/ Or, if the data in second storage region change, and the data modification of second storage region be identified as it is described Initial value then modifies the data modification mark of second storage region.
Second aspect, the embodiment of the present application provide a kind of data synchronization unit, first memory and second memory it Between be replication relation, the first memory is divided into the first number the first storage region, and the second memory is drawn It is divided into the first number the second storage region, first storage region and second storage region correspond, and described the Replication relation each other between one storage region and the second storage region corresponding with first storage region;Include:
Acquiring unit, for obtaining the data modification mark of the first storage region of first number;And obtain institute State the data modification mark of the second storage region of the first number;
Determination unit, the number for data modification mark and second storage region using first storage region According to modified logo, determine between the data stored in the first memory and the data stored in the second memory whether Have differences data;
Synchronization unit, for if it exists, processing being synchronized to the variance data, so that depositing in the first memory The data stored in the data of storage and the second memory are identical.
Optionally, the determination unit, is specifically used for:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained;
If the calculated result is not equal to initial value, it is determined that the data stored in the first memory and described second The data stored in storage have differences data.
Optionally, the initial value is 0, and the data modification mark includes 1 or 0;If first storage region Data modification is identified as 1, then it represents that the data stored in first storage region are changed, if first memory block The data modification in domain is identified as 0, then it represents that the data stored in first storage region do not change;If described second deposits The data modification in storage area domain is identified as 1, then it represents that and the data stored in second storage region are changed, if described The data modification of two storage regions is identified as 0, then it represents that the data stored in second storage region do not change;
It is described that the data modification mark of first storage region and corresponding with first storage region second are deposited The data modification mark in storage area domain is calculated, and calculated result is obtained, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is carried out or is calculated, and obtains calculated result.
Optionally, the initial value is 1, and the data modification mark includes 0 or 1;If first storage region Data modification is identified as 0, then it represents that the data stored in first storage region are changed, if first memory block The data modification in domain is identified as 1, then it represents that the data stored in first storage region do not change;If described second deposits The data modification in storage area domain is identified as 0, then it represents that and the data stored in second storage region are changed, if described The data modification of two storage regions is identified as 1, then it represents that the data stored in second storage region do not change;
It is described that the data modification mark of first storage region and corresponding with first storage region second are deposited The data modification mark in storage area domain is calculated, and calculated result is obtained, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is carried out and is calculated, and obtains calculated result.
Optionally, described device further include:
First modification unit, for by the data modification of first storage region mark and/or second memory block The data modification mark in domain is revised as the initial value.
Optionally, described device further include:
Second modification unit, if stopping for the replication relation of the first memory and the second memory, and institute State first memory and/or the second memory be in it is readable can write state when, if the data in first storage region It changes, and the data modification of first storage region is identified as the initial value, then modifies first storage region Data modification mark;And/or if the data in second storage region change, and second storage region Data modification is identified as the initial value, then modifies the data modification mark of second storage region.
Compared with prior art, the embodiment of the present application has the advantage that
The embodiment of the present application provides a kind of method of data synchronization and device, wherein first memory and second memory Between be replication relation, the first memory is divided into the first number the first storage region, the second memory quilt It is divided into the second storage region of the first number, first storage region and second storage region correspond, described Replication relation each other between first storage region and the second storage region corresponding with first storage region.It include: to obtain The data modification mark of the first storage region of first number, and, obtain the second storage region of first number Data modification mark;Utilize the data modification of the data modification mark and second storage region of first storage region Mark, determines the difference number between the data stored in the first memory and the data stored in the second memory According to;Processing is synchronized to the variance data, so that the data stored in the first memory and the second memory The data of middle storage are identical.It can be seen that in the embodiment of the present application, since the data modification mark of the first storage region can be with Whether the data of the first storage region storage are changed in characterization first memory, the data modification mark of the second storage region Knowing can characterize whether the data that the second storage region stores in second memory are changed.Therefore, it can use first The data modification mark of storage region and the data modification of second storage region identify, and determine to store in first memory Data and second memory in the data that store with the presence or absence of variance data, to further be synchronized to the variance data Processing, so that the data stored in first memory and the data stored in the second memory are identical.That is, at this In application, processing only is synchronized to variance data, rather than as in the prior art, being synchronized to all data Processing, to effectively improve the synchronous efficiency of data.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in application, for those of ordinary skill in the art, without creative efforts, It is also possible to obtain other drawings based on these drawings.
Fig. 1 is the structural schematic diagram of first memory provided by the embodiments of the present application and second memory;
Fig. 2 is a kind of flow diagram of method of data synchronization provided by the embodiments of the present application;
Fig. 3 is the schematic diagram of calculated result provided by the embodiments of the present application;
Fig. 4 is the schematic diagram of calculated result provided by the embodiments of the present application;
A kind of Fig. 5 structural schematic diagram of data synchronization unit provided by the embodiments of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only this Apply for a part of the embodiment, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art exist Every other embodiment obtained under the premise of creative work is not made, shall fall in the protection scope of this application.
Present inventor has found after study, in some scenes, when the replication relation between two memories stops When only, two memories can become readable writeable state.That is, when the replication relation between two memories stops When only, the data in two memories have been likely to occur variation.And when being again started up replication relation, it needs to deposit two Data in reservoir synchronize processing, to realize the backup to data.
Currently, when the replication relation between two memories stops, it can be all to being stored in two memories Data synchronize processing, for example, the data stored in first memory are all copied in second memory, covering second The data stored in memory.It is understood that if the data volume stored in two memories is very big, to all data The mode of processing is synchronized, so that the efficiency that data synchronize is very low.
Inventor has found under study for action, and when being again started up replication relation, the partial data stored in first memory can Energy does not change, correspondingly, the partial data stored in second memory may also not change, simultaneously to these The data not changed can be without any processing in synchronization process, so that the data volume for needing to synchronize is reduced, To promote the synchronous efficiency of data.
In consideration of it, the embodiment of the present application provides a kind of method of data synchronization and device, wherein first memory and second It is replication relation between memory, the first memory is divided into the first storage region of the first number, and described second deposits Reservoir is divided into the second storage region of the first number, and first storage region and second storage region one are a pair of It answers, replication relation each other between first storage region and the second storage region corresponding with first storage region.Packet It includes: obtaining the data modification mark of the first storage region of first number, and, it obtains first number second and deposits The data modification in storage area domain identifies;Utilize the number of the data modification mark and second storage region of first storage region According to modified logo, determine between the data stored in the first memory and the data stored in the second memory whether Have differences data;Processing is synchronized to the variance data if it exists, so that the data stored in the first memory It is identical as the data stored in the second memory.
It can be seen that in the embodiment of the present application, since the data modification mark of the first storage region can characterize first Whether the data that the first storage region stores in memory are changed, and the data modification mark of the second storage region can be with table Whether the data of the second storage region storage are changed in sign second memory.Therefore, it can use the first storage region Data modification mark and second storage region data modification identify, determine the data stored in first memory and The data stored in second memory make with the presence or absence of variance data to further synchronize processing to the variance data The data for obtaining the data stored in first memory and storing in the second memory are identical.That is, in this application, Processing only is synchronized to variance data, rather than as in the prior art, synchronizing processing to all data, from And effectively improve the synchronous efficiency of data.
With reference to the accompanying drawing, the various non-limiting embodiments of the application are described in detail.
Illustrative methods
For convenience of understanding, combine Fig. 1 that method of data synchronization provided by the embodiments of the present application is introduced first.
Referring to Fig. 1, which is the structural schematic diagram of first memory and second memory provided by the embodiments of the present application.
It should be noted that being replication relation between first memory 100 shown in FIG. 1 and second memory 200.It is so-called Replication relation, it is possible to understand that at first memory 100 be the backup of second memory 200 or the second storage 200 is first to deposit The backup of reservoir 100.
In the embodiment of the present application, after the backup relation of first memory 100 and second memory 200 stops, first Memory 100 and second memory 200 can become it is readable can write state.When restoring replication relation again, need to the The data that the data and second memory 200 of the storage of one memory 100 store synchronize, so that first memory 100 stores The data that store of data and second memory 200 it is identical.
It is understood that due to replication relation each other between first memory 100 and second memory 200, The size of the memory space of the size and second memory 200 of the memory space of one memory 100 can be identical.
In the embodiment of the present application, the first memory 100 can be divided into the first storage region of the first number, The second memory 200 can be divided into the first number the second storage region, first storage region and described the Two storage regions correspond, between first storage region and the second storage region corresponding with first storage region Replication relation each other.
In conjunction with Fig. 1, in Fig. 1, first memory 100 is divided into 8 the first storage regions, respectively 110,120,130, 140,150,160,170 and 180.Correspondingly, second memory 200 is divided into 8 the second storage regions, respectively 210, 220,230,240,250,260,270 and 280.
Wherein, be between the first storage region and the second storage region it is one-to-one, specifically, the first storage region and Corresponding relationship between second storage region can be corresponding relationship as shown in the table.
Table 1
First storage region Second storage region
110 210
120 220
130 230
140 240
150 250
160 260
170 270
180 280
Replication relation each other between first storage region and the second storage region corresponding with first storage region.? That is when starting replication relation, the data and the second storage corresponding with the first storage region that are stored in the first storage region The data stored in region are identical.
In conjunction with table 1, it is replication relation between the first storage region 110 and the second storage region 210, starts replication relation When, the data stored in the data and the second storage region 210 that store in the first storage region 110 are identical;First storage region 120 and second be replication relation between storage region 220, when starting replication relation, the data that are stored in the first storage region 120 It is identical with the data stored in the second storage region 220;It is duplication between first storage region 130 and the second storage region 230 Relationship, the data stored in the data and the second storage region 230 stored when starting replication relation, in the first storage region 130 It is identical;It is replication relation between first storage region 140 and the second storage region 240, when starting replication relation, the first memory block The data stored in domain 140 and the data stored in the second storage region 240 are identical;First storage region 150 and the second storage It is replication relation, the data stored in the first storage region 150 when starting replication relation and the second memory block between region 250 The data stored in domain 250 are identical;It is replication relation, starting duplication between first storage region 160 and the second storage region 260 When relationship, the data stored in the data and the second storage region 260 that store in the first storage region 160 are identical;First storage It is replication relation between region 170 and the second storage region 270, when starting replication relation, is stored in the first storage region 170 The data stored in data and the second storage region 270 are identical;It is between first storage region 180 and the second storage region 280 Replication relation stores in the data and the second storage region 280 stored when starting replication relation, in the first storage region 180 Data are identical.
It should be noted that the embodiment of the present application does not limit the big of memory space shared by each first storage region specifically Small, the size of memory space shared by each first storage region may be the same or different, and the embodiment of the present application does not limit specifically Fixed, correspondingly, the embodiment of the present application does not limit the size of memory space shared by each second storage region specifically, each second is deposited The size of memory space shared by storage area domain may be the same or different, and the embodiment of the present application does not limit specifically.It is understood that It is, due to being replication relation between the first storage region and the second storage region corresponding with first storage region, It is stored shared by the size of memory space shared by first storage region and the second storage region corresponding with first storage region The size in space can be identical.
For example, the size of memory space shared by the first storage region 110 and the shared storage of the first storage region 120 are empty Between size may be the same or different.The size and the second storage region of memory space shared by second storage region 210 The size of memory space shared by 220 may be the same or different.The size of memory space shared by first storage region 110 and The size of memory space shared by second storage region 210 is identical, the size and second of memory space shared by the first storage region 120 The size of memory space shared by storage region 220 is identical.
It should be noted that Fig. 1 is illustrated so that the first number is 8, i.e., it is only to divide first memory At 8 the first storage regions, second memory is divided into 8 the second storage regions to be illustrated.It does not constitute to this Shen Please the restriction of embodiment do not limit the number of first number, the number of first number can in the embodiment of the present application With determines according to actual conditions.
It should be noted that the embodiment of the present application to first memory and second memory without limitation.Described first deposits Reservoir and the second memory for example can be hard disk.
Referring to fig. 2, which is a kind of flow diagram of method of data synchronization provided by the embodiments of the present application.
Method of data synchronization provided by the embodiments of the present application, such as can be realized with S201-S203 as follows.
S201: the data modification mark of the first storage region of first number is obtained;And obtain first number The data modification mark of the second storage region of mesh.
It should be noted that in the embodiment of the present application, the data modification of first storage region identifies, for characterizing Whether the data of the first storage region storage are changed later in upper primary replication relation stopping.Correspondingly, described The data modification of second storage region identifies, for characterizing the data of the second storage region storage in upper primary replication relation Stop whether being changed later.
It is understood that the data of the first storage region storage have occurred after upper primary replication relation stops Change, then it represents that the data of first storage region storage are likely to and the second storage region corresponding with first storage region The data of middle storage are different.Correspondingly, the data of the second storage region storage are sent out after upper primary replication relation stops Change is given birth to, then it represents that the data of second storage region storage are likely to and the first storage corresponding with second storage region The data stored in region are different.
The data modification that the embodiment of the present application does not limit first storage region specifically identifies and second memory block The data modification in domain identifies.
S202: the data modification mark of the data modification mark and second storage region of first storage region is utilized Know, determine the data stored in the first memory and the data stored in the second memory whether variance data.
It should be noted that step S202 is in specific implementation, such as can be realized with A-B as follows.
Step A: to the data modification of first storage region mark and with first storage region corresponding second The data modification mark of storage region is calculated, and calculated result is obtained.
Step B: if the calculated result is not equal to initial value, it is determined that the data stored in the first memory and institute It states the data stored in second memory and has differences data.
About step A and step B, it should be noted that the embodiment of the present application does not limit the initial value specifically, described first The value of initial value for example can be 0 or be 1.
When the data modification of first storage region is identified as the initial value, indicate that first storage region is deposited The data of storage do not change after upper primary replication relation stops;When the data modification of first storage region identifies not When for the initial value, indicate that the data of the first storage region storage are changed after upper primary replication relation stops Become.
Correspondingly, indicating that described second deposits when the data modification of second storage region is identified as the initial value The data of storage area domain storage do not change after upper primary replication relation stops;When the data of second storage region are repaired When changing mark not for the initial value, indicate the data of the second storage region storage after upper primary replication relation stops Changed.
It should be noted that the value of locating initial value is different, the specific implementation of step A is also different.It is introduced below Two kinds of possible implementations.
The first implementation: the initial value is 0, and the data modification mark includes 1 or 0.
It is understood that if the data modification of first storage region is identified as 1, then it represents that first memory block Change has occurred in the data stored in domain, and (data of the i.e. described first storage region storage are after upper primary replication relation stops Changed), if the data modification of first storage region is identified as 0, then it represents that stored in first storage region Data do not change that (i.e. the data of first storage region storage do not change after upper primary replication relation stops Become);If the data modification of second storage region is identified as 1, then it represents that the data hair stored in second storage region Change (data of the i.e. described second storage region storage are changed after upper primary replication relation stops) being given birth to, if institute The data modification for stating the second storage region is identified as 0, then it represents that the data stored in second storage region do not change (data of the i.e. described second storage region storage do not change after upper primary replication relation stops).
In this case, step A in specific implementation, can to the data modification of first storage region identify and The data modification mark of the second storage region corresponding with first storage region is carried out or is calculated, and obtains calculated result.
Further, if calculated result is 1, it is determined that first storage region and/or described and described first storage The data stored in corresponding second storage region in region are the variance data.
Specifically, it can be understood that the figure is the schematic diagram of calculated result provided by the embodiments of the present application in conjunction with Fig. 3.
In Fig. 3, the data modification of the first storage region 120 is identified as " 1 ", the data modification mark of the first storage region 170 Knowing is " 1 ", and the data modification mark of other first storage regions is " 0 ".The data modification of second storage region 210 is identified as The data modification of " 1 ", the second storage region 260 is identified as " 1 ", and the data modification of third storage region 270 is identified as " 1 ", The data modification of its second storage region is identified as " 0 ".After being calculated, obtained calculated result such as 300 institutes in Fig. 3 Show.Wherein:
310 identify the meter identified with the data modification of the second storage region 210 for the data modification of the first storage region 110 Calculate result;320 identify the meter identified with the data modification of the second storage region 220 for the data modification of the first storage region 120 Calculate result;330 identify the meter identified with the data modification of the second storage region 230 for the data modification of the first storage region 130 Calculate result;340 identify the meter identified with the data modification of the second storage region 240 for the data modification of the first storage region 140 Calculate result;350 identify the meter identified with the data modification of the second storage region 250 for the data modification of the first storage region 150 Calculate result;360 identify the meter identified with the data modification of the second storage region 260 for the data modification of the first storage region 160 Calculate result;370 identify the meter identified with the data modification of the second storage region 270 for the data modification of the first storage region 170 Calculate result;380 identify the meter identified with the data modification of the second storage region 280 for the data modification of the first storage region 180 Calculate result.
From 300 it is found that 310 value is not equal to initial value " 0 ", 320 value is not equal to initial value " 0 ", and 360 value is not equal to Initial value " 0 ", 370 value are not equal to initial value " 0 ".Hence, it can be determined that the first storage region of 310 value is calculated Data are had differences between the data of 110 storages and the data of the second storage region 210 storage;320 value is calculated in determination The first storage region 120 storage data and the second storage region 220 storage data between have differences data;Determine meter It calculates between the data of the first storage region 160 storage and the data of the second storage region 260 storage for the value for obtaining 360 in the presence of poor Heteromerism evidence;What the data and the second storage region 270 that the first storage region 170 of the determining value for being calculated 370 stores stored Data are had differences between data.
Second of implementation: the initial value is 0, and the data modification mark includes 1 or 0.
It is understood that if the data modification of first storage region is identified as 0, then it represents that first memory block Change has occurred in the data stored in domain, and (data of the i.e. described first storage region storage are after upper primary replication relation stops Changed), if the data modification of first storage region is identified as 1, then it represents that stored in first storage region Data do not change that (i.e. the data of first storage region storage do not change after upper primary replication relation stops Become);If the data modification of second storage region is identified as 0, then it represents that the data hair stored in second storage region Change (data of the i.e. described second storage region storage are changed after upper primary replication relation stops) being given birth to, if institute The data modification for stating the second storage region is identified as 1, then it represents that the data stored in second storage region do not change (data of the i.e. described second storage region storage do not change after upper primary replication relation stops).
In this case, step A in specific implementation, can to the data modification of first storage region identify and The data modification mark of the second storage region corresponding with first storage region is carried out and is calculated, and obtains calculated result.
Further, if calculated result is 0, it is determined that first storage region and/or described and described first storage The data stored in corresponding second storage region in region are the variance data.
Specifically, it can be understood that the figure is the schematic diagram of calculated result provided by the embodiments of the present application in conjunction with Fig. 4.
In Fig. 4, the data modification of the first storage region 120 is identified as " 0 ", the data modification mark of the first storage region 170 Knowing is " 0 ", and the data modification mark of other first storage regions is " 1 ".The data modification of second storage region 210 is identified as The data modification of " 0 ", the second storage region 260 is identified as " 0 ", and the data modification of third storage region 270 is identified as " 0 ", The data modification of its second storage region is identified as " 1 ".After being calculated, obtained calculated result such as 300 institutes in Fig. 4 Show.Wherein:
310 identify the meter identified with the data modification of the second storage region 210 for the data modification of the first storage region 110 Calculate result;320 identify the meter identified with the data modification of the second storage region 220 for the data modification of the first storage region 120 Calculate result;330 identify the meter identified with the data modification of the second storage region 230 for the data modification of the first storage region 130 Calculate result;340 identify the meter identified with the data modification of the second storage region 240 for the data modification of the first storage region 140 Calculate result;350 identify the meter identified with the data modification of the second storage region 250 for the data modification of the first storage region 150 Calculate result;360 identify the meter identified with the data modification of the second storage region 260 for the data modification of the first storage region 160 Calculate result;370 identify the meter identified with the data modification of the second storage region 270 for the data modification of the first storage region 170 Calculate result;380 identify the meter identified with the data modification of the second storage region 280 for the data modification of the first storage region 180 Calculate result.
From 300 it is found that 310 value is not equal to initial value " 1 ", 320 value is not equal to initial value " 1 ", and 360 value is not equal to Initial value " 1 ", 370 value are not equal to initial value " 1 ".Hence, it can be determined that the first storage region of 310 value is calculated Data are had differences between the data of 110 storages and the data of the second storage region 210 storage;320 value is calculated in determination The first storage region 120 storage data and the second storage region 220 storage data between have differences data;Determine meter It calculates between the data of the first storage region 160 storage and the data of the second storage region 260 storage for the value for obtaining 360 in the presence of poor Heteromerism evidence;What the data and the second storage region 270 that the first storage region 170 of the determining value for being calculated 370 stores stored Data are had differences between data.
S203: synchronizing processing to the variance data so that the data stored in the first memory with it is described The data stored in second memory are identical.
In the embodiment of the present application, if the data that are stored in first storage region and with first storage region pair Data are had differences between the data stored in the second storage region answered, then can will be stored in first storage region Data copy in the second storage region corresponding with first storage region, to cover described and first storage region pair The data stored in the second storage region answered.The data stored in second storage region can also be copied to this In corresponding first storage region of two storage regions, to cover first storage region corresponding with second storage region The data of middle storage.
For example, when synchronizing processing to the data stored in the first storage region 110, it can be by the first memory block The data stored in domain 110 copy in the second storage region 210, to cover number currently stored in the second storage region 210 According to data currently stored in the second storage region 210 can also being copied in the first storage region 110, to cover first Currently stored data in storage region 110.
As above, the data modification of first storage region is identified, for characterizing the first storage region storage Whether data are changed later in upper primary replication relation stopping.Correspondingly, the data modification of second storage region Whether mark, the data for characterizing the second storage region storage are changed later in upper primary replication relation stopping Become.The data of the first storage region storage are changed after upper primary replication relation stops, then it represents that this first The data of storage region storage be likely to and the second storage region corresponding from first storage region in the data that store it is different. Correspondingly, the data of the second storage region storage are changed after upper primary replication relation stops, then it represents that should The data of second storage region storage be likely to and the first storage region corresponding with second storage region in the data that store It is different.
And to the data modification of first storage region mark and the second storage corresponding with first storage region The data modification mark in region is calculated, and after obtaining calculated result, the first memory block can be determined according to the calculated result The data stored in the data and second storage region stored in domain whether there is variance data.In consideration of it, in the application In embodiment, after obtaining the calculated result, the data modification of first storage region can also be identified and/or described The data modification mark of second storage region is revised as the initial value.For example, being understood in conjunction with Fig. 3, according to the first storage The data modification mark in region 110 and the data modification mark of the second storage region 120 are calculated after 310 value, can be with The data modification mark of the data modification mark of first storage region 110 and/or the second storage region 210 is revised as initial value “0”。
It should be noted that in the embodiment of the present application, after being synchronized to the variance data, can further by The calculated result that the data modification mark of first storage region and the data modification of the second storage region identify is revised as institute State initial value.For example, being understood in conjunction with Fig. 3, the data modification mark of the first storage region 110 and the second storage region 210 The data modification calculated result that is calculated of mark not equal to initial value " 0 ", then to being stored in the first storage region 110 Data and the second storage region 120 in after the data that store synchronize, 310 value can be revised as initial value " 0 ".
It is understood that after to the synchronizing of variance data processing, the first memory and described The replication relation of second memory may stop.At this point, the first memory and/or the second memory are likely to be at It is readable can write state.When replication relation for the ease of starting first memory and second memory next time, to described first The data stored in memory and the data stored in the second memory synchronize processing, in the embodiment of the present application, If the data in first storage region change, and the data modification of first storage region be identified as it is described initial Value then modifies the data modification mark of first storage region.If the data in second storage region change, and The data modification of second storage region is identified as the initial value, then modifies the data modification mark of second storage region Know.
It can be seen that using method of data synchronization provided by the embodiments of the present application, since the data of the first storage region are repaired Changing mark can characterize whether the data that the first storage region stores in first memory are changed, the second storage region Data modification mark can characterize whether the data that the second storage region stores in second memory are changed.Therefore, may be used It is identified with the data modification using the data modification of the first storage region mark and second storage region, determines that first deposits The data stored in the data and second memory stored in reservoir whether there is variance data, thus further to the difference number According to processing is synchronized, so that the data stored in first memory and the data stored in the second memory are identical.? That is in this application, processing only is synchronized to variance data, rather than picture is in the prior art, to all numbers According to processing is synchronized, to effectively improve the synchronous efficiency of data.
Example devices
Based on the method for data synchronization that above method embodiment provides, it is synchronous that the embodiment of the present application also provides a kind of data Device introduces the device below in conjunction with attached drawing.
Referring to Fig. 5, which is a kind of structural schematic diagram of data synchronization unit provided by the embodiments of the present application.
Data synchronization unit 500 provided by the embodiments of the present application, such as may include: acquiring unit 510, determination unit 520 and synchronization unit 530.
It wherein, is replication relation between first memory and second memory, the first memory is divided into first The first storage region of number, the second memory are divided into the second storage region of the first number, first storage Region and second storage region correspond, first storage region and with first storage region corresponding second Replication relation each other between storage region;
Acquiring unit 510, for obtaining the data modification mark of the first storage region of first number;And it obtains Take the data modification mark of the second storage region of first number;
Determination unit 520, for the data modification mark and second storage region using first storage region Data modification mark, determine between the data stored in the first memory and the data stored in the second memory With the presence or absence of variance data;
Synchronization unit 530, for if it exists, processing being synchronized to the variance data, so that the first memory The data stored in the data of middle storage and the second memory are identical.
Optionally, the determination unit 520, is specifically used for:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained;
If the calculated result is not equal to initial value, it is determined that first storage region and/or second memory block The data stored in domain are the variance data.
Optionally, the initial value is 0, and the data modification mark includes 1 or 0;If first storage region Data modification is identified as 1, then it represents that the data stored in first storage region are changed, if first memory block The data modification in domain is identified as 0, then it represents that the data stored in first storage region do not change;If described second deposits The data modification in storage area domain is identified as 1, then it represents that and the data stored in second storage region are changed, if described The data modification of two storage regions is identified as 0, then it represents that the data stored in second storage region do not change;
It is described that the data modification mark of first storage region and corresponding with first storage region second are deposited The data modification mark in storage area domain is calculated, and calculated result is obtained, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is carried out or is calculated, and obtains calculated result.
Optionally, the initial value is 1, and the data modification mark includes 0 or 1;If first storage region Data modification is identified as 0, then it represents that the data stored in first storage region are changed, if first memory block The data modification in domain is identified as 1, then it represents that the data stored in first storage region do not change;If described second deposits The data modification in storage area domain is identified as 0, then it represents that and the data stored in second storage region are changed, if described The data modification of two storage regions is identified as 1, then it represents that the data stored in second storage region do not change;
It is described that the data modification mark of first storage region and corresponding with first storage region second are deposited The data modification mark in storage area domain is calculated, and calculated result is obtained, comprising:
To the data modification mark of first storage region and the second memory block corresponding with first storage region The data modification mark in domain is carried out and is calculated, and obtains calculated result.
Optionally, described device 500 further include:
First modification unit, for by the data modification of first storage region mark and/or second memory block The data modification mark in domain is revised as the initial value.
Optionally, described device 500 further include:
Second modification unit, if stopping for the replication relation of the first memory and the second memory, and institute State first memory and/or the second memory be in it is readable can write state when, if the data in first storage region It changes, and the data modification of first storage region is identified as the initial value, then modifies first storage region Data modification mark;And/or if the data in second storage region change, and second storage region Data modification is identified as the initial value, then modifies the data modification mark of second storage region.
It should be noted that since the method for data synchronization that described device 500 is with above method embodiment provides is corresponding Device can refer to the description of above method embodiment accordingly, with respect to the specific implementation of each unit of described device 500, Details are not described herein again.
It can be seen that using data synchronization unit provided by the embodiments of the present application, since the data of the first storage region are repaired Changing mark can characterize whether the data that the first storage region stores in first memory are changed, the second storage region Data modification mark can characterize whether the data that the second storage region stores in second memory are changed.Therefore, may be used It is identified with the data modification using the data modification of the first storage region mark and second storage region, determines that first deposits The data stored in the data and second memory stored in reservoir whether there is variance data, thus further to the difference number According to processing is synchronized, so that the data stored in first memory and the data stored in the second memory are identical.? That is in this application, processing only is synchronized to variance data, rather than picture is in the prior art, to all numbers According to processing is synchronized, to effectively improve the synchronous efficiency of data.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the application Its embodiment.This application is intended to cover any variations, uses, or adaptations of the application, these modifications, purposes or Person's adaptive change follows the general principle of the application and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the application are by following Claim is pointed out.
It should be understood that the application is not limited to the precise structure that has been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.Scope of the present application is only limited by the accompanying claims
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.

Claims (12)

1. a kind of method of data synchronization, which is characterized in that it is replication relation between first memory and second memory, described the One memory is divided into the first storage region of the first number, and the second memory is divided into the first number second and deposits Storage area domain, first storage region and second storage region correspond, first storage region and with described the Replication relation each other between corresponding second storage region of one storage region;Include:
Obtain the data modification mark of the first storage region of first number;And obtain first number second The data modification of storage region identifies;
It is identified using the data modification mark of first storage region and the data modification of second storage region, determines institute The data stored in first memory and the data stored in the second memory are stated with the presence or absence of variance data;
If it exists, processing is synchronized to the variance data, so that the data stored in the first memory and described the The data stored in two memories are identical.
2. the method according to claim 1, wherein the data modification mark using first storage region Know and the data modification of second storage region identifies, determines that the data stored in the first memory and described second are deposited The data stored in storage whether there is variance data, comprising:
To the data modification of first storage region mark and the second storage region corresponding with first storage region Data modification mark is calculated, and calculated result is obtained;
If the calculated result is not equal to initial value, it is determined that the data and second storage stored in the first memory The data of middle storage have differences data.
3. according to the method described in claim 2, the data modification mark includes 1 it is characterized in that, the initial value is 0 Or 0;If the data modification of first storage region is identified as 1, then it represents that the data stored in first storage region Changed, if the data modification of first storage region is identified as 0, then it represents that stored in first storage region Data do not change;If the data modification of second storage region is identified as 1, then it represents that deposited in second storage region The data of storage are changed, if the data modification of second storage region is identified as 0, then it represents that second storage region The data of middle storage do not change;
The data modification to first storage region identifies and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained, comprising:
To the data modification of first storage region mark and the second storage region corresponding with first storage region Data modification mark is carried out or is calculated, and obtains calculated result.
4. according to the method described in claim 2, the data modification mark includes 0 it is characterized in that, the initial value is 1 Or 1;If the data modification of first storage region is identified as 0, then it represents that the data stored in first storage region Changed, if the data modification of first storage region is identified as 1, then it represents that stored in first storage region Data do not change;If the data modification of second storage region is identified as 0, then it represents that deposited in second storage region The data of storage are changed, if the data modification of second storage region is identified as 1, then it represents that second storage region The data of middle storage do not change;
The data modification to first storage region identifies and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained, comprising:
To the data modification of first storage region mark and the second storage region corresponding with first storage region Data modification mark is carried out and is calculated, and obtains calculated result.
5. according to the method described in claim 2, it is characterized in that, it is described obtain calculated result after, the method also includes:
The data modification mark of the data modification mark of first storage region and/or second storage region is revised as The initial value.
6. according to the method described in claim 2, it is characterized in that, the method also includes:
If the replication relation of the first memory and the second memory stops, and the first memory and/or described Second memory be in it is readable can write state when, if the data in first storage region change, and described first deposits The data modification in storage area domain is identified as the initial value, then modifies the data modification mark of first storage region;And/or If the data in second storage region change, and the data modification of second storage region be identified as it is described initial Value then modifies the data modification mark of second storage region.
7. a kind of data synchronization unit, which is characterized in that it is replication relation between first memory and second memory, described the One memory is divided into the first storage region of the first number, and the second memory is divided into the first number second and deposits Storage area domain, first storage region and second storage region correspond, first storage region and with described the Replication relation each other between corresponding second storage region of one storage region;Include:
Acquiring unit, for obtaining the data modification mark of the first storage region of first number;And obtain described the The data modification mark of the second storage region of one number;
Determination unit, the data for data modification mark and second storage region using first storage region are repaired Change mark, determining whether there is between the data stored in the first memory and the data stored in the second memory Variance data;
Synchronization unit, for if it exists, synchronizing processing to the variance data, so that stored in the first memory The data stored in data and the second memory are identical.
8. device according to claim 7, which is characterized in that the determination unit is specifically used for:
To the data modification of first storage region mark and the second storage region corresponding with first storage region Data modification mark is calculated, and calculated result is obtained;
If the calculated result is not equal to initial value, it is determined that the data and second storage stored in the first memory The data of middle storage have differences data.
9. device according to claim 8, which is characterized in that the initial value is 0, and the data modification mark includes 1 Or 0;If the data modification of first storage region is identified as 1, then it represents that the data stored in first storage region Changed, if the data modification of first storage region is identified as 0, then it represents that stored in first storage region Data do not change;If the data modification of second storage region is identified as 1, then it represents that deposited in second storage region The data of storage are changed, if the data modification of second storage region is identified as 0, then it represents that second storage region The data of middle storage do not change;
The data modification to first storage region identifies and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained, comprising:
To the data modification of first storage region mark and the second storage region corresponding with first storage region Data modification mark is carried out or is calculated, and obtains calculated result.
10. device according to claim 8, which is characterized in that the initial value is 1, and the data modification mark includes 0 Or 1;If the data modification of first storage region is identified as 0, then it represents that the data stored in first storage region Changed, if the data modification of first storage region is identified as 1, then it represents that stored in first storage region Data do not change;If the data modification of second storage region is identified as 0, then it represents that deposited in second storage region The data of storage are changed, if the data modification of second storage region is identified as 1, then it represents that second storage region The data of middle storage do not change;
The data modification to first storage region identifies and the second memory block corresponding with first storage region The data modification mark in domain is calculated, and calculated result is obtained, comprising:
To the data modification of first storage region mark and the second storage region corresponding with first storage region Data modification mark is carried out and is calculated, and obtains calculated result.
11. device according to claim 8, which is characterized in that described device further include:
First modification unit, for by the data modification of first storage region mark and/or second storage region Data modification mark is revised as the initial value.
12. device according to claim 8, which is characterized in that described device further include:
Second modification unit, if stopping for the replication relation of the first memory and the second memory, and described the One memory and/or the second memory be in it is readable can write state when, if the data in first storage region occur Change, and the data modification of first storage region is identified as the initial value, then modifies the number of first storage region According to modified logo;And/or if the data in second storage region change, and the data of second storage region Modified logo is the initial value, then modifies the data modification mark of second storage region.
CN201810934585.2A 2018-08-16 2018-08-16 A kind of method of data synchronization and device Pending CN109144418A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810934585.2A CN109144418A (en) 2018-08-16 2018-08-16 A kind of method of data synchronization and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810934585.2A CN109144418A (en) 2018-08-16 2018-08-16 A kind of method of data synchronization and device

Publications (1)

Publication Number Publication Date
CN109144418A true CN109144418A (en) 2019-01-04

Family

ID=64789725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810934585.2A Pending CN109144418A (en) 2018-08-16 2018-08-16 A kind of method of data synchronization and device

Country Status (1)

Country Link
CN (1) CN109144418A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1701303A (en) * 2002-11-29 2005-11-23 国际商业机器公司 Remote copy synchronization in disaster recovery computer systems
CN101211288A (en) * 2006-12-28 2008-07-02 株式会社日立制作所 Storage system comprising backup function
CN102279857A (en) * 2010-06-11 2011-12-14 阿里巴巴集团控股有限公司 Method and system for realizing data reproduction
CN103793271A (en) * 2012-10-29 2014-05-14 国际商业机器公司 Methods and systems for switching between mirrored volumes
CN105045541A (en) * 2015-09-11 2015-11-11 浪潮(北京)电子信息产业有限公司 Increment snapshot method and apparatus
CN105630413A (en) * 2015-12-23 2016-06-01 中国科学院深圳先进技术研究院 Synchronized writeback method for disk data
US20180203623A1 (en) * 2017-01-19 2018-07-19 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1701303A (en) * 2002-11-29 2005-11-23 国际商业机器公司 Remote copy synchronization in disaster recovery computer systems
CN101211288A (en) * 2006-12-28 2008-07-02 株式会社日立制作所 Storage system comprising backup function
CN102279857A (en) * 2010-06-11 2011-12-14 阿里巴巴集团控股有限公司 Method and system for realizing data reproduction
CN103793271A (en) * 2012-10-29 2014-05-14 国际商业机器公司 Methods and systems for switching between mirrored volumes
CN105045541A (en) * 2015-09-11 2015-11-11 浪潮(北京)电子信息产业有限公司 Increment snapshot method and apparatus
CN105630413A (en) * 2015-12-23 2016-06-01 中国科学院深圳先进技术研究院 Synchronized writeback method for disk data
US20180203623A1 (en) * 2017-01-19 2018-07-19 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same and storage medium

Similar Documents

Publication Publication Date Title
CN106325933B (en) Batch data synchronous method and device
US9952783B2 (en) Data processing method and apparatus, and shared storage device
CN105843702B (en) A kind of method and device for data backup
CN105187464B (en) Method of data synchronization, apparatus and system in a kind of distributed memory system
CN106815275B (en) Method and equipment for realizing synchronization of main database and standby database through standby database
CN105376277B (en) A kind of method of data synchronization and device
CN111131399B (en) Method and device for dynamically increasing consensus nodes in block chain
US9576019B2 (en) Increasing distributed database capacity
CN107454161A (en) A kind of data back up method and device
CN106933493A (en) Method and apparatus for caching disk array dilatation
CN107038092B (en) Data copying method and device
CN104077373B (en) A kind of data consistency verification method
CN109032507A (en) A kind of method, system and associated component generating source book storage snapshot
CN106339387A (en) Data synchronization method and device of server newly added to database cluster
CN104580439A (en) Method for achieving uniform data distribution in cloud storage system
CN107085546A (en) Data managing method and device based on failure field technique
CN110780816A (en) Data synchronization method, device and medium
CN106407128A (en) Method and system for multicasting data to persistent memory
CN109815207A (en) Date storage method and Client Agent
CN109144418A (en) A kind of method of data synchronization and device
CN109298977A (en) A kind of virtual machine business quick recovery method, system, device and storage medium
CN107621994A (en) The method and device that a kind of data snapshot creates
JP2016129003A (en) Snapshot management method, management unit, and snapshot management program
US9430163B1 (en) Implementing synchronization for remote disk mirroring
US10725877B2 (en) System, method and computer program product for performing a data protection operation

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

Application publication date: 20190104

RJ01 Rejection of invention patent application after publication