Regular automatic inspection backup data method for MySQL data

Through the regular automatic inspection and backup method, the cumbersome and insufficient intelligence of MySQL database backup and inspection are solved, and data security and system reliability are improved. Through load prediction and dynamic scheduling, task execution is optimized to ensure complete data Sex and consistency.

CN119226033APending Publication Date: 2024-12-31UNICLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411042697.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The backup and inspection of existing MySQL databases rely on manual operations, which are cumbersome and error-prone. The flexibility and intelligence of timing tasks are insufficient, resulting in difficult to ensure the integrity and consistency of data backup, lack of validity verification and automated inspection functions, which affects the Data security and system reliability.

Method used

Provides regular automatic inspection and backup methods for MySQL data, automatically backup and store it in multiple redundant locations, verify the integrity of the backup file, execute database inspection tasks to generate reports, and intelligently schedule tasks based on load conditions and business needs. , use load prediction and dynamic adjustment of task execution time to ensure the normal operation of the database.

Benefits of technology

Improve data security and system reliability, avoid high-load period execution through load prediction, optimize task scheduling, ensure data integrity and consistency, and enhance the validity verification and patrol functions of backup data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226033A_ABST
    Figure CN119226033A_ABST
Patent Text Reader

Abstract

The invention provides a regular automatic inspection backup data method for MySQL data, which comprises the following steps: after a backup task is completed, verifying the integrity and restorability of a backup file; regularly executing a database inspection task to obtain a database operation state, checking the consistency, integrity and performance indexes of the data, and generating a detailed inspection report; the system intelligently dispatches the backup task and the inspection task according to the load condition and the service requirement of the database so as to reduce the influence on normal service operation. The method has the beneficial effects that the system can adjust the task execution time in real time according to the latest load prediction and service requirements, the flexibility and dynamism of task scheduling are ensured, and meanwhile, the system is helped to rapidly adjust the task execution time when facing accidental load changes, so that the influence on normal operation of a database is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of database management, and in particular relates to a method for regularly automatically inspecting and backing up data for MySQL data. Background Art

[0002] In the prior art, the backup and inspection of MySQL databases usually rely on manual operation or simple scheduled task management. This method has the following problems: manual operation is cumbersome and error-prone, the flexibility and intelligence of scheduled tasks are insufficient, and the integrity and consistency of data backup are difficult to ensure.

[0003] In addition, existing backup systems usually lack the ability to verify the validity of backup data and automated inspection of the database operating status, making it difficult to effectively ensure data security and system reliability. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention provides a method for regular automatic inspection and backup of MySQL data, which can realize automatic backup and regular inspection of MySQL database, thereby improving the security and reliability of data.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] In a first aspect, the present invention discloses a method for regularly automatically inspecting and backing up MySQL data, including:

[0007] Preset regular backup tasks to automatically back up the MySQL database regularly according to the preset backup tasks, and store the backup files in multiple redundant storage locations;

[0008] After completing the backup task, verify the integrity and recoverability of the backup file;

[0009] Regularly perform database inspection tasks to obtain database operation status, check data consistency, integrity and performance indicators, and generate detailed inspection reports;

[0010] The system intelligently schedules backup tasks and inspection tasks based on the database load and business needs. Furthermore, the system continuously monitors the database load, and the load function is W(t), including:

[0011] W(t)=α 1 CPU T +β 1 MEM t +γ 1 IO t +δ 1 NET t ;

[0012] in,

[0013] W(t) represents the load function;

[0014] CPUt, MEMt, IOt, and NETt represent CPU usage, memory usage, I / O operations, and network traffic, respectively;

[0015] α 1 , β 1 , γ 1 ,δ 1 They represent weight coefficients respectively.

[0016] Furthermore, the system predicts future load peak periods based on historical load data and current load trends, including:

[0017] W′(t)=d+ψ 1 W(t-1)+ψ 2 W(t-2)+…+ψ p W(tp)+ζ 1 e(t-1)+

[0018] ζ 2 e(t-2)+…+ζ q e(tq)+e(t);

[0019] in,

[0020] W′(t) represents the predicted load value at time t;

[0021] d is a constant;

[0022] ψ 1 ,ψ 2 ,…,ψ p is the autoregressive coefficient, which indicates the influence of the load values ​​at the previous p moments on the load prediction at the current moment;

[0023] ζ 1 ,ζ 2 ,…,ζ q is the moving translation coefficient, which represents the impact of the error term in the previous q moments on the load prediction at the current moment;

[0024] e(t) is the error term at the current moment, which represents the random error predicted by the model;

[0025] W(t-1), W(t-2), …, W(tp) are the actual load values ​​at the previous p moments;

[0026] e(t-1), e(t-2),…, e(tq) are the error terms of the previous q moments.

[0027] Furthermore, the system determines the optimal execution time for backup and inspection tasks based on the predicted load and business needs, including:

[0028]

[0029] st

[0030]

[0031] in,

[0032] y i is a binary variable, indicating whether the i-th task is completed at time t i Execute, 1 means execute, 0 means do not execute;

[0033] k i For the i-th task at time t i The cost of execution reflects the impact of task execution on the system;

[0034] mm ij is the constraint coefficient matrix, which represents the influence of the jth constraint on the i-th task;

[0035] u j is the upper limit of the jth constraint, ensuring that the task is completed within a specific time window;

[0036] n is the total number of backup and inspection tasks;

[0037] mmm is the total number of constraints.

[0038] Furthermore, the system executes backup and inspection tasks at the best time and dynamically adjusts the task execution time according to the real-time load situation to ensure that the normal operation of the database is not affected, including: adjust ={t′ 1 , t′ 2 , ..., t′ k};

[0039] in,

[0040] V adjust The adjusted task execution time window;

[0041] t 1 ′,t 2 ′,…,t k ' is the adjusted task execution time point, which is adjusted in real time according to the latest load forecast and business needs.

[0042] In a second aspect, the present solution discloses an electronic device, including a processor and a memory that is communicatively connected to the processor and is used to store executable instructions of the processor, wherein the processor is used to execute the method for periodically automatically inspecting and backing up data for MySQL data described in the first aspect above.

[0043] In the third aspect, the present solution discloses a server, comprising at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to enable the at least one processor to execute the method for periodic automatic inspection and backup of MySQL data described in the first aspect.

[0044] In a fourth aspect, the present solution discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for periodically automatically inspecting and backing up data for MySQL data as described in the first aspect.

[0045] Compared with the prior art, the method for periodically automatically checking and backing up MySQL data described in the present invention has the following beneficial effects:

[0046] (1) In the method for periodically automatically inspecting and backing up MySQL data described in the present invention, the system calculates the overall load of the database by integrating different load parameters during the process of continuously monitoring the load of the database, and can improve the accuracy of load evaluation in specific application scenarios by adjusting the weights of various parameters;

[0047] (2) The method for periodic automatic inspection and data backup of MySQL data described in the present invention is based on historical load data and current load trends. By predicting future load peak periods, the system can prepare for task scheduling in advance to avoid executing tasks that affect system performance during high load periods;

[0048] (3) The method for periodically automatically inspecting and backing up data for MySQL data described in the present invention optimizes task scheduling by minimizing the task execution cost when determining the optimal execution time of backup and inspection tasks. The system can find the optimal execution time of backup and inspection tasks while ensuring the normal operation of the database, thereby improving the efficiency and rationality of task scheduling;

[0049] (4) The method for periodically automatically inspecting and backing up MySQL data described in the present invention enables the system to adjust task execution time in real time according to the latest load forecast and business needs, thereby ensuring the flexibility and dynamism of task scheduling. At the same time, it helps the system to quickly adjust task execution time when facing unexpected load changes, thereby avoiding affecting the normal operation of the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0051] Figure 1 The present invention is a flowchart of a method for periodically automatically checking and backing up MySQL data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0053] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0054] This solution discloses a method for regular automatic inspection and backup of MySQL data, including:

[0055] Preset regular backup tasks to automatically back up the MySQL database regularly according to the preset backup tasks, and store the backup files in multiple redundant storage locations;

[0056] After completing the backup task, verify the integrity and recoverability of the backup file;

[0057] Regularly perform database inspection tasks to obtain database operation status, check data consistency, integrity and performance indicators, and generate detailed inspection reports;

[0058] The system intelligently schedules backup tasks and inspection tasks based on database load and business needs to reduce the impact on normal business operations.

[0059] Among them, intelligent scheduling backup tasks and inspection tasks specifically include:

[0060] First, by monitoring the database load in real time, we can obtain the database load W(t) and provide basic data for subsequent load prediction and scheduling, including:

[0061] W(t)=α 1 CPU t +β 1 MEM t +γ 1 IO t +δ 1 NET t ;

[0062] Secondly, the system predicts future load peak periods based on historical load data and current load trends, including:

[0063] W′(t)=d+ψ 1 W(t-1)+ψ 2 W(t-2)+…+ψ p W(tp)+ζ 1 e(t-1)+

[0064] ζ 2 e(t-2)+…+ζ q e(tq)+e(t);

[0065] The historical data of database load W(t) is used to predict future load peaks. By performing time series analysis on the historical data of W(t), the predicted value W′(t) is obtained, which provides a prediction basis for intelligent scheduling and ensures that tasks will not be executed during high-load periods.

[0066] Thirdly, the system determines the optimal execution time of backup and inspection tasks based on the predicted load and business needs. It uses the predicted load W′(t) to determine the optimal execution time of tasks. Combined with the predicted load peak information, the system selects the most appropriate time to execute tasks in different time windows to minimize the impact on the system.

[0067] Finally, the task execution time is dynamically adjusted using the current and predicted load information (including W(t) and W′(t)). If the actual load deviates from the predicted load, the system will recalculate and adjust the task execution time window V according to the latest load data. adjust , ensuring the flexibility and adaptability of task scheduling The system performs backup and inspection tasks at the determined optimal time.

[0068] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0069] In the several embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of the units described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above-mentioned units may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

[0071] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for regular automatic inspection and backup of MySQL data, characterized in that: include: Preset regular backup tasks to automatically back up the MySQL database regularly according to the preset backup tasks, and store the backup files in multiple redundant storage locations; After completing the backup task, verify the integrity and recoverability of the backup file; Regularly perform database inspection tasks to obtain database operation status, check data consistency, integrity and performance indicators, and generate detailed inspection reports; The system intelligently schedules backup and inspection tasks based on database load and business needs.

2. The method for regularly automatically checking and backing up MySQL data according to claim 1, characterized in that: The system continuously monitors the load of the database and obtains the load function W(t) as: W(t)=α1·CPU t +β1·MEM t +γ1·IO t +δ1·NET t ; in, W(t) represents the load function; CPUt, MEMt, IOt, and NETt represent CPU usage, memory usage, I / O operations, and network traffic, respectively; α1, β1, γ1, and δ1 represent weight coefficients respectively.

3. The method for regularly automatically checking and backing up MySQL data according to claim 2, characterized in that: The system predicts future load peak periods based on historical load data and current load trends, including: W′(t)=d+ψ1W(t-1)+ψ2W(t-2)+…+ψ p W(tp)+ζ1e(t-1)+ζ2e(t-2)+…+ζ q e(tq)+e(t); in, W′(t) represents the predicted load value at time t; d is a constant; ψ1,ψ2,…,ψ p is the autoregressive coefficient, which indicates the influence of the load values ​​at the previous p moments on the load prediction at the current moment; ζ1,ζ2,…,ζ q is the moving translation coefficient, which represents the impact of the error term in the previous q moments on the load prediction at the current moment; e(t) is the error term at the current moment, which represents the random error predicted by the model; W(t-1), W(t-2), …, W(tp) are the actual load values ​​at the previous p moments; e(t-1), e(t-2),…, e(tq) are the error terms of the previous q moments.

4. The method for regularly automatically checking and backing up MySQL data according to claim 3, characterized in that: The system determines the optimal execution time for backup and inspection tasks based on the predicted load and business needs, including: st in, y i is a binary variable, indicating whether the i-th task is completed at time t i Execute, 1 means execute, 0 means do not execute; k i For the i-th task at time t i The cost of execution reflects the impact of task execution on the system; m ij is the constraint coefficient matrix, which represents the influence of the jth constraint on the i-th task; u j is the upper limit of the jth constraint, ensuring that the task is completed within a specific time window; n is the total number of backup and inspection tasks; m is the total number of constraints.

5. The method for regularly automatically checking and backing up MySQL data according to claim 4, characterized in that: The system executes backup and inspection tasks at the best time and dynamically adjusts the task execution time according to the real-time load situation to ensure that the normal operation of the database is not affected, including: V adjust ={t′1,t′2,...,t′ k }; in, V adjust The adjusted task execution time window; t1′, t2′, …, t k ' is the adjusted task execution time point, which is adjusted in real time according to the latest load forecast and business needs.

6. An electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, characterized in that: The processor is used to execute the method for periodically automatically inspecting and backing up data for MySQL data as described in any one of claims 1 to 5 above.

7. A server, characterized in that: The invention comprises at least one processor and a memory in communication with the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes the method for periodically automatically checking and backing up data for MySQL data as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for periodically automatically checking and backing up data for MySQL data as described in any one of claims 1 to 5 is implemented.