CN112905694A - Data synchronization method, device, server and storage medium - Google Patents

Data synchronization method, device, server and storage medium Download PDF

Info

Publication number
CN112905694A
CN112905694A CN202110164554.5A CN202110164554A CN112905694A CN 112905694 A CN112905694 A CN 112905694A CN 202110164554 A CN202110164554 A CN 202110164554A CN 112905694 A CN112905694 A CN 112905694A
Authority
CN
China
Prior art keywords
data
snapshot
source data
target data
target
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
CN202110164554.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.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya 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 Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110164554.5A priority Critical patent/CN112905694A/en
Publication of CN112905694A publication Critical patent/CN112905694A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion

Landscapes

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

Abstract

The invention provides a data synchronization method, a data synchronization device, a server and a storage medium, wherein the method comprises the following steps: obtaining a priority of source data, the source data having been subjected to at least one modification operation; and synchronizing the modified source data to a target data area corresponding to the source data according to the effective strategy corresponding to the priority. The method and the device determine the effective strategy corresponding to the source data according to the priority of the source data, thereby reducing the risk that the source data with high importance degree is mistakenly synchronized out.

Description

Data synchronization method, device, server and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data synchronization method, an apparatus, a server, and a storage medium.
Background
The service operation management background manages massive service data, the service data can be provided for a plurality of data center platforms all over the world to use, in the process of dealing with the service diversity requirements of users, the updating frequency and the using times of the service data are very high, the updating data are synchronized to each data center in time, and the data requirements of each data center are met.
At present, after service data is modified, the industry broadcasts the modified service data to each data center area immediately, so that each data center area obtains the modified service data, and the defects of the method are as follows: all the data have the same synchronization rule, the modified data are immediately synchronized to each data center, and a corresponding auditing mechanism is not executed according to the importance degree of each type of data, so that the data with errors in modification can be synchronized, and irreparable loss is caused.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a data synchronization method, apparatus, server and storage medium, which are used to determine an effective policy corresponding to source data according to a priority of the source data, so as to reduce a risk that the source data with a high importance degree is mistakenly synchronized.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, the present invention provides a data synchronization method, including: acquiring the priority of source data; the source data is executed with at least one modification operation; and synchronizing the modified source data to a target data area corresponding to the source data according to the effective strategy corresponding to the priority.
Optionally, synchronizing the modified source data to a data center according to the validation policy corresponding to the priority identifier includes: when the effective strategy is a delayed effective strategy, copying the target data snapshot corresponding to the modified source data to the target data area; wherein the modified source data corresponds to a plurality of data snapshots; the data snapshot is data for backing up the modified source data according to a preset time interval; the target data snapshot is one of the plurality of data snapshots; and when the effective strategy is an immediate effective strategy, copying the modified source data to the target data area.
Optionally, when the validation policy is a delayed validation policy, copying the modified target data snapshot corresponding to the source data to the target data area, including: when the effective strategy is a delayed effective strategy, determining the target data snapshot based on user audit confirmation time and snapshot time of a plurality of data snapshots corresponding to the source data; and the snapshot time of the target data snapshot is less than or equal to the user audit confirmation time and is adjacent to the user audit confirmation time.
Optionally, the method further comprises: responding to the user checking operation and outputting prompt information; the prompt message comprises the snapshot time of the target snapshot; when the validation policy is a delayed validation policy, determining the target data snapshot based on a user audit confirmation time and snapshot times of a plurality of data snapshots corresponding to the source data, including: and responding to the user confirmation operation, and determining the target data snapshot based on the user confirmation operation and the snapshot time of the plurality of data snapshots corresponding to the source data.
Optionally, copying the target data snapshot to the target data area includes: acquiring a routing rule table corresponding to the source data according to the index number of the target data snapshot; the routing rule table is used for maintaining the corresponding relation between the source data and the target data area as well as the synchronization strategy; and synchronizing the target data snapshot to the target area corresponding to the source data based on the synchronization policy corresponding to the source data.
Optionally, when the validation policy is a delayed validation policy, determining the target data snapshot based on a user audit confirmation time and snapshot times of a plurality of data snapshots corresponding to the source data, further includes: and when the designated operation of the auditor for one of the data snapshots is obtained, determining the designated data snapshot as a target data snapshot.
Optionally, after synchronizing the target data snapshot to the target area corresponding to the source data based on the synchronization policy corresponding to the source data, the method further includes: and generating a notification message and sending the notification message to a target area application program corresponding to the target data area, so that the target area application program reads the updated source data.
In a second aspect, the present invention provides a data synchronization apparatus, including: the acquisition module is used for acquiring the priority of the source data; the source data is executed with at least one modification operation; and the synchronization module is used for synchronizing the modified source data to a target data area corresponding to the source data according to the effective strategy corresponding to the priority.
Optionally, the synchronization module is specifically configured to: when the effective strategy is a delayed effective strategy, copying the target data snapshot corresponding to the modified source data to the target data area; wherein the modified source data corresponds to a plurality of data snapshots; the data snapshot is data for backing up the modified source data according to a preset time interval; the target data snapshot is one of the plurality of data snapshots; and when the effective strategy is an immediate effective strategy, copying the modified source data to the target data area.
In a third aspect, the present invention provides a server comprising a memory and a memory, the memory storing machine executable instructions executable by the memory to implement the method of the first aspect.
In a fourth aspect, the present invention provides a storage medium having stored thereon a computer program which, when executed by a memory, implements the method of the first aspect.
The embodiment of the invention provides a data synchronization method, a data synchronization device, a server and a storage medium, wherein the method comprises the following steps: acquiring the priority of source data; the source data is executed with at least one modification operation; and synchronizing the modified source data to a target data area corresponding to the source data according to the effective strategy corresponding to the priority. The method is different from the prior art in that after source data is updated, each data center is broadcast immediately, the data is not synchronized according to the strategy of the importance degree of the source data, and once the data is in error and is synchronized, irreparable loss is caused.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic diagram of an application environment provided in an embodiment of the present invention;
fig. 2 is a block diagram of a server according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a data synchronization method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of one implementation of step S32 provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of a data snapshot generation process;
FIG. 6 is a schematic flow chart of one implementation of step S322 provided in the embodiments of the present invention;
FIG. 7 is a diagram illustrating a list of modifications to be reviewed in accordance with an implementation of the present invention;
FIG. 8 is a schematic flow chart diagram of one implementation of step S322-2 provided by an embodiment of the present invention;
FIG. 9 is a schematic diagram of a scenario provided in an embodiment of the present invention;
FIG. 10 is a schematic diagram of another scenario presented in an embodiment of the present invention;
fig. 11 is a functional block diagram of a data synchronization apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The service operation management background manages massive service data, the service data can be provided for a plurality of data center platforms all over the world to use, in the process of dealing with the service diversity requirements of users, the updating frequency and the using times of the service data are very high, the updating data are synchronized to each data center in time, and the data requirements of each data center are met. At present, after service data is modified, the industry broadcasts the modified service data to each data center area immediately, so that each data center area obtains the modified service data, and the defects of the method are as follows: all the data have the same synchronization rule, the modified data are immediately synchronized to each data center, and a corresponding auditing mechanism is not executed according to the importance degree of each type of data, so that the data with errors in modification can be synchronized, and irreparable loss is caused.
In order to solve the above problem, the present invention provides a data synchronization method, which can be applied in an application environment shown in fig. 1, referring to fig. 1, where fig. 1 is a schematic diagram of an application environment provided in an embodiment of the present invention, and the method includes: a source data center server 10 and a target data center server 11, wherein the source data center server 10 maintains source data, the source data can be provided with a plurality of target data center servers 11 for use, and when the source data maintained in the source data center server 10 is updated, the updated source data is synchronized to the target data center servers 11.
In the embodiment of the present invention, after the source data is modified, the source data center server 10 may synchronously update the modified source data to the target data center server 11 according to the validation policy corresponding to each source data, so as to avoid data errors and irreparable loss.
To implement the foregoing data synchronization function, an implementation manner of the source data center server 10 is given below, please refer to fig. 2, and fig. 2 is a block diagram of a server according to an embodiment of the present invention. The server 200 may be the source data center server 10 in the figure, and the server 200 includes a data synchronization device 201, a memory 202, a memory 203 and a communication interface 204. The memory 202, the memory 203 and the communication interface 204 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The memory 202 is used for storing programs or data. The memory 202 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an erasable read only memory (EPROM), an electrically erasable read only memory (EEPROM), and the like.
The memory 203 is used to read/write data or programs stored in the memory 202 and perform corresponding functions.
The communication interface 204 is used for establishing communication connection between the server and other servers through the network, and for transceiving data through the network.
It should be understood that the architecture shown in fig. 2 is merely a schematic diagram of a server, which may also include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 1. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
Based on the application environment shown in fig. 1 and the server architecture shown in fig. 2, a data synchronization method provided in an embodiment of the present invention is described in detail below, referring to fig. 3, where fig. 3 is a schematic flowchart of a data synchronization method provided in an embodiment of the present invention, where the method may include:
and S31, acquiring the priority of the source data.
In some possible embodiments, the source data may be data that is edited and previewed simultaneously by operators supporting multiple regions of the world, the source data may be modified at least once, and it is understood that the source data may be provided for use by other data centers around the world.
In some possible embodiments, a large amount of source data is stored in the source data center, and the importance degrees of the source data are different, so that all the source data can be prioritized according to the importance degrees of the source data, and each source data can be prioritized by a priority level identifier, for example, the level identifier may be in the form of level 1, level 2, or level a, level B, or the like. The user can configure the priority of each source data according to the actual requirement.
And S32, synchronizing the modified source data to the target data area corresponding to the source data according to the effective strategy corresponding to the priority.
In some scenarios, in order to prevent the data which is erroneous and has a higher importance level after modification from being synchronized out, and causing irreparable loss, different validation policies may be established for different priorities, where a validation policy indicates whether modification of the source data is validated immediately and synchronized, for example, a validation policy which is validated immediately after modification or a validation policy which is delayed after modification, and the like. For example, level 1 corresponds to an immediate validation policy, and level 2 corresponds to a delayed validation policy, so that modified source data can be synchronized according to the validation policy matched with the modified source data, and errors are avoided.
In some possible examples, the target data area refers to an area where the source data is applied, for example, a data center where the source data is located is in singapore, and the target data area may be an area of the united states, brazil, indonesia, or the like.
The data synchronization method provided by the embodiment of the invention is different from the prior art in that after source data is updated, each data center is immediately broadcast in the prior art, the data is synchronized according to the importance degree of the source data, once the data is in error and is synchronized, irreparable loss can be caused, in order to solve the problem, after the source data is modified, an effective strategy corresponding to the source data is determined according to the priority of the source data, the effective strategy can be in instant effect or in delayed effect, and the delayed effect means that an auditing mechanism intervenes before synchronization, so that the risk that the source data with high importance degree is mistakenly synchronized is reduced.
Optionally, in some scenarios, for source data with a low degree of importance, synchronization may be performed immediately after modification to a target data region corresponding to the source data, and for some source data with a high degree of importance, synchronization may be performed after modification with a delay to the target data region, which is given below for synchronization manners under these two effective policies, referring to fig. 4, where fig. 4 is a schematic flowchart of an implementation manner of step S32 provided by an embodiment of the present invention, and step S32 may include:
s321, when the effective strategy is an instant effective strategy, copying the modified source data to the target data area.
In some possible embodiments, the modified source data may be copied to the target data region by the table-wide copy scheduler, the target data region storing the source data.
And S322, when the effective strategy is a delayed effective strategy, copying the target data snapshot corresponding to the modified source data to the target data area.
In some possible embodiments, the modified source data corresponds to a plurality of data snapshots, and the data snapshots are data for backing up the modified source data at preset time intervals; the preset time interval can be 2 minutes, 5 minutes and the like, a user can configure according to actual needs, and the target data snapshot is one of the multiple data snapshots.
For example, referring to fig. 5, fig. 5 is a schematic diagram of a data snapshot generating process, and it can be seen that a preset time interval of a data snapshot is 5 minutes, that is, every 5 minutes, source data at this time is backed up, and in order to reduce storage, a maximum of 100 snapshots are usually saved.
It should be noted that, at this time, the backed-up source data has already been modified, so that the target data snapshot can be copied to the target data area. As can be seen from fig. 5, each data snapshot corresponds to a snapshot time, and the modification state of the source data at this time can be obtained according to the snapshot time.
Optionally, based on the above, for the source data adopting the delayed validation policy, in order to prevent an error, an auditing mechanism is introduced below to achieve the purpose of synchronizing the target data snapshot to the target data area, referring to fig. 6, where fig. 6 is a schematic flow chart of an implementation manner of step S322 provided by the embodiment of the present invention, and step S32 may include:
s322-1, when the validation strategy is a delayed validation strategy, determining the target data snapshot based on the user audit confirmation time and the snapshot time of the plurality of data snapshots.
S322-2, copying the target data snapshot to the target data area.
In the embodiment of the present invention, the time for the user to verify and confirm refers to that the reviewer starts to verify the modified list to be verified, and after confirming that the modification is correct, for example, when the reviewer operates the confirmation button on the display interface, a time stamp for verification and confirmation can be obtained.
It is understood that the snapshot time of the target data snapshot is less than or equal to the user audit confirmation time and corresponds to the data snapshot adjacent to the user audit confirmation time.
It can also be understood that the target data snapshot includes all modified fields in the to-be-checked modified list corresponding to the modified source data, or includes partial modified fields in the to-be-checked modified list; the modification list to be audited is generated based on the modification operation, and can be used for maintaining the corresponding relation between the modified field in the source data and the modification timestamp.
In a possible scenario, the target data snapshot includes a part of modification fields in a to-be-audited modification list corresponding to modified source data, that is, the snapshot time of the target data snapshot may be less than the maximum modification time in the to-be-audited list corresponding to the source data; it can be understood that the list of modifications to be reviewed is generated based on the modifying operation; and the modification list to be audited is used for maintaining the corresponding relation between the modified field in the source data and the modification timestamp. After the operator modifies the source data each time, a list is added to the list to be checked. It should be noted that, if the modification to the data is irrevocable, for example, if the modification to the data is made in 18:16:00, the modification is irrevocable, and the modification can be made again only on this basis, and then a modification record is added to the modification list to be reviewed.
For example, referring to fig. 7, fig. 7 is a schematic diagram of a to-be-checked modification list provided in the implementation of the present invention, as can be seen from fig. 7, a data table 1 may be modified by mechanical energy of a plurality of different operators, and a record of modified fields and operation time is generated once per operation, so as to generate a to-be-checked modification list, which may be checked by an auditor, and once any pass, data synchronization may be performed according to a target data snapshot.
In conjunction with fig. 5 and 7, assuming that the audit validation time of the auditor is 18:19:00, the system may determine that less than 18:19 and the snapshot time adjacent to 18:19 is 18:15:00, at this time, the data table of the target data area can be covered by the corresponding data snapshot of 18:15:00, but the to-be-audited modification list contains records exceeding the snapshot time 18:15:00 (such as 18:16:00 and 18:18:00 of the table 004 classmatic operation in fig. 5, and hereinafter referred to as standard snapshots for short) will not be copied to the target data area. However, the system outputs prompt information to prompt the auditor of the current snapshot time, and the user can determine whether to use the data snapshot of the current snapshot time or wait for the next data snapshot to be generated according to actual needs.
In a second possible scenario, the target data snapshot includes all modification fields in the to-be-reviewed modification list corresponding to the modified source data, that is, the snapshot time of the target data snapshot is greater than or equal to the maximum modification time in the to-be-reviewed modification list, for example, continuing with the above example, if an auditor needs to copy all modification records of the table of fig. 5 to the target data area, the auditor may wait until the next snapshot generation, which is expected to be 18:20:00, the auditor may perform auditing at 18:21:01, where the snapshot time 18:21:01 may be greater than or equal to the maximum modification time in the to-be-reviewed list, and at this time, the data snapshot corresponding to the snapshot time 18:20:00 may include all modifications on the table and may be used as the target data snapshot.
Optionally, after the target data snapshot is obtained, the target data snapshot may be copied to the target data area, a possible implementation manner is given below, referring to fig. 8, fig. 8 is a schematic flow chart of an implementation manner of step S322-2 provided in the embodiment of the present invention, and step S322-2 may include:
s322-2-1, obtaining a routing rule table corresponding to the source data according to the index number of the target data snapshot; the routing rule table is used for maintaining the corresponding relation between the source data and the target data area as well as the synchronization strategy.
S322-2-2, synchronizing the target data snapshot to a target area corresponding to the source data based on the synchronization strategy corresponding to the source data.
In some possible embodiments, if the auditor confirms the audit, the scheduler may determine the routing rule table corresponding to the source data table according to the index number (e.g., 20201209-18:15:00) of the target data snapshot, and further synchronize the target data snapshot to the target data area according to the synchronization policy in the routing rule table. If the audit is not passed, the data of the data table is marked, a message is sent to a management page for modifying the data, and the data table is allowed to be audited again only if the data table is modified again.
Optionally, in some possible embodiments, after the source data of the target data area is updated, the target area application program corresponding to the target data area may be further notified that the data update is completed, so as to facilitate policy control and reading of the updated source data by the target area application program.
For the convenience of understanding the above embodiments, please refer to fig. 9, fig. 9 is a schematic view of a scenario provided by the embodiment of the present invention, assuming that the source data is data table 1, and the index number of the obtained target data snapshot is 20201209181500, at this time, the target data areas corresponding to the source data table 1 can be determined as the united states area (US), brazilian area (BR), and indonesia area (IN) according to the index number, if the corresponding synchronization policy is full table coverage, the target data snapshot can be completely table covered or added to the data table 1 of the data center corresponding to each of the US area (US), brazilian area (BR) and indonesia area (IN), after the data is copied, an asynchronous message notification can be sent to the area application program, and the area application program comprises a U.S. area program, a Brazil area program and a Indonesia area program, so that updated source data of each area can be read conveniently.
Optionally, in the auditing process, if it is determined that a certain piece of data in the list to be audited is modified by an error, that is, the auditing is not passed, then one data snapshot may be designated as a target data snapshot, and then the designated target data snapshot is synchronized to the target data area, it can be understood that all data snapshots after the snapshot time of the designated target data snapshot have error data.
To facilitate understanding of the whole implementation process of the above embodiment, a scene diagram is given below, referring to fig. 10, and fig. 10 is another scene diagram given in the embodiment of the present invention.
As shown in fig. 10, it is assumed that source data is located in the singapore data center room, the source data includes data table 1, data table 2, data table 3, data table 4, and data table 5, where the importance degrees of data tables 1 to 4 are greater than the importance degrees of data tables 5 and 6, data tables 1 to 3 correspond to the delayed validation policy, and data tables 4 and 5 correspond to the immediate validation policy.
Suppose that the global operator a modifies the data table 1 for 6 times, the data can be previewed or edited in the management background immediately after the modification is finished each time, a list is automatically added to the list to be checked and modified each time, and the auditor checks the list according to the list records. If the audit is passed, the determined target data snapshot is submitted to a replication scheduler, and the scheduler replicates the target data snapshot into a data table 1 corresponding to other data centers around the world. If the audit is not passed, a message is sent to the management page for modifying the data, and the data table is allowed to be audited again by the high-level administrator only if the data table is modified again.
If the global operator B modifies the data table 4 or the data table 5, the copy scheduler directly copies the modified data table 4 or the modified data table 5 to the data table 4 or the data table 5 corresponding to other data centers around the world.
In order to execute the corresponding steps in the above embodiment and various possible manners, an implementation manner of the data synchronization apparatus is given below, and optionally, the data synchronization apparatus 201 may adopt the device structure of the data synchronization apparatus 201 shown in fig. 2. Further, referring to fig. 11, fig. 11 is a functional block diagram of a data synchronization apparatus according to an embodiment of the present invention. It should be noted that the basic principle and the generated technical effect of the data synchronization apparatus 201 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no part of the present embodiment is mentioned, and corresponding contents in the above embodiments may be referred to. The data synchronization apparatus 201 includes:
an obtaining module 2011, configured to obtain a priority of the source data; the source data is executed with at least one modification operation;
a synchronization module 2012, configured to synchronize the modified source data to the target data area corresponding to the source data according to the validation policy corresponding to the priority.
Optionally, the synchronization module 2012 is specifically configured to copy the modified target data snapshot corresponding to the source data to the target data area when the validation policy is a delayed validation policy; wherein the modified source data corresponds to a plurality of data snapshots; the data snapshot is data for backing up the modified source data according to a preset time interval; the target data snapshot is one of the plurality of data snapshots; and when the effective strategy is an immediate effective strategy, copying the modified source data to the target data area.
Optionally, the synchronization module 2012 is specifically configured to: when the effective strategy is a delayed effective strategy, determining the target data snapshot based on user audit confirmation time and snapshot time of a plurality of data snapshots corresponding to the source data; the snapshot time of the target data snapshot is less than or equal to the user audit confirmation time and is adjacent to the user audit confirmation time; and copying the target data snapshot to the target data area.
Optionally, the synchronization module 2012 is specifically configured to: acquiring a routing rule table corresponding to the source data according to the index number of the target data snapshot; the routing rule table is used for maintaining the corresponding relation between the source data and the target data area as well as the synchronization strategy; and synchronizing the target data snapshot to the target area corresponding to the source data based on the synchronization policy corresponding to the source data.
Optionally, the synchronization module 2012 is specifically configured to: when the validation policy is a delayed validation policy, determining the target data snapshot based on user audit confirmation time and snapshot time of a plurality of data snapshots corresponding to the source data, further comprising: and when the designated operation of the auditor for one of the data snapshots is obtained, determining the designated data snapshot as a target data snapshot.
Optionally, a communication interface 204 is further included, configured to generate a notification message and send the notification message to a target area application corresponding to the target data area, so that the target area application reads the updated source data.
Alternatively, the modules may be stored in the memory 202 shown in fig. 2 in the form of software or Firmware (Firmware) or be fixed in an Operating System (OS) of the server 200, and may be executed by the memory 203 in fig. 2. Meanwhile, data, codes of programs, and the like required to execute the above modules may be stored in the memory 202.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for synchronizing data, the method comprising:
acquiring the priority of source data; the source data is executed with at least one modification operation;
and synchronizing the modified source data to a target data area corresponding to the source data according to the effective strategy corresponding to the priority.
2. The data synchronization method according to claim 1, wherein synchronizing the modified source data to a data center according to an effective policy corresponding to the priority comprises:
when the effective strategy is a delayed effective strategy, copying the target data snapshot corresponding to the modified source data to the target data area;
wherein the modified source data corresponds to a plurality of data snapshots; the data snapshot is data for backing up the modified source data according to a preset time interval; the target data snapshot is one of the plurality of data snapshots;
and when the effective strategy is an immediate effective strategy, copying the modified source data to the target data area.
3. The data synchronization method according to claim 2, wherein when the validation policy is a delayed validation policy, copying the modified target data snapshot corresponding to the source data to the target data area includes:
when the effective strategy is a delayed effective strategy, determining the target data snapshot based on user audit confirmation time and snapshot time of the plurality of data snapshots;
the snapshot time of the target data snapshot is less than or equal to the user audit confirmation time and is adjacent to the user audit confirmation time; the target data snapshot comprises all modified fields in a to-be-audited modified list corresponding to the modified source data, or the target data snapshot comprises partial modified fields in the to-be-audited modified list; the modification list to be checked is generated based on the modification operation; the modification list to be audited is used for maintaining the corresponding relation between the modified field in the source data and the modification timestamp;
and copying the target data snapshot to the target data area.
4. The data synchronization method of claim 3, wherein copying the target data snapshot to the target data region comprises:
acquiring a routing rule table corresponding to the source data according to the index number of the target data snapshot; the routing rule table is used for maintaining the corresponding relation between the source data and the target data area as well as the synchronization strategy;
and synchronizing the target data snapshot to the target data area corresponding to the source data based on the synchronization policy corresponding to the source data.
5. The data synchronization method according to claim 2, further comprising:
when the validation strategy is a delayed validation strategy, after the appointed operation of an auditor for one of the data snapshots is obtained, the appointed data snapshot is determined as a target data snapshot; all data snapshots after the specified snapshot time of the target data snapshot have error data.
6. The data synchronization method of claim 4, further comprising, after synchronizing the target data snapshot to the target data region corresponding to the source data based on the synchronization policy corresponding to the source data:
and generating a notification message and sending the notification message to a target area application program corresponding to the target data area, so that the target area application program reads the updated source data.
7. A data synchronization apparatus, comprising:
the acquisition module is used for acquiring the priority of the source data; the source data is executed with at least one modification operation;
and the synchronization module is used for synchronizing the modified source data to a target data area corresponding to the source data according to the effective strategy corresponding to the priority.
8. The data synchronization apparatus of claim 7, wherein the synchronization module is specifically configured to:
when the effective strategy is a delayed effective strategy, copying the target data snapshot corresponding to the modified source data to the target data area;
wherein the modified source data corresponds to a plurality of data snapshots; the data snapshot is data for backing up the modified source data according to a preset time interval; the target data snapshot is one of the plurality of data snapshots;
and when the effective strategy is an immediate effective strategy, copying the modified source data to the target data area.
9. A server comprising a memory and a memory, the memory storing machine executable instructions executable by the memory to implement the method of any one of claims 1 to 6.
10. A storage medium on which a computer program is stored, the computer program, when executed by a memory, implementing the method of any one of claims 1-6.
CN202110164554.5A 2021-02-05 2021-02-05 Data synchronization method, device, server and storage medium Pending CN112905694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110164554.5A CN112905694A (en) 2021-02-05 2021-02-05 Data synchronization method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110164554.5A CN112905694A (en) 2021-02-05 2021-02-05 Data synchronization method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN112905694A true CN112905694A (en) 2021-06-04

Family

ID=76123196

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110164554.5A Pending CN112905694A (en) 2021-02-05 2021-02-05 Data synchronization method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112905694A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742422A (en) * 2021-08-20 2021-12-03 广州市易工品科技有限公司 Data synchronization accuracy verification method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015096500A1 (en) * 2013-12-24 2015-07-02 华为技术有限公司 Service migration method and device and disaster tolerance system
CN106980625A (en) * 2016-01-18 2017-07-25 阿里巴巴集团控股有限公司 A kind of method of data synchronization, apparatus and system
CN110019140A (en) * 2017-12-29 2019-07-16 华为技术有限公司 Data migration method, device, equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015096500A1 (en) * 2013-12-24 2015-07-02 华为技术有限公司 Service migration method and device and disaster tolerance system
CN106980625A (en) * 2016-01-18 2017-07-25 阿里巴巴集团控股有限公司 A kind of method of data synchronization, apparatus and system
CN110019140A (en) * 2017-12-29 2019-07-16 华为技术有限公司 Data migration method, device, equipment and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742422A (en) * 2021-08-20 2021-12-03 广州市易工品科技有限公司 Data synchronization accuracy verification method and device

Similar Documents

Publication Publication Date Title
CN109683826B (en) Capacity expansion method and device for distributed storage system
CN102770854B (en) Automatic synchronization Conflict solving
US20190227710A1 (en) Incremental data restoration method and apparatus
US20140156598A1 (en) Replication control using eventually consistent meta-data
CN112364049B (en) Data synchronization script generation method, system, terminal and storage medium
CN111414426A (en) Data processing method and system based on block chain
CN110727550B (en) Data replication processing method, data replication processing device, disaster recovery system, disaster recovery equipment and storage medium
EP2542976B1 (en) Method and apparatus of backing-up subversion repository
CN113688035A (en) Database double-living center verification method and system based on sandbox environment
CN112905694A (en) Data synchronization method, device, server and storage medium
CN110555317B (en) Application file change processing method, device and system
KR20200127122A (en) Copy processing method and node, storage system, server, and readable medium
US10911306B2 (en) Information processing apparatus, control method, and storage medium storing program
US10387262B1 (en) Federated restore of single instance databases and availability group database replicas
US11093380B1 (en) Automated testing of backup component upgrades within a data protection environment
US20180101335A1 (en) Data management system, data management apparatus, method, and storage medium storing program
CN113157491A (en) Data backup method and device, communication equipment and storage medium
CN103581262A (en) Master-and-backup data synchronizing method, device and system
CN107291575B (en) Processing method and equipment for data center fault
CN108737184B (en) Management method and device of disaster recovery system
CN109587202B (en) Method, device and system for coprocessing between file verification and data processing
CN106354830B (en) Method and device for data synchronization between database cluster nodes
CN115248746A (en) Data backup method, system and related equipment
US10884874B1 (en) Federated restore of availability group database replicas
CN111274311A (en) Data synchronization method and device for cross-machine-room database

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