A cluster construction method for real-time transaction database system

By adopting a cluster construction method consisting of a master node replication module, a monitoring module, and a Sentinel node selection module in a real-time transaction database system, the problem of data loss caused by master node downtime is solved, the continuity of data transmission and the fairness of transactions are achieved, and the fault tolerance of the system is enhanced.

CN115883418BActive Publication Date: 2025-09-23BEIJING NATURAL CONSTANT COMPUTER SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211487543.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-09-23
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

The existing cluster-based real-time transaction database system is prone to data transmission loss when the master node goes offline.

Method used

A cluster construction method is adopted, which includes a master node replication module, a master node monitoring module, a Sentinel node selection module, and a time domain supervision module. By replicating the master node port path information, setting up slave node backup, and monitoring the master node connection status in real time, the system switches to the Sentinel node when the master node fails to synchronize data and calculate time differences, thus ensuring the continuity of data transmission.

Benefits of technology

It improves the fault tolerance of the real-time transaction database system, prevents data loss, ensures the timeliness and fairness of data transmission, and enhances the practicality of the system and the fairness of data transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883418B_ABST
    Figure CN115883418B_ABST
Patent Text Reader

Abstract

The present invention provides a cluster construction method for a real-time transaction database system, and relates to the technical field of database system construction. The cluster construction method for a real-time transaction database system includes the following specific cluster construction steps: S1. Setting the data transmission port of the transaction database as a master node; S2. Using the Redis cluster method to copy the master node port path information; S3. Real-time monitoring of the master node connection port, while implementing information protection for the master node connection port; S4. Copying the backup node to obtain the Sentinel node, and synchronizing the data between the master node and the Sentinel node; S5. Slave node matching monitoring: matching and connecting the data transmission ports of multiple slave nodes and multiple transaction terminals. By setting a Sentinel node selection module, when the master node access data traffic exceeds the limit, the transaction data can be synchronized, thereby improving the practicality of the real-time transaction database system and preventing the host cloud from crashing and disconnecting in a crowded state or an emergency state of the access server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database system construction, and in particular to a cluster construction method for a real-time transaction database system. Background Art

[0002] The transaction database system is an advanced transaction system in the current stage of computer data economy. It is a new way of conducting data transactions based on networked databases. Generally, in order to ensure the fairness and openness of transactions, online real-time transaction database systems are generally used for data economic transactions.

[0003] There are two types of existing transaction databases. One is to implement one-to-one data economic transaction services through a single data channel, and the other is to implement real-time economic transactions of internal database data through cluster construction. However, most cluster-built real-time transaction database systems use node replication to implement one-to-many data economic transactions. When the master node goes offline, data transmission loss is often prone to occur. Summary of the Invention

[0004] (1) Technical problems solved

[0005] In view of the fact that most of the existing cluster-based real-time transaction database systems use node replication to achieve one-to-many data economic transactions, data transmission loss is often prone to occur when the master node is offline. The present invention provides a cluster construction method for a real-time transaction database system, which solves the problem of data transmission loss in existing transaction databases when the host cloud is offline due to access server congestion or emergency status.

[0006] (2) Technical solution

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: A cluster construction method for a real-time transaction database system, comprising the following specific cluster construction steps:

[0008] S1. Database port master node access: Set the transaction database data transmission port to the master node and set the master node tag to the master node character label;

[0009] S2. Copy from the slave node: Copy the port path information of the master node, set up multiple slave nodes, set the label to the slave node character label-digit number format, and then select any node from the slave node for backup storage;

[0010] S3. Master node matching monitoring: Real-time monitoring of the master node connection port and information protection of the master node connection port;

[0011] S4. Sentinel node replication selection: Replicate the backup node to obtain the Sentinel node, and synchronize data between the primary node and the Sentinel node;

[0012] S5. Slave node matching monitoring: Match the data transmission ports of multiple slave nodes and multiple transaction terminals according to the master node character label, so as to perform data transaction transmission processing of the transaction database.

[0013] Preferably, the cluster construction step is implemented by a cluster construction system, which includes a master node replication module, a master node monitoring module, a Sentinel node selection module and a time domain supervision module, and is interactively connected through external data nodes, wherein:

[0014] The master node replication module is used to replicate the master node port path information to obtain multiple slave nodes, then select the master node and the database port to establish a data communication channel, and simultaneously back up and store any of the slave nodes in the transaction database;

[0015] The master node monitoring module is used to monitor the connection status between nodes and ports, synchronize node connection information, and perform security protection processing on them;

[0016] The Sentinel node selection module is used to copy the backup node to obtain the Sentinel node, and then replace the obtained Sentinel node with the master node port matching, and simultaneously synchronize the data and time data of the Sentinel node;

[0017] The time domain supervision module is used to calculate the time difference between nodes and perform time domain synchronization of node ports.

[0018] Preferably, the master node replication module internally includes a port node replication unit, a primary node selection unit, and a node backup storage unit, wherein:

[0019] Port node replication unit: used to record and count the port path information of the replicated master node, and use the replicated port path information of the master node to establish a backup node;

[0020] Main node selection unit: used to select the main node and mark the corresponding backup node;

[0021] Node backup storage unit: used to back up and store the selected backup node in the transaction database.

[0022] Preferably, the master node monitoring module includes a node connection status monitoring unit, a security protection unit and an information synchronization unit, wherein:

[0023] Node connection status monitoring unit: used to monitor the data connection status between nodes, including offline status, congestion status, and normal status. When the master node is in a congested state, it controls the Sentinel node selection module to switch the server access node.

[0024] Security protection unit: used to provide data security protection for the data connection channels between port nodes in congested and normal states, and filter virus information in data exchanges;

[0025] Information synchronization unit: used to synchronize and record data between port nodes in the cloud.

[0026] Preferably, the Sentinel node selection module includes a node replication acquisition unit, a time data matching unit, a port data matching unit, and a node secondary backup unit, wherein:

[0027] Node replication unit: used to replicate the backup node to obtain the Sentinel node;

[0028] Time data matching unit: used to connect the Sentinel node to the original master node offline time data;

[0029] Port data matching unit: used to match the Sentinel node to the slave node originally connected to the master node to continue data transmission;

[0030] Node secondary backup unit: used to create a backup of the obtained Sentinel node, obtain the secondary backup node, and store the secondary backup node in the transaction database.

[0031] Preferably, the time domain supervision module includes a time synchronization unit, a time statistics unit, and a time domain difference reduction unit, wherein:

[0032] Time synchronization unit, used to synchronize the time data of Sentinel nodes with the time data of offline master nodes;

[0033] The time statistics unit is used to record the time data of the offline master node and the time data of the reconnected Sentinel node;

[0034] The time domain difference reduction unit is used to reduce the time data of the reconnected Sentinel node based on the time data recorded by the slave node, and cooperates with the master node monitoring module to increase or decrease the transaction data volume information based on the data volume.

[0035] Preferably, the transaction database in step S1 is set up on an Internet cloud platform, and the transaction database internally includes a data distribution temporary storage module, a transaction data storage module, a data transmission module, a node control operation module, and a node backup storage module, wherein:

[0036] Data distribution temporary storage module: used to temporarily store the transmitted database transaction data and perform data retention transaction processing according to the distributed temporary storage method;

[0037] Transaction data storage module: used to extract the data to be traded in the transaction database and perform real-time record backup;

[0038] Data transmission module: used for data transmission between the transaction terminal and the transaction database;

[0039] Node control operation module: used to control data transmission and transaction database data extraction using node access information;

[0040] Node backup storage module: used to back up storage port nodes, including master nodes, slave nodes, backup nodes and secondary backup nodes.

[0041] Preferably, the specific operating steps of the distributed temporary storage method in the data distribution temporary storage module are: analyzing the amount of transaction data proposed by the master node and the slave node, controlling the transaction data of the master node and the slave node to be retained in the data distribution temporary storage module in the form of a percentage, and when the transaction data amount of the master node and the slave node in the data distribution temporary storage module reaches 10%, controlling the flow of transaction data of the master node and the slave node, and repeating the previous data retention operation until the data transaction between the master node and the slave node is completely completed.

[0042] (3) Beneficial effects

[0043] The present invention provides a cluster construction method for a real-time transaction database system.

[0044] Beneficial effects:

[0045] 1. The present invention can achieve read-write separation by replicating the master node port path information in the real-time transaction database system. The master node replication module and the master node monitoring module can automatically replicate the master node data to the slave node, sharing the pressure of the master node and realizing the master node monitoring function. At the same time, the time domain supervision module can enable the real-time transaction database system to have a fault-tolerant function during use. At the same time, due to the provision of the Sentinel node selection module and the node connection status monitoring unit, when the master node is in a congested state, the Sentinel node selection module can be promptly controlled to switch the server access node. The backup node is used to establish the Sentinel node as the next master node, thereby synchronizing transaction data, thereby improving the practicality of the real-time transaction database system and preventing the host cloud from crashing and disconnecting in the access server congestion or emergency state.

[0046] 2. The present invention provides a time domain supervision module that cooperates with the information synchronization unit of the master node monitoring module and the time data matching unit of the Sentinel node selection module to facilitate the synchronization of the time data of the Sentinel node and the time data of the offline master node. It also cooperates with the master node monitoring module to increase or decrease the transaction data volume information according to the data volume, preventing the transaction data of the transaction node from overflowing in the data distribution temporary storage module of the transaction database, avoiding the mismatch of the data flow retained in the data distribution temporary storage module, and improving the timeliness of the transaction database system and the fairness of data information transactions.

[0047] 3. The present invention can improve the system fault tolerance by allowing the data stored in the database system to be transmitted through the data distribution temporary storage module, and using the node control operation module to control the transaction data storage module and the data transmission module to extract and store data. In conjunction with the Redsi-Sentinel cluster construction system for system cluster construction of real-time transaction database, it can prevent transaction data from being lost due to the main node being offline during transportation, thereby improving the fairness and justice of data information transactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flow chart of the construction system of the present invention;

[0049] Figure 2 This is a system diagram of the time domain supervision module of the present invention;

[0050] Figure 3 This is a diagram of the master node replication module system of the present invention;

[0051] Figure 4 This is a system diagram of the master node monitoring module of the present invention;

[0052] Figure 5Select module system diagram for Sentinel node of the present invention;

[0053] Figure 6 This is a diagram of the database transmission transaction structure system of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only 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 making creative efforts are within the scope of protection of the present invention.

[0055] Example:

[0056] An embodiment of the present invention provides a cluster construction method for a real-time transaction database system, comprising the following specific cluster construction steps:

[0057] S1. Database port master node access: Set the transaction database data transmission port to the master node and set the master node tag to the master node character label;

[0058] S2. Slave node replication: Use the Redis cluster method to replicate the master node's port path information. Set up multiple slave nodes to achieve read-write separation. Set the label to the slave node character label-number format, and then select any slave node for backup storage.

[0059] S3. Master node matching monitoring: Real-time monitoring of the master node connection port and information protection of the master node connection port;

[0060] S4. Sentinel node replication selection: The backup node is replicated to obtain the Sentinel node, and data is synchronized between the master node and the Sentinel node. The Sentinel node obtained based on the Redis cluster has the function of real-time monitoring the Redis master node server and can take over the node when the master node server encounters an abnormality;

[0061] S5. Slave node matching monitoring: Match the data transmission ports of multiple slave nodes and multiple transaction terminals according to the master node character label, so as to perform data transaction transmission processing of the transaction database.

[0062] The cluster construction step implements the Sentinel cluster construction system through Redis. The cluster construction system includes the master node replication module, the master node monitoring module, the Sentinel node selection module, and the time domain supervision module. They are connected through external data nodes. The interaction mode is information interaction based on the WebService protocol. The master node replication module, the master node monitoring module, the Sentinel node selection module, and the time domain supervision module all implement the interaction between the node module and the database by calling control commit. Among them:

[0063] The master node replication module is used to replicate the master node port path information to obtain multiple slave nodes, then select the master node and the database port to establish a data communication channel, and simultaneously back up and store any of the slave nodes in the transaction database;

[0064] The master node monitoring module is used to monitor the connection status between nodes and ports, synchronize node connection information, and perform security protection. The master node replication module and the master node monitoring module can automatically copy the master node's data to the slave node, sharing the pressure of the master node and also realizing the master node monitoring function.

[0065] The Sentinel node selection module is used to copy the backup node to obtain the Sentinel node, and then replace the obtained Sentinel node with the master node port. It also synchronizes the data and time data of the Sentinel node. When the master node goes offline or receives a node congestion signal, the system will use the backup node to establish a Sentinel node as the next master node, thereby synchronizing transaction data. This improves the practicality of the real-time transaction database system and prevents the host cloud from being disconnected due to access server congestion or emergency conditions.

[0066] The time domain supervision module is used to calculate and process the time differences between nodes and perform time domain synchronization processing of node ports. It can also enable the real-time transaction database system to have fault tolerance during use.

[0067] The master node replication module includes a port node replication unit, a primary node selection unit, and a node backup storage unit, among which:

[0068] Port node replication unit: used to record and count the port path information of the replicated master node, and use the replicated port path information of the master node to establish a backup node;

[0069] Main node selection unit: used to select the main node and mark the corresponding backup node;

[0070] Node backup storage unit: used to back up and store the selected backup node in the transaction database.

[0071] The master node monitoring module includes a node connection status monitoring unit, a security protection unit, and an information synchronization unit.

[0072] Node connection status monitoring unit: used to monitor the data connection status between nodes, including offline status, congestion status, and normal status. When the data flow exceeds 70% of the maximum throughput of the server master node, it is determined to be in a master node congestion state. When the master node is in a congested state, it controls the connection Sentinel node selection module to switch the server access node;

[0073] Security protection unit: used to provide data security protection for the data connection channels between port nodes in congested and normal states, and filter virus information in data exchanges;

[0074] Information synchronization unit: used to synchronize and record data between port nodes in the cloud, and can also use the cloud Internet to back up and store database transaction records.

[0075] The Sentinel node selection module includes a node replication acquisition unit, a time data matching unit, a port data matching unit, and a node secondary backup unit.

[0076] Node replication unit: used to replicate the backup node to obtain the Sentinel node;

[0077] Time data matching unit: used to connect the Sentinel node to the original master node offline time data;

[0078] Port data matching unit: used to match the Sentinel node to the slave node originally connected to the master node to continue data transmission;

[0079] Node secondary backup unit: used to create a backup of the obtained Sentinel node, obtain the secondary backup node, and store the secondary backup node in the transaction database.

[0080] The time domain monitoring module includes a time synchronization unit, a time statistics unit, and a time domain difference reduction unit.

[0081] Time synchronization unit, used to synchronize the time data of Sentinel nodes with the time data of offline master nodes;

[0082] The time statistics unit is used to record the time data of the offline master node and the time data of the reconnected Sentinel node;

[0083] The time domain difference reduction unit is used to reduce the time data of the reconnected Sentinel node based on the time data recorded by the slave node, and cooperates with the master node monitoring module to increase or decrease the transaction data volume information based on the data volume.

[0084] By setting up the time domain supervision module, cooperating with the information synchronization unit of the master node monitoring module and the time data matching unit of the Sentinel node selection module, it is convenient to synchronize the time data of the Sentinel node and the time data of the offline master node, and cooperating with the master node monitoring module to increase or decrease the transaction data volume information according to the data volume, preventing the transaction data of the transaction node from overflowing during the transaction process of the transaction database, avoiding the mismatch of data flow retained during the transaction process, and improving the timeliness of the transaction database system and the fairness of data information transactions.

[0085] In step S1, the transaction database is set up on the Internet cloud platform, and the transaction database includes a data distribution temporary storage module, a transaction data storage module, a data transmission module, a node control operation module, and a node backup storage module, wherein:

[0086] Data distribution temporary storage module: used to temporarily store the transmitted database transaction data and perform data retention transaction processing according to the distributed temporary storage method. By allowing the internal storage data of the database system to be transmitted through the data distribution temporary storage module, and using the node control operation module to control the transaction data storage module and the data transmission module to extract and store data, it can improve the system fault tolerance. In conjunction with the Redsi-Sentinel cluster construction system for the system cluster construction of the real-time transaction database, it can prevent the loss of transaction data due to the disconnection of the main node during the transportation process, thereby improving the fairness and justice of data information transactions.

[0087] Transaction data storage module: used to extract the data to be traded in the transaction database and perform real-time record backup;

[0088] Data transmission module: used for data transmission between the transaction terminal and the transaction database;

[0089] Node control operation module: used to control data transmission and transaction database data extraction using node access information;

[0090] Node backup storage module: used to back up storage port nodes, including master nodes, slave nodes, backup nodes and secondary backup nodes.

[0091] The specific operating steps of the distributed temporary storage method in the data distribution temporary storage module are: analyzing the amount of transaction data proposed by the master node and the slave node, controlling the transaction data of the master node and the slave node to be retained in the data distribution temporary storage module in the form of a percentage; when the transaction data amount of the master node and the slave node in the data distribution temporary storage module reaches 10%, controlling the flow of transaction data of the master node and the slave node, and repeating the previous data retention operation until the data transaction between the master node and the slave node is completely completed.

[0092] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A cluster construction method for a real-time transaction database system, characterized by: The following specific cluster building steps are included: S1. Database port master node access: Set the transaction database data transmission port to the master node and set the master node tag to the master node character label; S2. Copy from the slave node: Copy the port path information of the master node, set up multiple slave nodes, set the label to the slave node character label-digit number format, and then select any node from the slave node for backup storage; S3. Master node matching monitoring: Real-time monitoring of the master node connection port and information protection of the master node connection port; S4. Sentinel node replication selection: Replicate the backup node to obtain the Sentinel node, and synchronize data between the primary node and the Sentinel node; S5. Slave node matching monitoring: Match the data transmission ports of multiple slave nodes and multiple transaction terminals according to the master node character label, so as to perform data transaction transmission processing of the transaction database.

2. The cluster construction method for a real-time transaction database system according to claim 1, characterized in that: The cluster construction step is implemented by a cluster construction system, which includes a master node replication module, a master node monitoring module, a Sentinel node selection module, and a time domain supervision module, and is interactively connected through external data nodes, wherein: The master node replication module is used to replicate the master node port path information to obtain multiple slave nodes, then select the master node and the database port to establish a data communication channel, and simultaneously back up and store any of the slave nodes in the transaction database; The master node monitoring module is used to monitor the connection status between nodes and ports, synchronize node connection information, and perform security protection processing on them; The Sentinel node selection module is used to copy the backup node to obtain the Sentinel node, and then replace the obtained Sentinel node with the master node port matching, and simultaneously synchronize the data and time data of the Sentinel node; The time domain supervision module is used to calculate the time difference between nodes and perform time domain synchronization of node ports.

3. The cluster construction method for a real-time transaction database system according to claim 2, characterized in that: The master node replication module includes a port node replication unit, a main node selection unit and a node backup storage unit, wherein: Port node replication unit: used to record and count the port path information of the replicated master node, and use the replicated port path information of the master node to establish a backup node; Main node selection unit: used to select the main node and mark the corresponding backup node; Node backup storage unit: used to back up and store the selected backup node in the transaction database.

4. The cluster construction method for a real-time transaction database system according to claim 2, characterized in that: The master node monitoring module includes a node connection status monitoring unit, a security protection unit, and an information synchronization unit, wherein: Node connection status monitoring unit: used to monitor the data connection status between nodes, including offline status, congestion status, and normal status. When the master node is in a congested state, it controls the Sentinel node selection module to switch the server access node. Security protection unit: used to provide data security protection for the data connection channels between port nodes in congested and normal states, and filter virus information in data exchanges; Information synchronization unit: used to synchronize and record data between port nodes in the cloud.

5. The cluster construction method for a real-time transaction database system according to claim 2, characterized in that: The Sentinel node selection module includes a node replication acquisition unit, a time data matching unit, a port data matching unit, and a node secondary backup unit, wherein: Node replication unit: used to replicate the backup node to obtain the Sentinel node; Time data matching unit: used to connect the Sentinel node to the original master node offline time data; Port data matching unit: used to match the Sentinel node to the slave node originally connected to the master node to continue data transmission; Node secondary backup unit: used to create a backup of the obtained Sentinel node, obtain the secondary backup node, and store the secondary backup node in the transaction database.

6. The cluster construction method for a real-time transaction database system according to claim 2, characterized in that: The time domain supervision module includes a time synchronization unit, a time statistics unit, and a time domain difference reduction unit, wherein: Time synchronization unit, used to synchronize the time data of Sentinel nodes with the time data of offline master nodes; The time statistics unit is used to record the time data of the offline master node and the time data of the reconnected Sentinel node; The time domain difference reduction unit is used to reduce the time data of the reconnected Sentinel node based on the time data recorded by the slave node, and cooperates with the master node monitoring module to increase or decrease the transaction data volume information based on the data volume.

7. The cluster construction method for a real-time transaction database system according to claim 1, characterized in that: In step S1, the transaction database is set up on the Internet cloud platform, and the transaction database includes a data distribution temporary storage module, a transaction data storage module, a data transmission module, a node control operation module, and a node backup storage module, wherein: Data distribution temporary storage module: used to temporarily store the transmitted database transaction data and perform data retention transaction processing according to the distributed temporary storage method; Transaction data storage module: used to extract the data to be traded in the transaction database and perform real-time record backup; Data transmission module: used for data transmission between the transaction terminal and the transaction database; Node control operation module: used to control data transmission and transaction database data extraction using node access information; Node backup storage module: used to back up storage port nodes, including master nodes, slave nodes, backup nodes and secondary backup nodes.

8. The cluster construction method for a real-time transaction database system according to claim 7, characterized in that: The specific operating steps of the distributed temporary storage method in the data distribution temporary storage module are: analyzing the transaction data volume proposed by the master node and the slave node, controlling the transaction data of the master node and the slave node to be retained in the data distribution temporary storage module in the form of percentage; when the transaction data volume of the master node and the slave node in the data distribution temporary storage module reaches 10%, controlling the transaction data circulation of the master node and the slave node, and repeating the previous data retention operation until the data transaction between the master node and the slave node is completely completed.

Citation Information

Patent Citations

  • Node downtime repairing method and device, electronic equipment and readable storage medium

    CN111106947A

  • Database cluster data verification method and device, storage medium and electronic equipment

    CN115328931A