A database backup method and apparatus

By determining the correspondence between the backup script IP address and the asynchronous standby database IP address before database backup, the backup is ensured to be performed on the asynchronous standby database. This solves the problem of low database backup security in existing technologies, enabling normal operation of the primary database and improving database security.

CN114647536BActive Publication Date: 2026-07-28NETSUNION CLEARING CORP
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETSUNION CLEARING CORP
Filing Date
2020-12-17
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

In existing technologies, database backup methods have low security, especially after the asynchronous backup database is switched to the primary database. When the backup script is deployed on the original primary database, it may cause business blockage and affect the security of the database.

Method used

By obtaining the database configuration information, it is determined whether the backup script IP address is the same as the asynchronous standby database IP address. If they are different, the backup script is replaced with the asynchronous standby database IP address, and the backup script is run to perform the database backup, ensuring that the backup is performed on the asynchronous standby database.

Benefits of technology

This effectively avoids business disruptions caused by backing up the primary database, ensuring the normal operation of the primary database and improving database security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647536B_ABST
    Figure CN114647536B_ABST
Patent Text Reader

Abstract

The application provides a database backup method and device, the method comprising: obtaining database configuration information, wherein the database configuration information comprises an asynchronous backup database IP address and a backup script IP address; judging whether the backup script IP address and the asynchronous backup database IP address are the same according to the database configuration information; replacing the backup script IP address with the asynchronous backup database IP address in the case that the backup script IP address and the asynchronous backup database IP address are different; and running the backup script to perform database backup. Through the database type judgment on the database corresponding to the execution script before the database backup on the database after the completion of the master-slave database switching, the database backup is performed in the case that the database is determined to be an asynchronous backup database. The database backup on the master database is effectively avoided, the business jam caused by the database backup on the master database is avoided, the safe operation of the master database business is ensured, and the security of the database is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of databases, and more specifically to a database backup method and apparatus. Background Technology

[0002] With the development of network technology, databases have been widely used in various industries. For example, databases used in the financial industry typically employ a master-slave architecture due to the high complexity of financial business and the stringent requirements for business continuity. This master-slave architecture consists of one master database and two slave databases. One slave database synchronizes with the master database using a semi-synchronous strategy (referred to as a semi-synchronous slave database), while the other slave database synchronizes with the master database using an asynchronous strategy (referred to as an asynchronous slave database).

[0003] In existing technologies, backup scripts used to implement database backup functions are usually deployed on an asynchronous standby database. When the backup script is running, the database will be locked. Therefore, when the asynchronous standby database switches to the primary database, the business operations of the primary database may be blocked, posing a risk to the security of the database. Summary of the Invention

[0004] Therefore, the technical problem to be solved by the present invention is to overcome the shortcomings of low security in existing database backup methods, thereby providing a database backup method and apparatus.

[0005] The first aspect of this application provides a database backup method, including:

[0006] Obtain database configuration information, wherein the database configuration information includes: asynchronous standby database IP address and backup script IP address;

[0007] Based on the database configuration information, determine whether the backup script IP address is the same as the asynchronous backup database IP address;

[0008] If the backup script IP address is different from the asynchronous backup database IP address, replace the backup script IP address with the asynchronous backup database IP address;

[0009] Run the backup script to perform a database backup.

[0010] Optionally, before obtaining the database configuration information, the method further includes:

[0011] Obtain the monitoring information of the database; determine whether the database has completed the primary / standby database switchover operation based on the monitoring information;

[0012] If the database has completed the primary / standby database switchover operation, then the step of obtaining the database configuration information is executed.

[0013] Optionally, before running the backup script, the method further includes:

[0014] Obtain the database status of the primary database and determine whether the database status is alive.

[0015] If the database is in an active state, execute the step of running the backup script.

[0016] Optionally, before running the backup script, the method further includes:

[0017] Obtain the read / write status of the asynchronous backup database and determine whether the read / write status is read-only.

[0018] When the read / write state is read-only, the step of running the backup script is executed.

[0019] Optionally, before running the backup script, the method further includes:

[0020] Obtain the resource pool information corresponding to the IP address of the asynchronous backup library;

[0021] Based on the resource pool information, determine whether the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database; if the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database, execute the step of running the backup script.

[0022] Optionally, before running the backup script, the method further includes:

[0023] Determine whether the backup script meets the preset running conditions;

[0024] If the backup script meets the preset running conditions, the step of running the backup script is executed.

[0025] Optionally, an alarm may be triggered if the database fails to complete the primary / standby database switchover operation, or if the read / write status is not read-only, or if the database type corresponding to the IP address of the asynchronous standby database is not asynchronous, or if the backup script does not meet the preset operating conditions.

[0026] A second aspect of this application provides a database backup device, comprising: an acquisition module, a judgment module, a configuration module, and a backup module;

[0027] The acquisition module is used to acquire database configuration information, wherein the database configuration information includes: asynchronous backup database IP address and backup script IP address;

[0028] The judgment module is used to determine whether the backup script IP address is the same as the asynchronous backup database IP address based on the database configuration information.

[0029] The configuration module is used to replace the backup script IP address with the asynchronous backup database IP address when the backup script IP address is different from the asynchronous backup database IP address.

[0030] The backup module is used to run the backup script to perform database backup.

[0031] Optionally, the acquisition module is further configured to: acquire monitoring information of the database; and determine whether the database has completed the primary / standby database switchover operation based on the monitoring information.

[0032] If the database has completed the primary / standby database switchover operation, then the step of obtaining the database configuration information is executed.

[0033] Optionally, the judgment module is further configured to: obtain the database status of the master database, and determine whether the database status is alive;

[0034] If the database is in an active state, execute the step of running the backup script.

[0035] Optionally, the judgment module is further configured to: obtain the read / write status of the asynchronous backup library, and determine whether the read / write status is a read-only status;

[0036] When the read / write state is read-only, the step of running the backup script is executed.

[0037] Optionally, the determination module is further configured to: obtain resource pool information corresponding to the IP address of the asynchronous backup library;

[0038] Based on the resource pool information, determine whether the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database; if the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database, execute the step of running the backup script.

[0039] Optionally, the determination module is further configured to: determine whether the backup script meets preset running conditions;

[0040] If the backup script meets the preset running conditions, the step of running the backup script is executed.

[0041] Optionally, the judgment module is further configured to: issue an alarm when the database has not completed the primary / standby database switchover operation, or when the read / write state is not read-only, or when the database type corresponding to the IP address of the asynchronous standby database is not asynchronous standby database, or when the backup script does not meet the preset running conditions.

[0042] A third aspect of this application provides an electronic device, comprising: at least one processor and a memory;

[0043] The memory stores computer-executed instructions;

[0044] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method described in the first aspect above and various possible designs of the first aspect.

[0045] The fourth aspect of this application provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the methods described in the first aspect above and various possible designs of the first aspect.

[0046] The technical solution of this invention has the following advantages:

[0047] This application provides a database backup method and apparatus. The method involves acquiring database configuration information, including an asynchronous standby database IP address and a backup script IP address; determining whether the backup script IP address is the same as the asynchronous standby database IP address based on the configuration information; replacing the backup script IP address with the asynchronous standby database IP address if they differ; and then running the backup script to perform a database backup. This database backup method, before backing up the database after a primary / standby switchover, first determines the database type of the database corresponding to the backup script. Only when the database is determined to be an asynchronous standby database is the backup performed, thus avoiding database backups on the primary database. This prevents business congestion caused by backing up the primary database, ensures the normal operation of the primary database, and improves database security. Attached Figure Description

[0048] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0049] Figure 1This is a schematic diagram of the structure of the database backup system on which the embodiments of this application are based;

[0050] Figure 2 A schematic flowchart illustrating a database backup method provided in an embodiment of this application;

[0051] Figure 3 This is a schematic diagram of the database system provided in an embodiment of this application;

[0052] Figure 4 A flowchart illustrating another database backup method provided in this application embodiment;

[0053] Figure 5 A flowchart illustrating another database backup method provided in an embodiment of this application;

[0054] Figure 6 This is a schematic diagram of the structure of the database backup device provided in the embodiments of this application;

[0055] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0056] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] The database backup method and apparatus provided in this application are applicable to avoiding database backup operations on the primary database, thereby preventing disruption to the primary database's operations, ensuring the normal operation of the primary database's operations, and improving database security. Figure 1 The diagram shown illustrates the structure of a database backup system based on an embodiment of this application. This system may include a database system and a database backup device for backing up the database. The database system includes a primary database, a semi-synchronous standby database, and an asynchronous standby database. When a primary / standby database switch is completed in the database system, the database backup device will determine the database type of the database corresponding to the executed script before performing the backup. If the database is determined to be an asynchronous standby database, the backup will be performed; otherwise, the backup will not be performed.

[0058] However, in existing technologies, backup scripts for database backup are typically deployed based on IP addresses and on asynchronous standby databases. When a primary / standby database switch occurs—that is, the original asynchronous standby database becomes the primary database, and the original primary database becomes the asynchronous standby database—the IP address of the asynchronous standby database changes. If the backup script is still deployed using the original IP address, it might be deployed on the original primary database or the original semi-synchronous standby database. When the backup script is executed on the original primary database, the backup tool generates locks during the backup process, which can block the operations on the original primary database, thus affecting normal business operations.

[0059] Therefore, the database backup method and apparatus provided in this application obtain database configuration information, including the asynchronous standby database IP address and the backup script IP address; determine whether the backup script IP address and the asynchronous standby database IP address are the same based on the database configuration information; if the backup script IP address and the asynchronous standby database IP address are different, replace the backup script IP address with the asynchronous standby database IP address; and run the backup script to perform database backup. The database backup method provided by the above solution, before backing up the database after the primary / standby database switchover is completed, first determines the database type of the database corresponding to the execution script. If it is determined that the database is an asynchronous standby database, the database backup is performed. This effectively avoids backing up the primary database, thereby preventing business congestion caused by backing up the primary database, ensuring the normal operation of the primary database business, avoiding business data storage failures, and improving database security.

[0060] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0061] This application provides a database backup method to address the low security shortcomings of existing database backup methods. The execution subject of this application embodiment is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, or other electronic devices that can be used for database backup.

[0062] like Figure 2 The diagram shown is a flowchart illustrating a database backup method provided in an embodiment of this application. The method includes:

[0063] Step 101: Obtain database configuration information;

[0064] The database configuration information includes: the asynchronous backup database IP address and the backup script IP address.

[0065] It should be noted that the primary, semi-synchronous, and asynchronous standby databases in a database system can all act as primary databases for business data interaction. Business data interaction with the database is based on a VIP connection. When a primary database failure is detected, the database failover tool switches the VIP connection port to the appropriate standby database to ensure normal business data interaction.

[0066] For example, if the database system is applied in the financial field, when the primary database is being maintained and upgraded, a lot of extra preparation work is required for the primary database replacement operation. Therefore, in order to avoid unnecessary database switching, each standby database can be used as the primary database for business data interaction based on the VIP connection.

[0067] Specifically, the VIP viewing tool is used to obtain the main architecture of the database system, and to obtain the IP address of the asynchronous standby database and the IP address of the backup script in the database system.

[0068] Specifically, in one embodiment, before obtaining the database configuration information, it is also necessary to obtain the database monitoring information; determine whether the database has completed the primary / standby database switchover operation based on the monitoring information; if the database has completed the primary / standby database switchover operation, execute the step of obtaining the database configuration information.

[0069] Step 102: Based on the database configuration information, determine whether the backup script IP address is the same as the asynchronous standby database IP address;

[0070] It's important to note that during data backup, locks are created on the backup database to ensure data consistency. This means that backing up the database will impact its interactive performance. Therefore, asynchronous standby databases are typically used for data backup. The backup script's IP address is deployed using the same IP address as the original asynchronous standby database; that is, the backup script's IP address is the same as the asynchronous standby database's IP address before the database switchover.

[0071] However, during the database switchover process, the IP address of the asynchronous standby database may change, and the database corresponding to the original asynchronous standby database's IP address may have been switched to the primary database.

[0072] For example, such as Figure 3The diagram shows the structure of the database system provided in this embodiment. The first database system on the left is the structure of the database system before database switching, and the second database system on the right is the structure of the database system after database switching. It can be seen that in the database system after database switching, the database corresponding to the backup script is not necessarily the asynchronous standby database; it could also be the primary database. The database switching is performed using an HA (High Availability) tool. HA is primarily responsible for switching the VIP to a semi-synchronous standby database to maintain normal business data interaction after a primary database failure. When the semi-synchronous standby database fails, HA is automatically set up for both the primary and asynchronous standby databases to improve the availability of the database architecture.

[0073] Specifically, to avoid using a database other than the asynchronous standby database for database backup, before performing the database backup, it is first necessary to determine whether the obtained asynchronous standby database IP address and backup script IP address correspond to each other, that is, to determine whether the asynchronous standby database IP address and backup script IP address are the same.

[0074] Step 103: If the backup script IP address and the asynchronous standby database IP address are different, replace the backup script IP address with the asynchronous standby database IP address.

[0075] Specifically, if it is determined that the database corresponding to the backup script IP address is not an asynchronous standby database, then the backup script IP address needs to be replaced according to the obtained asynchronous standby database IP address to make the two correspond.

[0076] Step 104: Run the backup script to back up the database.

[0077] Specifically, if the backup script IP address is the same as the asynchronous standby database IP address, then the database backup is performed by the asynchronous standby database, thus avoiding any impact on the database's interactive performance.

[0078] Specifically, in one embodiment, before running the backup script, it is necessary to obtain the database status of the master database and determine whether the database status is alive; if the database status is alive, the step of running the backup script is executed.

[0079] If the primary database is not in an active state, it indicates that the primary database failure has not been resolved. In this case, an alarm should be triggered to remind relevant operators to repair the database. Database backup should not be performed during the database repair process.

[0080] Based on the above embodiments, in order to further determine the database type corresponding to the backup script, and to avoid performing database backups on databases other than the asynchronous backup database, Figure 4This is a flowchart illustrating another database backup method provided in this application embodiment. As an implementable approach, based on the above embodiments, in one embodiment, before running the backup script, the database backup method provided in this application embodiment further includes:

[0081] Step 401: Obtain the read / write status of the asynchronous backup database and determine whether the read / write status is read-only.

[0082] Step 402: When the read / write state is read-only, execute the step of running the backup script.

[0083] It should be noted that the primary database is usually in a read-write state or a write state, while the asynchronous backup database is in a read-only state.

[0084] For example, when determining the read / write status of the database corresponding to the backup script's IP address, the "show variables like '%read_only%'" database command can be executed based on the backup script's IP address to determine the read / write status of the database corresponding to that IP address. If the database is determined to be read-only, the backup script is run, and a database backup is performed. Conversely, if the database is determined to be writable, it indicates an error in this step, and / or an error in the database type determination step preceding this step. In this case, an alarm will be triggered to remind the operator to diagnose and repair the relevant fault.

[0085] Based on the above embodiments, in order to further determine the database type corresponding to the backup script, and to avoid performing database backups on databases other than the asynchronous backup database, Figure 5 This is a flowchart illustrating another database backup method provided in this application. As an implementable approach, based on the above embodiments, in one embodiment, before running the backup script, the database backup method provided in this application further includes:

[0086] Step 501: Obtain the resource pool information corresponding to the IP address of the asynchronous standby database;

[0087] Step 502: Determine whether the database type corresponding to the IP address of the asynchronous standby database is an asynchronous standby database based on the resource pool information; if the database type corresponding to the IP address of the asynchronous standby database is an asynchronous standby database, execute the step of running the backup script.

[0088] It should be noted that the resource pool includes database failure and database switchover information. The IP addresses of each database recorded in the resource pool are updated based on the switchover status to ensure consistency between the resource pool information and the actual environment. In other words, the database type corresponding to each IP address can be determined based on the resource pool information.

[0089] For example, based on the resource pool interface, the resource pool information corresponding to the IP address of the asynchronous standby database corresponding to the backup script is obtained. If it is determined that the database type recorded in the resource pool information is an asynchronous standby database, the backup script is run, and a database backup is performed on the database. Conversely, if the database type recorded in the resource pool information is not an asynchronous standby database, it indicates that an error has occurred in this step, and / or that an error has occurred in the database type determination step before this step. In this case, an alarm will be triggered to remind the operator to diagnose and repair the relevant fault.

[0090] Based on the above embodiments, in order to avoid database failures during database backup, it is necessary to diagnose the database performance before performing database backup, so as to avoid database backup failures due to database performance defects, thereby improving database security.

[0091] As an implementable approach, based on the above embodiments, in one embodiment, before running the backup script, the database backup method provided in this application further includes: determining whether the backup script meets preset running conditions; and executing the backup script if the backup script meets the preset running conditions.

[0092] Specifically, based on the logical information of the backup script, the performance data of the database corresponding to the backup script can be determined. This performance data includes: database system load, disk space, and the number of database threads. It is then determined whether the database performance data meets the preset operating conditions, i.e., whether the database can meet the database backup requirements.

[0093] If the performance of the asynchronous backup database does not meet the preset operating conditions, an alarm will be triggered to remind operators to diagnose and repair the relevant faults.

[0094] For example, in order to improve the management capabilities of database backups and to collect statistics on the switching and backup status of each database in the database system, a database backup platform can be developed using Python based on the Django framework. This platform can be used to collect daily backup statistics, schedule the execution time of backup scripts, and control the backup work to be carried out during the off-peak hours of business at night, so as to avoid generating a large load on the database due to backups when the database is under high load.

[0095] Specifically, in one embodiment, an alarm is triggered if the database has not completed the primary / standby database switchover operation, or if the read / write state is not read-only, or if the database type corresponding to the IP address of the asynchronous standby database is not asynchronous, or if the asynchronous standby database does not meet the preset operating conditions.

[0096] The alarm function mainly refers to reporting fault information. The fault information can be sent to relevant operators via SMS, or it can be reported through other means such as indicator lights or sounds. This application embodiment does not limit the scope of the alarm function.

[0097] It should be noted that each implementable method in the embodiments of this application can be implemented individually or in any combination without conflict. The embodiments of this application do not impose any limitations.

[0098] The database backup method provided in this application obtains database configuration information, including the asynchronous standby database IP address and the backup script IP address. Based on the database configuration information, it determines whether the backup script IP address and the asynchronous standby database IP address are the same. If they are different, the backup script IP address is replaced with the asynchronous standby database IP address. The backup script is then run to perform a database backup. This database backup method, before backing up the database after a primary / standby switchover, first determines the database type of the database corresponding to the execution script. If the database is determined to be an asynchronous standby database, the backup is performed. This effectively avoids backing up the primary database, thus preventing business congestion caused by primary database backups, ensuring the normal operation of the primary database, and improving database security.

[0099] This application provides a database backup apparatus to address the low security shortcomings of existing database backup methods. For example... Figure 6 The diagram shown is a schematic diagram of the structure of a database backup device provided in an embodiment of this application. The device 60 includes: an acquisition module 601, a judgment module 602, a configuration module 603, and a backup module 604.

[0100] The acquisition module 601 is used to acquire database configuration information, including the asynchronous standby database IP address and the backup script IP address. The judgment module 602 is used to determine whether the backup script IP address and the asynchronous standby database IP address are the same based on the database configuration information. The configuration module 603 is used to replace the backup script IP address with the asynchronous standby database IP address if the backup script IP address and the asynchronous standby database IP address are different. The backup module 604 is used to run the backup script to perform database backup.

[0101] Specifically, in one embodiment, the acquisition module 601 is further configured to: acquire monitoring information of the database; and determine whether the database has completed the primary / standby database switchover operation based on the monitoring information.

[0102] If the database has completed the primary / standby switchover operation, proceed with the steps to obtain database configuration information.

[0103] Specifically, in one embodiment, the determination module 602 is further configured to: obtain the database status of the master database and determine whether the database status is alive;

[0104] If the database is in a live state, execute the steps to run the backup script.

[0105] Specifically, in one embodiment, the determination module 602 is further configured to: obtain the read / write status of the asynchronous backup library, and determine whether the read / write status is a read-only status;

[0106] If the read / write state is read-only, execute the steps to run the backup script.

[0107] Specifically, in one embodiment, the determination module 602 is further configured to: obtain resource pool information corresponding to the IP address of the asynchronous backup library;

[0108] Determine whether the database type corresponding to the IP address of the asynchronous standby database is an asynchronous standby database based on the resource pool information; if the database type corresponding to the IP address of the asynchronous standby database is an asynchronous standby database, execute the steps to run the backup script.

[0109] Specifically, in one embodiment, the determination module 602 is further configured to: determine whether the backup script meets the preset running conditions;

[0110] If the backup script meets the preset running conditions, execute the steps to run the backup script.

[0111] Specifically, in one embodiment, the judgment module 602 is further configured to: issue an alarm when the database has not completed the primary / standby database switchover operation, or when the read / write state is not read-only, or when the database type corresponding to the IP address of the asynchronous standby database is not asynchronous standby database, or when the backup script does not meet the preset running conditions.

[0112] This application provides a database backup device for executing the database backup method provided in the above embodiments. Its implementation and principle are the same, and will not be described again.

[0113] This application also provides an electronic device for performing the methods provided in the above embodiments.

[0114] like Figure 7 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. The electronic device 70 includes at least one processor 71 and a memory 72;

[0115] In this embodiment, at least one processor executes computer execution instructions stored in memory, causing the at least one processor to execute the instructions of any of the methods described in the foregoing embodiments.

[0116] This application provides an electronic device for executing the database backup method provided in the above embodiments. Its implementation method and principle are the same, and will not be described again.

[0117] This application provides a storage medium containing computer-executable instructions. The storage medium stores computer processor execution instructions, and when the processor executes the computer execution instructions, it implements the method provided in any of the above embodiments.

[0118] The storage medium containing computer-executable instructions in this application embodiment can be used to store the computer-executable instructions of the database backup method provided in the foregoing embodiments. Its implementation method and principle are the same, and will not be described again.

[0119] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A database backup method, characterized in that, include: Obtain database configuration information, which includes: asynchronous standby database IP address and backup script IP address, which are obtained from the database system through a VIP viewing tool; Based on the database configuration information, determine whether the backup script IP address is the same as the asynchronous backup database IP address; If the backup script IP address is different from the asynchronous backup database IP address, replace the backup script IP address with the asynchronous backup database IP address; Run the backup script to perform a database backup; Before running the backup script, the method further includes: Based on the resource pool interface, obtain the resource pool information corresponding to the IP address of the asynchronous backup library; Based on the resource pool information, determine whether the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database; if the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database, determine whether the backup script meets the preset running conditions based on the performance data of the database. If the backup script meets the preset running conditions, obtain the read / write status of the asynchronous backup database and determine whether the read / write status is read-only. When the read / write status is read-only, the step of running the backup script is executed; wherein, the read / write status of the primary database is readable / writable or writable, and the read / write status of the asynchronous backup database is read-only. The business data interacts with the database based on the VIP connection. When the primary database fails, the database switching tool switches the VIP connection port to the corresponding asynchronous standby database to enable normal interaction of business data.

2. The method according to claim 1, characterized in that, Before obtaining the database configuration information, the method further includes: Obtain the monitoring information of the database; determine whether the database has completed the primary / standby database switchover operation based on the monitoring information; If the database has completed the primary / standby database switchover operation, then the step of obtaining the database configuration information is executed.

3. The method according to claim 1, characterized in that, Before running the backup script, the method further includes: Obtain the database status of the primary database and determine whether the database status is alive. If the database is in an active state, execute the step of running the backup script.

4. The method according to claim 2 or 3, characterized in that, An alarm will be triggered if the database fails to complete the primary / standby database switchover operation, or if the read / write status is not read-only, or if the database type corresponding to the IP address of the asynchronous standby database is not asynchronous, or if the backup script does not meet the preset operating conditions.

5. A database backup device, characterized in that, include: Acquisition module, judgment module, configuration module, and backup module; The acquisition module is used to acquire database configuration information, wherein the database configuration information includes: asynchronous standby database IP address and backup script IP address, which are obtained from the database system through a VIP viewing tool; The judgment module is used to determine whether the backup script IP address is the same as the asynchronous backup database IP address based on the database configuration information. The configuration module is used to replace the backup script IP address with the asynchronous backup database IP address when the backup script IP address is different from the asynchronous backup database IP address. The backup module is used to run the backup script to perform database backup; The judgment module is also used to: obtain resource pool information corresponding to the IP address of the asynchronous backup library based on the resource pool interface; Based on the resource pool information, determine whether the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database; if the database type corresponding to the IP address of the asynchronous backup database is an asynchronous backup database, determine whether the backup script meets the preset running conditions based on the performance data of the database. If the backup script meets the preset running conditions, Obtain the read / write status of the asynchronous backup database and determine whether the read / write status is read-only. When the read / write status is read-only, the step of running the backup script is executed; wherein, the read / write status of the primary database is readable / writable or writable, and the read / write status of the asynchronous backup database is read-only. The business data interacts with the database based on the VIP connection. When the primary database fails, the database switching tool switches the VIP connection port to the corresponding asynchronous standby database to enable normal interaction of business data.

6. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-4.

7. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the method as described in any one of claims 1-4.