Method for operating a database system, storage medium and device

By collecting and analyzing the state set of the database system, the operating mode is adjusted to upgrade the backup center to the primary center under specific conditions, which solves the problem of inaccurate fault diagnosis in the existing technology and improves the availability and reliability of the database system.

CN116089149BActive Publication Date: 2026-06-05CETC JINCANG (BEIJING) TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CETC JINCANG (BEIJING) TECH CO LTD
Filing Date
2023-02-20
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing database systems are not accurate enough in judging the specific circumstances of failures, resulting in low reliability and making it easy for problems to occur during the process of upgrading a backup center to a new primary center.

Method used

By collecting the state set of the database system, including the communication status between the arbitrator and the primary and backup centers, it is determined whether the state set meets the preset status. Based on the state set at the previous collection time, the operating mode is adjusted to ensure that the backup center is promoted to the primary center and the original transaction processing work of the primary center is stopped under specific conditions.

Benefits of technology

It improves the availability and reliability of the database system in case of failure, avoids split-brain problems and situations where there is no master center available, and ensures the stable operation of the database system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089149B_ABST
    Figure CN116089149B_ABST
Patent Text Reader

Abstract

The application provides a database system operation method, a storage medium and equipment. The database system comprises an arbitrator, a main center and a backup center. The database system operation method comprises collecting a state set of the database system, the state set comprising communication states between the arbitrator and the main center, between the arbitrator and the backup center and between the main center and the backup center at a collection time; judging whether the state set is consistent with a first preset state, the first preset state at least comprising a communication state between the arbitrator and the main center being disconnected and a communication state between the main center and the backup center being disconnected; if the state set is consistent with the first preset state, obtaining a state set collected at a previous collection time, denoted as a reference state set; and adjusting an operation mode of the database system according to the reference state set. Thus, the failure of the database system can be more accurately judged, and the problem in the failure processing process can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and in particular to a method for operating a database system, a storage medium, and a device. Background Technology

[0002] In database systems with disaster recovery capabilities, there are typically an arbitrator, a primary data center, and a backup data center. This allows the backup data center to be promoted to the new primary data center if the primary data center fails, ensuring the database system's disaster recovery effectiveness. Specifically, if both the arbitrator and the backup data center cannot ping the primary data center (using a packet explorer to establish network connections between nodes), the backup data center will be promoted to the new primary data center to continue maintaining the database system and improve its availability.

[0003] While existing database systems guarantee availability, they only use the loss of connection between the primary and backup centers and the arbitrator as the basis for changing the database system's operating mode. This lack of accuracy in judging the specific circumstances of the fault can easily lead to problems during the process of promoting a backup center to a new primary center, resulting in low database system reliability. Summary of the Invention

[0004] One object of the present invention is to provide a method for operating a database system, a storage medium, and a device that can solve any of the above problems.

[0005] Specifically, this invention provides a method for operating a database system, the database system including an arbitrator, a primary center, and a backup center, the method of operating the database system including:

[0006] The database system's status set is collected according to a preset cycle. The status set includes the communication status between the arbitrator and the main center, the communication status between the arbitrator and the backup center, and the communication status between the main center and the backup center at the time of collection.

[0007] Determine whether the set of states matches the first preset state. The first preset state includes at least the communication state between the arbitrator and the main center being disconnected and the communication state between the main center and the backup center being disconnected.

[0008] If the state set matches the first preset state, obtain the state set collected at the previous collection time and record it as the reference state set;

[0009] Adjust the database system's operating mode based on the reference state set.

[0010] Optionally, the first preset state includes the communication status between the arbitrator and the main center being disconnected, the communication status between the arbitrator and the backup center being normal, and the communication status between the main center and the backup center being disconnected.

[0011] Optionally, the steps for adjusting the operating mode of the database system based on the reference state set include:

[0012] Determine whether the reference state set matches the second preset state;

[0013] If the reference state set matches the second preset state, the backup center will be promoted to the primary center.

[0014] Stop the original main center's transaction processing work.

[0015] Optionally, the second preset state includes the communication status between the arbitrator and the main center being normal, the communication status between the arbitrator and the backup center being normal, and the communication status between the main center and the backup center being normal.

[0016] Optionally, the second preset state includes the communication status between the arbitrator and the main center being disconnected, the communication status between the arbitrator and the backup center being normal, and the communication status between the main center and the backup center being normal.

[0017] Optionally, the step of determining whether the set of states matches the first preset state includes:

[0018] If the state set does not match the first preset state, maintain the current operating mode of the current database system.

[0019] Optionally, the state set also includes data difference states between the primary center and the backup center. Data difference states include same state and different state. Same state means that the data in the primary center and the backup center are the same, and different state means that the data in the primary center and the backup center are different.

[0020] The second preset state includes at least the state where the data difference between the primary center and the backup center is the same.

[0021] Optionally, the steps for adjusting the operating mode of the database system according to the reference set include:

[0022] Determine whether the reference state set matches the third preset state. The third preset state includes at least the communication status between the arbitrator and the backup center being disconnected.

[0023] If the reference state set matches the third preset state, continue the transaction processing work in the main center.

[0024] According to another aspect of the present invention, a machine-readable storage medium is also provided, on which a machine-executable program is stored, which, when executed by a processor, implements the method of operating the database system according to any one of the preceding claims.

[0025] According to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a machine-executable program stored in the memory and running on the processor, wherein the processor, when executing the machine-executable program, implements a method for operating a database system according to any of the preceding claims.

[0026] The database system operation method of this invention collects a set of states, including the communication states between the arbitrator and the primary center, the communication states between the arbitrator and the backup center, and the communication states between the primary center and the backup center. When the state set meets a first preset state, the method obtains the state set collected at the previous collection time, and adjusts the database system's operation mode based on the state set collected at the previous collection time. In other words, it can adjust the database system's operation mode based on changes in the state set. Therefore, on the one hand, it can judge the fault situation based on the communication states between the arbitrator and the primary center, the arbitrator and the backup center, and the primary center and the backup center, which helps to identify the actual fault type. On the other hand, adjusting the operation mode based on changes in the state set can confirm the system situation at the moment before the fault, thereby confirming to some extent the state from which the fault developed, and thus better adjusting the database operation mode. Therefore, the method of this embodiment can make a more accurate judgment on the fault situation of the database system, thereby reducing the occurrence of problems during fault handling and ensuring the availability and reliability of the database system.

[0027] Furthermore, the present invention enables a first preset state including a disconnected communication state between the arbitrator and the primary center, a normal communication state between the arbitrator and the backup center, and a disconnected communication state between the primary center and the backup center. When the reference state set matches the second preset state, the backup center is promoted to the primary center, and the transaction processing work of the original primary center is stopped. In other words, the backup center is promoted to the primary center and the transaction processing work of the original primary center is stopped only when the database system's state set changes from a normal communication state between the arbitrator and the primary center, a normal communication state between the arbitrator and the backup center, and a normal communication state between the primary center and the backup center to a disconnected communication state between the arbitrator and the primary center, a normal communication state between the arbitrator and the backup center, and a disconnected communication state between the primary center and the backup center; or from a disconnected communication state between the arbitrator and the primary center, a normal communication state between the arbitrator and the backup center, and a normal communication state between the primary center and the backup center to a disconnected communication state between the arbitrator and the primary center, a normal communication state between the arbitrator and the backup center, and a disconnected communication state between the primary center and the backup center. Therefore, on the one hand, in the event of a primary center failure or communication failure between the primary center and the arbitrator, or between the primary center and the backup center, the backup center can be promoted to the primary center, and the transaction processing of the original primary center can be stopped. This avoids the situation where two primary centers exist simultaneously in the database system, thus preventing the split-brain problem after the backup center is promoted to the primary center. On the other hand, it ensures that the primary center and the backup center can communicate to maintain state synchronization before the failure, guaranteeing normal use after the backup center becomes the new primary center. Furthermore, the transaction processing of the original primary center is only stopped when the above conditions are met, avoiding the situation where the transaction processing of the original primary center is stopped even if the communication between the arbitrator and the backup center is broken, preventing the backup center from being promoted to the new primary center, thus avoiding the situation where the database system has no available primary center. Therefore, being able to handle various types of database system failures in a compliant manner helps reduce problems during database system failure handling, ensuring the availability and reliability of the database system.

[0028] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0029] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:

[0030] Figure 1This is a schematic diagram of a database system according to an embodiment of the present invention;

[0031] Figure 2 This is a schematic flowchart of a method for operating a database system according to an embodiment of the present invention;

[0032] Figure 3 This is a schematic flowchart illustrating the step of determining the operating mode of a database system based on a reference state set in a database system operation method according to an embodiment of the present invention.

[0033] Figure 4 This is a schematic diagram illustrating a database system state change according to a database system operation method based on an embodiment of the present invention;

[0034] Figure 5 This is a schematic diagram illustrating another database system state change for a database system operation method according to an embodiment of the present invention;

[0035] Figure 6 This is a schematic diagram illustrating another type of database system state change, according to a database system operation method based on an embodiment of the present invention.

[0036] Figure 7 This is a schematic diagram illustrating another type of database system state change, according to a database system operation method based on an embodiment of the present invention.

[0037] Figure 8 This is a schematic diagram of a machine-readable storage medium according to an embodiment of the present invention;

[0038] Figure 9 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0039] Those skilled in the art should understand that the embodiments described below are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. These partial embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present invention.

[0040] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0041] like Figure 1 and Figure 2 As shown, in one embodiment, the database system includes an arbitrator 10, a primary center 20, and a backup center 30. The operation of the database system generally includes:

[0042] Step S201: Collect the status set of the database system according to a preset cycle. The status set includes the communication status between the arbitrator 10 and the main center 20, the communication status between the arbitrator 10 and the backup center 30, and the communication status between the main center 20 and the backup center 30 at the time of collection.

[0043] Specifically, a state set is created, represented as [communication state between the arbitrator and the primary center, communication state between the arbitrator and the backup center, and communication state between the primary center and the backup center]. The communication state between each pair of arbitrator 10, primary center 20, and backup center 30 is represented by values; for example, 0 represents normal communication and 1 represents abnormal communication. Therefore, under normal database conditions, the collected state set is [0, 0, 0].

[0044] Furthermore, the state set of the database system is periodically collected and recorded according to a preset cycle, thereby forming a sequence of changes in the state set of the database system.

[0045] Step S202: Determine whether the state set matches the first preset state. If yes, proceed to step S203; otherwise, proceed to step S205. The first preset state includes at least the communication status between the arbitrator 10 and the main center 20 being disconnected, and the communication status between the main center 20 and the backup center 30 being disconnected.

[0046] Specifically, the first preset state includes the communication state between the arbitrator 10 and the main center 20 being disconnected, the communication state between the arbitrator 10 and the backup center 30 being normal, and the communication state between the main center 20 and the backup center 30 being disconnected. Referring to the example above, that is, the first preset state is [1, 0, 1].

[0047] Step S203: Obtain the state set collected at the previous acquisition time, denoted as the reference state set. Specifically, if the state set collected at the current acquisition time matches the first preset state, obtain the state set collected at the previous acquisition time, i.e., the state set collected in the previous acquisition operation at the current acquisition time, from the change record sequence of the state set formed by acquisition in chronological order.

[0048] Step S204: Determine the operating mode of the database system based on the reference state set.

[0049] Reference Figure 3 As shown, specifically, the steps for determining the operating mode of a database system based on a reference state set include:

[0050] Step S301: Determine whether the reference state set matches the second preset state.

[0051] Specifically, the second preset state includes normal communication between arbitrator 10 and main center 20, normal communication between arbitrator 10 and backup center 30, and normal communication between main center 20 and backup center 30. Alternatively, the second preset state includes disconnected communication between arbitrator 10 and main center 20, normal communication between arbitrator 10 and backup center 30, and normal communication between main center 20 and backup center 30.

[0052] Referring to the example above, that is, the second preset state is [0, 0, 0] or [1, 0, 0].

[0053] Step S302: If the reference state set matches the second preset state, the backup center is promoted to the primary center. Specifically, if the reference state set is [0, 0, 0] or [1, 0, 0], that is, in the chronological sequence of state set changes, the previous state set of [1, 0, 1] was [0, 0, 0] or [1, 0, 0]. In other words, the state of the database system jumps from [0, 0, 0] or [1, 0, 0] to [1, 0, 1]. Then, the backup center 30 is promoted to the new primary center in the database system.

[0054] Step S303: Stop the original transaction processing work of the main center. Stop the original transaction processing work of the main center 20.

[0055] Step S205: Maintain the current operating mode of the database system. Specifically, if the state set does not match the first preset state, that is, if the state set collected at the current time is not [1, 0, 1], then the operating mode of the database system will not be changed. Specifically, this means maintaining the primary center 20 as the execution center for write operations, allowing the primary center 20 to perform transaction processing. In other words, the backup center 30 will not be promoted to the new primary center, nor will the transaction processing work of the primary center 20 be stopped.

[0056] In this embodiment, a set of states is collected, including the communication states between the arbitrator 10 and the primary center 20, the communication states between the arbitrator 10 and the backup center 30, and the communication states between the primary center 20 and the backup center 30. When the state set meets a first preset state, the state set collected at the previous collection time is obtained, thereby adjusting the operating mode of the database system based on the state set collected at the previous collection time. In other words, the operating mode of the database system can be adjusted according to the changes in the state set.

[0057] Therefore, on the one hand, the communication status between arbitrator 10 and primary center 20, between arbitrator 10 and backup center 30, and between primary center 20 and backup center 30 can be used to determine the fault situation, which helps to identify the specific circumstances of the fault. On the other hand, adjusting the operating mode based on changes in the state set can confirm the system status at the moment before the fault, thereby confirming to some extent the state from which the fault developed, and thus better adjusting the database operating mode. Therefore, the method of this embodiment can make a more accurate judgment on the fault situation of the database system, thereby reducing the occurrence of problems during fault handling.

[0058] Furthermore, existing technologies, due to their inaccurate assessment of the specific circumstances of a fault, are prone to promoting a backup center to the primary center when the primary center is functioning correctly, but communication between the primary center 20, arbitrator 10, and backup center 30 fails. This can result in two primary centers and a split-brain scenario. Conversely, if transaction processing at the primary center is stopped to prevent a split-brain scenario, then if communication between backup center 30 and arbitrator 10 fails first, it could lead to a situation where no primary center is available.

[0059] In this embodiment, the first preset state includes the communication state between the arbitrator 10 and the main center 20 being disconnected, the communication state between the arbitrator 10 and the backup center 30 being normal, and the communication state between the main center 20 and the backup center 30 being disconnected. Furthermore, if the reference state set matches the second preset state, the backup center is promoted to the main center, and the transaction processing work of the original main center is stopped.

[0060] In other words, the backup center 30 will be promoted to the primary center and the transaction processing work of the original primary center 20 will be stopped only when the communication status of the database system changes from normal between arbitrator 10 and primary center 20, normal between arbitrator 10 and backup center 30, and normal between primary center 20 and backup center 30 to disconnected between arbitrator 10 and primary center 20, normal between arbitrator 10 and backup center 30, and disconnected between primary center 20 and backup center 30; or when the communication status of arbitrator 10 and primary center 20, normal between arbitrator 10 and backup center 30, and normal between primary center 20 and backup center 30 changes to disconnected between arbitrator 10 and primary center 20, normal between arbitrator 10 and backup center 30, and disconnected between primary center 20 and backup center 30.

[0061] Therefore, on the one hand, in the event of a failure of the primary center 20 or a communication failure between the primary center 20 and the arbitrator 10, or between the primary center 20 and the backup center 30, the backup center 30 can be promoted to the primary center, stopping the transaction processing work of the original primary center 20. This avoids the situation where there are two primary centers in the database system at the same time, thus preventing the split-brain problem after the backup center is promoted to the primary center. On the other hand, it ensures that the primary center 20 and the backup center 30 can communicate to maintain state synchronization before the failure, guaranteeing the normal use of the backup center 30 after it becomes the new primary center.

[0062] Furthermore, the transaction processing of the original primary center 20 is only stopped when the above conditions are met. This avoids the situation where the transaction processing of the original primary center 20 is stopped even if the communication between the arbitrator 10 and the backup center 30 is disconnected, preventing the backup center 30 from being promoted to the new primary center, thus avoiding a situation where the database system has no primary center available. Therefore, being able to handle various types of database system faults in a compliant manner helps reduce problems that arise during database system fault handling.

[0063] In this embodiment, the state set further includes data difference states between the primary center 20 and the backup center 30. These data difference states include identical and dissimilar states. An identical state indicates that the data of the primary center 20 and the backup center 30 is the same, while a dissimilar state indicates that the data of the primary center 20 and the backup center 30 is different. The second preset state at least includes the data difference state between the primary center 20 and the backup center 30 being identical.

[0064] Specifically, values ​​are used to represent these states. For example, 0 represents the same state as normal, and 1 represents a different state. Therefore, [0, 0, 0, 0] represents the communication state between arbitrator 10 and main center 20 as normal, the communication state between arbitrator 10 and backup center 30 as normal, the communication state between main center 20 and backup center 30 as normal, and the data difference state between main center 20 and backup center 30 as the same state.

[0065] Therefore, the second preset state includes normal communication between arbitrator 10 and main center 20, normal communication between arbitrator 10 and backup center 30, normal communication between main center 20 and backup center 30, and the same data difference status between main center 20 and backup center 30. That is, [0, 0, 0, 0]. Alternatively, the second preset state includes disconnected communication between arbitrator 10 and main center 20, normal communication between arbitrator 10 and backup center 30, normal communication between main center 20 and backup center 30, and the same data difference status between main center 20 and backup center 30. That is, [1, 0, 0, 0].

[0066] The method of this embodiment will now be described with reference to schematic diagrams of various scenarios:

[0067] Reference Figure 4 As shown, when the primary database center 20 itself malfunctions, the database system transitions from a state where the communication status between the arbitrator 10 and the primary database center 20 is normal, the communication status between the arbitrator 10 and the backup database center 30 is normal, the communication status between the primary database center 20 and the backup database center 30 is normal, and the data difference status between the primary database center 20 and the backup database center 30 is the same, to a state where the communication status between the arbitrator 10 and the primary database center 20 is abnormal, the communication status between the arbitrator 10 and the backup database center 30 is normal, the communication status between the primary database center 20 and the backup database center 30 is abnormal, and the data difference status between the primary database center 20 and the backup database center 30 is different.

[0068] In other words, the reference state set [0, 0, 0, 0] conforms to the second preset state, and the collected fault set [1, 0, 1, 1] conforms to the first preset state. Therefore, the backup center 30 is promoted to the new primary center and the transaction processing of the original primary center 20 is stopped (because the original primary center 20 has encountered problems and cannot be used, which can be regarded as stopping transaction processing), which meets the processing requirements.

[0069] Reference Figure 5As shown, when the primary database center 20 itself is not faulty, but the communication between the primary database center 20, the arbitrator 10, and the backup database center 30 fails, the database system transitions from a state where the communication between the arbitrator 10 and the primary database center 20 is normal, the communication between the arbitrator 10 and the backup database center 30 is normal, the communication between the primary database center 20 and the backup database center 30 is normal, and the data difference between the primary database center 20 and the backup database center 30 is the same, to a state where the communication between the arbitrator 10 and the primary database center 20 is abnormal, the communication between the arbitrator 10 and the backup database center 30 is normal, the communication between the primary database center 20 and the backup database center 30 is abnormal, and the data difference between the primary database center 20 and the backup database center 30 is different.

[0070] In other words, the reference state set [0, 0, 0, 0] conforms to the second preset state, and the collected fault set [1, 0, 1, 1] conforms to the first preset state. Therefore, promoting the backup center 30 to the new primary center and stopping the transaction processing of the original primary center 20 meets the processing requirements.

[0071] Reference Figure 6 As shown, when the primary database center 20 itself is functioning correctly, communication between the primary center 20 and the arbitrator 10 first fails, followed by a communication failure between the primary center 20 and the backup center 30. The database system transitions from a state where communication between the arbitrator 10 and the primary center 20 is abnormal, communication between the arbitrator 10 and the backup center 30 is normal, communication between the primary center 20 and the backup center 30 is normal, and the data differences between the primary center 20 and the backup center 30 are the same, to a state where communication between the arbitrator 10 and the primary center 20 is abnormal, communication between the arbitrator 10 and the backup center 30 is normal, communication between the primary center 20 and the backup center 30 is abnormal, and the data differences between the primary center 20 and the backup center 30 are different.

[0072] In other words, the reference state set [1, 0, 0, 0] conforms to the second preset state, and the collected fault set [1, 0, 1, 1] conforms to the first preset state. Therefore, promoting the backup center 30 to the new primary center and stopping the transaction processing of the original primary center 20 meets the processing requirements.

[0073] Reference Figure 7As shown, when the communication between the arbitrator 10 and the backup center 30 of the database system fails first, followed by a failure in the communication between the primary center 20 and the arbitrator 10, and then a failure in the communication between the primary center 20 and the backup center 30, the database system transitions from a state where the communication between the arbitrator 10 and the primary center 20 is normal, the communication between the arbitrator 10 and the backup center 30 is abnormal, the communication between the primary center 20 and the backup center 30 is normal, and the data difference status between the primary center 20 and the backup center 30 is the same, to a state where the communication between the arbitrator 10 and the primary center 20 is abnormal, the communication between the arbitrator 10 and the backup center 30 is abnormal, the communication between the primary center 20 and the backup center 30 is abnormal, and the data difference status between the primary center 20 and the backup center 30 is different.

[0074] In other words, the reference state set [0, 1, 0, 0] does not conform to the second preset state, and the collected fault set [1, 1, 1, 1] does not conform to the first preset state. Therefore, the operations of promoting the backup center 30 to the new primary center and stopping the transaction processing of the original primary center 20 are not executed. That is, the current mode is maintained, and transaction processing continues with the primary center 20.

[0075] Reference Figure 1 As shown, in one embodiment, the step of adjusting the operating mode of the database system according to the reference state set includes: determining whether the reference state set matches a third preset state, the third preset state including at least the communication state between the arbitrator 10 and the backup center 30 being disconnected; if the reference state set matches the third preset state, maintaining the transaction processing work of the main center 20.

[0076] In other words, a reference state set is obtained whenever the collected state set shows that the communication between Arbitrator 10 and the main center 20 is disconnected, as well as the communication between the main center 20 and the backup center 30 is disconnected. If the reference state set includes a disconnected communication between Arbitrator 10 and the backup center 30, then the transaction processing of the main center 20 is maintained, i.e., the current operating mode is maintained.

[0077] If the reference state set does not include the communication status between arbitrator 10 and backup center 30 as disconnected, then backup center 30 is promoted to the new primary center and the transaction processing of the original primary center 20 is stopped. That is, if the reference state set does not match the third preset state, backup center 30 is promoted to the new primary center and the transaction processing of the original primary center 20 is stopped.

[0078] This embodiment also provides a machine-readable storage medium and a computer device. Figure 8 This is a schematic diagram of a machine-readable storage medium 100 according to an embodiment of the present invention. Figure 9This is a schematic diagram of a computer device 200 according to an embodiment of the present invention.

[0079] The machine-readable storage medium 100 stores a machine-executable program 110 thereon, which, when executed by a processor, implements the operation method of the database system of any of the above embodiments.

[0080] Computer device 200 may include memory 210, processor 220 and machine-executable program 110 stored on memory 210 and running on processor 220, and processor 220 implements the database system operation method of any of the above embodiments when executing machine-executable program 110.

[0081] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any machine-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-based system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0082] For the purposes of this embodiment, the machine-readable storage medium 100 can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection (electronic device) having one or more wires, a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, the machine-readable storage medium 100 can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0083] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.

[0084] Computer device 200 can be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, computer device 200 can be a cloud computing node. Computer device 200 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types. Computer device 200 can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked via a communication network. In a distributed cloud computing environment, program modules can reside on local or remote computing system storage media, including storage devices.

[0085] Computer device 200 may include a processor 220 adapted to execute stored instructions and a memory 210 that provides temporary storage space for the operation of said instructions during operation. The processor 220 may be a single-core processor, a multi-core processor, a computing cluster, or any other configuration. The memory 210 may include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.

[0086] The processor 220 can be connected via a system interconnect (e.g., PCI, PCI-Express, etc.) to an I / O interface (input / output interface) suitable for connecting the computer device 200 to one or more I / O devices (input / output devices). I / O devices may include, for example, a keyboard and indicating devices, where indicating devices may include a touchpad or touchscreen, etc. I / O devices may be built into the computer device 200 or may be external devices connected to the computing device.

[0087] The processor 220 may also be linked via a system interconnect to a display interface suitable for connecting the computer device 200 to a display device. The display device may include a display screen as a built-in component of the computer device 200. The display device may also include an external computer monitor, television, or projector connected to the computer device 200. Furthermore, a network interface controller (NIC) may be adapted to connect the computer device 200 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an Internet Minicomputer System Interface) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. Remote devices may connect to the computing device via the network.

[0088] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.

[0089] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.

Claims

1. A method for operating a database system, the database system comprising an arbitrator, a primary center, and a backup center, the method comprising: The database system's status set is collected according to a preset period. The status set includes the communication status between the arbitrator and the main center, the communication status between the arbitrator and the backup center, and the communication status between the main center and the backup center at the time of collection. Determine whether the set of states matches a first preset state, wherein the first preset state includes at least the communication state between the arbitrator and the main center being disconnected and the communication state between the main center and the backup center being disconnected; If the state set matches the first preset state, obtain the state set collected at the previous collection time and record it as the reference state set; The operating mode of the database system is adjusted according to the reference state set; The step of adjusting the operating mode of the database system according to the reference state set includes: If the first preset state also includes a normal communication status between the arbitrator and the backup center, determine whether the reference state set matches the second preset state. The second preset state includes a normal communication status between the arbitrator and the main center, a normal communication status between the arbitrator and the backup center, and a normal communication status between the main center and the backup center; or a disconnected communication status between the arbitrator and the main center, a normal communication status between the arbitrator and the backup center, and a normal communication status between the main center and the backup center. If the reference state set matches the second preset state, the backup center is promoted to the primary center; Stop the original main center's transaction processing work.

2. The method for operating the database system according to claim 1, wherein, The step of determining whether the set of states matches the first preset state is followed by: If the set of states does not match the first preset state, the current operating mode of the current database system is maintained.

3. The method for operating the database system according to claim 1, wherein, The state set also includes data difference states between the primary center and the backup center. The data difference states include same state and different state. Same state means that the data of the primary center and the backup center are the same, and different state means that the data of the primary center and the backup center are different. The second preset state includes at least the state where the data difference between the main center and the backup center is the same.

4. The method for operating the database system according to claim 1, wherein, The step of adjusting the operating mode of the database system according to the reference state set includes: Determine whether the reference state set matches a third preset state, wherein the third preset state includes at least one condition: the communication between the arbitrator and the backup center is disconnected. If the reference state set matches the third preset state, the transaction processing work of the main center continues.

5. A machine-readable storage medium having a machine-executable program stored thereon, wherein the machine-executable program, when executed by a processor, implements the method of operating the database system according to any one of claims 1 to 4.

6. A computer device comprising a memory, a processor, and a machine-executable program stored in the memory and running on the processor, wherein the processor, when executing the machine-executable program, implements a method for operating a database system according to any one of claims 1 to 4.