Data synchronization method, device, server and storage medium
By determining the effective strategy based on the priority of the source data, adopting immediate or delayed effective strategies, and introducing an audit mechanism, the problem of incorrect synchronization during data synchronization in the existing technology is solved, and the security and reliability of data synchronization are improved.
Patent Information
- Application Number
- CN202110164554.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-02-05
AI Technical Summary
In the existing technology, after the business data is updated, it is immediately broadcast to each data center, and there is no audit mechanism based on the importance of the data. As a result, erroneous data may be synchronized, causing irreparable losses.
The effective strategy is determined based on the priority of the source data, and adopts immediate or delayed effective strategies. The delayed effective strategy introduces an audit mechanism before synchronization to ensure that important data is not synchronized incorrectly.
It reduces the risk of highly important source data being incorrectly synchronized, avoids irreparable losses, and improves the security and reliability of data synchronization.
Smart Images

Figure CN112905694B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data synchronization method, device, server and storage medium. Background Art
[0002] The business operation management background manages a massive amount of business data, which can be provided to multiple data center platforms around the world. In the process of responding to users' needs for diversified business, the update frequency and usage of these business data are very high. Timely synchronization of updated data to each data center is to meet the data needs of each data center.
[0003] Currently, after business data is modified, the industry immediately broadcasts the modified business data to each data center area so that each data center area obtains the modified business data. The defect of this method is that the synchronization rules of all data are the same, and the modified data is immediately synchronized to each data center. There is no corresponding review mechanism based on the importance of each type of data. It is possible that the modified data with errors will be synchronized out, causing irreparable losses. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a data synchronization method, device, server and storage medium, which are used to determine the effectiveness policy corresponding to the source data according to the priority of the source data, thereby reducing the risk of highly important source data being erroneously synchronized.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, the present invention provides a data synchronization method, the method comprising: obtaining the priority of source data; the source data has been modified at least once; and according to an effective policy corresponding to the priority, synchronizing the modified source data to a target data area corresponding to the source data according to the effective policy.
[0007] Optionally, according to the effective policy corresponding to the priority identifier, the modified source data is synchronized to the data center according to the effective policy, including: when the effective policy is a delayed effective policy, the target data snapshot corresponding to the modified source data is copied to the target data area; wherein the modified source data corresponds to multiple data snapshots; the data snapshot is data that backs up the modified source data at a preset time interval; the target data snapshot is one of the multiple data snapshots; when the effective policy is an immediate effective policy, the modified source data is copied to the target data area.
[0008] Optionally, when the effective policy is a delayed effective policy, the modified target data snapshot corresponding to the source data is copied to the target data area, including: when the effective policy is a delayed effective policy, the target data snapshot is determined based on the user review confirmation time and the snapshot time of multiple data snapshots corresponding to the source data; wherein the snapshot time of the target data snapshot is less than or equal to the user review confirmation time and is adjacent to the user review confirmation time.
[0009] Optionally, it also includes: responding to a user review operation, outputting a prompt message; the prompt message includes the snapshot time of the target snapshot; when the effectiveness policy is a delayed effectiveness policy, determining the target data snapshot based on the user review confirmation time and the snapshot times of multiple data snapshots corresponding to the source data, including: responding to a user confirmation operation, determining the target data snapshot based on the user confirmation operation and the snapshot times of multiple data snapshots corresponding to the source data.
[0010] Optionally, copying the target data snapshot to the target data area includes: obtaining a routing rule table corresponding to the source data according to an index number of the target data snapshot; the routing rule table is used to maintain the correspondence between the source data and the target data area and the synchronization policy; based on the synchronization policy corresponding to the source data, synchronizing the target data snapshot to the target area corresponding to the source data.
[0011] Optionally, when the effectiveness strategy is a delayed effectiveness strategy, the target data snapshot is determined based on the user review confirmation time and the snapshot time of multiple data snapshots corresponding to the source data, and also includes: when the auditor's specified operation for one of the data snapshots is obtained, the specified data snapshot is determined as the target data snapshot.
[0012] 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, it also includes: generating a notification message and sending it to a target area application corresponding to the target data area, so that the target area application reads the updated source data.
[0013] In a second aspect, the present invention provides a data synchronization device, comprising: an acquisition module for acquiring the priority of source data; the source data has been subjected to at least one modification operation; and a synchronization module for synchronizing the modified source data to a target data area corresponding to the source data according to an effective policy corresponding to the priority.
[0014] Optionally, the synchronization module is specifically used to: when the effective policy is a delayed effective policy, copy the target data snapshot corresponding to the modified source data to the target data area; wherein the modified source data corresponds to multiple data snapshots; the data snapshot is data that backs up the modified source data at a preset time interval; the target data snapshot is one of the multiple data snapshots; when the effective policy is an immediate effective policy, copy the modified source data to the target data area.
[0015] In a third aspect, the present invention provides a server, comprising a memory and a storage device, wherein the memory stores machine executable instructions that can be executed by the memory, and the memory can execute the machine executable instructions to implement the method described in the first aspect.
[0016] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a memory, implements the method described in the first aspect.
[0017] The embodiment of the present invention proposes a data synchronization method, device, server and storage medium, and the method includes: obtaining the priority of the source data; the source data has been modified at least once; according to the effective policy corresponding to the priority, the modified source data is synchronized to the target data area corresponding to the source data according to the effective policy. The difference from the prior art is that the prior art immediately broadcasts each data center after the source data is updated, and does not synchronize data according to the importance of the source data. Once the data is wrong and synchronized out, it will cause irreparable losses. In order to solve this problem, the present invention determines the effective policy corresponding to the source data according to the priority of the source data after the source data is modified. This effective policy can be immediate or delayed. Delayed effectiveness means that there is an audit mechanism intervention before synchronization, thereby reducing the risk of high-importance source data being synchronized out by mistake.
[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A schematic diagram of an application environment provided in an embodiment of the present invention;
[0021] Figure 2 is a block diagram of a server provided by an embodiment of the present invention;
[0022] Figure 3 A schematic flow chart of a data synchronization method provided by an embodiment of the present invention;
[0023] Figure 4 A schematic flow chart of an implementation method of step S32 provided in an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of a data snapshot generation process;
[0025] Figure 6 A schematic flow chart of an implementation method of step S322 provided in an embodiment of the present invention;
[0026] Figure 7 A schematic diagram of a list of modifications to be reviewed provided for implementation of the present invention;
[0027] Figure 8 A schematic flowchart of an implementation method of step S322-2 provided in an embodiment of the present invention;
[0028] Fig. 9 A schematic diagram of a scenario provided for an embodiment of the present invention;
[0029] Fig.10 Another scenario schematic diagram provided for an embodiment of the present invention;
[0030] Fig.11 A functional module diagram of a data synchronization device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0032] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0033] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0034] The business operation management backend manages a massive amount of business data, which can be provided to multiple data center platforms around the world. In the process of responding to users' needs for diversified business, the update frequency and usage of these business data are very high. Timely synchronization of updated data to each data center is to meet the data needs of each data center. At present, after the business data is modified, the industry will immediately broadcast the modified business data to each data center area so that each data center area can obtain the modified business data. The defect of this method is that the synchronization rules of all data are the same, and the modified data is immediately synchronized to each data center. There is no corresponding review mechanism based on the importance of each type of data. It is possible to synchronize the modified data with errors, causing irreparable losses.
[0035] In order to solve the above problems, the present invention proposes a data synchronization method, which can be applied to Figure 1 In the application environment shown, see Figure 1 , Figure 1 A schematic diagram of an application environment provided in an embodiment of the present invention, including: a source data center server 10 and a target data center server 11, wherein source data is maintained in the source data center server 10, and the source data can be provided to multiple target data center servers 11 for use. When the source data maintained in the source data center server 10 is updated, the updated source data will be synchronized to the target data center server 11.
[0036] In an embodiment of the present invention, after the source data is modified, the source data center server 10 can synchronously update the modified source data to the target data center server 11 according to the effectiveness policy corresponding to each source data, so as to avoid data errors and irreparable losses.
[0037] In order to realize the above data synchronization function, a method for realizing the source data center server 10 is given below. Figure 2 , Figure 2 2 is a block diagram of a server provided by 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 achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0038] The memory 202 is used to store 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 programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0039] The memory 203 is used to read / write the data or programs stored in the memory 202 and execute corresponding functions.
[0040] The communication interface 204 is used to establish a communication connection between the server and other servers through the network, and to send and receive data through the network.
[0041] It should be understood that Figure 2 The structure shown is only a schematic diagram of the server structure, and the server may also include Figure 2 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0042] based on Figure 1 The application environment and Figure 2 The server architecture shown in FIG. 1 is a data synchronization method provided by an embodiment of the present invention. Figure 3 , Figure 3 A schematic flow chart of a data synchronization method provided by an embodiment of the present invention, the method may include:
[0043] S31. Obtain the priority of source data.
[0044] In some possible embodiments, the source data may be data that supports simultaneous editing and previewing by operators in multiple regions around the world. The source data may have been modified at least once. It is understood that the source data may be provided to other data centers around the world for use.
[0045] In some possible embodiments, a massive amount of source data is stored in the source data center, and these source data have different importance levels. Therefore, all source data can be prioritized according to the importance of each source data, and each source data can be prioritized by a priority level identifier, for example, the level identifier can be in the form of level 1, level 2, etc., or level A, level B, etc. The user can configure the priority of each source data according to actual needs.
[0046] S32. According to the effective policy corresponding to the priority, synchronize the modified source data to the target data area corresponding to the source data according to the effective policy.
[0047] In some scenarios, in order to prevent the synchronization of modified and highly important data with errors, which may cause irreparable losses, different effective policies can be formulated for different priorities. The effective policy refers to whether the modification of the source data takes effect immediately and is synchronized, for example, the effective policy immediately after modification or the effective policy with a delay after modification. For example, level 1 corresponds to the immediate effective policy, and level 2 corresponds to the delayed effective policy. Thus, the modified source data can be synchronized according to the effective policy that matches it to avoid errors.
[0048] In some possible instances, the above-mentioned target data area refers to the area where the source data is used. For example, the data center where the source data is located is in Singapore, and the target data area may be the United States, Brazil, Indonesia and other regions. It can be understood that all source data can be maintained in the data center server in Singapore, and the storage area in the server is divided according to different regions, and each area stores source data.
[0049] A data synchronization method provided by an embodiment of the present invention is different from the prior art in that the prior art immediately broadcasts the source data to each data center after the source data is updated, and does not synchronize the data according to the importance of the source data. Once the data is wrong and is synchronized out, it will cause irreparable losses. In order to solve this problem, the present invention determines the effective policy corresponding to the source data according to the priority of the source data after the source data is modified. This effective policy can be immediate or delayed. Delayed effectiveness means that there is an audit mechanism intervention before synchronization, thereby reducing the risk of high-importance source data being synchronized out incorrectly.
[0050] Optionally, in some scenarios, for source data with low importance, it can be synchronized to the target data area corresponding to the source data immediately after modification. For source data with high importance, it can be synchronized to the target data area after modification. The following are the synchronization methods under these two effective strategies. Figure 4 , Figure 4 A schematic flowchart of an implementation of step S32 provided in an embodiment of the present invention, step S32 may include:
[0051] S321: When the effective policy is an immediate effective policy, the modified source data is copied to the target data area.
[0052] In some possible embodiments, the modified source data may be copied to a target data area through a whole-table copy scheduler, where the target data area stores the source data.
[0053] S322: When the effective policy is a delayed effective policy, the target data snapshot corresponding to the modified source data is copied to the target data area.
[0054] In some possible embodiments, the modified source data corresponds to multiple data snapshots, which are data that backs up the modified source data at preset time intervals; wherein the preset time interval can be 2 minutes, 5 minutes, etc., and the user can configure it according to actual needs, and the target data snapshot is one of the multiple data snapshots.
[0055] For example, see Figure 5 , Figure 5 This is a schematic diagram of a data snapshot generation process. It can be seen that the preset time interval of the data snapshot is 5 minutes, that is, the source data at this moment is backed up every 5 minutes. In order to reduce storage, usually at most 100 snapshots are saved.
[0056] It should be noted that the source data being backed up has been modified at this time, so the target data snapshot can be copied to the target data area. Figure 5 It can be seen that each data snapshot corresponds to a snapshot time, and the modification status of the source data at that time can be obtained based on the snapshot time.
[0057] Optionally, based on the above content, for source data that adopts a delayed effectiveness strategy, in order to prevent errors, the following will introduce an audit mechanism to achieve the purpose of synchronizing the target data snapshot to the target data area, see Figure 6 , Figure 6 A schematic flowchart of an implementation of step S322 provided in an embodiment of the present invention, step S32 may include:
[0058] S322-1. When the effective policy is a delayed effective policy, determine the target data snapshot based on the user review confirmation time and the snapshot time of multiple data snapshots.
[0059] S322-2. Copy the target data snapshot to the target data area.
[0060] In an embodiment of the present invention, the above-mentioned user review confirmation time refers to the time when the reviewer starts to review the above-mentioned modification list to be reviewed and confirms that the modification is correct. For example, when the reviewer operates the confirmation button on the display interface, the timestamp of the review confirmation can be obtained.
[0061] It is understandable that the snapshot time of the above-mentioned target data snapshot will be a data snapshot corresponding to a snapshot time that is less than or equal to the user review confirmation time and is adjacent to the user review confirmation time.
[0062] It can also be understood that the target data snapshot contains all the modified fields in the pending modification list corresponding to the modified source data, or contains some of the modified fields in the pending modification list; wherein, the pending modification list is generated based on the modification operation and can be used to maintain the correspondence between the modified fields in the source data and the modification timestamp.
[0063] In one possible scenario, the target data snapshot contains some modified fields in the pending modification list corresponding to the modified source data, that is, the snapshot time of the above-mentioned target data snapshot may be less than the maximum modification time in the pending modification list corresponding to the source data; it is understandable that the pending modification list is generated based on the modification operation; the pending modification list is used to maintain the correspondence between the modified fields in the source data and the modification timestamp. Each time the operator modifies the source data, a list record will be added to the pending list. It should be noted that modifications to the data cannot be revoked. For example, if the data is modified at 18:16:00, the modification is irreversible, and can only be modified once more on this basis, and then a modification record will be added to the pending modification list.
[0064] For example, see Figure 7 , Figure 7 A schematic diagram of a list of pending revisions provided for the implementation of the present invention, from Figure 7 It can be seen that data table 1 can be modified by multiple different operators. Each operation generates a record of the modified field and the operation time, thereby generating a list of pending modifications. The list of pending modifications can be reviewed by the auditors. Once any of them passes, the data can be synchronized according to the target data snapshot.
[0065] Combination Figure 5 and Figure 7, assuming that the reviewer's review confirmation time is 18:19:00, the system can determine that the snapshot time that is less than 18:19 and adjacent to 18:19 is 18:15:00. At this time, the data table of the target data area can be overwritten according to the data snapshot corresponding to 18:15:00, but the list of pending changes contains records that exceed the snapshot time of 18:15:00 (as shown above Figure 5 The snapshots at 18:16:00 and 18:18:00 (hereinafter referred to as the super-standard snapshots) operated by students in Table 004 will not be copied to the target data area. However, the system will output a prompt message to remind the auditor of the current snapshot time. The user can determine whether to use the data snapshot at the current snapshot time or wait for the next data snapshot to be generated according to actual needs.
[0066] In the second possible scenario, the target data snapshot contains all the modified fields in the pending 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 pending modification list. For example, continuing the above example, if the auditor needs to Figure 5 All modification records of the table are copied to the target data area, and the auditor can wait until the next snapshot is generated, which is expected to be 18:20:00. The auditor can review it at 18:21:01. The snapshot time 18:21:01 can be greater than or equal to the maximum modification time in the list to be reviewed. At this time, the data snapshot corresponding to the snapshot time 18:20:00 can include all modifications on the table and can be used as the target data snapshot.
[0067] Optionally, after obtaining the target data snapshot, the target data snapshot can be copied to the target data area. A possible implementation method is given below. Figure 8 , Figure 8 A schematic flowchart of an implementation of step S322-2 provided in an embodiment of the present invention, step S322-2 may include:
[0068] S322-2-1. Obtain 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 to maintain the corresponding relationship between the source data and the target data area and the synchronization strategy.
[0069] S322-2-2. Based on the synchronization policy corresponding to the source data, synchronize the target data snapshot to the target area corresponding to the source data.
[0070] In some possible embodiments, if the auditor confirms the audit, the scheduler will determine the routing rule table corresponding to the source data table according to the index number of the target data snapshot (such as 20201209-18:15:00), and then synchronize the target data snapshot to the target data area according to the synchronization policy in the routing rule table. If the audit fails, the data in the data table will be marked, and a message will be sent to the management page for modifying the data. Only when the data table is modified again will it be allowed to be reviewed by the auditor again.
[0071] Optionally, in some possible embodiments, after the source data of the target data area is updated, the target area application corresponding to the target data area can also be notified that the data update is complete to facilitate the target area application policy control and reading of the updated source data. A possible implementation method is given below, which is to generate a notification message and send it to the target area application corresponding to the target data area so that the target area application reads the updated source data.
[0072] For easier understanding of the above embodiments, see Fig. 9 , Fig. 9 A scenario diagram is given for an embodiment of the present invention. Assuming that the source data is data table 1, the index number of the obtained target data snapshot is 20201209181500. At this time, the target data region corresponding to the source data table 1 can be determined according to the index number as the United States region (US), Brazil region (BR) and Indonesia region (IN). The corresponding synchronization strategy is full table coverage. The entire target data snapshot can be overwritten or appended to data table 1 of the data centers corresponding to the United States region (US), Brazil region (BR) and Indonesia region (IN). After the data is copied, an asynchronous message notification can also be sent to the regional application, which includes the United States regional program, the Brazil regional program and the Indonesian regional program, to facilitate reading the updated source data in each region.
[0073] Optionally, during the audit process, if the auditor determines that an error has occurred in the modification of a data item in the audit list, that is, the audit fails, a data snapshot can be specified as the target data snapshot, and then the specified target data snapshot can be synchronized to the target data area. It can be understood that all data snapshots after the snapshot time of the specified target data snapshot contain erroneous data.
[0074] In order to facilitate understanding of the entire implementation process of the above embodiment, a scenario diagram is given below. Fig.10 , Fig.10 Another scenario schematic diagram provided for an embodiment of the present invention.
[0075] like Fig.10As shown, assuming that the source data is located in the computer room of the Singapore data center, the source data includes data table 1, data table 2, data table 3, data table 4 and data table 5, among which, the importance of data table 1 to data table 4 is greater than the importance of data table 5 and data table 6, data table 1 to data table 3 correspond to delayed effective strategy, and data tables 4 and 5 correspond to immediate effective strategy.
[0076] Assume that global operator A has made 6 changes to data table 1. After each change, he can preview or edit the data in the management background immediately. Each change to the data will automatically add a list record to the list to be reviewed. The reviewer will review it based on these list records. If the review is passed, the determined target data snapshot will be submitted to the replication scheduler, and the scheduler will copy the target data snapshot to the corresponding data table 1 in other data centers around the world. If the review fails, a message will be sent to the management page for modifying the data. Only when this data table is modified again will it be allowed to be reviewed by the senior administrator again.
[0077] If global operator B modifies data table 4 or data table 5, the replication scheduler will directly copy the modified data table 4 or data table 5 to the corresponding data table 4 or data table 5 of other data centers around the world.
[0078] In order to execute the corresponding steps in the above embodiments and various possible methods, a data synchronization device implementation method is given below. Optionally, the data synchronization device 201 can adopt the above Figure 2 The device structure of the data synchronization device 201 is shown in FIG. Fig.11 , Fig.11 This is a functional module diagram of a data synchronization device provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the data synchronization device 201 provided in this embodiment are the same as those of the above embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiments. The data synchronization device 201 includes:
[0079] The acquisition module 2011 is used to acquire the priority of the source data; the source data has been modified at least once;
[0080] The synchronization module 2012 is used to synchronize the modified source data to the target data area corresponding to the source data according to the effective policy corresponding to the priority.
[0081] Optionally, the synchronization module 2012 is specifically used to copy the target data snapshot corresponding to the modified source data to the target data area when the effective policy is a delayed effective policy; wherein the modified source data corresponds to multiple data snapshots; the data snapshot is data that backs up the modified source data at a preset time interval; the target data snapshot is one of the multiple data snapshots; when the effective policy is an immediate effective policy, the modified source data is copied to the target data area.
[0082] Optionally, the synchronization module 2012 is specifically used to: when the effectiveness policy is a delayed effectiveness policy, determine the target data snapshot based on the user review confirmation time and the snapshot time of multiple data snapshots corresponding to the source data; wherein the snapshot time of the target data snapshot is less than or equal to the user review confirmation time and is adjacent to the user review confirmation time; and copy the target data snapshot to the target data area.
[0083] Optionally, the synchronization module 2012 is specifically used to: obtain the routing rule table corresponding to the source data according to the index number of the target data snapshot; the routing rule table is used to maintain the correspondence between the source data and the target data area and the synchronization policy; based on the synchronization policy corresponding to the source data, synchronize the target data snapshot to the target area corresponding to the source data.
[0084] Optionally, the synchronization module 2012 is specifically used to: when the effectiveness policy is a delayed effectiveness policy, determine the target data snapshot based on the user review confirmation time and the snapshot time of multiple data snapshots corresponding to the source data, and also includes: when obtaining the auditor's specified operation on one of the data snapshots, determine the specified data snapshot as the target data snapshot.
[0085] Optionally, a communication interface 204 is further included, which is used to generate a notification message and send it to a target area application corresponding to the target data area, so that the target area application reads the updated source data.
[0086] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory 202 shown in the figure may be fixed in the operating system (OS) of the server 200 and may be Figure 2 Meanwhile, the data, program codes, etc. required to execute the above modules may be stored in the memory 202.
[0087] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0088] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0089] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data synchronization method, It is characterized in that The method comprises: Obtaining the priority of source data; the source data has been modified at least once; According to the effectiveness policy corresponding to the priority, the modified source data is synchronized to the target data area corresponding to the source data according to the effectiveness policy; the effectiveness policy refers to whether the modification of the source data takes effect immediately and is synchronized; According to the effective policy corresponding to the priority, synchronizing the modified source data to the target data area according to the effective policy, including: when the effective policy is a delayed effective policy, copying the target data snapshot corresponding to the modified source data to the target data area, specifically: When the snapshot time of the target data snapshot is less than the maximum modification time in the pending modification list corresponding to the source data, the data table of the target data area is overwritten according to the target data snapshot, and the records in the pending modification list that are greater than the snapshot time of the target data snapshot will not be copied to the target data area; when the snapshot time of the target data snapshot is greater than or equal to the maximum modification time, when the user review confirmation time is greater than the maximum modification time, all modification records of the pending modification list are copied to the target data area; wherein the snapshot time of the target data snapshot is less than or equal to the user review confirmation time and is adjacent to the user review confirmation time; the pending modification list is used to maintain the correspondence between the modified fields in the source data and the modification timestamp.
2. The data synchronization method according to claim 1, It is characterized in that in, The modified source data corresponds to a plurality of data snapshots; the data snapshots are data that backs up the modified source data at preset time intervals; The target data snapshot is one of the multiple data snapshots; According to the effective policy corresponding to the priority, synchronizing the modified source data to the target data area according to the effective policy, and also includes: when the effective policy is an immediate effective policy, copying the modified source data to the target data area.
3. The data synchronization method according to claim 2, It is characterized in that When the effective strategy is a delayed effective strategy, copying the modified target data snapshot corresponding to the source data to the target data area includes: When the effectiveness policy is a delayed effectiveness policy, the target data snapshot is determined based on the user review confirmation time and the snapshot time of the multiple data snapshots; the target data snapshot includes all the modified fields in the modification list to be reviewed corresponding to the modified source data, or the target data snapshot includes some of the modified fields in the modification list to be reviewed; the modification list to be reviewed is generated based on the modification operation; and the target data snapshot is copied to the target data area.
4. The data synchronization method according to claim 3, It is characterized in that Copying the target data snapshot to the target data area includes: According to the index number of the target data snapshot, a routing rule table corresponding to the source data is obtained; the routing rule table is used to maintain the corresponding relationship between the source data and the target data area and the synchronization strategy; Based on the synchronization policy corresponding to the source data, the target data snapshot is synchronized to the target data area corresponding to the source data.
5. The data synchronization method according to claim 2, It is characterized in that Also includes: When the effectiveness strategy is a delayed effectiveness strategy, after obtaining the auditor's designated operation on one of the data snapshots, the designated data snapshot is determined as the target data snapshot; all data snapshots after the snapshot time of the designated target data snapshot contain erroneous data.
6. The data synchronization method according to claim 4, It is characterized in that After 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, the method further includes: A notification message is generated and sent to a target area application corresponding to the target data area, so that the target area application reads the updated source data.
7. A data synchronization device, It is characterized in that include: An acquisition module is used to obtain the priority of source data; The source data has been modified at least once; A synchronization module, configured to synchronize the modified source data to a target data area corresponding to the source data according to the effectiveness policy corresponding to the priority; the effectiveness policy refers to whether the modification of the source data takes effect immediately and is synchronized; A synchronization module, specifically used for: when the effectiveness policy is a delayed effectiveness policy, copying the modified target data snapshot corresponding to the source data to the target data area, specifically: when the snapshot time of the target data snapshot is less than the maximum modification time in the pending modification list corresponding to the source data, overwriting the data table of the target data area according to the target data snapshot, and the records in the pending modification list that are greater than the snapshot time of the target data snapshot will not be copied to the target data area; when the snapshot time of the target data snapshot is greater than or equal to the maximum modification time, when the user review confirmation time is greater than the maximum modification time, copying all modification records of the pending modification list to the target data area; wherein the snapshot time of the target data snapshot is less than or equal to the user review confirmation time and is adjacent to the user review confirmation time; the pending modification list is used to maintain the correspondence between the modified fields in the source data and the modification timestamp.
8. The data synchronization device according to claim 7 , It is characterized in that in, The modified source data corresponds to a plurality of data snapshots; the data snapshot is data that backs up the modified source data at a preset time interval; the target data snapshot is one of the plurality of data snapshots; The synchronization module is further specifically used for: when the effective policy is an immediate effective policy, copying the modified source data to the target data area.
9. A server, It is characterized in that The invention comprises a memory and a storage device, wherein the memory stores machine executable instructions that can be executed by the memory, and the memory can execute the machine executable instructions to implement the method according to any one of claims 1 to 6.
10. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a memory, the method according to any one of claims 1 to 6 is implemented.
