Database backup method and device, electronic equipment and storage medium

By constructing a table association model and a threshold analysis model, the data tables to be backed up are dynamically identified and only frequently updated tables are backed up. This solves the redundant backup problem in the existing technology, achieves efficient and accurate database backup, and reduces costs and management. workload.

CN118779151AInactive Publication Date: 2024-10-15SHENZHEN YLINK COMPUTING SYST

Patent Information

Application Number
CN202410820660.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing database backup solutions cannot effectively identify and process redundant backup data, resulting in backup space that takes up too much space, high costs, and difficulty in scalability. Data changes cannot be captured in a timely manner, affecting the availability and consistency of backups.

Method used

Build a table association model by scanning the database, monitor the change information of the data table, use the threshold analysis model to analyze the data table, determine the data table to be backed up, and perform intelligent backup, dynamically adjust the backup strategy, and only back up frequently updated tables and tables. Related tables.

Benefits of technology

It improves backup efficiency, reduces storage space and costs, ensures data integrity and availability, and achieves accurate, efficient and reliable database backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779151A_ABST
    Figure CN118779151A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a database backup method and device, electronic equipment and a storage medium, and relates to the technical field of databases, the method comprises the following steps: scanning a database to obtain a data table, constructing a database table association model according to the data table, generating a table association relationship library according to the database table association model, and monitoring change information of the data table in the database, analyzing the data table according to the change information through the threshold analysis model to obtain a to-be-backed-up data table, backing up the to-be-backed-up data table, and performing early warning according to the to-be-backed-up data table. Through the intelligent backup strategy and the backup triggering mechanism, the backup strategy can be dynamically adjusted according to the data change condition in the database, accurate, efficient and reliable database backup is achieved, and the problems that in the prior art, redundant backup data cannot be accurately recognized and processed, a large amount of storage space and computing resources are needed, and the backup efficiency is high are solved. The cost is high; and the expansion is not easy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a database backup method, device, electronic equipment and storage medium. Background Art

[0002] In today's big data era, the scale of enterprise databases continues to grow, and database backup management faces increasingly severe challenges. Traditional database backup solutions are usually based on fixed time intervals or manual settings, which cannot fully adapt to the uncertainty of data changes in the database, and often cannot effectively identify and process redundant backup data, resulting in excessive backup space usage. Backup solutions based on fixed time intervals may cause the backup frequency to be too high or too low, and backup resources cannot be fully utilized, and data changes cannot be captured in a timely manner.

[0003] In addition, there may be inconsistent or incomplete data during the backup process of large-scale databases, which will affect the availability and consistency of the backup data. Traditional backup solutions require a lot of storage space and computing resources, are costly and difficult to expand. Documents in many corporate databases may be missing or incomplete, which makes it impossible to perform accurate backups. Traditional backup solutions lack in-depth analysis of database structure and data changes, and cannot formulate targeted backup strategies.

[0004] Therefore, there is an urgent need for a database backup method that can dynamically adjust the backup strategy according to the changes in the data in the database and is efficient, accurate and reliable. Summary of the invention

[0005] The embodiments of the present invention provide a database backup method to solve the problem that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand. The technical solution is as follows:

[0006] According to one aspect of the present invention, a database backup method includes: scanning a database to obtain a data table, constructing a database table association model based on the data table; generating a table association relationship library based on the database table association model, and monitoring change information of the data table in the database; analyzing the data table based on the change information through a threshold analysis model to obtain a data table to be backed up; backing up the data table to be backed up, and issuing an early warning based on the data table to be backed up.

[0007] In one of the embodiments, constructing a database table association model based on the data table is achieved by the following steps: taking the data table as a reference table, analyzing the dependency relationship between the data tables based on the reference table through a model, and obtaining a database table association model.

[0008] In one of the embodiments, analyzing the dependency relationship between the data tables according to the benchmark table through a model is achieved by the following steps: analyzing through a model whether the data table and the benchmark table have the same data, and if so, there is a dependency relationship between the data table and the benchmark table; analyzing through a model whether the data table and the benchmark table have fields with similar names, and if so, there is a dependency relationship between the data table and the benchmark table.

[0009] In one embodiment, generating a table association relationship library according to the database table association model is achieved by the following steps: obtaining an associated data table that has an association relationship with the database table according to the database table association model, and constructing a table association relationship library according to the data table and the associated data table.

[0010] In one of the embodiments, monitoring the change information of the data table in the database is achieved by the following steps: selecting a monitoring method, and obtaining the change information of the data table in the database through the monitoring method; the monitoring method includes triggers, Binglog log method and communication proxy server; the change information includes operation statements, change timestamps, changed tables and number of rows.

[0011] In one of the embodiments, the data table is analyzed according to the change information by a threshold analyzer model, and the data table to be backed up is obtained by the following steps: analyzing whether the change operation of the data table meets the set conditions; if the set conditions are met, obtaining the data table associated with the data table through the table association library and the data table as the data table to be backed up.

[0012] In one of the embodiments, issuing an early warning based on the data table to be backed up is achieved by the following steps: obtaining database status information based on the data table to be backed up; the database status information includes data volume, server utilization and storage space; obtaining a database status value based on the database status information, and if the database status value reaches a warning value, issuing a risk warning for the database.

[0013] According to one aspect of the present invention, a database backup device includes: a data table acquisition module, which is used to scan a database to obtain a data table and construct a database table association model based on the data table; a database monitoring module, which is used to generate a table association relationship library based on the database table association model and monitor change information of the data table in the database; a data table analysis module, which is used to analyze the data table according to the change information through a threshold analysis model to obtain a data table to be backed up; and a database backup module, which is used to back up the data table to be backed up and issue an early warning based on the data table to be backed up.

[0014] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the database backup method as described above.

[0015] According to one aspect of the present invention, a storage medium stores computer-readable instructions, and the computer-readable instructions are executed by one or more processors to implement the database backup method as described above.

[0016] The beneficial effects brought by the technical solution provided by the present invention are:

[0017] In the above technical scheme, the present invention first scans the database to obtain a data table, constructs a database table association model based on the data table, generates a table association relationship library based on the database table association model, monitors the change information of the data table in the database, analyzes the data table according to the change information through the threshold analysis model, obtains the data table to be backed up, and finally backs up the data table to be backed up, issues an early warning based on the data table to be backed up, and through an intelligent backup strategy and backup trigger mechanism, can dynamically adjust the backup strategy according to the data changes in the database, improves the backup efficiency, and reduces the storage space and cost required for backup. By backing up only frequently updated tables and related tables, storage resources can be maximized, backup costs can be reduced, data integrity and availability can be guaranteed, and accurate, efficient and reliable database backup can be achieved, thereby effectively solving the problem that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0019] Figure 1 is a flow chart showing a database backup method according to an exemplary embodiment;

[0020] Figure 2 is a schematic diagram showing a database backup method according to an exemplary embodiment;

[0021] Figure 3 yes Figure 2 Schematic diagram of the process of building a database table association model in the corresponding application scenario;

[0022] Figure 4 yes Figure 2 Schematic diagram of the database table association model in the corresponding application scenario;

[0023] Figure 5 yes Figure 2 Schematic diagram of the database backup process in the corresponding application scenario;

[0024] Figure 6 yes Figure 2 Schematic diagram of the process of implementing database monitoring in the form of triggers in the corresponding application scenario;

[0025] Figure 7 yes Figure 2 Schematic diagram of the process of implementing database monitoring in Binlog log mode in the corresponding application scenario;

[0026] Figure 8 yes Figure 2 Schematic diagram of the process of implementing database monitoring in the form of a proxy server in the corresponding application scenario;

[0027] Fig. 9 yes Figure 2 Schematic diagram of the structure of the threshold analysis model in the corresponding application scenario;

[0028] Fig.10 yes Figure 2 Schematic diagram of the process of threshold analysis in the corresponding application scenario;

[0029] Fig.11 is a block diagram of a database backup device according to an exemplary embodiment;

[0030] Fig.12 is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0031] Fig.13 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0032] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0033] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0034] The present invention provides a database backup method, which can dynamically adjust the backup strategy according to the change of data in the database through an intelligent backup strategy and a backup trigger mechanism, solves the problem that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand, and is suitable for a database backup device, which can be an electronic device. The database backup method in the embodiment of the present invention can be applied to a variety of scenarios, such as database management.

[0035] See also Figure 1 , an embodiment of the present invention provides a database backup method, which is applicable to electronic equipment.

[0036] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.

[0037] like Figure 1 As shown, the method may include the following steps:

[0038] Step 110, scan the database to obtain data tables, and construct a database table association model based on the data tables.

[0039] In a possible implementation, a data table is used as a reference table, and the dependency relationship between data tables is analyzed according to the reference table through a model to obtain a database table association model.

[0040] Among them, the model is used to analyze whether the data table and the benchmark table have the same data. If so, there is a dependency relationship between the data table and the benchmark table. The model is used to analyze whether the data table and the benchmark table have fields with similar names. If so, there is a dependency relationship between the data table and the benchmark table.

[0041] Step 130: Generate a table association relationship library according to the database table association model, and monitor the change information of the data table in the database.

[0042] In a possible implementation, an associated data table associated with the database table is obtained according to the database table association model, and a table association relationship library is constructed according to the data table and the associated data table.

[0043] In a possible implementation, a monitoring mode is selected to obtain change information of a data table in a database through the monitoring mode.

[0044] Among them, the monitoring methods include triggers, Binglog log methods and communication proxy servers, and the change information includes operation statements, change timestamps, changed tables and rows, etc., which are not limited here.

[0045] Step 150: Analyze the data table according to the change information using a threshold analysis model to obtain the data table to be backed up.

[0046] In a possible implementation, it is analyzed whether the modification operation of the data table meets the set conditions. If the set conditions are met, the data tables associated with the data table and the data tables are obtained through the table association library as the data tables to be backed up.

[0047] Step 170: back up the data table to be backed up, and issue an early warning based on the data table to be backed up.

[0048] In a possible implementation, database status information is obtained according to the data table to be backed up, and a database status value is obtained according to the database status information. If the database status value reaches a warning value, a risk warning is issued for the database.

[0049] The database status information includes data volume, server utilization, storage space, etc., which are not limited here.

[0050] Through the above process, the present invention first scans the database to obtain a data table, constructs a database table association model according to the data table, generates a table association relationship library according to the database table association model, monitors the change information of the data table in the database, analyzes the data table according to the change information through the threshold analysis model, obtains the data table to be backed up, and finally backs up the data table to be backed up, issues an early warning according to the data table to be backed up, and through the intelligent backup strategy and backup trigger mechanism, can dynamically adjust the backup strategy according to the data changes in the database, improves the backup efficiency, and reduces the storage space and cost required for backup. By backing up only frequently updated tables and related tables, storage resources can be used to the maximum extent, backup costs can be reduced, data integrity and availability can be guaranteed, and accurate, efficient and reliable database backup can be achieved, thereby effectively solving the problem that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand.

[0051] In one application scenario, Figure 2 A flowchart of a database backup method is shown. Figure 3 It shows the process diagram of building a database table association model. Figure 4 A diagram showing the database table association model. Figure 5 The following figure shows the process diagram of database backup. Figure 6 It shows the flow chart of implementing database monitoring by trigger. Figure 7 It shows the process diagram of implementing database monitoring in Binlog mode. Figure 8 It shows the flow chart of implementing database monitoring by means of communication proxy server. Fig. 9 The structural diagram of the threshold analysis model is shown. Fig.10 A schematic diagram showing the process flow of threshold analysis.

[0052] like Figure 2 As shown, the database backup method may include the following steps:

[0053] The first step is to scan the database data.

[0054] The second step is to generate the database table association model.

[0055] The third step is to generate a table association library through the database table association model.

[0056] Among them, expert intervention supplements the table association library.

[0057] The fourth step is to use the database data operation listener to monitor the data change operations.

[0058] The fifth step is to analyze which tables need to be backed up based on the data collected by the listener through the threshold analysis model, and perform backup operations on the tables that need to be backed up.

[0059] Among them, experts intervene to adjust the parameters of the threshold analysis model. During the backup process, the table associated with the table to be backed up is searched in the table association library and the backup operation is also performed.

[0060] In the sixth step, the early warning device analyzes whether an early warning is needed based on the backup situation. If an early warning is needed, it will be issued through the early warning device.

[0061] Specifically, the steps include:

[0062] Step A1: Establish a database table association model by scanning the existing table structure and data in the database. There are two ways to establish an association relationship, namely, data similarity association and table field name similarity association.

[0063] Step A2: Generate a pure table association relationship library through the established database table association model, which is used as basic data for subsequent backup processing.

[0064] Step B1: Open the threshold analysis model to adjust the parameters, and experts can intervene to determine whether to back up the judgment benchmark value.

[0065] Step B2: Open the table relationship library modification entry, experts can modify and add new table relationships.

[0066] Step C1: The database operation listener obtains the operation SQL, change timestamp, involved tables, involved row numbers, etc. through triggers, Binglog logs, communication proxy servers, etc., and processes them.

[0067] Step C2: The threshold analysis model receives information from the database operation listener and performs threshold analysis.

[0068] Step C3: After the backup operation is triggered, the association relationship is obtained from the table association relationship library.

[0069] Step C4: Return to the related table.

[0070] If Table 1 triggers a backup operation in step C2, then step C3 initiates acquisition of other tables associated with Table 1, and step C4 returns other tables, such as Table 2 having an associated relationship.

[0071] Step C5: The amount of data in the backup, server utilization, storage space, etc. are passed as parameters to the alarm.

[0072] Step C6: After the early warning device analyzes, if the early warning value is reached, a risk alarm is issued.

[0073] Among them, database data is the information generated after the database runs for a long time and the existing database table structure; the database table association model is constructed by taking all the tables in the database as the benchmark table and then dynamically adding dependencies through model analysis of the association; the table association library is the output product of the database table association model, including all the tables in the database and other tables that are associated with it; the database data operation listener listens to the insert, update, delete and other operations of the database, collects the change timestamp, the tables and rows involved, and inputs the collected operation records into the threshold analysis model. The implementation scheme of the database data operation listener includes trigger method, Binlog log method and communication proxy server method.

[0074] Among them, the threshold analysis model mainly analyzes how many write / update operations a table has performed in a certain period of time and whether the predetermined value has been operated. If it exceeds the predetermined value, the backup is triggered. For example, if table A triggers the backup operation, the remaining tables related to table A in the association table are obtained through the table association library, and the backup is performed together. The data output by the above database data operation listener: operation statement, change timestamp, involved table, number of rows involved are analyzed, connected to redis, the analysis data is temporarily suspended in the memory, the start, process and end of the backup are analyzed and early warning is given.

[0075] like Figure 3 As shown, the construction of the database table association model may include the following steps:

[0076] Step D1: Scan the entire database. If the number of existing tables in the database is b, the scan results are Table 1, Table 2, ... Table n.

[0077] Step D2: Data similarity analysis: Analyze a field in Table 1 to see if there is the same data in the entire database. If so, mark it as a related table.

[0078] Step D3: similarity analysis of table field names. Analyze a field in Table 1 to see if there is a field with a similar name in the table structure of the entire database. If so, mark it as a related relationship table.

[0079] Step D4: Based on the above basic logic, a database table association model is constructed.

[0080] Specifically, firstly, a full table scan of the database is performed. If the number of existing tables in the database is b, the scan results are table 1, table 2...table n. The scanned tables are traversed, and then the attributes of a specific table are traversed, as shown in Table 1.

[0081] Furthermore, data similarity analysis is to analyze whether a field in Table 1 has the same data in the entire database, and if so, it is marked as an associated table; table field name similarity analysis is to analyze whether a field in Table 1 has a field with a similar name in the table structure of the entire database, and if so, it is marked as an associated table.

[0082] like Figure 4 As shown in the figure, the structure of the database table association model is displayed, in which the main table data is the database base table, which is the actual table data in the database in the true sense; the associated table data is the data table that has an association relationship with the database base table. The table association relationship library is generated through the database table association model, and its data relationship is 1:n, where 1 represents a specific data table in the database, and n represents other data tables that have a dependent relationship with the data table.

[0083] like Figure 5 As shown, database backup can include the following steps:

[0084] Step J1: Monitor the insert, update and delete operations of the database.

[0085] Step J2: The database operation listener analyzes the operation table and operation frequency and transmits them to the threshold analysis model.

[0086] Step J3: The threshold analysis model analyzes whether the table exceeds the limit value.

[0087] Step J4: If the threshold is exceeded, a backup operation will be triggered. Before the backup operation, other tables associated with the table are obtained from the table association database and backup is performed at the same time to ensure data consistency and integrity and avoid full database backup.

[0088] like Figure 6 As shown, implementing database monitoring in a trigger manner may include the following steps:

[0089] Step L01: The application performs operations on the database, such as adding data, modifying data, etc.

[0090] Step L02: The operation object is a specific data table in the database, such as Table 1.

[0091] Step L03: trigger the insert trigger (INSERT), update trigger (UPDATE) and / or delete trigger (DELETE) of the database according to the specific operation.

[0092] Step L04: The trigger passes the data to the database data operation listener.

[0093] Step L05: The listener outputs the result to the threshold analysis model and determines whether the threshold is triggered.

[0094] Step L06: trigger the threshold and obtain related tables from the table association library.

[0095] Step L07: Back up the data table and related tables.

[0096] like Figure 7 As shown, implementing database monitoring in Binlog mode may include the following steps:

[0097] Step L11: The application performs operations on the database, such as adding new data, modifying data, etc.

[0098] Step L12: The operation object is a specific data table in the database, such as Table 1.

[0099] Step L13: The database records all data change operations in the Binlog log.

[0100] Step L14: Database data operation listener, obtain Binlog log.

[0101] Step L15: Return to the log.

[0102] Step L16: The listener outputs the result to the threshold analysis model and determines whether the threshold is triggered.

[0103] Step L17: trigger the threshold and obtain related tables from the table association library.

[0104] Step L18: Back up the data table and related tables.

[0105] like Figure 8 As shown, implementing database monitoring in a communication proxy server manner may include the following steps:

[0106] Step L21: The application performs operations on the database, such as adding data, modifying data, etc., through the proxy server.

[0107] Step L22: Database response operation.

[0108] Step L23: Data table implementation operation.

[0109] Step L24: Monitor the operations in step L21 on the proxy server.

[0110] Step L25: Return information to the database data operation listener.

[0111] Step L26: The database data operation listener analyzes the output information to the threshold analyzer and analyzes whether it exceeds the threshold.

[0112] Step L27: trigger the threshold and obtain related tables from the table association library.

[0113] Step L28: Back up the data table and related tables.

[0114] like Fig. 9 As shown in the figure, the threshold analysis model is divided into three parts: the first part is the control input, which is the three parameters intervened by the expert to realize whether to turn on or off, and achieve 100 operations within 1 second. The parameters include switch, that is, whether to turn on the threshold analysis, time, that is, the limited unit time, and number, that is, the limited threshold number of times; the second part is the log input, which is the main basis for the threshold analysis; the third part is the output flag, that is, whether to trigger the threshold for backup operation.

[0115] Specifically, the input of the threshold analysis model is the data output by the data operation listener, including operation statements, change timestamps, tables and rows involved, and other information; predetermined threshold parameters, such as the maximum number of operations on a table within a certain time period; the function is to analyze whether the number of operations on a table within a specific time period exceeds a predetermined value; the condition for triggering a backup operation is that if the number of operations on a table exceeds a predetermined value, a backup operation is triggered, wherein the backup operation can be a backup of a single table or a joint backup of related tables involved; the output is an instruction to trigger the backup, including the name of the table to be backed up or the identifier of the backup task.

[0116] like Fig.10 As shown, threshold analysis can include the following steps:

[0117] Step Q1: Table 1 triggers analysis and carries relevant information of Table 1, operation content, operation data volume, etc.

[0118] Step Q2: Determine whether the threshold analysis model is enabled, and if enabled, perform analysis.

[0119] Step Q3: If there is no operation record for Table 1 within the set time, a new operation information about Table 1 is added.

[0120] Step Q4: If there is an operation record in Table 1 within the x time, then the operation record of Table 1 is increased by 1.

[0121] Step Q5: If the number of operation records in Table 1 exceeds y times within x time, the threshold is triggered.

[0122] Step Q6: Perform backup processing.

[0123] Through the above process, the embodiment of the present invention can dynamically adjust the backup strategy according to the data changes in the database through intelligent backup strategy and backup trigger mechanism, thereby improving backup efficiency and reducing the storage space and cost required for backup. By backing up only frequently updated tables and related tables, storage resources can be used to the maximum extent, backup costs can be reduced, data integrity and availability can be guaranteed, and accurate, efficient and reliable database backup can be achieved, thereby effectively solving the problems that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand.

[0124] In another application scenario, a company's order database contains data tables such as order information, customer information, and product information. Due to document loss, the understanding of the database table structure and data relationships is relatively limited. Some data tables in the database are frequently updated, and it is necessary to identify key data tables and back them up in a timely manner.

[0125] Therefore, the database backup method of the present invention is used as follows: first, a database operation listener is designed to monitor the write and update operations of the database. When the update frequency of a table exceeds a preset threshold, a backup operation is triggered to back up the table and other related tables.

[0126] Specifically, in actual operation, assuming that the database contains the following tables: order table, product table, and customer table, the system implements backup operations including: designing a database operation listener to monitor the write and update operations of the order table. When the update frequency of the order table exceeds the preset threshold, the backup operation is triggered to back up the order table and related product and customer tables.

[0127] Through the above process, the embodiment of the present invention focuses on solving the problem of backup management, and other modules do not need to be used temporarily, thereby simplifying the implementation and management of the system. By backing up only frequently updated tables and related tables, storage resources can be maximized, backup costs can be reduced, data integrity and availability can be guaranteed, and accurate, efficient and reliable database backup can be achieved, thereby effectively solving the problems that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand.

[0128] The following is an embodiment of the device of the present invention, which can be used to execute the database backup method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the database backup method involved in the present invention.

[0129] See also Fig.11 , an embodiment of the present invention provides a database backup device 800.

[0130] The database backup device 800 includes but is not limited to: a data table acquisition module 810 , a database monitoring module 830 , a data table analysis module 850 and a database backup module 870 .

[0131] The data table acquisition module 810 is used to scan the database to obtain the data table and construct a database table association model according to the data table.

[0132] The database monitoring module 830 is used to generate a table association relationship library according to the database table association model and monitor the change information of the data table in the database.

[0133] The data table analysis module 850 is used to analyze the data table according to the change information through a threshold analysis model to obtain the data table to be backed up.

[0134] The database backup module 870 is used to back up the data table to be backed up and issue an early warning based on the data table to be backed up.

[0135] It should be noted that, in the database backup provided in the above embodiment, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the database backup device will be divided into different functional modules to complete all or part of the functions described above.

[0136] In addition, the database backup device and the database backup method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs operations has been described in detail in the method embodiment, which will not be repeated here.

[0137] Fig.12 The present invention schematically illustrates the structure of an electronic device according to an exemplary embodiment.

[0138] It should be noted that the electronic device is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The electronic device cannot be interpreted as requiring dependence on or having Fig.12 One or more components of exemplary electronic device 2000 are shown.

[0139] The hardware structure of the electronic device 2000 may vary greatly due to differences in configuration or performance, such as Fig.12 As shown, the electronic device 2000 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .

[0140] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000 .

[0141] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted by the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Fig.12 As shown, this is not intended to be a specific limitation.

[0142] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.

[0143] Among them, the operating system 251 is used to manage and control various hardware devices and application programs 253 on the electronic device 2000 to enable the central processor 270 to calculate and process the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0144] The application program 253 is a computer-readable instruction that performs at least one specific task based on the operating system 251, and may include at least one module ( Fig.12 (not shown), each module may respectively include computer-readable instructions for the electronic device 2000. For example, the database backup device may be regarded as an application 253 deployed on the electronic device 2000.

[0145] The data 255 may be signal information, etc., stored in the memory 250 .

[0146] The central processor 270 may include one or more processors and is configured to communicate with the memory 250 through at least one communication bus to read the computer-readable instructions stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the database backup method is completed by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.

[0147] In addition, the present invention can also be implemented by hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present invention is not limited to any specific hardware circuits, software, or a combination of the two.

[0148] See also Fig.13 In an embodiment of the present invention, an electronic device 4000 is provided. The electronic device 4000 may include: a desktop computer, a laptop computer, a server, etc. with sensor recognition capability.

[0149] exist Fig.13 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0150] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0151] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception, etc. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0152] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0153] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 4000, but is not limited to this.

[0154] The memory 4003 stores computer-readable instructions, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .

[0155] The computer-readable instructions are executed by one or more processors 4001 to implement the database backup method in the above-mentioned embodiments.

[0156] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement the database backup method as described above.

[0157] A computer program product is provided in an embodiment of the present invention. The computer program product includes computer-readable instructions. The computer-readable instructions are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the database backup method as described above.

[0158] Compared with the related art, the present invention has the following beneficial effects:

[0159] 1. The present invention first scans the database to obtain a data table, constructs a database table association model based on the data table, generates a table association relationship library based on the database table association model, monitors the change information of the data table in the database, analyzes the data table according to the change information through the threshold analysis model, obtains the data table to be backed up, and finally backs up the data table to be backed up, issues an early warning based on the data table to be backed up, and through an intelligent backup strategy and backup trigger mechanism, can dynamically adjust the backup strategy according to the data changes in the database, thereby improving the backup efficiency and reducing the storage space and cost required for the backup. By backing up only frequently updated tables and related tables, storage resources can be utilized to the maximum extent, backup costs can be reduced, data integrity and availability can be guaranteed, and accurate, efficient and reliable database backup can be achieved, thereby effectively solving the problem that the prior art cannot accurately identify and process redundant backup data, requires a large amount of storage space and computing resources, is costly and difficult to expand.

[0160] 2. The present invention can improve backup efficiency: through intelligent backup strategies and backup trigger mechanisms, unnecessary backup operations can be reduced, thereby improving backup efficiency. The system can perform backups based on actual data changes, avoiding invalid full backups and saving time and resources.

[0161] 3. The present invention can reduce backup costs: the intelligent backup system can perform backup according to actual needs, avoiding unnecessary backup operations, thereby reducing the storage space and cost required for backup. By backing up only frequently updated tables and related tables, storage resources can be used to the maximum extent and backup costs can be reduced.

[0162] 4. The present invention can ensure data consistency and integrity: the intelligent backup system can perform backup according to the association between tables to ensure the consistency and integrity of the backup data. By backing up the associated tables, inconsistency and loss between data can be avoided, ensuring the integrity and availability of data.

[0163] 5. The present invention can reduce the workload of backup management: the intelligent backup system can automate the backup management process and adjust the backup strategy according to the actual situation, thus reducing the workload of the administrator. The administrator does not need to manually set the backup strategy, and the system can make adaptive adjustments according to the actual data changes, thus simplifying the backup management process.

[0164] 6. The present invention can improve business continuity and availability: By ensuring the consistency and integrity of backup data, the intelligent backup system can improve business continuity and availability. In the event of a catastrophic event or data loss, the database can be quickly and effectively restored to ensure the continued operation of the business.

[0165] 7. The present invention proposes an intelligent and refined database backup management solution, which can dynamically adjust the backup strategy according to the changes in the data in the database to achieve accurate, efficient and reliable backup.

[0166] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0167] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A database backup method, characterized in that: The method comprises: Scan the database to obtain a data table, and construct a database table association model based on the data table; Generate a table association relationship library according to the database table association model, and monitor the change information of the data table in the database; Analyze the data table according to the change information through a threshold analysis model to obtain a data table to be backed up; The data table to be backed up is backed up, and an early warning is issued according to the data table to be backed up.

2. The database backup method according to claim 1, characterized in that: The step of constructing a database table association model according to the data table includes: The data table is used as a reference table, and the dependency relationship between the data tables is analyzed according to the reference table through a model to obtain a database table association model.

3. The database backup method according to claim 2, characterized in that: The analyzing the dependency relationship between the data tables according to the reference table through the model includes: Analyze the data table and the reference table through a model to see whether there is the same data; if so, there is a dependency relationship between the data table and the reference table; The model is used to analyze whether the data table and the reference table have fields with similar names. If so, a dependency relationship exists between the data table and the reference table.

4. The database backup method according to claim 1, characterized in that: The step of generating a table association relationship library according to the database table association model includes: According to the database table association model, an associated data table that has an association relationship with the database table is obtained, and a table association relationship library is constructed according to the data table and the associated data table.

5. The database backup method according to claim 1, characterized in that: The monitoring of the change information of the data table in the database includes: A monitoring method is selected to obtain change information of the data table in the database through the monitoring method; the monitoring method includes triggers, Biglog log methods and communication proxy servers; the change information includes operation statements, change timestamps, changed tables and number of rows.

6. The database backup method according to claim 1, characterized in that: The step of analyzing the data table according to the change information by using a threshold analyzer model to obtain the data table to be backed up includes: Analyze whether the modification operation of the data table meets the set conditions. If the set conditions are met, obtain the data table associated with the data table through the table association library and the data table as the data table to be backed up.

7. The database backup method according to claim 1, characterized in that: The issuing of an early warning according to the data table to be backed up includes: Acquire database status information according to the data table to be backed up; the database status information includes data volume, server utilization and storage space; A database status value is obtained according to the database status information, and if the database status value reaches a warning value, a risk warning is issued for the database.

8. A database backup device, characterized in that: The device comprises: A data table acquisition module is used to scan the database to obtain a data table, and to construct a database table association model according to the data table; A database monitoring module, used to generate a table association relationship library according to the database table association model, and monitor the change information of the data table in the database; A data table analysis module, used for analyzing the data table according to the change information through a threshold analysis model to obtain a data table to be backed up; The database backup module is used to back up the data table to be backed up and issue an early warning based on the data table to be backed up.

9. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors so that the electronic device implements the database backup method according to any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement the database backup method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Device and method for database backup

    CN105320576A

  • Data recovery method and device, equipment and storage medium

    CN111382198A

  • Data backup device based on distributed file data

    CN113360324A

  • Method and system for keeping disk space of online database

    CN115098501A

  • Data monitoring method and device, computer device, and storage medium

    WO2019232832A1

Cited By

  • Quasi-real-time database backup method and system

    CN119988092A

  • Quick backup method for TB-level database based on B / S architecture

    CN120407288A

  • Data backup method and equipment

    CN120407296A

  • Enterprise integrated management system

    CN120851818A

  • An enterprise integrated management system

    CN120851818B