CN117608921A - Backup method, recovery method and related equipment of cloud database - Google Patents

Backup method, recovery method and related equipment of cloud database Download PDF

Info

Publication number
CN117608921A
CN117608921A CN202311646347.9A CN202311646347A CN117608921A CN 117608921 A CN117608921 A CN 117608921A CN 202311646347 A CN202311646347 A CN 202311646347A CN 117608921 A CN117608921 A CN 117608921A
Authority
CN
China
Prior art keywords
backup
database
configuration
target
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311646347.9A
Other languages
Chinese (zh)
Inventor
许婉君
吴杨阳
于津苏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Resources Digital Technology Co Ltd
Original Assignee
China Resources Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Resources Digital Technology Co Ltd filed Critical China Resources Digital Technology Co Ltd
Priority to CN202311646347.9A priority Critical patent/CN117608921A/en
Publication of CN117608921A publication Critical patent/CN117608921A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a backup method, a recovery method and related equipment of a cloud database; the backup method comprises the steps of carrying out backup on basic data of a target database at the backup moment to obtain basic backup data, and generating a backup identifier of the basic backup data; then, according to the configuration group identification of the target database, acquiring a configuration parameter group of the target database at the backup time as a target configuration parameter group; the configuration group identifier corresponds to a target configuration group, and the configuration parameter group comprises configuration parameters of at least one configuration item; and finally, generating the association information of the target configuration parameter set and the backup identifier, and determining backup data of the target database based on the association information, thereby ensuring the data integrity and reliability in the backup process of the database.

Description

Backup method, recovery method and related equipment of cloud database
Technical Field
The present disclosure relates to the field of cloud databases, and in particular, to a backup method, a recovery method, and related devices for a cloud database.
Background
As cloud computing technology gradually comes into practical application, database products based on cloud computing have been developed. Cloud databases refer to databases that are optimized or deployed in a virtual computing environment. The database is deployed in the cloud environment, so that the capabilities of dynamic expandability, high availability, low construction cost, easy deployment and the like can be realized.
In the related art, it is often necessary to perform backup storage on the cloud database, and then acquire backup data for restoration. However, the current database backup and recovery method only supports the backup and recovery of basic data such as a database and a database account of the cloud database, but cannot support the backup and recovery of configuration item information which is set by user definition in the cloud database.
Disclosure of Invention
The embodiment of the application provides a backup method, a recovery method and related equipment of a cloud database, which can improve the backup integrity of the cloud database when the cloud database is backed up.
To achieve the above object, a first aspect of an embodiment of the present application provides a method for backing up a cloud database, where the method includes:
backing up the basic data of the target database at the backing up moment to obtain basic backing up data, and generating a backing up identifier of the basic backing up data;
acquiring a configuration parameter set of the target database at the backup time as a target configuration parameter set according to the configuration group identifier of the target database; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration item information of at least one configuration item;
And generating association information of the target configuration parameter set and the backup identifier, and determining backup data of the target database based on the association information.
In some embodiments, the method further comprises:
acquiring the associated information corresponding to a plurality of different backup moments;
and generating a backup information corresponding table of the target database according to the association information.
To achieve the above object, a second aspect of the embodiments of the present application provides a method for recovering a cloud database, where the method includes:
responding to a database recovery request, and acquiring backup data; the backup data is obtained according to the backup method of the cloud database in the first aspect;
acquiring the backup identifier from the backup data, acquiring basic backup data according to the backup identifier, and generating a database instance according to the basic backup data;
and acquiring the target configuration parameter set according to the association information, and configuring configuration recovery information of the database instance according to the target configuration parameter set.
In some embodiments, the obtaining the target configuration parameter set according to the association information, and configuring the configuration recovery information of the database instance according to the target configuration parameter set includes:
Acquiring the target configuration parameter set from the associated information according to the backup identifier;
generating a new configuration group of the database instance according to the target configuration parameter group; the configuration recovery information in the new configuration group is consistent with the configuration item information, and the database instance and the target database have different configuration group identifications;
the new configuration set is mounted on the database instance such that the configuration restoration information is validated on the database instance.
In some embodiments, the underlying backup data includes at least hardware resource parameters, network type, and disk type; the generating database instance according to the basic backup data comprises the following steps:
calling a resource scheduling component to create a database instance according to the hardware resource parameter;
invoking a network service component to create a virtual network interface of the database instance according to the network type;
and calling a storage component to create virtual storage of the database instance according to the disk type.
In some embodiments, after the configuring the configuration recovery information of the database instance according to the target set of configuration parameters, the method further comprises:
According to the corresponding configuration items, the target configuration group parameters of the target database are compared with the configuration recovery information of the database instance;
and obtaining configuration inheritance information of the database instance and the target database according to the comparison result.
To achieve the above object, a third aspect of the embodiments of the present application proposes a backup apparatus, including:
the basic acquisition module is used for backing up the basic data of the target database at the backup moment to obtain basic backup data and generating a backup identifier of the basic backup data;
the configuration acquisition module is used for acquiring a configuration parameter set of the target database at the backup moment as a target configuration parameter set according to the configuration group identifier of the target database; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration item information of at least one configuration item;
and the backup module is used for generating the association information of the target configuration parameter set and the backup identifier and determining backup data of the target database based on the association information.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a recovery device, including:
The recovery response module is used for responding to the database recovery request and acquiring backup data; the backup data is obtained according to the backup method of the cloud database in the first aspect;
the basic recovery module is used for acquiring the backup identifier from the backup data, acquiring basic backup data according to the backup identifier and generating a database instance according to the basic backup data;
and the configuration recovery module is used for acquiring the target configuration parameter set according to the association information and configuring the configuration recovery information of the database instance according to the target configuration parameter set.
To achieve the above object, a fifth aspect of the embodiments of the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores a computer program, and the processor implements the method for backing up a cloud database according to the first aspect or the method for recovering a cloud database according to the second aspect when executing the computer program.
To achieve the above object, a sixth aspect of the embodiments of the present application proposes a storage medium, which is a computer-readable storage medium, storing a computer program, where the computer program is executed by a processor to implement the method for backing up a cloud database according to the first aspect, or the method for recovering a cloud database according to the second aspect.
The embodiment of the application provides a backup method, a recovery method and related equipment of a cloud database; the backup method comprises the steps of carrying out backup on basic data of a target database at the backup moment to obtain basic backup data, and generating a backup identifier of the basic backup data; then, according to the configuration group identification of the target database, acquiring a configuration parameter group of the target database at the backup time as a target configuration parameter group; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration parameters of at least one configuration item; and finally, generating the association information of the target configuration parameter set and the backup identifier, and determining the backup data of the target database based on the association information. When the data of the target database is restored later, the backup data of the target database at the backup moment can be restored completely by utilizing the target configuration parameter group in the backup identifier, so that the data integrity and reliability in the backup restoring process of the database are ensured.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
Fig. 1 is a flowchart of a backup method of a cloud database according to an embodiment of the present application.
Fig. 2 is a further flowchart of a backup method of a cloud database according to a further embodiment of the present application.
Fig. 3 is a schematic diagram of a backup information correspondence representing an intention of a backup method of a cloud database according to another embodiment of the present application.
Fig. 4 is a flowchart of a method for recovering a cloud database according to another embodiment of the present application.
Fig. 5 is a flowchart of step S402 in fig. 4.
Fig. 6 is a flowchart of step S403 in fig. 4.
Fig. 7 is a schematic diagram illustrating selection of a target configuration parameter set of a recovery method according to another embodiment of the present application.
Fig. 8 is a further flowchart of a method for recovering a cloud database according to a further embodiment of the present application.
Fig. 9 is a schematic flowchart of recovery data acquisition provided in a further embodiment of the present application.
Fig. 10 is a flowchart of recovery data selection combined with configuration preference in a recovery method provided in accordance with yet another embodiment of the present application.
Fig. 11 is a schematic structural diagram of a backup device according to another embodiment of the present application.
Fig. 12 is a schematic structural diagram of a restoring device according to another embodiment of the present application.
Fig. 13 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
First, several nouns referred to in this application are parsed:
OpenStack is an open-source cloud computing platform that provides an infrastructure as a service (IaaS) solution. The cloud computing system is a software set for constructing and managing public cloud and private cloud, and can be used for managing computing, storage and network resources. OpenStack consists of a series of key components, components that can be selected for use according to requirements, including: nova: and the management and the scheduling of the computing resources are responsible, and virtual machine instances are provided. Neutron: network services are provided, including virtual network, routing, firewall, etc. functions. Cinder: a block storage service is provided that allows users to create and manage persistent storage volumes for virtual machines. Swift: object storage services are provided for large-scale distributed file and data storage. Keystone: responsible for identity authentication and authorization management, providing user authentication, access control, and service directory functions, etc.
OpenStack Trove is an open source item for managing and providing Database-as-a-Service (DBaaS). It is a sub-item of OpenStack, aimed at simplifying the flow of database deployment and management. OpenStack Trove supports many common relational and non-relational databases, including MySQL, postgreSQL, mongoDB and Cassandra, etc. It provides a unified interface for creating, configuring, monitoring and deleting database data so that users can easily manage database resources. With OpenStack Trove, users do not need to worry about the underlying configuration and maintenance of the database, and can focus on the development and business needs of the application. The system provides automatic database deployment, backup and recovery and horizontal expansion capabilities, so that users can easily adjust database resources according to actual demands.
As cloud computing technology gradually comes into practical application, database products based on cloud computing have been developed. Cloud databases refer to databases that are optimized or deployed in a virtual computing environment. The database is deployed in the cloud environment, so that the capabilities of dynamic expandability, high availability, low construction cost, easy deployment and the like can be realized.
In the related art, it is often necessary to perform backup storage on the cloud database, and then acquire backup data for restoration. However, the current database backup and recovery method only supports the backup and recovery of basic data such as a database and a database account of the cloud database, but cannot support the backup and recovery of configuration item information which is set by user definition in the cloud database.
Based on the method, the method and the related equipment for restoring the cloud database are provided, and the backup integrity of the cloud database can be improved when the cloud database is backed up. The backup method comprises the steps of carrying out backup on basic data of a target database at the backup moment to obtain basic backup data, and generating a backup identifier of the basic backup data; then, according to the configuration group identification of the target database, acquiring a configuration parameter group of the target database at the backup time as a target configuration parameter group; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration parameters of at least one configuration item; and finally, generating the association information of the target configuration parameter set and the backup identifier, and determining the backup data of the target database based on the association information. When the data of the target database is restored later, the backup data of the target database at the backup moment can be restored completely by utilizing the target configuration parameter group in the backup identifier, so that the data integrity and reliability in the backup restoring process of the database are ensured.
The embodiment of the application provides a backup method, a recovery method and related equipment of a cloud database, and specifically, the following embodiment is used for explaining, and first describes the backup method of the cloud database in the embodiment of the application.
In this embodiment, referring to fig. 1, which is an optional flowchart of a method for backing up a cloud database according to an embodiment of the present application, the method in fig. 1 may include, but is not limited to, steps S101 to S104. It should be understood that the order of steps S101 to S103 in fig. 1 is not particularly limited, and the order of steps may be adjusted, or some steps may be reduced or added according to actual requirements.
Step S101: and backing up the basic data of the target database at the backup moment to obtain basic backup data, and generating a backup identifier of the basic backup data.
In some embodiments, after responding to a data backup request of a target database, the cloud database first takes the response time as the backup time, receives and backs up basic data of the target database at the backup time through a network communication channel connected with a virtual machine of the target database to obtain basic backup data, and then generates a backup identifier of the target database in this backup data operation based on the data backup data and the backup time. It is understood that the underlying data of the target database refers to all information related in the database, including databases, user information, database data, database structures, and the like.
In OpenStack, a user can create a mirror copy of a database to restore, clone, or create a new restore database carrying the original database data when needed. Backup of databases may be used in data protection, disaster recovery, experimentation, and development. In OpenStack, a backup of the database may be performed using a Glance service. Glance allows users to create, upload, share and manage virtual machine images, and so forth.
In some embodiments, the data of the target database typically includes at least one configuration item information that is custom set by the user in addition to the underlying data. Because the current backup recovery method only supports the backup and recovery of the basic data of the target database, the configuration item information which is set by the user in the backup and recovery target database cannot be supported, the backup data of the target database is incomplete, and the recovery data obtained in the subsequent data recovery process is incomplete, so that the experience of the user is reduced. It will be appreciated that each database has its configuration items that can be user-defined, such as the postgresql database has configuration items: authentication_timeout, background_flush_after, checkpoint_timeout; the mysql database has configuration items: connect_timeout, innodb_adaptive_max_sleep_delay; the redis database has configuration items: auto-aof-rewrite-min-size, hll-spark-max-bytes, and the like.
Step S102: and acquiring a configuration parameter set of the target database at the backup time as a target configuration parameter set according to the configuration group identifier of the target database.
Therefore, in order to improve the data integrity of the target database when performing data backup, in the embodiment of the present application, a configuration group identifier is first generated based on the target database. It will be appreciated that the configuration group identification corresponds to the target database binding, and that the configuration identifier of the target database remains unchanged until the target database is not subject to an uninstall operation. In the embodiment of the application, the configuration item information in the configuration items of the target database can be queried through the configuration group identification.
Therefore, in the embodiment of the present application, after the backup time is responded to the backup request of the target database, in addition to obtaining the basic data of the target database for backup, the configuration item information of at least one configuration item, which is set by user definition and corresponds to the target database at the backup time, is obtained through the configuration identifier. And then taking a configuration parameter set formed by at least one configuration item information of the target database at the backup moment as a target configuration parameter set so as to facilitate backup storage of the target configuration parameter set in the subsequent data backup operation of the target database, thereby improving the data integrity of the target database when the target database performs data backup.
Step S103: and generating the association information of the target configuration parameter set and the backup identifier, and determining the backup data of the target database based on the association information.
In some embodiments, in order to improve data integrity and convenience when the target database performs data backup, after the target configuration parameter set and the backup identifier are obtained, the backup identifier and the target configuration parameter set corresponding to the backup time are associated to obtain association information of the target configuration parameter set and the backup identifier, and backup data of the target database is determined based on the association information to perform backup storage, so that when the database of the target database is restored later, the association relationship can be used for performing data restoration of the target database, and data integrity and convenience when the backup data of the target database is restored later are improved. It will be appreciated that the backup data of the target database is a record storing the address of the database backup file (including the base backup data and the target configuration parameter set) stored remotely, and that the backup identifier is an identification of this record.
In some embodiments, in order to improve the integrity and reliability of the data backup of the target database, the cloud database generally performs multiple data backup operations within a period of time, or performs multiple data backup operations periodically over a preset period of time, where the cloud database needs to store multiple backup data of the target database, a backup storage operation of the multiple backup data will be further described below.
Referring to fig. 2, the backup method of the cloud database further includes the following steps S201 to S202.
Step S201: and acquiring the associated information corresponding to a plurality of different backup moments.
Step S302: and generating a backup information corresponding table of the target database according to the association information.
In some embodiments, the cloud database will acquire backup identifiers and target configuration parameter sets corresponding to the target database at a plurality of different backup times to generate a plurality of associated information, and then generate a backup information corresponding table of the target database according to the plurality of associated information. Referring to fig. 3, the backup information corresponding to the backup method of the cloud database provided in the embodiment of the present application indicates an intention. Wherein, after responding to multiple data backup requests of the target database, the cloud database generates multiple backup identifiers (such as backup identifier 1, backup identifier 2,..and backup identifier N shown in fig. 3) according to the basic backup data corresponding to each backup time, and associates multiple configuration item information (such as configuration item information 1, configuration item information 2, configuration item information 3,..and the like shown in fig. 3) of the configuration group (i.e. the target configuration parameter group) corresponding to each backup time, so as to obtain multiple associated information, such as backup identifier 1 associated configuration item information 1, configuration item information 2, configuration item information 3..backup identifier 2 associated configuration item information 1, configuration item information 4, configuration item information 5..and the like. And then storing the plurality of associated information to generate a backup information corresponding table of the target database, so that the required recovery data can be extracted according to the backup information corresponding table when the data of the target database is recovered later. It will be understood that the 3 backup identifiers and their corresponding configuration groups are shown in fig. 3 for illustration only, and are not limited to the number and names of backup identifiers or configuration item information.
Since the backup identifier corresponds to the backup time and the target database, when the data of the target database is restored, after any backup identifier is acquired, the backup time and the target database can be determined based on the backup identifier, so that the basic backup data of the target database at the backup time can be determined.
In addition, since the configuration group identifier corresponds to the target database binding, the configuration identifier of the target database remains unchanged until the target database is not subject to the uninstalling operation, but since the configuration item information of the target database at different backup moments may change, one configuration identifier may correspond to a plurality of different target configuration parameter groups, wherein the configuration item information in each two target configuration parameter groups is different.
In order to better achieve the purpose of the present application, the method for recovering the cloud database provided in the embodiment of the present application will be further described below.
In this embodiment, referring to fig. 4, which is an optional flowchart of a method for recovering a cloud database provided in an embodiment of the present application, the method in fig. 4 may include, but is not limited to, steps S401 to S403. It should be understood that the order of steps S401 to S403 in fig. 4 is not particularly limited, and the order of steps may be adjusted, or some steps may be reduced or added according to actual requirements.
Step S401: and responding to the database recovery request, and acquiring backup data.
In some embodiments, when the cloud database responds to a backup data recovery request of a user for the target database, backup data of the target database required by the user is acquired, so that recovery data corresponding to the backup data is extracted from the cloud database, and a subsequent data recovery process is facilitated, wherein the recovery data comprises a backup identifier. It will be appreciated that the backup process of the backup data of the target database is obtained as shown in the backup method provided in the above embodiment.
Step S402: and acquiring a backup identifier from the backup data, acquiring basic backup data according to the backup identifier, and generating a database instance according to the basic backup data.
In some embodiments, after responding to a database restoration request and acquiring backup data, firstly extracting a backup identifier from the backup data, then acquiring basic backup data of a corresponding target database at a backup time according to the backup identifier, and then generating a database instance according to the basic backup data, thereby preliminarily realizing a backup data restoration process of restoring the database. This preliminary backup data recovery process will be further described below.
Referring to fig. 5, a database instance is generated from basic backup data, including the following steps S501 to S503.
Step S501: and calling a resource scheduling component to create a database instance according to the hardware resource parameters.
Step S502: and calling a network service component to create a virtual network interface of the database instance according to the network type.
Step S503: and calling a storage component to create virtual storage of the database instance according to the disk type.
In some embodiments, the obtained basic backup data generally includes hardware resource parameters, network type and disk type of the target database, so after the basic backup data is obtained, the trove bottom layer in the cloud database creates a new database instance by using parameter information such as the issued hardware resource parameters, network type and disk type and the corresponding backup identifier, for example: the trove calls a resource scheduling component (such as a nova component in an openstack) to create a database instance in a corresponding hardware resource according to the hardware resource parameter; trove calls a network service component (such as a neutron component in openstack) to create a virtual network interface of a database instance according to the network type; the trove calls the storage component to create virtual storage of the database instance according to the disk type, so that the reliability of data recovery of the target database is improved.
Step S403: and acquiring a target configuration parameter set according to the association information, and configuring configuration recovery information of the database instance according to the target configuration parameter set.
In some embodiments, after backup data is obtained and a backup identifier is obtained from the backup data, target associated information including the backup identifier and a target configuration parameter set thereof are determined according to a plurality of associated information in a corresponding representation intention of backup information of a backup method of a cloud database as shown in fig. 3, and a plurality of configuration item information in the target configuration parameter set is used as configuration recovery information to perform configuration parameter recovery in a database instance, so that in the backup recovery process of the database, basic backup data of the target database is recovered, and configuration item information of configuration items which are set by user definition is recovered, and further, the data integrity and reliability of data recovery of the target database are improved. How to configure the configuration recovery information of the database instance will be described in further detail below.
Referring to fig. 6, the steps S601 to S603 of acquiring the target configuration parameter group according to the association information and configuring the configuration restoration information of the database instance according to the target configuration parameter group include the following steps.
Step S601: and acquiring the target configuration parameter set from the associated information according to the backup identifier.
Step S602: and generating a new configuration group of the database instance according to the target configuration parameter group.
Step S603: the new configuration group is mounted on the database instance such that the configuration recovery information is validated on the database instance.
In some embodiments, after the cloud database acquires the backup identifier, the cloud database determines the target associated information and the target configuration parameter set thereof containing the backup identifier according to the plurality of associated information in the corresponding representation intention of the backup information of the backup method of the cloud database as shown in fig. 3. Then generating a new configuration set of the database instance according to the target configuration parameter set, and then mounting the new configuration set on the generated database instance, so that configuration recovery information corresponding to the target configuration parameter set takes effect on the database instance, thereby ensuring that the basic backup data of the target database is recovered in the backup recovery process of the database, and simultaneously recovering configuration item information of configuration items which are set by user definition, and further improving the data integrity and reliability of data recovery of the target database. It can be understood that the configuration restoration information corresponds to all the configuration item information in the target configuration parameter set, and when the configuration restoration information is installed on the database instance, it is equivalent to adjusting at least one configuration item corresponding to the target configuration parameter set to the configuration item information in the target configuration parameter set on the database instance. That is, the configuration restoration information and the configuration item information in the new configuration group are identical.
Fig. 7 is a schematic diagram illustrating selection of a target configuration parameter set of a recovery method according to an embodiment of the present application. After the backup identifier 2 is determined from the backup data, the association information of the backup identifier 2 is determined from the backup information correspondence table shown in fig. 3 as target association information, and a plurality of configuration item information (such as configuration item information 1, configuration item information 4, and configuration item information 5 and.+ -.) of the configuration group corresponding to the backup identifier 2 is taken as configuration recovery information, so that a move command is invoked to mount the configuration recovery information corresponding to the backup identifier 2 in the constructed database instance.
In addition, after the new database instance is created, because the database instance and the target database for data backup are in two independent individuals, the configuration group identifier of the database instance is different from the configuration group identifier of the target database, so that different identifier references are convenient when the configuration item information of the restored database instance is modified and the new data backup is carried out later.
In some embodiments, to further improve the reliability of data backup and data recovery of the cloud database, verification of the database instance performing the data recovery is also required.
Therefore, referring to fig. 8, after the configuration restoration information of the database instance is configured according to the target configuration parameter group, the following steps S801 to S802 are further included.
Step S801: and comparing the configuration item information of the target database with the configuration recovery information of the database instance according to the corresponding configuration item.
Step S802: and obtaining configuration inheritance information of the database instance and the target database according to the comparison result.
In some embodiments, in order to further improve reliability of data backup and data recovery of the cloud database, after the cloud database creates a database instance and performs data recovery of the basic backup data and the configuration recovery information, the cloud database performs a comparison between the configuration item information in the target database and the configuration recovery information in the database instance according to the configuration items in the target configuration parameter set, so as to obtain a comparison result of each configuration item. And if the comparison result of each configuration item represents that the configuration item information is consistent with the configuration recovery information, generating the configuration inheritance information of the database instance to completely inherit the backup data of the target database. If the comparison result of at least one configuration item represents that the configuration item information is inconsistent with the configuration recovery information, generating configuration inheritance information of backup data of the database instance incompletely inheritance target database, and checking and verifying the backup data according to the configuration inheritance information, so as to determine whether a problem occurs in the backup process or the recovery process, and further solve the problem in the place. In addition, the user may view at the product console of the cloud database whether the parameter configurations of the database instance and the target database are consistent. Thereby improving the reliability of the cloud database for data backup and data recovery.
In some embodiments, since the target database has only one corresponding configuration group identifier and backup identifiers corresponding to a plurality of backup moments, when a user performs a restoration request operation, the situation that the backup identifier required to be restored is not clear may exist, so that configuration inheritance information meeting user satisfaction cannot be inherited, and therefore, in order to further improve user experience, another method for determining the target configuration identifier is provided in the embodiments of the present application as follows.
Referring to fig. 9, a schematic flowchart of recovery data acquisition is provided in an embodiment of the present application. Wherein the recovery data includes base backup data and configuration recovery information. After responding to a backup data recovery request of a user for a target database, the cloud database firstly acquires a configuration group identifier input by the user; then determining a target database according to the configuration group identifier, and determining a backup information corresponding table of the target database; and then analyzing the configuration preference of the target database according to the multiple items of associated information in the backup information corresponding table, so as to select the target associated information from the multiple items of associated information according to the configuration preference, so as to obtain a target backup identifier in the target associated information and target configuration item information meeting the configuration preference requirement, and further determining corresponding basic backup data at the backup moment and target configuration item information meeting the configuration preference requirement according to the target configuration identifier, so as to generate configuration recovery information meeting the configuration preference requirement, and generating a database instance meeting the user configuration preference requirement, thereby further improving the convenience of backup data recovery and the user experience of the user. How the selection of recovery data is performed in conjunction with analyzing configuration preferences will be further described below.
Referring to fig. 10, a flowchart of recovery data selection combined with configuration preference in a recovery method according to an embodiment of the present application is provided. Including steps S1001 to S1004.
Step S1001: configuration item information corresponding to the plurality of backup identifiers is obtained.
In some embodiments, after the cloud database acquires the configuration group identifier, determining a target database according to the configuration group identifier, and determining a backup information corresponding table of the target database; and then acquiring a plurality of backup identifiers and configuration parameter sets corresponding to the backup identifiers from a plurality of associated information in the backup information corresponding table, wherein each configuration parameter set comprises a plurality of corresponding configuration item information. To facilitate subsequent analysis of the configuration preferences of the target database based on the configuration item information.
Step S1002: a preference analysis of the plurality of configuration parameter sets is performed.
In some embodiments, the cloud database obtains configuration item information of each configuration item in the plurality of configuration parameter sets based on the obtained plurality of configuration parameter sets, accumulates the same configuration item information in each configuration item in the plurality of configuration parameter sets to obtain parameter frequency of each configuration item information, and obtains frequency weight of different configuration item information in each configuration item according to the parameter frequency of all configuration item information; next, according to the backup time corresponding to each backup identifier, obtaining the use duration of the configuration item information in each configuration item in the plurality of configuration parameter sets, and accumulating the use duration of the same configuration item information to obtain the duration weights of different configuration item information in each configuration item; in addition, according to the backup time corresponding to each backup identifier, the update freshness of the configuration item information in each configuration item in the plurality of configuration parameter sets (that is, the more recent the configuration item information is from the data recovery request time of the database), the update weight of each configuration item information in each configuration item is obtained, so that the use habit of the target database is analyzed more accurately based on the frequency weight, the duration weight and the update weight as parameters for analyzing the configuration preference of the configuration parameter set corresponding to the backup identifier.
Step S1003: and obtaining preference evaluation of the configuration parameter set corresponding to each backup identifier.
In some embodiments, based on the obtained frequency weight, duration weight, and update weight, a preference evaluation analysis is performed on the plurality of configuration parameter sets in the backup information correspondence table to obtain an evaluation score of each configuration parameter set. The step of performing preference evaluation analysis on each configuration parameter set by using the frequency weight, the duration weight and the update weight comprises the following steps: and after the frequency weight, the duration weight and the update weight proportion of the configuration item information corresponding to each configuration item in each configuration parameter set are subjected to evaluation scoring, accumulating the evaluation scoring of all the configuration items to obtain the evaluation scoring of each configuration parameter set.
Step S1004: and determining the target backup identifier and the corresponding target configuration parameter set.
In some embodiments, after the evaluation score of each configuration parameter set, the configuration parameter set with the highest evaluation score is selected as the target configuration parameter set, and the backup identifier corresponding to the target configuration parameter set is used as the target backup identifier, so as to obtain the basic backup data corresponding to the target backup identifier and the configuration item information of the target configuration parameter set, so that when the user does not know the backup identifier required to be restored, the cloud database can recommend the target configuration parameter set meeting the user satisfaction degree, and the use experience of the user is improved.
The embodiment of the application provides a backup method, a recovery method and related equipment of a cloud database, which can improve the data backup integrity of the cloud database when the data backup of the cloud database is carried out. The backup method comprises the steps of carrying out backup on basic data of a target database at the backup moment to obtain basic backup data, and generating a backup identifier of the basic backup data; then, according to the configuration group identification of the target database, acquiring a configuration parameter group of the target database at the backup time as a target configuration parameter group; secondly, generating association information of the target configuration parameter set and the backup identifier, and determining backup data of the target database based on the association information; in addition, after the associated information of a plurality of backup moments is acquired, a backup information corresponding table of the target database is generated according to the plurality of associated information. Therefore, at a plurality of backup moments of the target database, the backup identifier is utilized to carry out backup storage of basic data of the cloud database, so that the data backup efficiency is improved, the storage cost is reduced, meanwhile, the configuration parameter set at the moment is obtained according to the configuration group identifier corresponding to the cloud database, and the plurality of backup identifiers and the plurality of configuration parameter sets are associated to carry out backup storage, so that backup data of the target database at the backup moment can be completely restored by utilizing the backup identifier when the data of the target database is restored later, and further, the data integrity and reliability in the backup restoration process of the database are ensured.
Correspondingly, the recovery method comprises the steps of responding to a database recovery request, obtaining backup data, obtaining a backup identifier from the backup data, obtaining basic backup data according to the backup identifier, generating a database instance according to the basic backup data, obtaining a target configuration parameter set according to associated information, configuring configuration recovery information of the database instance according to the target configuration parameter set, and finally comparing the configuration recovery information of the database instance with configuration item information of a target database to obtain configuration inheritance information of the database instance and the target database. And the configuration inheritance information is mounted in the database instance to restore the backup data same as the target database, and data matching judgment is carried out after the restoration, so that the convenience, reliability and integrity of restoring the backup data of the target database in the cloud-based database by a user are improved.
The embodiment of the present application further provides a backup device, which may implement the foregoing method for backing up a cloud database, with reference to fig. 11, where the device 1100 includes:
the base obtaining module 1110 is configured to backup base data of the target database at a backup time to obtain base backup data, and generate a backup identifier of the base backup data;
The configuration obtaining module 1120 is configured to obtain, as a target configuration parameter set, a configuration parameter set of the target database at the backup time according to the configuration group identifier of the target database; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration item information of at least one configuration item;
the backup module 1130 is configured to generate association information between the target configuration parameter set and the backup identifier, and determine backup data of the target database based on the association information.
The specific implementation manner of the backup device in this embodiment is basically the same as the specific implementation manner of the backup method of the cloud database, and will not be described herein.
The embodiment of the present application further provides a recovery device, which may implement the above method for recovering a cloud database, with reference to fig. 12, where the device 1200 includes:
a restore response module 1210, configured to obtain backup data in response to a database restore request; the backup data are obtained according to the backup method of the cloud database;
the base recovery module 1220 is configured to obtain a backup identifier from the backup data, obtain the base backup data according to the backup identifier, and generate a database instance according to the base backup data;
the configuration recovery module 1230 is configured to obtain the target configuration parameter set according to the association information, and configure configuration recovery information of the database instance according to the target configuration parameter set.
The specific implementation manner of the recovery device in this embodiment is basically the same as the specific implementation manner of the recovery method of the cloud database, and will not be described herein.
The embodiment of the application also provides electronic equipment, which comprises:
at least one memory;
at least one processor;
at least one program;
the program is stored in the memory, and the processor executes the at least one program to implement the cloud database backup method implemented by the application. The electronic equipment can be any intelligent terminal including a mobile phone, a tablet personal computer, a personal digital assistant (Personal Digital Assistant, PDA for short), a vehicle-mounted computer and the like.
Referring to fig. 13, fig. 13 illustrates a hardware structure of an electronic device according to another embodiment, the electronic device includes:
the processor 1301 may be implemented by a general purpose CPU (central processing unit), a microprocessor, an application specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC), or one or more integrated circuits, etc. for executing related programs to implement the technical solutions provided by the embodiments of the present application;
the memory 1302 may be implemented in the form of a ROM (read only memory), a static storage device, a dynamic storage device, or a RAM (random access memory). The memory 1302 may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present application are implemented by software or firmware, relevant program codes are stored in the memory 1302, and the processor 1301 invokes a backup method for executing the cloud database in the embodiments of the present application;
An input/output interface 1303 for implementing information input and output;
the communication interface 1304 is configured to implement communication interaction between the device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
a bus 1305 to transfer information between the various components of the device (e.g., the processor 1301, memory 1302, input/output interfaces 1303, and communication interfaces 1304);
wherein the processor 1301, the memory 1302, the input/output interface 1303 and the communication interface 1304 enable a communication connection between each other inside the device via a bus 1305.
The embodiment of the application also provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program realizes the cloud database backup method when being executed by a processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by those skilled in the art that the technical solutions shown in the figures do not constitute limitations of the embodiments of the present application, and may include more or fewer steps than shown, or may combine certain steps, or different steps.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
Preferred embodiments of the present application are described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.

Claims (10)

1. A method for backing up a cloud database, comprising:
backing up the basic data of the target database at the backing up moment to obtain basic backing up data, and generating a backing up identifier of the basic backing up data;
acquiring a configuration parameter set of the target database at the backup time as a target configuration parameter set according to the configuration group identifier of the target database; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration item information of at least one configuration item;
and generating association information of the target configuration parameter set and the backup identifier, and determining backup data of the target database based on the association information.
2. The method of backing up a cloud database of claim 1, further comprising:
acquiring the associated information corresponding to a plurality of different backup moments;
and generating a backup information corresponding table of the target database according to the association information.
3. A method for recovering a cloud database, comprising:
responding to a database recovery request, and acquiring backup data; the backup data is obtained according to the backup method of the cloud database according to any one of claims 1 to 2;
Acquiring the backup identifier from the backup data, acquiring basic backup data according to the backup identifier, and generating a database instance according to the basic backup data;
and acquiring the target configuration parameter set according to the association information, and configuring configuration recovery information of the database instance according to the target configuration parameter set.
4. The method for recovering a cloud database according to claim 3, wherein said obtaining the target configuration parameter set according to the association information and configuring the configuration recovery information of the database instance according to the target configuration parameter set includes:
acquiring the target configuration parameter set from the associated information according to the backup identifier;
generating a new configuration group of the database instance according to the target configuration parameter group; the configuration recovery information in the new configuration group is consistent with the configuration item information, and the database instance and the target database have different configuration group identifications;
the new configuration set is mounted on the database instance such that the configuration restoration information is validated on the database instance.
5. A method of recovering a cloud database according to claim 3, wherein the underlying backup data includes at least hardware resource parameters, network type and disk type; the generating database instance according to the basic backup data comprises the following steps:
Calling a resource scheduling component to create a database instance according to the hardware resource parameter;
invoking a network service component to create a virtual network interface of the database instance according to the network type;
and calling a storage component to create virtual storage of the database instance according to the disk type.
6. The method for recovering cloud database according to any one of claims 3 to 5, wherein after said configuring configuration recovery information of said database instance according to said target configuration parameter set, said method further comprises:
according to the corresponding configuration items, comparing the configuration item information of the target database with the configuration recovery information of the database instance;
and obtaining configuration inheritance information of the database instance and the target database according to the comparison result.
7. A backup apparatus, the backup apparatus comprising:
the basic acquisition module is used for backing up the basic data of the target database at the backup moment to obtain basic backup data and generating a backup identifier of the basic backup data;
the configuration acquisition module is used for acquiring a configuration parameter set of the target database at the backup moment as a target configuration parameter set according to the configuration group identifier of the target database; the configuration group identifier corresponds to the target database, and the configuration parameter group comprises configuration item information of at least one configuration item;
And the backup module is used for generating the association information of the target configuration parameter set and the backup identifier and determining backup data of the target database based on the association information.
8. A recovery device, the recovery device comprising:
the recovery response module is used for responding to the database recovery request and acquiring backup data; the backup data is obtained according to the backup method of the cloud database according to any one of claims 1 to 2;
the basic recovery module is used for acquiring the backup identifier from the backup data, acquiring basic backup data according to the backup identifier and generating a database instance according to the basic backup data;
and the configuration recovery module is used for acquiring the target configuration parameter set according to the association information and configuring the configuration recovery information of the database instance according to the target configuration parameter set.
9. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the method of backing up a cloud database according to any of claims 1 to 2 or the method of recovering a cloud database according to any of claims 4 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the backup method of a cloud database according to any one of claims 1 to 2, or the restoration method of a cloud database according to any one of claims 4 to 6.
CN202311646347.9A 2023-12-01 2023-12-01 Backup method, recovery method and related equipment of cloud database Pending CN117608921A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311646347.9A CN117608921A (en) 2023-12-01 2023-12-01 Backup method, recovery method and related equipment of cloud database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311646347.9A CN117608921A (en) 2023-12-01 2023-12-01 Backup method, recovery method and related equipment of cloud database

Publications (1)

Publication Number Publication Date
CN117608921A true CN117608921A (en) 2024-02-27

Family

ID=89947807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311646347.9A Pending CN117608921A (en) 2023-12-01 2023-12-01 Backup method, recovery method and related equipment of cloud database

Country Status (1)

Country Link
CN (1) CN117608921A (en)

Similar Documents

Publication Publication Date Title
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
CN106843828B (en) Interface display and loading method and device
CN109445869B (en) Cross-cloud-adaptive micro-service management method and device and storage medium
CN108513657B (en) Data conversion method and backup server
US10601680B2 (en) Application resiliency using APIs
CN105515872B (en) The update method of configuration information, apparatus and system
WO2016037479A1 (en) Method, device and system for optimizing virtualized network function (vnf)
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
CN105095103A (en) Storage device management method and device used for cloud environment
CN113626286A (en) Multi-cluster instance processing method and device, electronic equipment and storage medium
CN105591778A (en) Method and system for updating configuration file in distributed system
CN114238255A (en) Method and device for synchronizing files, electronic equipment and computer readable storage medium
CN110134489A (en) Using moving method and device, system, storage medium, using upper cloud tool
CN104517067A (en) Method, device and system for data access
CN110737458A (en) code updating method and related device
CN107623705B (en) Storage mode upgrading method, device and system based on video cloud storage system
US11093477B1 (en) Multiple source database system consolidation
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN115878138B (en) Application pre-download method, device, computer and storage medium
CN109495298B (en) Method and device for managing nodes in OpenStack system
CN109840094B (en) Database deployment method and device and storage equipment
CN117608921A (en) Backup method, recovery method and related equipment of cloud database
US11290318B2 (en) Disaster recovery of cloud resources
CN111431951B (en) Data processing method, node equipment, system and storage medium
US20200244525A1 (en) System and method for device configuration update

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination