Data backup system, method, storage medium, and electronic device
By generating backup policies through a ledger database and backup management platform, backup data of the MySQL database is remotely stored in a distributed object storage system. This solves the problem of large space occupied by the built-in SSD storage disk and the difficulty in management of MySQL database backup data, and achieves efficient backup data management and storage resource saving.
Patent Information
- Application Number
- CN202210744986.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In existing technologies, MySQL database backup data occupies a large amount of space on the built-in SSD storage disk and is difficult to manage, resulting in wasted storage resources and complex backup operations.
A backup strategy is generated using a ledger database. Backup data is remotely stored in a distributed object storage system through a backup management platform. Combined with tape library management of long-term data, unified management and monitoring are achieved.
It enables convenient and efficient management of backup data, saves local storage space, and improves the availability of database groups and the stability of backup data.
Smart Images

Figure CN115080309B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, in particular to a data backup system and method, a storage medium and an electronic device. BACKGROUND
[0002] At present, with the development of open source databases, MySQL databases have been widely used in many enterprises. With the increase of business volume, the amount of data stored in the MySQL database and the number of databases also need to be greatly improved, so it is usually necessary to backup the data in the database to prevent data loss due to database abnormalities.
[0003] The current data backup method usually copies the data in the backup database to the backup directory in the server where the backup database is located, and then backs up the data from the backup directory to the hard disk for storage. However, the management of data backup is decentralized, and unified management and monitoring of backup operations cannot be performed. At the same time, the storage device used when storing backup data in the backup directory is an internal SSD storage disk, but the disk space occupied by the backup directory is about 1.5 times the space required for the actual storage data, and generally the backup data does not completely use the backup disk, resulting in a large amount of remaining space in the internal SSD storage disk that is not fully utilized. Moreover, in order to ensure that the new backup corresponding to the server after the high-availability switch still has sufficient space for backup, multiple servers in the MySQL database group need to reserve storage space, resulting in waste of disk performance and storage resources and increasing storage costs. At the same time, the decentralized Mysql backup management cannot accurately control the backup task and timely discover the backup task failure, and it is also difficult to complete the unified management and update of the backup script. During backup recovery, backup recovery is only performed through manual operation, and the recovery operation is very complex.
[0004] At present, there is no effective solution to the problem of large backup data occupying internal SSD storage disk space and difficult backup data management in the related art. SUMMARY
[0005] The present application provides a data backup system, method, storage medium and electronic device to solve the problem of large backup data occupying internal SSD storage disk space and difficult backup data management in the related art.
[0006] According to an aspect of the present application, a data backup system is provided. The system comprises: a ledger database configured to obtain information of a database group and generate a backup strategy corresponding to the database group, wherein the backup strategy is configured to indicate a backup database in the database group and a backup manner, and the backup database is a database configured to perform a backup task; a backup management platform configured to obtain the backup strategy, perform the backup task of the database group by the backup database in a case that the backup manner is remote backup, and backup data generated by the backup task to a distributed object storage system; and the distributed object storage system configured to receive the data generated by the backup task.
[0007] Optionally, the data backup system further comprises: a database management platform configured to monitor a running condition of the database group, determine a slave database as a master database in a case that a master database in the database group fails, and send a prompt message to the ledger database to prompt the ledger database to change the backup strategy corresponding to the database group.
[0008] Optionally, the data backup system further comprises: a tape library configured to receive target data generated by the backup task, wherein the target data is data with a backup retention period greater than a preset period, and the backup retention period is determined by the backup strategy.
[0009] Optionally, the data backup system further comprises: a database building platform configured to create the database group and send information of the database group to the ledger database, and modify the created database group and send modification information corresponding to the database group to the ledger database to prompt the ledger database to change the backup strategy corresponding to the database group.
[0010] According to an aspect of the present application, a data backup method is provided. The method comprises: obtaining a backup strategy sent by a ledger database, wherein the backup strategy is configured to indicate a backup database in a database group and a backup manner, and the backup database is a database configured to perform a backup task; determining whether the backup manner is remote backup; and performing the backup task of the database group by the backup database in a case that the backup manner is remote backup, and backing up data generated by the backup task to a distributed object storage system.
[0011] Optionally, in a case that the backup manner is remote backup, after the backup task of the database group is performed by the backup database and the data generated by the backup task is backed up to the distributed object storage system, the method further comprises: in a case that a backup recovery instruction is received, parsing a recovery address in the backup recovery instruction; obtaining the backed-up data indicated by the backup recovery instruction, and sending the backed-up data to a database indicated by the recovery address.
[0012] Optionally, the backup strategy includes a backup retention period, the backup database performs a backup task of the database group, and data generated by the backup task is backed up to the distributed object storage system, including: in the case of remote backup, obtaining the backup retention period and determining whether the backup retention period is greater than a preset period; in the case that the backup retention period is less than the preset period, backing up the data generated by the backup task to the distributed object storage system; in the case that the backup retention period is greater than the preset period, backing up the data generated by the backup task to the distributed object storage system and backing up the data generated by the backup task to the tape library.
[0013] Optionally, in the process of performing the backup task of the database group by the backup database, in the case that the backup task fails, a prompt message is generated, wherein the prompt message is used to indicate that the backup task fails.
[0014] According to another aspect of the present application, a data backup method is provided. The method comprises: obtaining information of a database group and generating a backup strategy corresponding to the database group, wherein the backup strategy is used to indicate a backup database in the database group and a backup mode, and the backup database is a database for performing a backup task; sending the backup strategy to a backup management platform to perform a backup task based on the backup strategy by the backup management platform, and backing up data generated by the backup task to a distributed object storage system, wherein the backup task is a backup task performed by the backup database.
[0015] Optionally, obtaining information of a database group and generating a backup strategy corresponding to the database group comprises: obtaining creation information of the database group, and parsing a database to be backed up and a backup database corresponding to the database to be backed up from the creation information; determining backup information, and generating the backup strategy according to the information of the backup database and the backup information, wherein the backup information at least includes one of the following: a backup address, a backup time.
[0016] Optionally, after obtaining information of a database group and generating a backup strategy corresponding to the database group, the method further comprises: when a modification message for a server in the database group is received, changing the backup strategy corresponding to the database group; and / or when a switching message for a master database in the database group is received, changing the backup strategy corresponding to the database group, wherein the switching message is used to indicate switching a slave database in the database group to the master database.
[0017] According to another aspect of the present application, a computer storage medium is also provided, which is used to store a program, wherein the program controls a device where the computer storage medium is located to perform a data backup method when the program is running.
[0018] According to another aspect of the embodiments of the present application, an electronic device is provided, which includes one or more processors and a memory; the memory stores computer readable instructions, and the processor is configured to execute the computer readable instructions, wherein the computer readable instructions perform a data backup method when executed.
[0019] According to the present application, the following system is adopted: an account database is configured to obtain information of a database group and generate a backup strategy corresponding to the database group, wherein the backup strategy is configured to indicate a backup database in the database group and a backup manner, and the backup database is a database configured to perform a backup task; a backup management platform is configured to obtain the backup strategy, and in a case that the backup manner is remote backup, perform the backup task of the database group by the backup database, and backup data generated by the backup task to a distributed object storage system; and the distributed object storage system is configured to receive the data generated by the backup task. The problems of large occupation of built-in SSD storage disk space by backup data and difficulty in management of backup data in the related art are solved. The generation, delivery and management of the backup strategy are performed by the account database and the backup management platform, the backup data is remotely backed up, and the effects of convenient and efficient management of the backup data and saving of local storage space are achieved. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and are used to interpret the illustrative embodiments of the present application and their descriptions, and are not intended to limit the present application. In the drawings:
[0021] Figure 1 is a schematic diagram of a data backup system according to an embodiment of the present application;
[0022] Figure 2 is a flowchart of an optional operation process of a data backup system according to an embodiment of the present application;
[0023] Figure 3 is a flowchart of a data backup method according to an embodiment of the present application;
[0024] Figure 4 is a flowchart of another data backup method according to an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a data backup device according to an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of another data backup device according to an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] It should be noted that the embodiments and features of the present application can be combined with each other if there is no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0029] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0031] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.
[0032] It should be noted that the data backup system, method, storage medium and electronic device determined by the present disclosure can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application field of the data backup system, method, storage medium and electronic device determined by the present disclosure is not limited.
[0033] According to the embodiments of the present application, a data backup system is provided.
[0034] Figure 1 is a schematic diagram of the data backup system provided by the embodiments of the present application. As shown in Figure 1 , the system comprises:
[0035] The account database 101 is used to obtain information of a database group and generate a backup strategy corresponding to the database group, wherein the backup strategy is used to indicate a backup database in the database group and a backup mode, and the backup database is a database performing a backup task.
[0036] Specifically, the information of the database group can be attribute information of a newly added database group, for example, group name, number of databases in the group, settings of a master database and a slave database in the group, and the like. After receiving the information of the database group, the account database 101 stores the information of the database group into the account database 101, sets a slave database in the database group as a backup database, and sets a backup mode of the backup database, for example, remote backup or local backup. After selecting the backup mode, the backup strategy corresponding to the database group can be generated according to the backup mode and the backup database information, and the backup strategy is sent to the backup management platform 102.
[0037] The backup management platform 102 is used to obtain the backup strategy, perform a backup task of the database group through the backup database in the case of remote backup, and backup data generated by the backup task to the distributed object storage system 103.
[0038] Specifically, the backup management platform 102 can receive the backup strategy sent by the account database 101, and perform a backup operation of the corresponding database according to the backup mode in the backup strategy. In the case of remote backup, the backup management platform 102 pushes the backup strategy and the corresponding backup script stored in the backup management platform 102 to the corresponding MYSQL database. After the MYSQL database receives the corresponding backup script, the MYSQL database sends the corresponding backup data in the backup database to the distributed object storage system 103 for backup storage.
[0039] For example, the backup strategy corresponding to the database group A can be remote backup, and the backup database is set as the slave database C. At this time, the backup management platform 102 sends the backup script and the backup strategy to the MYSQL database after receiving the backup strategy. The MYSQL database can include data information of multiple database groups. After the MYSQL database receives the backup script and the backup strategy, the slave database C is set as the backup database through the backup script, and the data in the slave database C is remotely backed up and sent to the distributed object storage system 103 for storage. It should be noted that the backup script will feed back the backup situation to the backup management platform 102 after the backup operation of the backup database in the MYSQL database is completed. The backup management platform 102 can issue an alarm information when receiving the feedback information as a backup exception, so that the operation and maintenance personnel can maintain in time.
[0040] It should be noted that when the backup management platform 102 simultaneously receives multiple backup strategies, the backup script corresponding to each backup management platform 102 can be selected from multiple backup scripts first, the multiple backup strategies are sorted according to the contents of the backup strategies, and the backup operation is executed in sequence, so that each backup operation can be completed within a specified time.
[0041] The distributed object storage system 103 is configured to receive data generated by the backup task.
[0042] Specifically, the distributed object storage system 103 can receive data sent by the backup database in each database group in the MYSQL database, and store the data in the corresponding database, thereby completing remote backup of the data.
[0043] The data backup system provided by the embodiment of the application comprises a ledger database 101, a backup management platform 102, and a distributed object storage system 103. The ledger database 101 is configured to obtain information of a database group and generate a backup strategy corresponding to the database group. The backup strategy is used to indicate a backup database in the database group and a backup mode. The backup database is a database for executing a backup task. The backup management platform 102 is configured to obtain the backup strategy. In a case where the backup mode is remote backup, the backup management platform 102 executes a backup task of the database group through the backup database and backs up data generated by the backup task to the distributed object storage system 103. The distributed object storage system 103 is configured to receive the data generated by the backup task. The data backup system provided by the embodiment of the application solves the problems of large occupation of built-in SSD storage disk space by backup data and difficulty in management of the backup data in the related art. The generation, issuance, and management of the backup strategy are performed through the ledger database 101 and the backup management platform 102. The backup data is remotely backed up, thereby achieving the effects of convenient and efficient management of the backup data and saving of local storage space.
[0044] Optionally, in the data backup system provided by the embodiment of the application, the data backup system further comprises a database management platform configured to monitor a running state of the database group and, in a case where a master database in the database group fails, determine a slave database as the master database and send a prompt message to the ledger database 101 to prompt the ledger database 101 to change the backup strategy corresponding to the database group.
[0045] Specifically, the database management platform can monitor the running state of the database group in the MYSQL database in real time, and in a case where a master database in a certain database group is abnormal, change a slave database in the same group to the master database, change the original master database to the slave database, and perform abnormal processing, thereby ensuring normal operation of the database. The embodiment achieves the effect of improving the availability of the database group.
[0046] It should be noted that in the case of an abnormality of the master database of a certain database group, the backup database may be changed to the master database. Since the database cannot be simultaneously set as the master database and the backup database, other slave databases in the database group need to be changed to the backup database, and the change information is sent to the account database 101. The account database 101 changes the backup strategy according to the backup database change, and sends the changed backup strategy to the backup management platform 102. The backup management platform 102 performs backup script distribution according to the changed backup strategy, thereby setting the backup database in the remaining slave databases in the database group, so as to timely change and manage the backup database.
[0047] Optionally, in the data backup system provided in the embodiment of the present application, the data backup system further comprises: a tape library configured to receive target data generated by a backup task, wherein the target data is data with a backup retention period greater than a preset period, and the backup retention period is determined by a backup strategy.
[0048] Specifically, after the distributed object storage system 103 receives the data sent by the backup database in each database group in the MYSQL database and stores the data to the corresponding database, the backup retention period information in the backup strategy corresponding to each database needs to be obtained, and the backup retention period information is compared with the preset period. In the case where the backup retention period is greater than the preset period, it indicates that the backup data needs to be saved for a long time, so the backup data with the backup retention period greater than the preset period needs to be sent to the tape library for storage. The embodiment stores important data for a long time through the tape library, thereby improving the stability of remote data backup.
[0049] Optionally, in the data backup system provided in the embodiment of the present application, the data backup system further comprises: a database building platform configured to create a database group and send information of the database group to the account database 101, and further configured to modify the created database group and send modification information corresponding to the database group to the account database 101 to prompt the account database 101 to change the backup strategy corresponding to the database group.
[0050] Specifically, the database group information can include attribute information of the database group, for example, the group name of the newly added database group, the number of databases in the group, the settings of the master database and the slave database in the group, and the like. The database building platform can be used to create a newly added database group in the MYSQL database, and send the group information of the newly added database group to the account database 101 for recording. At the same time, when one or more databases in the database group need to be changed, the database building platform can also be used to make the changes, and send the change content to the account database 101, so as to record the change information in time, and modify the corresponding backup strategy in time according to the added or changed information, and send the backup strategy to the backup management platform 102, so as to complete the synchronous adding and changing operation of the backup database. The embodiment manages the added and updated database groups, and improves the management effect of the database groups.
[0051] Figure 2 is an optional data backup system running flowchart provided by the embodiment of the application, as shown in Figure 2 The database building platform newly creates a target database group, sends the data content of the target database group to the MYSQL for storage, and sends the information of the target database group to the account database. The account database stores the information of the target database group, generates a backup strategy according to the information of the target database group, sends the backup strategy to the backup management platform, selects a corresponding backup script according to the backup strategy, pushes the backup strategy and the backup script to the MYSQL database, sends the backup data to the distributed object storage system for storage through the backup database set in the backup strategy, and sends the data that needs to be stored for a long time to the tape library for storage according to the storage time length.
[0052] The backup script sent by the backup management platform will also feed back the backup situation to the backup management platform after the backup operation of the backup database in the MYSQL database is completed. The backup management platform can generate an alarm information when receiving the feedback information of the backup exception, and can send an alarm, so that the operation and maintenance personnel can maintain in time.
[0053] It should be noted that in the case of abnormality of the master database of the target database group, the backup database may be changed to the master database. Since the database cannot be simultaneously set as the master database and the backup database, other slave databases in the database group need to be changed to the backup database, and the change information is sent to the account database. The account database changes the backup strategy according to the backup database change, and sends the changed backup strategy to the backup management platform. The backup management platform performs backup script distribution according to the changed backup strategy, thereby setting the backup database in the remaining slave databases in the database group, so as to timely change and manage the backup database.
[0054] According to an embodiment of the present application, a data backup method is provided. Figure 3 is a flowchart of a data backup method according to an embodiment of the present application. As shown in Figure 3 , the method comprises the following steps:
[0055] Step S301, obtaining the backup strategy sent by the account database, wherein the backup strategy is used to indicate the backup database and the backup mode in the database group, and the backup database is the database performing the backup task.
[0056] Step S302, judging whether the backup mode is remote backup.
[0057] Step S303, in the case of remote backup, performing the backup task of the database group by the backup database, and backing up the data generated by the backup task to the distributed object storage system.
[0058] Specifically, the backup management platform can receive the backup strategy sent by the account database, and perform the backup operation of the corresponding database according to the backup mode in the backup strategy. In the case of remote backup, the backup management platform pushes the backup strategy and the corresponding backup script stored in the backup management platform to the corresponding MYSQL database. After the MYSQL database receives the corresponding backup script, the corresponding backup data in the backup database is sent to the distributed object storage system for backup storage.
[0059] For example, the backup strategy corresponding to the database group A can be remote backup, and the backup database is set to the slave database C. When the backup management platform receives the backup strategy, the backup script and the backup strategy are sent to the MYSQL database. The MYSQL database can include data information of a plurality of database groups. After receiving the backup script and the backup strategy, the MYSQL database sets the slave database C as the backup database through the backup script, and sends the data in the slave database C to the distributed object storage system for storage through remote backup. It should be noted that the backup script will feed back the backup situation to the backup management platform after the MYSQL database completes the remote backup operation. When the backup management platform receives the feedback information and finds that the backup is abnormal, the backup management platform will send an alarm information, so that the operation and maintenance personnel can maintain in time.
[0060] The data backup method provided by the embodiment of the present application acquires the backup strategy sent by the account database, wherein the backup strategy is used to indicate the backup database and the backup mode in the database group, and the backup database is the database for executing the backup task; it is judged whether the backup mode is remote backup; in the case of remote backup, the backup task of the database group is executed through the backup database, and the data generated by the backup task is backed up to the distributed object storage system, thereby solving the problems of large occupation of built-in SSD storage disk space and difficult management of backup data in the related art. Through the generation, issuance and management of the backup strategy by the account database and the backup management platform, the backup data is remotely backed up, thereby achieving the effects of convenient and efficient management of the backup data and saving of the local storage space.
[0061] Optionally, in the data backup method provided by the embodiment of the present application, in the case of remote backup, after the backup database executes the backup task of the database group and the data generated by the backup task is backed up to the distributed object storage system, the method further includes: in the case of receiving a backup recovery instruction, analyzing the recovery address in the backup recovery instruction; acquiring the backed-up data indicated by the backup recovery instruction, and sending the backed-up data to the database indicated by the recovery address.
[0062] Specifically, when sending the backup script and the backup strategy to the MYSQL database, the identifier corresponding to the database group needs to be added in the backup script and the backup strategy, and the same identifier needs to be added in the corresponding backup database in the distributed object storage system when the MYSQL database sends the backup data to the distributed object storage system, where the identifier can be a timestamp or an identifier, etc. At this time, when the distributed object storage system receives an instruction to obtain the backup data, the distributed object storage system will analyze the identifier, and after obtaining the identifier information, the backup data is sent to the database group with the same identifier in the MYSQL database, so as to complete the recovery operation of the backup data. The embodiment achieves the effect of conveniently and accurately recovering the backup data.
[0063] Optionally, in the data backup method provided in the embodiment of the application, the backup strategy includes a backup retention time length, the backup database executes the backup task of the database group, and the data generated by the backup task is backed up to the distributed object storage system, including: in the case of remote backup, obtaining the backup retention time length, and determining whether the backup retention time length is greater than a preset time length; in the case that the backup retention time length is less than the preset time length, backing up the data generated by the backup task to the distributed object storage system; in the case that the backup retention time length is greater than the preset time length, backing up the data generated by the backup task to the distributed object storage system and backing up the data generated by the backup task to the tape library.
[0064] Specifically, after the distributed object storage system receives the data sent by the backup database in each database group in the MYSQL database and stores the data to the corresponding database, the backup retention time length information in the backup strategy corresponding to each database needs to be obtained, and the backup retention time length information is compared with the preset time length. In the case that the backup retention time length is greater than the preset time length, it indicates that the backup data needs to be saved for a long time, so the backup data with the backup retention time length greater than the preset time length needs to be sent to the tape library for storage. The embodiment stores important data for a long time through the tape library, and achieves the effect of improving the stability of data remote backup.
[0065] Optionally, in the data backup method provided in the embodiment of the application, in the process of executing the backup task of the database group by the backup database, in the case that the backup task fails, a prompt information is generated, where the prompt information is used to indicate that the backup task fails.
[0066] Specifically, the backup script sent by the backup management platform will feed back the backup condition to the backup management platform after the backup operation is completed in the backup database in the MYSQL database. The backup management platform can generate alarm information when receiving the feedback information for abnormal backup, and can send an alarm, so that the operation and maintenance personnel can timely maintain. The embodiment feeds back the backup condition, and alarms the abnormal backup condition, thereby improving the management efficiency of the backup data.
[0067] According to an embodiment of the present application, another data backup method is provided. Figure 4 is a schematic diagram of another data backup device provided according to an embodiment of the present application. As shown in the figure, the method comprises the following steps: Figure 4
[0068] In step S401, the information of the database group is obtained, and the backup strategy corresponding to the database group is generated, wherein the backup strategy is used to indicate the backup database in the database group and the backup mode, and the backup database is the database for executing the backup task.
[0069] Specifically, the information of the database group can be the attribute information of the newly added database group, for example, the group name of the newly added database group, the number of databases in the group, the settings of the master database and the slave database in the group, and the like. After receiving the information of the database group, the account database stores the information of the database group in the account database, and sets a certain slave database in the database group as a backup database, and sets the backup mode of the backup database, such as remote backup or local backup. After selecting the backup mode, the backup strategy corresponding to the database group can be generated according to the backup mode and the backup database information.
[0070] In step S402, the backup strategy is sent to the backup management platform, so that the backup management platform executes the backup task based on the backup strategy, and backs up the data generated by the backup task to the distributed object storage system, wherein the backup task is the backup task executed by the backup database.
[0071] Specifically, after generating the backup strategy, the account database needs to send the backup strategy to the backup management platform. The backup management platform sends the backup strategy and the corresponding backup script to the MYSQL database, sets the backup database according to the backup strategy in the MYSQL database, and sends the backup data to the distributed object storage system through the backup database, thereby completing the remote backup of the data.
[0072] The data backup method provided in the embodiments of the present application comprises the following steps: obtaining information of a database group, and generating a backup strategy corresponding to the database group, wherein the backup strategy is used to indicate a backup database in the database group and a backup mode, and the backup database is a database performing a backup task; sending the backup strategy to a backup management platform, so that the backup management platform performs a backup task based on the backup strategy, and backs up data generated by the backup task to a distributed object storage system, wherein the backup task is a backup task performed by the backup database. The problems of large occupation of built-in SSD storage disk space by backup data and difficult management of backup data in the related art are solved. The generation, delivery and management of the backup strategy are performed by means of the account database and the backup management platform, the backup data is remotely backed up, and therefore the effect of conveniently and efficiently managing the backup data and saving local storage space is achieved.
[0073] Optionally, in the data backup method provided in the embodiments of the present application, obtaining the information of the database group and generating the backup strategy corresponding to the database group comprises: obtaining creation information of the database group, and parsing a database to be backed up and a backup database corresponding to the database to be backed up from the creation information; determining backup information, and generating the backup strategy according to the information of the backup database and the backup information, wherein the backup information at least comprises one of the following: a backup address, a backup time.
[0074] Specifically, the creation information of the database group can be attribute information of a newly added database group, for example, group name, number of databases in the group, settings of a master database and a slave database in the databases in the group and the like. The account database can obtain the database group information, and set the backup database according to the database group information. After the backup database is set, the backup information such as the backup time and the backup address is determined, and the backup strategy is generated according to the backup information and the backup database information. The backup strategy is sent to the backup management platform for backup operation. The embodiments generate the backup strategy, which lays a foundation for subsequent quick and accurate data backup.
[0075] Optionally, in the data backup method provided in the embodiments of the present application, after obtaining the information of the database group and generating the backup strategy corresponding to the database group, the method further comprises: when a modification message for a server in the database group is received, changing the backup strategy corresponding to the database group; and / or when a switching message for a master database in the database group is received, changing the backup strategy corresponding to the database group, wherein the switching message is used to indicate switching a slave database in the database group to the master database.
[0076] Specifically, after completing the data backup, the server may be changed, for example, due to the server change caused by the database group corresponding to the database damage, or due to the change of the slave database to the master database due to the abnormality of the master database. At this time, the ledger database can obtain the change information of the database, update the backup strategy according to the change information, and send the backup strategy to the backup management platform, and perform the backup script according to the changed backup strategy, so as to set the backup database in the remaining slave databases in the database group, thereby timely changing and managing the backup database. The embodiment achieves the effect of improving the availability of the database group.
[0077] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0078] The embodiment of the present application also provides a data backup device, and it should be noted that the data backup device of the embodiment of the present application can be used to execute the data backup method provided by the embodiment of the present application. The data backup device provided by the embodiment of the present application is introduced as follows.
[0079] Figure 5 is a schematic diagram of a data backup device according to an embodiment of the present application. As shown in Figure 5 The device comprises a first acquisition unit 51, a judgment unit 52 and an execution unit 53.
[0080] Specifically, the first acquisition unit 51 is configured to acquire the backup strategy sent by the ledger database, wherein the backup strategy is used to indicate the backup database in the database group and the backup mode, and the backup database is the database for executing the backup task;
[0081] The judgment unit 52 is configured to judge whether the backup mode is remote backup.
[0082] The execution unit 53 is configured to execute the backup task of the database group through the backup database in the case of remote backup, and backup the data generated by the backup task to the distributed object storage system.
[0083] The data backup apparatus provided in the embodiments of the present application acquires the backup strategy sent by the account database through the first acquisition unit 51, wherein the backup strategy is used to indicate the backup database and the backup mode in the database group, and the backup database is the database performing the backup task; the judgment unit 52 judges whether the backup mode is remote backup; and the execution unit 53 performs the backup task of the database group through the backup database in the case of remote backup, and backs up the data generated by the backup task to the distributed object storage system. The problems of large occupation of built-in SSD storage disk space by backup data and difficult management of backup data in the related art are solved. The generation, issuance and management of the backup strategy are performed through the account database and the backup management platform, the backup data is remotely backed up, and thus the effect of conveniently and efficiently managing the backup data and saving the local storage space is achieved.
[0084] Optionally, in the data backup apparatus provided in the embodiments of the present application, the apparatus further includes: an analysis unit, configured to analyze the recovery address in the backup recovery instruction in the case of receiving the backup recovery instruction; and a second acquisition unit, configured to acquire the backed-up data indicated by the backup recovery instruction, and send the backed-up data to the database indicated by the recovery address.
[0085] Optionally, in the data backup apparatus provided in the embodiments of the present application, the backup strategy includes a backup retention time length, and the execution unit 53 includes: a first acquisition module, configured to acquire the backup retention time length in the case of remote backup, and judge whether the backup retention time length is greater than a preset time length; a first backup module, configured to back up the data generated by the backup task to the distributed object storage system in the case of the backup retention time length being less than the preset time length; and a second backup module, configured to back up the data generated by the backup task to the distributed object storage system and the tape library in the case of the backup retention time length being greater than the preset time length.
[0086] Optionally, in the data backup apparatus provided in the embodiments of the present application, in the process of performing the backup task of the database group through the backup database, the reminding information is generated in the case of failure of the backup task, wherein the reminding information is used to indicate the failure of the backup task.
[0087] The data backup apparatus includes a processor and a memory, and the first acquisition unit 51, the judgment unit 52 and the execution unit 53 are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.
[0088] Figure 6 is a schematic diagram of another data backup apparatus provided in the embodiments of the present application. As shown in Figure 6 the apparatus includes a third acquisition unit 61 and a sending unit 62.
[0089] The third obtaining unit 61 is configured to obtain information of a database group and generate a backup strategy corresponding to the database group, wherein the backup strategy is used to indicate a backup database in the database group and a backup manner, and the backup database is a database performing a backup task;
[0090] The sending unit 62 is configured to send the backup strategy to a backup management platform, so that the backup management platform performs a backup task based on the backup strategy, and backs up data generated by the backup task to a distributed object storage system, wherein the backup task is a backup task performed by the backup database.
[0091] The data backup apparatus provided in the embodiments of the present application obtains information of a database group through the third obtaining unit 61 and generates a backup strategy corresponding to the database group, wherein the backup strategy is used to indicate a backup database in the database group and a backup manner, and the backup database is a database performing a backup task; the sending unit 62 sends the backup strategy to a backup management platform, so that the backup management platform performs a backup task based on the backup strategy, and backs up data generated by the backup task to a distributed object storage system, wherein the backup task is a backup task performed by the backup database. The problems of large occupation of built-in SSD storage disk space by backup data and difficult management of backup data in the related art are solved. The generation, issuance and management of the backup strategy are performed through the account database and the backup management platform, the backup data is remotely backed up, and therefore the effect of conveniently and efficiently managing the backup data and saving local storage space is achieved.
[0092] Optionally, in the data backup apparatus provided in the embodiments of the present application, the third obtaining unit 61 includes: a second obtaining module configured to obtain creation information of the database group and parse a database to be backed up and a backup database corresponding to the database to be backed up from the creation information; and a generating module configured to determine backup information and generate the backup strategy according to the information of the backup database and the backup information, wherein the backup information at least includes one of the following: a backup address and a backup time.
[0093] Optionally, in the data backup apparatus provided in the embodiments of the present application, the apparatus further includes: a changing module configured to change the backup strategy corresponding to the database group when a modification message for a server in the database group is received; and / or change the backup strategy corresponding to the database group when a switching message for a master database in the database group is received, wherein the switching message is used to indicate switching a slave database in the database group to the master database.
[0094] The aforementioned data backup device includes a processor and a memory. The third acquisition unit 61 and the sending unit 62 are stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0095] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters addresses the issues of large storage space occupied by the internal SSD and difficulties in managing backup data in related technologies.
[0096] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0097] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the data backup method.
[0098] This invention provides a processor for running a program, wherein the program executes the data backup method during runtime.
[0099] like Figure 7 As shown, this embodiment of the invention provides an electronic device 70, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: obtaining a backup policy sent by a ledger database, wherein the backup policy indicates the backup database and backup method in a database group, and the backup database is the database executing the backup task; determining whether the backup method is remote backup; if the backup method is remote backup, executing the backup task of the database group through the backup database, and backing up the data generated by the backup task to a distributed object storage system; and / or obtaining information about the database group and generating a backup policy corresponding to the database group, wherein the backup policy indicates the backup database and backup method in the database group, and the backup database is the database executing the backup task; sending the backup policy to a backup management platform, so that the backup management platform executes the backup task based on the backup policy, and backs up the data generated by the backup task to a distributed object storage system, wherein the backup task is a backup task executed through the backup database. The device in this document can be a server, PC, PAD, mobile phone, etc.
[0100] The application further provides a computer program product, which is suitable for executing the program of the following method steps when executed on a data processing device: obtaining a backup strategy sent by a ledger database, wherein the backup strategy is used for indicating a backup database in a database group and a backup mode, and the backup database is a database for executing a backup task; judging whether the backup mode is remote backup; in the case that the backup mode is remote backup, executing a backup task of the database group through the backup database, and backing up data generated by the backup task to a distributed object storage system. And / or, obtaining information of the database group, and generating a backup strategy corresponding to the database group, wherein the backup strategy is used for indicating a backup database in a database group and a backup mode, and the backup database is a database for executing a backup task; sending the backup strategy to a backup management platform, so as to execute a backup task based on the backup strategy through the backup management platform, and backup data generated by the backup task to a distributed object storage system, wherein the backup task is a backup task executed through the backup database.
[0101] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0102] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks
[0103] These computer program instructions can also be stored in a computer-readable memory capable of guiding a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including instruction devices, which implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks
[0104] These computer program instructions can also be loaded into computer or other programmable data processing devices to cause a series of operational steps to be performed on the computer or other programmable devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable devices provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 Figure 1
[0105] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0106] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the processor can execute instructions. The memory can also include non-volatile memory, such as read only memory (ROM), electrically programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), flash memory, or other memory technologies, CD-ROM, digital versatile disc (DVD), or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information for access by a computing device. In no case does the medium include a transitory signal.
[0107] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically programmable read only memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carrier waves.
[0108] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to encompass a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements in the list, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0109] The above merely provides an example of the present application, and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall fall into the scope of claims of the present application.
Claims
1. A data backup system, characterized by The system comprises: an account database, configured to obtain information of a database group and generate a backup strategy corresponding to the database group, wherein the backup strategy is used to indicate a backup database in the database group and a backup mode, and the backup database is a database performing a backup task; and a backup management platform, configured to obtain the backup strategy, perform the backup task of the database group through the backup database in a case where the backup mode is remote backup, and backup data generated by the backup task to a distributed object storage system; the distributed object storage system, configured to receive the data generated by the backup task and store the data generated by the backup task to a corresponding database in a case where the backup mode is remote backup; wherein the data backup system further comprises a tape library, configured to receive target data generated by the backup task, wherein the target data is data with a backup retention period greater than a preset period, and the backup retention period is determined by the backup strategy; the data backup system further comprises a database building platform, configured to create the database group and send information of the database group to the account database, and modify the created database group and send modification information corresponding to the database group to the account database to prompt the account database to change the backup strategy corresponding to the database group; the system further comprises, when the backup management platform receives multiple backup strategies at the same time, selecting a backup script corresponding to each backup management platform from multiple backup scripts, sorting the multiple backup strategies according to the contents of the backup strategies, and performing backup operations in sequence.
2. The data backup system of claim 1, wherein, The data backup system further comprises: a database management platform, configured to monitor running conditions of the database group, determine a slave database as a master database in a case where a master database in the database group fails, and send a prompt message to the account database to prompt the account database to change the backup strategy corresponding to the database group.
3. A data backup method characterized by, The system comprises: obtaining a backup strategy sent by an account database, wherein the backup strategy is used to indicate a backup database in a database group and a backup mode, and the backup database is a database performing a backup task; determining whether the backup mode is remote backup; in a case where the backup mode is remote backup, performing the backup task of the database group through the backup database and backing up data generated by the backup task to a distributed object storage system; in a case where the backup mode is remote backup, performing the backup task of the database group through the backup database and backing up data generated by the backup task to the distributed object storage system, the method further comprises: in a case where a backup recovery instruction is received, parsing a recovery address in the backup recovery instruction; obtaining backed-up data indicated by the backup recovery instruction and sending the backed-up data to a database indicated by the recovery address. The backup strategy includes a backup retention period, the backup database performs the backup task of the database group, and the data generated by the backup task is backed up to the distributed object storage system, including: In the case of remote backup, the backup retention period is obtained, and it is judged whether the backup retention period is greater than a preset period; In the case of the backup retention period being less than the preset period, the data generated by the backup task is backed up to the distributed object storage system; In the case of the backup retention period being greater than the preset period, the data generated by the backup task is backed up to the distributed object storage system, and the data generated by the backup task is backed up to the tape library. The method further comprises: the account database obtains the creation information of the database group sent by the database building platform and the modification information corresponding to the database group; the account database changes the backup strategy corresponding to the database group according to the modification information corresponding to the database group.
4. The method of claim 3, wherein, In the process of executing the backup task of the database group by the backup database, in the case of failure of the backup task, a prompt information is generated, wherein the prompt information is used to indicate the failure of the backup task.
5. A data backup method characterized by, Including: Obtain the information of the database group, and generate the backup strategy corresponding to the database group, wherein the backup strategy is used to indicate the backup database in the database group and the backup mode, and the backup database is the database for executing the backup task; Send the backup strategy to the backup management platform, so as to execute the backup task based on the backup strategy by the backup management platform, and backup the data generated by the backup task to the distributed object storage system, wherein the backup task is the backup task executed by the backup database, and the distributed object storage system stores the data generated by the backup task in the corresponding database in the case of remote backup; The method further comprises: receiving target data generated by the backup task, wherein the target data is data with a backup retention period greater than a preset period, and the backup retention period is determined by the backup strategy; The method further comprises: creating the database group and sending the information of the database group to the account database, and modifying the created database group and sending the modification information corresponding to the database group to the account database, so as to prompt the account database to change the backup strategy corresponding to the database group; The method further comprises: when the backup management platform receives multiple backup strategies at the same time, selecting a backup script corresponding to each backup management platform in multiple backup scripts, sorting multiple backup strategies according to the backup strategy content, and performing backup operation in sequence.
6. The method of claim 5, wherein, Obtain the information of the database group, and generate the backup strategy corresponding to the database group, including: Obtain the creation information of the database group, and parse the database to be backed up and the backup database corresponding to the database to be backed up from the creation information; Determine backup information, and generate the backup policy according to information of the backup database and the backup information, wherein the backup information at least includes one of the following: backup address, backup time.
7. The method of claim 5, wherein, After obtaining information of the database group and generating the backup policy corresponding to the database group, the method further comprises: Upon receiving a modification message for a server in the database group, changing the backup policy corresponding to the database group; and / or Upon receiving a switching message for a master database in the database group, changing the backup policy corresponding to the database group, wherein the switching message is used to indicate switching a slave database in the database group to a master database.
8. A computer storage medium, characterized in that, The computer storage medium is used to store a program, wherein the program controls a device where the computer storage medium is located to execute the data backup method in any one of claims 3 to 4, or the data backup method in any one of claims 5 to 7 when the program is running.
9. An electronic device, comprising: The device comprises one or more processors and a memory, wherein the memory is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the data backup method in any one of claims 3 to 4, or the data backup method in any one of claims 5 to 7.
Citation Information
Patent Citations
Database backup and recovery method, device and equipment
CN111552595A
Data backup method and device, electronic equipment and medium
CN111737059A