Data processing method and device, equipment and storage medium

By calculating the growth rate and change amount of the database system change number, the SCN at the moment of data anomaly can be quickly determined, solving the problem of difficult database data recovery and achieving efficient and accurate data recovery.

CN116340292BActive Publication Date: 2025-11-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310310334.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2025-11-07
Estimated Expiration
2043-03-24

AI Technical Summary

Technical Problem

Existing technologies make it difficult to quickly and accurately determine the System Change Number (SCN) when a database experiences data anomalies, leading to difficulties in database data recovery.

Method used

By obtaining the growth rate of the system change number in the database and combining it with the time difference within a preset time period, the change in the system change number is calculated. An iterative algorithm is used to improve the accuracy of the growth rate, determine the SCN at the moment of data anomaly, and achieve rapid data recovery.

Benefits of technology

It improves the efficiency and accuracy of database data recovery, avoids data loss and recovery failure caused by invalid timestamp mapping relationships or complex operations, and simplifies the data recovery process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340292B_ABST
    Figure CN116340292B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device, equipment and a storage medium, relating to the field of financial technology or other related fields. The data processing method comprises the following steps: in response to receiving a recovery instruction for recovering data of a target database at a data abnormal time, executing the recovery instruction, obtaining a target growth rate of a system change number of the target database; determining a preset time length, the starting time of the preset time length being the data abnormal time of the target database, and the ending time of the preset time length being the current time of the target database; determining the change amount of the system change number within the preset time length according to the target growth rate and the preset time length; determining the second system change number at the data abnormal time according to the change amount and the first system change number at the current time, and the second system change number is used for recovering the data corresponding to the data abnormal time of the target database. The method provided by the application improves the data recovery efficiency when the database appears data abnormality.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of financial technology or other related fields, in particular to a data processing method and device, equipment and storage medium. BACKGROUND

[0002] Database recovery refers to a technology of rescuing and recovering lost electronic data saved in a database through technical means. The database may become unavailable due to hardware or software (or both) failure, and different failure conditions require different recovery operations.

[0003] In related technologies, when data in a database is abnormal and the data in the database needs to be recovered, the system change number (SCN) of the database is usually used for data recovery, that is, the SCN at the time when the data is abnormal is obtained, and then the original data corresponding to the SCN is used for data recovery of the database. However, it is difficult to determine the SCN at the time when the data is abnormal, so that it is difficult to recover the data when the data in the database is abnormal. SUMMARY

[0004] The present application provides a data processing method, device, equipment and storage medium to improve the data recovery efficiency when the data in the database is abnormal.

[0005] In a first aspect, the present application provides a data processing method, comprising: in response to receiving a recovery instruction for recovering data of a target database at a data abnormal time, executing the recovery instruction, obtaining a target growth rate of a system change number of the target database; determining a preset time length, the starting time of the preset time length being the data abnormal time of the target database, and the ending time of the preset time length being the current time of the target database; determining a change amount of the system change number within the preset time length according to the target growth rate and the preset time length; determining a second system change number at the data abnormal time according to the change amount and a first system change number at the current time, the second system change number being used for recovering data corresponding to the data abnormal time of the target database.

[0006] In a possible implementation, the target growth rate of the system change number of the target database is obtained by using an iterative algorithm.

[0007] In a possible implementation, the target growth rate is obtained by using an iterative algorithm, including: for each of a preset number of iterations, obtaining a third system change number of the target database at a first time, a fourth system change number of the target database at a second time, and an interval length between the first time and the second time; determining a growth rate in the interval length according to the third system change number, the fourth system change number, and the interval length; determining an average of the growth rates of the preset number of iterations; and determining the average as the target growth rate.

[0008] In a possible implementation, the variation of the system change number in the preset time length is determined according to the target growth rate and the preset time length, including: obtaining a first product of the target growth rate and the preset time length; and determining the variation according to the first product.

[0009] In a possible implementation, the variation is determined according to the first product, including: determining the first product as the variation; or determining a second product of a preset coefficient and the first product; and determining the second product as the variation.

[0010] In a possible implementation, the second system change number of the data abnormal time is determined according to the variation and a first system change number at a current time, including: determining a difference between the first system change number and the variation; and determining the difference as the second system change number.

[0011] In a possible implementation, after the second system change number of the data abnormal time is determined, the method further includes: obtaining a data snapshot corresponding to the second system change number in the target database; determining to-be-restored data corresponding to the second system change number according to the data snapshot; and performing data recovery on the target database by using the to-be-restored data.

[0012] In a second aspect, the present application provides a data processing apparatus, including: an execution module configured to execute a recovery instruction for recovering data of a target database at a data abnormal time, and obtain a target growth rate of a system change number of the target database; a first determination module configured to determine a preset time length, a start time of the preset time length being the data abnormal time of the target database, and an end time of the preset time length being a current time of the target database; a second determination module configured to determine a variation of the system change number in the preset time length according to the target growth rate and the preset time length; and a third determination module configured to determine a second system change number of the data abnormal time according to the variation and a first system change number at the current time, the second system change number being used to recover data corresponding to the data abnormal time of the target database.

[0013] In a third aspect, the present application provides an electronic device, including: a processor, and a memory connected with the processor; the memory stores computer execution instructions; and the processor executes the computer execution instructions stored in the memory to implement the data processing method of the first aspect.

[0014] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are used to implement the data processing method according to the first aspect when executed.

[0015] In a fifth aspect, the present application provides a computer program product, comprising a computer program, and the computer program is used to implement the data processing method according to the first aspect when executed.

[0016] The data processing method, device, equipment and storage medium provided by the present application can determine the change amount of the system change number in the preset time length through the growth rate of the system change number of the database, and the preset time length is from the data abnormal time of the database to the current time of the database, so that the system change number of the database at the data abnormal time can be quickly determined according to the system change number of the database at the current time and the change amount of the system change number in the preset time length, and the data of the database at the data abnormal time can be quickly recovered according to the system change number of the database at the data abnormal time. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] Figure 1 A structural schematic diagram of the data processing system provided by the embodiments of the present application is shown;

[0019] Figure 2 A flowchart of the data processing method provided by the embodiments of the present application is shown;

[0020] Figure 3 A structural schematic diagram of the data processing device provided by the embodiments of the present application is shown;

[0021] Figure 4 A structural schematic diagram of an electronic device provided by the embodiments of the present application is shown.

[0022] The above drawings have shown the specific embodiments of the present application, and the following will have more detailed description. These drawings and text descriptions are not intended to limit the scope of the concept of the present application by any means, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments, and other drawings can be obtained by those skilled in the art without creative labor under the premise of not paying any creative labor. DETAILED DESCRIPTION

[0023] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings wherein like reference numerals represent like elements which are in similar or analogous embodiments. The following description of exemplary embodiments is not representative of all embodiments consistent with the present application. Rather, it is merely an example of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.

[0024] First, the terms involved in the present application are explained:

[0025] System change number (SCN): a logical, internal timestamp used by Oracle databases to identify the version of the database committed at a certain point in time.

[0026] Snapshot: a completely usable copy of a specified data set, which includes the image of the corresponding data at a certain point in time (the time point when the copy starts).

[0027] In the related art provided in the background, at least the following technical problems exist:

[0028] Database recovery refers to a technology that saves lost electronic data in the database and recovers it through technical means. The database may become unavailable due to hardware or software (or both) failure, and different failure conditions require different recovery operations. In the related art, the data recovery of the database is usually realized by the following three methods:

[0029] The first method is timestamp-based data recovery. The method uses the correspondence between system timestamp and SCN to perform data recovery operation. In the oracle database, the mapping relationship between current timestamp and system SCN is maintained. The system generates a system timestamp and SCN match every preset time interval and stores it in the sys.smon_scn_time table. The SCN is determined by the correspondence between the timestamp and the SCN, and then the SCN is used to recover the data. Although this method is relatively simple to operate, the sys.smon_scn_time table records the latest preset number of system timestamp and SCN match records. Therefore, only the latest data can be flashed back. For example, the scns: 339988, 339989 match the times 13:52:00 and 13:57:00, respectively. When querying the data in the time period from 13:52:00 to 13:56:59, oracle will match it to the scns: 339988 to the table space for searching. That is, in this time period, no matter what the specified time point is, the query will return the data at 13:52:00, which may cause the loss of part of the data. In addition, in some systems, if the system time is adjusted forward, the oracle database will no longer maintain the sys.smon_scn_time table data, that is, the mapping relationship between the timestamp and the SCN will be invalid, which may cause the data recovery to fail.

[0030] The second method is system SCN-based data recovery. The method directly uses the SCN of the database to recover the data, that is, the SCN at the time of data anomaly is obtained, and the original data corresponding to the SCN is used to recover the database. However, it is difficult to determine the SCN at the time of data anomaly, and the implementation of this method is difficult in actual use, which may cause difficulty in recovering the data when the database has data anomaly.

[0031] The third method is RMAN-based data recovery. The method requires that the database must be in archive mode, and a reasonable database backup method must be developed. In addition, when recovering the data, the backup file is used to restore the target to the state of the backup file, and then the archive log is used to restore the target to the time to be recovered, and the recovery granularity is fine. However, the operation of this method is relatively complex, and the database must be in archive mode and have a backup file. The requirement for the operator performing the data recovery operation is relatively high. If the database is not started in archive mode or the last backup time is relatively long, the application of this method may not achieve the ideal data recovery effect.

[0032] In view of the problems in the prior art, the present application provides a data processing method, which determines the change amount of the system change number in a preset time length by the growth rate of the system change number of a database, and since the preset time length is from the data abnormal time of the database to the current time of the database, the system change number of the database at the data abnormal time can be quickly determined according to the system change number of the database at the current time and the change amount of the system change number in the preset time length, so that the data recovery of the database at the data abnormal time can be quickly performed according to the system change number of the database at the data abnormal time.

[0033] In an embodiment, the data processing method can be applied in an application scenario. Figure 1 A structural schematic diagram of a data processing system provided by an embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the data processing system can include a first database, a recovery module and a second database, wherein the recovery module can include a first obtaining unit, a second obtaining unit, a third obtaining unit, a fourth obtaining unit and a recovery unit.

[0034] Specifically, the first obtaining unit obtains the growth rate of the system change number of the first database, the second obtaining unit obtains the current time of the first database, the third obtaining unit obtains the data abnormal time of the first database, and the fourth obtaining unit obtains the system change number of the first database at the current time. The third obtaining unit can obtain the data abnormal time manually input by a user.

[0035] Specifically, the recovery module determines the time difference between the current time and the data abnormal time, and determines the change amount of the system change number in the time period from the data abnormal time to the current time according to the growth rate of the system change number and the time difference, and then quickly determines the system change number of the first database at the data abnormal time according to the change amount and the system change number of the first database at the current time. After obtaining the system change number of the first database at the data abnormal time, the recovery unit can quickly perform data recovery according to the system change number of the first database at the data abnormal time, and obtain the second database, which is the database after data recovery. Since the system change number of the database at the data abnormal time can be quickly obtained, the efficiency and success rate of data recovery can be improved.

[0036] In combination with the above scenario, the technical solutions of the present application and how the technical solutions solve the above technical problems will be described in detail in specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments. The embodiments of the present application will be described in combination with the drawings.

[0037] The present application provides a data processing method. Figure 2A flowchart of a data processing method provided by an embodiment of the present application is shown in FIG. 8. The data processing method includes the following steps: Figure 2

[0038] S201: In response to receiving a recovery instruction for recovering data of a target database at a data abnormal time, executing the recovery instruction to obtain a target growth rate of a system change number of the target database.

[0039] Specifically, if the target database is abnormal, the target database may lose data at the data abnormal time. In order to recover the lost data, the received recovery instruction can be executed to start the data recovery operation of the target database.

[0040] Specifically, the system change number of the database increases over time. When the data recovery operation of the target database is performed, the target growth rate of the system change number of the target database can be obtained first, which can be used to represent the growth rate of the system change number of the target database.

[0041] Optionally, the target database can be an oracle database.

[0042] S202: Determine a preset time length, the starting time of the preset time length is the data abnormal time of the target database, and the ending time of the preset time length is the current time of the target database.

[0043] Specifically, when the data recovery operation of the target database is performed, the time difference of the target database from the data abnormal time to the current time can be determined, which is also the preset time length.

[0044] Specifically, the current time and the data abnormal time of the target database can be obtained first, the current time is denoted as C_T, and the data abnormal time is denoted as RECV_TIME. The preset time length CT_R can be determined by the following formula:

[0045] CT_R = C_T - RECV_TIME

[0046] Optionally, the data abnormal time can also be referred to as the data recovery time, which can be manually input by a user, i.e., the user can manually input the time node for which the data recovery is needed.

[0047] S203: According to the target growth rate and the preset time length, determine the change amount of the system change number within the preset time length.

[0048] ​Specifically, the target growth rate can be used to represent the growth speed of the system change number of the target database, and the growth rate of the system change number of the target database in the preset time length is also the target growth rate. Therefore, according to the target growth rate and the preset time length, the change amount of the system change number of the target database in the preset time length can be determined.

[0049] S204: determining, according to the change amount and the first system change number at the current moment, a second system change number at the data abnormal moment, the second system change number being used to restore the data of the target database corresponding to the data abnormal moment.

[0050] Specifically, since the preset time length is the time length from the data abnormal moment to the current moment, after the change amount of the system change number of the target database in the preset time length is determined, the first system change number of the target database at the current moment can be obtained first, and then the second system change number of the target database at the data abnormal moment can be determined according to the change amount, so that the data of the target database at the data abnormal moment can be restored according to the second system change number.

[0051] The data processing method provided in the embodiment can determine the change amount of the system change number of the target database in the preset time length through the growth rate of the system change number of the target database, and since the preset time length is from the data abnormal moment of the target database to the current moment of the target database, the system change number of the target database at the data abnormal moment can be quickly determined according to the system change number of the target database at the current moment and the change amount of the system change number of the target database in the preset time length, so that the data of the target database at the data abnormal moment can be quickly restored according to the system change number of the target database at the data abnormal moment.

[0052] In an embodiment, the target growth rate of the system change number of the target database is obtained by using an iterative algorithm.

[0053] Specifically, the iterative algorithm can be used to repeatedly execute a group of instructions (or a certain number of steps), and a new value of a variable is derived from an original value of the variable each time the group of instructions (or the certain number of steps) is executed. When the target growth rate is obtained by using the iterative algorithm, the number of iterations can be determined first, a growth rate value can be determined each time the iteration is performed, and after the iteration is completed, an average value of the growth rate values obtained through each iteration is obtained, and the average value is determined as the target growth rate of the system change number of the target database.

[0054] Specifically, by adopting the iterative algorithm to determine the target growth rate of the system change number of the target database, the accuracy of the determined target growth rate can be improved, and the problem of large error caused by single determination can be avoided. Alternatively, in addition to the iterative algorithm, other algorithms can also be used to obtain the target growth rate, as long as the target growth rate can be determined and the accuracy of the determined target growth rate can be ensured.

[0055] In an embodiment, the target growth rate is obtained by adopting the iterative algorithm, including: for each of the preset number of iterations, obtaining a third system change number of the target database at a first time, a fourth system change number of the target database at a second time, and an interval time length between the first time and the second time; determining a growth rate in the interval time length according to the third system change number, the fourth system change number and the interval time length; determining an average value of the growth rates of the preset number of iterations; and determining the average value as the target growth rate.

[0056] Specifically, when the target growth rate is obtained by adopting the iterative algorithm, the growth rate of the system change number of the target database from the first time to the second time can be determined at each iteration. Then the average value of the growth rates obtained by multiple iterations is determined as the target growth rate, which can be expressed by the following formula:

[0057]

[0058] Wherein, GR_SCN can be used to represent the target growth rate, G i can be used to represent the growth rate of the SCN of the target database at the i th iteration, m can be used to represent the number of iterations, t i can be used to represent the time consumed by the i th iteration.

[0059] Specifically, the system change number at each iteration can be different, for example, the system change number at the first iteration can be the growth rate from 1 to 1000, the system change number at the second iteration can be the growth rate from 500 to 2000, and the system change number at the third iteration can be the growth rate from 2001 to 5000. Correspondingly, the time consumed by each iteration can also be different, and the average value is finally taken, so that the accuracy of the determined target growth rate can be ensured.

[0060] In an embodiment, according to the target growth rate and the preset time length, the variation of the system change number in the preset time length is determined, including: obtaining a first product of the target growth rate and the preset time length; and determining the variation according to the first product.

[0061] Specifically, the target database has a target growth rate of the system change number in a preset time length, and a product of the target growth rate and the preset time length, i.e., a first product, can be obtained to determine a change amount of the system change number of the target database from the data abnormal time to the current time. Therefore, the system change number of the target database at the data abnormal time can be quickly determined, and the data of the target database at the data abnormal time can be quickly recovered according to the system change number of the target database at the data abnormal time.

[0062] In an embodiment, the change amount is determined according to the first product, including: determining the first product as the change amount; or, determining a second product of a preset coefficient and the first product; and determining the second product as the change amount.

[0063] Specifically, after the first product of the target growth rate and the preset time length is determined, in order to quickly determine the change amount of the system change number of the target database, the first product can be directly determined as the change amount, so that the second system change number of the target database at the data abnormal time is determined according to the change amount.

[0064] Specifically, after the first product of the target growth rate and the preset time length is determined, in order to improve the accuracy of the determined second system change number, a second product of a preset coefficient and the first product can be obtained, and the obtained second product is determined as the change amount, which can be expressed by the following formula:

[0065]

[0066] The RECV_SCN can be used to represent the change amount of the system change number of the target database in the preset time length. The preset coefficient can be a robust coefficient, which can be used to compensate for errors that may exist at the data abnormal time, so as to improve the accuracy of the determined change amount of the system change number of the target database, and further improve the accuracy of the determined second system change number, and further improve the accuracy of the data recovery.

[0067] In an embodiment, the second system change number at the data abnormal time is determined according to the change amount and the first system change number at the current time, including: determining a difference between the first system change number and the change amount; and determining the difference as the second system change number.

[0068] Specifically, the change amount of the system change number of the target database within the preset time length can be used to represent the growth amount of the system change number of the target database from the data exception moment to the current moment, and thus the first system change number of the target database at the current moment can be determined first, and then the second system change number of the target database at the data exception moment can be determined according to the first change number and the change amount, so that the data of the target database at the data exception moment can be quickly restored according to the system change number of the target database at the data exception moment.

[0069] Specifically, when the second system change number of the target database at the data exception moment is determined, the input data exception moment can be converted into an SCN by constructing a timestamp-to-SCN conversion algorithm TIME_TO_SCN(·), which can be represented by the following formula:

[0070] RECV_SCN = TIME_TO_SCN(RECV_TIME)

[0071] Wherein, RECV_SCN can be used to represent the change amount of the system change number of the target database within the preset time length.

[0072] Specifically, the growth rate of the system change number of the target database within the preset time length is also a target growth rate, and thus the conversion algorithm TIME_TO_SCN(·) can be implemented by the following steps:

[0073] Step 1: obtaining the time difference CT_R of the data exception moment RECV_TIME and the current moment C_T of the target database;

[0074] Step 2: obtaining the target growth rate GR_SCN of the system change number of the target database;

[0075] Step 3: determining the product of the time difference CT_R and the target growth rate GR_SCN, that is, the first product, so as to determine the change amount RECV_SCN of the system change number of the target database from the data exception moment to the current moment;

[0076] Step 4: obtaining the first system change number SCN_1 of the target database at the current moment, and determining the second system change number SCN_2 of the target database at the data exception moment by the following formula, so as to achieve the purpose of converting the data exception moment into an SCN (i.e., converting the timestamp into an SCN):

[0077] SCN_2 = SCN_1 - RECV_SCN

[0078] In an embodiment, after the second system change number at the data abnormal time is determined, the method further comprises: obtaining a data snapshot corresponding to the second system change number in the target database; determining the data to be recovered corresponding to the second system change number according to the data snapshot; and performing data recovery on the target database by using the data to be recovered.

[0079] Specifically, the target database can store a corresponding data snapshot at each time point, so that after the second system change number at the data abnormal time is obtained, the data snapshot corresponding to the second system change number can be determined in the target database, and then the data corresponding to the second system change number can be obtained according to the data snapshot, thereby quickly realizing data recovery of the target database.

[0080] Specifically, the data recovery of the target database can be realized by the following formula:

[0081] DB' = RECV_DB(RECV_SCN, OB)

[0082] Wherein, DB' can be used to represent a restored target in the target database, and the restored target can be data at the data abnormal time after recovery; RECV_DB(·) can be used to represent a flashback operation; and OB can be used to represent a target to be recovered in the target database, and the target to be recovered is data at the data abnormal time.

[0083] The data processing method provided in the embodiment can solve the problem of data recovery failure caused by database time adjustment, and can solve the problem of inaccurate data recovery caused by large recovery granularity when the oracle database performs data recovery based on the timestamp. In addition, the problem that the SCN of the database before data recovery is difficult to obtain can also be solved, and the SCN can be quickly determined by using the timestamp and the conversion algorithm of the timestamp and the SCN, so that the data recovery is quickly completed. Therefore, the data processing method provided in the embodiment can realize convenient, fast and efficient data recovery.

[0084] In general, the technical solution provided in the present application is a technical solution which can quickly complete data recovery and ensure the accuracy of data recovery.

[0085] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0086] The embodiment of the present application also provides a data processing device. Figure 3 The structural schematic diagram of the data processing device provided by the embodiment of the present application is shown in Figure 3 The data processing device 300 comprises:

[0087] The execution module 301 is configured to execute the recovery instruction in response to receiving the recovery instruction for recovering the data of the target database at the data abnormal time, and obtain a target growth rate of the system change number of the target database.

[0088] The first determination module 302 is configured to determine a preset time length, and the starting time of the preset time length is the data abnormal time of the target database, and the ending time of the preset time length is the current time of the target database.

[0089] The second determination module 303 is configured to determine a variation of the system change number within the preset time length according to the target growth rate and the preset time length.

[0090] The third determination module 304 is configured to determine a second system change number at the data abnormal time according to the variation and the first system change number at the current time, and the second system change number is used to recover the data corresponding to the data abnormal time of the target database.

[0091] Optionally, when the execution module 301 obtains the target growth rate of the system change number of the target database, the execution module 301 is specifically configured to obtain the target growth rate by using an iterative algorithm.

[0092] Optionally, when the execution module 301 obtains the target growth rate by using the iterative algorithm, the execution module 301 is specifically configured to obtain, for each of a preset number of iterations, a third system change number of the target database at a first time, a fourth system change number of the target database at a second time, and an interval time length between the first time and the second time; determine a growth rate within the interval time length according to the third system change number, the fourth system change number and the interval time length; determine an average value of the growth rates of the preset number of iterations; and determine the average value as the target growth rate.

[0093] Optionally, when the second determination module 303 determines the variation of the system change number within the preset time length according to the target growth rate and the preset time length, the second determination module 303 is specifically configured to obtain a first product of the target growth rate and the preset time length; and determine the variation according to the first product.

[0094] Optionally, the second determining module 303, in determining the change amount according to the first product, is specifically configured to: determine the first product as the change amount; or, determine a second product of the preset coefficient and the first product; and determine the second product as the change amount.

[0095] Optionally, the third determining module 304, in determining the second system change number according to the change amount and the first system change number of the current moment, is specifically configured to: determine a difference value of the first system change number and the change amount; and determine the difference value as the second system change number.

[0096] Optionally, the data processing apparatus 300 further comprises a recovery module configured to: acquire a data snapshot corresponding to the second system change number in the target database; determine the to-be-recovered data corresponding to the second system change number according to the data snapshot; and perform data recovery on the target database by using the to-be-recovered data.

[0097] The data processing apparatus provided in the embodiment is used to execute the data processing method in the foregoing method embodiments, and has similar implementation principles and technical effects, which will not be described herein again.

[0098] The embodiment of the present application further provides an electronic device. Figure 4 is a block diagram of an electronic device according to an exemplary embodiment. Exemplarily, the electronic device can be provided as a computer. Referring to Figure 4 , the electronic device 400 comprises a processing component 401 further comprising one or more processors, and a memory resource represented by a memory 402, used to store instructions executable by the processing component 401, such as an application program. The application program stored in the memory 402 can comprise one or more than one module each corresponding to a set of instructions. In addition, the processing component 401 is configured to execute the instructions to execute any of the above method embodiments.

[0099] The electronic device 400 can further comprise a power supply component 403 configured to perform power management of the electronic device 400, a wired or wireless network interface 404 configured to connect the electronic device 400 to a network, and an input / output interface 405, which can also be referred to as an I / O interface 405. The electronic device 400 can operate based on an operating system stored in the memory 402, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

[0100] The memory can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), and the like. Among them, the memory is used to store a program, and the processor executes the program after receiving an execution instruction. Further, the software program and the module in the above-mentioned memory can also include an operating system, which can include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and can communicate with various hardware or software components to provide an operating environment for other software components.

[0101] The processor can be an integrated circuit chip with processing capability. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), and the like. It can implement or execute the disclosed methods, steps, and logic block diagrams in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0102] The embodiments of the present application also provide a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. When the computer execution instructions are executed, the technical solutions of the data processing method provided in the foregoing method embodiments are implemented.

[0103] The embodiments of the present application also provide a computer program product, and the computer program product includes a computer program. When the computer program is executed, the technical solutions of the data processing method provided in the foregoing method embodiments are implemented.

[0104] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the application pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the application are indicated by the appended claims.

[0105] It is to be understood that the application is not limited to the precise construction already described above and shown in the drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application should only be limited by the claims appended hereto.

Claims

1. A data processing method, characterized by, The method comprises the following steps: in response to receiving a recovery instruction for recovering data of a target database at a data abnormal time, executing the recovery instruction, obtaining a target growth rate of a system change number of the target database; determining a preset time length, a starting time of the preset time length being the data abnormal time of the target database, and an ending time of the preset time length being a current time of the target database; determining a change amount of the system change number within the preset time length according to the target growth rate and the preset time length; determining a second system change number at the data abnormal time according to the change amount and a first system change number at the current time, the second system change number being used for recovering data corresponding to the data abnormal time of the target database.

2. The data processing method according to claim 1, characterized in that, The obtaining of the target growth rate of the system change number of the target database comprises the following steps: an iterative algorithm is used to obtain the target growth rate.

3. The data processing method according to claim 2, characterized in that, The obtaining of the target growth rate by using the iterative algorithm comprises the following steps: for each of a preset number of iterations, obtaining a third system change number at a first time, a fourth system change number at a second time, and an interval time length between the first time and the second time of the target database; and determining a growth rate within the interval time length according to the third system change number, the fourth system change number and the interval time length; determining an average value of the growth rates of the preset number of iterations; determining the average value as the target growth rate.

4. The data processing method according to any one of claims 1 to 3, characterized in that, The determining of the change amount of the system change number within the preset time length according to the target growth rate and the preset time length comprises the following steps: obtaining a first product of the target growth rate and the preset time length; determining the change amount according to the first product.

5. The data processing method according to claim 4, characterized in that, The determining of the change amount according to the first product comprises the following steps: determining the first product as the change amount; or determining a second product of a preset coefficient and the first product; and determining the second product as the change amount.

6. The data processing method according to any one of claims 1 to 3, characterized in that, The determining of the second system change number at the data abnormal time according to the change amount and the first system change number at the current time comprises the following steps: determining a difference value of the first system change number and the change amount; determining the difference value as the second system change number.

7. The data processing method according to any one of claims 1 to 3, characterized in that, After the determining of the second system change number at the data abnormal time, the method further comprises the following steps: obtaining a data snapshot corresponding to the second system change number in the target database; determining to-be-restored data corresponding to the second system change number according to the data snapshot; performing data recovery on the target database by using the to-be-restored data.

8. A data processing apparatus, characterized by, The method comprises the following steps: an execution module is configured to, in response to receiving a recovery instruction for recovering data of a target database at a data abnormal time, execute the recovery instruction, and obtain a target growth rate of a system change number of the target database; a first determination module is configured to determine a preset time length, a starting time of the preset time length being the data abnormal time of the target database, and an ending time of the preset time length being a current time of the target database; a second determination module is configured to determine a change amount of the system change number within the preset time length according to the target growth rate and the preset time length. A third determining module, configured to determine a second system change number of the data abnormal time according to the change amount and the first system change number of the current time, the second system change number being used to restore data corresponding to the data abnormal time of the target database.

9. An electronic device, comprising: Comprise: A processor, and a memory connected with the processor; The memory stores computer-executed instructions; The processor executes the computer-executed instructions stored in the memory to implement the data processing method in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executed instructions, and the computer-executed instructions are executed to implement the data processing method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data backup method and data recovery method and device in big data system

    CN107665153A

  • Data reconstruction time prediction method, system and terminal of distributed block storage system

    CN111858180A