A database automatic backup method and system based on dynamic monitoring

Through dynamic monitoring and rating partition backup algorithms, combined with online incremental and offline backup methods, the problems of low backup efficiency in fixed cycles and failure in large files are solved, and adaptive database automatic backup is realized, improving backup efficiency and security.

CN118819966BActive Publication Date: 2024-12-13QIAN XINGCHENG NETWORK SECURITY TECH (HUNAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411296963.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-13
Estimated Expiration
2044-09-18

AI Technical Summary

Technical Problem

The existing database automatic backup method uses fixed cycles to backup, resulting in low backup efficiency and easy to cause large files to fail and waste computing resources.

Method used

Using the automatic database backup method based on dynamic monitoring, verify security by obtaining user account and IP address, select offline backup and online incremental backup methods, initialize dynamic monitoring parameters such as dynamic backup cycle and data growth rate, and design rating partition backup algorithm. Update dynamic backup cycles based on data growth and growth rate, and perform data backups in combination with online incremental and offline backup methods.

Benefits of technology

It improves the efficiency of computing resources, ensures complete backup of data, enhances the security and reliability of backup, avoids backup failures caused by network problems of large files, and improves backup efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819966B_ABST
    Figure CN118819966B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for automatic database backup based on dynamic monitoring, the method comprising: obtaining a user account and a user IP address to verify the security of data backup; obtaining data to be backed up and selecting a backup method according to the data type; initializing dynamic monitoring parameters when the backup method is offline backup; designing a rating partition backup algorithm to complete offline backup of data; calculating the data growth amount and the data growth rate, and updating the dynamic backup cycle according to the data growth amount and the data growth rate. The present invention updates the dynamic backup cycle by the data growth amount and the data growth rate, thereby improving the utilization efficiency of backup resources; verifies the security of data backup by the user account and the user IP address; and designs a rating partition backup algorithm for offline backup to further improve backup efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data backup, and in particular to a database automatic backup method and system based on dynamic monitoring. Background Art

[0002] With the continuous development of society, the capacity of information data is also increasing exponentially. In order to meet the society's demand for data, database technology has attracted more and more attention. Whether it is data transmission in daily life or the use of important data at work, people are increasingly dependent on information systems. In order to avoid data loss, database backup technology has become a research hotspot for scientific researchers.

[0003] In order to realize automatic database backup, people have also proposed a database automatic backup method and device, an intelligent database automatic backup system, and a database automatic backup method, device and storage device based on MongoDB. Although these methods can realize the function of automatic database backup, most of these existing methods use a fixed time to perform database backup, and adjust according to the change of data volume, thereby reducing the backup efficiency. In addition, the existing methods back up data one by one, which is easy to cause backup failure of large files and waste computing resources. Therefore, improvement is needed. Summary of the invention

[0004] The present invention provides a database automatic backup method and system based on dynamic monitoring, so as to solve the technical problem that the current database automatic backup method adopts fixed period to perform backup, the backup efficiency is low, and the backup of relatively large files is likely to fail.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0006] The present invention provides a database automatic backup method based on dynamic monitoring, comprising:

[0007] S1: Obtain the user account and user IP address to verify the security of data backup;

[0008] S2: Get the data to be backed up and select the backup method based on the data type. The backup methods are divided into offline backup and online incremental backup.

[0009] S3: when the backup mode is offline backup, initialize dynamic monitoring parameters, where the dynamic monitoring parameters include dynamic backup cycle, data growth amount and data growth rate;

[0010] S4: Design a rating partition backup algorithm to complete offline data backup;

[0011] S5: Calculate the data growth amount and the data growth rate, and update the dynamic backup period according to the data growth amount and the data growth rate.

[0012] Furthermore, obtaining the user account and the user IP address and verifying the security of the data backup includes:

[0013] Get User Account and the user's IP address ;

[0014] The user account The user IP address is 8 characters long and contains numbers, lowercase letters, and uppercase letters. The Internet Protocol address of the user's client;

[0015] The verification of the security of the data backup includes:

[0016] 1) Initial password verification: User account You need to enter your password to complete the initial verification. If the password is correct, you will be prompted to enter the combination code. If the password is incorrect, it indicates that there is a security risk in the user's account, and the user will be prompted with a security reminder via email, SMS, or smartphone.

[0017] 2) Combined code verification: When a user account is created, based on the user account and the user's IP address Generate a combined code The combination code is set as follows: the head B of the combination code consists of four random numbers from 0 to 9, the tail C consists of three random letters from a to z, and the middle It consists of the user account and the user's IP address;

[0018] After the user completes the initial password verification, he / she further enters the head B and tail C of the combination code to verify the security of the combination code. If the combination code is correct, it means that the data can be backed up. If the combination code is incorrect, it means that there is a security risk in the user account, and the user will be given a security reminder via email, text message and smart phone reminder.

[0019] Furthermore, the data to be backed up is obtained, and a backup mode is selected according to the data type. The backup modes are divided into offline backup and online incremental backup, including:

[0020] Acquire the data to be backed up, and divide the data to be backed up into real-time data and delayed data according to the data transmission situation;

[0021] Real-time data refers to data that changes in real time; delayed data refers to data that needs to be backed up after being cached;

[0022] For real-time data, online incremental backup is used for data backup;

[0023] For delayed data, use offline backup to back up data;

[0024] The delay data includes the delay data capacity M, the capacity m of each file in the delay data, the user access frequency f and the user access duration t.

[0025] The online incremental backup method for data backup includes:

[0026] When using online incremental backup, only the data that has changed in real time is backed up and the original data is overwritten. To ensure that all changed data can be traced back to the modification record, when performing online incremental backup, logs are used to record all modified data and are retained for 7 days.

[0027] Furthermore, in step S3, the initialization of dynamic monitoring parameters includes:

[0028] Initialize dynamic backup cycle , Data growth and data growth rate ; The dynamic backup cycle refers to the interval Time, perform an offline backup of delayed data;

[0029] When performing offline backup, it is necessary to ensure that all delayed data in the previous dynamic backup cycle has been backed up. , Indicates the average time actually required for offline backup of delayed data in all dynamic periods.

[0030] Furthermore, in step S4, the step of designing a rating partition backup algorithm includes:

[0031] (1) Initialize user access frequency threshold and user access duration threshold , get the user access frequency and user access time ,in , represents the access frequency of the i-th file in the delay data, , represents the user access duration of the i-th file in the delay data, n represents the number of files in the delay data, ;

[0032] (2) Get the user access frequency of the i-th file , user access time ,if and , then the i-th file is rated as level I; if and ,or and , then the i-th file is rated as level II; if it is any other case, then the i-th file is rated as level III;

[0033] (3) Initialization file capacity threshold , get the capacity m of each file in the delayed data, , Indicates the file capacity of the i-th file in the delayed data, and obtains the file capacity of the i-th file ,if , then the i-th file is a large file; if , then the i-th file is a small file;

[0034] (4) The delayed data is screened to obtain six file rating partition labels. Each file corresponds to one of the labels. The six file rating partition labels are: , Level I large file , Level II small file , Level II large files , small file of level III , Level III large files ;

[0035] (5) Obtain the daily average backup network speed , calculate the average value of the backup network speed for a random selection of 5 consecutive seconds ,if , no backup is performed; if , the order of the backup files is , , ;if , the order of the backup files is , , ;

[0036] (6) Whenever all files of a file rating partition label are backed up, the average network speed of a randomly selected continuous 5 seconds needs to be recalculated.

[0037] Further, the calculating of the data growth amount and the data growth rate, and updating the dynamic backup period according to the data growth amount and the data growth rate, includes:

[0038] Calculating data growth The data growth amount is the average capacity value of the delayed data in the previous dynamic backup cycle And the delayed data capacity M is obtained, and the calculation formula is: ;

[0039] Calculate data growth rate The data growth amount is the average capacity value of the delayed data in the previous dynamic backup cycle and data growth The calculation formula is: ;

[0040] Get the average backup network speed of the current dynamic backup cycle , update the dynamic backup period, the calculation formula of the updated dynamic backup period is as follows: ;

[0041] Updated dynamic backup cycle To verify reliability, if , then the updated dynamic backup cycle meets the requirements. If , then The compensation calculation formula is: ,in Indicates the dynamic backup period after compensation.

[0042] On the other hand, the present invention also provides a database automatic backup system based on dynamic monitoring, comprising:

[0043] Security verification module, which obtains user account and user IP address and verifies the security of data backup;

[0044] The data acquisition module acquires the data to be backed up and selects the backup method based on the data type. The backup methods are divided into offline backup and online incremental backup.

[0045] Offline backup module: When the backup mode is offline backup, the dynamic monitoring parameters are initialized, including the dynamic backup cycle, data growth amount and data growth rate; for offline backup, a rating partition backup algorithm is designed to complete delayed data backup;

[0046] The dynamic backup cycle update module calculates the data growth amount and the data growth rate, and updates the dynamic backup cycle according to the data growth amount and the data growth rate.

[0047] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0048] 1. The present invention realizes automatic database backup by a dynamic monitoring-based method, updates the dynamic backup period by the data growth amount and the data growth rate, and verifies the reliability of the updated dynamic backup period. Compared with the solution of performing database backup in a fixed period, the solution of the present invention can adaptively adjust the backup period according to the change of data volume, thereby improving the utilization efficiency of computing resources and further ensuring the complete backup of data.

[0049] 2. Before performing backup, the present invention needs to complete two-step data backup security verification, namely, initial password verification and combination code verification. Compared with the solution of directly performing data backup, this solution can avoid backing up unnecessary data of other accounts, which can not only ensure that the data of important users is effectively backed up, but also improve the security and reliability of data backup.

[0050] 3. The scheme of the present invention adopts a combination of online incremental backup and offline backup to perform data backup. For online incremental backup, only the changed data is backed up, and all modified information is recorded and saved, which enhances the traceability of the backup data. For offline backup, a rating partition backup algorithm is designed, and the backup order of each file is further determined by rating the partition label based on the user access frequency and user access duration of each file in the delayed data. Compared with other direct backup schemes, this scheme can further improve the backup efficiency and solve the problem of backup failure of large files due to network problems, thereby causing large file data loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] 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 the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0052] Figure 1 A method for automatic database backup based on dynamic monitoring and a system step implementation diagram provided by an embodiment of the present invention;

[0053] Figure 2 A schematic diagram of a database automatic backup system module based on dynamic monitoring provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0055] Embodiment 1:

[0056] This embodiment will describe in more detail a database automatic backup method based on dynamic monitoring of the present invention in conjunction with the corresponding drawings. Figure 1 As shown, the following steps are included:

[0057] Step S1: Obtain the user account and user IP address to verify the security of data backup, including:

[0058] Get User Account and the user's IP address ;

[0059] The user account The user IP address is 8 characters long and contains numbers, lowercase letters, and uppercase letters. The Internet Protocol address of the user's client;

[0060] The verification of the security of the data backup includes:

[0061] 1) Initial password verification: User account You need to enter your password to complete the initial verification. If the password is correct, you will be prompted to enter the combination code. If the password is incorrect, it indicates that there is a security risk in the user's account, and the user will be prompted with a security reminder via email, SMS, or smartphone.

[0062] 2) Combined code verification: When a user account is created, based on the user account and the user's IP address Generate a combined code The combination code is set as follows: the head B of the combination code consists of four random numbers from 0 to 9, the tail C consists of three random letters from a to z, and the middle It consists of the user account and the user's IP address;

[0063] After the user completes the initial password verification, he / she further enters the head B and tail C of the combination code to verify the security of the combination code. If the combination code is correct, it means that the data can be backed up. If the combination code is incorrect, it means that there is a security risk in the user account, and the user will be given a security reminder via email, text message and smart phone reminder.

[0064] Step S2: Obtain the data to be backed up and select a backup method based on the data type. The backup methods are divided into offline backup and online incremental backup, including:

[0065] Acquire the data to be backed up, and divide the data to be backed up into real-time data and delayed data according to the data transmission situation;

[0066] Real-time data refers to data that changes in real time; delayed data refers to data that needs to be backed up after being cached;

[0067] For real-time data, online incremental backup is used for data backup;

[0068] For delayed data, use offline backup to back up data;

[0069] The delay data includes the delay data capacity M, the capacity m of each file in the delay data, the user access frequency f and the user access duration t.

[0070] When using online incremental backup, only the data that has changed in real time is backed up and the original data is overwritten. To ensure that all changed data can be traced back to the modification record, when performing online incremental backup, logs are used to record all modified data and are retained for 7 days.

[0071] Step S3: When the backup mode is offline backup, initialize dynamic monitoring parameters, where the dynamic monitoring parameters include dynamic backup period, data growth amount and data growth rate, including:

[0072] Initialize dynamic backup cycle , Data growth and data growth rate ; The dynamic backup cycle refers to the interval Time, perform an offline backup of delayed data;

[0073] When performing offline backup, it is necessary to ensure that all delayed data in the previous dynamic backup cycle has been backed up. , Indicates the average time actually required for offline backup of delayed data in all dynamic periods.

[0074] Step S4: Design a rating partition backup algorithm to complete offline data backup:

[0075] The steps of designing a rating partition backup algorithm include:

[0076] (1) Initialize user access frequency threshold and user access duration threshold , get the user access frequency and user access time ,in , represents the access frequency of the i-th file in the delay data, , represents the user access duration of the i-th file in the delay data, n represents the number of files in the delay data, ;

[0077] (2) Get the user access frequency of the i-th file , user access time ,if and , then the i-th file is rated as level I; if and ,or and , then the i-th file is rated as level II; if it is any other case, then the i-th file is rated as level III;

[0078] (3) Initialization file capacity threshold , get the capacity m of each file in the delayed data, , Indicates the file capacity of the i-th file in the delayed data, and obtains the file capacity of the i-th file ,if , then the i-th file is a large file; if , then the i-th file is a small file;

[0079] (4) The delayed data is screened to obtain six file rating partition labels. Each file corresponds to one of the labels. The six file rating partition labels are: , Level I large file , Level II small file , Level II large files , small file of level III , Level III large files ;

[0080] (5) Obtain the daily average backup network speed , calculate the average value of the backup network speed for a random selection of 5 consecutive seconds ,if , no backup is performed; if , the order of the backup files is , , ;if , the order of the backup files is , , ; If all large files are downloaded, back up the small files in order according to their rating partition labels until all files are backed up;

[0081] (6) Whenever all files of a file rating partition label are backed up, the average network speed of a randomly selected continuous 5 seconds needs to be recalculated.

[0082] In this embodiment, the rating partition label confirmed according to the user access frequency and the user access duration can further determine the importance of the file, and the important files are backed up first when the network speed is appropriate;

[0083] Under normal circumstances, all data can be backed up within the dynamic backup cycle. If there is still data that has not been backed up after the dynamic backup cycle ends, the dynamic backup cycle can be appropriately extended, and the data can be backed up in order of file size until all the data that needs to be backed up is backed up, and the backup status will be promptly fed back to the user.

[0084] Step S5: Calculate the data growth amount and the data growth rate, and update the dynamic backup period according to the data growth amount and the data growth rate, including:

[0085] Calculating data growth The data growth amount is the average capacity value of the delayed data in the previous dynamic backup cycle And the delayed data capacity M is obtained, and the calculation formula is: ;

[0086] Calculate data growth rate The data growth amount is the average capacity value of the delayed data in the previous dynamic backup cycle and data growth The calculation formula is: ;

[0087] Get the average backup network speed of the current dynamic backup cycle , update the dynamic backup period, the calculation formula of the updated dynamic backup period is as follows: ;

[0088] Updated dynamic backup cycle To verify reliability, if , then the updated dynamic backup cycle meets the requirements. If , then The compensation calculation formula is: ,in Indicates the dynamic backup period after compensation.

[0089] Example 2

[0090] The present invention also provides a database automatic backup system based on dynamic monitoring. The main modules of the database automatic backup system based on dynamic monitoring are as follows: Figure 2 As shown:

[0091] Security verification module, which obtains user account and user IP address and verifies the security of data backup;

[0092] The data acquisition module acquires the data to be backed up and selects the backup method based on the data type. The backup methods are divided into offline backup and online incremental backup.

[0093] Offline backup module: When the backup mode is offline backup, the dynamic monitoring parameters are initialized, including the dynamic backup cycle, data growth amount and data growth rate; for offline backup, a rating partition backup algorithm is designed to complete delayed data backup;

[0094] The dynamic backup cycle update module calculates the data growth amount and the data growth rate, and updates the dynamic backup cycle according to the data growth amount and the data growth rate.

[0095] The automatic database backup system based on dynamic monitoring of the present embodiment corresponds to the multi-information source general aviation fraud detection method of the above-mentioned embodiment; wherein, the functions implemented by each functional module in the automatic database backup system based on dynamic monitoring of the present embodiment correspond one-to-one to each process step in the multi-information source general aviation fraud detection method of the above-mentioned embodiment; therefore, they will not be repeated here.

[0096] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

Claims

1. A database automatic backup method based on dynamic monitoring, characterized in that: include: S1: Obtain the user account and user IP address to verify the security of data backup; S2: Get the data to be backed up and select the backup method based on the data type. The backup methods are divided into offline backup and online incremental backup. S3: when the backup mode is offline backup, initialize dynamic monitoring parameters, where the dynamic monitoring parameters include dynamic backup cycle, data growth amount and data growth rate; S4: Design a rating partition backup algorithm to complete offline data backup; The steps of designing a rating partition backup algorithm include: (1) Initialize user access frequency threshold and user access duration threshold , get the user access frequency and user access time ,in , represents the access frequency of the i-th file in the delay data, , represents the user access duration of the i-th file in the delay data, n represents the number of files in the delay data, ; (2) Get the user access frequency of the i-th file , user access time ,if and , then the i-th file is rated as level I; if and ,or and , then the i-th file is rated as level II; if it is any other case, then the i-th file is rated as level III; (3) Initialization file capacity threshold , get the capacity m of each file in the delayed data, , Indicates the file capacity of the i-th file in the delayed data, and obtains the file capacity of the i-th file ,if , then the i-th file is a large file; if , then the i-th file is a small file; (4) The delayed data is screened to obtain six file rating partition labels. Each file corresponds to one of the labels. The six file rating partition labels are: , Level I large file , Level II small file , Level II large files , Level III small file , Level III large files ; (5) Obtain the daily average backup network speed , calculate the average value of the backup network speed for a random selection of 5 consecutive seconds ,if , no backup is performed; if , the order of the backup files is , , ;if , the order of the backup files is , , ; (6) Whenever all files of a file rating partition label are backed up, the average network speed of a random continuous 5 seconds needs to be recalculated; S5: Calculate the data growth amount and the data growth rate, and update the dynamic backup period according to the data growth amount and the data growth rate.

2. The automatic database backup method based on dynamic monitoring according to claim 1, characterized in that: The step S1 comprises: Get User Account and the user's IP address ; The user account The user IP address is 8 characters long and contains numbers, lowercase letters, and uppercase letters. The Internet Protocol address of the user's client; The verification of the security of the data backup includes: 1) Initial password verification: User account You need to enter your password to complete the initial verification. If the password is correct, you will be prompted to enter the combination code. If the password is incorrect, it indicates that there is a security risk in the user's account, and the user will be prompted with a security reminder via email, SMS, or smartphone. 2) Combined code verification: When a user account is created, based on the user account and the user's IP address Generate a combined code The combination code is set as follows: the head B of the combination code consists of four random numbers from 0 to 9, the tail C consists of three random letters from a to z, and the middle It consists of the user account and the user's IP address; After the user completes the initial password verification, he / she further enters the head B and tail C of the combination code to verify the security of the combination code. If the combination code is correct, it means that the data can be backed up. If the combination code is incorrect, it means that there is a security risk in the user account, and the user will be given a security reminder via email, text message and smart phone reminder.

3. The automatic database backup method based on dynamic monitoring according to claim 1, characterized in that: The step S2 comprises: Acquire the data to be backed up, and divide the data to be backed up into real-time data and delayed data according to the data transmission situation; Real-time data refers to data that changes in real time; delayed data refers to data that needs to be backed up after being cached; For real-time data, online incremental backup is used for data backup; For delayed data, use offline backup to back up data; The delay data includes the delay data capacity M, the capacity m of each file in the delay data, the user access frequency f and the user access duration t.

4. The automatic database backup method based on dynamic monitoring as claimed in claim 3 is characterized in that: The online incremental backup method for data backup includes: When using online incremental backup, only the data that has changed in real time is backed up and the original data is overwritten. To ensure that all changed data can be traced back to the modification record, when performing online incremental backup, logs are used to record all modified data and are retained for 7 days.

5. The automatic database backup method based on dynamic monitoring as claimed in claim 3, characterized in that: In step S3, the initialization of dynamic monitoring parameters includes: Initialize dynamic backup cycle , Data growth and data growth rate ; The dynamic backup cycle refers to the interval Time, perform an offline backup of delayed data; When performing offline backup, it is necessary to ensure that all delayed data in the previous dynamic backup cycle has been backed up. , Indicates the average time actually required for offline backup of delayed data in all dynamic periods.

6. The automatic database backup method based on dynamic monitoring as claimed in claim 5, characterized in that: The step S5 comprises: Calculating data growth The data growth amount is the average capacity value of the delayed data in the previous dynamic backup cycle And the delayed data capacity M is obtained, and the calculation formula is: ; Calculate data growth rate The data growth amount is the average capacity value of the delayed data in the previous dynamic backup cycle and data growth The calculation formula is: ; Get the average backup network speed of the current dynamic backup cycle , update the dynamic backup period, the calculation formula of the updated dynamic backup period is as follows: ; Updated dynamic backup cycle To verify reliability, if , then the updated dynamic backup cycle meets the requirements. If , then The compensation calculation formula is: ,in Indicates the dynamic backup period after compensation.

7. A database automatic backup system based on dynamic monitoring, characterized in that: include: Security verification module, which obtains user account and user IP address and verifies the security of data backup; The data acquisition module acquires the data to be backed up and selects the backup method based on the data type. The backup methods are divided into offline backup and online incremental backup. Offline backup module: When the backup mode is offline backup, the dynamic monitoring parameters are initialized, including the dynamic backup cycle, data growth amount and data growth rate; for offline backup, a rating partition backup algorithm is designed to complete delayed data backup; A dynamic backup cycle update module calculates the data growth amount and the data growth rate, and updates the dynamic backup cycle according to the data growth amount and the data growth rate; To realize an automatic database backup method based on dynamic monitoring as described in any one of claims 1-6.