Distributed database multi-copy strong synchronization method and device based on double centers and computer equipment

By detecting network failures and downgrading the replication mechanism in the distributed database, restoring the data synchronization process, and evaluating link stability, the problem of the impact of intermittent failures on the business is solved, and the stable operation and high availability of the distributed database are achieved.

CN118838751APending Publication Date: 2024-10-25BANK OF HANGZHOU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410760600.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-10-25

AI Technical Summary

Technical Problem

In a distributed database, intermittent network failures will affect the synchronization mechanism of multiple copies of data, resulting in intermittent unavailability of the business system. It is difficult for existing technologies to effectively judge and handle such failures.

Method used

When the data node in the main center detects the failure of the strong synchronization mechanism and the replication timeout, it records the fault situation and enters the link monitoring mode, downgrading to asynchronous replication; after detecting that the network link is restored, the data replication synchronization process is resumed, and the data is When the node enters the synchronization preparation state, it continuously monitors the synchronization progress of the data change log; collects the status information of all data nodes to evaluate link stability, and restores the strong synchronization mechanism of all data nodes when the link is confirmed to be stable.

Benefits of technology

It achieves effective judgment on the dual-center synchronous write mechanism in intermittent network failure scenarios, ensures the stable operation of distributed databases, and improves business service quality and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118838751A_ABST
    Figure CN118838751A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a distributed database multi-copy strong synchronization method and device based on double centers and computer equipment. The method comprises the following steps: receiving and recording a copy fault condition fed back by a data node positioned in a main center, and entering a link monitoring mode to continuously monitor a network state and the feedback of the data node; degrading all data nodes into asynchronous replication; when it is detected that the network link is recovered, the data nodes are driven to conduct data copying under the condition that it is ensured that all the data nodes are kept in the asynchronous state; when the synchronization progress of the data change log meets the requirement, switching the data node into a synchronization preparation state; collecting state information of all data nodes to evaluate link stability; and after the link is stable, upgrading a data strong synchronization mechanism of all data nodes, and switching to a two-center synchronous writing state. By implementing the method provided by the embodiment of the invention, the double-center synchronous writing mechanism can be effectively judged in an intermittent network fault scene of the distributed relational database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a distributed database data processing method, and more specifically to a distributed database multi-copy strong synchronization method, device and computer equipment based on dual centers. Background Art

[0002] When a distributed database is deployed in two centers, the strong synchronization of multiple copies of data depends on the network link between the two centers. In the scenario where RPO=0 is required, the data must be written to the local center and transmitted to the remote center and the writing is successful before the write success can be returned to the client. This means that the data multi-copy mechanism needs to ensure the data consistency of the two centers before confirming the completion of the write operation. Therefore, the success of data synchronization is closely dependent on the reliability of the network link.

[0003] Due to the large number of data nodes in a distributed database, the probability of network failure affecting nodes increases, and the impact of network failure on different nodes may vary in order. In actual work, when a network failure occurs, in order to ensure the continuous availability of the business, the dual-center synchronous writing of multiple copies of data should be downgraded to asynchronous writing, and then restored after the failure is recovered. If the stability of the network and the synchronization progress of incremental data are not judged, once an intermittent network failure occurs, it will be limited by the synchronization mechanism of multiple copies of data, which will affect the stable operation of the distributed database, thereby causing intermittent unavailability of the business system.

[0004] Therefore, it is necessary to design a new method to effectively judge the dual-center synchronous writing mechanism in the intermittent network failure scenario of the distributed relational database. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device and computer equipment for strong synchronization of multiple copies of a distributed database based on dual centers.

[0006] To achieve the above object, the present invention adopts the following technical solution: a distributed database multi-copy strong synchronization method based on dual centers, comprising:

[0007] When the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center to copy data to the remote center times out, it receives and records the replication failure feedback from the data node at the main center and enters the link monitoring mode to continuously monitor the network status and feedback from the data node;

[0008] Downgrade all data nodes to asynchronous replication;

[0009] When the network link is detected to be restored, the data nodes are driven to replicate data while ensuring that all data nodes remain in an asynchronous state;

[0010] When the synchronization progress of the data change log meets the requirements, the data node is switched to the synchronization preparation state;

[0011] Collect status information of all data nodes to evaluate link stability;

[0012] When the link is stable, the strong data synchronization mechanism of all data nodes is upgraded and switched to the two-center synchronous writing state.

[0013] Its further technical solution is: the replication failure situation is caused when the network link of the dual centers fails, the data node of the distributed data cluster of the main center detects that the strong synchronization mechanism fails and feedback that the write command has timed out.

[0014] A further technical solution is: when the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center to copy data to the remote center times out, the data node receives and records the copy failure feedback from the data node at the main center, and enters the link monitoring mode to continuously monitor the network status and the feedback from the data node, including:

[0015] When the data node at the main center detects that the strong synchronization mechanism fails and the operation of copying data from the data node at the main center to the remote center times out, it receives the replication failure feedback from the data node at the main center, stores the replication failure time persistently locally, and enters the link monitoring mode to continuously monitor the network status and feedback from the data node.

[0016] Its further technical solution is: downgrading all data nodes to asynchronous replication includes:

[0017] Send instructions to all data nodes to downgrade the data strong synchronization mechanism to asynchronous replication, monitor the accumulation of data change logs, and record the data change logs in the queue to be sent.

[0018] A further technical solution is: when the network link is detected to be restored, the data nodes are driven to perform data replication while ensuring that all data nodes remain in an asynchronous state, including:

[0019] When it is detected that the network link between the two centers has been restored, the data node remains in an asynchronous state and starts to restore data replication at the same time. When synchronizing the data change logs accumulated during the failure, the link recovery time is persistently stored locally.

[0020] A further technical solution is: when the synchronization progress of the data change log meets the requirements, the data node is switched to a synchronization ready state, including:

[0021] When the synchronization progress of the data change log is not higher than the safety threshold of the sending queue, the data node enters the synchronization preparation state. During the synchronization preparation stage, feedback information from the data node is obtained. When a write command timeout occurs again during the synchronization preparation stage, the replication failure time is re-recorded, and the above-mentioned downgrading of all data nodes to asynchronous replication is executed.

[0022] A further technical solution is: the collecting of status information of all data nodes to evaluate link stability includes:

[0023] Collect the status information of all data nodes and confirm that all data nodes have entered the synchronization preparation state;

[0024] Determine link stability and exit link monitoring mode when the link is stable.

[0025] The further technical solution is: when the link is stable, the data strong synchronization mechanism of all data nodes is upgraded and switched to the two-center synchronous writing state, including:

[0026] Send instructions to all data nodes to upgrade the data replication mechanism of all data nodes back to the strong synchronization state and switch to the two-center synchronous write mode.

[0027] The present invention also provides a distributed database multi-copy strong synchronization device based on dual centers, including:

[0028] A receiving and recording unit is used to receive and record the replication failure feedback from the data node at the main center when the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center replicating data to the remote center times out, and enters a link monitoring mode to continuously monitor the network status and feedback from the data node;

[0029] Demotion unit, used to downgrade all data nodes to asynchronous replication;

[0030] The replication unit is used to drive the data nodes to replicate data when the network link is detected to be restored, ensuring that all data nodes remain in an asynchronous state;

[0031] A synchronization preparation unit is used to switch the data node to a synchronization preparation state when the synchronization progress of the data change log meets the requirements;

[0032] An evaluation unit, used to collect status information of all data nodes to evaluate link stability;

[0033] The switching unit is used to upgrade the data strong synchronization mechanism of all data nodes and switch to the two-center synchronous writing state when the link is stable.

[0034] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.

[0035] Compared with the prior art, the beneficial effects of the present invention are as follows: when the data node of the main center detects that the strong synchronization mechanism fails and a replication timeout occurs, the system records the fault and enters the link monitoring mode, and then downgrades all data nodes to asynchronous replication; after detecting that the network link is restored, the system resumes the data replication synchronization process, and continuously monitors the synchronization progress of the data change log when the data node enters the synchronization preparation state; collects the status information of all data nodes to evaluate the link stability, and when the link is confirmed to be stable, the system resumes the strong synchronization mechanism of all data nodes, thereby realizing effective judgment of the dual-center synchronous write mechanism applicable to distributed relational databases in intermittent network failure scenarios.

[0036] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0038] Figure 1 A schematic diagram of an application scenario of a dual-center distributed database multi-copy strong synchronization method provided in an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of a process flow of a dual-center distributed database multi-copy strong synchronization method provided in an embodiment of the present invention;

[0040] Figure 3 A schematic block diagram of a dual-center distributed database multi-copy strong synchronization device provided in an embodiment of the present invention;

[0041] Figure 4 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following will be combined with the 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 part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0044] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0045] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of a dual-center distributed database multi-copy strong synchronization method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a distributed database multi-copy strong synchronization method based on dual centers provided in an embodiment of the present invention. The distributed database multi-copy strong synchronization method based on dual centers is applied to a control node. The control node interacts with several data nodes for data, which is conducive to improving the quality of business services. This design can ensure data synchronization between two data centers, thereby improving the fault tolerance and data reliability of the system. When a data center on one side fails, the data center on the other side can still continue to provide services to ensure the continuity of the business. At the same time, the recovery judgment mechanism can shield the intermittent type of failures in the network. By observing the recovery conditions, the system can minimize the impact on the distributed database and better support the stable operation of the business system. This means that the system can automatically identify changes in the quality of the network link and perform corresponding operations according to the recovery conditions set in advance, such as downgrading to asynchronous replication or switching to a backup link. Such a mechanism can reduce the impact on the business and improve the stability and reliability of the system.

[0047] In general, the design of dual-center network link quality judgment, dual-center synchronous writing of distributed databases, and recovery judgment mechanism can effectively improve business service quality, reduce the impact of system failures on business, and ensure the stable operation of the system.

[0048] Figure 2 1 is a flow chart of a method for strong synchronization of multiple copies of a distributed database based on dual centers provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S160.

[0049] S110. When the data node located at the main center detects that the strong synchronization mechanism fails and the operation of the data node located at the main center to copy data to the remote center times out, it receives and records the replication failure feedback from the data node located at the main center, and enters the link monitoring mode to continuously monitor the network status and feedback from the data node.

[0050] In this embodiment, the replication failure situation is caused when the network link of the dual centers fails, the data node of the distributed data cluster of the main center detects that the strong synchronization mechanism fails and feedback that the write command has timed out.

[0051] Specifically, when the data node located at the main center detects that the strong synchronization mechanism has failed and the operation of the data node located at the main center to copy data to the remote center has timed out, it receives the replication failure feedback from the data node located at the main center, stores the replication failure time persistently locally, and enters the link monitoring mode to continuously monitor the network status and feedback from the data node.

[0052] In the dual-center architecture, each data node monitors the data synchronization status with the remote center in real time. When a network link fails, the data node in the primary center detects that the strong synchronization mechanism has failed. When the data node attempts to write data to the remote center, if the network link is interrupted, the write operation will time out. The data node captures this timeout exception and immediately reports it to the control node. After receiving feedback on the write timeout, the control node will persist the time of the replication failure on the local storage device, including log files or database tables to record the specific time and related information of the failure. The control node begins to enter link monitoring mode, which means that it will continue to monitor the status of the network link and the feedback from the data node. The specific implementation can be achieved in the following ways:

[0053] Regular heartbeat detection: The control node periodically sends network heartbeat packets to the remote center to detect the connectivity of the network link; Collect node status: The control node collects status information from all data nodes, including synchronization progress, replication delay, etc.; Log analysis: Analyze the logs of data nodes to determine whether there are any abnormalities; Status feedback mechanism: The control node establishes a status feedback mechanism to ensure that it can respond in time and switch back to the normal synchronization mechanism after the link is restored.

[0054] Specifically, the remote center write operation is monitored in each data node; a write timeout threshold is set, and when the threshold is exceeded, the fault detection logic is triggered; when the data node detects a fault, it immediately sends a feedback message containing the fault information to the control node; a persistent storage module is implemented in the control node to record the fault time, for example, the local file system or database can be used to store this information; each time a fault feedback is received, the current timestamp and related fault information are recorded; after the control node switches to the link monitoring mode, a regular heartbeat detection task is started, and the frequency can be configured according to business needs; a status collection module is implemented to periodically obtain the current status information from the data node and analyze it; through the log management system, the logs of the data nodes are analyzed in real time to identify potential problems.

[0055] Through real-time monitoring and rapid feedback mechanisms, the system can detect problems and handle them as soon as network links fail, thereby reducing business interruption time. Persistently recording the failure time and related information helps to check and verify data consistency after failure recovery to ensure that no data is lost or damaged. The introduction of link monitoring mode enables the system to maintain basic business functions in the case of network instability, and ensures data availability and reliability by downgrading to asynchronous replication. Persistent fault records provide data support for subsequent fault analysis and troubleshooting, helping operation and maintenance personnel to better understand the system operation status and make optimization adjustments. The automated processing and monitoring capabilities of the control nodes reduce the need for manual intervention and improve the system's self-healing capabilities and management efficiency.

[0056] Through the above implementation steps and benefits, the control node's response measures after the dual-center network link fails will help improve the business service quality and overall stability of the distributed database system.

[0057] S120. Downgrade all data nodes to asynchronous replication.

[0058] In this embodiment, the control node sends instructions to all data nodes to downgrade the data strong synchronization mechanism to asynchronous replication, and monitors the accumulation of data change logs, and records the data change logs in the queue to be sent.

[0059] Specifically, the control node sends asynchronous replication configuration instructions to all data nodes, requiring the data nodes to switch the synchronization mode to asynchronous; after receiving the configuration instructions, the data node modifies the local configuration to downgrade the synchronization mechanism to asynchronous, and starts to operate according to the new configuration; when the entire cluster switches to the asynchronous state, the data node begins to record data change logs locally and stores these logs in a queue to be sent; the data node will continue to collect data changes caused by business operations, record these changes as logs and store them in sequence in the queue, waiting for subsequent asynchronous transmission; during the entire switching process, the control node and the data node maintain communication to ensure the correctness of configuration delivery and status synchronization; in the asynchronous replication mode, the data node no longer waits for confirmation from the remote center, but updates the data according to the local log to ensure the normal operation of the business.

[0060] By downgrading to asynchronous replication, data nodes no longer need to wait for confirmation from the remote center and can process local data changes immediately, effectively reducing synchronization delays and improving system response speed. In asynchronous replication mode, data nodes can process data changes in parallel and are no longer subject to serial limitations during synchronization. The system throughput is improved and can better support high-concurrency business needs. Asynchronous replication reduces frequent communications between data nodes and remote centers, reduces network burden, reduces network latency, and helps improve system stability and performance. In abnormal situations caused by network failures or synchronization delays, by switching to asynchronous replication mode, the continuous availability of the business is ensured and business interruptions due to synchronization problems are avoided. The data change log recording in asynchronous replication mode facilitates subsequent fault recovery and can help the system quickly synchronize data to a normal state after fault recovery, reducing the impact of faults on the system.

[0061] Through the above implementation steps and benefits, the control node sends the asynchronous replication configuration, downgrades the data strong synchronization mechanism and switches to the asynchronous state, which helps to improve the performance and stability of the distributed database cluster and ensure the normal operation of the business and the reliability of the data.

[0062] S130: When it is detected that the network link is restored, the data nodes are driven to perform data replication while ensuring that all data nodes remain in an asynchronous state.

[0063] In this embodiment, when it is detected that the network link of the dual center has been restored, the data node remains in an asynchronous state and simultaneously starts to restore data replication and synchronize the data change log accumulated during the failure. The control node stores the link recovery time persistently locally.

[0064] Specifically, when the network link of the dual centers is restored, the data node will detect that the link is available and start trying to connect to the other center; after the data node establishes a connection with the other center, they confirm the link status with each other to ensure the stability and reliability of the connection; the data node starts to restore data replication in an asynchronous state, and gradually synchronizes the data change logs accumulated during the failure to the data nodes of the other center; the data node sends the data change logs stored locally to the data nodes of the other center one by one in sequence to ensure data consistency and integrity; after the control node detects that all data nodes have started data replication, it records the link recovery time and persists it in the local storage as the timestamp of the link recovery.

[0065] The recovery process of asynchronous data replication can ensure that after the dual-center network link is restored, the data nodes can continue to maintain data consistency to avoid data loss or inconsistency; during the data replication recovery process, the business can continue to operate normally and will not be affected by data synchronization operations, ensuring the continuous stability and availability of the system; the control node persists the link recovery time, providing important reference data for system operation and maintenance and monitoring, which helps to analyze the impact of link failures and optimize fault recovery strategies; asynchronous data replication recovery can reduce the pressure and cost of data synchronization to a certain extent, avoid large-scale data transmission after the link is restored, and reduce the burden on the system; through continuous asynchronous data replication and link recovery timestamp recording, the reliability and disaster recovery capabilities of the system can be improved, and the consistency and reliability of data after dual-center switching can be guaranteed.

[0066] S140: When the synchronization progress of the data change log meets the requirement, the data node is switched to the synchronization preparation state.

[0067] In this embodiment, when the synchronization progress of the data change log is not higher than the safety threshold of the sending queue, the data node enters the synchronization preparation state. During the synchronization preparation stage, feedback information from the data node is obtained. When a write command timeout occurs again during the synchronization preparation stage, the replication failure time is re-recorded, and the downgrading of all data nodes to asynchronous replication is executed.

[0068] The data node continuously monitors the synchronization progress of the data change log to ensure that all data changes starting from the recovery of the dual-center network link are gradually synchronized to the other center; the data node detects the number of logs in the queue to be sent and determines whether it is lower than the preset safety threshold (for example, 10 logs).

[0069] When the number of logs in the queue to be sent is less than 10, that is, when the synchronization progress reaches the safety threshold, the data node will enter the synchronization preparation state; the data node will feedback the current synchronization preparation state to the control node, indicating that it can consider switching to the synchronous data replication mechanism; after receiving the synchronization preparation state feedback from the data node, the control node will check the overall system status and confirm that the switch can be made; when the data node is currently in the synchronization preparation state, while ensuring that the log differences between the data nodes are extremely small and controllable, the control node instructs the data node to switch to the synchronous data replication mechanism; after switching to the synchronous data replication mechanism, the data node continues to monitor the execution of write commands; if there are still write commands that time out during the synchronization process, the data node will immediately feedback the replication failure to the control node; after receiving the replication failure feedback, the control node will persist the failure time and store it locally; the control node instructs the data node to return to the asynchronous data replication recovery step to ensure that data consistency is not affected.

[0070] The introduction of the synchronous ready state ensures a smooth transition from asynchronous data replication to synchronous data replication, avoiding long business waits caused by forced synchronous writing when the data difference is large, thereby reducing the risk of business interruption; the synchronous ready state ensures that the switching of the data replication mechanism is carried out within a safe and controllable range, improving the responsiveness and stability of the system during the switching process; through meticulous monitoring and progress management, it ensures that the data change logs between data nodes are consistent at any time, thereby ensuring data consistency; if a replication failure occurs during the switching process, the system can immediately feedback and persist the failure time, and quickly re-enter the asynchronous recovery step to ensure that data will not be lost or inconsistent due to the failure of the replication mechanism switching; by switching to the synchronous replication mechanism in the synchronous ready state, the use of network and system resources can be optimized, avoiding performance bottlenecks caused by large-scale data transmission; the system has higher fault tolerance and recovery capabilities, and can quickly adjust the recovery strategy in the event of abnormal situations such as write command timeouts, thereby improving the overall disaster recovery capabilities; the persistent link recovery time and replication failure time provide detailed logs and timestamps for operation and maintenance personnel, which is helpful for problem troubleshooting and system optimization, and simplifies operation and maintenance management.

[0071] S150: Collect status information of all data nodes to evaluate link stability.

[0072] In one embodiment, the above-mentioned step S150 may include steps S151 - S152 .

[0073] S151. Collect status information of all data nodes and confirm that all data nodes have entered the synchronization preparation state;

[0074] S152: Determine link stability, and when the link is stable, exit link monitoring mode.

[0075] Specifically, after the control node collects feedback that all data nodes have entered the synchronization preparation state, it begins to judge the link stability; the link stability judgment includes two conditions: the number of replication failures and the link recovery time. The control node counts the number of replication failures in the last 8 hours. If it is less than or equal to the failure threshold of 2 times, one of the conditions is met. In addition, the control node records the time of the most recent link recovery and determines whether it is greater than the 30-minute safety time threshold; if the link stability judgment is established, that is, the number of replication failures is less than or equal to 2 and the most recent link recovery time is greater than 30 minutes, the control node will exit the link monitoring mode; the control node sends instructions to the data nodes, notifying them that they will no longer continuously monitor the data change log and synchronization preparation status, and resume normal data operation mode; the data nodes synchronize all write operations in real time to ensure data consistency between multiple nodes; in link monitoring mode, data nodes need to continuously monitor the data change log. After exiting the link monitoring mode, the data node is no longer monitored, which reduces resource overhead and improves the overall performance of the system. By counting the number of replication failures and monitoring the link recovery time, the stability of the link can be evaluated more accurately. Setting the number of failures and safety time thresholds helps to eliminate occasional failures and short-term link jitters, and improve the reliability of judgment. The introduction of link stability judgment avoids premature exit from the link monitoring mode, thereby reducing the problem of database jams caused by rapid recovery after multiple network interruptions due to misjudgment. Exiting the monitoring mode only after the link stability judgment is established reduces the risk of misoperation and business instability caused by link instability.

[0076] The above implementation steps can better manage the exit conditions of the link monitoring mode, ensure timely switching to the real-time data synchronization mode when the link is stable, and improve the stability, performance and reliability of the system.

[0077] S160: When the link is stable, the strong data synchronization mechanism of all data nodes is upgraded and switched to the two-center synchronous writing state.

[0078] In this embodiment, instructions are sent to all data nodes to upgrade the data replication mechanisms of all data nodes back to the strong synchronization state and switch to the two-center synchronous write mode.

[0079] Specifically, after confirming that the link is stable, the control node issues an instruction to notify all data nodes that they can exit the link monitoring mode; the control node stops sending monitoring instructions to the data nodes, and prepares to issue the configuration for the strong synchronization mechanism upgrade. The control node generates an instruction containing the strong synchronization mechanism upgrade configuration and issues it to all data nodes; the configuration instruction includes the parameters and settings required to switch to the two-center synchronous write state to ensure that all data nodes can synchronize data according to the new requirements. After receiving the configuration instruction issued by the control node, the data node upgrades the strong synchronization mechanism according to the requirements in the instruction; the data node adjusts its own data synchronization strategy and algorithm to ensure that strong synchronization of data can be achieved in the two-center synchronous write state. After the upgrade is completed, verification and testing are performed to ensure that the new strong synchronization mechanism can work properly; simulated failures, power outages, etc. can be used to test the data consistency and reliability of the system in the two-center synchronous write state.

[0080] The synchronous write state of the two centers means that data will be written in the two centers at the same time, thus avoiding data inconsistency problems caused by single point failures and improving data consistency and reliability; after adopting the synchronous write state of the two centers, even if one data center fails, the other data center can continue to provide services, thereby enhancing the disaster recovery capability of the system; the strong synchronization mechanism upgrade can reduce the risk of data loss, because the data will be synchronized to the two centers at the same time when written, even if one center fails, the other center still retains a complete copy of the data; the synchronous write state of the two centers can better adapt to the growth of business scale and ensure the stability and reliability of the system when facing large-scale data operations; after adopting the synchronous write state of the two centers, the availability of the system will be improved, and users can use the system for data operations and access more stably.

[0081] For example:

[0082] Time point: June 11, 2024;

[0083] Initial state: data nodes are in a strong synchronization mechanism, and both centers are writing synchronously;

[0084] When the network link of the dual-center fails:

[0085] Time: 2024-06-11 12:00;

[0086] Event: Data node A (primary center) detects that the strong synchronization mechanism with data node B (remote center) fails;

[0087] The write command timed out, for example, the write operation ID#1001,#1002,#1003 timed out;

[0088] The control node records the replication failure time: 2024-06-11 12:00;

[0089] The control node enters the link monitoring mode;

[0090] The control node sends the asynchronous replication configuration:

[0091] Time: 2024-06-11 12:05;

[0092] Event: The control node sends configuration to switch all data nodes to asynchronous replication state;

[0093] Data nodes A and B switch to asynchronous state;

[0094] Data change logs are accumulated in the queue to be sent:

[0095] For example: ID#1004(12:06PM),ID#1005(12:07PM),...,ID#1020(12:20PM);

[0096] Dual-center network link recovery:

[0097] Time: 2024-06-11 13:00;

[0098] Event: The network link is restored and the data node starts to resume data replication;

[0099] Data node A starts synchronizing the accumulated logs to data node B:

[0100] For example: ID#1004-ID#1020 starts synchronization;

[0101] The control node records the link recovery time: 2024-06-11 13:00;

[0102] The data change log synchronization completion progress is lower than the sending queue safety threshold:

[0103] Time: 2024-06-11 14:00;

[0104] Event: The number of logs in the queue to be sent is less than 10, and the data node enters the synchronization preparation state;

[0105] The number of queued logs to be sent on data node A is reduced to 8:

[0106] For example: ID#1021(1:01PM) to ID#1028(13:08);

[0107] Data node A sends feedback to the control node that it has entered the synchronization preparation state;

[0108] If a write timeout occurs during the process, such as ID#1029 (13:09) write command timeout, a fault will be reported and all data nodes will be downgraded to asynchronous replication after re-entering the process;

[0109] The control node determines the link stability:

[0110] Time: 2024-06-11 15:00;

[0111] Event: The control node collects data and determines the link stability;

[0112] Number of replication failures in the last 8 hours: 1 (failure at 12:00);

[0113] More than 30 minutes have passed since the last link restoration (no failures since restoration at 13:00);

[0114] The control node confirms that the link is stable and exits the link monitoring mode;

[0115] The control node sends configuration upgrades to a strong synchronization mechanism:

[0116] Time: 2024-06-11 15:15;

[0117] Event: The control node sends the configuration, and the data node switches back to the strong synchronization mechanism.

[0118] Data node A and data node B switch to the two-center synchronous writing state;

[0119] The system returns to normal strong synchronization mechanism operation;

[0120] Through this specific example, we can see how the system downgrades from a strong synchronization mechanism to an asynchronous mechanism when a network link failure occurs, and how it gradually recovers to a strong synchronization mechanism after the failure is recovered. Each step has detailed time points and log numbers to ensure that the business can transition smoothly and maintain data consistency and integrity.

[0121] The above method can realize dual-center synchronous writing of distributed database based on the network link quality of the dual centers, and is beneficial to improving the service quality for the following reasons:

[0122] Monitoring of strong synchronization failure and network timeout: When a data node detects that the strong synchronization mechanism fails and a replication timeout occurs, the system immediately records the failure, enters link monitoring mode, and downgrades to asynchronous replication, thereby avoiding data loss or inconsistency.

[0123] Automatic recovery mechanism after network link recovery: Once the network link recovery is detected, the system automatically resumes the data replication synchronization process of the data node to ensure the continuity and integrity of data synchronization.

[0124] Monitoring of synchronization readiness status: Continuously monitor the synchronization progress of the data change log to ensure data consistency before resuming synchronization.

[0125] Link stability assessment and recovery: collects status information of all data nodes to assess link stability. Once the link is confirmed to be stable, the system will restore the strong synchronization mechanism of all data nodes to ensure the reliability of data synchronization.

[0126] In summary, through real-time monitoring of network link quality and execution of recovery mechanisms, this solution can minimize the impact of intermittent network failures on distributed databases, better support the stable operation of business systems, and improve the reliability and stability of business services.

[0127] The above-mentioned distributed database multi-copy strong synchronization method based on dual centers is that when the data node of the main center detects that the strong synchronization mechanism fails and a replication timeout occurs, the system records the failure and enters the link monitoring mode, and then downgrades all data nodes to asynchronous replication; after detecting that the network link is restored, the system resumes the data replication synchronization process, and continuously monitors the synchronization progress of the data change log when the data node enters the synchronization preparation state; collects the status information of all data nodes to evaluate the link stability, and when the link is confirmed to be stable, the system resumes the strong synchronization mechanism of all data nodes, so as to realize the distributed relational database in the intermittent network failure scenario, and effectively judges the dual-center synchronous write mechanism.

[0128] Figure 3 is a schematic block diagram of a dual-center distributed database multi-copy strong synchronization device 300 provided in an embodiment of the present invention. Figure 3 As shown, corresponding to the above-mentioned distributed database multi-copy strong synchronization method based on dual centers, the present invention also provides a distributed database multi-copy strong synchronization device 300 based on dual centers. The distributed database multi-copy strong synchronization device 300 based on dual centers includes a unit for executing the above-mentioned distributed database multi-copy strong synchronization method based on dual centers, and the device can be configured in a server. Specifically, please refer to Figure 3 The dual-center-based distributed database multi-copy strong synchronization device 300 includes a receiving and recording unit 301, a degradation unit 302, a replication unit 303, a synchronization preparation unit 304, an evaluation unit 305, and a switching unit 306.

[0129] The receiving and recording unit 301 is used to receive and record the replication failure feedback from the data node at the main center when the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center copying data to the remote center times out, and enter the link monitoring mode to continuously monitor the network status and the feedback of the data node; the downgrading unit 302 is used to downgrade all data nodes to asynchronous replication; the replication unit 303 is used to drive the data node to replicate data when it is detected that the network link is restored, ensuring that all data nodes remain in an asynchronous state; the synchronization preparation unit 304 is used to switch the data node to the synchronization preparation state when the synchronization progress of the data change log meets the requirements; the evaluation unit 305 is used to collect the status information of all data nodes to evaluate the link stability; the switching unit 306 is used to upgrade the data strong synchronization mechanism of all data nodes after the link is stable, and switch to the two-center synchronous write state.

[0130] In one embodiment, the receiving recording unit 301 is used to receive the replication failure situation reported by the data node located at the main center when the data node located at the main center detects that the strong synchronization mechanism has failed and the operation of the data node located at the main center to copy data to the remote center has timed out, store the replication failure time persistently locally, and enter the link monitoring mode to continuously monitor the network status and feedback from the data node.

[0131] In one embodiment, the downgrading unit 302 is used to send instructions to all data nodes to downgrade the data strong synchronization mechanism to asynchronous replication, and monitor the accumulation of data change logs, and record the data change logs in a queue to be sent.

[0132] In one embodiment, the replication unit 303 is used to detect that the network link between the dual centers has been restored, and the data nodes remain in an asynchronous state, and simultaneously start to restore data replication, synchronize the data change logs accumulated during the failure, and store the link recovery time persistently locally.

[0133] In one embodiment, the synchronization preparation unit 304 is used to, when the synchronization progress of the data change log is not higher than the safety threshold of the sending queue, cause the data node to enter a synchronization preparation state, obtain feedback information from the data node during the synchronization preparation stage, and when a write command timeout occurs again during the synchronization preparation stage, re-record the replication failure time, and execute the downgrading of all data nodes to asynchronous replication.

[0134] In one embodiment, the evaluation unit 305 includes:

[0135] The collection subunit is used to collect the status information of all data nodes and confirm that all data nodes have entered the synchronization preparation state; the exit subunit is used to determine the link stability, and when the link is stable, exit the link monitoring mode.

[0136] In one embodiment, the switching unit 306 is used to send instructions to all data nodes to upgrade the data replication mechanism of all data nodes back to the strong synchronization state and switch to the two-center synchronous write mode.

[0137] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned dual-center distributed database multi-copy strong synchronization device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.

[0138] The above-mentioned dual-center distributed database multi-copy strong synchronization device 300 can be implemented in the form of a computer program. The computer program can be used in Figure 4 Runs on the computer device shown.

[0139] See also Figure 4 , Figure 4 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.

[0140] See also Figure 4 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0141] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a distributed database multi-copy strong synchronization method based on dual centers.

[0142] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0143] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a distributed database multi-copy strong synchronization method based on dual centers.

[0144] The network interface 505 is used to communicate with other devices over the network. Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0145] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0146] When the data node at the main center detects that the strong synchronization mechanism fails and the operation of copying data from the data node at the main center to the remote center times out, it receives and records the replication failure feedback from the data node at the main center, and enters the link monitoring mode to continuously monitor the network status and feedback from the data nodes; downgrades all data nodes to asynchronous replication; when it detects that the network link is restored, ensures that all data nodes remain in an asynchronous state and drives the data nodes to replicate data; when the synchronization progress of the data change log meets the requirements, switches the data node to the synchronization preparation state; collects the status information of all data nodes to evaluate the link stability; when the link is stable, upgrades the data strong synchronization mechanism of all data nodes and switches to the synchronous write state of the two centers.

[0147] The replication failure occurs when a network link between the dual centers fails, and the data node of the distributed data cluster of the primary center detects that the strong synchronization mechanism fails and reports that the write command has timed out.

[0148] In one embodiment, when the processor 502 implements the steps of receiving and recording the replication failure feedback from the data node located in the main center, and entering the link monitoring mode to continuously monitor the network status and the feedback of the data node, the processor 502 specifically implements the following steps:

[0149] When the data node at the main center detects that the strong synchronization mechanism fails and the operation of copying data from the data node at the main center to the remote center times out, it receives the replication failure feedback from the data node at the main center, stores the replication failure time persistently locally, and enters the link monitoring mode to continuously monitor the network status and feedback from the data node.

[0150] In one embodiment, when the processor 502 implements the step of downgrading all data nodes to asynchronous replication, it specifically implements the following steps:

[0151] Send instructions to all data nodes to downgrade the data strong synchronization mechanism to asynchronous replication, monitor the accumulation of data change logs, and record the data change logs in the queue to be sent.

[0152] In one embodiment, when the processor 502 drives the data nodes to perform data replication while ensuring that all data nodes remain in an asynchronous state when the network link recovery is detected, the following steps are specifically implemented:

[0153] When it is detected that the network link between the two centers has been restored, the data node remains in an asynchronous state and starts to restore data replication at the same time. When synchronizing the data change logs accumulated during the failure, the link recovery time is persistently stored locally.

[0154] In one embodiment, when the processor 502 implements the step of switching the data node to the synchronization preparation state when the synchronization progress of the data change log meets the requirement, the processor 502 specifically implements the following steps:

[0155] When the synchronization progress of the data change log is not higher than the safety threshold of the sending queue, the data node enters the synchronization preparation state. During the synchronization preparation stage, feedback information from the data node is obtained. When a write command timeout occurs again during the synchronization preparation stage, the replication failure time is re-recorded, and the above-mentioned downgrading of all data nodes to asynchronous replication is executed.

[0156] In one embodiment, when the processor 502 implements the step of collecting the status information of all data nodes to evaluate the link stability, the processor 502 specifically implements the following steps:

[0157] Collect status information of all data nodes and confirm that all data nodes have entered the synchronization preparation state; determine the link stability, and when the link is stable, exit the link monitoring mode.

[0158] In one embodiment, when the processor 502 implements the step of upgrading the data strong synchronization mechanism of all data nodes and switching to the two-center synchronous write state after the link is stable, the following steps are specifically implemented:

[0159] Send instructions to all data nodes to upgrade the data replication mechanism of all data nodes back to the strong synchronization state and switch to the two-center synchronous write mode.

[0160] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0161] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0162] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:

[0163] When the data node at the main center detects that the strong synchronization mechanism fails and the operation of copying data from the data node at the main center to the remote center times out, it receives and records the replication failure feedback from the data node at the main center, and enters the link monitoring mode to continuously monitor the network status and feedback from the data nodes; downgrades all data nodes to asynchronous replication; when it detects that the network link is restored, ensures that all data nodes remain in an asynchronous state and drives the data nodes to replicate data; when the synchronization progress of the data change log meets the requirements, switches the data node to the synchronization preparation state; collects the status information of all data nodes to evaluate the link stability; when the link is stable, upgrades the data strong synchronization mechanism of all data nodes and switches to the synchronous write state of the two centers.

[0164] The replication failure occurs when a network link between the dual centers fails, and the data node of the distributed data cluster of the primary center detects that the strong synchronization mechanism fails and reports that the write command has timed out.

[0165] In one embodiment, when the processor executes the computer program to implement the steps of receiving and recording the replication failure feedback from the data node located at the main center, and entering the link monitoring mode to continuously monitor the network status and the feedback of the data node when the data node located at the main center detects that the strong synchronization mechanism fails and the operation of the data node located at the main center replicating data to the remote center times out, and specifically implements the following steps:

[0166] When the data node at the main center detects that the strong synchronization mechanism fails and the operation of copying data from the data node at the main center to the remote center times out, it receives the replication failure feedback from the data node at the main center, stores the replication failure time persistently locally, and enters the link monitoring mode to continuously monitor the network status and feedback from the data node.

[0167] In one embodiment, when the processor executes the computer program to implement the step of downgrading all data nodes to asynchronous replication, the processor specifically implements the following steps:

[0168] Send instructions to all data nodes to downgrade the data strong synchronization mechanism to asynchronous replication, monitor the accumulation of data change logs, and record the data change logs in the queue to be sent.

[0169] In one embodiment, when the processor executes the computer program to implement the step of driving the data nodes to perform data replication while ensuring that all data nodes remain in an asynchronous state when the network link is detected to be restored, the processor specifically implements the following steps:

[0170] When it is detected that the network link between the two centers has been restored, the data node remains in an asynchronous state and starts to restore data replication at the same time. When synchronizing the data change logs accumulated during the failure, the link recovery time is persistently stored locally.

[0171] In one embodiment, when the processor executes the computer program to implement the step of switching the data node to the synchronization preparation state when the synchronization progress of the data change log meets the requirement, the processor specifically implements the following steps:

[0172] When the synchronization progress of the data change log is not higher than the safety threshold of the sending queue, the data node enters the synchronization preparation state. During the synchronization preparation stage, feedback information from the data node is obtained. When a write command timeout occurs again during the synchronization preparation stage, the replication failure time is re-recorded, and the above-mentioned downgrading of all data nodes to asynchronous replication is executed.

[0173] In one embodiment, when the processor executes the computer program to implement the step of collecting status information of all data nodes to evaluate link stability, the processor specifically implements the following steps:

[0174] Collect status information of all data nodes and confirm that all data nodes have entered the synchronization preparation state; determine the link stability, and when the link is stable, exit the link monitoring mode.

[0175] In one embodiment, when the processor executes the computer program to implement the step of upgrading the data strong synchronization mechanism of all data nodes and switching to the two-center synchronous write state after the link is stable, the following steps are specifically implemented:

[0176] Send instructions to all data nodes to upgrade the data replication mechanism of all data nodes back to the strong synchronization state and switch to the two-center synchronous write mode.

[0177] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0178] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0179] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0180] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0182] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A dual-center distributed database multi-copy strong synchronization method, characterized in that: include: When the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center to copy data to the remote center times out, it receives and records the replication failure feedback from the data node at the main center and enters the link monitoring mode to continuously monitor the network status and feedback from the data node; Downgrade all data nodes to asynchronous replication; When the network link is detected to be restored, the data nodes are driven to replicate data while ensuring that all data nodes remain in an asynchronous state; When the synchronization progress of the data change log meets the requirements, the data node is switched to the synchronization preparation state; Collect status information of all data nodes to evaluate link stability; When the link is stable, the strong data synchronization mechanism of all data nodes is upgraded and switched to the two-center synchronous writing state.

2. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: The replication failure situation is caused when a network link between the dual centers fails, and the data nodes of the distributed data cluster of the main center detect that the strong synchronization mechanism fails and feedback that the write command has timed out.

3. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: When the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center to copy data to the remote center times out, it receives and records the copy failure feedback from the data node at the main center, and enters the link monitoring mode to continuously monitor the network status and the feedback of the data node, including: When the data node at the main center detects that the strong synchronization mechanism fails and the operation of copying data from the data node at the main center to the remote center times out, it receives the replication failure feedback from the data node at the main center, stores the replication failure time persistently locally, and enters the link monitoring mode to continuously monitor the network status and feedback from the data node.

4. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: The described downgrading of all data nodes to asynchronous replication includes: Send instructions to all data nodes to downgrade the data strong synchronization mechanism to asynchronous replication, monitor the accumulation of data change logs, and record the data change logs in the queue to be sent.

5. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: When the network link is detected to be restored, the data nodes are driven to perform data replication while ensuring that all data nodes remain in an asynchronous state, including: When it is detected that the network link between the two centers has been restored, the data node remains in an asynchronous state and starts to restore data replication at the same time. When synchronizing the data change logs accumulated during the failure, the link recovery time is persistently stored locally.

6. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: When the synchronization progress of the data change log meets the requirement, switching the data node to the synchronization preparation state includes: When the synchronization progress of the data change log is not higher than the safety threshold of the sending queue, the data node enters the synchronization preparation state. During the synchronization preparation stage, feedback information from the data node is obtained. When a write command timeout occurs again during the synchronization preparation stage, the replication failure time is re-recorded, and the above-mentioned downgrading of all data nodes to asynchronous replication is executed.

7. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: The collecting of status information of all data nodes to evaluate link stability includes: Collect the status information of all data nodes and confirm that all data nodes have entered the synchronization preparation state; Determine link stability and exit link monitoring mode when the link is stable.

8. The method for strong synchronization of multiple copies of a distributed database based on dual centers according to claim 1 is characterized in that: When the link is stable, the data strong synchronization mechanism of all data nodes is upgraded and switched to the two-center synchronous writing state, including: Send instructions to all data nodes to upgrade the data replication mechanism of all data nodes back to the strong synchronization state and switch to the two-center synchronous write mode.

9. A dual-center distributed database multi-copy strong synchronization device, characterized in that: include: A receiving and recording unit is used to receive and record the replication failure feedback from the data node at the main center when the data node at the main center detects that the strong synchronization mechanism fails and the operation of the data node at the main center replicating data to the remote center times out, and enters a link monitoring mode to continuously monitor the network status and feedback from the data node; Demotion unit, used to downgrade all data nodes to asynchronous replication; The replication unit is used to drive the data nodes to replicate data when the network link is detected to be restored, ensuring that all data nodes remain in an asynchronous state; A synchronization preparation unit is used to switch the data node to a synchronization preparation state when the synchronization progress of the data change log meets the requirements; An evaluation unit, used to collect status information of all data nodes to evaluate link stability; The switching unit is used to upgrade the data strong synchronization mechanism of all data nodes and switch to the two-center synchronous writing state when the link is stable.

10. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method according to any one of claims 1 to 8 when executing the computer program.