Data synchronization system and method
By introducing the synchronization task management module and the data synchronization module into the data synchronization system, cross-regional data synchronization is achieved, the problems of data security and integrity in cross-regional data synchronization are solved, and the reliability and resource utilization of data synchronization are improved.
Patent Information
- Application Number
- CN202211087419.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-09-07
AI Technical Summary
In the process of cross-region data synchronization, how to effectively ensure the security and integrity of data, especially in a multi-tenant environment, there are challenges in the management and execution of data synchronization tasks, leading to problems of data loss and synchronization interruption.
A data synchronization system is designed, including a synchronization task management module and a data synchronization module. By receiving and distributing data synchronization tasks, a communication connection between the source and the target is established, and the data to be synchronized is written into the relay cache to achieve cross-regional data synchronization. , and ensure the progress of data synchronization and resource utilization through global transaction number and resource pool management.
It improves data security and integrity, achieves continuity and reliability of cross-region data synchronization, prevents data loss, and optimizes resource utilization and synchronization efficiency through dynamic resource allocation and on-demand expansion.
Smart Images

Figure CN115484274B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data synchronization system and method. Background Art
[0002] With the rapid development of Internet user services, its data center network and system are becoming increasingly large. User data and system data are the most core and important assets. Therefore, data synchronization can effectively ensure data security.
[0003] However, due to business needs, tenants may need to synchronize data across different regions. Therefore, it is necessary to provide a data synchronization solution that can achieve cross-region data synchronization and thus ensure the security and integrity of synchronized data. Summary of the invention
[0004] The present invention provides a data synchronization system and method, which can realize data synchronization and improve the security and integrity of data.
[0005] In a first aspect, an embodiment of the present invention provides a data synchronization system, comprising: at least one synchronization task management module and a data synchronization module;
[0006] The current synchronization task management module in the at least one synchronization task management module is used to receive the data synchronization task submitted by the tenant on the data providing side; when the current synchronization task management module is the synchronization task management module of the local area, the target data synchronization instance corresponding to the tenant is determined, and the data synchronization task is issued based on the target data synchronization instance; wherein the data synchronization task includes: the source end address on the data providing side and the target end address on the data synchronization side;
[0007] The data synchronization module is used to establish a communication connection between the source end address and the target end address after receiving the data synchronization task issued by the current synchronization task management module; obtain the data to be synchronized from the source database of the data provider side, and write the data to be synchronized into the relay cache and send it to the target end address, so that the data synchronization side can execute the data synchronization task.
[0008] In a possible implementation, the current synchronization task management module is further used to distribute the data synchronization task to other areas when the current synchronization task management module is not the synchronization task management module of the local area, so that the synchronization task can be completed by the target area corresponding to the data synchronization task.
[0009] In one possible implementation, the current synchronization task management module is used to check whether there is an idle instance in the idle instance list of the tenant's data synchronization instance resource pool according to the data synchronization task; if there is an idle instance in the data synchronization instance resource pool, check whether the specification of the idle instance meets the preset requirements; if the specification of the idle instance meets the preset requirements, determine the idle instance as the target data synchronization instance; if there is no idle instance in the data synchronization instance resource pool, or the specification of the idle instance in the data synchronization instance resource pool does not meet the preset requirements, create a new instance according to the specifications required by the data synchronization task, and determine the new instance as the target data synchronization instance; wherein the specifications include at least one of bandwidth and storage space.
[0010] In one possible implementation, the current synchronization task management module is further used to monitor the running progress of the data synchronization task and store the global transaction number; and, after the data synchronization task is restarted, query the global transaction number last saved before the data synchronization task is terminated to restore the synchronization progress before the data synchronization task is terminated; wherein, the global transaction number is used to record the execution progress of the task.
[0011] In a possible implementation, the data synchronization module is further used to pre-check the configurations of the data providing side and the data synchronization side after receiving the data synchronization task issued by the current synchronization task management module, and execute the synchronization task after the check passes;
[0012] The configured items include at least one of the following:
[0013] Whether the database instances on the data providing side and the data synchronization side are connected, the instance permissions on the data providing side and the data synchronization side, and whether the global transaction numbers on the data providing side and the data synchronization side are enabled; wherein the global transaction number is used to record the execution progress of the task.
[0014] In a second aspect, an embodiment of the present invention provides a data synchronization method, including:
[0015] Using a current synchronization task management module in at least one synchronization task management module to receive a data synchronization task submitted by a tenant on a data providing side;
[0016] When the current synchronization task management module is the synchronization task management module of the local area, the target data synchronization instance corresponding to the tenant is determined by using the current synchronization task management module;
[0017] The data synchronization task is issued based on the target data synchronization instance by using the current synchronization task management module; wherein the data synchronization task includes: a source end address of a data providing side and a target end address of a data synchronization side;
[0018] After receiving the data synchronization task issued by the current synchronization task management module, the data synchronization module establishes a communication connection between the source end address and the target end address;
[0019] Using the data synchronization module to obtain the data to be synchronized from the source database on the data provider side;
[0020] The data synchronization module is used to write the data to be synchronized into the relay cache and then send it to the target end address, so that the data synchronization side executes the data synchronization task.
[0021] In a possible implementation, the method further includes:
[0022] When the current synchronization task management module is not the synchronization task management module of the local area, the data synchronization task is distributed to other areas by using the current synchronization task management module, so that the synchronization task is completed by the target area corresponding to the data synchronization task.
[0023] In a possible implementation, the using the current synchronization task management module to determine the target data synchronization instance corresponding to the tenant includes:
[0024] Using the current synchronization task management module to check whether there is an idle instance in the idle instance list of the data synchronization instance resource pool of the tenant according to the data synchronization task;
[0025] If there is an idle instance in the data synchronization instance resource pool, the current synchronization task management module is used to check whether the specification of the idle instance meets the preset requirements;
[0026] If the specification of the idle instance meets the preset requirements, the idle instance is determined as the target data synchronization instance by using the current synchronization task management module;
[0027] If there is no idle instance in the data synchronization instance resource pool, or the specifications of the idle instances in the data synchronization instance resource pool do not meet the preset requirements, the current synchronization task management module is used to create a new instance according to the specifications required by the data synchronization task, and the new instance is determined as the target data synchronization instance; wherein the specifications include at least one of bandwidth and storage space.
[0028] In a possible implementation, the method further includes:
[0029] Using the current synchronization task management module to monitor the running progress of the data synchronization task and store the global transaction number;
[0030] After the data synchronization task is restarted, the current synchronization task management module is used to query the global transaction number last saved before the data synchronization task is terminated to restore the synchronization progress before the data synchronization task is terminated; wherein, the global transaction number is used to record the execution progress of the task.
[0031] In a possible implementation, after receiving the data synchronization task issued by the current synchronization task management module using the data synchronization module, the method further includes:
[0032] The data synchronization module is used to pre-check the configurations of the data providing side and the data synchronization side, and the synchronization task is executed after the check passes;
[0033] The configured items include at least one of the following:
[0034] Whether the database instances on the data providing side and the data synchronization side are connected, the instance permissions on the data providing side and the data synchronization side, and whether the global transaction numbers on the data providing side and the data synchronization side are enabled; wherein the global transaction number is used to record the execution progress of the task.
[0035] It can be seen from the above technical solution that the data synchronization system may include a synchronization task management module and a data synchronization module. The current synchronization task management module can realize operations such as receiving data synchronization tasks, determining implementation examples, and issuing data synchronization tasks. After the synchronization task management module issues the data synchronization task, the data synchronization module can establish a connection between the source address and the target short address according to the data synchronization task. Further, the data is written to the relay cache and sent to achieve data synchronization. It can be seen that this solution can not only realize the synchronization operation of the data to be synchronized, but also improve the integrity and security of the data by establishing a communication connection between the source address and the target address, and writing the data to be synchronized into the relay cache and then sending it. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 is a structural diagram of a data synchronization system provided by an embodiment of the present invention;
[0038] Figure 2 The present invention is a flowchart of a data synchronization method based on a data synchronization system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] At present, with the rapid development of Internet user services, its data center network and system are becoming increasingly large. With the increasing number of business types and business traffic, in order to ensure the safe, stable and controllable operation of various user systems, for all walks of life, user data and system data are the most core and important wealth of enterprises. However, due to various reasons (natural disasters, man-made disasters), data may be irreversibly damaged. Only a perfect disaster recovery plan can ultimately guarantee data security and business continuity. In the disaster recovery level, data-level disaster recovery is to copy the data of the production center to the disaster recovery center, and take over the storage system or restore the data when the production center fails. The data in the disaster recovery center can be a complete copy of the local production data (usually implemented in the same city), or it can be slightly behind the production data, but it must be available (usually implemented in a different location).
[0040] For these scenarios where there is a strong demand for business continuity services and data reliability or regulatory requirements, cloud relational databases (such as MySQL) provide cross-regional disaster recovery instances to help users improve business continuity service capabilities at a lower cost while improving data reliability. Generally, the source database instance and target database instance that need to be synchronized are cloud database instances purchased by the user. Database instances created in other ways are also supported. Such databases generally only accept database access requests, and you cannot choose to install related data acquisition client software on the server where the database is located. At the same time, in order to minimize the performance impact on the source database instance and the target database instance, it is generally chosen to separately create and purchase a data synchronization instance for database synchronization, which is used to run the corresponding data synchronization middleware product. This middleware product generally uses asynchronous replication to synchronize database incremental data in real time, and is responsible for data extraction on the source database instance side and data playback on the target database instance side.
[0041] However, when there are many database instances that need to be synchronized across regions in the same region and they are scattered among different tenants, it is necessary to centrally manage the synchronization tasks between database instances and ensure the continuity of the running synchronization tasks as well as the monitoring and control of the running status. In addition, how to reliably and effectively manage data synchronization tasks and ensure the data integrity and security of data synchronization tasks is also an urgent problem to be solved.
[0042] Based on this, this solution considers receiving and sending data synchronization tasks through the synchronization task management module, and the data synchronization module establishes a communication connection between the source address and the target address. Then, the data to be synchronized is written into the relay cache and then sent, which can not only realize the synchronization operation of the data to be synchronized, but also improve the integrity and security of the data.
[0043] like Figure 1 As shown, an embodiment of the present invention provides a data synchronization system, which may include: at least one synchronization task management module 101 and a data synchronization module 102;
[0044] The current synchronization task management module 101 in at least one synchronization task management module 101 is used to receive data synchronization tasks submitted by tenants on the data providing side; when the current synchronization task management module 101 is the synchronization task management module 101 of the local area, the target data synchronization instance corresponding to the tenant is determined, and the data synchronization task is issued based on the target data synchronization instance; wherein the data synchronization task includes: the source end address of the data providing side and the target end address of the data synchronization side;
[0045] The data synchronization module 102 is used to establish a communication connection between the source end address and the target end address after receiving the data synchronization task issued by the current synchronization task management module 101; obtain the data to be synchronized from the source database on the data providing side, and write the data to be synchronized into the relay cache and send it to the target end address so that the data synchronization side can execute the data synchronization task.
[0046] In an embodiment of the present invention, a data synchronization system may include a synchronization task management module 101 and a data synchronization module 102. The current synchronization task management module 101 may be used to implement operations such as receiving data synchronization tasks, determining implementation examples, and issuing data synchronization tasks. After the synchronization task management module 101 issues a data synchronization task, the data synchronization module 102 may establish a connection between a source address and a target short address according to the data synchronization task. Further, data synchronization is achieved by writing the data into a relay cache and sending it. It can be seen that this solution not only achieves synchronization operations on the data to be synchronized, but also improves the integrity and security of the data by establishing a communication connection between the source address and the target address, and writing the data to be synchronized into the relay cache and then sending it.
[0047] The synchronization task management module 101 runs in a multi-copy cluster mode on the management side of the cloud platform (such as the K8S virtualization environment) to provide high availability support, and uses load balancing to provide a unified access address, manage the data synchronization instance list, and view and operate synchronization tasks. It uses the multi-copy deployment capability provided by the virtualization platform (Kubernetes) to deploy a high-availability service cluster. A high-availability distributed configuration center (such as consul) is deployed within the cluster to uniformly store synchronization instance information, synchronization task descriptions, synchronization task progress, and operating status. The reliability of stored data is guaranteed by multi-copy redundancy, and the load balancing mechanism of the virtualization platform provides a unified access address for the service cluster;
[0048] In a possible implementation, the current synchronization task management module 101 can also distribute the data synchronization task to other regions when the current synchronization task management module 101 is not the synchronization task management module 101 of the region, so that the synchronization task can be completed by the target region corresponding to the data synchronization task. It can be seen that after the data synchronization task is submitted to the server, it can be centrally stored in the distributed configuration center and distributed to the management service clusters in different regions. In this way, it can help users centrally store and manage synchronization tasks and accurately distribute tasks.
[0049] For example, the synchronization task management module 101 in different regions performs real-time synchronization of synchronization task description information and synchronization task status information to ensure the integrity of information in the global system, prevent the loss of synchronization tasks, and prevent the problem of being unable to quickly and effectively recover after the synchronization task is interrupted. The distributed Gossip protocol of the P2P network is used to complete data sharing in each region. It is ensured that the synchronization task information obtained when the monitoring page in the entire logical system is connected to any regional service cluster is complete.
[0050] The data synchronization tasks submitted by different tenants carry the unique identifier of the current tenant. When the synchronization tasks are submitted to the server, they are centrally stored in the distributed configuration center and distributed to the management service clusters in different regions. The front-end monitoring page of the data synchronization module 102 is provided in a browser mode of B / S architecture. When the user accesses the global domain name, it will be routed to the nearest local management service cluster according to the global domain name resolution. When the data synchronization task is submitted to the synchronization task management module 101 of the non-local area, the task management module will not assign the task to the synchronization instance of this area, but only distribute the synchronization task to other areas, and the task will be routed to the correct area for execution.
[0051] In a possible implementation, the current synchronization task management module 101 can also check whether there are idle instances in the idle instance list of the tenant's data synchronization instance resource pool according to the data synchronization task; if there are idle instances in the data synchronization instance resource pool, check whether the specifications of the idle instance meet the preset requirements; if the specifications of the idle instance meet the preset requirements, determine the idle instance as the target data synchronization instance; if there are no idle instances in the data synchronization instance resource pool, or the specifications of the idle instances in the data synchronization instance resource pool do not meet the preset requirements, create a new instance according to the specifications required by the data synchronization task, and determine the new instance as the target data synchronization instance; wherein the specifications include at least one of bandwidth and storage space.
[0052] It can be seen that this embodiment realizes the dynamic allocation and scheduling of data synchronization instances by querying and creating idle embodiments, which can effectively reuse resources and realize on-demand resource allocation and recycling, thereby improving resource utilization. Moreover, the synchronization task management module 101 can also customize and dynamically expand the bandwidth and storage space of the data synchronization instance on demand, which can meet the needs of different users in different scenarios, ensuring synchronization efficiency and effectively preventing data loss caused by insufficient storage space.
[0053] In addition, when performing task scheduling, the synchronization task management module 101 can select the data synchronization instance belonging to the tenant according to the tenant unique identifier carried in the data synchronization task, thereby ensuring task isolation between tenants. The synchronization task management module 101 can filter the synchronization tasks belonging to the database instance in this region according to the source address and target address of the data synchronization task submitted by the user, and further select the source or target synchronization instance according to the specification requirements of the data synchronization task, the filtering information of the synchronization data, etc., using its task scheduling strategy. The source end can be the data providing side, and the target end can be the data synchronization side.
[0054] In a possible implementation, the current synchronization task management module 101 can also monitor the running progress of the data synchronization task and store the global transaction number; then after the data synchronization task is restarted, the global transaction number last saved before the data synchronization task is terminated is queried to restore the synchronization progress before the data synchronization task is terminated; wherein the global transaction number is used to record the execution progress of the task. It can be seen that the synchronization task management module 101 can realize the rapid recovery of abnormal tasks, thereby preventing data loss.
[0055] For example, the synchronization task management module 101 can monitor the progress of the data synchronization task. Only when the target-side synchronization data is successfully submitted, the data synchronization instance on the target side records the progress of the synchronization task (database global transaction number) and updates it to the distributed configuration center in real time. If the synchronization task is abnormal or terminated manually, after restarting, the data synchronization instance on the target side queries the distributed configuration center for the last saved database global transaction number before the task is terminated, and can quickly restore the synchronization task and resume data transmission from breakpoints, effectively ensuring that data will not be lost; moreover, when monitoring the running status of the synchronization task, the synchronization task management module 101 collects the runtime resource usage of the data synchronization instance (CPU, memory, storage space, network traffic, etc.), and provides a query interface for front-end display and user query.
[0056] In addition, the Gossip protocol for synchronizing data uses the Rumor-Mongering mode and the Pull communication mode to complete the rapid convergence of data between zones. If the probability that a node is infected in the i-th cycle is p i , the probability of being infected in the i+1th period is p i+1 , then the convergence probability of the Pull communication mode is p i+1 =p i 2 .
[0057] The data synchronization module 102 is used to create and scale data synchronization instance clusters, execute synchronization tasks, report synchronization task status, and perform other operations.
[0058] In a possible implementation, the data synchronization module 102 can also pre-check the configuration of the data providing side and the data synchronization side after receiving the data synchronization task issued by the current synchronization task management module 101, and execute the synchronization task after the check is passed; wherein the configuration items include one or more of whether the database instances of the data providing side and the data synchronization side are connected, the instance permissions of the data providing side and the data synchronization side, and whether the global transaction number of the data providing side and the data synchronization side is enabled; wherein the global transaction number is used to record the execution progress of the task. It can be seen that the data synchronization module 102 in this embodiment can effectively prevent the loss of data synchronization caused by log cleaning on the source database side through the data relay function of the data synchronization instance, and then described in the synchronization task management module 101.
[0059] For example, when the data synchronization module 102 performs the data synchronization operation, it can be implemented through the following process:
[0060] 1) First, you can create a data synchronization instance on demand in the region. The main configuration indicators are network bandwidth size, which is used for different data flow requirements of users; storage space size, which is used for caching user relay data;
[0061] 2) Change the synchronization instance specifications according to user needs, including bandwidth and storage space. The bandwidth of the data synchronization instance is limited by the physical bandwidth of the network card on which it is mounted. It runs the leaky bucket current limiting flow control algorithm within the range of the physical bandwidth according to the bandwidth limit specified by the synchronization task to achieve soft bandwidth limitation. The leaky bucket current limiting flow control algorithm can achieve flow control in mbps. The storage space of the data synchronization instance uses distributed storage technology to achieve dynamic allocation and mounting of storage space to meet the needs of users to manually expand space. At the same time, it supports automatic dynamic expansion within the upper limit after the storage space utilization reaches the preset threshold.
[0062] 3) Receive synchronization task information, establish network connection between source and target synchronization instances, and report task establishment status;
[0063] 4) Task pre-check. Before starting the task, you need to check the configuration of the source and target side item by item according to the synchronization restrictions. The check items are: source and target database instance connectivity, source and target instance permission check, source and target global transaction number check, etc. The synchronization task can be started only after the pre-check is passed, and the task pre-check results are reported;
[0064] 5) Start the synchronization task and report the synchronization task execution progress and synchronization instance running status information in real time;
[0065] 6) If the synchronization task specifies caching synchronization relay data, the source-side data synchronization instance will allocate storage space of the specified size, first cache the synchronization data extracted from the source database, write it to the cache file, and then send the cached data to the target-side data synchronization instance. When the cross-region network bandwidth is small, it can effectively buffer and smooth the data traffic.
[0066] 7) If the source database service performs a data log cleanup operation, the storage of the synchronization instance relay log can effectively avoid the loss and discontinuity of the synchronization data. The relay log provides an automatic submission rolling mechanism, which stores the log data in multiple shards according to the space size set by the user; when the currently cached relay log exceeds the preset shard size, the log file will be truncated and the log will start to be stored in a new shard file; the target data synchronization instance will respond to the global transaction number submitted by the target database, and the source instance will clean up and delete the submitted shard relay log file according to the response transaction number; through the shard rolling mechanism, the conflict between cleaning the relay log and writing the relay log is avoided, and the problem of long-term cache overrun of the relay log is effectively prevented; when the relay log cache increases suddenly in a very short time, so that it is about to exceed the limit before reaching the clearing limit, it will be reported to the synchronization task management module 101 in time, and the user will intervene to manually expand the capacity or automatically expand the capacity according to the preset rules to prevent data loss.
[0067] It can be seen that the data synchronization module 102 provides a pre-check function while performing data synchronization operations, avoiding the cumbersome third-party program installation of traditional database backups, and can check each configuration of the source and target ends item by item according to synchronization restrictions, and intuitively display the start, view, edit and delete functions of remote disaster recovery synchronization tasks. Moreover, it can adopt a high-availability solution, manage and update the backup service cluster in real time, and collect the configuration information and pre-check results of the synchronization task.
[0068] In addition, in a possible implementation, the data synchronization system may further include a network security module, which is used for performing permission configuration, permission verification, encryption of data transmission, etc.
[0069] For example, the network security module designs the network. The data synchronization instance is allocated with at least two virtual network cards, network card 1 is used for communication with the synchronization task management module 101 on the management side, and network card 2 is used for communication with the database instance on the tenant side. Network connection is established with the peer synchronization instance through VPN or dedicated network by using network card 2 or network card 3;
[0070] The distributed key-value storage program in the data synchronization instance and the management-side data synchronization module 102, and the synchronization task scheduling service use a secure TLS authentication connection to effectively prevent unauthorized data synchronization instances from accessing the synchronization task scheduling service;
[0071] An ACL permission control mechanism is provided between the synchronization task scheduling service and the data synchronization instance. The data synchronization instance only has the permission to read the synchronization task and report the execution status, which effectively prevents unauthorized tenant-side task access.
[0072] In addition, encrypted secure links or VPN dedicated lines are used between the cross-regional management-side synchronization task cluster and the tenant-side data synchronization instance. Inter-domain data transmission encrypts data using an encryption algorithm that meets user security requirements, effectively ensuring the security of cross-region data transmission.
[0073] like Figure 2 As shown, an embodiment of the present invention provides a method for synchronizing data in a data synchronization system based on any one of the above embodiments, and the method may include the following steps:
[0074] Step 201: using the current synchronization task management module 101 in at least one synchronization task management module to receive a data synchronization task submitted by a tenant on the data providing side;
[0075] Step 202: when the current synchronization task management module is the synchronization task management module of the local area, the target data synchronization instance corresponding to the tenant is determined by using the current synchronization task management module;
[0076] Step 203: using the current synchronization task management module to issue a data synchronization task based on the target data synchronization instance; wherein the data synchronization task includes: a source end address of the data providing side and a target end address of the data synchronization side;
[0077] Step 204: After receiving the data synchronization task issued by the current synchronization task management module, the data synchronization module establishes a communication connection between the source end address and the target end address;
[0078] Step 205: using the data synchronization module to obtain the data to be synchronized from the source database on the data provider side;
[0079] Step 206: Use the data synchronization module to write the data to be synchronized into the relay cache and then send it to the target end address, so that the data synchronization side executes the data synchronization task.
[0080] In a possible implementation, the method further includes: when the current synchronization task management module 101 is not the synchronization task management module 101 of the local area, using the current synchronization task management module 101, distributing the data synchronization task to other areas so that the synchronization task can be completed by the target area corresponding to the data synchronization task.
[0081] In a possible implementation, step 202, in which the current synchronization task management module 101 is used to determine the target data synchronization instance corresponding to the tenant, includes:
[0082] Using the current synchronization task management module 101 to check whether there is an idle instance in the idle instance list of the tenant's data synchronization instance resource pool according to the data synchronization task;
[0083] If there is an idle instance in the data synchronization instance resource pool, the current synchronization task management module 101 is used to check whether the specification of the idle instance meets the preset requirements;
[0084] If the specification of the idle instance meets the preset requirements, the idle instance is determined as the target data synchronization instance by using the current synchronization task management module 101;
[0085] If there is no idle instance in the data synchronization instance resource pool, or the specifications of the idle instances in the data synchronization instance resource pool do not meet the preset requirements, the current synchronization task management module 101 is used to create a new instance according to the specifications required by the data synchronization task, and the new instance is determined as the target data synchronization instance; wherein the specifications include at least one of bandwidth and storage space.
[0086] In a possible implementation, the method further includes:
[0087] Using the current synchronization task management module 101 to monitor the running progress of the data synchronization task and store the global transaction number;
[0088] After the data synchronization task is restarted, the current synchronization task management module 101 is used to query the global transaction number last saved before the data synchronization task is terminated to restore the synchronization progress before the data synchronization task is terminated; wherein, the global transaction number is used to record the execution progress of the task.
[0089] In a possible implementation, after the data synchronization module 102 receives the data synchronization task issued by the current synchronization task management module 101, the following is further included:
[0090] Use the data synchronization module 102 to pre-check the configurations of the data providing side and the data synchronization side, and execute the synchronization task after the check passes;
[0091] The configured items include at least one of the following:
[0092] Whether the database instances on the data provider side and the data synchronization side are connected, the instance permissions on the data provider side and the data synchronization side, and whether the global transaction numbers on the data provider side and the data synchronization side are enabled; among them, the global transaction number is used to record the execution progress of the task.
[0093] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute a method in any one of the embodiments of the present solution.
[0094] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method in any one of the embodiments of this solution is implemented.
[0095] It is to be understood that the structure illustrated in the embodiment of the present solution does not constitute a specific limitation on the data synchronization system. In other embodiments of the specification, the data synchronization system may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0096] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is 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 the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "comprise a..." do not exclude the existence of other identical factors in the process, method, article or equipment including the elements.
[0097] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0098] The method in the above embodiment and the system in the above embodiment are based on the same inventive concept. The specific content of the method in the embodiment can be found in the description in the embodiment of the system of this solution, and will not be repeated here.
[0099] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this solution can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0100] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects described in this solution in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A data synchronization system, characterized in that: include: At least one synchronization task management module and a data synchronization module; The current synchronization task management module in the at least one synchronization task management module is used to receive the data synchronization task submitted by the tenant on the data providing side; When the current synchronization task management module is the synchronization task management module of the local area, determine the target data synchronization instance corresponding to the tenant, and issue the data synchronization task based on the target data synchronization instance; wherein the data synchronization task includes: the source end address of the data providing side and the target end address of the data synchronization side; The data synchronization module is used to establish a communication connection between the source end address and the target end address after receiving the data synchronization task issued by the current synchronization task management module; obtain the data to be synchronized from the source database of the data providing side, write the data to be synchronized into the relay cache, and then send it to the target end address, so that the data synchronization side executes the data synchronization task; The current synchronization task management module is further used to distribute the data synchronization task to other areas when the current synchronization task management module is not the synchronization task management module of the local area, so that the synchronization task can be completed by the target area corresponding to the data synchronization task; The current synchronization task management module is used to check whether there is an idle instance in the idle instance list of the data synchronization instance resource pool of the tenant according to the data synchronization task; if there is an idle instance in the data synchronization instance resource pool, check whether the specification of the idle instance meets the preset requirements; if the specification of the idle instance meets the preset requirements, determine the idle instance as the target data synchronization instance; if there is no idle instance in the data synchronization instance resource pool, or the specification of the idle instance in the data synchronization instance resource pool does not meet the preset requirements, create a new instance according to the specifications required by the data synchronization task, and determine the new instance as the target data synchronization instance; wherein the specifications include at least one of bandwidth and storage space; The current synchronization task management module is further used to monitor the running progress of the data synchronization task and store the global transaction number; and, after the data synchronization task is restarted, query the global transaction number last saved before the data synchronization task is terminated to restore the synchronization progress before the data synchronization task is terminated; wherein the global transaction number is used to record the execution progress of the task; The data synchronization module is further used to pre-check the configurations of the data providing side and the data synchronization side after receiving the data synchronization task issued by the current synchronization task management module, and execute the synchronization task after the check passes; The configured items include at least one of the following: Whether the database instances on the data providing side and the data synchronization side are connected, the instance permissions on the data providing side and the data synchronization side, and whether the global transaction numbers on the data providing side and the data synchronization side are enabled; wherein the global transaction number is used to record the execution progress of the task.
2. A data synchronization method, characterized in that: include: Using a current synchronization task management module in at least one synchronization task management module to receive a data synchronization task submitted by a tenant on a data providing side; When the current synchronization task management module is the synchronization task management module of the local area, the target data synchronization instance corresponding to the tenant is determined by using the current synchronization task management module; The data synchronization task is issued based on the target data synchronization instance by using the current synchronization task management module; wherein the data synchronization task includes: a source end address of a data providing side and a target end address of a data synchronization side; After receiving the data synchronization task issued by the current synchronization task management module, the data synchronization module establishes a communication connection between the source end address and the target end address; Using the data synchronization module to obtain the data to be synchronized from the source database on the data provider side; Using the data synchronization module to write the data to be synchronized into the relay cache and then send it to the target end address, so that the data synchronization side performs the data synchronization task; When the current synchronization task management module is not the synchronization task management module of the local area, the data synchronization task is distributed to other areas by using the current synchronization task management module, so that the synchronization task is completed by the target area corresponding to the data synchronization task; The using the current synchronization task management module to determine the target data synchronization instance corresponding to the tenant includes: Using the current synchronization task management module to check whether there is an idle instance in the idle instance list of the data synchronization instance resource pool of the tenant according to the data synchronization task; If there is an idle instance in the data synchronization instance resource pool, the current synchronization task management module is used to check whether the specification of the idle instance meets the preset requirements; If the specification of the idle instance meets the preset requirements, the idle instance is determined as the target data synchronization instance by using the current synchronization task management module; If there is no idle instance in the data synchronization instance resource pool, or the specifications of the idle instances in the data synchronization instance resource pool do not meet the preset requirements, a new instance is created according to the specifications required by the data synchronization task using the current synchronization task management module, and the new instance is determined as the target data synchronization instance; wherein the specifications include at least one of bandwidth and storage space; further comprising: Using the current synchronization task management module to monitor the running progress of the data synchronization task and store the global transaction number; After the data synchronization task is restarted, the global transaction number last saved before the data synchronization task is terminated is queried using the current synchronization task management module to restore the synchronization progress before the data synchronization task is terminated; wherein the global transaction number is used to record the execution progress of the task; After receiving the data synchronization task issued by the current synchronization task management module using the data synchronization module, further comprising: The data synchronization module is used to pre-check the configurations of the data providing side and the data synchronization side, and the synchronization task is executed after the check passes; The configured items include at least one of the following: Whether the database instances on the data providing side and the data synchronization side are connected, the instance permissions on the data providing side and the data synchronization side, and whether the global transaction numbers on the data providing side and the data synchronization side are enabled; wherein the global transaction number is used to record the execution progress of the task.
Citation Information
Patent Citations
Method and system for synchronizing file content
CN102045400A
Multi-tenant data sharing system, management method thereof and database deployment method
CN111367887A
Data synchronization method and device, medium and equipment
CN113626522A
Database synchronization method and device, electronic equipment and storage medium
CN114510531A
Agent-based service cross-domain calling method and system
CN114629953A
