CN116107803A - Database backup method, system, electronic equipment and storage medium - Google Patents

Database backup method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN116107803A
CN116107803A CN202211494259.7A CN202211494259A CN116107803A CN 116107803 A CN116107803 A CN 116107803A CN 202211494259 A CN202211494259 A CN 202211494259A CN 116107803 A CN116107803 A CN 116107803A
Authority
CN
China
Prior art keywords
backup
database
frequency
backup frequency
application system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211494259.7A
Other languages
Chinese (zh)
Inventor
余恬恬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Financial Technology Co Ltd
Original Assignee
Bank of China Financial Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Financial Technology Co Ltd filed Critical Bank of China Financial Technology Co Ltd
Priority to CN202211494259.7A priority Critical patent/CN116107803A/en
Publication of CN116107803A publication Critical patent/CN116107803A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a database backup method, a system, electronic equipment and a storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: acquiring a configuration file of a first application system; based on the configuration file, obtaining the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through the second application system; updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database; and backing up the data transmitted by the first application system to a third party database according to the updated backup frequency. The invention realizes the dynamic configuration of the backup mechanism among different databases so as to uniformly backup all the databases and improve the synchronism of backup data.

Description

Database backup method, system, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a database backup method, a system, an electronic device, and a storage medium.
Background
Database backup is widely used in data management systems for various industries. In particular, in a banking system, the security of data relates to whether the whole banking system can normally operate or not, and finally relates to whether normal service can be provided or not, so that the data is completely and effectively backed up, the data protection in the whole banking system is crucial, and the basis for ensuring normal and efficient service to clients is ensured.
With the continuous development of the computer industry, application systems are also becoming more and more complex, and the application systems need to perform data backup across multiple databases of different sites, service units or computing platforms on physical nodes. In the prior art, the data backup process mainly depends on manual predefining of backup mechanisms of all databases and executing the data backup.
However, because different backup mechanisms exist between different databases, when the data in the different databases are uniformly backed up, it is difficult to uniformly backup all the databases according to a specific database backup mechanism by manpower, so that the backup data of the different databases are not synchronous.
Disclosure of Invention
The invention provides a database backup method, a system, electronic equipment and a storage medium, which are used for solving the defect that backup data of different databases are not synchronous due to the fact that the backup mechanism of each database is predefined and data backup is executed manually in the prior art, and realizing unified data backup of multiple databases.
The invention provides a database backup method, which comprises the following steps:
acquiring a configuration file of a first application system;
based on the configuration file, acquiring the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system;
updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database;
and backing up the data transmitted by the first application system to the third party database according to the updated backup frequency.
According to the database backup method provided by the invention, the backup frequency of the third party database is updated according to the backup frequency of the local database and the backup frequency of the third party database, and the method comprises the following steps:
determining a target backup frequency according to the backup frequency of the local database; the target backup frequency is greater than or equal to the backup frequency of the local database;
Comparing the backup frequency of the third party database with the target backup frequency;
generating a system notification under the condition that the backup frequency of the third-party database is less than the target backup frequency according to the comparison result;
and sending the system notification to the second application system so that the second application system can update the backup frequency of the third-party database according to the target backup frequency in the system notification.
According to the database backup method provided by the invention, the backup frequency of the local database and the backup frequency of the third party database are obtained based on the configuration file, and the method comprises the following steps:
analyzing the backup strategy of the local database from the configuration file and the backup strategy of the third party database;
and acquiring the backup frequency of the local database according to the backup strategy of the local database, and acquiring the backup frequency of the third-party database according to the backup strategy of the third-party database.
According to the method for backing up the database provided by the invention, the backup frequency of the local database is obtained according to the backup strategy of the local database, and the method comprises the following steps:
Acquiring the backup frequency of the local database according to a backup time table in a backup strategy of the local database;
or, taking the backup frequency in the backup strategy of the local database as the backup frequency of the local database.
According to the database backup method provided by the invention, the method further comprises the following steps:
under the condition that a query request sent by the first application system is received, acquiring a database to be queried and data to be queried according to the query request;
acquiring an access interface of the second application system from the configuration file under the condition that the database to be queried is the third party database;
the query request is sent to the second application system through the access interface so that the second application system returns response information corresponding to the query request;
the response information is generated by the second application system based on the Internet protocol address and the user information of the third party database in the configuration file, accessing the third party database, inquiring the data to be inquired in the third party database based on the backup data storage address of the third party database in the configuration file and according to the inquiring result.
According to the database backup method provided by the invention, the method further comprises the following steps:
for a storage medium in either one of the local database and the third party database;
under the condition that the data of the storage medium is lost, acquiring a storage record and a backup record of any database from a transaction log of any database;
comparing the stored record with the backup record;
determining data to be recovered according to the comparison result; the data to be recovered is the data lost by the storage medium;
and restoring the data to be restored in the backup file corresponding to the storage medium.
The invention also provides a database backup system, which comprises:
the first acquisition module is used for acquiring a configuration file of the first application system;
the second acquisition module is used for acquiring the backup frequency of the local database and the backup frequency of the third-party database based on the configuration file; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system;
The backup rule application module is used for updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database;
and the data storage module is used for backing up the data transmitted by the first application system into the third-party database according to the updated backup frequency.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements any one of the database backup methods described above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a database backup method as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a database backup method as described in any one of the above.
According to the database backup method, the system, the electronic equipment and the storage medium, the backup frequency of the local database and the third-party database in the configuration file of the first application system is obtained, and the backup frequency of the third-party database is updated, so that the backup frequency of the third-party database is greater than or equal to the backup frequency of the local database, and a backup mechanism of the third-party database is dynamically configured; and then, according to the updated backup frequency, backing up the data transmitted by the first application system into a third party database so as to realize unified backup of all databases according to the dynamically configured backup frequency, further improve the synchronism of the backup data of different databases, ensure the timely backup of the data of the local database to the third party database through the update of the backup frequency, and reduce the loss or error of the data when a fault occurs.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a database backup method according to the present invention;
FIG. 2 is a second flowchart of a database backup method according to the present invention;
FIG. 3 is a schematic diagram of interaction among a first application system, a second application system and a database of the database backup method provided by the invention;
FIG. 4 is a schematic diagram of a database backup system according to the present invention;
FIG. 5 is a second schematic diagram of a database backup system according to the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The use and reliance on data in today's society is expanding. Today, any industry relies more on data to operate a service than ever before. Various industries use a variety of conventional mechanisms for protecting and covering data. These backup systems vary in the level of protection provided, the time required to restore the backup data, and the difficulties associated with the interaction of the business, other systems, and applications. For example, most businesses typically use some sort of backup program to backup data to a backup system, in which case a particular database or application using disk will cease to run and backup information. Alternatively, a backup system may be used when a disk is damaged or lost. Typically the backup system uses the log to determine the appropriate point in time to which the database or application should be restored.
Data backup applications are also particularly important in banking and customers of banks require higher availability, accuracy and real-time data. The security of the data relates to whether the whole banking system can normally operate, and finally relates to whether normal service can be provided. Therefore, the data protection of the data of the whole system is very important, and is the basis for ensuring that normal and efficient services are provided for clients.
At present, the most effective application of data protection is data backup, and the methods of data backup generally include manual backup, automatic backup, LAN (Local Area Network ) backup, etc. The different backup methods have different effects and are mainly characterized in the aspects of performance, automation degree, influence degree on the application of the existing system, management and expandability. However, with the continuous development of the computer industry, the application system is more and more complex, and the application system spans databases of physically different sites, service units or computing platforms, if the application system needs to directly or indirectly access different local and third party databases, when the databases have different backup mechanisms or different backup frequencies, if the data of a certain remote database is lost, after the data backup is restored by the database, the data in the database is lower than the backup frequency of the local database because the backup frequency is lower, and the data returned to the application system by the third party database may be invalid outdated data, so that the data is asynchronous.
It may be difficult to fully identify the different databases used directly or indirectly by the application and to uniformly back up the data for multiple databases.
In view of this problem, an embodiment of the present invention provides a database backup method, where a minimum backup frequency is established for all databases directly or indirectly used by a specified application program, and the database backup method is intended for managing a database backup method for directly or indirectly providing data to a first application program, specifically, by obtaining a backup frequency of a local database of the first application system and a backup frequency of a third party database according to a configuration file, so as to adaptively update the backup frequency of the third party database according to the backup frequency of the local database of the first application system and the backup frequency of the third party database, dynamically configure backup mechanisms between different databases, and implement unified backup for all databases, thereby improving synchronization of backup data.
It should be noted that, the essence of the computer database backup is a countermeasure developed to avoid the adverse effect of the failure on the normal operation of the computer; the fault prevented by the method may be a data loss caused by a computer fault or other factors, or may be a data information asynchronous condition, which is not specifically limited in this embodiment. The computer database backup technology is the integration process of copying and copying. The computer database backup mode can be dynamic backup, the dynamic backup can better protect the integrity and instantaneity of data materials, timely process the occurrence of data loss and other conditions, and simultaneously can restore the initial state of the data.
The database backup method of the present invention is described below in conjunction with fig. 1.
As shown in fig. 1, the present embodiment provides a flowchart of a database backup method, which includes the following steps:
step 101, acquiring a configuration file of a first application system;
the first application system represents a logic entity to be backed up, and may be one or more newly built software application systems, one or more updated software application systems, one or more software applications and related information, and in this embodiment, the form of the first application system is not specifically limited.
Illustratively, the first application system may be banking management software, accounting software, engineering budget software, educational assistance software.
The first application system may directly access data from one database, or may query other application programs to obtain additional data in another database, or may obtain a processing result based on the additional data in another database, and in this embodiment, the function of the first application system is not specifically limited.
The configuration file is a file for carrying out different configurations on different objects; the configuration file of the first application system is configuration file information written in advance, and the configuration file needs to be manually modified if information such as newly added database resources exists later. The stored content can be local database resources directly accessed by the first application system, second application systems indirectly accessed and database resource information directly accessed by the second application systems, and the stored backup parameters of each database comprise information such as backup frequency, backup schedule, backup address and the like.
The configuration file may be stored in the form of a data list. The data list includes a data dictionary, a network management document, a topology map, a database log, a business process model, a workflow graph, an application system configuration file, a disaster recovery plan, and a service registry as a computing system implemented for a service oriented architecture.
Optionally, in the case that the database backup is required, selecting a configuration file of the first application system from application system configuration files of the data list according to the identification information of the first application system.
Step 102, based on the configuration file, obtaining the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system;
the first application system may acquire the corresponding data by directly accessing a local database, or may acquire related data information from the second application system. Illustratively, the second application system obtains the data information by querying a third party database and returns the data information to the first application system via the interface. Thus, in this embodiment, the databases that the first application system needs to directly or indirectly use are a local database and a third party database.
The backup frequency is the frequency of the backup operation of the system at regular intervals; the backup frequency can be preset manually in advance, can be calculated through a manually preset backup mechanism, and can be set by the system; the source of the backup frequency is not particularly limited in this embodiment.
Optionally, after the configuration file of the first application system is obtained, the backup frequency of the local database and the backup frequency of the third party database may be directly or indirectly obtained from the configuration file.
The specific obtaining mode may be that firstly, the local database backup parameter of the first application system is obtained from the configuration file, so as to directly obtain the backup frequency of the local database from the local database backup parameter; or acquiring the parameters related to the backup frequency from the backup parameters of the local database, so as to indirectly calculate and acquire the backup frequency of the local database according to the parameters related to the backup frequency.
Step 103, updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database;
Optionally, after the backup frequency of the local database and the backup frequency of the third party database are obtained, determining a target backup frequency according to the backup frequency of the local database; or determining the target backup frequency according to the backup frequency of the local database and the backup frequency of the third-party database.
And then comparing the backup frequency of the third-party database with the target backup frequency, and updating the backup frequency of the third-party database according to the comparison result so that the updated backup frequency is greater than or equal to the backup frequency of the local database.
Optionally, the specific value of the updated backup frequency may be set through manual selection, or may be calculated through a manually preset backup mechanism, or may be calculated through a preset update rule; the calculation method of the specific numerical value of the backup frequency after updating is not particularly limited in this embodiment.
And 104, backing up the data transmitted by the first application system to the third party database according to the updated backup frequency.
The data transmitted by the first application system may be structured data, time sequence data, GIS (Geographic Information System ) data, graph data, text data, etc., and the type of the data transmitted by the first application system is not specifically limited in this embodiment.
Taking a first application system as a bank management system as an example, the description of database backup in the embodiment is developed;
the core components of the bank information system comprise a file system, a database and the like, and the data in the system is the core in the core. The security, integrity and real-time of the data is related to whether the whole banking system can operate normally. For banking systems, the faults may be physical faults that cause damage to software and hardware that the system cannot operate properly, or logical faults that cause damage to some information that the system is operating properly. For example, physical failures are easily found and handled in time, which may be operating system failures, application program damages, disk failures, host failures, etc., and logical failures are not easily found, but can be recovered to a normal state as long as there is original data, which may be data file loss, program loss, partial data in the system is erroneous or data is not up to date valid data, etc., and the failure type for backup is not specifically limited in this embodiment.
The bank information system data to be backed up by the third party database includes, but is not limited to, any one or more of manager login authority data, customer name data, account data and telephone data, which is not specifically limited in this embodiment.
Optionally, after the configuration file of the bank information system is obtained, based on the configuration file, the backup frequency of the local database of the bank information system and the backup frequency of the third party database are obtained and compared, so that the backup frequency of the third party database is dynamically updated according to the comparison result.
And according to the updated backup frequency, carrying out data backup. For example, the data of one or more of the login authority data of the administrator, the name data of the client, the account data and the telephone data is backed up to a third party database, so that the database backup is realized.
According to the database backup method provided by the embodiment, the backup frequency of the local database and the third-party database in the first application system configuration file is obtained, and the backup frequency of the third-party database is updated, so that the backup frequency of the third-party database is greater than or equal to the backup frequency of the local database, and a backup mechanism of the third-party database is dynamically configured; and then, according to the updated backup frequency, backing up the data transmitted by the first application system into a third party database so as to realize unified backup of all databases according to the dynamically configured backup frequency, further improve the synchronism of the backup data of different databases, ensure the timely backup of the data of the local database to the third party database through the update of the backup frequency, and reduce the loss or error of the data when a fault occurs.
Based on the foregoing embodiment, in this embodiment, updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database includes: determining a target backup frequency according to the backup frequency of the local database; the target backup frequency is greater than or equal to the backup frequency of the local database; comparing the backup frequency of the third party database with the target backup frequency; generating a system notification under the condition that the backup frequency of the third-party database is less than the target backup frequency according to the comparison result; and sending the system notification to the second application system so that the second application system can update the backup frequency of the third-party database according to the target backup frequency in the system notification.
It can be appreciated that in the backup frequency update process, the backup frequencies of the local database and the third party database may be compared to determine whether the backup frequency of the local database is less than or equal to the backup frequency of the third party database.
Optionally, the backup frequency of the local database may be directly used as the target backup frequency, or the target backup frequency may be indirectly determined according to the backup frequency of the local database; and indirectly determining that the target backup frequency is greater than the backup frequency of the local database.
As shown in fig. 2, the step of updating the backup frequency includes:
step 201, acquiring configuration file information;
step 202, identifying all database information used by a first application system;
step 203, judging for each database;
step 204, comparing the determined target backup frequency with the backup frequency of the third party database, and judging whether the backup frequency of the database is smaller than the target backup frequency;
after step 204 is completed, a comparison result is obtained, where the result may be that the target backup frequency is less than or equal to the backup frequency of the third party database, and at this time, the result after the backup frequency of the third party database is updated is the original backup frequency, that is, the original backup frequency is not changed, which is not specifically analyzed in this embodiment. And continuing to judge the backup frequency of the next third party database; otherwise, go to step 205;
step 205, when the target backup frequency is determined to be greater than the backup frequency of the third party database, the processing program of the first application system marks the third party database, generates a corresponding system notification, and sends the corresponding system notification to the application program corresponding to the second application system, so that the second application system is required to update the backup frequency of the third party database according to the target backup frequency, and the backup frequency after the update of the third party database is greater than or equal to the backup frequency of the local database.
Wherein in step 203 the backup program starts performing the iterative process of steps 203-205 once for each database identified in step 202. Each iteration of the iterative process is associated with the target backup frequency determined in step 201 or 202.
When the backup program has performed the iterative process of steps 203-205 for all databases identified in step 202, the iterative process ends and the entire process ends synchronously. At this point, the method of the present embodiment will identify each database storing the target application dependency information and will mark or otherwise identify any database associated with the backup schedule so that the backup data required by the application is up-to-date throughout the system.
According to the embodiment, firstly, the appropriate target backup frequency which is larger than or equal to the local database is determined through the backup frequency of the local database; and then comparing the target backup frequency with the backup frequency of the third-party database, and updating the backup frequency of the third-party database based on the target backup frequency after determining that the target backup frequency is greater than the backup frequency of the third-party database, thereby achieving the purpose that the backup frequency of the third-party database is greater than or equal to the backup frequency of the local database, realizing the backup mechanism between different databases to uniformly backup all databases and improving the synchronism of backup data.
Based on the foregoing embodiment, in this embodiment, obtaining the backup frequency of the local database and the backup frequency of the third party database based on the configuration file includes: analyzing the backup strategy of the local database from the configuration file and the backup strategy of the third party database; and acquiring the backup frequency of the local database according to the backup strategy of the local database, and acquiring the backup frequency of the third-party database according to the backup strategy of the third-party database.
The backup policy is a policy for automatically performing data backup by setting settings such as backup content, backup schedule, backup frequency, and backup mode. The backup policy may be that the backup content is completely backed up each time, or that the backup is performed for the first time, and then each backup is performed only for incremental backup of updated or modified data, or that the backup policy may be performed for the first time, and then each time, all data different from the first backup is performed for differential backup, where the embodiment does not specifically limit whether the backup policy is completely backed up.
The backup mode in the backup policy may be a LAN backup mode that can be used for all storage types, or a LAN-Free (without a local area network) backup that copies data to the backup storage device by the fast random storage device, or a SAN Server-Free (without a Server) backup that is specific to a SAN (Storage Area Network ) architecture, and the backup mode is not specifically limited in this embodiment.
The embodiment first analyzes a configuration file of a first application system to obtain a backup strategy of a local database and a backup strategy of a third party database. Correspondingly, the backup frequency of the local database and the backup frequency of the third party database are directly or indirectly obtained from the backup strategy of the local database and the backup strategy of the third party database, so that the two are compared, the backup mechanism among different databases is dynamically configured, unified backup of all databases is realized, and the synchronism of backup data is improved.
Based on the foregoing embodiment, in this embodiment, obtaining the backup frequency of the local database according to the backup policy of the local database includes: acquiring the backup frequency of the local database according to a backup time table in a backup strategy of the local database; or, taking the backup frequency in the backup strategy of the local database as the backup frequency of the local database.
The method for obtaining the backup frequency may be according to the number of times of database backup under the same time condition, or may be determined according to a time period required by the same number of times of backup, and the method for determining the backup frequency in this embodiment is not specifically limited.
In some embodiments, other criteria may be considered in addition to comparing the frequency magnitudes between the two backup frequencies. Illustratively, step 204 may further consider the synchronization of the backup schedule of the database and the backup schedule of the application. These criteria are predefined by the system administrator, can be updated later on demand, and can use many other criteria to synchronize the backup mechanisms of the different databases.
Optionally, the backup schedule is used to define the time nodes at which the data base performs backup and archiving operations.
Optionally, in the process of obtaining the backup frequency of the local database, the backup frequency of the local database can be obtained from the backup strategy of the local database, and if the backup frequency of the local database is obtained, the backup frequency of the local database is directly used as the backup frequency of the local database; if not, the backup time table of the local database is obtained from the backup strategy of the local database, and the backup frequency of the local database is calculated and obtained according to the backup time nodes in the backup time table and the time interval of each backup time node.
It should be noted that the step of obtaining the backup frequency is only a reference, and is not particularly limited. For example, the backup frequency of the local database can also be calculated and obtained directly according to the backup schedule in the backup strategy of the local database.
Similarly, the step of obtaining the backup frequency of the third party database may refer to the step of obtaining the backup frequency of the local database, which is not described herein.
In this embodiment, it is first determined whether the backup frequency of the local database exists as the content of the backup schedule in the backup policy of the local database or directly as the content of the backup policy of the local database; then, correspondingly, the backup frequency in the backup strategy of the local database can be obtained as the backup frequency of the local database, or the backup frequency of the local database can be directly obtained from the backup strategy of the local database as the backup frequency of the local database, so that the flexibility of database backup is improved.
On the basis of the foregoing embodiment, the method in this embodiment further includes: under the condition that a query request sent by the first application system is received, acquiring a database to be queried and data to be queried according to the query request; acquiring an access interface of the second application system from the configuration file under the condition that the database to be queried is the third party database; and sending the query request to the second application system through the access interface so that the second application system returns response information corresponding to the query request.
The database to be queried is a database acquired for the corresponding query request. The database to be queried may be a structured database, a time sequence database, a GIS database, a graph database, or a text database, and the type of the database to be queried is not particularly limited in this embodiment.
Correspondingly, the data to be queried is the data in the database to be queried acquired aiming at the corresponding query request. The data to be queried may be structured data, time sequence data, GIS data, graph data, text data, and the type of the data to be queried is not particularly limited in this embodiment.
Optionally, under the condition that a query request input by a user and sent by the first application system is received, determining a database where the data to be queried is located and the data to be queried in the database according to the specific query request.
It can be appreciated that after the access interface of the second application system is obtained from the configuration file of the first application system, other relevant information in the configuration file may be obtained, including, but not limited to, an IP address (Internet Protocol Address ) of the third party database, user information, a backup data storage address, and the like, so as to improve the response efficiency of the query request.
The access interface of the second application system may be a command interface for organizing and controlling execution of a job or managing a computer system by using an operation command, or may be a system call interface for requesting the operation system to provide a service. For example, the service provided by the system call interface for requesting the operating system may be to apply for and release resources such as peripheral devices, control the execution speed of the program, and the like. The type of the access interface of the second application system is not particularly limited in this embodiment.
The response information is generated by the second application system based on the IP address and the user information of the third party database in the configuration file, accessing the third party database, inquiring the data to be inquired in the third party database based on the backup data storage address of the third party database in the configuration file and according to the inquiring result.
The IP address is a unified address format provided by the IP protocol, and a logic address is allocated to each network and each host on the Internet so as to shield the difference of physical addresses.
The user information is information which needs to be verified when an administrator obtains each request authority. The user information can be manually input into the database or indirectly imported through other databases; the source of the user information of the third party database is not particularly limited in this embodiment.
In this embodiment, after receiving a query request sent by a user through a first application system, other query related information such as an access interface of a second application system, an IP address of a third party database, user information, a backup data storage address, and the like is obtained from a configuration file of the first application system; after the query request and related information are output to the second application system through the access interface, the second application system firstly finds and accesses the third party database based on the IP address and the user information of the third party database in the configuration file, then searches the data to be queried in the third party database based on the backup data storage address of the third party database in the configuration file, and finally queries corresponding information generated by the result according to the backup data storage address, so as to complete the instruction of the user query request.
On the basis of the foregoing embodiment, the method in this embodiment further includes: for a storage medium in either one of the local database and the third party database; under the condition that the data of the storage medium is lost, acquiring a storage record and a backup record of any database from a transaction log of any database; comparing the stored record with the backup record; determining data to be recovered according to the comparison result; the data to be recovered is the data lost by the storage medium; and restoring the data to be restored in the backup file corresponding to the storage medium.
As shown in fig. 3, the database cluster includes a local database and a third party database. For each of the local database and the third party database, the database includes a database table, a storage medium, a backup file of the storage medium, a storage container, and a transaction log, a transaction log storage medium, a transaction log storage container, a backup file of the transaction log.
Wherein the dashed box represents a set of logical entities, i.e. sub-components of the first application system, which may store information on which the first application system depends. In this embodiment, two logical entities are shown, namely a local database and a third party database. The database table contains information used directly or indirectly by the first application system, which information depends on information retrieved from a database stored on a physical or virtual persistent storage medium.
Wherein the storage medium represents persistent storage files of corresponding storage folders of the local database and the third party database. The first application system retrieves information from the local database or the third party database and further stores the file information to the local database and the third party database. The local database and the third party database are each associated with one or more backup mechanisms including a repository-specific backup schedule and a repository-specific target backup frequency.
The backup files represent one or more backup files that include backup information that is performed according to a repository-specific backup schedule or a repository-specific target backup frequency.
The storage container represents a storage volume of a storage item partition, and may be a virtual disk created by a virtual machine monitor from the resources that make up the physical volume. The transaction log represents a transaction log that the first application system performs based on information in the local database or the third party database. The transaction log may be created and maintained by the first application system or a different transaction log recording application. These recorded transaction log files may be used to generate reports and perform other functions. If information of the local database and the third party database needs to be recovered from the backup file, any transactions not captured in the backup file may be recovered from the log. Such a mechanism may require that the trace information in the log file be backed up at a higher frequency than the information stored in the data table on the storage medium. In this case, if an event such as downtime occurs, the first application system will be restarted first, and then the local database and the third party database will be restored from the backup file. Finally, any transaction that occurs after the backup file is created will restore the latest backup of the transaction log to the local database and the third party database.
The transaction log storage medium represents a persistent storage medium that stores folders or information stores that store persistent copies of transaction log files. The transaction log storage container represents a physical or virtual persistent storage volume that stores project log files. The transaction log storage container may be a virtual disk created by a virtual machine monitor from the resources that make up the physical volume. The transaction log backup file represents one or more backup files that one or more backup mechanisms will store in a transaction log storage container, which information includes folders or information stores. These backups may be performed according to a repository-specific or storage volume-specific backup schedule or a minimum backup frequency specific to a repository or a specific volume, and these backup schedules and minimum backup frequency may be a function of one or more characteristics of the first application system or log record.
In the embodiment, firstly, a persistent storage file corresponding to a storage folder of a local database and a third party database is introduced; under the condition that the data loss is found in the storage medium, the storage log record file and the backup record file of the corresponding local database or the third party database can be obtained through the transaction log and the backup file in the transaction log storage container; then, comparing and analyzing the obtained storage records and backup records corresponding to the corresponding local database or the third party database; and determining corresponding lost data to be recovered according to the comparison result, and recovering the lost data to a storage medium in a corresponding local database or a third party database so as to ensure that the lost data file can be timely determined and recovered after the fault occurs.
The database backup system provided by the invention is described below, and the database backup system described below and the database backup method described above can be referred to correspondingly.
As shown in fig. 4, the present embodiment provides a database backup system, which includes:
a first acquisition module 401, a second acquisition module 402, a backup rule application module 403, and a data storage module 404, wherein:
the first obtaining module 401 is configured to obtain a configuration file of the first application system;
the second obtaining module 402 is configured to obtain a backup frequency of the local database and a backup frequency of the third party database based on the configuration file; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system;
the backup rule application module 403 is configured to update the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database;
the backup rule application module 403 defines rule information related to the database backup frequency of the update application system. The programmable computer processor or processing system accesses a configuration file which can be stored in the form of a set of predetermined parameters to define backup requirement information of each related database, and the computer processor or processing system requests the application system of the corresponding database to change the database backup mechanism through a specified backup rule and performs dynamic backup processing for the database. The programmable computer processor or processing system, configuration files, and backup rules may vary depending on the requirements of the first application system or system cluster.
The data storage module 404 is configured to backup the data transmitted by the first application system to the third party database according to the updated backup frequency.
The data storage module 404 stores the backup data in the corresponding address by using the storage address information in the configuration file, and saves the database backup resource information. As shown in fig. 5, the database backup system further includes a database information module 501 and a transaction processing module 502.
The database information module 501 collects the local database, remote database, and database information that needs to be used by other system resources accessed by the first application system. Such as the database application IP address, the user information of the database, the backup frequency of the database, the storage address of the database backup data, and the like.
The transaction processing module 502 is configured to access the backup information of the control database, and notify the corresponding application system of the computer processing program by using the minimum backup frequency principle, and dynamically update the backup frequency of the database in real time, so as to realize that the data provided by all databases to the first application system is real-time and accurate.
According to the database backup system provided by the embodiment, the backup frequency of the local database and the third party database in the first application system configuration file is obtained, and the backup frequency of the third party database is updated, so that the backup frequency of the third party database is greater than or equal to the backup frequency of the local database, and a backup mechanism of the third party database is dynamically configured; and then, according to the updated backup frequency, backing up the data transmitted by the first application system into a third party database so as to realize unified backup of all databases according to the dynamically configured backup frequency, further improve the synchronism of the backup data of different databases, ensure the timely backup of the data of the local database to the third party database through the update of the backup frequency, and reduce the loss or error of the data when a fault occurs.
On the basis of the foregoing embodiment, the comparing module in the second obtaining module in this embodiment is configured to: updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; determining a target backup frequency according to the backup frequency of the local database; the target backup frequency is greater than or equal to the backup frequency of the local database; comparing the backup frequency of the third party database with the target backup frequency; generating a system notification under the condition that the backup frequency of the third-party database is less than the target backup frequency according to the comparison result; and sending the system notification to the second application system so that the second application system can update the backup frequency of the third-party database according to the target backup frequency in the system notification.
On the basis of the foregoing embodiment, the backup policy module in the second obtaining module in this embodiment is configured to: based on the configuration file, acquiring the backup frequency of the local database and the backup frequency of the third party database; analyzing the backup strategy of the local database from the configuration file and the backup strategy of the third party database; and acquiring the backup frequency of the local database according to the backup strategy of the local database, and acquiring the backup frequency of the third-party database according to the backup strategy of the third-party database.
On the basis of the foregoing embodiment, the backup frequency module in the backup policy module in this embodiment is configured to: acquiring the backup frequency of the local database according to the backup strategy of the local database; acquiring the backup frequency of the local database according to a backup time table in a backup strategy of the local database; or, taking the backup frequency in the backup strategy of the local database as the backup frequency of the local database.
On the basis of the above embodiment, the system further includes a query module configured to: under the condition that a query request sent by the first application system is received, acquiring a database to be queried and data to be queried according to the query request; acquiring an access interface of the second application system from the configuration file under the condition that the database to be queried is the third party database; the query request is sent to the second application system through the access interface so that the second application system returns response information corresponding to the query request; the response information is generated by the second application system based on the Internet protocol address and the user information of the third party database in the configuration file, accessing the third party database, inquiring the data to be inquired in the third party database based on the backup data storage address of the third party database in the configuration file and according to the inquiring result.
On the basis of the above embodiment, the system further includes a recovery module for: for a storage medium in either one of the local database and the third party database; under the condition that the data of the storage medium is lost, acquiring a storage record and a backup record of any database from a transaction log of any database; comparing the stored record with the backup record; determining data to be recovered according to the comparison result; the data to be recovered is the data lost by the storage medium; and restoring the data to be restored in the backup file corresponding to the storage medium.
Fig. 6 illustrates a physical schematic diagram of an electronic device, as shown in fig. 6, which may include: processor 601, communication interface (Communications Interface) 602, memory 603 and communication bus 604, wherein processor 601, communication interface 602, memory 603 complete the communication between each other through communication bus 604. The processor 601 may invoke logic instructions in the memory 603 to perform a database backup method comprising: acquiring a configuration file of a first application system; based on the configuration file, acquiring the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system; updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database; and backing up the data transmitted by the first application system to the third party database according to the updated backup frequency.
Further, the logic instructions in the memory 603 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing a database backup method provided by the above methods, the method comprising: acquiring a configuration file of a first application system; based on the configuration file, acquiring the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system; updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database; and backing up the data transmitted by the first application system to the third party database according to the updated backup frequency.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a database backup method provided by the above methods, the method comprising: acquiring a configuration file of a first application system; based on the configuration file, acquiring the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system; updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database; and backing up the data transmitted by the first application system to the third party database according to the updated backup frequency.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a ROM or a RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for backing up a database, comprising:
acquiring a configuration file of a first application system;
based on the configuration file, acquiring the backup frequency of the local database and the backup frequency of the third party database; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system;
updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database;
and backing up the data transmitted by the first application system to the third party database according to the updated backup frequency.
2. The database backup method according to claim 1, wherein updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database comprises:
determining a target backup frequency according to the backup frequency of the local database; the target backup frequency is greater than or equal to the backup frequency of the local database;
Comparing the backup frequency of the third party database with the target backup frequency;
generating a system notification under the condition that the backup frequency of the third-party database is less than the target backup frequency according to the comparison result;
and sending the system notification to the second application system so that the second application system can update the backup frequency of the third-party database according to the target backup frequency in the system notification.
3. The database backup method according to claim 1, wherein the obtaining the backup frequency of the local database and the backup frequency of the third party database based on the configuration file includes:
analyzing the backup strategy of the local database from the configuration file and the backup strategy of the third party database;
and acquiring the backup frequency of the local database according to the backup strategy of the local database, and acquiring the backup frequency of the third-party database according to the backup strategy of the third-party database.
4. A method of backing up a database according to claim 3, wherein said obtaining a backup frequency of the local database according to a backup policy of the local database comprises:
Acquiring the backup frequency of the local database according to a backup time table in a backup strategy of the local database;
or, taking the backup frequency in the backup strategy of the local database as the backup frequency of the local database.
5. The database backup method of any of claims 1-4, wherein the method further comprises:
under the condition that a query request sent by the first application system is received, acquiring a database to be queried and data to be queried according to the query request;
acquiring an access interface of the second application system from the configuration file under the condition that the database to be queried is the third party database;
the query request is sent to the second application system through the access interface so that the second application system returns response information corresponding to the query request;
the response information is generated by the second application system based on the Internet protocol address and the user information of the third party database in the configuration file, accessing the third party database, inquiring the data to be inquired in the third party database based on the backup data storage address of the third party database in the configuration file and according to the inquiring result.
6. The database backup method of any of claims 1-4, wherein the method further comprises:
for a storage medium in either one of the local database and the third party database;
under the condition that the data of the storage medium is lost, acquiring a storage record and a backup record of any database from a transaction log of any database;
comparing the stored record with the backup record;
determining data to be recovered according to the comparison result; the data to be recovered is the data lost by the storage medium;
and restoring the data to be restored in the backup file corresponding to the storage medium.
7. A database backup system, comprising:
the first acquisition module is used for acquiring a configuration file of the first application system;
the second acquisition module is used for acquiring the backup frequency of the local database and the backup frequency of the third-party database based on the configuration file; the local database is a database directly accessed by the first application system; the third-party database is a database indirectly accessed by the first application system through a second application system;
The backup rule application module is used for updating the backup frequency of the third party database according to the backup frequency of the local database and the backup frequency of the third party database; the updated backup frequency is greater than or equal to the backup frequency of the local database;
and the data storage module is used for backing up the data transmitted by the first application system into the third-party database according to the updated backup frequency.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the database backup method of any of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the database backup method according to any of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements a database backup method as claimed in any one of claims 1 to 6.
CN202211494259.7A 2022-11-25 2022-11-25 Database backup method, system, electronic equipment and storage medium Pending CN116107803A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211494259.7A CN116107803A (en) 2022-11-25 2022-11-25 Database backup method, system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211494259.7A CN116107803A (en) 2022-11-25 2022-11-25 Database backup method, system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116107803A true CN116107803A (en) 2023-05-12

Family

ID=86256950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211494259.7A Pending CN116107803A (en) 2022-11-25 2022-11-25 Database backup method, system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116107803A (en)

Similar Documents

Publication Publication Date Title
US10657008B2 (en) Managing a redundant computerized database using a replicated database cache
US10671639B1 (en) Selectively replicating changes to hierarchial data structures
US9727273B1 (en) Scalable clusterwide de-duplication
CN108804253B (en) Parallel operation backup method for mass data backup
US20140337988A1 (en) Method and apparatus for database sanitizing
US11687595B2 (en) System and method for searching backups
US10671316B2 (en) System, method, and recording medium for alignment of backup and archival policy
US11494271B2 (en) Dynamically updating database archive log dependency and backup copy recoverability
US11500738B2 (en) Tagging application resources for snapshot capability-aware discovery
US7630955B2 (en) Apparatus, system, and method for analyzing the association of a resource to a business process
US11042454B1 (en) Restoration of a data source
US11966297B2 (en) Identifying database archive log dependency and backup copy recoverability
US11436089B2 (en) Identifying database backup copy chaining
WO2023129342A1 (en) Database management engine for a database management system
CN116107803A (en) Database backup method, system, electronic equipment and storage medium
US8650548B2 (en) Method to derive software use and software data object use characteristics by analyzing attributes of related files
US11675931B2 (en) Creating vendor-neutral data protection operations for vendors' application resources
US11836125B1 (en) Scalable database dependency monitoring and visualization system
CA3173093A1 (en) Secure data replication in distributed data storage environments
US20100125619A1 (en) Deterministic selection of domain controllers in a multi-master database distributed directory service
US11675668B2 (en) Leveraging a cloud-based object storage to efficiently manage data from a failed backup operation
US12026056B2 (en) Snapshot capability-aware discovery of tagged application resources
US11520668B2 (en) Vendor-neutral models of vendors' application resources
US11650975B2 (en) Online file system consistency check for container data on a clustered filesystem
US20220229741A1 (en) Protecting databases in a clusterless availability group

Legal Events

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