Data backup method and device and server

By obtaining and using the backup time and storage address in the configuration information in the data backup method, determining the scheduling reference time point and performing data backup, the problem of data backup affecting transaction operation in the prior art is solved, and the data backup effect with strong flexibility and no occupancy of system resources is achieved.

CN119668935APending Publication Date: 2025-03-21AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411741410.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing data backup method will affect the normal operation of the transaction during the backup process and have poor operation flexibility. Especially in the accounting system, due to the existence of accounting dates, online transactions need to be closed for cold backups.

Method used

By obtaining the backup time point and storage address in the configuration information, determine the scheduling reference time point, and perform data backup at that time to avoid affecting transaction operation. The backup data is stored based on the storage path in the configuration information, and redundant storage is used for network additional storage and disk arrays.

Benefits of technology

It realizes data backup without affecting the normal operation of the transaction, improves operation flexibility, avoids the use of a large amount of system resources during peak business periods, and ensures data security and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668935A_ABST
    Figure CN119668935A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data backup method and device and a server. When the method is specifically executed, the method comprises the steps of determining a scheduling reference starting time point through a backup time point in configuration information, performing data backup based on the scheduling reference starting time point, and performing data storage on the backed-up data based on a storage path in the configuration information. Through the backup time point and the scheduling reference time point in the configuration information, data backup can be carried out in a time period with a relatively low system load, and the situation that a large number of system resources are occupied in a business peak period and normal transaction operation is influenced is avoided. Data backup can be executed based on the backup time point, the storage path and other information of the configuration information, manual intervention is not needed, and the system flexibility is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data backup method, device and server. Background Art

[0002] In the current information data era, the necessity and importance of data backup are unquestionable, and it is the basis for enterprises to recover from disasters. Existing data backup methods often use cold backup, that is, during the data backup process, the database storing the data cannot provide normal transaction operations. Only after the cold backup is completed can the database continue to provide transaction operations. Taking the data backup of the accounting system as an example, the current data backup of the accounting system often requires closing online transactions to ensure that there are no database transaction operations before backup due to the existence of accounting dates. However, this backup method not only affects the normal operation of transactions, but also often requires personnel intervention and system adjustments, so the operational flexibility is poor. Summary of the invention

[0003] The embodiments of the present application provide a data backup method, apparatus and device, which are used to back up data without affecting the normal operation of transactions and have strong operational flexibility.

[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0005] In a first aspect, the present application provides a data backup method, the method comprising:

[0006] Acquire configuration information, the configuration information including a backup time point and a storage address, the backup time point being a time point at which new data is stopped from being received;

[0007] Based on the backup time point, determining a scheduling reference time point; the difference between the scheduling reference time point and the backup time point is a first preset duration;

[0008] Perform data backup based on the scheduling reference time point and obtain the backup data;

[0009] Based on the storage address, the backup data is stored.

[0010] Optionally, if the backup time point is a daily switching time point, the method further includes:

[0011] If the business volume on that day is greater than the preset business volume threshold, determining the backup time point as the first time point;

[0012] If the business volume of the day is less than or equal to the preset business volume threshold, the backup time point is determined to be a second time point, and the second time point is earlier than the first time point.

[0013] Optionally, if the backup time point is a daily switching time point, the method further includes:

[0014] If the day is the end of a month or a quarter, the backup time point is determined to be the first time point;

[0015] If the day is not the end of the month and the end of the quarter, the backup time point is determined to be the second time point; the first time point is later than the second time point.

[0016] Optionally, determining a scheduling reference time point based on the backup time point includes:

[0017] Determining the first preset duration based on historical backup efficiency and database load;

[0018] The scheduling reference time point is determined based on the first preset duration and the backup time point.

[0019] Optionally, the historical backup efficiency includes a historical CPU occupancy index, a historical IO occupancy index, and a historical memory occupancy index. The first preset duration is determined based on the historical backup efficiency and the database load, including:

[0020] The first preset duration is determined based on the historical CPU occupancy index, the historical IO occupancy index, the historical memory occupancy index, and the database load.

[0021] Optionally, the method further comprises:

[0022] Generate a system scheduling task table, the system scheduling task table includes a count date, a task name, a scheduling status, a scheduling reference start time, a scheduling actual start time, a scheduling actual completion time, and a failure reason;

[0023] The step of backing up data based on the scheduling reference time point and obtaining the backup data includes:

[0024] Obtaining the scheduling status and the scheduling reference time under the current accounting date from the system scheduling task table;

[0025] If the scheduling status is waiting status and the current time is greater than or equal to the scheduling reference time, data backup is performed and the system scheduling task table is updated. The accounting date in the updated system scheduling task table is the date corresponding to the current time, the task name is the scheduled completion time of the system backup, and the scheduling status is the completion status.

[0026] Optionally, storing the backup data based on the storage address includes:

[0027] Based on the storage address, the backup data is stored using a network attached storage NAS and a disk array RAID.

[0028] Optionally, the method further comprises:

[0029] Obtain the corresponding monitoring logs during the data backup process;

[0030] If the monitoring log involves a complex transaction, determine whether the log within the transaction execution time overlaps with the log in the backup log table; if not, obtain the log information after the table is locked based on the lock table start time, and the backup log table is used to record the backup information;

[0031] If the monitoring log does not involve complex transactions, the log information after the table is locked is obtained based on the table lock start time;

[0032] Merge the log information after locking the table with the backup data to obtain merged data;

[0033] The storing the backup data based on the storage address includes:

[0034] Based on the storage address, the merged data is stored.

[0035] In a second aspect, an embodiment of the present application provides a data backup device, the device comprising:

[0036] A configuration unit, used to obtain configuration information, wherein the configuration information includes a backup time point and a storage address, wherein the backup time point is a time point at which new data is stopped from being received;

[0037] A determination unit, configured to determine a scheduling reference time point based on the backup time point; the difference between the scheduling reference time point and the backup time point is a first preset duration;

[0038] A backup unit, used to perform data backup based on a scheduling reference time point and obtain backup data;

[0039] A storage unit is used to store the backup data based on the storage address.

[0040] In a third aspect, an embodiment of the present application provides a server, including a memory and a processor.

[0041] The memory is used to store the computing program;

[0042] The processor is used to execute the computing program to implement the data backup method as described in any one of the first aspects.

[0043] In a fourth aspect, an embodiment of the present application provides a computer storage medium for storing a computer program, which, when executed, is used to implement the method as described in any one of the first aspects.

[0044] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on at least one computing device, enables the at least one computing device to implement a method as described in any one of the first aspects.

[0045] In summary, the embodiments of the present application provide a data backup method, device and server. When the method is specifically executed, it includes: determining the scheduling reference start time point through the backup time point in the configuration information, performing data backup based on the scheduling reference start time point, and storing the backed-up data based on the storage path in the configuration information. Through the backup time point and the scheduling reference time point in the configuration information, data backup can be performed during periods of low system load to avoid occupying a large amount of system resources during business peak periods and affecting normal transaction operations. Based on information such as the backup time point and storage path in the configuration information, data backup can be performed without manual intervention, and the system has strong flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0047] Figure 1 A system architecture diagram of a data backup method provided in an embodiment of the present application;

[0048] Figure 2 A flow chart of a data backup method provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of implementing the storage of backup data to off-site data;

[0050] Figure 4 A flowchart of another data backup method provided in an embodiment of the present application;

[0051] Figure 5 A flow chart of a data merging method provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of the structure of a data backup device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] In order to enable those skilled in the art to better understand the embodiments of the present application, technical terms are first introduced.

[0055] Accounting system: A software system used to manage and record a company's financial activities. It is used to help companies manage financial data, including income, expenditure, assets and liabilities.

[0056] Accounting date: The date used in accounting. The accounting date is different from the actual natural date.

[0057] Hot backup: refers to the ability to back up data while the database is providing transaction operations.

[0058] Cold backup: refers to the process in which the database cannot provide normal transaction operations during the data backup process. Only after the backup is completed can it continue to provide transaction operations.

[0059] As mentioned above, data backup is required in many scenarios, but the cold backup method will affect the normal use and flexibility of transactions provided by the database. For example, the data backup of the accounting system often requires a cold backup of the entire data due to the existence of accounting dates, that is, the backup is performed after closing the online transaction to ensure that there is no transaction operation in the database. The cold backup method will affect the normal use of transactions, and because the switching of accounting dates, backup scheduling and other operations are fixed, the transaction flexibility is limited.

[0060] In view of this, an embodiment of the present application provides a data backup method, which determines the scheduling reference start time point through the backup time point in the configuration information, performs data backup based on the scheduling reference start time point, and stores the backed-up data based on the storage path in the configuration information. Through the backup time point and the scheduling reference time point in the configuration information, data backup can be performed during periods of low system load to avoid occupying a large amount of system resources during business peak periods and affecting normal business operations. Based on information such as the backup time point and storage path of the configuration information, data backup can be performed without manual intervention, and the system has strong flexibility.

[0061] First, the application scenario of the data backup method provided by the embodiment of the present application is introduced.

[0062] Attached Figure 1A system architecture diagram of a data backup method provided in an embodiment of the present application. The system architecture 100 is a diagram of an accounting system architecture, and the system architecture 100 includes a terminal device 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0063] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101.

[0064] The terminal device 101 may be an electronic device having a page display processing screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.

[0065] The server 103 may be a server that provides various services, such as a background management server (only an example) that provides support for users to use the terminal device 101. The background management server may analyze and process the received product information query request and other data, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0066] It should be noted that the database backup method provided in the embodiment of the present invention is generally executed by the server 103, and accordingly, the computing device is generally disposed in the server 103. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0067] The data backup method provided by the embodiment of the present application is described below in conjunction with the accompanying drawings. In order to enable those skilled in the art to better understand the embodiment of the present application, the following is a schematic description using an accounting system as an example. It should be noted that the embodiment of the present application can also be applied to other scenarios, and the embodiment of the present application is not specifically limited.

[0068] Attached Figure 2 A data backup method flow chart provided in an embodiment of the present application, the method comprising:

[0069] S210: Obtain configuration information.

[0070] Configuration information refers to the information required for data backup that is configured through the host computer, including information such as backup time point and storage location. Among them, the backup time point refers to the time point when new data is stopped from being received. For example, for the accounting system, since the accounting system pays more attention to the accounting date, the backup time point at this time is the day-cut time point. Among them, the day-cut time point refers to the accounting date switching time point, which also refers to the time point in a day when new transaction data is stopped from being received and a series of day-processing operations are started.

[0071] Furthermore, in order to reduce unnecessary operation and maintenance burdens on the accounting system, the daily cut-off time point can be determined according to the busyness of the business. In one example, if the system connection business volume on that day is greater than the preset business volume threshold, the daily cut-off time point is set to the first time point. If the system connection business volume on that day is less than or equal to the preset business volume threshold, the daily cut-off time point is set to the second time point. Among them, the first time point is later than the second time point. For example, the preset business volume threshold is 10,000 transactions, the first time point is 3 a.m. the next day, and the second time point is 12 a.m. on the same day. If the business volume on that day is 15,000 transactions, which exceeds the preset threshold of 10,000 transactions, the daily cut-off time point is 3 a.m. the next day. If the business volume on that day is 8,000 transactions, which does not reach the preset threshold of 10,000 transactions, the daily cut-off time point is 12 a.m. on that day.

[0072] In another example, considering that the business volume is relatively large at the end of the month (the last day of each month) or the end of the quarter (the last day of the first quarter), it is possible to determine whether the day is the end of the month or the end of the quarter. If so, the day-cut time point is set to the first time point, otherwise the day-cut time point is set to the second time point. For example, if the day is the end of the month, the day-cut time point is set to 3 a.m. the next day. If the day is not the end of the month or the end of the quarter, the day-cut time point is 12 a.m. on the day.

[0073] Exemplary description: Table 1 is a daily time point configuration table.

[0074] Table 1

[0075] Serial number Cron Expressions Daily cut time configuration Integer String Timestamp

[0076] cronExpr is used to specify the specific date corresponding to the day-cut time point. The data type is string type. cronExpr includes day, month, week, etc. For example, cronExpr "2024.01.13" means the date is January 13, 2024.

[0077] The daily switching time configuration is used to configure the daily switching time point. For example, the timestamp (i.e., time point) "03:00" means that the daily switching time point is 3 o'clock.

[0078] Through the daily cut time point configuration table, maintenance personnel can more clearly understand and manage the settings of each daily cut time point, ensuring that the accounting system performs end-of-day processing at the appropriate time, thereby improving system stability and data accuracy.

[0079] In addition, the configuration information also includes but is not limited to data retention configuration and backup scope configuration. Among them, the data retention configuration is used to determine which data needs to be retained and which data needs to be cleared. The backup scope configuration is used to specify the data to be backed up.

[0080] In addition, the configuration information may also include but is not limited to the backup file type, backup strategy, and backup table directory. Among them, the backup table directory refers to a data table or data file that records detailed information of the backup file. For example, the backup table directory includes the backup file identifier, backup status, etc. The backup table target helps to quickly locate and manage backup files and improve backup efficiency. The backup strategy refers to the methods and rules followed for data backup, such as full backup, incremental backup, or differential backup. The backup file type refers to the file type that needs to be backed up, such as database files, log files, configuration files, etc.

[0081] S220: Based on the configuration information, obtain the backed-up backup data.

[0082] In an embodiment of the present application, the server determines the scheduling reference start time based on the backup time point in the configuration information, performs data backup based on the scheduling reference start time, and obtains the backup data after the backup. Among them, the scheduling reference start time point is the first preset time before the backup time point, such as 10 minutes before the backup time point. For example, if the backup time point is 12:00 a.m. on the same day, the scheduling reference start time can be 11:50 a.m. on the same day. The system performs data backup 10 minutes before the backup time point, which can ensure that it is completed on time at the backup time point, avoiding missing the backup time point due to uncertain factors in the backup process. In addition, the first preset time length is not easy to process, otherwise it will result in poor data integrity.

[0083] For the accounting system, the accounting system determines the reference start time of scheduling based on the daily cut-off time point. Furthermore, the accounting system will obtain the first preset duration based on the historical backup efficiency and / or database load. Therefore, by dynamically adjusting the first preset duration, backup during peak hours can be avoided, reducing backup failures caused by insufficient resources. And through the historical backup efficiency and the daily cut-off time point, the time required for backup can be accurately predicted to improve backup efficiency.

[0084] Exemplary description: Table 2 is a scheduled scheduling time control table. The accounting system can dynamically adjust the first preset duration based on the data in the scheduled scheduling time control table.

[0085] Table 2

[0086]

[0087] The scheduled scheduling time control table includes accounting date, analysis time, system CPU occupancy index, system IO occupancy index, system memory occupancy index, current database load and calculation results. The accounting date is a date type, such as 2024-11-11, and the analysis time is a timestamp, such as 00:00; 00. The system CPU occupancy index, system IO occupancy index, system memory occupancy index, and current data capacity are all floating point types. The calculation result is time. For example, the accounting date is 2024-11-11, the analysis time is 00:00:00, the system CPU occupancy index is 0.2, the system IO occupancy index is 0.3, the system memory occupancy index is 0.4, and the current database load is 1000000.

[0088] The first preset duration can be determined by counting parameters such as the system CPU occupancy indication, IO occupancy index, memory occupancy index, and database load of the second preset duration. For example, the system CPU occupancy index, system IO occupancy index, system memory occupancy index, and current data capacity within the second preset duration are 0.1875, 0.2875, 0.3875, and 1005000, respectively, and the corresponding first preset duration is 10 minutes. Then the accounting date is 2024-11-11, the analysis time is 00:00:00, the system CPU occupancy index is 0.2, the system IO occupancy index is 0.3, the system memory occupancy index is 0.4, and the database load is 1000000, and the corresponding calculation result (i.e., the first preset duration) is 10 minutes.

[0089] In addition, in the embodiment of the present application, the server also includes a system scheduling task table, which defines the daily backup scheduling time. For example, Table 3 shows a system scheduling task table, including accounting date, task name, scheduling status, scheduling reference start time, scheduling actual start time, scheduling actual completion time, failure reason, etc.

[0090] Table 3

[0091]

[0092] When the server performs data backup, it first reads the scheduling status and scheduling reference start time of the current accounting date in the system scheduling task table. If the current accounting date scheduling status is in the waiting state (such as W state) and the current time is ≥ the scheduling reference time, the data backup operation is performed and the scheduling status is set to the start scheduling state. The server records the scheduling start time and synchronizes it in the system scheduling task table.

[0093] When the server completes the backup operation, the accounting date of the system scheduling task table is updated to the current day, the task name is the scheduled completion time of the system backup, and the scheduling status field is updated to F-Completed, indicating that the system backup of the accounting date has been completed.

[0094] Then, the server queries the backup time point and parses the cron expression. When the system time exceeds the daily cut-off time configuration, the accounting date is updated to the next day. At this time, the system enters a new accounting workday.

[0095] In addition, in the embodiment of the present application, due to the presence of table-level locks during the data backup process, the backup of transaction data during the period will be lost, resulting in incomplete final data. To compensate for the data loss caused by the process, the server also monitors the main database log during the backup period and merges the monitored log with the backup data. For example, the monitored log is converted into a transactional statement, and the backup data is supplemented after the backup data is completed.

[0096] S230: Store the backup data based on the storage path in the configuration information.

[0097] In an embodiment of the present application, the server can store the backup data to a designated device based on the storage path. For example, after the backup data is backed up, a data backup file named after the accounting date is generated, and the server can store the data backup file to a designated device based on the storage path.

[0098] Furthermore, in order to ensure the reliability of backup data and avoid the problem of backup data loss caused by hardware damage, the embodiment of the present application uses network attached storage (NAS) and disk array (RAID) for backup data storage. Among them, NAS can be accessed at any time through the network, without geographical and distance restrictions, and the storage capacity can be expanded at any time. Through the deployment of multiple NAS in multiple locations, off-site disaster recovery storage of backup data can be achieved. For example Figure 3 The figure shows a schematic diagram of implementing the storage of backup data in off-site data. The backup data can be stored on NAS1 in location A and NAS2 in location B. On any accounting day, the compressed backup data is stored on two NAS deployed in different locations at the same time. If any NAS is damaged, the data of the day can be found in the other NAS.

[0099] RAID can achieve redundant storage of backup data by combining multiple hard disks. For important month-end and year-end backup data that need to be stored for a long time, RAID10 storage can be used. This storage method allows half of the hard disks to be damaged at the same time, and the backup data files are still intact and available. For backup data that needs to be cleaned up regularly, RAID0 storage can be used to make full use of hard disk storage space. The flexible use of NAS and RAID can not only achieve dual protection of backup data security, but also reasonably use storage space according to the importance of backup data.

[0100] In summary, the embodiment of the present application determines the scheduling reference start time point through the backup time point in the configuration information, performs data backup based on the scheduling reference start time point, and stores the backed-up data based on the storage path in the configuration information. Through the backup time point and the scheduling reference time point in the configuration information, data backup can be performed during periods of low system load to avoid occupying a large amount of system resources during business peak periods and affecting normal business operations. Based on information such as the backup time point and storage path of the configuration information, data backup can be performed without manual intervention, and the system has strong flexibility.

[0101] Furthermore, another data backup method is provided below. This method is described by taking an accounting system as an example. Specifically, the server is installed with the accounting system, and the accounting system performs a data backup operation.

[0102] Attached Figure 4 Another data backup method flow chart provided in the present application embodiment. The method is applied to the attached Figure 1 In the application scenario shown, the method includes the following contents:

[0103] S410. The terminal device 101 obtains configuration information.

[0104] In one example, the terminal device 101 displays a configuration interface, and the user can configure relevant configuration information in the configuration interface.

[0105] In another example, the user can obtain system backup information from historical backup information and display it on the interface of the terminal device 101. The system backup information includes backup time, backup file, backup status, cleanup status, storage location, data extraction, etc. The user understands the data backup status based on the information displayed on the interface of the terminal device 101 and configures related configuration information.

[0106] S420 , the terminal device 101 sends the configuration information to the server 103 .

[0107] S430. The server 103 determines a scheduling reference start time based on the day-cut time point in the configuration information.

[0108] S440. The server 103 performs data backup based on the scheduling reference start time.

[0109] S450: The server 103 obtains backup data and backup logs.

[0110] The backup log refers to the log that records database transaction operations during the backup process.

[0111] S460. The server 103 merges the backup log and the backup data to obtain merged data.

[0112] Since backup data and backup logs may be duplicated, the backup logs can be translated into Structured Query Language (SQL) information, and the SQL information is obtained to complete the merging of backup data due to the transaction operation on the table during the backup lock. The backup lock table here means that in the backup process, in order to ensure data consistency and integrity, some tables are locked to prevent modification operations on these tables during the backup process.

[0113] Furthermore, in the embodiment of the present application, since the transaction operation of the database will not be synchronously executed by the database during the table lock period, this part is lost during the backup process. The server 103 can record the backup information through the backup log table to record the time of the backup lock table, the name of the backup table, the actual start time of the backup, the actual end time of the backup, etc. For example, Table 4 is a schematic diagram of a backup log table.

[0114] Table 4

[0115] Accounting date Table name The actual time the backup started The actual end time of the backup Date Type String Timestamp Timestamp

[0116] In addition, during the data backup process, since the table being backed up is locked, new transactions generated in the accounting system operate the table through the database, and the actual results will not be backed up. Therefore, it is necessary to assist in the recording operation of the backup log. To this end, when backing up, the server 103 first records the actual start time and the actual end time of the backup, and displays them in the backup log table. When all data are backed up, the log filtering operation begins. The filtered log and backup data are merged to obtain the merged data. Figure 5 Provide detailed explanation.

[0117] Attached Figure 5 A flow chart of a data merging method provided in an embodiment of the present application, the method includes the following contents:

[0118] S510: Determine whether the log involves a complex transaction. If so, execute S520; if not, execute S530.

[0119] In the database, a complex transaction refers to a transaction involving multiple tables.

[0120] If the server determines that the log involves transactions of multiple tables, the server determines that the log involves a complex transaction. If the log involves a transaction of a single table, the server determines that the log does not belong to a complex transaction.

[0121] S520, determine whether the transaction execution time and the backup log table have overlapping parts. If not, execute S530. If yes, end.

[0122] If the log involves complex transactions, mark the actual start time and the actual end time of the transaction. In the time period between the actual start time and the actual end time of the transaction, determine whether there is any overlap between the log and the backup log table. For example, the execution order of transaction T is as follows: table A adds data, table B deletes data, and table C updates data. If the backup of B is being executed during the execution period of transaction T, the backup result does not contain the operation of this transaction. At this time, filter by time to jump out the log information of tables A, B and C in this period.

[0123] S530: Obtain log information after locking the table based on the start time.

[0124] S540: After appending the filtered log information to the backup data, the merged data is obtained.

[0125] At this point, the server can obtain the full amount of data.

[0126] S470. The server 103 stores the merged data based on the storage path in the configuration information.

[0127] S480. Clean up data based on the data retention configuration in the configuration information.

[0128] The configuration information configures whether the system backup data is permanently stored and the storage period, etc. This configuration information is the data retention configuration. For the accounting system, important end-of-month and end-of-quarter data can be configured to be permanently stored to prepare for various data extraction needs in the future. For non-important node data, the retention period can be configured, such as 15 days. By designing an expired data cleanup function, the data backup retention configuration table is read after the accounting date is cut off every day, and the cleanup operation of historical redundant data is completed to ensure the long-term normal operation of the system backup.

[0129] The embodiment of the present application performs data cleaning based on the data retention configuration in the configuration information. In the case where the backup data and the backup log may be duplicated, the backup lock table is used to filter the logs and merge the logs to ensure that the stored data is full data. In this way, full data backup can be achieved, and configuration information can be determined based on historical backup data to improve configuration accuracy.

[0130] In addition, an embodiment of the present application also provides a data backup device.

[0131] Attached Figure 6 A schematic diagram of a data backup device structure provided in an embodiment of the present application. The device 600 includes:

[0132] The configuration unit 601 is used to obtain configuration information, where the configuration information includes a backup time point and a storage address, where the backup time point is a time point when new data is stopped from being received;

[0133] A determination unit 602 is configured to determine a scheduling reference time point based on the backup time point; the difference between the scheduling reference time point and the backup time point is a first preset duration;

[0134] The backup unit 603 is used to perform data backup based on the scheduling reference time point and obtain the backup data;

[0135] The storage unit 604 is configured to store the backup data based on the storage address.

[0136] Optionally, if the backup time point is a daily cut-off time point, the configuration unit 601 is also used to: if the business volume on that day is greater than a preset business volume threshold, determine the backup time point as a first time point; if the business volume on that day is less than or equal to the preset business volume threshold, determine the backup time point as a second time point, and the second time point is earlier than the first time point.

[0137] Optionally, if the backup time point is a daily cut-off time point, the configuration unit 601 is also used to: if the day is the end of a month or the end of a quarter, determine the backup time point as a first time point; if the day is not the end of a month and not the end of a quarter, determine the backup time point as a second time point; the first time point is later than the second time point.

[0138] Optionally, the determination unit 602 is used to: determine the first preset duration based on historical backup efficiency and database load; and determine the scheduling reference time point based on the first preset duration and the backup time point.

[0139] Optionally, the historical backup efficiency includes a historical CPU occupancy index, a historical IO occupancy index, and a historical memory occupancy index, and the determination unit 602 is specifically used to determine the first preset duration based on the historical CPU occupancy index, the historical IO occupancy index, the historical memory occupancy index, and the database load.

[0140] Optionally, the device further comprises a generating unit for generating a system scheduling task table, wherein the system scheduling task table comprises a counting date, a task name, a scheduling status, a scheduling reference start time, a scheduling actual start time, a scheduling actual completion time and a failure reason. The backup unit 603 is used to:

[0141] Obtain the scheduling status and the scheduling reference time under the current accounting date from the system scheduling task table; if the scheduling status is a waiting state and the current time is greater than or equal to the scheduling reference time, perform data backup and update the system scheduling task table. The accounting date in the updated system scheduling task table is the date corresponding to the current time, the task name is the scheduling completion time of the system backup, and the scheduling status is a completion state.

[0142] The storage unit 604 is specifically used to store the backup data based on the storage address by using a network attachment storage and a disk array.

[0143] The storage unit is also used to: obtain the corresponding monitoring log during the data backup process; if the monitoring log involves complex transactions, determine whether there is overlap with the backup log table during the transaction execution time; if not, obtain the log information after the table is locked based on the lock table start time, and the backup log table is used to record the backup information; if the monitoring log does not involve complex time, obtain the log information after the table is locked based on the lock table start time; merge the log information after the table is locked with the backup data to obtain merged data; based on the storage address, store the merged data.

[0144] In summary, the data backup device provided in the embodiment of the present application determines the scheduling reference start time point through the backup time point in the configuration information, performs data backup based on the scheduling reference start time point, and stores the backed-up data based on the storage path in the configuration information. Through the backup time point and the scheduling reference time point in the configuration information, data backup can be performed during periods of low system load to avoid occupying a large amount of system resources during business peak periods and affecting normal business operations. Based on information such as the backup time point and storage path of the configuration information, data backup can be performed without manual intervention, and the system has strong flexibility.

[0145] For the convenience of description, the above system is described as being divided into various modules according to their functions. Of course, when implementing the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0146] It is understandable that in the specific implementation of the present application, related data such as user information and historical user information are involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components 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 modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0148] Professionals may further appreciate that the units and algorithm 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 the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.

[0149] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0150] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0151] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data backup method, characterized in that: The method comprises: Acquire configuration information, the configuration information including a backup time point and a storage address, the backup time point being a time point at which new data is stopped from being received; Based on the backup time point, determining a scheduling reference time point; the difference between the scheduling reference time point and the backup time point is a first preset duration; Perform data backup based on the scheduling reference time point and obtain the backup data; Based on the storage address, the backup data is stored.

2. The method according to claim 1, characterized in that If the backup time point is a daily switching time point, the method further includes: If the business volume on that day is greater than the preset business volume threshold, determining the backup time point as the first time point; If the business volume of the day is less than or equal to the preset business volume threshold, the backup time point is determined to be a second time point, and the second time point is earlier than the first time point.

3. The method according to claim 1, characterized in that If the backup time point is a daily switching time point, the method further includes: If the day is the end of a month or a quarter, the backup time point is determined to be the first time point; If the day is not the end of the month and the end of the quarter, the backup time point is determined to be the second time point; the first time point is later than the second time point.

4. The method according to claim 1, characterized in that: The determining of the scheduling reference time point based on the backup time point includes: Determining the first preset duration based on historical backup efficiency and database load; The scheduling reference time point is determined based on the first preset duration and the backup time point.

5. The method according to claim 4, characterized in that The historical backup efficiency includes a historical CPU occupancy index, a historical IO occupancy index, and a historical memory occupancy index. The first preset duration is determined based on the historical backup efficiency and the database load, including: The first preset duration is determined based on the historical CPU occupancy index, the historical IO occupancy index, the historical memory occupancy index, and the database load.

6. The method according to claim 1, characterized in that The method further comprises: Generate a system scheduling task table, the system scheduling task table includes a count date, a task name, a scheduling status, a scheduling reference start time, a scheduling actual start time, a scheduling actual completion time, and a failure reason; The step of backing up data based on the scheduling reference time point and obtaining the backup data includes: Obtaining the scheduling status and the scheduling reference time under the current accounting date from the system scheduling task table; If the scheduling status is waiting status and the current time is greater than or equal to the scheduling reference time, data backup is performed and the system scheduling task table is updated. The accounting date in the updated system scheduling task table is the date corresponding to the current time, the task name is the scheduled completion time of the system backup, and the scheduling status is the completion status.

7. The method according to claim 1, characterized in that The storing the backup data based on the storage address includes: Based on the storage address, the backup data is stored using a network attached storage NAS and a disk array RAID.

8. The method according to claim 1, characterized in that The method further comprises: Obtain the corresponding monitoring logs during the data backup process; If the monitoring log involves a complex transaction, determine whether the log within the transaction execution time overlaps with the log in the backup log table; if not, obtain the log information after the table is locked based on the lock table start time, and the backup log table is used to record the backup information; If the monitoring log does not involve complex transactions, the log information after the table is locked is obtained based on the table lock start time; Merge the log information after locking the table with the backup data to obtain merged data; The storing the backup data based on the storage address includes: Based on the storage address, the merged data is stored.

9. A data backup device, characterized in that: The device comprises: A configuration unit, used to obtain configuration information, wherein the configuration information includes a backup time point and a storage address, wherein the backup time point is a time point at which new data is stopped from being received; A determination unit, configured to determine a scheduling reference time point based on the backup time point; the difference between the scheduling reference time point and the backup time point is a first preset duration; A backup unit, used to perform data backup based on a scheduling reference time point and obtain backup data; A storage unit is used to store the backup data based on the storage address.

10. A server, characterized in that: including memory and processor; The memory is used to store the computing program; The processor is used to execute the computing program to implement the data backup method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Data backup scheduling method, device and system, server and program product

    CN120872691A