CN108243209A - 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
CN108243209A
CN108243209A CN201611209630.5A CN201611209630A CN108243209A CN 108243209 A CN108243209 A CN 108243209A CN 201611209630 A CN201611209630 A CN 201611209630A CN 108243209 A CN108243209 A CN 108243209A
Authority
CN
China
Prior art keywords
unit
database
data
database unit
main
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
CN201611209630.5A
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.)
Shenzhen Excellent Friends Bullock Media Development Co
Original Assignee
Shenzhen Excellent Friends Bullock Media Development Co
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 Shenzhen Excellent Friends Bullock Media Development Co filed Critical Shenzhen Excellent Friends Bullock Media Development Co
Priority to CN201611209630.5A priority Critical patent/CN108243209A/en
Publication of CN108243209A publication Critical patent/CN108243209A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of method of data synchronization and devices, determine the data update state of each Database Unit in multiple Database Unit, the multiple Database Unit includes main database element and from Database Unit, it is determining that it is newer that the main database element data occur, newer data is being synchronized to from Database Unit by the main database element;In the case that determining described newer from the generation of Database Unit data, newer data are synchronized to main database element from Database Unit by described, and newer data are synchronized to the slave Database Unit in addition to the slave Database Unit that data update occurs by the main database element.When can solve multiple data centers by the present invention and providing application access to the user jointly, the technical issues of how ensureing Database Unit data consistency.

Description

A kind of method of data synchronization and device
Technical field
The present invention relates to Internet technical fields, and in particular to a kind of method of data synchronization and device.
Background technology
With becoming increasingly popular for network service, the type of network application is more and more, by network application accessing network equipment Caused user data visit capacity is increasing.At present, network data is usually stored entirely in a data center, the data Center often data access amount is excessive or hardware, computer room, network etc. due to and break down, individual data center occurs Failure can lead to happening for service disruption, therefore the Database Unit that individual data center includes provides data clothes for application The system reliability of business is than relatively low.
With the extension of current business scale and the increase of data center's disaster tolerance demand, the number that individual data center includes The data service provided according to library unit cannot undertake the demand of various applications.Therefore need multiple data center's shareds each The demand of kind application.
In the above case said, the business datum in the Database Unit included due to multiple data centers is often become More, after the data change in certain data center, other data centers may result in without carrying out data synchronization updating in time Data are inconsistent to be happened, once inconsistent situation, which occur, in the data in each data center will influence user just Often use.
Therefore how multiple data centers ensure that the data of Database Unit are consistent when providing application access to the user jointly Property is problem to be solved.
Invention content
The object of the present invention is to provide a kind of method of data synchronization and device, to solve multiple data centers jointly as user When application access is provided, the problem of how ensureing Database Unit data consistency.
The purpose of the present invention is what is be achieved through the following technical solutions:
In a first aspect, providing a kind of method of data synchronization, in this method, each database in multiple Database Unit is determined The data update state of unit, the multiple Database Unit include main database element and from Database Unit, determining The main database element data occur it is newer in the case of, by the main database element by newer data be synchronized to from Database Unit;In the case that determine described from Database Unit data and occur it is newer, by it is described will from Database Unit Newer data are synchronized to main database element, and newer data are synchronized to except the hair by the main database element Slave Database Unit other than the slave Database Unit of raw data update.
In the embodiment of the present invention, by determining the data update state of each Database Unit in multiple Database Unit, When the Database Unit for determining that data update occurs is main database element, by the main database element to from database Unit synchronizes the newer data, when the Database Unit for determining that data update occurs is from Database Unit, then passes through It is described that newer data are synchronized to main database element, and by the main database element to except described from Database Unit The newer slave Database Unit other than Database Unit occurs and synchronizes the newer data, and and indirect passes through generation The slave Database Unit of data update, which will update the data, to be synchronized to except the generation is newer other in addition to Database Unit From Database Unit.Through the above scheme, multiple Database Unit are avoided and form loop during data synchronize, and then It avoids loop and synchronizes and multiple Database Unit are caused to synchronize chaotic and repeat synchronous situation, ensure that Database Unit The reliability that data synchronize between the consistency of middle data and multiple Database Unit.
Preferably, newer data are synchronized to after Database Unit, and pass through by the main database element Newer data are synchronized to the Backup Data library unit of the main database element by the main database element.
In the embodiment of the present invention, when the data update in the main database element, by the way that newer data are synchronized To the Backup Data library unit of the main database element, it is ensured that the main database element and its Backup Data library unit The consistency of middle data.
Preferably, the above method further includes:
Determine that main database element breaks down;It is the feelings from Database Unit in the Database Unit that data update occurs Under condition, newer data are synchronized to the Backup Data library unit of main database element from Database Unit, and lead to by described Newer data are synchronized to except the generation is newer from database by the Backup Data library unit for crossing the main database element Slave Database Unit other than unit;In the backup database list that the Database Unit that data update occurs is main database element In the case of member, newer data are synchronized to from database list by the Backup Data library unit of the main database element Member.
In the embodiment of the present invention, through the above scheme, it ensure that in the case where main database element breaks down, do not send out The consistency of data in each Database Unit of raw failure.
Preferably, the above method further includes:
It determines to break down from Database Unit;It is the slave number not broken down in the Database Unit that data update occurs In the case of according to library unit, newer data are synchronized to by primary database list by the slave Database Unit not broken down Member, and newer data are synchronized to except the slave Database Unit to break down and institute by the main database element It states and the newer slave Database Unit other than Database Unit occurs;It is master data in the Database Unit that data update occurs In the case of library unit, newer data are synchronized to except the slave Database Unit to break down by the main database element Slave Database Unit in addition.
In the embodiment of the present invention, through the above scheme, it ensure that in the case where breaking down from Database Unit, do not send out The consistency of data in each Database Unit of raw failure.Wherein, when breaking down from Database Unit and occur data update Database Unit be the slave Database Unit not broken down in the case of, by the way that newer data are synchronized to primary database In unit, and from the main database element to except the slave Database Unit to break down and it is described occur it is newer from Slave Database Unit other than Database Unit synchronizes the newer data, due between Database Unit not directly into The synchronization of row data avoids multiple Database Unit and forms loop, and then it is same to avoid loop during data synchronize It walks and multiple Database Unit is caused to synchronize situation that is chaotic and repeating synchronization.
Preferably, the above method further includes:
Determine the Database Unit of fault recovery;It is the feelings from Database Unit in the Database Unit for determining fault recovery Under condition, data are synchronized to the slave Database Unit of fault recovery by main database element;In the data for determining fault recovery In the case that library unit is main database element, data are synchronized to by failure by the Backup Data library unit of main database element The main database element of recovery.
In the embodiment of the present invention, due to the main database element to break down and from Database Unit during failure, with It is synchronized between the Database Unit not broken down without data, therefore restores the main database element of failure and from database list Data in member may be long past due.When from Database Unit fault recovery, data are synchronized to by main database element In the slave Database Unit of fault recovery, when main database element fault recovery, the backup database list of main database element Data are synchronized in the main database element of fault recovery by member, ensure that the later each Database Unit of fault recovery with not sending out The consistency of data in each Database Unit of raw failure.
Second aspect provides a kind of data synchronization unit, including:
Determination unit, it is described for determining the data update state of each Database Unit in multiple Database Unit Multiple Database Unit include main database element and from Database Unit;
Processing unit, for the data update state of each Database Unit determined according to the determination unit, In the case of determining that the main database element data generation is newer, newer data are synchronized by the main database element To from Database Unit, determine it is described from Database Unit data occur it is newer in the case of, by described from Database Unit Newer data are synchronized to main database element, and newer data are synchronized to except described by the main database element The slave Database Unit other than the slave Database Unit of data update occurs.
Preferably, the processing unit is additionally operable to:
Newer data are synchronized to after Database Unit by the main database element, newer data are same Walk the Backup Data library unit of the main database element.
Preferably, the processing unit is additionally operable to:
Determine that main database element breaks down;It is the feelings from Database Unit in the Database Unit that data update occurs Under condition, newer data are synchronized to the Backup Data library unit of main database element from Database Unit, and lead to by described Newer data are synchronized to except the generation is newer from database by the Backup Data library unit for crossing the main database element Slave Database Unit other than unit;In the backup database list that the Database Unit that data update occurs is main database element In the case of member, newer data are synchronized to from database list by the Backup Data library unit of the main database element Member.
Preferably, the processing unit is additionally operable to:
It determines to break down from Database Unit;It is the slave number not broken down in the Database Unit that data update occurs In the case of according to library unit, newer data are synchronized to by primary database list by the slave Database Unit not broken down Member, and newer data are synchronized to except the slave Database Unit to break down and institute by the main database element It states and the newer slave Database Unit other than Database Unit occurs;It is master data in the Database Unit that data update occurs In the case of library unit, newer data are synchronized to except the slave Database Unit to break down by the main database element Slave Database Unit in addition.
Preferably, the processing unit is additionally operable to:
Determine the Database Unit of fault recovery;It is the feelings from Database Unit in the Database Unit for determining fault recovery Under condition, data are synchronized to the slave Database Unit of fault recovery by main database element;In the data for determining fault recovery In the case that library unit is main database element, data are synchronized to by failure by the Backup Data library unit of main database element The main database element of recovery.
Description of the drawings
Fig. 1 is a kind of method of data synchronization flow chart provided in an embodiment of the present invention;
Fig. 2 is another method of data synchronization flow chart provided in an embodiment of the present invention;
Method of data synchronization schematic diagrames of the Fig. 3 between a kind of three Database Unit provided in an embodiment of the present invention;
Fig. 4 is another method of data synchronization flow chart provided in an embodiment of the present invention;
Fig. 5 is another method of data synchronization flow chart provided in an embodiment of the present invention;
Method of data synchronization schematic diagrames of the Fig. 6 between another three Database Unit provided in an embodiment of the present invention;
Method of data synchronization schematic diagrames of the Fig. 7 between another three Database Unit provided in an embodiment of the present invention;
Fig. 8 is another method of data synchronization flow chart provided in an embodiment of the present invention;
Method of data synchronization of the Fig. 9 between another three Database Unit provided in an embodiment of the present invention;
Method of data synchronization of the Figure 10 between another three Database Unit provided in an embodiment of the present invention;
Figure 11 is a kind of data synchronization unit schematic diagram provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is retouched in detail It states, it is clear that described embodiment is only part of the embodiment of the present invention, is not whole embodiments.
When providing application access to the user jointly to solve multiple data centers, how to ensure number in multiple data centers The problem of according to library unit data consistency, the embodiment of the present invention provide a kind of method of data synchronization.
Below in conjunction with the accompanying drawings, a kind of method of data synchronization specific embodiment provided in an embodiment of the present invention is carried out detailed Explanation.
, below will be with method of data synchronization in the embodiment of the present invention, multiple database lists applied to storage identical data Member, and the multiple Database Unit for storing identical data can provide data to access the application of the multiple Database Unit simultaneously It is illustrated for the scene of service.
Fig. 1 show a kind of method of data synchronization flow chart provided in an embodiment of the present invention, as shown in Figure 1, including:
S101:Determine the data update state of each Database Unit in multiple Database Unit.
In the embodiment of the present invention, the multiple Database Unit includes main database element and from Database Unit, by In multiple Database Unit, can data service be provided to access the application of the multiple Database Unit simultaneously, in order to ensure It states multiple Database Unit and provides identical and accurate data service to access the application of the multiple Database Unit, need to protect Demonstrate,prove the consistency of data in each Database Unit in the multiple Database Unit.In order to ensure data in each Database Unit Consistency, each Database Unit can be ensured by determining data update state true in the multiple Database Unit When fixed number is according to updating, in time to other each Database Unit synchrodatas.
S102:It is determining that it is newer that the main database element data occur, is passing through the main database element Newer data are synchronized to from Database Unit.
In the embodiment of the present invention, when the Database Unit for determining that data update occurs is main database element, pass through institute It states main database element and synchronizes the newer data to from Database Unit, ensure that the consistent of data in each Database Unit Property.
S103:In the case that determine described from Database Unit data and occur it is newer, by described from Database Unit Newer data are synchronized to main database element, and newer data are synchronized to except described by the main database element The slave Database Unit other than the slave Database Unit of data update occurs.
In the embodiment of the present invention, when the Database Unit for determining that data update occurs is from Database Unit, then pass through It is described that newer data are synchronized to main database element, and by the main database element to except described from Database Unit The newer slave Database Unit other than Database Unit occurs and synchronizes the newer data, and and indirect passes through generation The slave Database Unit of data update, which will update the data, to be synchronized to except the generation is newer other in addition to Database Unit It, in this way can be to avoid forming loop between each Database Unit during synchronization from Database Unit, and ring Road synchronization can cause to repeat it is synchronous or it is synchronous occur it is chaotic, therefore, can further prevent from repeating in this way it is synchronous or Person, which synchronizes, to be occurred chaotic, ensure that in Database Unit data between the consistency of data and multiple Database Unit Synchronous reliability.
In the embodiment of the present invention, in order to ensure the consistency of main database element and data in Backup Data library unit, lead to It crosses the main database element newer data are synchronized to after Database Unit, also be synchronized to newer data described The Backup Data library unit of main database element.
Fig. 2 show another method of data synchronization flow chart provided in an embodiment of the present invention, as shown in Fig. 2, wherein S201, S202 and S203 are identical with S101, S102 and S103 in Fig. 1 respectively, and the difference lies in pass through the main number in S204 Newer data are synchronized to the Backup Data library unit of the main database element according to library unit.When in main database element When data update, newer data are synchronized to Backup Data library unit by main database element, ensure backup database list The consistency of member and data in main database element, in this way when main database element breaks down, Backup Data library unit can Main database element to be replaced to work.
In the embodiment of the present invention, it is above-mentioned be described in detail main database element with from Database Unit data change When data synchronization process, will update the data and be synchronized to from Database Unit and standby when data change in main database element Part Database Unit.When data change from Database Unit, it will update the data and be synchronized to main database element, and by leading Database Unit, which will update the data, is synchronized to other slave Database Unit that data variation does not occur.Realize primary database list Member is synchronous with the bi-directional data from Database Unit, from not directly progress data synchronization and master data between Database Unit One-way data between library unit and the Backup Data library unit of main database element is synchronous.Fig. 3 show main database element and Its backup database element number is 1, and from the situation that Database Unit quantity is 2, certain embodiment of the present invention is simultaneously unlimited Determine main database element, main database element Backup Data library unit and the particular number from Database Unit.Such as Fig. 3 institutes Show, fraternal unit A represents main database element, the standby backup database lists for representing main database element of fraternal unit A- in figure Member, fraternal unit B and C represent two from Database Unit respectively.Three fraternal units are located at three different computer rooms respectively, such as Computer room 1, computer room 2 and computer room 3 in Fig. 3.It is arranged in computer room 3 in Fig. 3 by fraternal unit A- is standby, brother's unit during practical application A- is standby to may be provided at arbitrary computer room.Global node monitoring is used for the update status of data in monitoring data library unit in figure.
In the embodiment of the present invention, following detailed description breaks down when the Database Unit in the multiple Database Unit When, how to ensure the consistency of data between the Database Unit not broken down respectively, illustrate main database element first During failure, how to ensure the consistency of data between the Database Unit not broken down respectively.
Fig. 4 show another method of data synchronization flow chart provided in an embodiment of the present invention, as shown in Figure 4:
S301:Determine that main database element breaks down.
S302:In the case where the Database Unit that data update occurs is from Database Unit, by described from data Newer data are synchronized to the Backup Data library unit of main database element by library unit, and by the standby of the main database element Newer data are synchronized to the slave database in addition to the slave Database Unit that data update occurs by part Database Unit Unit.
In the embodiment of the present invention, when main database element breaks down, Backup Data library unit will replace primary database Cell operation, therefore when being updated from the data in Database Unit, newer data are synchronized to the backup number first According to library unit, from Backup Data library unit to except it is described occur it is newer other from database list in addition to Database Unit Member synchronizes the newer data, and then ensure that the consistency of data in each Database Unit not broken down.
S303:There is a situation where the Database Unit of data update be main database element Backup Data library unit Under, newer data are synchronized to from Database Unit by the Backup Data library unit of the main database element.
In the embodiment of the present invention, when main database element breaks down, Backup Data library unit will replace primary database Cell operation, when the data in Backup Data library unit update, from Backup Data library unit to same from Database Unit The newer data are walked, and then ensure that the consistency of data in each Database Unit not broken down.
In the embodiment of the present invention, it is described further below from Database Unit break down when, the data that do not break down respectively How the consistency of data is ensured between library unit.
Fig. 5 show another method of data synchronization flow chart provided in an embodiment of the present invention, as shown in Figure 5:
S401:It determines to break down from Database Unit.
S402:In the case where the Database Unit that data update occurs is the slave Database Unit not broken down, lead to It crosses the slave Database Unit not broken down and newer data is synchronized to main database element, and pass through the master data Library unit by newer data be synchronized to except the slave Database Unit to break down and it is described occur data update from Slave Database Unit other than Database Unit.
In the embodiment of the present invention, when breaking down from Database Unit, when in the slave Database Unit not broken down During data update, newer data are synchronized in main database element, and are broken down from main database element to except described Slave Database Unit and the slave Database Unit that data update occurs other than other from Database Unit, synchronous institute Newer data are stated, and then ensure that the consistency of data in each Database Unit not broken down.
S403:In the case where the Database Unit that data update occurs is main database element, pass through the master data Newer data are synchronized to the slave Database Unit in addition to the slave Database Unit to break down by library unit.
In the embodiment of the present invention, when breaking down from Database Unit, when the data update in main database element, by Main database element synchronizes the newer data to the slave Database Unit not broken down, and then ensure that and event does not occur respectively The consistency of data in the Database Unit of barrier.
In the embodiment of the present invention, below will in case of three Database Unit, during database of descriptions cell failure, How the consistency of data is ensured between each Database Unit.Main database element or former from Database Unit is described below in detail During barrier, two kinds of situations of data synchronization.Fig. 6 show from Database Unit break down when a kind of data synchronization process, such as Fig. 6 Shown, identical unit is identical with meaning in Fig. 4 in Fig. 6 and in Fig. 4.In Fig. 6 the fraternal unit B of failure no longer with it is other not The fraternal unit of failure keeps the consistency of data, and the fraternal unit not broken down is in the process for keeping data consistency In, bi-directional synchronization data between fraternal unit A and fraternal unit C, fraternal unit A and fraternal unit A- one-way datas between are same Step.
Fig. 7 shows a kind of data synchronization process when main database element breaks down, as shown in fig. 7, in Fig. 7 with Fig. 4 In identical unit it is identical with meaning in Fig. 4.Fraternal units of the fraternal unit A of failure no longer with other non-failures in Fig. 7 The consistency of data is kept, and the fraternal unit not broken down is during data consistency is kept, fraternal unit A- is standby The equal bi-directional synchronization data between fraternal unit B and fraternal unit C, it is same without data between fraternal unit B and fraternal unit C Step.
It, will be by primary database list when main database element and during from Database Unit simultaneous faults in the embodiment of the present invention The Backup Data library unit of member provides data service for the application accessed, until the Database Unit of failure restores normal.When complete Portion from Database Unit break down when, then provide data for the application accessed by main database element and Backup Data library unit Service at this point, when data update occurs in main database element, will occur newer data by main database element and synchronize To Backup Data library unit, until the Database Unit of failure restores normal.
In the embodiment of the present invention, it is detailed above when main database element and when breaking down from Database Unit such as What ensures the consistency of data, is described more detail below when the Database Unit fault recovery of failure, how to ensure to restore event The Database Unit of barrier and the consistency of data in the Database Unit of non-failure.
Fig. 8 show another method of data synchronization flow chart provided in an embodiment of the present invention, as shown in Figure 8:
S501:Determine the Database Unit of fault recovery.
S502:In the case where the Database Unit for determining fault recovery is from Database Unit, pass through primary database list Data are synchronized to the slave Database Unit of fault recovery by member.
In the embodiment of the present invention, during breaking down from Database Unit, main database element is not to its synchronized update number According to, it, may be expired already from the data in Database Unit when from Database Unit fault recovery, therefore work as what is broken down From during Database Unit fault recovery, total data is synchronized in the slave Database Unit of fault recovery by main database element, It ensure that the slave Database Unit after fault recovery and the consistency of data in the Database Unit not broken down.
S503:In the case where the Database Unit for determining fault recovery is main database element, pass through primary database list Data are synchronized to the main database element of fault recovery by the Backup Data library unit of member.
In the embodiment of the present invention, during main database element breaks down, the Backup Data library unit of main database element It works instead of main database element, the consistency of data is kept between other each Database Unit not broken down.Main number According to be during library unit failure not with other Database Unit carry out data it is synchronous, when main database element fault recovery, Data in main database element may be expired already, therefore when the main database element fault recovery broken down, main number Total data is synchronized in the main database element of fault recovery according to the Backup Data library unit of library unit, ensure that failure is extensive The consistency of data in main database element after multiple and the Database Unit not broken down.
In the embodiment of the present invention, it will illustrate each data during fault recovery in case of three Database Unit below How the consistency of data is ensured between library unit.Fig. 9 shows to synchronize from a kind of data during Database Unit fault recovery Journey, as shown in figure 9, unit identical in Fig. 9 and in Fig. 4 is identical with meaning in Fig. 4.Brother unit A and fault recovery in Fig. 9 Fraternal unit B one-way data synchronize, treat fraternal unit A complete data from the fraternal unit B to fault recovery synchronize after, brother When data update occurring after younger brother's unit B, it is synchronous to carry out bi-directional data with fraternal unit A.Figure 10 shows main database element event Barrier restore when a kind of data synchronization process, as shown in Figure 10, in Figure 10 and in Fig. 4 identical unit with meaning phase in Fig. 4 Together.Fraternal unit A- is standby synchronous with the fraternal unit A one-way datas of fault recovery in Figure 10, with fraternal unit B and fraternal unit C Between bi-directional data synchronize.
A kind of data synchronization unit in the embodiment of the present invention is also provided, the composition and use of the device is described more fully below On the way.
Figure 11 is a kind of data synchronization unit schematic diagram provided in an embodiment of the present invention, and as shown in figure 11, which includes Determination unit 101 and processing unit 102, wherein:
Determination unit 101, for determining the data update state of each Database Unit in multiple Database Unit, institute It states multiple Database Unit and includes main database element and from Database Unit.
Processing unit 102, for the data update of each Database Unit determined according to the determination unit 101 State, determine the main database element data occur it is newer in the case of, by the main database element by newer number According to being synchronized to from Database Unit, determine it is described from Database Unit data occur it is newer in the case of, by described from data Newer data are synchronized to main database element, and be synchronized to newer data by the main database element by library unit Slave Database Unit in addition to the slave Database Unit that data update occurs.
In the embodiment of the present invention, the processing unit 102 is additionally operable to:
Newer data are synchronized to after Database Unit by the main database element, newer data are same Walk the Backup Data library unit of the main database element.
In the embodiment of the present invention, the processing unit 102 is additionally operable to:
Determine that main database element breaks down;It is the feelings from Database Unit in the Database Unit that data update occurs Under condition, newer data are synchronized in the Backup Data library unit of main database element from Database Unit by described, and By the Backup Data library unit of the main database element by newer data be synchronized to except it is described occur data update from Slave Database Unit other than Database Unit;In the backup number that the Database Unit that data update occurs is main database element In the case of according to library unit, newer data are synchronized to from data by the Backup Data library unit of the main database element Library unit.
In the embodiment of the present invention, the processing unit 102 is additionally operable to:
It determines to break down from Database Unit;It is the slave number not broken down in the Database Unit that data update occurs In the case of according to library unit, newer data are synchronized to by primary database list by the slave Database Unit not broken down Member, and newer data are synchronized to except the slave Database Unit to break down and institute by the main database element State the slave Database Unit other than the slave Database Unit that data update occurs;Based on the Database Unit that data update occurs In the case of Database Unit, newer data are synchronized to except the slave database to break down by the main database element Slave Database Unit other than unit.
In the embodiment of the present invention, the processing unit 102 is additionally operable to:
Determine the Database Unit of fault recovery;It is the feelings from Database Unit in the Database Unit for determining fault recovery Under condition, data are synchronized to the slave Database Unit of fault recovery by main database element;In the data for determining fault recovery In the case that library unit is main database element, data are synchronized to by failure by the Backup Data library unit of main database element The main database element of recovery.
In the embodiment of the present invention, by determining the data update state of each Database Unit in multiple Database Unit, When the Database Unit for determining that data update occurs is main database element, by the main database element to from database Unit synchronizes the newer data, when the Database Unit for determining that data update occurs is from Database Unit, then passes through It is described that newer data are synchronized to main database element, and by the main database element to except described from Database Unit The newer slave Database Unit other than Database Unit occurs and synchronizes the newer data, and and indirect passes through generation The slave Database Unit of data update, which will update the data, to be synchronized to except the generation is newer other in addition to Database Unit From Database Unit.Through the above scheme, multiple Database Unit are avoided and form loop during data synchronize, and then It avoids loop and synchronizes and multiple Database Unit are caused to synchronize chaotic and repeat synchronous situation, ensure that Database Unit The reliability that data synchronize between the consistency of middle data and multiple Database Unit.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of method of data synchronization, which is characterized in that including:
Determine the data update state of each Database Unit in multiple Database Unit, the multiple Database Unit includes Main database element and from Database Unit;
Determining that it is newer that the main database element data occur, by the main database element by newer number According to being synchronized to from Database Unit;
In the case that determine described from Database Unit data and occur it is newer, by it is described from Database Unit by newer number According to being synchronized to main database element, and be synchronized to newer data except the generation data more by the main database element Slave Database Unit other than new slave Database Unit.
2. the method as described in claim 1, which is characterized in that be synchronized to newer data by the main database element After Database Unit, the method further includes:
Newer data are synchronized to the Backup Data library unit of the main database element by the main database element.
3. such as claim 1 to 2 any one of them method, which is characterized in that the method further includes:
Determine that main database element breaks down;
Occur data update Database Unit be from Database Unit in the case of, by it is described will more from Database Unit New data are synchronized to the Backup Data library unit of main database element, and pass through the backup database of the main database element Newer data are synchronized to the slave Database Unit in addition to the slave Database Unit that data update occurs by unit;
In the case of Backup Data library unit of the Database Unit that data update occurs for main database element, by described Newer data are synchronized to from Database Unit by the Backup Data library unit of main database element.
4. such as claim 1 to 2 any one of them method, which is characterized in that the method further includes:
It determines to break down from Database Unit;
In the case where the Database Unit that data update occurs is the slave Database Unit not broken down, do not sent out by described Newer data are synchronized to main database element, and will more by the main database element by the slave Database Unit of raw failure New data are synchronized to except the slave Database Unit to break down and the slave Database Unit that data update occurs Slave Database Unit in addition;
It, will more by the main database element in the case where the Database Unit that data update occurs is main database element New data are synchronized to the slave Database Unit in addition to the slave Database Unit to break down.
5. the method as described in claim 1, which is characterized in that the method further includes:
Determine the Database Unit of fault recovery;
It is by main database element that data are same in the case where the Database Unit for determining fault recovery is from Database Unit Walk the slave Database Unit of fault recovery;
In the case where the Database Unit for determining fault recovery is main database element, pass through the backup number of main database element Data are synchronized to the main database element of fault recovery according to library unit.
6. a kind of data synchronization unit, which is characterized in that including:
Determination unit, for determining the data update state of each Database Unit in multiple Database Unit, the multiple number Include main database element and from Database Unit according to library unit;
Processing unit for the data update state of each Database Unit determined according to the determination unit, determines The main database element data occur it is newer in the case of, by the main database element by newer data be synchronized to from Database Unit, determine it is described from Database Unit data occur it is newer in the case of, by it is described will more from Database Unit New data are synchronized to main database element, and newer data are synchronized to except the generation by the main database element Slave Database Unit other than the slave Database Unit of data update.
7. device as claimed in claim 6, which is characterized in that the processing unit is additionally operable to:
Newer data are synchronized to after Database Unit by the main database element, newer data are synchronized to The Backup Data library unit of the main database element.
8. such as claim 6 to 7 any one of them device, which is characterized in that the processing unit is additionally operable to:
Determine that main database element breaks down;
Occur data update Database Unit be from Database Unit in the case of, by it is described will more from Database Unit New data are synchronized to the Backup Data library unit of main database element, and pass through the backup database of the main database element Newer data are synchronized to the slave Database Unit in addition to the slave Database Unit that data update occurs by unit;
In the case of Backup Data library unit of the Database Unit that data update occurs for main database element, by described Newer data are synchronized to from Database Unit by the Backup Data library unit of main database element.
9. such as claim 6 to 7 any one of them device, which is characterized in that the processing unit is additionally operable to:
It determines to break down from Database Unit;
In the case where the Database Unit that data update occurs is the slave Database Unit not broken down, do not sent out by described Newer data are synchronized to main database element, and will more by the main database element by the slave Database Unit of raw failure New data are synchronized to except the slave Database Unit to break down and the slave Database Unit that data update occurs Slave Database Unit in addition;
It, will more by the main database element in the case where the Database Unit that data update occurs is main database element New data are synchronized to the slave Database Unit in addition to the slave Database Unit to break down.
10. device as claimed in claim 8 or 9, which is characterized in that the processing unit is additionally operable to:
Determine the Database Unit of fault recovery;
It is by main database element that data are same in the case where the Database Unit for determining fault recovery is from Database Unit Walk the slave Database Unit of fault recovery;
In the case where the Database Unit for determining fault recovery is main database element, pass through the backup number of main database element Data are synchronized to the main database element of fault recovery according to library unit.
CN201611209630.5A 2016-12-23 2016-12-23 A kind of method of data synchronization and device Pending CN108243209A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611209630.5A CN108243209A (en) 2016-12-23 2016-12-23 A kind of method of data synchronization and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611209630.5A CN108243209A (en) 2016-12-23 2016-12-23 A kind of method of data synchronization and device

Publications (1)

Publication Number Publication Date
CN108243209A true CN108243209A (en) 2018-07-03

Family

ID=62704409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611209630.5A Pending CN108243209A (en) 2016-12-23 2016-12-23 A kind of method of data synchronization and device

Country Status (1)

Country Link
CN (1) CN108243209A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851528A (en) * 2019-10-09 2020-02-28 网联清算有限公司 Database synchronization method and device, storage medium and computer equipment
CN113672604A (en) * 2021-08-16 2021-11-19 浙江大华技术股份有限公司 User data synchronization method, device and system and electronic equipment

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030074600A1 (en) * 2000-04-12 2003-04-17 Masaharu Tamatsu Data backup/recovery system
CN101309167A (en) * 2008-06-27 2008-11-19 华中科技大学 Disaster allowable system and method based on cluster backup
CN101918927A (en) * 2008-01-18 2010-12-15 Tivo有限公司 Distributed backup and retrieval system
CN102033930A (en) * 2010-12-17 2011-04-27 北京世纪互联工程技术服务有限公司 Distributed memory database system
CN102541693A (en) * 2011-12-31 2012-07-04 曙光信息产业股份有限公司 Multi-copy storage management method and system of data
CN103019875A (en) * 2012-12-19 2013-04-03 北京世纪家天下科技发展有限公司 Method and device for realizing double main reconstruction of database
CN103560906A (en) * 2013-10-22 2014-02-05 珠海多玩信息技术有限公司 Data replication method and device
CN103853748A (en) * 2012-11-29 2014-06-11 天津书生投资有限公司 Database synchronizing method
CN104281506A (en) * 2014-07-10 2015-01-14 中国科学院计算技术研究所 Data maintenance method and system for file system
CN104537046A (en) * 2014-12-24 2015-04-22 北京奇虎科技有限公司 Method and device for complementing data
CN104980455A (en) * 2014-04-02 2015-10-14 腾讯科技(深圳)有限公司 Multi-terminal data synchronization method based on cloud storage, device and system thereof
CN105159796A (en) * 2015-08-24 2015-12-16 浪潮(北京)电子信息产业有限公司 Data processing method and server end
CN105306585A (en) * 2015-11-12 2016-02-03 焦点科技股份有限公司 Data synchronization method for plurality of data centers
CN105930498A (en) * 2016-05-06 2016-09-07 中国银联股份有限公司 Distributed database management method and system
CN106021030A (en) * 2016-05-30 2016-10-12 浪潮电子信息产业股份有限公司 Database system and database fault processing method and device
CN106254416A (en) * 2016-06-27 2016-12-21 乐视控股(北京)有限公司 Communication data synchronous method and system

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030074600A1 (en) * 2000-04-12 2003-04-17 Masaharu Tamatsu Data backup/recovery system
CN101918927A (en) * 2008-01-18 2010-12-15 Tivo有限公司 Distributed backup and retrieval system
CN101309167A (en) * 2008-06-27 2008-11-19 华中科技大学 Disaster allowable system and method based on cluster backup
CN102033930A (en) * 2010-12-17 2011-04-27 北京世纪互联工程技术服务有限公司 Distributed memory database system
CN102541693A (en) * 2011-12-31 2012-07-04 曙光信息产业股份有限公司 Multi-copy storage management method and system of data
CN103853748A (en) * 2012-11-29 2014-06-11 天津书生投资有限公司 Database synchronizing method
CN103019875A (en) * 2012-12-19 2013-04-03 北京世纪家天下科技发展有限公司 Method and device for realizing double main reconstruction of database
CN103560906A (en) * 2013-10-22 2014-02-05 珠海多玩信息技术有限公司 Data replication method and device
CN104980455A (en) * 2014-04-02 2015-10-14 腾讯科技(深圳)有限公司 Multi-terminal data synchronization method based on cloud storage, device and system thereof
CN104281506A (en) * 2014-07-10 2015-01-14 中国科学院计算技术研究所 Data maintenance method and system for file system
CN104537046A (en) * 2014-12-24 2015-04-22 北京奇虎科技有限公司 Method and device for complementing data
CN105159796A (en) * 2015-08-24 2015-12-16 浪潮(北京)电子信息产业有限公司 Data processing method and server end
CN105306585A (en) * 2015-11-12 2016-02-03 焦点科技股份有限公司 Data synchronization method for plurality of data centers
CN105930498A (en) * 2016-05-06 2016-09-07 中国银联股份有限公司 Distributed database management method and system
CN106021030A (en) * 2016-05-30 2016-10-12 浪潮电子信息产业股份有限公司 Database system and database fault processing method and device
CN106254416A (en) * 2016-06-27 2016-12-21 乐视控股(北京)有限公司 Communication data synchronous method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851528A (en) * 2019-10-09 2020-02-28 网联清算有限公司 Database synchronization method and device, storage medium and computer equipment
CN110851528B (en) * 2019-10-09 2022-09-02 网联清算有限公司 Database synchronization method and device, storage medium and computer equipment
CN113672604A (en) * 2021-08-16 2021-11-19 浙江大华技术股份有限公司 User data synchronization method, device and system and electronic equipment

Similar Documents

Publication Publication Date Title
CN102652423B (en) Method and system for cluster selection and cooperative replication
US10177994B2 (en) Fault tolerant federation of computing clusters
CN104123198B (en) The method and apparatus for managing data replication mode
CN104427002B (en) Group system and the method for providing service availability in group system
CN110784350B (en) Design method of real-time high-availability cluster management system
CN104243527A (en) Data synchronization method and device and distributed system
CN109005045A (en) Active and standby service system and host node fault recovery method
CN104734878A (en) Software-defined networking disaster recovery
CN105468476B (en) Data disaster recovery and backup systems based on HDFS
JP2010128644A (en) Failure restoration method, program and management server
CN103534955A (en) Coordinated disaster recovery production takeover operations
US20140136878A1 (en) Scaling Up and Scaling Out of a Server Architecture for Large Scale Real-Time Applications
CN108319618B (en) Data distribution control method, system and device of distributed storage system
US20140137187A1 (en) Scalable and Highly Available Clustering for Large Scale Real-Time Applications
CN107153660A (en) The fault detect processing method and its system of distributed data base system
CN105988894A (en) Disaster tolerance technique of active-active mode
CN110489494A (en) Distributed data base on-line rapid estimation method and device
CN108243209A (en) A kind of method of data synchronization and device
CN109298837A (en) A kind of multi-controller caching backup method, device, equipment and readable storage medium storing program for executing
CN103516734A (en) Data processing method, device and system
JP5124237B2 (en) Storage system and storage subsystem
CN105893176B (en) A kind of management method and device of network store system
CN106951445A (en) A kind of distributed file system and its memory node loading method
CN110377487A (en) A kind of method and device handling high-availability cluster fissure
JP2013117889A (en) Wide area dispersion constitution alteration 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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180703