Dual-computer hot standby database management system and method

By introducing a heartbeat monitoring module and a failover module into the dual-machine hot standby database management system, the problem that traditional database technology solutions cannot switch in time when partial failure of the main database server is achieved, and the effect of quickly recovering database services is achieved to avoid data loss.

CN119759652APending Publication Date: 2025-04-04CHINA NUCLEAR CONTROL SYST ENG
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411823358.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When the traditional high-availability database technology solution for the master and standby machine based on shared storage partially fails, the backup database server cannot take over the service in time, resulting in data loss.

Method used

Design a dual-machine hot backup database management system, including the main database server, backup database server, heartbeat monitoring module, data synchronization module and failover module. The heartbeat monitoring module monitors the operating status of the main database server in real time, and when a failure occurs, the backup database server is quickly switched to the main database server through the failover module.

Benefits of technology

It realizes that when the primary database server fails, the backup database server can quickly and automatically take over the service, avoiding the risks of data loss and business interruption, and improving the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759652A_ABST
    Figure CN119759652A_ABST
Patent Text Reader

Abstract

The invention discloses a dual-computer hot standby database management system and method, and relates to the technical field of database management in a nuclear power distributed control system. The main database server performs data updating and storage based on the information data of the client; the data synchronization module synchronizes the data in the main database server to the backup database server; the backup database server performs data updating and storage according to the data synchronized by the data synchronization module; the backup database server is in a hot standby state; the heartbeat monitoring module monitors running state data of the main database server; and the fault switching module determines whether to switch the database server or not according to the running state data. The invention aims to improve the reliability and stability of the system and avoid the risks of data loss and service interruption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of database management in a nuclear power distributed control system, and in particular to a dual-machine hot standby database management system and method. Background Art

[0002] Real-time historical database management system plays an important role in nuclear power distributed control systems. However, data loss and system downtime caused by database host failure and other reasons still exist, which has a serious impact on the operation and business processes of the system. In order to solve these problems, researchers have proposed various high-availability real-time historical database management systems, including dual-machine hot standby high-availability real-time historical database management systems.

[0003] In the traditional high-availability database technology solution based on shared storage, the backup database server is usually in a cold standby state and will only start and take over the service when the primary database server fails. Although this method is reliable, it also has some problems. For example, when the primary database server partially fails, the backup database server may not be able to take over the service in time, resulting in data loss. Summary of the invention

[0004] The purpose of this application is to provide a dual-machine hot standby database management system and method, which can improve the reliability and stability of the system and avoid the risks of data loss and business interruption.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a dual-machine hot standby database management system, including: a primary database server, a backup database server, a heartbeat monitoring module, a data synchronization module, and a fault switching module;

[0007] The main database server and the backup database server are both connected to the client; the main database server and the backup database server are connected via the data synchronization module; the heartbeat monitoring module and the fault switching module are both connected to the main database server, and are also connected to the backup database server;

[0008] The backup database server is in hot standby state;

[0009] The main database server is used to update and store data based on the information data of the client;

[0010] The data synchronization module is used to synchronize the data in the primary database server to the backup database server; the backup database server is used to update and store data according to the data synchronized by the data synchronization module;

[0011] The synchronization content of the data synchronization module includes metadata and real-time historical data; when the metadata version information of the databases corresponding to the primary database server and the backup database server are inconsistent, the metadata information is first synchronized, and after the metadata information synchronization is completed, the real-time historical data is synchronized to avoid the database with a low metadata version receiving the real-time historical data and failing to store it successfully;

[0012] The heartbeat monitoring module is used to monitor the operating status data of the main database server;

[0013] The fault switching module is used to determine whether to switch the database server according to the running status data.

[0014] Optionally, the running status data includes: network reachability, metadata version consistency, and whether the data synchronization queue is accumulated.

[0015] Optionally, the monitoring period of the heartbeat monitoring module is no more than 1 second.

[0016] Optionally, when the fault switching module determines according to the running status data that the primary database server fails, a switching logic is triggered to switch the backup database server at the current moment as the primary database server at the next moment.

[0017] Optionally, the fault includes: server power failure, database shutdown, network card failure, switch failure or incorrect network cable insertion.

[0018] Optionally, the fault switching module triggers the switching logic, and the time period corresponding to the fault switching process is less than 1 second.

[0019] Optionally, when the data synchronization module performs data synchronization, the corresponding replication delay duration does not exceed 1 second.

[0020] Optionally, the dual-machine hot standby database management system further includes: a client connection management module;

[0021] The client connection management module is connected to the client and the fault switching module respectively; the client connection management module is also connected to the primary database server and the backup database server respectively;

[0022] The client connection management module is used to reallocate the communication cache processing connection when the failover module performs a failover.

[0023] In a second aspect, the present application provides a dual-machine hot standby database management method, which is implemented by using the dual-machine hot standby database management system described above; the dual-machine hot standby database management method includes:

[0024] The client's information data is updated and stored through the main database server, and the information data is synchronized to the backup database server based on the data synchronization module for data updating and storage; the backup database server is in hot standby state;

[0025] Control the heartbeat monitoring module to monitor the operating status data of the main database server;

[0026] The fault switching module is controlled to perform switching logic judgment according to the operating status data to determine whether to switch the database server.

[0027] Optionally, the dual-machine hot standby database management method further includes:

[0028] According to the user request of the user terminal, the information data stored in the main database server or the backup database server is retrieved for analysis and query processing.

[0029] According to the specific embodiments provided in this application, this application has the following technical effects:

[0030] The present application provides a dual-machine hot standby database management system and method. By introducing a heartbeat monitoring module, the operating status of the main database server can be monitored in real time. When the main database server fails, the fault switching module is immediately triggered to switch the backup database server to the main database server. This method avoids the problems of the traditional backup server in the standby state, can quickly restore the database service, and improve the reliability and stability of the system; when the main database server fails, the backup database server can automatically take over the service immediately, thereby avoiding the risk of data loss and business interruption. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0032] Figure 1 This is a structural block diagram of the dual-machine hot standby database management system mentioned in this application;

[0033] Figure 2 This is a flowchart of the design concept of the database management method mentioned in this application. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0035] The real-time historical database can record and store the real-time data of the equipment and control system in real time, and can also save the historical data for subsequent analysis and query. It can achieve rapid master-slave switching when the database host fails in the nuclear power distributed control system, and ensure the integrity and availability of the data, thus ensuring the continuity of nuclear power business.

[0036] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0037] In an exemplary embodiment, the present application provides a dual-machine hot standby database management system, including: a primary database server, a backup database server, a heartbeat monitoring module, a data synchronization module and a fault switching module.

[0038] The main database server and the backup database server are both connected to the client; the main database server and the backup database server are connected through the data synchronization module; the heartbeat monitoring module and the fault switching module are both connected to the main database server and also connected to the backup database server. The backup database server is in hot standby state.

[0039] The main database server is used to update and store data based on the information data of the client; the data synchronization module is used to synchronize the data in the main database server to the backup database server. The backup database server is used to update and store data based on the data synchronized by the data synchronization module.

[0040] Among them, the synchronization content of the data synchronization module includes metadata and real-time historical data; when the metadata version information of the databases corresponding to the main database server and the backup database server are inconsistent, wait for the synchronization of the metadata information first, and then synchronize the real-time historical data after the synchronization of the metadata information is completed, so as to avoid the failure of successful storage when the database with a low metadata version receives the real-time historical data.

[0041] The heartbeat monitoring module is used to monitor the operating status data of the main database server; the fault switching module is used to determine whether to switch the database server according to the operating status data.

[0042] The operation status data includes: network reachability, metadata version consistency, and whether the data synchronization queue is accumulated. The monitoring cycle of the heartbeat monitoring module is no more than 1 second.

[0043] The metadata version refers to the version number of metadata information such as database tags and configuration parameters. Each time the metadata information changes, the version number increases by one. The database with a high metadata version number or a backlog in the data synchronization queue will be prioritized as the primary database.

[0044] When the fault switching module determines that the main database server fails according to the running status data, the switching logic is triggered to switch the backup database server at the current moment as the main database server at the next moment.

[0045] Faults include: server power failure, database shutdown, network card failure, switch failure, or incorrect network cable insertion. The fault switching module triggers the switching logic, and the corresponding time period for the fault switching process is less than 1 second.

[0046] When the data synchronization module performs data synchronization, the corresponding replication delay does not exceed 1 second.

[0047] As an optional implementation method, the dual-machine hot standby database management system also includes: a client connection management module. This module is used to manage the connection between the client and the database server. Each client establishes a communication connection channel or data subscription service with the primary and standby databases at the same time. By default, business data interaction with the primary database is prioritized, including metadata and real-time historical data addition, deletion, modification, and query, as well as real-time reception of published data and other services.

[0048] When the client requests data, if the master-slave information changes after the request to the master database returns the result, the client will initiate a request to the new master database again, up to a maximum of three times.

[0049] The client connection management module redistributes the communication cache processing connection when the failover module performs a failover. The client connection management module caches the recent write data with the main database, and immediately redistributes the communication data and cache write data to another communication channel when a failover occurs, ensuring continuous access and data integrity for the client. The entire failover process is controlled within 1 second, improving the system's disaster recovery capability, improving system availability, and ensuring continuous availability of services.

[0050] like Figure 1 As shown, the system includes a main database server, a backup database server, a heartbeat monitoring module, a fault switching module, a data synchronization module, and a client connection management module.

[0051] The primary database server is responsible for processing user requests and data update operations, and synchronizing data to the backup database server in real time.

[0052] The backup database server serves as a backup of the primary database server and stores the same data copy as the primary database server.

[0053] The Heartbeat Monitoring Module is used to monitor the operating status of the primary database server. The operating status data includes: network accessibility, metadata version consistency, and whether the data synchronization queue is backlogged. When the Heartbeat Monitoring Module detects a failure in the primary database server, it triggers a failover operation; the database with a high metadata version number or a backlog in the data synchronization queue is switched to the primary database.

[0054] The FailoverModule automatically switches the backup database server to the primary database server when the primary database server fails. The module notifies the client to switch connections and ensures data consistency.

[0055] The Data Synchronization Module is responsible for data synchronization between the primary and standby databases to ensure data real-time and consistency. When the metadata version information of the primary and standby databases is inconsistent, wait for the metadata information to be synchronized first. After the metadata information synchronization is completed, synchronize the real-time historical data to avoid the database with a lower metadata version from receiving the real-time historical data and failing to store it successfully.

[0056] The Client Connection Management Module is responsible for managing the connection between the client and the database server and handling the reallocation of the connection during failover.

[0057] Figure 2 The present invention is a flowchart of the design concept of the database management method, and the management method includes the following steps.

[0058] Step 1: Initialize and configure the primary database server and backup database server, and ensure that the network connection between the databases is unobstructed.

[0059] Step 2: Operation monitoring: monitor the operation status of the main database server in real time through the heartbeat monitoring module.

[0060] Step 3: Data synchronization: Use the data synchronization module to synchronize the data of the primary database server to the backup database server in real time.

[0061] Step 4: Failure switching. When the heartbeat monitoring module detects a failure in the primary database server, it triggers the failover module to perform a switch operation.

[0062] Step 5: Client connection management. During the failover process, the client connection management module handles the reallocation of connections to ensure continuous access to the client.

[0063] Heartbeat monitoring interval: This parameter should be determined based on the system's reliability requirements, as well as the network latency and stability between the primary and backup servers. It is recommended to set the heartbeat monitoring interval to between once per second and once every five seconds.

[0064] Database replication delay: This parameter indicates the data replication delay from the primary database server to the backup database server. This delay should be as small as possible to ensure the real-time and consistency of data. It is recommended to set the replication delay to 1 second or less.

[0065] Failure recovery time: This parameter indicates the time from the failure of the primary database server to the backup server becoming the primary database server. This time should be as short as possible to ensure the continuity of system services. It is recommended to set the failure recovery time to 3 seconds or less.

[0066] Client connection timeout: This parameter indicates that after the client establishes a connection with the database server, if there is no activity within the specified time, the connection will be automatically disconnected. It is recommended to set the client connection timeout to between 500 milliseconds and 2 seconds.

[0067] In an exemplary embodiment, a dual-machine hot standby database management method is provided, and the method is implemented by a dual-machine hot standby database management system. The dual-machine hot standby database management method includes:

[0068] The client's information data is updated and stored through the main database server, and the information data is synchronized to the backup database server based on the data synchronization module for data updating and storage; the backup database server is in hot standby state.

[0069] The heartbeat monitoring module is controlled to monitor the running status data of the main database server; the fault switching module is controlled to perform switching logic judgment according to the running status data to determine whether to switch the database server.

[0070] As an optional implementation, the dual-machine hot standby database management method further includes:

[0071] According to the user's request at the user end, the information data stored in the main database server or the backup database server is retrieved for analysis and query processing.

[0072] Benefits of this application:

[0073] First, improve the reliability and stability of the system. By introducing the heartbeat monitoring module, the operating status of the main database server can be monitored in real time. When the main database server fails, the failover module is immediately triggered to switch the backup database server to the main database server. This method avoids the problems of the traditional backup server in standby mode, can quickly restore the database service, and improve the reliability and stability of the system.

[0074] Secondly, it reduces the risk of data loss. When the primary database server fails, the backup database server can automatically take over the service immediately, thus avoiding the risk of data loss and business interruption.

[0075] In this application, all actions to obtain signals, information or data are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization of the corresponding device owner. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0076] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0077] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A dual-machine hot standby database management system, characterized in that: The dual-machine hot standby database management system includes: a main database server, a backup database server, a heartbeat monitoring module, a data synchronization module and a fault switching module; The main database server and the backup database server are both connected to the client; the main database server and the backup database server are connected via the data synchronization module; the heartbeat monitoring module and the fault switching module are both connected to the main database server, and are also connected to the backup database server; The backup database server is in hot standby state; The main database server is used to update and store data based on the information data of the client; The data synchronization module is used to synchronize the data in the primary database server to the backup database server; the backup database server is used to update and store data according to the data synchronized by the data synchronization module; The synchronization content of the data synchronization module includes metadata and real-time historical data; when the metadata version information of the databases corresponding to the primary database server and the backup database server are inconsistent, the metadata information is first synchronized, and after the metadata information synchronization is completed, the real-time historical data is synchronized to avoid the database with a low metadata version receiving the real-time historical data and failing to store it successfully; The heartbeat monitoring module is used to monitor the operating status data of the main database server; The fault switching module is used to determine whether to switch the database server according to the running status data.

2. The dual-machine hot standby database management system according to claim 1 is characterized in that: The operation status data includes: network reachability, metadata version consistency, and whether the data synchronization queue is accumulated.

3. The dual-machine hot standby database management system according to claim 1 is characterized in that: The monitoring period of the heartbeat monitoring module is no more than 1 second.

4. The dual-machine hot standby database management system according to claim 1 is characterized in that: When the fault switching module determines according to the running status data that the primary database server fails, the switching logic is triggered to switch the backup database server at the current moment as the primary database server at the next moment.

5. The dual-machine hot standby database management system according to claim 4 is characterized in that: The failures include: server power outage, database shutdown, network card failure, switch failure or incorrect network cable insertion.

6. The dual-machine hot standby database management system according to claim 4 is characterized in that: The fault switching module triggers the switching logic, and the time period corresponding to the fault switching process is less than 1 second.

7. The dual-machine hot standby database management system according to claim 1 is characterized in that: When the data synchronization module performs data synchronization, the corresponding replication delay duration does not exceed 1 second.

8. The dual-machine hot standby database management system according to claim 1 is characterized in that: The dual-machine hot standby database management system also includes: a client connection management module; The client connection management module is connected to the client and the fault switching module respectively; the client connection management module is also connected to the primary database server and the backup database server respectively; The client connection management module is used to reallocate the communication cache processing connection when the failover module performs a failover.

9. A dual-machine hot standby database management method, characterized in that: The dual-machine hot standby database management method is implemented by using the dual-machine hot standby database management system described in any one of claims 1 to 8; the dual-machine hot standby database management method includes: The client's information data is updated and stored through the main database server, and the information data is synchronized to the backup database server based on the data synchronization module for data updating and storage; the backup database server is in hot standby state; Control the heartbeat monitoring module to monitor the operating status data of the main database server; The fault switching module is controlled to perform switching logic judgment according to the operating status data to determine whether to switch the database server.

10. The dual-machine hot standby database management method according to claim 9, characterized in that: The dual-machine hot standby database management method also includes: According to the user request of the user terminal, the information data stored in the main database server or the backup database server is retrieved for analysis and query processing.

Citation Information

Patent Citations

  • Data backup method and device, equipment and storage medium

    CN116610500A

  • Hot backup system and method, electronic equipment and storage medium

    CN117827544A