Database restoration method, device and equipment and computer readable storage medium

By creating backup file recovery verification, restore and verification tasks during the database restoration process, and automatically performing operations using the target database restore template, solving the problems of cumbersome manual operations and lack of universality, and achieving efficient and timely automatic restoration of the database.

CN119248572APending Publication Date: 2025-01-03CCB FINTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411288395.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The existing database restoration process is cumbersome, inefficient and lacks universality, and automatic database restoration cannot be completed in time.

Method used

By creating database restore tasks, including backup file recovery verification, restore and verification tasks, use the target database restore template to automatically perform restore operations, determine templates based on server, database and backup file information, ensuring the integrity and availability of backup files.

Benefits of technology

It realizes automatic and rapid database recovery, improves restoration efficiency and universality, and ensures that the database is restored to an available state in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248572A_ABST
    Figure CN119248572A_ABST
Patent Text Reader

Abstract

The invention discloses a database restoration method, device and equipment and a computer readable storage medium, and is applied to the technical field of databases. The method comprises the following steps: if a database restoration condition is met, creating a database restoration task; executing a database backup file recovery verification task in the database recovery task, and performing integrity verification on the database backup file; if verification is passed, a database backup restoration task in the database restoration tasks is executed, database restoration operation is executed according to a target database restoration template, and the target database restoration template is determined according to server information of the target server, database information of the to-be-restored database and backup information of a database backup file; and executing a database backup restoration verification task in the database restoration task, and performing availability verification on the restored database. According to the embodiment of the invention, the timeliness of database restoration and the universality of database automatic restoration can be ensured, and the database restoration efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of database technology, and in particular, relates to a database restoration method, device, equipment and computer-readable storage medium. Background Art

[0002] With the rapid development of information technology, database, as the core of information storage and processing, has received more and more attention for its security and availability. Database backup is an important measure to protect data security.

[0003] In order to protect data security, currently, the database is usually backed up first, a database backup file is generated, and the database backup file is restored to a designated server. Afterwards, the database restoration personnel manually use the database backup file to restore the database to be restored. However, manual database restoration is usually not timely enough, and manual database restoration operations are cumbersome, resulting in low database restoration efficiency. In addition, different databases and different database backup files often have different database restoration methods, and the database restoration methods are not universal. Summary of the invention

[0004] The embodiments of the present application provide a database restoration method, apparatus, device, computer-readable storage medium, and computer program product, which can ensure the timeliness of database restoration and the versatility of automatic database restoration, and improve the efficiency of database restoration.

[0005] In a first aspect, an embodiment of the present application provides a database restoration method, the method comprising:

[0006] When the database restoration condition is met, a database restoration task is created, wherein the database restoration task includes a database backup file recovery verification task, a database backup restoration task and a database backup restoration verification task, and the database restoration condition at least includes that the database backup file has been restored to the target server;

[0007] Execute the database backup file recovery verification task to perform integrity verification on the database backup file and obtain a verification result;

[0008] If the verification result is that the verification is passed, the database backup and restoration task is executed to perform a database restoration operation according to a target database restoration template, wherein the target database restoration template is determined according to server information of the target server, database information of the database to be restored, and backup information of the database backup file;

[0009] When the database restoration is successful, the database backup and restoration verification task is executed to verify the availability of the restored database and obtain a verification result.

[0010] In a possible implementation, server information of the target server, database information of the database to be restored, and backup information of the database backup file are obtained;

[0011] The target database restoration template is determined from the multiple database restoration templates according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file.

[0012] In a possible implementation manner, before determining the target database restoration template from the multiple database restoration templates, the method further includes:

[0013] Acquire multiple template generation samples, wherein the template generation samples include a database information sample, a server information sample, and a backup information sample;

[0014] The database restoration templates corresponding to the plurality of template generation samples are generated respectively.

[0015] In a possible implementation, before executing the database backup file recovery verification task, the method further includes:

[0016] When generating the database backup file, using a first verification tool to calculate the database backup file to obtain a first verification value file;

[0017] Restoring the database backup file and the first check value file to the target server together;

[0018] The executing of the database backup file recovery verification task includes:

[0019] Using the first verification tool to calculate the database backup file to obtain a second verification value file;

[0020] When the first verification value file and the second verification value file are the same, the verification result is determined to be verification passed.

[0021] In a possible implementation, the executing the database backup file recovery verification task includes:

[0022] Use a second verification tool corresponding to the database to be restored to perform integrity verification on the database backup file to obtain a verification result.

[0023] In a possible implementation, the database restoration task further includes a data desensitization task; after executing the database backup and restoration verification task, the method further includes:

[0024] When the verification result is successful and the application environment of the restored database is the target application environment, the data desensitization task is performed to desensitize the data in the restored database.

[0025] In a possible implementation, the method further includes:

[0026] Task execution information and execution result information are displayed according to the execution order of multiple tasks in the database restoration task, and the multiple tasks at least include the database backup file recovery verification task, the database backup restoration task and the database backup restoration verification task.

[0027] In a second aspect, an embodiment of the present application provides a database restoration device, the device comprising:

[0028] A creation module, used to create a database restoration task when a database restoration condition is met, wherein the database restoration task includes a database backup file recovery verification task, a database backup restoration task and a database backup restoration verification task, and the database restoration condition at least includes that the database backup file has been restored to the target server;

[0029] A verification module, used to execute the database backup file recovery verification task to perform integrity verification on the database backup file and obtain a verification result;

[0030] A restoration module, configured to execute the database backup and restoration task if the verification result is a verification pass, so as to perform a database restoration operation according to a target database restoration template, wherein the target database restoration template is determined according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file;

[0031] The verification module is used to execute the database backup and restoration verification task when the database restoration is successful, so as to verify the availability of the restored database and obtain a verification result.

[0032] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;

[0033] When the processor executes the computer program instructions, the processor implements any possible implementation method of the first aspect described above.

[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implements a method in any possible implementation method of the first aspect described above.

[0035] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a method as any possible implementation method in the first aspect above.

[0036] The database restoration method, device, equipment, computer-readable storage medium and computer program product of the embodiments of the present application can automatically restore the database backup file into an active and immediately usable database by creating database restoration tasks such as database backup file restoration verification tasks, database backup restoration tasks and database backup restoration verification tasks when the database restoration conditions are met (such as the database backup file has been restored to the target server), and executing the above multiple tasks in sequence to obtain the restored database, thereby ensuring the timeliness of database restoration and improving the efficiency of database restoration. In addition, by determining the target database restoration template according to the server information of the target server, the database information of the database to be restored and the backup information of the database backup file, and performing the database restoration operation according to the target database restoration template, database restoration for different databases and different database backup files can be achieved, ensuring the universality of automatic database restoration. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0038] Figure 1 It is a structural diagram of a database restoration system provided in an embodiment of the present application;

[0039] Figure 2 It is a flowchart of a database restoration method provided in an embodiment of the present application;

[0040] Figure 3 It is a schematic diagram of a process for determining a target database restoration template provided by an embodiment of the present application;

[0041] Figure 4 It is a schematic diagram of a process for generating multiple database restoration templates provided in an embodiment of the present application;

[0042] Figure 5 It is a structural schematic diagram of a database restoration device provided in an embodiment of the present application;

[0043] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0045] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0046] In addition, the acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0047] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0048] As mentioned in the background technology section, database backup is an important measure to protect data security. Currently, more attention is paid to the improvement of backup technology, while most database recovery and restoration technologies remain at restoring the database backup file to the designated server, and then the database restorer manually uses the database backup file to restore the database to be restored.

[0049] However, manual database restoration is usually not timely enough, and the manual database restoration operation is cumbersome, resulting in low database restoration efficiency. In addition, different databases and different database backup files often have different database restoration methods, and the database restoration methods are not universal. Therefore, it is of great significance to realize the ability to automatically restore the database backup file into an active and immediately usable database and realize automatic and rapid database recovery.

[0050] In order to solve the problems in the prior art, the embodiments of the present application provide a database restoration method, apparatus, device, computer-readable storage medium and computer program product. The database restoration method can be executed by a database restoration system. Figure 1 A schematic diagram of the structure of a database restoration system 100 provided in an embodiment of the present application is shown.

[0051] like Figure 1 As shown, the database restoration system 100 may include a basic configuration unit 11, a task management unit 12, a database backup file recovery verification unit 13, a database backup and restoration unit 14, a database backup and restoration verification unit 15, a data desensitization unit 16 and a log unit 17.

[0052] The basic configuration unit 11 can provide basic information for the task management unit 12. The basic information can be used by the task management unit 12 to create a database restoration task. The basic information may include server information of the target server corresponding to the database restoration system 100, database information of the database to be restored, backup information of the database backup file, and multiple database restoration templates. Among them, the server information may include information such as the Internet Protocol Address (IP address) of the server, the operating system type, and the operating system version. The database information may include information such as the database brand, the database version, and the database installation directory. For example, the database brand may include Oracle, MySQL, SQLServer, DB2, etc. The backup information may include information such as the backup type, the directory of the backup file, the name of the backup file, and the format of the backup file. For example, the backup type may include full backup, differential backup, incremental backup, etc. The database restoration template may be used to provide a restore command for the database backup and restoration unit 14 to perform database restoration.

[0053] In addition, the basic information may also include a configuration template for generating executable programs or scripts for the database backup file recovery verification unit 13 , the database backup restoration unit 14 , the database backup restoration verification unit 15 and the data desensitization unit 16 .

[0054] The task management unit 12 can provide functions including creating a database restoration task, combining the basic configuration unit 11 and the server information of the target server required for the database restoration task, the database information of the database to be restored and the backup information of the database backup file to generate executable programs or scripts corresponding to each execution link of the database restoration task, executing the database restoration task, scheduling tasks at a fixed time, providing real-time dynamic feedback on the progress status and results of each execution link, and viewing historical tasks.

[0055] The database backup file restoration verification unit 13 can perform integrity check on the database backup file after the database backup file is restored to the target server.

[0056] The database backup and restoration unit 14 can perform a database restoration operation, and perform a database restoration on the database backup file restored by the database backup and restoration unit, so as to restore the database to the state before the backup is performed.

[0057] The database backup and restoration verification unit 15 can perform availability check on the database after the database is restored. Different databases and different business applications correspond to different check contents.

[0058] The data desensitization unit 16 can provide a data desensitization function to achieve data desensitization and ensure data security.

[0059] The log unit 17 is a general function that can provide log records of system events and execution of each unit. The records may include operation information of each functional unit such as the basic configuration unit 11, the task management unit 12, the database backup file recovery verification unit 13, the database backup and restore unit 14, the database backup and restore verification unit 15, and the data desensitization unit 16 for auditing and problem tracing.

[0060] The following is an introduction to the database restoration method provided in the embodiment of the present application.

[0061] Figure 2 A schematic diagram of a process flow of a database restoration method provided in an embodiment of the present application is shown.

[0062] like Figure 2 As shown, the database restoration method provided in the embodiment of the present application includes the following steps:

[0063] S210. When the database restoration condition is met, create a database restoration task, the database restoration task including a database backup file recovery verification task, a database backup restoration task and a database backup restoration verification task, and the database restoration condition at least includes that the database backup file has been restored to the target server;

[0064] S220, executing a database backup file recovery verification task to perform integrity verification on the database backup file and obtain a verification result;

[0065] S230. If the verification result is that the verification is passed, execute the database backup and restore task to perform the database restore operation according to the target database restore template, where the target database restore template is determined according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file;

[0066] S240. When the database restoration is successful, execute a database backup and restoration verification task to verify the availability of the restored database and obtain a verification result.

[0067] The database restoration method of the embodiment of the present application can automatically restore the database backup file into an active and immediately usable database by creating database restoration tasks such as database backup file restoration verification tasks, database backup restoration tasks, and database backup restoration verification tasks when the database restoration conditions are met (such as the database backup file has been restored to the target server), and executing the above multiple tasks in sequence to obtain the restored database, thereby ensuring the timeliness of database restoration and improving the efficiency of database restoration. In addition, by determining the target database restoration template according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file, and performing the database restoration operation according to the target database restoration template, database restoration for different databases and different database backup files can be achieved, ensuring the universality of automatic database restoration.

[0068] The specific implementation methods of the above steps are introduced below.

[0069] In some embodiments, in S210, the database restoration condition may include that the database backup file has been restored to the target server. Among them, the target server may be the server where the database to be restored is located. The process of restoring the database backup file to the target server can refer to the prior art and will not be described in detail here. In addition, the database restoration condition may also include that the basic configuration unit has prepared the basic information required for the task management unit to create a database restoration task, and the basic information may include the server information of the target server, the database information of the database to be restored, the backup information of the database backup file and multiple database restoration templates, as well as the configuration template for generating the executable program or script of the database backup file recovery verification unit, the database backup restoration unit, the database backup restoration verification unit and the data desensitization unit. In addition, the data restoration condition may also include that the clock time of the target server reaches the preset database restoration time.

[0070] As an example, when a database backup file is generated, a preset database restore time corresponding to the database backup file can also be generated at the same time. When the database backup file has been restored to the target server, the basic configuration unit has prepared the basic information required by the task management unit to create a database restore task, and the clock time of the target server reaches the preset database restore time, the database is restored based on the database backup file.

[0071] In addition, the database backup file recovery verification task can be performed by the database backup file recovery verification unit, the database backup restoration task can be performed by the database backup restoration unit, and the database backup restoration verification task can be performed by the database backup restoration verification unit.

[0072] As an example, the task management unit can generate the executable programs or scripts corresponding to the database backup file recovery verification unit, the database backup restoration unit, the database backup restoration verification unit and the data desensitization unit in sequence according to the server information of the target server, the database information of the database to be restored, the backup information of the database backup file and the configuration template for generating the executable programs or scripts of the database backup file recovery verification unit, the database backup restoration unit, the database backup restoration verification unit and the data desensitization unit. Among them, the data desensitization unit is an optional unit. If the data does not need to be desensitized, the executable program or script of the data desensitization unit may not be generated.

[0073] In addition, the task management unit can also create database restore tasks such as database backup file recovery verification tasks, database backup restore tasks, database backup restore verification tasks, and data desensitization tasks, so that the database backup file recovery verification unit, database backup restore unit, database backup restore verification unit, and data desensitization unit can respectively perform database backup file recovery verification tasks, database backup restore tasks, database backup restore verification tasks, and data desensitization tasks. Among them, the data desensitization task is an optional task. If the data does not need to be desensitized, the data desensitization task can be not generated.

[0074] In addition, the task management unit may also determine a target database restoration template from a plurality of database restoration templates according to the server information, database information, and backup information corresponding to the database restoration task.

[0075] As an example, after creating a database restoration task, the task management unit may initiate an execution task instruction so that multiple units in the database restoration system can execute multiple tasks in sequence. The execution task instruction may carry a target database restoration template.

[0076] In some embodiments, in S220, the task management unit may first send a first instruction in the execution task instruction to the database backup file recovery verification unit. The first instruction may be used to instruct the database backup file recovery verification unit to execute the database backup file recovery verification task. The database backup file recovery verification task may specifically be to perform an integrity check on the database backup file to obtain a verification result. If the verification result is a successful verification, the database backup file recovery verification unit may return the execution result of a successful verification to the task management unit so that the task management unit may initiate the task execution instruction of the next link. If the verification result is a failed verification, the database backup file recovery verification unit may return the execution result of a failed verification to the task management unit and terminate the task execution.

[0077] In some embodiments, the above S220 may specifically include:

[0078] Use the second verification tool corresponding to the database to be restored to perform integrity verification on the database backup file to obtain a verification result. If the database to be restored is DB2, the second verification tool can be the db2ckbkp tool or the db2cklog tool. If the database to be restored is mysql, the second verification tool can be the Percona XtraBackup tool.

[0079] However, some databases may not have a corresponding second verification tool. Therefore, in order to ensure the universality of the verification of the database backup file and to ensure the success of the verification even when some databases do not have a corresponding second verification tool, in some embodiments, before the above S220, the following may also be included:

[0080] When generating a database backup file, using a first verification tool to calculate the database backup file to obtain a first verification value file;

[0081] Restore the database backup file and the first checksum file to the target server.

[0082] Based on this, the above S220 may specifically include:

[0083] Use the first verification tool to calculate the database backup file to obtain a second verification value file;

[0084] When the first verification value file and the second verification value file are the same, the verification result is determined to be verification passed.

[0085] Here, the first verification tool may be a verification tool implemented based on a message digest (Message Digest, MD) algorithm or a verification tool implemented based on a secure hash algorithm (Secure Hash Algorithm, SHA). The first verification tool may include, for example, SHA1 and MD5.

[0086] As an example, if the target server has a first verification value file obtained by calculating the database backup file using the first verification tool, the database backup file recovery verification unit can use the first verification tool to calculate the database backup file to obtain a second verification value file, and compare the first verification value file with the second verification value file. If the first verification value file and the second verification value file are the same, the verification passes. If the first verification value file and the second verification value file are different, the verification fails.

[0087] The embodiment of the present application can ensure the universality of verifying the database backup file by using the first verification tool to verify the integrity of the database backup file, so as to ensure that the verification is successful even if there is no corresponding second verification tool for some databases.

[0088] In some embodiments, in S230, when the task management unit receives a verified successful execution result, a second instruction in the execution task instruction can be sent to the database backup and restore unit. The second instruction can be used to instruct the database backup and restore unit to perform a database backup and restore task for the database to be restored and the database backup file. Among them, the database to be restored and the database that generates the database backup file can be the same or different, which is not limited here. The database backup and restore task can specifically be to perform a database restore operation using a database backup file according to a target database restoration template, so that the database to be restored (if the database to be restored is the same as the database that generates the database backup file) is restored to the state before the backup is performed.

[0089] Specifically, different database restore templates can be used for different databases to be restored and different database backup files. For example, if the database to be restored is DB2 and the backup type of the database backup file is online full backup, the database restore template can be used to provide a db2 restore command or a db2 rollback command for the database backup and restore unit, so that the database backup and restore unit can use the db2 restore command or the db2 rollback command to restore the database.

[0090] In addition, the target database restoration template may be any one of a plurality of database restoration templates. Specifically, the target database restoration template may be a database restoration template corresponding to the data restoration task.

[0091] Based on this, in order to determine the target database restoration template, in some embodiments, before the above S230, a specific method of determining the target database restoration template may also be included. Figure 3 As shown, determining the target database restoration template may specifically include the following steps:

[0092] S31, obtaining server information of the target server, database information of the database to be restored, and backup information of the database backup file;

[0093] S32: Determine a target database restoration template from multiple database restoration templates according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file.

[0094] Here, the task management unit can obtain the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file from the basic configuration unit. Since the basic configuration unit can also include multiple database restoration templates. Therefore, after obtaining the server information, database information, and backup information, the task management unit can match them with the server information, database information, and backup information corresponding to multiple database restoration templates respectively. If the match is successful, the database restoration template can be determined as the target database restoration template. Among them, a successful match can be understood as the server information corresponding to the data restoration task is the same as the server information corresponding to a database restoration template, and the database information corresponding to the data restoration task is the same as the database information corresponding to the database restoration template, and the backup information corresponding to the data restoration task is the same as the backup information corresponding to the database restoration template.

[0095] Based on this, in order to generate multiple database restoration templates, in some embodiments, before determining the target database restoration template among the multiple database restoration templates, a specific method of generating multiple database restoration templates may also be included. Figure 4 As shown, generating multiple database restoration templates may specifically include the following steps:

[0096] S41, obtaining a plurality of template generation samples, where the template generation samples include a database information sample, a server information sample, and a backup information sample;

[0097] S42: Generate database restoration templates corresponding to the multiple template generation samples.

[0098] Here, the database information sample may include information such as database brand, database version, database installation directory, etc. The server information sample may include information such as the server's Internet Protocol Address (IP address), operating system type, operating system version, etc. The backup information sample may include information such as backup type, backup file directory, backup file name, backup file format, etc.

[0099] The database information samples, server information samples and backup information samples in samples generated from different templates may overlap. For example, the sample generated from template A may include the A database information sample, the A server information sample and the A backup information sample; the sample generated from template B may include the A database information sample, the B server information sample and the B backup information sample; the sample generated from template C may include the B database information sample, the B server information sample and the A backup information sample.

[0100] As an example, for each template generated sample, a database restoration command may be determined based on the database information sample, the server information sample, and the backup information sample to obtain a database restoration template.

[0101] In addition, as an example, if the restoration result of the database restoration is restoration passed, the database backup restoration unit can return the execution result of restoration passed to the task management unit, so that the task management unit can initiate the task execution instruction of the next link. If the restoration result is restoration failure, the database backup restoration unit can return the execution result of restoration failure to the task management unit and terminate the task execution.

[0102] In some embodiments, in S240, when the task management unit receives the execution result of the restoration, the third instruction in the execution task instruction can be sent to the database backup and restoration verification unit. The third instruction can be used to instruct the database backup and restoration verification unit to perform availability check and verification on the restored database to obtain a verification result. Specifically, different inspection contents may be used for different database brands and different business applications. For example, if the database to be restored is mysql, the mysqlcheck tool can be used to check the integrity and consistency of the database table to determine the availability of the database; if the database to be restored is DB2, a connect connection test can be initiated, and combined with the execution of some basic SQL queries, including SELECT, INSERT, CREATE and other operations, as well as checking the table space status and table status to determine the availability of the database.

[0103] In addition, the verification result may include verification success and verification failure. If the verification result is verification failure, the database backup and restore verification unit may return the execution result of verification failure to the task management unit and terminate the task execution. If the verification result is verification success, the database backup and restore verification unit may return the execution result of verification success to the task management unit. If there is a next-stage task (such as a data desensitization task), the task management unit may initiate the task execution instruction for the next stage. If there is no next-stage task, the task management unit may feedback the final execution result to the user.

[0104] In the case where the database restoration task includes a data desensitization task, in order to ensure data security, in some embodiments, after the above S240, the following may also be included:

[0105] When the verification result is successful and the application environment of the restored database is the target application environment, a data desensitization task is performed to desensitize the data in the restored database.

[0106] Here, the target application environment may include a test environment and a simulation environment. By combining the application environment of the database and the development and design of the database, desensitization rules can be formulated to desensitize the data in the restored database to ensure data security. Among them, desensitization may include successful desensitization and failed desensitization. If desensitization fails, the data desensitization unit may return the execution result of the failed desensitization to the task management unit and terminate the task execution. If desensitization is successful, the data desensitization unit may return the execution result of the successful desensitization to the task management unit, so that the task management unit can feedback the final execution result to the user.

[0107] In addition, in order to facilitate auditing and problem tracing, in some embodiments, the following may also be included:

[0108] The task execution information and execution result information are displayed according to the execution order of multiple tasks in the database restoration task. The multiple tasks at least include a database backup file recovery verification task, a database backup restoration task, and a database backup restoration verification task.

[0109] Here, the task execution information may include information generated by the specific execution process corresponding to multiple tasks such as database backup file recovery verification task, database backup and restore task, database backup and restore verification task and data desensitization task. The execution result information may include multiple result information such as verification success and verification failure corresponding to the database backup file recovery verification task, restoration pass and restoration failure corresponding to the database backup and restore task, verification success and verification failure corresponding to the database backup and restore verification task, and desensitization success and desensitization failure corresponding to the data desensitization task.

[0110] As an example, the log unit can record and display the task execution information and execution result information in the execution order of the multiple tasks, so that the user can perform auditing and problem tracing based on the task execution information and execution result information.

[0111] It should be noted that the present application can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present application in detail and completely and to fully convey the scope of the present application to those skilled in the art.

[0112] Based on the database restoration method provided in the above embodiment, the present application also provides a specific implementation of a database restoration device. Please refer to the following embodiment.

[0113] like Figure 5 As shown, the database restoration device 500 provided in the embodiment of the present application includes the following modules:

[0114] A creation module 510 is used to create a database restoration task when a database restoration condition is met. The database restoration task includes a database backup file recovery verification task, a database backup restoration task, and a database backup restoration verification task. The database restoration condition at least includes that the database backup file has been restored to the target server.

[0115] Verification module 520, used to perform database backup file recovery verification task to perform integrity verification on the database backup file and obtain verification results;

[0116] The restoration module 530 is used to execute the database backup and restoration task if the verification result is that the verification is passed, so as to perform the database restoration operation according to the target database restoration template, where the target database restoration template is determined according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file;

[0117] The verification module 540 is used to execute the database backup and restoration verification task when the database restoration is successful, so as to verify the availability of the restored database and obtain a verification result.

[0118] The above-mentioned database restoration device 500 is described in detail below, as shown below:

[0119] In some embodiments, the target database restoration template is any one of a plurality of database restoration templates. Based on this, the database restoration device 500 may further include:

[0120] A first acquisition module is used to acquire server information of a target server, database information of a database to be restored, and backup information of a database backup file before executing a database backup and restoration task;

[0121] The determination module is used to determine a target database restoration template from multiple database restoration templates according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file.

[0122] In some embodiments, the database restoration device 500 may further include:

[0123] A second acquisition module is used to acquire multiple template generation samples before determining a target database restoration template from multiple database restoration templates, where the template generation samples include a database information sample, a server information sample, and a backup information sample;

[0124] The generation module is used to generate database restoration templates corresponding to multiple template generation samples.

[0125] In some embodiments, the database restoration device 500 may further include:

[0126] A calculation module, used to calculate the database backup file using a first verification tool to obtain a first verification value file when generating a database backup file;

[0127] The recovery module is used to restore the database backup file and the first verification value file to the target server.

[0128] Based on this, the verification module 520 may specifically include:

[0129] A calculation submodule, used to use the first verification tool to calculate the database backup file to obtain a second verification value file;

[0130] The determination submodule is used to determine that the verification result is a passed verification when the first verification value file and the second verification value file are the same.

[0131] In some embodiments, the verification module 520 may specifically include:

[0132] The verification submodule is used to use a second verification tool corresponding to the database to be restored to perform integrity verification on the database backup file to obtain a verification result.

[0133] In some embodiments, the database restoration task also includes a data desensitization task. Based on this, the database restoration device 500 may also include:

[0134] The desensitizing module is used to perform a data desensitizing task after executing the database backup and restore verification task, if the verification result is successful and the application environment of the restored database is the target application environment, to desensitize the data in the restored database.

[0135] In some embodiments, the database restoration device 500 may further include:

[0136] The display module is used to display task execution information and execution result information according to the execution order of multiple tasks in the database restoration task. The multiple tasks at least include a database backup file recovery verification task, a database backup restoration task, and a database backup restoration verification task.

[0137] The database restoration device of the embodiment of the present application can automatically restore the database backup file into an active and immediately usable database by creating database restoration tasks such as database backup file restoration verification tasks, database backup restoration tasks, and database backup restoration verification tasks when the database restoration conditions are met (such as the database backup file has been restored to the target server), and executing the above multiple tasks in sequence to obtain the restored database, thereby ensuring the timeliness of database restoration and improving the efficiency of database restoration. In addition, by determining the target database restoration template according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file, and performing the database restoration operation according to the target database restoration template, it is possible to realize database restoration for different databases and different database backup files, thereby ensuring the universality of automatic database restoration.

[0138] Based on the database restoration method provided in the above embodiment, the embodiment of the present application also provides a specific implementation of the electronic device. Figure 6 A schematic diagram of an electronic device 600 provided in an embodiment of the present application is shown.

[0139] The electronic device 600 may include a processor 610 and a memory 620 storing computer program instructions.

[0140] Specifically, the processor 610 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0141] The memory 620 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 620 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 620 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 620 may be inside or outside the electronic device 600. In a particular embodiment, the memory 620 is a non-volatile solid-state memory.

[0142] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.

[0143] The processor 610 implements any one of the database restoration methods in the above embodiments by reading and executing computer program instructions stored in the memory 620 .

[0144] In one example, the electronic device 600 may further include a communication interface 630 and a bus 640. Figure 6 As shown, the processor 610, the memory 620, and the communication interface 630 are connected via a bus 640 and communicate with each other.

[0145] The communication interface 630 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0146] Bus 640 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 640 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0147] Exemplarily, the electronic device 600 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).

[0148] The electronic device can execute the database restoration method in the embodiment of the present application, thereby realizing the combination Figures 1 to 5 The described database restoration method and device.

[0149] In addition, in combination with the database restoration method in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the database restoration methods in the above embodiment is implemented.

[0150] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0151] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0152] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0153] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0154] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A database restoration method, characterized in that: include: When the database restoration condition is met, a database restoration task is created, wherein the database restoration task includes a database backup file recovery verification task, a database backup restoration task and a database backup restoration verification task, and the database restoration condition at least includes that the database backup file has been restored to the target server; Executing the database backup file recovery verification task to perform integrity verification on the database backup file and obtain a verification result; If the verification result is that the verification is passed, the database backup and restoration task is executed to perform a database restoration operation according to a target database restoration template, wherein the target database restoration template is determined according to server information of the target server, database information of the database to be restored, and backup information of the database backup file; When the database restoration is successful, the database backup and restoration verification task is executed to verify the availability of the restored database and obtain a verification result.

2. The method according to claim 1, characterized in that The target database restoration template is any one of a plurality of database restoration templates. Before executing the database backup and restoration task, the method further includes: Obtaining server information of the target server, database information of the database to be restored, and backup information of the database backup file; The target database restoration template is determined from the multiple database restoration templates according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file.

3. The method according to claim 2, characterized in that Before determining the target database restoration template from the multiple database restoration templates, the method further includes: Acquire multiple template generation samples, wherein the template generation samples include a database information sample, a server information sample, and a backup information sample; The database restoration templates corresponding to the plurality of template generation samples are generated respectively.

4. The method according to claim 1, characterized in that: Before executing the database backup file recovery verification task, the method further includes: When generating the database backup file, using a first verification tool to calculate the database backup file to obtain a first verification value file; Restoring the database backup file and the first check value file to the target server together; The executing of the database backup file recovery verification task includes: Using the first verification tool to calculate the database backup file to obtain a second verification value file; When the first verification value file and the second verification value file are the same, the verification result is determined to be verification passed.

5. The method according to claim 1, characterized in that: The executing of the database backup file recovery verification task includes: Use a second verification tool corresponding to the database to be restored to perform integrity verification on the database backup file to obtain a verification result.

6. The method according to claim 1, characterized in that The database restoration task also includes a data desensitization task; after executing the database backup and restoration verification task, the method also includes: When the verification result is successful and the application environment of the restored database is the target application environment, the data desensitization task is performed to desensitize the data in the restored database.

7. The method according to claim 1, characterized in that The method further comprises: Task execution information and execution result information are displayed according to the execution order of multiple tasks in the database restoration task, and the multiple tasks at least include the database backup file recovery verification task, the database backup restoration task and the database backup restoration verification task.

8. A database restoration device, characterized in that: The device comprises: A creation module, used to create a database restoration task when a database restoration condition is met, wherein the database restoration task includes a database backup file recovery verification task, a database backup restoration task and a database backup restoration verification task, and the database restoration condition at least includes that the database backup file has been restored to the target server; A verification module, used to execute the database backup file recovery verification task to perform integrity verification on the database backup file and obtain a verification result; A restoration module, configured to execute the database backup and restoration task if the verification result is a verification pass, so as to perform a database restoration operation according to a target database restoration template, wherein the target database restoration template is determined according to the server information of the target server, the database information of the database to be restored, and the backup information of the database backup file; The verification module is used to execute the database backup and restoration verification task when the database restoration is successful, so as to verify the availability of the restored database and obtain a verification result.

9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the database restoration method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the database restoration method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the database restoration method as described in any one of claims 1 to 7.