Distributed database data recovery method and device, equipment and storage medium

By deploying database agents in distributed database clusters, automatically loading data backup files and log files, and achieving consistent data recovery, the problem of low data recovery efficiency in large-scale distributed clusters is solved, and recovery efficiency and accuracy are improved.

CN119782047APending Publication Date: 2025-04-08INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Large-scale distributed clusters are inefficient in data recovery, requiring multiple professional operation and maintenance personnel to recover, and finally recover to consistency and the efficiency is reduced.

Method used

By deploying database agents in distributed database clusters, management nodes issue storage plug-ins and data recovery tasks, the database agent loads data backup files and log files, and automatically performs data consistent recovery to avoid manual participation.

Benefits of technology

It improves the efficiency and accuracy of data recovery, reduces the need for manual operation and maintenance, and is suitable for large-scale distributed clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782047A_ABST
    Figure CN119782047A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed database data recovery method and device, equipment and a storage medium, and relates to the technical field of distributed and financial science and technology. The distributed database data recovery method comprises the steps that in response to a storage plug-in issued by a user, the storage plug-in is issued to a database agent in a target distributed database cluster, and the storage plug-in is used for indicating the database agent to load the storage plug-in; wherein the storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in comprises a data backup file and a log file; and in response to a data recovery task issued by a user, issuing the data recovery task to the database agent to indicate the database agent to perform data consistency recovery on the database node based on a recovery node in the data recovery task according to the data backup file and the log file in the loaded storage plug-in. According to the technical scheme, the data recovery efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed and financial technology, and in particular to a distributed database data recovery method, device, equipment and storage medium. Background Art

[0002] With the widespread application of database technology in various fields, in the process of database application, important data may be lost due to human error, malicious destruction, system instability or storage medium damage. Once data is lost or damaged, it will cause huge losses to enterprises and individuals, and data recovery is needed at this time.

[0003] Mainframes are expensive, and banks, operators and other industries are already replacing distributed databases with local ones. Most of the existing distributed databases are restored by restoring each node separately. After the recovery is completed, the binary log (binlog) is manually parsed to restore the data and ensure data consistency. In a distributed cluster, when the cluster scale is large, multiple professional operation and maintenance personnel are required to restore multiple database nodes, and the efficiency of restoring to consistency becomes increasingly low as the cluster scale increases. Summary of the invention

[0004] The present invention provides a distributed database data recovery method, device, equipment and storage medium to solve the problem of low efficiency of large-scale distributed cluster data recovery.

[0005] According to one aspect of the present invention, a distributed database data recovery method is provided, which is applied to a management node in a target distributed database cluster, wherein the target distributed database cluster includes a management node and at least two database nodes, each of which is deployed with a database agent, including:

[0006] In response to a user sending a storage plug-in, sending the storage plug-in to a database agent in a destination distributed database cluster to instruct the database agent to load the storage plug-in;

[0007] The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file;

[0008] In response to a user issuing a data recovery task, the data recovery task is issued to the database agent, which is used to instruct the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and according to the data backup files and log files in the loaded storage plug-in.

[0009] According to another aspect of the present invention, a distributed database data recovery method is provided, which is applied to a database agent configured by a database node in a target distributed database cluster, wherein the target distributed database cluster includes a management node and at least two database nodes, each of which is deployed with a database agent, including:

[0010] In response to the storage plug-in sent by the management node, loading the storage plug-in;

[0011] The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file;

[0012] In response to the data recovery task issued by the management node, the data consistency is restored to the recovery node set in the data recovery task according to the data backup files and log files in the loaded storage plug-in.

[0013] According to another aspect of the present invention, a distributed database data recovery device is provided, which is configured in a management node applied to a target distributed database cluster, wherein the target distributed database cluster includes a management node and at least two database nodes, each of which is deployed with a database agent, including:

[0014] A plug-in delivery module, configured to deliver the storage plug-in to a database agent in a target distributed database cluster in response to a user delivering the storage plug-in, and to instruct the database agent to load the storage plug-in;

[0015] The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file;

[0016] The task issuing module is used to respond to the user issuing a data recovery task and issue the data recovery task to the database agent, and is used to instruct the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and the data backup files and log files in the loaded storage plug-in.

[0017] According to another aspect of the present invention, a distributed database data recovery device is provided, which is configured in a database agent configured in a database node in a target distributed database cluster, wherein the target distributed database cluster includes a management node and at least two database nodes, each database node is deployed with a database agent, including:

[0018] A plug-in loading module, configured to load the storage plug-in in response to the storage plug-in sent by the management node;

[0019] The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file;

[0020] The data recovery module is used to respond to the data recovery task issued by the management node and restore the data consistency to the recovery node set in the data recovery task according to the data backup file and log file in the loaded storage plug-in.

[0021] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0022] at least one processor; and

[0023] a memory communicatively connected to the at least one processor; wherein,

[0024] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the distributed database data recovery method described in any embodiment of the present invention.

[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the distributed database data recovery method described in any embodiment of the present invention when executed.

[0026] According to another aspect of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the distributed database data recovery method of any embodiment of the present disclosure is implemented.

[0027] According to the technical solution of an embodiment of the present invention, the management node in the target distributed database cluster responds to the storage plug-in sent by the user, and sends the storage plug-in to the database agent in the target distributed database cluster. The database agent loads the storage plug-in, and then the management node responds to the data recovery task sent by the user, and sends the data recovery task to the database agent. The database agent restores the data consistency to the recovery node set in the data recovery task based on the data backup files and log files in the loaded storage plug-in. Data consistency recovery is performed through the data backup files and log files without human intervention, thereby improving data recovery efficiency and accuracy.

[0028] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0030] Figure 1a is a flow chart of a distributed database data recovery method provided according to Embodiment 1 of the present invention;

[0031] Figure 1b This is the structure of the target distributed database cluster provided according to the first embodiment of the present invention;

[0032] Figure 2 is a flow chart of a distributed database data recovery method provided according to Embodiment 2 of the present invention;

[0033] Figure 3 is a structural diagram of a distributed database data recovery device provided according to Embodiment 3 of the present invention;

[0034] Figure 4 is a schematic diagram of the structure of a distributed database data recovery device provided according to a fourth embodiment of the present invention;

[0035] Figure 5 It is a structural schematic diagram of an electronic device for implementing the distributed database data recovery method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments 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 creative work should fall within the scope of protection of the present invention.

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0038] Embodiment 1

[0039] Figure 1a A flowchart of a distributed database data recovery method is provided for the first embodiment of the present invention. This embodiment is applicable to the case where data is recovered from a distributed database by means of data backup. The method can be executed by a distributed database data recovery device. The distributed database data recovery device can be implemented in the form of hardware and / or software. The distributed database data recovery device can be configured in various general-purpose computing devices, for example, a management node configured in a target distributed database cluster. The target distributed database cluster includes a management node and at least two database nodes. Each database node is deployed with a database agent. The structure of the target distributed database cluster is as follows: Figure 1b As shown. Figure 1a As shown, the method includes:

[0040] S110 . In response to a user sending a storage plug-in, the storage plug-in is sent to a database agent in a target distributed database cluster to instruct the database agent to load the storage plug-in.

[0041] The storage plug-in is downloaded from the source distributed database cluster, and the storage plug-in includes data backup files and log files.

[0042] The user can download the storage plug-in from the source distributed database cluster through the source user interface (i.e., the user-oriented interface of the source distributed database cluster). Specifically, the source distributed database cluster includes at least two database nodes, and the storage plug-in corresponding to each database node can be downloaded from the source distributed database cluster. Each storage plug-in includes a data backup file and a log file, wherein the data backup file includes the data stored in the corresponding database node, and the log file includes all transactions that modify the data in the corresponding database node.

[0043] In the embodiment of the present invention, the user sends the storage plug-in downloaded from the source distributed database cluster to the management node in the destination distributed database cluster through the destination user interface (i.e., the user-facing interface of the destination distributed database cluster). After receiving the storage plug-in sent by the user, the management node sends the storage plug-in to the database agent in the destination distributed database cluster to instruct the database agent to load the storage plug-in and complete the preparation for data recovery.

[0044] Specifically, the management node can send the storage plug-in to the database agent in the corresponding database node according to the correspondence between the storage plug-in pre-sent by the user and the database node in the destination distributed database cluster. For example, if the currently sent storage plug-in is associated with database node A in the destination distributed database cluster, the storage plug-in will be sent to the database agent in database node A. The management node can also send the storage plug-in to the database agent in the database node in sequence according to the pre-configured storage plug-in sending rules. For example, the storage plug-in sending rule is to arrange the database nodes in the destination distributed database cluster in sequence, and finally send the storage plug-in sent by the user to the database agent in the database node in sequence according to the arrangement order.

[0045] Optionally, before sending the storage plug-in, the user can perform storage configuration in the destination user interface according to the actual data recovery needs. The storage configuration content may include the topology of the source distributed database cluster and the relevant information of each database node in the destination distributed database cluster, such as the Internet Protocol Address (IP address) of the database node. In addition, the destination user interface provides storage configuration import, view, update and delete functions, and the user can operate it with one click in the destination user interface. Through plug-in storage configuration, it supports loading, updating, deleting and downloading storage plug-ins, and supports various forms of data storage.

[0046] When the management node receives the loading results fed back by the database agent in each database node, it summarizes the loading results and feeds them back to the destination user interface. The loading results include the loading status of each database node for the storage plug-in sent by the management node, such as loading progress, loading success or failure, etc. Users can intuitively obtain the loading status of the storage plug-in through the destination user interface.

[0047] Optionally, in response to a user sending a storage plug-in, sending the storage plug-in to a database proxy in a destination distributed database cluster includes:

[0048] In response to the user sending the storage plug-in, according to the correspondence between the storage plug-in and the database node in the target distributed database cluster in the storage configuration information sent in advance by the user, the storage plug-in is sent to the database agent in the corresponding database node;

[0049] The storage configuration information is generated based on the association between the storage plug-in and the database nodes in the source distributed database cluster.

[0050] In this optional embodiment, a specific method is provided for sending a storage plug-in to a database agent in a destination distributed database cluster in response to a user sending a storage plug-in: in response to a user sending a storage plug-in, the storage plug-in is sent to a database agent in a corresponding database node according to the corresponding relationship between the storage plug-in and the database node in the destination distributed database cluster in the storage configuration information pre-sent by the user. Wherein, the storage configuration information is generated according to the association relationship between the storage plug-in and the database node in the source distributed database cluster. Exemplarily, when the topological structures of the source distributed database cluster and the destination distributed database cluster are the same, the storage configuration information is generated according to the association relationship between the storage plug-in and the database node in the source distributed database cluster. For example, if both the source distributed database cluster and the destination distributed database cluster contain 10 database nodes, the database node in the source distributed database cluster in the association relationship between the storage plug-in and the database node in the source distributed database cluster can be directly replaced with the database node in the destination distributed database cluster. By pre-sending the storage configuration information, the management node can quickly determine the database node that needs to be sent by the currently received storage plug-in, thereby improving data recovery efficiency.

[0051] S120. In response to a user issuing a data recovery task, the data recovery task is issued to a database agent, for instructing the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and according to the data backup files and log files in the loaded storage plug-in.

[0052] In an embodiment of the present invention, after the user obtains through the destination user interface that each database node in the destination distributed database cluster has completed the storage plug-in loading, the user can issue a data recovery task to the management node. The data recovery task is used to instruct the database node to perform data recovery according to the storage plug-in, and the data recovery task may include a recovery node, for example, a recovery time node or a recovery transaction node.

[0053] After receiving the data recovery task issued by the user, the management node can send the data recovery task to the database agent of each database node in the target distributed database cluster, instructing the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and the data backup files and log files in the loaded storage plug-in.

[0054] After completing the data recovery, the database agent will feedback the data recovery results to the management node. The management node summarizes the recovery results fed back by the database agents in multiple target distributed database clusters and displays the summary results through the target user interface. The recovery results may include the success or failure of data recovery, as well as the log information generated during the data recovery process.

[0055] According to the technical solution of an embodiment of the present invention, the management node in the target distributed database cluster responds to the storage plug-in sent by the user, and sends the storage plug-in to the database agent in the target distributed database cluster. The database agent loads the storage plug-in, and then the management node responds to the data recovery task sent by the user, and sends the data recovery task to the database agent. The database agent restores the data consistency to the recovery node set in the data recovery task based on the data backup files and log files in the loaded storage plug-in. Data consistency recovery is performed through the data backup files and log files without human intervention, thereby improving data recovery efficiency and accuracy.

[0056] Embodiment 2

[0057] Figure 2 A flowchart of a distributed database data recovery method is provided for the second embodiment of the present invention. This embodiment is applicable to the situation where data of a distributed database is recovered by means of data backup. The method can be executed by a distributed database data recovery device. The distributed database data recovery device can be implemented in the form of hardware and / or software. The distributed database data recovery device can be configured in various general-purpose computing devices, for example, applied to a database agent configured by a database node in a target distributed database cluster. The target distributed database cluster includes a management node and at least two database nodes, and each database node is deployed with a database agent.

[0058] like Figure 2 As shown, the method includes:

[0059] S210, in response to the storage plug-in sent by the management node, loading the storage plug-in;

[0060] The storage plug-in is downloaded from the source distributed database cluster, and the storage plug-in includes data backup files and log files;

[0061] In the embodiment of the present invention, after receiving the storage plug-in sent by the management node, the database agent first loads the storage plug-in to complete the preparation work of data recovery. The storage plug-in is downloaded from the source distributed database cluster, and the storage plug-in includes a data backup file and a log file. The data backup file includes the data stored in the corresponding database node, and the log file includes all transactions that modify the data in the corresponding database node.

[0062] S220: In response to the data recovery task issued by the management node, restore data consistency to the recovery node set in the data recovery task according to the data backup files and log files in the loaded storage plug-in.

[0063] In an embodiment of the present invention, after receiving a data recovery task issued by a management node, the database agent first reads the recovery node included in the data recovery task. Then, based on the data backup file and log file in the loaded storage plug-in, the data consistency is restored to the recovery node set in the data recovery task. Specifically, all data in a database node in the source distributed database cluster can be obtained based on the data backup file and the log file, including submitted data and unsubmitted data. Further, based on the log file, the data consistency is restored to the recovery node set in the data recovery task, specifically, the data change operations after the recovery node are extracted from the log file, and this part of the data change operations is rolled back to restore the data consistency to the recovery node.

[0064] In addition, after completing the data consistency recovery, the data recovery results will be fed back to the management node. After the management node summarizes the information fed back by the database agent of each database node, all data recovery results will be displayed through the destination user interface.

[0065] Optionally, in response to a data recovery task issued by the management node, restoring data consistency to a recovery node set in the data recovery task according to the data backup file and log file in the loaded storage plug-in includes:

[0066] In response to the data recovery task issued by the management node, read the data recovery node included in the data recovery task;

[0067] Read the data backup file and log file in the loaded storage plug-in to obtain the initial recovery data;

[0068] Based on the initial recovery data and according to the log file, the data change operations after the data recovery node are rolled back to restore the data consistency to the recovery node.

[0069] In this optional embodiment, a specific method is provided for responding to a data recovery task issued by a management node, and restoring data consistency to a recovery node set in the data recovery task according to the data backup file and log file in the loaded storage plug-in: responding to the data recovery task issued by the management node, reading the data recovery node included in the data recovery task, and further reading the data backup file and log file in the loaded storage plug-in to obtain the initial recovery data. Specifically, the data submitted in the source database cluster can be obtained in the data backup file, and the data not submitted in the source database cluster can be obtained in the log file. The submitted data and the unsubmitted data together constitute the initial recovery data.

[0070] Furthermore, based on the initial recovery data and according to the log file, the data change operation after the data recovery node is rolled back, and the data consistency is restored to the recovery node. Specifically, according to the recovery node, the log information after the recovery node is extracted from the log file. Based on the initial recovery data and according to the extracted log information, the data change operation after the data recovery node is rolled back, and the data consistency is restored to the recovery node. The data consistency can be quickly restored to the recovery node, and cross-system data recovery can be completed without human intervention, thereby improving data recovery efficiency and ensuring data consistency.

[0071] It is worth noting that in a distributed database, the execution results of the same transaction on different database nodes may be different. Only when the data associated with the same transaction is submitted on different database nodes, the transaction is considered to be submitted successfully. On the contrary, transactions that have not been fully submitted on different database nodes are called active transactions. When there is an active transaction at the recovery node, the database node where the active transaction has been submitted needs to roll back the active transaction to ensure the consistency of distributed database transactions.

[0072] Optionally, the data recovery node is a recovery time node;

[0073] Based on the initial recovery data and according to the log file, the data change operation after the data recovery node is rolled back to restore the data consistency to the recovery node, including:

[0074] According to the recovery time node, extract the target log information after the recovery time node in the log file;

[0075] Based on the initial recovery data and according to the target log information, the data change operations after the recovery time node are rolled back to restore the data consistency to the recovery time node.

[0076] In this optional embodiment, when the data recovery node is a recovery time node, based on the initial recovery data and according to the log file, the data change operation after the data recovery node is rolled back, and the data consistency is restored to the recovery node, including: according to the recovery time node, extracting the target log information after the recovery time node in the log file, based on the initial recovery data and according to the target log information, rolling back the data change operation after the recovery time node, and restoring the data consistency to the recovery time node. By setting the recovery transaction node, the data can be restored to any time point, and the data consistency of each database node in each destination database cluster can be guaranteed.

[0077] Optionally, the data recovery node is a recovery transaction node;

[0078] Based on the initial recovery data and log files, roll back the data changes after the data recovery node and restore the data consistency to the recovery node, including:

[0079] According to the recovery transaction node, extract the target log information after the recovery transaction node in the log file;

[0080] Based on the initial recovery data and according to the target log information, the data change operations after the recovery transaction node are rolled back to restore the data consistency to the recovery transaction node.

[0081] In this optional embodiment, when the data recovery node is a recovery transaction node, based on the initial recovery data and according to the log file, the data change operation after the data recovery node is rolled back, and the data consistency is restored to the recovery node, including: according to the recovery transaction node, extracting the target log information after the recovery transaction node in the log file. Based on the initial recovery data and according to the target log information, the data change operation after the recovery transaction node is rolled back, and the data consistency is restored to the recovery transaction node. Among them, the recovery transaction node can be a transaction identifier. By setting the recovery transaction node, the data can be restored to before the execution of any transaction, and the data consistency of each database node in each destination database cluster can be guaranteed.

[0082] The technical solution of the embodiment of the present invention is that the database agent configured by the database node in the target distributed database cluster responds to the storage plug-in issued by the management node, loads the storage plug-in, and the storage plug-in includes a data backup file and a log file. Then, in response to the data recovery task issued by the management node, the data consistency is restored to the recovery node set in the data recovery task according to the data backup file and the log file in the loaded storage plug-in. Data consistency is restored through the data backup file and the log file without human intervention, thereby improving data recovery efficiency and accuracy.

[0083] Embodiment 3

[0084] Figure 3 This is a schematic diagram of the structure of a distributed database data recovery device provided in Embodiment 3 of the present invention. The distributed database data recovery device is configured in a management node applied to a target distributed database cluster. The target distributed database cluster includes a management node and at least two database nodes, each of which is deployed with a database agent. Figure 3 As shown, the device comprises:

[0085] A plug-in delivery module 310, configured to deliver the storage plug-in to a database agent in a target distributed database cluster in response to a user delivering the storage plug-in, and to instruct the database agent to load the storage plug-in;

[0086] The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file;

[0087] The task issuing module 320 is used to respond to the user issuing a data recovery task and issue the data recovery task to the database agent, and to instruct the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and the data backup files and log files in the loaded storage plug-in.

[0088] According to the technical solution of an embodiment of the present invention, the management node in the target distributed database cluster responds to the storage plug-in sent by the user, and sends the storage plug-in to the database agent in the target distributed database cluster. The database agent loads the storage plug-in, and then the management node responds to the data recovery task sent by the user, and sends the data recovery task to the database agent. The database agent restores the data consistency to the recovery node set in the data recovery task based on the data backup files and log files in the loaded storage plug-in. Data consistency recovery is performed through the data backup files and log files without human intervention, thereby improving data recovery efficiency and accuracy.

[0089] Optionally, the plug-in delivery module 310 is specifically used for:

[0090] In response to a storage plug-in being sent by a user, according to a correspondence between the storage plug-in and the database node in the target distributed database cluster in the storage configuration information sent in advance by the user, the storage plug-in is sent to a database agent in the corresponding database node;

[0091] The storage configuration information is generated according to the association relationship between the storage plug-in and the database nodes in the source distributed database cluster.

[0092] The distributed database data recovery device provided in the embodiment of the present invention can execute the distributed database data recovery method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0093] Embodiment 4

[0094] Figure 4 This is a schematic diagram of the structure of a distributed database data recovery device provided in Embodiment 4 of the present invention. The distributed database data recovery device is configured in a database agent configured by a database node in a target distributed database cluster. The target distributed database cluster includes a management node and at least two database nodes, and each database node is deployed with a database agent. Figure 4 As shown, the device comprises:

[0095] A plug-in loading module 410, configured to load the storage plug-in in response to the storage plug-in sent by the management node;

[0096] The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file;

[0097] The data recovery module 420 is used to respond to the data recovery task issued by the management node and restore the data consistency to the recovery node set in the data recovery task according to the data backup files and log files in the loaded storage plug-in.

[0098] The technical solution of the embodiment of the present invention is that the database agent configured by the database node in the target distributed database cluster responds to the storage plug-in issued by the management node, loads the storage plug-in, and the storage plug-in includes a data backup file and a log file. Then, in response to the data recovery task issued by the management node, the data consistency is restored to the recovery node set in the data recovery task according to the data backup file and the log file in the loaded storage plug-in. Data consistency is restored through the data backup file and the log file without human intervention, thereby improving data recovery efficiency and accuracy.

[0099] Optionally, the data recovery module 420 includes:

[0100] A node reading unit, configured to respond to the data recovery task issued by the management node and read the data recovery node included in the data recovery task;

[0101] An initial data determination unit, used to read the data backup file and log file in the loaded storage plug-in to obtain initial recovery data;

[0102] The data recovery unit is used to roll back the data change operation after the data recovery node based on the initial recovery data and according to the log file, and restore the data consistency to the recovery node.

[0103] Optionally, the data recovery node is a recovery time node;

[0104] The data recovery unit is specifically used for:

[0105] According to the recovery time node, extract the target log information after the recovery time node in the log file;

[0106] Based on the initial recovery data and according to the target log information, the data change operations after the recovery time node are rolled back to restore the data consistency to the recovery time node.

[0107] Optionally, the data recovery node is a recovery transaction node;

[0108] The data recovery unit is specifically used for:

[0109] According to the recovery transaction node, extracting target log information after the recovery transaction node in the log file;

[0110] Based on the initial recovery data and according to the target log information, the data change operation after the recovery transaction node is rolled back to restore the data consistency to the recovery transaction node.

[0111] The distributed database data recovery device provided in the embodiment of the present invention can execute the distributed database data recovery method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] In the technical solution of the present invention, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0113] Embodiment 5

[0114] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.

[0115] Figure 5A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, applicators, blade applicators, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0116] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0117] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0118] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a distributed database data recovery method.

[0119] In some embodiments, the distributed database data recovery method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the distributed database data recovery method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the distributed database data recovery method in any other appropriate manner (e.g., by means of firmware).

[0120] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or application.

[0122] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0124] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data applier), or a computing system that includes a middleware component (e.g., an application applier), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0125] A computing system may include a client and an application server. The client and the application server are generally remote from each other and usually interact through a communication network. The relationship between the client and the application server is generated by computer programs running on corresponding computers and having a client-application server relationship with each other. The application server may be a cloud application server, also known as a cloud computing application server or a cloud host, which is a host product in a cloud computing application system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS applications.

[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0127] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A distributed database data recovery method, characterized in that: Applied to a management node in a target distributed database cluster, the target distributed database cluster includes a management node and at least two database nodes, each database node is deployed with a database agent, including: In response to a user sending a storage plug-in, sending the storage plug-in to a database agent in a destination distributed database cluster to instruct the database agent to load the storage plug-in; The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file; In response to a user issuing a data recovery task, the data recovery task is issued to the database agent, which is used to instruct the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and according to the data backup files and log files in the loaded storage plug-in.

2. The method according to claim 1, characterized in that In response to a user sending a storage plug-in, sending the storage plug-in to a database agent in a destination distributed database cluster includes: In response to a storage plug-in being sent by a user, according to a correspondence between the storage plug-in and the database node in the target distributed database cluster in the storage configuration information sent in advance by the user, the storage plug-in is sent to a database agent in the corresponding database node; The storage configuration information is generated according to the association relationship between the storage plug-in and the database nodes in the source distributed database cluster.

3. A distributed database data recovery method, characterized in that: A database agent configured for a database node in a target distributed database cluster, wherein the target distributed database cluster includes a management node and at least two database nodes, each of which is deployed with a database agent, including: In response to the storage plug-in sent by the management node, loading the storage plug-in; The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file; In response to the data recovery task issued by the management node, the data consistency is restored to the recovery node set in the data recovery task according to the data backup files and log files in the loaded storage plug-in.

4. The method according to claim 3, characterized in that In response to the data recovery task issued by the management node, the data consistency is restored to the recovery node set in the data recovery task according to the data backup file and log file in the loaded storage plug-in, including: In response to the data recovery task issued by the management node, reading the data recovery node included in the data recovery task; Read the data backup file and log file in the loaded storage plug-in to obtain the initial recovery data; Based on the initial recovery data and according to the log file, the data change operations after the data recovery node are rolled back to restore the data consistency to the recovery node.

5. The method according to claim 4, characterized in that The data recovery node is a recovery time node; Based on the initial recovery data and according to the log file, rolling back the data change operation after the data recovery node and restoring the data consistency to the recovery node includes: According to the recovery time node, extract the target log information after the recovery time node in the log file; Based on the initial recovery data and according to the target log information, the data change operations after the recovery time node are rolled back to restore the data consistency to the recovery time node.

6. The method according to claim 4, characterized in that The data recovery node is a recovery transaction node; Based on the initial recovery data and according to the log file, rolling back the data change operation after the data recovery node and restoring the data consistency to the recovery node includes: According to the recovery transaction node, extracting target log information after the recovery transaction node in the log file; Based on the initial recovery data and according to the target log information, the data change operation after the recovery transaction node is rolled back to restore the data consistency to the recovery transaction node.

7. A distributed database data recovery device, characterized in that: The management node configured in the target distributed database cluster includes the management node and at least two database nodes, each of which is deployed with a database agent, including: A plug-in delivery module, configured to deliver the storage plug-in to a database agent in a target distributed database cluster in response to a user delivering the storage plug-in, and to instruct the database agent to load the storage plug-in; The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file; The task issuing module is used to respond to the user issuing a data recovery task and issue the data recovery task to the database agent, and to instruct the database agent to perform data consistency recovery on the database node based on the recovery node in the data recovery task and the data backup files and log files in the loaded storage plug-in.

8. A distributed database data recovery device, characterized in that: A database agent configured on a database node in a target distributed database cluster, wherein the target distributed database cluster includes a management node and at least two database nodes, each of which is deployed with a database agent, includes: A plug-in loading module, configured to load the storage plug-in in response to the storage plug-in sent by the management node; The storage plug-in is downloaded from a source distributed database cluster, and the storage plug-in includes a data backup file and a log file; The data recovery module is used to respond to the data recovery task issued by the management node and restore the data consistency to the recovery node set in the data recovery task according to the data backup file and log file in the loaded storage plug-in.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the distributed database data recovery method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the distributed database data recovery method according to any one of claims 1 to 6 when executed.