Backup device and method of distributed database, readable storage medium and product

Through the configuration registration module, backup agent module, data management module and backup storage module of the distributed database backup device, the distributed database and backup media are directly connected, solving the problem of low backup efficiency of the distributed database and realizing efficient and reliable data Backup, reducing storage costs and performance impact, and improving data security.

CN118796941APending Publication Date: 2024-10-18CHINA MOBILE GROUP ZHEJIANG +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410293906.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The data backup efficiency of distributed databases is low, resulting in increased additional storage costs, compromised IO performance, and insufficient security and reliability of backup data.

Method used

Provides a backup device for a distributed database, including a configuration registration module, a backup agent module, a data management module and a backup storage module. By directly connecting the distributed database and the backup medium, data streaming transmission and storage is realized, and the transfer of storage and files is avoided. The system is implemented and provides a unified backup interface.

Benefits of technology

It achieves efficient and reliable data backup, reduces storage space usage and performance overhead, and improves the security of backup data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796941A_ABST
    Figure CN118796941A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed database backup device and method, a readable storage medium and a computer program product, and the device comprises a configuration registration module which is used for obtaining node configuration information of a target distributed database and synchronizing the node configuration information to a backup agent module; the backup agent module is used for sending a backup instruction to the target distributed database based on the backup request and the node configuration information, and the backup instruction carries backup interface information matched with a target backup medium; the data management module is used for sending a backup request to the backup agent module based on a backup strategy sent by a target backup medium and transmitting backup data to the backup storage module based on a preset storage mode, and the backup strategy carries an instance name of a target distributed database and transmits the instance name of the target distributed database to the backup agent module; the backup data is transmitted by the target distributed database in response to the backup instruction; and the backup storage module is used for transmitting the backup data to a target backup medium for storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular to a distributed database backup device and method, a readable storage medium, and a computer program product. Background Art

[0002] As the demand for business data of Internet applications grows rapidly, the underlying database is gradually changing from traditional database architecture to distributed architecture to meet the needs of business growth, and its application is becoming more and more extensive. Distributed databases have the advantages of flexible architecture, high performance, high availability, and high scalability. Logically, they are a unified whole, but physically, they are stored on different physical nodes. Distributed databases are used to support more and more core business systems.

[0003] Distributed databases usually include components such as load balancing, computing nodes, data nodes, and management nodes. In order to ensure the safe and stable operation of business data when a disaster occurs, the database needs to be backed up. Currently, distributed databases have built-in backup capabilities. Distributed databases use the corresponding components for data backup under the management node to perform data backup tasks based on the received backup strategy, and export the backup data to a shared file system, such as a network attached storage (NAS) file system, or a local file system. The backup software then periodically transfers the backup data on the NAS or local file system to the corresponding type of backup media for storage in the form of file backup.

[0004] The above-mentioned export-type transit backup data requires additional transit storage space, which significantly increases the additional storage cost investment. Exporting backup data from a distributed database to a local or shared file system, and then transferring it from the local or shared file system to the backup medium also adds additional IO performance duplication overhead to the distributed database, which has a potential performance impact on the stable operation of the distributed database. In addition, the backup data stored locally or on NAS before backing up the data to the backup medium is open to exposure, which also leads to insufficient security and reliability of the backup data. Any of the above situations will lead to the problem of low data backup efficiency in the distributed database. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a distributed database backup device and method, a readable storage medium, and a computer program product to solve the problem of low data backup efficiency in distributed databases.

[0006] In order to solve the above technical problems, this specification is implemented as follows:

[0007] In a first aspect, a backup device for a distributed database is provided, comprising a configuration registration module, a backup proxy module, a data management module and a backup storage module.

[0008] The configuration registration module is connected to the target distributed database and is used to obtain the node configuration information of the target distributed database and synchronize it to the backup proxy module;

[0009] The backup proxy module is connected to the target distributed database and is used to send a backup instruction to the target distributed database based on the backup request and the node configuration information, wherein the backup instruction carries the backup interface information adapted by the target backup medium;

[0010] The data management module is connected to the target distributed database and the target backup medium respectively, and is used to send the backup request to the backup proxy module based on the backup strategy sent by the target backup medium, and transmit the backup data to the backup storage module based on a preset storage method, wherein the backup strategy carries the instance name of the target distributed database, and the backup data is transmitted by the target distributed database in response to the backup instruction;

[0011] The backup storage module is connected to the target backup medium and is used to transfer the backup data to the target backup medium for storage.

[0012] Optionally, the node configuration information is stored in a configuration table of the target distributed database, and the node configuration information includes configuration information of a management node, a computing node, and a data node of the target distributed database.

[0013] Optionally, the backup proxy module is specifically used to:

[0014] Based on the node configuration information, determining a management node of the target distributed database;

[0015] In response to the backup request, assigning a value to a field of the backup interface adapted by the target backup medium to obtain backup interface information adapted by the target backup medium;

[0016] The backup interface information is encapsulated into the backup instruction and sent to the management node.

[0017] Optionally, the fields of the backup interface include parameters of the request call and a request return value, and the parameters of the request call include the instance name of the target distributed database, the host name of each node, and the host IP address of each node.

[0018] Optionally, the data management module includes a backup management submodule and a data storage management submodule.

[0019] The backup management submodule sends the backup request to the backup proxy module based on the backup strategy sent by the target backup medium, and records the backup information of the backup data after the target distributed database has transmitted the backup data;

[0020] The data storage management submodule presets the storage mode of the backup data based on the storage mode adapted by the target backup medium, and transmits the backup data to the backup storage module after the target distributed database completes transmitting the backup data.

[0021] Optionally, the preset storage method includes a storage data format, a backup medium type and a backup medium location corresponding to the backup data.

[0022] Optionally, the backup storage module is specifically used to:

[0023] Based on the backup medium location, the backup data is forwarded to a target backup medium of the backup medium type.

[0024] Optionally, the data management module is further used to respond to a recovery request for the target backup data in the target distributed database, and send a recovery instruction to the backup storage module and the configuration registration module, wherein the recovery instruction carries a complete backup copy of the target backup data at a storage location of the target backup medium;

[0025] The backup storage module is further used to obtain a complete backup copy of the target backup data from a storage location of the target backup medium based on the recovery instruction;

[0026] The configuration registration module is further used to send a matching result of the target distributed database to the backup proxy module based on the recovery instruction and the node configuration information of the target distributed database, wherein the matching result carries information of a first distributed database matching the node configuration of the target distributed database;

[0027] The backup proxy module is further used to complete data recovery of the target backup data in the first distributed database based on the information of the first distributed database and the complete backup copy of the target backup data.

[0028] In a second aspect, a distributed database backup method is provided, comprising:

[0029] Based on the backup policy sent by the target backup medium, a backup instruction is sent to the target distributed database, wherein the backup instruction carries the backup interface information adapted by the target backup medium, and the backup policy carries the instance name of the target distributed database;

[0030] Receiving backup data transmitted by the target distributed database in response to the backup instruction;

[0031] The backup data is transferred to the target backup medium for storage based on a preset storage method.

[0032] In a third aspect, a backup device for a distributed database is provided, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the second aspect are implemented.

[0033] In a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented.

[0034] In a fifth aspect, a computer program product is provided, the computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute the steps of the method described in the second aspect.

[0035] In an embodiment of the present application, a backup device of a distributed database is embedded in a target distributed database to take over the backup capability of the target distributed database, automatically obtain and analyze the environmental data and data partition and table information of the target distributed database, establish a direct connection with the target distributed database node, issue backup instructions and directly transmit the backup data to the backup medium through a data stream, thereby providing a complete unified backup interface for the target distributed database, adapting the target distributed database and the backup medium, and eliminating the need for the backup data of the target distributed database to be landed locally or via NAS and then transferred by the backup software to the backup medium for storage, thereby avoiding the problems of additional storage space occupation and overhead, poor backup timeliness and insufficient data security and reliability, and achieving efficient and reliable data backup. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0037] Figure 1 This is one of the structural block diagrams of the backup device of the distributed database in the embodiment of the present application.

[0038] Figure 2 This is the second structural block diagram of the backup device of the distributed database according to the embodiment of the present application.

[0039] Figure 3It is a working principle diagram of the backup proxy module in an embodiment of the present application.

[0040] Figure 4 It is a structural block diagram of the data management module of an embodiment of the present application.

[0041] Figure 5 It is a schematic diagram of the data backup process of the backup device of the distributed database in an embodiment of the present application.

[0042] Figure 6 It is a flowchart of the distributed database backup method of the embodiment of the present application.

[0043] Figure 7 This is the third structural block diagram of the backup device of the distributed database according to the embodiment of the present application. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. The numbering of the drawings in this application is only used to distinguish the various steps in the scheme, and is not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.

[0045] In order to solve the problems existing in the prior art, the embodiments of the present application provide a distributed database backup device and method, a readable storage medium, and a computer program product.

[0046] like Figure 1 As shown, the backup device 2000 for a distributed database includes a configuration registration module 2200 , a backup proxy module 2400 , a data management module 2600 and a backup storage module 2800 .

[0047] The configuration registration module 2200 is connected to the target distributed database 1000 and is used to obtain the node configuration information of the target distributed database 1000 and synchronize it to the backup proxy module 2400; the backup proxy module 2400 is connected to the target distributed database 1000 and is used to send a backup instruction to the target distributed database 1000 based on the backup request and the node configuration information, and the backup instruction carries the backup interface information adapted by the target backup medium 3000; the data management module 2600 is respectively connected to the target distributed database 1000 and the target backup medium 3000. The target backup medium 3000 is connected, and is used to send the backup request to the backup proxy module 2400 based on the backup policy sent by the target backup medium 3000, and transmit the backup data to the backup storage module 2800 based on a preset storage method, wherein the backup policy carries the instance name of the target distributed database 1000, and the backup data is transmitted by the target distributed database 1000 in response to the backup instruction; the backup storage module 2800 is connected to the target backup medium 3000, and is used to transmit the backup data to the target backup medium 3000 for storage.

[0048] In the embodiment of the present application, the target distributed database 1000 is a database with built-in backup capabilities, and the target backup medium 3000 includes, for example, a tape library, an integrated backup machine, etc. Usually, the data backed up by the target distributed database 1000 needs to be exported to the target file system for storage first, and then the backup software transfers and backs up the backup data stored on the target file system to the target backup medium 3000 in the form of file backup.

[0049] In the embodiment of the present application, the data backed up by the target distributed database 1000 through its own backup capability can be directly backed up to the target backup medium 3000 in the form of a data stream through the backup device 2000 of the distributed database.

[0050] Specifically, the configuration registration module 2200 is responsible for collecting the node configuration information of the distributed database 1000. The node configuration information of the target distributed database 1000 reflects the cluster environment configuration and node topology of the target distributed database 1000, and provides the cluster environment data of the target distributed database 1000 to the backup proxy module 2400 and the data management module 2600.

[0051] Optionally, the node configuration information is stored in a configuration table of the target distributed database 1000 , and the node configuration information includes configuration information of a management node, a computing node, and a data node of the target distributed database 1000 .

[0052] The configuration registration module 2200 can connect to the target distributed database 1000 through the client, obtain the configuration table storing the specific management information of the target distributed database 1000, and save it.

[0053] Reference below Figure 2 , Figure 2 It is a structural block diagram of a distributed database and a backup device according to an embodiment of the present application.

[0054] like Figure 2 As shown, the target distributed database 1000 includes components such as load balancing, database client 1 to data client N, computing nodes CN1 to computing nodes CNn, data nodes DN1, data nodes DN2 to data nodes DNn, and management node MN.

[0055] Combination Figure 3 The management node MN of the target distributed database 1000 includes an operations, maintenance & monitoring manager (OMM) component 1220, an agent component 1240, a cluster component 1260, a metadata management 1280, a global transaction manager (GTM) component 1290, and the like.

[0056] The proxy component 1240 is a component used for backing up the target distributed database 1000's own data. After receiving the backup instruction, based on the pre-configured attribute roles of the computing nodes and data nodes, it triggers the GTM component 1290 to complete the issuance of specific backup instructions, and the corresponding node performs data backup.

[0057] The backup device 2000 of the embodiment of the present application only needs to send instructions to the target distributed database 1000 to trigger the backup function originally provided by the target distributed database 1000. The backup function or logic inside the target distributed database 1000 remains unchanged and is still executed by the corresponding component of the target distributed database 1000.

[0058] The OMM component 1220 is a management platform for maintenance work, responsible for the management of all components under the target distributed database 1000. Its main functions include metadata management, DBProxy management, Cluster management, operation log query, resource management, OMM system configuration, database backup management, data redistribution, etc.

[0059] Combination Figure 3The node configuration information obtained by the configuration registration module 2200 includes: computing node host name, IP address, computing node process, OMM process, metadata information, etc.; data node host name, IP address, node role, data partition information, agent process, metadata information, etc.; management node OMM component 1220, agent component 1240, cluster component 1260, metadata management 1280 and GTM component 1290 information, etc.

[0060] The configuration registration module 2200 sends the acquired node configuration information to the backup proxy module 2400, which calls the node configuration information of the target distributed database 1000 and connects with the management node MN of the target distributed database 1000 by adapting the backup interface information of the target backup medium 3000. The backup instruction corresponding to the backup strategy is sent to the target distributed database 1000 to instruct the target distributed database 1000 to perform data backup through its own backup function.

[0061] Specifically, the backup proxy module 2400 connects to the management node MN through the adapted standard backup interface of the target backup medium 3000, establishes communication with the OMM component of the management node MN through the network, sends the backup instruction to the OMM component 1220, and the OMM component 1220 sends the backup instruction to the proxy component 1240 to start the data backup function of the target distributed database 1000 itself.

[0062] The backup proxy module 2400 is specifically used to: determine the management node of the target distributed database based on the node configuration information; respond to the backup request, assign values ​​to the fields of the backup interface adapted to the target backup medium to obtain the backup interface information adapted to the target backup medium; encapsulate the backup interface information into the backup instruction and send it to the management node.

[0063] Specifically, the backup proxy module 2400 encapsulates the backup interface information obtained by adapting the field values ​​of the standard backup interface of the target backup medium based on the backup request sent by the data management module 2600, and converts the backup request into a backup instruction in the form of standard backup interface information.

[0064] The fields of the backup interface include the parameters of the request call and the request return value. The parameters of the request call include the instance name of the target distributed database, the host name of each node, and the host IP address of each node.

[0065] Specifically, the definition of the standard backup interface is as follows, mainly including the interface name, description, parameters, return value, and return information. The parameters are the parameters called by the backup instruction request, and the return value is the specific content returned by the backup instruction request. The main parameter definitions of the standard backup interface are shown in Table 1 below:

[0066] Table 1

[0067]

[0068]

[0069] Through the above interface definition and parameter setting, the backup proxy module 2400 is connected to the target distributed database 1000 to implement the issuance of backup instructions, transmission and storage of backup data, and connection between the target distributed database 1000 and the data management module 2600.

[0070] The backup proxy module 2400 determines the role of each node of the target distributed database 1000 according to the node configuration information, for example, which nodes are computing nodes, data nodes or management nodes. Figure 3 As shown, the backup proxy module 2400 sends a backup instruction to the OMM component 1220 of the management node MN through the standard backup interface. The OMM component 1220 sends a backup instruction to the computing node and the data node of the target distributed database 1000 through the proxy component 1240 and the GTM component 1290 to initiate the backup of the data, binlog log, active gtid, metadata, sequence and other data of the target distributed database 1000.

[0071] The data management module 2600 is connected to the target backup medium 3000 to receive the backup policy sent by the target backup medium 3000. The backup policy carries the name of the distributed database instance to be backed up, that is, the instance name of the target distributed database 1000. The target backup medium 3000 can be connected to multiple distributed database instances in a one-to-many manner. Through the distributed database instance name carried by the backup policy, it can be requested to back up data from the corresponding distributed database. The backup policy can also carry the time when the data backup needs to start.

[0072] The data management module 2600 is also connected to the target distributed database 1000 to receive backup data transmitted by the target distributed database 1000 . The backup data is transmitted to the data management module 2600 by the target distributed database 1000 in response to the backup instruction sent by the backup proxy module 2400 .

[0073] In one embodiment, in combination Figure 4The data management module 2600 includes a backup management submodule 2620 and a data storage management submodule 2640. The backup management submodule 2620 sends the backup request to the backup proxy module 2400 based on the backup policy sent by the target backup medium 3000, and records the backup information of the backup data after the target distributed database 1000 has transmitted the backup data; the data storage management submodule 2640 presets the storage method of the backup data based on the storage method adapted by the target backup medium 3000, and transmits the backup data to the backup storage module 2800 after the target distributed database 1000 has transmitted the backup data.

[0074] The backup management submodule 2620 completes the issuance of backup instructions through the backup agent module 2400, and manages and configures the CataLog library, uniformly recording all data backup and recovery information. The data storage management submodule 2640 mainly presets the storage method corresponding to the backup data, and can automatically and accurately complete the backup data of the corresponding shards when performing a recovery operation.

[0075] Specifically, the preset storage method includes a storage data format corresponding to the backup data, a backup medium type, and a backup medium location. The storage data format corresponding to the backup data refers to the format in which the backup medium stores the backup data, the backup medium type refers to whether the backup data is stored in, for example, a disk library or a backup integrated machine, and the backup medium location is, for example, the IP address of the backup medium storing the backup data.

[0076] After the backup agent module 2400 sends a backup instruction and triggers the corresponding components and nodes of the target distributed database 1000 to perform a data backup operation, the data storage management submodule 2640 can receive the backup data transmitted by the target distributed database 1000, and transmit the backup data to the backup storage module 2800 according to the storage method set by the backup management submodule 2620.

[0077] The backup storage module 2800 is specifically configured to forward the backup data to a target backup medium of the backup medium type based on the backup medium location.

[0078] The backup storage module 2800 mainly caches and forwards the backup data to the backup medium 3000 at the corresponding location according to the records of the data management module 2600 and the preset storage method, and the backup data of the target distributed database 1000 is persistently stored by the backup medium 3000.

[0079] Combine the following Figure 5 , describes the process of the distributed database backup device of the embodiment of the present application completing the data backup of the target distributed database 1000.

[0080] Step ①: The backup management submodule 2620 sends a backup request to the backup proxy module 2400, and the backup request is obtained based on the backup policy sent by the backup medium 3000 to start the data backup task.

[0081] Step ②: The backup proxy module 2400 first determines the role of each host node of the target distributed database 1000, such as computing node, data node, management node, database partition and table information, etc. based on the node configuration information of the target distributed database 1000 synchronized by the configuration registration module 2200. The node configuration information is collected and obtained from the target distributed database 1000 by the configuration registration module 2200.

[0082] Then, the backup proxy module 2400 encapsulates the backup instructions carrying the backup interface information through the defined standard backup interface, and establishes communication with the OMM component 1200 and the proxy component 1240 of the management node MN of the target distributed database 1000, and sends the backup instructions to the OMM component 1200, which then sends the backup instructions to the proxy component 1240 to coordinate and issue the data backup tasks corresponding to the backup strategy.

[0083] Step ③: The OMM component 1200 and the proxy component 1240 of the management node MN of the target distributed database 1000 configure a data backup execution plan corresponding to the backup strategy in the target distributed database 1000, and send the data backup execution plan to the GTM component 1290.

[0084] Step ④: The GTM component 1290 distributes the received data backup execution plan to each data node, and then each data node executes the data backup operation according to the plan.

[0085] Step 5: Each data node transmits the backup data to the data storage management submodule 2640 through the standard backup interface, and returns the relevant backup information and backup completion status to the GTM component 1290 after the data backup execution plan assigned to its own node is completed.

[0086] The data storage management submodule 2640 transmits the backup data to the backup storage module 2800 for storage via the network according to the configured preset storage method, and then the backup storage module 2800 transmits the backup data to the target backup medium 3000.

[0087] Thus, the backup strategy of the target backup medium 3000 is completed, and the data source of the target distributed database is directly stored in the target backup medium 3000 in the form of a data stream.

[0088] The backup device 2000 of the present application can be embedded in the target distributed database 1000 in the form of software. One backup device corresponds to one distributed database. The target backup medium 3000 can be connected to multiple distributed databases including the target distributed database 1000.

[0089] When data recovery is required, optionally, the data management module 2600 is further configured to respond to a recovery request for target backup data in the target distributed database and send a recovery instruction to the backup storage module and the configuration registration module, wherein the recovery instruction carries a complete backup copy of the target backup data at a storage location of the target backup medium;

[0090] The backup storage module 2800 is further configured to obtain a complete backup copy of the target backup data from a storage location of the target backup medium based on the recovery instruction;

[0091] The configuration registration module 2200 is further configured to send a matching result of the target distributed database to the backup proxy module based on the recovery instruction and the node configuration information of the target distributed database, wherein the matching result carries information of a first distributed database matching the node configuration of the target distributed database;

[0092] The backup proxy module 2400 is further configured to restore the target backup data in the first distributed database based on the information of the first distributed database and the complete backup copy of the target backup data.

[0093] The recovery request received by the data management module 2600 may be sent by a user to the data management module 2600 through a client. The recovery request may include, for example, the instance name of the distributed database to be recovered and the time of the backup data to be recovered.

[0094] The data management module 2600 performs a distributed database backup information query based on the recovery request to obtain a complete backup copy of the backup data at a specified time and a storage location of the backup medium where the complete backup copy is located.

[0095] When a recovery request is received, if it is caused by a failure of the target distributed database 1000, the corresponding backup data can be restored to a distributed database with the same node cluster environment as the target distributed database 1000.

[0096] The configuration registration module 2200 first matches the node configuration information of the target distributed database 1000 with the node configuration information of multiple pre-built distributed database instances for backup data recovery, and after matching the first distributed database corresponding to the data recovery, sends the information of the first distributed database to the backup proxy module 2400.

[0097] The backup proxy module 2400 completes the communication verification with the first distributed database, and then the data management module 2600 issues a recovery instruction, and the backup storage module 2800 obtains the complete backup copy data from the backup medium according to the storage location of the backup medium where the complete backup copy of the backup data carried by the recovery instruction is located, and the backup proxy module 2400 completes data recovery at the corresponding node of the first distributed database based on the obtained complete backup copy data. Finally, after the data recovery of all nodes is completed, the backup proxy module 2400 can also call the management node MN to perform data integrity verification to complete the recovery operation.

[0098] In an embodiment of the present application, a backup device of a distributed database is embedded in a target distributed database to take over the backup capability of the target distributed database, automatically obtain and analyze the environmental data and data partition and table information of the target distributed database, establish a direct connection with the target distributed database node, issue backup instructions and directly transmit the backup data to the backup medium through a data stream, thereby providing a complete unified backup interface for the target distributed database, adapting the target distributed database and the backup medium, and eliminating the need for the backup data of the target distributed database to be landed locally or via NAS and then transferred by the backup software to the backup medium for storage, thereby avoiding the problems of additional storage space occupation and overhead, poor backup timeliness and insufficient data security and reliability, and achieving efficient and reliable data backup.

[0099] Alternatively, if Figure 6 As shown, the embodiment of the present application also provides a distributed database backup method, comprising the following steps:

[0100] Step 102: Send a backup instruction to a target distributed database based on the backup policy sent by the target backup medium, wherein the backup instruction carries backup interface information adapted by the target backup medium, and the backup policy carries the instance name of the target distributed database;

[0101] Step 104, receiving the backup data transmitted by the target distributed database in response to the backup instruction;

[0102] Step 106: transferring the backup data to the target backup medium for storage based on a preset storage method.

[0103] It can be understood that the steps in this embodiment are similar to those described above. Figures 1 to 5 The steps executed by the corresponding modules in the distributed database backup device 2000 of any embodiment are the same or similar, and can achieve the same technical effect. To avoid repetition, they are not described again here.

[0104] Alternatively, if Figure 7 As shown, an embodiment of the present application also provides a backup device 4000 for a distributed database, including a processor 4400 and a memory 4200, and the memory 4200 stores a program or instruction that can be executed on the processor 4400. When the program or instruction is executed by the processor 4400, the various steps of the above-mentioned distributed database backup method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0105] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of any of the above-mentioned distributed database backup method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the readable storage medium includes a computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0106] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be operated to enable a computer to execute the various processes of any of the above-mentioned distributed database backup method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0107] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0109] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A backup device for a distributed database, characterized in that: The backup device includes a configuration registration module, a backup proxy module, a data management module and a backup storage module. The configuration registration module is connected to the target distributed database and is used to obtain the node configuration information of the target distributed database and synchronize it to the backup proxy module; The backup proxy module is connected to the target distributed database and is used to send a backup instruction to the target distributed database based on the backup request and the node configuration information, wherein the backup instruction carries the backup interface information adapted by the target backup medium; The data management module is connected to the target distributed database and the target backup medium respectively, and is used to send the backup request to the backup proxy module based on the backup strategy sent by the target backup medium, and transmit the backup data to the backup storage module based on a preset storage method, wherein the backup strategy carries the instance name of the target distributed database, and the backup data is transmitted by the target distributed database in response to the backup instruction; The backup storage module is connected to the target backup medium and is used to transfer the backup data to the target backup medium for storage.

2. The backup device according to claim 1, characterized in that: The node configuration information is stored in the configuration table of the target distributed database, and the node configuration information includes configuration information of the management node, computing node and data node of the target distributed database.

3. The backup device according to claim 2, characterized in that: The backup proxy module is specifically used for: Based on the node configuration information, determining a management node of the target distributed database; In response to the backup request, assigning a value to a field of the backup interface adapted by the target backup medium to obtain backup interface information adapted by the target backup medium; The backup interface information is encapsulated into the backup instruction and sent to the management node.

4. The backup device according to claim 3, characterized in that: The fields of the backup interface include the parameters of the request call and the request return value. The parameters of the request call include the instance name of the target distributed database, the host name of each node, and the host IP address of each node.

5. The backup device according to claim 1, characterized in that: The data management module includes a backup management submodule and a data storage management submodule. The backup management submodule sends the backup request to the backup proxy module based on the backup strategy sent by the target backup medium, and records the backup information of the backup data after the target distributed database has transmitted the backup data; The data storage management submodule presets the storage mode of the backup data based on the storage mode adapted by the target backup medium, and transmits the backup data to the backup storage module after the target distributed database completes transmitting the backup data.

6. The backup device according to claim 5, characterized in that: The preset storage method includes a storage data format, a backup medium type and a backup medium location corresponding to the backup data.

7. The backup device according to claim 6, characterized in that: The backup storage module is specifically used for: Based on the backup medium location, the backup data is forwarded to a target backup medium of the backup medium type.

8. The backup device according to claim 1, characterized in that: The data management module is further used to respond to a recovery request for target backup data in the target distributed database and send a recovery instruction to the backup storage module and the configuration registration module, wherein the recovery instruction carries a storage location of a complete backup copy of the target backup data in the target backup medium; The backup storage module is further used to obtain a complete backup copy of the target backup data from a storage location of the target backup medium based on the recovery instruction; The configuration registration module is further used to send a matching result of the target distributed database to the backup proxy module based on the recovery instruction and the node configuration information of the target distributed database, wherein the matching result carries information of a first distributed database matching the node configuration of the target distributed database; The backup proxy module is further used to complete data recovery of the target backup data in the first distributed database based on the information of the first distributed database and the complete backup copy of the target backup data.

9. A distributed database backup method, characterized in that: include: Based on the backup policy sent by the target backup medium, a backup instruction is sent to the target distributed database, wherein the backup instruction carries the backup interface information adapted by the target backup medium, and the backup policy carries the instance name of the target distributed database; Receiving backup data transmitted by the target distributed database in response to the backup instruction; The backup data is transferred to the target backup medium for storage based on a preset storage method.

10. A backup device for a distributed database, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to claim 9 are implemented.

11. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to claim 9 are implemented.

12. A computer program product, characterized in that The computer program product comprises a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform the steps of the method as claimed in claim 9 .