A method and apparatus for maintaining a GoldenDB database

By introducing an intelligent management mechanism for parsing nodes and storage nodes in the GoldenDB database, the problem of timely detection and switching when data nodes are abnormal is solved, improving the security of financial transactions and the reliability of data storage, and ensuring the continuity of transactions and the integrity of data.

CN116932640BActive Publication Date: 2026-01-02INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310612170.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2026-01-02
Estimated Expiration
2043-05-26

AI Technical Summary

Technical Problem

The existing GoldenDB database management system lacks intelligent maintenance functions, resulting in insufficient real-time performance, continuity, and security of financial transactions. In particular, it is difficult to detect and handle abnormal data nodes in a timely manner, which can easily lead to transaction delays and significant risks.

Method used

By introducing a parsing node to register master data node information in the GoldenDB database, and computing nodes periodically registering and distributing operation instructions, and performing formatted processing and storage of database operation records between the parsing node and storage node, combined with a preset time comparison mechanism, automatic switching and fault detection of the master data node are achieved, ensuring data consistency and security.

Benefits of technology

It enables intelligent management and maintenance of the GoldenDB database, improves the security of financial transactions, reduces the risks caused by data node failures, and ensures the continuity of transactions and the integrity of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932640B_ABST
    Figure CN116932640B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a GoldenDB database maintenance method and device, wherein a computing node receives an operation instruction of a front end, and distributes the operation instruction to a corresponding data shard; a master data node and a backup data node receive the operation instruction, and execute a database operation according to the operation instruction; a parsing node obtains a database operation record executed by the master data node and first information of the master data node, performs format processing on the database operation record, and sends the database operation record after the format processing to a storage node; the first information and second information are compared once every preset time; if the comparison result is not corresponding, the first information of the master data node registered in the parsing node is updated according to second information of the master data node registered by the computing node. The embodiment of the present specification can maintain the GoldenDB database, and improve the security of financial transactions.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification relate to the field of distributed databases, and in particular, to a GoldenDB database maintenance method and device. BACKGROUND

[0002] Under the background of digitalization and intelligentization transformation, the financial industry widely introduces GoldenDB databases to store core business application data. The real-time fluctuations of securities, foreign exchange, commodities and other financial product prices make the requirements of financial transactions on real-time and continuity higher and higher, which requires the production database relied on by financial exchanges to guarantee high availability.

[0003] The existing GoldenDB database management system lacks intelligent maintenance functions, which is not conducive to the real-time, continuity of financial transactions and the security of financial data storage. When the number of production data nodes is large, if a certain data node abnormally stops running, it is difficult to discover and dispose immediately without the assistance of intelligent tools and only relying on manual intervention, which will easily cause financial transaction delays, business interruption, major production events, and significant losses to customers, and huge market risks, operational risks, reputation risks and legal risks to enterprises.

[0004] Therefore, there is an urgent need for a GoldenDB database maintenance method that can maintain GoldenDB databases and improve the security of financial transactions. SUMMARY

[0005] The purpose of the embodiments of the present specification is to provide a GoldenDB database maintenance method, device, equipment, storage medium and product to maintain GoldenDB databases and improve the security of financial transactions.

[0006] To achieve the above purpose, on the one hand, the embodiments of the present specification provide a GoldenDB database maintenance method, the GoldenDB database includes a plurality of clusters, each cluster includes a plurality of computing nodes, each computing node is connected with a master data node and a backup data node in a corresponding data shard; each cluster corresponds to an analysis node, all master data nodes in the cluster are connected with the analysis node, the first information of all master data nodes in the cluster is pre-registered in the analysis node, and the method comprises:

[0007] The computing node registers the second information of the master data node and the second information of the backup data node in the corresponding data shard once every set time;

[0008] The computing node receives an operation instruction from the front end, and distributes the operation instruction to the corresponding data shard;

[0009] The master data node and the backup data node in the data shard respectively receive the operation instruction, and perform corresponding database operations according to the operation instruction;

[0010] The analysis node obtains the database operation record performed by the master data node and the first information of the master data node, performs format processing on the database operation record, and sends the formatted database operation record to a storage node, which is used to backtrack the database operation record when the GoldenDB database fails;

[0011] The first information of the master data node obtained by the analysis node and the second information of the master data node registered by the computing node are compared every preset time to determine whether they correspond to each other;

[0012] If the comparison result is not corresponding, it is determined that the master data node is changed due to failure, and the first information of the master data node registered in the analysis node is updated according to the second information of the master data node registered by the computing node.

[0013] Preferably, the determination method of the preset time comprises:

[0014] The preset time is equal to the set time, and the first information of the master data node obtained by the analysis node and the second information of the same master data node registered in the computing node are compared every preset time;

[0015] If the comparison result of a certain master data node is not corresponding for a continuous set number of times, the preset time is equal to the set time;

[0016] If the comparison result of all obtained master data nodes is corresponding for a continuous set number of times, the preset time is a set multiple of the set time;

[0017] If the comparison result of all obtained master data nodes is random for a continuous set number of times, the preset time is determined according to the random comparison result.

[0018] Preferably, the determination method of the set multiple comprises:

[0019] The number of master data nodes in the comprehensive cluster and the set number are integrated to determine the set multiple.

[0020] Preferably, the determination of the set multiple according to the number of master data nodes in the comprehensive cluster and the set number further comprises:

[0021] A reference multiple is determined according to the set number;

[0022] determining whether the number of master data nodes in the cluster is greater than an average number, wherein the average number is an average of the number of master data nodes in a plurality of clusters;

[0023] if yes, reducing the reference multiple according to the excess number to obtain a set multiple;

[0024] if no, taking the reference multiple as the set multiple.

[0025] Preferably, the determining the preset time according to the random comparison result further comprises:

[0026] respectively calculating a corresponding number and a non-corresponding number in the random comparison result;

[0027] if the corresponding number is greater than the non-corresponding number, the preset time is at most twice the set time;

[0028] if the corresponding number is not greater than the non-corresponding number, the preset time is equal to the set time.

[0029] Preferably, the first information of the master data node comprises a name, a number, an address and a port number of the master data node.

[0030] The second information of the master data node comprises a name, a number, an address, a port number and an identification of the master data node.

[0031] Preferably, the comparing whether the first information of the master data node acquired by the parsing node and the second information of the master data node registered by the computing node correspond to each other once every preset time further comprises:

[0032] determining the same master data node acquired by the parsing node and registered by the computing node according to the name and / or the number;

[0033] comparing whether the address and the port number corresponding to the two master data nodes are consistent.

[0034] Preferably, the formatting the database operation record and sending the formatted database operation record to the storage node further comprises:

[0035] splicing the database operation record according to a corresponding message format rule;

[0036] sending the spliced database operation record to the message middleware for storage.

[0037] Preferably, the method further comprises:

[0038] When the master data node is changed due to failure, the corresponding standby data node is taken as a new master data node, and the computing node caches a database operation record performed by the new master data node;

[0039] When the first information of the registered master data node in the parsing node is updated, the computing node sends the cached content to the parsing node.

[0040] Preferably, after the computing node sends the cached content to the parsing node, the computing node further comprises:

[0041] The computing node empties the cached content and stops caching.

[0042] In another aspect, the embodiments of the present specification provide a GoldenDB database maintenance device, the GoldenDB database comprising a plurality of clusters, each cluster comprising a plurality of computing nodes, each computing node being connected with a master data node and a standby data node in a corresponding data shard; each cluster corresponds to a parsing node, all master data nodes in the cluster are connected with the parsing node, and the first information of all master data nodes in the cluster is registered in the parsing node in advance, and the device comprises:

[0043] The registration module is configured to register, by the computing node, the second information of the master data node and the second information of the standby data node in the corresponding data shard once every set time;

[0044] The distribution module is configured to receive, by the computing node, an operation instruction from a front end, and distribute the operation instruction to the corresponding data shard;

[0045] The operation module is configured to receive, by the master data node and the standby data node in the data shard, the operation instruction, and perform corresponding database operations according to the operation instruction;

[0046] The processing module is configured to acquire, by the parsing node, a database operation record performed by the master data node and the first information of the master data node, perform format processing on the database operation record, and send the format-processed database operation record to a storage node, the storage node being configured to backtrack the database operation record when the GoldenDB database fails;

[0047] The comparison module is configured to compare, once every preset time, whether the first information of the master data node acquired by the parsing node corresponds to the second information of the master data node registered by the computing node;

[0048] The change module is configured to, if the comparison result is not corresponding, determine that the master data node is changed due to failure, update the first information of the registered master data node in the parsing node according to the second information of the master data node registered by the computing node.

[0049] In another aspect, the embodiments of the present specification also provide a computer device, comprising a memory, a processor, and a computer program stored in the memory, when the computer program is run by the processor, instructions of the method in any of the above aspects are executed.

[0050] In another aspect, the embodiments of the present specification also provide a computer readable storage medium, having a computer program stored thereon, when the computer program is run by a processor of a computer device, instructions of the method in any of the above aspects are executed.

[0051] In another aspect, a computer program product, when the computer program product is run by a processor of a computer device, instructions of the method in any of the above aspects are executed.

[0052] As can be seen from the technical solutions provided by the embodiments of the present specification, through the method of the embodiments of the present specification, the database operation record executed by the primary data node registered in advance can be obtained by analyzing the node, and when the primary data node fails, the primary data node and the backup data node can be switched in the analysis node in time. After the switching, the backup data node may also fail, and the operation record of the database has been sent to the storage node by the analysis node, so that the operation record of the database can be traced back through the storage node. The intelligent management and maintenance of the GoldenDB database are realized, the security of the financial transaction is improved, and the risk is reduced.

[0053] In order to make the above and other objectives, features and advantages of the present specification more apparent and understandable, the following preferred embodiments are specifically described below, and the accompanying drawings are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present specification, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0055] Figure 1 A flowchart of a GoldenDB database maintenance method provided by the embodiments of the present specification is shown;

[0056] Figure 2 A flowchart of another GoldenDB database maintenance method provided by the embodiments of the present specification is shown;

[0057] Figure 3A flowchart of a method for determining a preset time according to an embodiment of the present specification is shown.

[0058] Figure 4 A flowchart of a method for determining a preset multiple according to an embodiment of the present specification is shown.

[0059] Figure 5 A flowchart of a method for determining a preset time according to an embodiment of the present specification is shown.

[0060] Figure 6 A flowchart of a method for determining whether the first information of the master data node obtained by the parsing node and the second information of the master data node registered by the computing node correspond to each other according to an embodiment of the present specification is shown.

[0061] Figure 7 A flowchart of a method for formatting the database operation record and sending the formatted database operation record to the storage node according to an embodiment of the present specification is shown.

[0062] Figure 8 A module structure diagram of a GoldenDB database maintenance device according to an embodiment of the present specification is shown.

[0063] Figure 9 A structure diagram of a computer device according to an embodiment of the present specification is shown.

[0064] Explanation of the drawings:

[0065] 100, a registration module;

[0066] 200, a distribution module;

[0067] 300, an operation module;

[0068] 400, a processing module;

[0069] 500, a comparison module;

[0070] 600, a change module;

[0071] 902, a computer device;

[0072] 904, a processor;

[0073] 906, a memory;

[0074] 908, a driving mechanism;

[0075] 910, an input / output module;

[0076] 912, an input device;

[0077] 914, output device;

[0078] 916, presentation device;

[0079] 918, graphical user interface;

[0080] 920, network interface;

[0081] 922, communication link;

[0082] 924, communication bus. DETAILED DESCRIPTION

[0083] The technical solutions in the embodiments of the present specification will be described clearly and completely in combination with the drawings in the embodiments of the present specification. Obviously, the described embodiments are only part of the embodiments of the present specification, not all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the embodiments of the present specification.

[0084] Under the background of digitalization and intelligentization transformation, the financial industry widely introduces GoldenDB database to store core business application data. The real-time fluctuation of securities, foreign exchange, commodity and other financial product prices makes the requirement of financial transactions on real-time and continuity higher and higher, which requires the production database relied on by financial exchanges to ensure high availability.

[0085] The existing GoldenDB database management system lacks intelligent maintenance function, which is not conducive to the real-time, continuity and security of financial data storage of financial transactions. When the number of production data nodes is large, if a certain data node abnormally stops running, it is difficult to discover and dispose immediately without the assistance of intelligent tools and only relying on manual intervention, which will easily cause financial transaction delay, business interruption, major production events, and cause significant losses to customers, and bring huge market risk, operation risk, reputation risk and legal risk to enterprises.

[0086] To solve the above problems, the embodiments of the present specification provide a GoldenDB database maintenance method. Figure 1 It is a flowchart of a GoldenDB database maintenance method provided by the embodiments of the present specification. The present specification provides method operation steps as described in the embodiments or flowchart, but more or fewer operation steps can be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one of the many execution orders, not the only execution order. In actual system or device product execution, the method order shown in the embodiments or drawings can be executed in sequence or in parallel.

[0087] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of the present specification and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, device, product, or apparatus that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatuses.

[0088] With reference to Figure 1 The embodiments of the present specification disclose a GoldenDB database maintenance method, the GoldenDB database includes a plurality of clusters, each cluster includes a plurality of computing nodes, each computing node is connected with a master data node and a backup data node in a corresponding data shard; each cluster corresponds to an analysis node, all master data nodes in the cluster are connected with the analysis node, the first information of all master data nodes in the cluster is pre-registered in the analysis node, and the method comprises:

[0089] S101: The computing node registers the second information of the master data node and the second information of the backup data node in the corresponding data shard once every set time;

[0090] S102: The computing node receives an operation instruction of the front end, and distributes the operation instruction to the corresponding data shard;

[0091] S103: The master data node and the backup data node in the data shard respectively receive the operation instruction, and execute corresponding database operations according to the operation instruction;

[0092] S104: The analysis node obtains a database operation record executed by the master data node and the first information of the master data node, formats the database operation record, and sends the formatted database operation record to a storage node, the storage node is used to backtrack the database operation record when the GoldenDB database fails;

[0093] S105: Compare the first information of the master data node obtained by the analysis node and the second information of the same master data node registered in the computing node once every preset time;

[0094] S106: If the comparison result is not corresponding, it is determined that the master data node is changed due to failure, and the first information of the master data node registered in the analysis node is updated according to the second information of the master data node registered by the computing node.

[0095] The GoldenDB database is a financial-level transactional distributed database, and the GoldenDB database includes multiple clusters. Each computing node in each cluster corresponds to a data shard of the distributed database. Each data shard includes a master data node and a backup data node. The master data nodes in each cluster are connected with an analysis node. The first information of the master data nodes is registered in the analysis node in advance. The first information of the master data nodes includes the name, number, address, and port number of the master data nodes. In addition, the computing node registers the second information of the master data nodes and the second information of the backup data nodes in the corresponding data shard once every set time. The second information of the master data nodes includes the name, number, address, port number, and identification of the master data nodes.

[0096] Compared with the first information, the second information has an identification. The identification is used to represent the master data node or the backup data node. For example, the identification "1" is used to represent the master data node, and the identification "0" is used to represent the backup data node, so as to distinguish the master data node and the backup data node.

[0097] After the computing node distributes the operation instruction of the front end to the corresponding data shard, the master data node and the backup data node in the data shard receive the operation instruction and perform the corresponding database operation. Since the analysis node only registers the first information of the master data node in advance, the analysis node only obtains the database operation record performed by the master data node. It should be noted that the database operation record refers to the operation on the database, such as deleting the A field in the database or adding the B field. Since the format of the data operation record is various, the data operation record needs to be formatted and sent to the storage node, which is used to trace back the database operation record when the GoldenDB database fails.

[0098] Since the master data node and the backup data node are provided, if the master data node fails, the backup data node is switched to, and the computing node switches the master data node and the backup data node, but at this time, the parsing node still acquires the database operation record of the master data node, and the parsing node also needs to be switched, so the first information of the master data node acquired by the parsing node and the second information of the same master data node registered in the computing node are compared once every preset time, if they do not correspond, that is, the master data node in the computing node is not the same as the master data node in the parsing node, the master data node is changed, at this time, since the master data node in the computing node is the changed master data node, according to the second information of the master data node registered in the computing node, the first information of the master data node registered in the parsing node can be updated to the same master data node in the computing node.

[0099] If the master data node and the backup data node both fail, at this time, the operation record of the database is recorded in the storage node, the operation record of the database can be found back by backtracking the data in the storage node, the operation record of the database stored in the storage node can be the record in the recent period of time, the record is cleared once every period of time, only the record in the recent period of time is reserved, or all records from the beginning of production use to now are stored in the storage node.

[0100] Referring to Figure 2 If all records from the beginning of production use to now are recorded in the storage node, the embodiment of the present specification further includes:

[0101] S201: When the master data node is changed due to failure, the corresponding backup data node is used as a new master data node, and the computing node caches the database operation record executed by the new master data node;

[0102] S202: After the first information of the master data node registered in the parsing node is updated, the computing node sends the cached content to the parsing node.

[0103] In order to prevent the parsing node from not updating the master data node in time after the master data node is changed, the database operation record executed by the new master data node can be cached in the computing node after the backup data node is used as the new master data node, and after the parsing node updates the master data node, the computing node sends the cached content to the parsing node, so as to ensure the integrity of the database operation record and prevent the record from being lost. Of course, after the computing node sends the cached content to the parsing node, the computing node can empty the cached content and stop caching to avoid redundant caching.

[0104] By the method of the embodiments of the present specification, the database operation record performed by the primary data node that is registered in advance can be obtained by the analysis node, and when the primary data node fails, the primary data node and the backup data node in the analysis node can be switched in time after the primary data node and the backup data node are switched. After the switching, the backup data node can also fail, and the database operation record in the backup data node has been sent to the storage node by the analysis node, so that the database operation record can be traced back by the storage node. Intelligent management and maintenance of the GoldenDB database are realized, the security of financial transactions is improved, and the risk is reduced.

[0105] In the embodiments of the present specification, with reference to Figure 3 , the determination method of the preset time comprises:

[0106] S301: the preset time is equal to the set time, and the first information of the primary data node obtained by the analysis node and the second information of the same primary data node registered in the computing node are compared once every preset time;

[0107] S302: if the comparison results of a certain primary data node for a continuous set number of times are all not corresponding, the preset time is equal to the set time;

[0108] S303: if the comparison results of all the obtained primary data nodes for a continuous set number of times are all corresponding, the preset time is a set multiple of the set time;

[0109] S304: if the comparison results of all the obtained primary data nodes for a continuous set number of times are random, the preset time is determined according to the random comparison results.

[0110] Generally, the computing node registers the second information of the primary data node and the second information of the backup data node in the corresponding data shard every set time, and if the primary data node is switched due to failure, the original primary data node is switched to a new backup data node, and the original backup data node is switched to a new primary data node, then the computing node will register the new primary data node and the new backup data node when registering. At this time, if the first information of the primary data node obtained by the analysis node and the second information of the primary data node registered by the computing node are compared once in time, the first information of the primary data node registered in the analysis node can be updated in time.

[0111] Therefore, under the premise that the initial registration of the computing node and the initial comparison of whether the first information of the primary data node obtained by the analysis node and the second information of the primary data node registered by the computing node correspond are the same, it is best to make the registration frequency of the computing node and the frequency of comparing whether they correspond the same, i.e. the preset time is equal to the set time, so that whether the primary data node is changed due to failure can be found in time.

[0112] The preset time is equal to the set time, and the first information of the master data node obtained by the analysis node and the second information of the same master data node registered in the computing node are compared once every preset time. Each cluster includes a plurality of master data nodes, and if the comparison result of a certain master data node is not corresponding for a continuous set number of times, it means that the master data node often fails to switch, so the preset time needs to be equal to the set time. If the comparison result of all the obtained master data nodes is corresponding for a continuous set number of times, it means that the master data node is not prone to failure, so the preset time can be correspondingly extended, and there is no need to be equal to the set time. The preset time extension can reduce the CPU running burden, and there is no need to perform frequent comparison. The specific extension can make the preset time be a set multiple of the set time. The set multiple is determined by comprehensively considering the number of master data nodes in the cluster and the set number.

[0113] In the embodiments of the present specification, reference is made to Figure 4 , the number of master data nodes in the cluster and the set number are further included in determining the set multiple.

[0114] S401: determining a reference multiple according to a set number;

[0115] S402: determining whether the number of master data nodes in the cluster is greater than an average number, wherein the average number refers to the average value of the number of master data nodes in a plurality of clusters;

[0116] S403: if yes, adjusting the reference multiple according to the exceeding number to obtain a set multiple;

[0117] S404: if no, the reference multiple is taken as the set multiple.

[0118] The set number refers to that the preset time is equal to the set time, and the first information of the master data node obtained by the analysis node and the second information of the same master data node registered in the computing node are compared once every preset time, and a total of continuous comparison is performed for the set number of times.

[0119] The reference multiple is determined according to the set number of times, and the reference multiple corresponds to the set number of times. If the set number of times is 2, the reference multiple is 2 times. If the set number of times is n, the reference multiple is n times. The average number of the number of master data nodes in the plurality of clusters is taken as the average number. If the number of master data nodes in the cluster is greater than the average number, that is, the number of master data nodes in the cluster is greater, for example, the average number is 5, and the number of master data nodes in the cluster is 7, the reference multiple is correspondingly reduced according to 2 master data nodes exceeding the average number, for example, the set multiple can be obtained by subtracting the exceeding number from the reference multiple, that is, n-2 is the set multiple. The reason for the reduction is that the set multiple is related to the extension of the preset time. If the number of master data nodes in the cluster is greater, it is more likely that a certain master data node fails. Therefore, the smaller the set multiple corresponding to the cluster with more master data nodes is, the shorter the extension of the preset time is, so as to find the failure of the master data node faster and improve the financial security. If the number of master data nodes in the cluster is not greater than the average number, that is, the number of master data nodes in the cluster is smaller, the reference multiple is taken as the set multiple.

[0120] If the comparison results of all the master data nodes obtained for the continuous set number of times are random, the comparison results are random, that is, there are comparison results corresponding to each master data node for the continuous set number of times, and there are comparison results not corresponding to each master data node for the continuous set number of times, but there is no comparison result of a certain master data node for the continuous set number of times, and there is no comparison result of all the master data nodes obtained for the continuous set number of times. At this time, the preset time needs to be determined according to the random comparison result.

[0121] In the embodiments of the present application, reference is made to Figure 5 , the preset time is further determined according to the random comparison result, and the method comprises the steps of:

[0122] S501: The number of comparison results corresponding to each master data node for the continuous set number of times is calculated, and the number of comparison results not corresponding to each master data node for the continuous set number of times is calculated.

[0123] S502: If the number of corresponding comparison results is greater than the number of non-corresponding comparison results, the preset time is at most twice the set time.

[0124] S503: If the number of corresponding comparison results is not greater than the number of non-corresponding comparison results, the preset time is equal to the set time.

[0125] If the number of corresponding comparison results is greater than the number of non-corresponding comparison results, that is, most of the comparison results are corresponding, so the preset time can be correspondingly extended for a period of time, but it is not suitable to be extended for too long, so the preset time can be twice the set time, or 1.5 times, or 2.5 times, etc. However, if the number of corresponding comparison results is not greater than the number of non-corresponding comparison results, that is, most of the comparison results are not corresponding, so the preset time needs to be equal to the set time.

[0126] In the embodiments of the present disclosure, the first information of the master data node comprises a name, a number, an address and a port number of the master data node.

[0127] The second information of the master data node comprises a name, a number, an address, a port number and an identifier of the master data node.

[0128] The second information further comprises an identifier of the master data node than the first information.

[0129] In the embodiments of the present disclosure, with reference to Figure 6 , the comparing, at a preset time interval, whether the first information of the master data node obtained by the parsing node and the second information of the master data node registered by the computing node correspond further comprises:

[0130] S601: determining, according to a name and / or a number, the same master data node obtained by the parsing node and registered by the computing node;

[0131] S602: comparing whether the address and the port number corresponding to the two master data nodes are consistent.

[0132] For example, the name of the master data node obtained by the parsing node is A node, according to the name of the A node, it is determined that the name of the master data node registered by the computing node is also the A node, and whether the address and the port number corresponding to the two A nodes are consistent is compared, if consistent, it is considered that the two A nodes are the same node, if not consistent, it is considered that the master data node is switched due to failure.

[0133] In the embodiments of the present disclosure, with reference to Figure 7 , the formatting processing of the database operation record and the sending of the formatted database operation record to the storage node further comprise:

[0134] S701: concatenating the database operation record according to a corresponding message format rule;

[0135] S702: sending the concatenated database operation record to the message middleware for storage.

[0136] According to the corresponding message format rule, the database operation record is concatenated into a message that can be recognized by the message middleware, the message middleware is a form of the storage node in the present disclosure, and of course, other storage media can also be used, which is not limited in the embodiments of the present disclosure.

[0137] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties. And the acquisition, storage, use, processing, etc. of the data in the technical solutions described in the embodiments of the present application comply with the relevant provisions of the national laws and regulations.

[0138] Based on the above-mentioned GoldenDB database maintenance method, the embodiments of the present application also correspondingly provide a GoldenDB database maintenance device. The device can include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiments of the present application, and a device combining necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided by the embodiments of the present application is as described in the following embodiments. Since the implementation scheme of the device to solve the problem is similar to the method, the implementation of the specific device in the embodiments of the present application can be referred to the implementation of the foregoing method, and the repeated parts will not be described herein. The term "unit" or "module" used below can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is conceived.

[0139] Specifically, Figure 8 is a module structure schematic diagram of one embodiment of a GoldenDB database maintenance device provided by the embodiments of the present application, referring to Figure 8 The GoldenDB database maintenance device provided by the embodiments of the present application includes a registration module 100, a distribution module 200, an operation module 300, a processing module 400, a comparison module 500, and a change module 600.

[0140] The GoldenDB database includes a plurality of clusters, each cluster including a plurality of computing nodes, each computing node being connected with a primary data node and a backup data node in a corresponding data shard; each cluster corresponds to an analysis node, all primary data nodes in the cluster are connected with the analysis node, and the analysis node has first information of all primary data nodes in the cluster registered in advance, and the device includes:

[0141] The registration module 100 is configured to register second information of the primary data node and second information of the backup data node in the corresponding data shard by the computing node every set time;

[0142] The distribution module 200 is configured to receive an operation instruction from the front end and distribute the operation instruction to the corresponding data shard by the computing node;

[0143] The operation module 300 is configured to receive the operation instruction by the master data node and the backup data node in the data fragment respectively, and perform a corresponding database operation according to the operation instruction.

[0144] The processing module 400 is configured to acquire the database operation record performed by the master data node and the first information of the master data node by the analysis node, perform format processing on the database operation record, and send the database operation record after the format processing to a storage node, where the storage node is configured to backtrack the operation record of the database when the GoldenDB database fails.

[0145] The comparison module 500 is configured to compare the first information of the master data node acquired by the analysis node and the second information of the master data node registered by the computing node every preset time.

[0146] The changing module 600 is configured to determine that the master data node is changed due to the failure if the comparison result is not corresponding, and update the first information of the master data node registered in the analysis node according to the second information of the master data node registered by the computing node.

[0147] Referring to Figure 9 According to the GoldenDB database maintenance method, the computer device 902 is provided in an embodiment of the present specification, and the method is run on the computer device 902. The computer device 902 can include one or more processors 904, such as one or more central processing units (CPUs) or graphics processing units (GPUs), each of which can implement one or more hardware threads. The computer device 902 can also include any memory 906 for storing any kind of information such as code, settings, data, etc. In a specific embodiment, the computer program stored on the memory 906 and executable on the processor 904 can execute the instructions according to the above method when the computer program is executed by the processor 904.

[0148] Without limitation, for example, the memory 906 can include any one or a combination of any type of RAM, any type of ROM, a flash memory device, a hard disk, an optical disk, etc. More generally, any of the memory can use any technology for storage of information. Further, any of the memory can provide volatile or nonvolatile retention of information. Further, any of the memory can represent a fixed or removable member of the computer device 902. In one case, the computer device 902 can perform any of the operations of the associated instructions stored in any memory or combination of memories when executed by the processor 904. The computer device 902 also includes one or more drive mechanisms 908 for interacting with any of the memory, such as a hard disk drive mechanism, an optical drive mechanism, etc.

[0149] The computer device 902 can also include an input / output module 910 (I / O) for receiving input (via input devices 912) and for providing output (via output devices 914). One particular output mechanism can include a presentation device 916 and an associated graphical user interface 918 (GUI). In other embodiments, the input / output module 910 (I / O), the input devices 912, and the output devices 914 can also not be included, merely as a computer device in a network. The computer device 902 can also include one or more network interfaces 920 for exchanging data with other devices via one or more communication links 922. One or more communication buses 924 couple the above-described components together.

[0150] The communication links 922 can be implemented in any manner, such as through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication links 922 can include any combination of hardwired links, wireless links, routers, gateway functionality, name servers, etc., governed by any protocol or combination of protocols.

[0151] Corresponding to the method in Figures 1-7 The embodiments of the present specification also provide a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to perform the steps of the above method.

[0152] The embodiments of the present specification also provide a computer readable instruction, and the program in the computer readable instruction makes the processor execute the method as shown in Figures 1 to 7 .

[0153] The embodiments of the present specification also provide a computer program product, and the computer program product is executed by the processor of the computer device to perform the method as shown in Figures 1 to 7 .

[0154] It should be understood that the size of the sequence number of each process described above in various embodiments of the present specification does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present specification.

[0155] It should also be understood that in the embodiments of the present specification, the term "and / or" is only a description of the association relationship of the associated objects, which means that there can be three relationships. For example, A and / or B can represent three cases of A alone, A and B together, and B alone. In addition, the character " / " in the embodiments of the present specification generally represents that the front and rear associated objects are in an "or" relationship.

[0156] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present specification can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been described in the above description. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of the present specification.

[0157] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0158] In several embodiments provided in the present specification, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displays or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can also be electrical, mechanical or other forms of connection.

[0159] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiments of the present specification.

[0160] In addition, each function unit in each embodiment of the present specification can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0161] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium.

[0162] Based on such understanding, the technical solutions of the embodiments of the present specification, essentially or in other words, the part of the prior art that contributes to the present specification, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present specification. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0163] In the present specification, the principles and implementation manners of the embodiments of the present specification are described by using specific embodiments. The above embodiment description is only used to help understand the method of the embodiments of the present specification and its core idea; at the same time, for those skilled in the art, according to the idea of the embodiments of the present specification, the specific implementation manner and application range will be changed; based on the above, the content of the present specification should not be understood as a limitation of the embodiments of the present specification.

Claims

1. A method for maintaining a GoldenDB database, characterized in that, The GoldenDB database comprises multiple clusters, each cluster containing multiple compute nodes. Each compute node is connected to the primary data node and backup data node in its corresponding data shard. Each cluster corresponds to a parser node, and all primary data nodes in the cluster are connected to the parser node. The parser node has pre-registered the first information of all primary data nodes in the cluster. The method includes: The computing node registers the second information of the primary data node and the second information of the backup data node in the corresponding data shard every set time interval; The computing node receives operation instructions from the front end and distributes the operation instructions to the corresponding data shards; The primary data node and backup data node in the data shard receive the operation instructions and execute corresponding database operations according to the operation instructions; The parsing node obtains the database operation records executed by the master data node and the first information of the master data node, formats the database operation records, and sends the formatted database operation records to the storage node. The storage node is used to backtrack the database operation records when the GoldenDB database fails. Every preset time interval, compare the first information of the master data node obtained by the parsing node with the second information of the master data node registered by the computing node to see if they correspond. If the comparison result is not a match, it is determined that the master data node has changed due to a fault. Based on the second information of the master data node registered by the computing node, the first information of the master data node already registered in the parsing node is updated.

2. The method for maintaining the GoldenDB database according to claim 1, characterized in that, The method for determining the preset time includes: Set the preset time to be equal to the set time, and compare the first information of the master data node obtained by the parsing node with the second information registered by the same master data node in the computing node every preset time. If a master data node fails to match any of the comparison results for a set number of consecutive times, then the preset time is equal to the set time. If the comparison results of all the master data nodes obtained are corresponding after a set number of consecutive times, then the preset time is a set multiple of the set time. If the comparison results of all the master data nodes obtained are random after a set number of consecutive comparisons, the preset time is determined based on the random comparison results.

3. The method for maintaining the GoldenDB database according to claim 2, characterized in that, The method for determining the set multiple includes: The set multiple is determined by considering the number of master data nodes in the cluster and the set number of times.

4. The method for maintaining the GoldenDB database according to claim 3, characterized in that, The determination of the set multiple, based on the number of master data nodes in the integrated cluster and the set number of times, further includes: The base multiple is determined based on the set number of attempts; Determine whether the number of master data nodes in the cluster is greater than the average number, where the average number refers to the average number of master data nodes in multiple clusters. If so, the base multiple is lowered according to the number exceeding the limit to obtain the set multiple; If not, then the reference multiple shall be used as the set multiple.

5. The method for maintaining the GoldenDB database according to claim 2, characterized in that, Determining the preset time based on the random comparison results further includes: Calculate the number of corresponding comparison results and the number of non-corresponding comparison results in the random comparison results respectively; If the corresponding number is greater than the non-corresponding number, then the preset time is at most twice the set time; If the corresponding number is not greater than the non-corresponding number, then the preset time is equal to the set time.

6. The method for maintaining the GoldenDB database according to claim 1, characterized in that, The first information of the master data node includes: the name, number, address, and port number of the master data node; The second information of the master data node includes: the master data node's name, number, address, port number, and identifier.

7. The method for maintaining the GoldenDB database according to claim 6, characterized in that, The step of comparing the first information of the master data node obtained by the parsing node and the second information of the master data node registered by the computing node at preset time intervals further includes: Based on the name and / or number, identify the same master data node that the parsing node obtains and that the compute node registers; Compare whether the addresses and port numbers corresponding to the two master data nodes are consistent.

8. The method for maintaining the GoldenDB database according to claim 1, characterized in that, The step of formatting the database operation records and sending the formatted database operation records to the storage node further includes: The database operation records are concatenated according to the corresponding message format rules; The concatenated database operation records are sent to the message middleware for storage.

9. The method for maintaining a GoldenDB database according to claim 1, characterized in that, Also includes: When the primary data node changes due to a failure, the corresponding backup data node is used as the new primary data node, and the computing node caches the database operation records performed by the new primary data node. Once the first information of the master data node registered in the parsing node is updated, the computing node will send the cached content to the parsing node.

10. The method for maintaining a GoldenDB database according to claim 9, characterized in that, After the computing node sends the cached content to the parsing node, it also includes: The computing node clears its cache contents and stops caching.

11. A maintenance device for a GoldenDB database, characterized in that, The GoldenDB database comprises multiple clusters, each cluster containing multiple compute nodes. Each compute node is connected to the primary data node and backup data node in its corresponding data shard. Each cluster corresponds to a parsing node, and all primary data nodes in the cluster are connected to the parsing node. The parsing node has pre-registered the first information of all primary data nodes in the cluster. The device includes: The registration module is used for the computing node to register the second information of the primary data node and the second information of the backup data node in the corresponding data shard once every set time interval; The distribution module is used for the computing node to receive operation instructions from the front end and distribute the operation instructions to the corresponding data shards; The operation module is used for the primary data node and the backup data node in the data shard to receive the operation instructions respectively and execute the corresponding database operations according to the operation instructions; The processing module is used by the parsing node to obtain the database operation records executed by the master data node and the first information of the master data node, to format the database operation records, and to send the formatted database operation records to the storage node. The storage node is used to backtrack the database operation records when the GoldenDB database fails. The comparison module is used to compare the first information of the master data node obtained by the parsing node and the second information of the master data node registered by the computing node at preset time intervals to see if they correspond. The change module is used to determine that the master data node has changed due to a fault if the comparison result is inconsistent, and to update the first information of the master data node registered in the parsing node according to the second information of the master data node registered by the computing node.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the computer program is run by the processor, it executes the instructions of the method according to any one of claims 1-10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor of the computer device, it executes the instructions of the method according to any one of claims 1-10.

14. A computer program product, characterized in that, When the computer program product is run by the processor of a computer device, it executes the instructions of the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Method and device for synchronizing databases of master network management system and standby network management system

    CN102081611A

  • Fault recovery method, apparatus and device for database node, and storage medium

    CN114297003A