CN110781036A - Data recovery method and device, computer equipment and storage medium - Google Patents

Data recovery method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110781036A
CN110781036A CN201911052667.5A CN201911052667A CN110781036A CN 110781036 A CN110781036 A CN 110781036A CN 201911052667 A CN201911052667 A CN 201911052667A CN 110781036 A CN110781036 A CN 110781036A
Authority
CN
China
Prior art keywords
data
data recovery
field
information table
recovery
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911052667.5A
Other languages
Chinese (zh)
Inventor
段雅亭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Neusoft Wang Hai Technology Co Ltd
Original Assignee
Beijing Neusoft Wang Hai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Neusoft Wang Hai Technology Co Ltd filed Critical Beijing Neusoft Wang Hai Technology Co Ltd
Priority to CN201911052667.5A priority Critical patent/CN110781036A/en
Publication of CN110781036A publication Critical patent/CN110781036A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data recovery method, a data recovery device, computer equipment and a storage medium, wherein the data recovery method comprises the following steps: acquiring identification information of target data with misoperation; searching a data recovery field matched with the identification information in a preset data recovery information table; and recovering the data operation of the target data according to the data recovery field. The data recovery device searches the data recovery field matched with the identification information in the preset data recovery information table and performs recovery operation on the target data subjected to misoperation according to the data recovery field.

Description

Data recovery method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of databases, in particular to a data recovery method, a data recovery device, computer equipment and a storage medium.
Background
Mysql is a relational database management system, and data is stored in different tables, so that the speed and flexibility of data acquisition can be increased. Generally, when Mysql is applied, a rollback operation cannot be performed after a transaction in the Mysql is submitted, and thus, after a misoperation occurs, because Mysql is a relational database, in order to ensure data consistency, a related business table needs to be rolled back to a uniform time point, and the misoperation intelligence is restored through ways such as backup recovery.
Currently, Mysql is backed up mainly by Mysqldump and supercona provided by the official and Innobackup maintained by the official. The Mysqldump backup method is to export a database into a native sql statement (embedded table), is convenient and simple to maintain, can span an operating system, and can restore the database to any specified time by combining a binlog log file, but the backup restoration time is long and part of services need to be stopped to complete data restoration. The inobackup is backed up in a data file snapshot mode, supports incremental backup, and has very high backup and recovery speed, flexibility and high efficiency. However, the backup method also requires shutdown maintenance, and only one database node can be recovered, and the more database cluster nodes, the more complicated the operation. In a word, the backup recovery mode is time-consuming and labor-consuming, and affects the working efficiency.
Disclosure of Invention
The embodiment of the invention provides a data recovery method, a data recovery device, computer equipment and a storage medium.
In order to solve the above technical problem, the embodiment of the present invention adopts a technical solution that: there is provided a data recovery method including the steps of:
acquiring identification information of target data with misoperation;
searching a data recovery field matched with the identification information in a preset data recovery information table;
and recovering the data operation of the target data according to the data recovery field.
Optionally, before searching for the data recovery field matching the identification information in the preset data recovery information table, the method further includes:
extracting a recovery log from a preset database, wherein the recovery log is used for recording the data state before the target data is subjected to misoperation;
converting the operation field in the recovery log into the data recovery field according to a database language;
and storing the identification information and the data recovery field into the preset data recovery information table according to a mapping relation.
Optionally, the recovering the data operation of the target data according to the data recovery field includes:
when the data recovery field indicates that the type of data operation on the target data is insertion, deleting the target data;
when the data recovery field indicates that the type of data operation on the target data is deletion, performing insertion operation of inserting data before deletion on the target data;
and when the data recovery field indicates that the type of the data operation performed on the target data is modification, recovering the target data into the data before modification.
Optionally, the identifying information is a keyword, and the searching for the data recovery field matched with the identifying information in a preset data recovery information table includes:
searching a field list containing the key words in a data recovery information table;
acquiring a data operation list of the target data according to the selection of the user in the field list;
and extracting the data recovery field from the data operation list.
Optionally, the identifying information is a timestamp for performing a data operation on the target data, and the searching for the data recovery field matched with the identifying information in a preset data recovery information table includes:
extracting a timestamp for performing a data operation on the target data from the database;
and extracting a data recovery field having a mapping relation with the time stamp from the data recovery information table.
Optionally, the method further comprises:
judging whether the storage time of a data recovery field in the data recovery information table is greater than a preset time;
and when the storage duration of the data recovery field is longer than the preset duration, deleting the information in the list where the data recovery field with the length longer than the preset duration is located.
Optionally, a search engine is set in the data recovery information table, and the searching for the data recovery field matched with the identification information in the preset data recovery information table includes:
looking up the data recovery field in the data recovery information table by the search engine.
To solve the foregoing technical problem, an embodiment of the present invention further provides a data recovery apparatus, including:
the acquisition module is used for acquiring the identification information of the target data with misoperation;
the processing module is used for searching a data recovery field matched with the identification information in a preset data recovery information table;
and the execution module is used for recovering the data operation of the target data according to the data recovery field.
Optionally, the method further comprises:
the first obtaining submodule is used for extracting a recovery log from a preset database, wherein the recovery log is used for recording the data state before the target data is subjected to misoperation;
the first processing submodule is used for converting the operation field in the recovery log into the data recovery field according to a database language;
and the second execution submodule is used for storing the identification information and the data recovery field into the preset data recovery information table according to a mapping relation.
Optionally, the execution module includes:
the first execution submodule is used for carrying out deletion operation on the target data when the data recovery field indicates that the type of carrying out data operation on the target data is insertion;
the second execution submodule is used for performing insertion operation of inserting data before deletion on the target data when the data recovery field indicates that the type of data operation performed on the target data is deletion;
and the third execution submodule is used for recovering the target data into the recovery operation of the data before modification when the data recovery field indicates that the type of the data operation on the target data is modification.
Optionally, the identification information is a keyword, and the processing module includes:
the second acquisition sub-module is used for searching a field list containing the key words in a data recovery information table;
the third processing submodule is used for acquiring a data operation list of the target data according to the selection of the user in the field list;
and the third acquisition submodule is used for extracting the data recovery field from the data operation list.
Optionally, the identification information is a timestamp of a data operation performed on the target data, and the processing module includes:
the fourth acquisition submodule is used for extracting a timestamp for performing data operation on the target data from the database;
and the fifth acquisition submodule is used for extracting a data recovery field which has a mapping relation with the timestamp from the data recovery information table.
Optionally, the method further comprises:
the third processing submodule is used for judging whether the storage time length of the data recovery field in the data recovery information table is greater than the preset time length or not;
and the fourth processing submodule is used for deleting the information in the list where the data recovery field with the length longer than the preset length is located when the storage length of the data recovery field is longer than the preset length.
Optionally, a search engine is disposed in the data recovery information table, and the processing module includes:
and the fifth processing submodule searches the data recovery field in the data recovery information table through the search engine.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores computer-readable instructions, and the computer-readable instructions, when executed by the processor, cause the processor to execute the steps of the data recovery method.
To solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the data recovery method described above.
The embodiment of the invention has the beneficial effects that: by searching the data recovery field matched with the identification information in the preset data recovery information table and performing recovery operation on the target data subjected to misoperation according to the data recovery field, the method does not need to restore the target data by using the backup file, is simple in operation, saves time and labor and further improves the working efficiency.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic basic flow chart of a data recovery method according to an embodiment of the present invention;
fig. 2 is a schematic basic flowchart of a method for creating a data recovery information table according to an embodiment of the present invention;
fig. 3 is a schematic basic flowchart of a method for searching a data recovery field matched with identification information in a preset data recovery information table according to an embodiment of the present invention;
fig. 4 is a schematic basic flowchart of another method for searching a data recovery field matching identification information in a preset data recovery information table according to an embodiment of the present invention;
fig. 5 is a schematic basic flowchart of a method for clearing a data recovery field in a data recovery information table according to an embodiment of the present invention;
FIG. 6 is a block diagram illustrating a basic structure of a data recovery apparatus according to an embodiment of the present invention;
FIG. 7 is a block diagram of the basic structure of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being indicated as 101, 102, etc. merely to distinguish between the various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Examples
As will be appreciated by those skilled in the art, "terminal" as used herein includes both devices that are wireless signal receivers, devices that have only wireless signal receivers without transmit capability, and devices that include receive and transmit hardware, devices that have receive and transmit hardware capable of performing two-way communication over a two-way communication link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, a "terminal Device" may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, or a smart tv, a set-top box, etc.
The client terminal in this embodiment is the above terminal.
Specifically, referring to fig. 1, fig. 1 is a basic flow chart of the data recovery method of the present embodiment.
As shown in fig. 1, the data recovery method includes the steps of:
s1100, acquiring identification information of target data with misoperation;
the target data is data for performing data operation in the database, wherein the data operation comprises the following steps: insert, delete, update, etc. The identification information is information for identifying each target data operation. In this embodiment, the database includes identification information for each data operation, and therefore, the identification information for each operation on the target data can be directly extracted from the database.
S1200, searching a data recovery field matched with the identification information in a preset data recovery information table;
the data recovery information table is an information table in which a mapping relation between identification information of operation target data and a data recovery field is recorded in a preset and database. The data recovery field is used to indicate a field in which a recovery operation is performed on target data of an operation, for example, when an insertion operation is performed on the target data, and when the insertion operation is an erroneous operation, the data recovery field indicates a field in which a deletion operation is performed on the inserted target data, when a deletion operation is performed on the target data, the data recovery field indicates a field in which the deleted target data is inserted, and when a modification operation is performed on the target data, the data recovery field indicates a field in which an operation is performed to recover the target data to data before the modification.
In one embodiment, a search engine may be provided in the data recovery information table, by which the data recovery fields are looked up in the data recovery information table, for example, a mysian engine may be provided to increase the speed of the query.
And S1300, recovering the data operation of the target data according to the data recovery field.
In this embodiment, the recovery operation may be performed on the target data according to the type of the target data operation. In one embodiment, when the data recovery field indicates that the type of the data operation performed on the target data is insertion, a deletion operation is performed on the target data; when the data recovery field indicates that the type of data operation on the target data is deletion, performing insertion operation for inserting data before deletion on the target data; and when the data recovery field indicates that the type of the data operation performed on the target data is modification, recovering the target data into the recovery operation of the data before modification.
According to the data recovery method, the data recovery field matched with the identification information is searched in the preset data recovery information table, and the target data subjected to misoperation is recovered according to the data recovery field.
An embodiment of the present invention provides a method for creating a data recovery information table, as shown in fig. 2, fig. 2 is a basic flow diagram of the method for creating a data recovery information table according to the embodiment of the present invention.
Specifically, as shown in fig. 2, before step S1200, the following steps are further included:
s1201, extracting a recovery log from a preset database, wherein the recovery log is used for recording a data state before misoperation occurs to target data;
the recovery log is an undoo log in this embodiment, where the undoo log is of an Oracle data type, and represents a log for recovering changes, which are caused to the program by operations performed by the user in the previous step, to the log before the changes. For example, when a transaction in the database is started, Oracle assigns an undo segment to the transaction for protection. For example, for an operation of inserting data, the undo log only records the id of the inserted data, and for an operation of modifying data or an operation of deleting data, the undo log also records the modified or deleted data in addition to the id of the modified data or the deleted data.
In this embodiment, the unique log may be extracted from the database through identification information of the data operation performed by the target data, for example, a sequence number of the target data operation.
S1202, converting the operation field in the recovery log into a data recovery field according to the database language;
in the present embodiment, the operation field in the recovery log indicates a field of the operated-on data, for example, when the target data indicates an insert operation, a field recorded in the recovery log is "id 1", and the field is extracted from the recovery log and converted into "delete from t where id 1". When a deletion operation is represented on target data, a field of a recovery log record is "id ═ 1, and col1 ═ b '", this field is extracted and converted into "insert int (id, col1) values (1, ' b ')", when a modification operation is represented on target data, a field of a recovery log record is "id ═ 1, and col1 ═ a '", this field is extracted and converted into "update set col1 ═ a ' where here root id ═ 1".
S1203, storing the identification information and the data recovery field into a preset data recovery information table according to a mapping relation.
As shown in table 1, table 1 is an example of a data structure of the data restoration information table. As shown in table 1, the data restoration information table includes: data operation identification ID, database contents for data operation, recovery log, database name, execution time, etc.
TABLE 1 data recovery information Table data Structure
Name of field Type of field Whether a field can be nulled Remarks on fields
trx_id bigint Whether or not Transaction ID
sql_context text Whether or not sql content
undo_log text Whether or not Rollback log
tablespace_name varchar(64) Whether or not Database name
exec_time timestamp Whether or not Execution time
As shown in table 2, table 2 is an example of a data recovery information table.
TABLE 2 data recovery information Table
Figure BDA0002255696600000091
The database content (SQL content) indicates an operation manner of performing a data operation on target data by the database, for example, for a data operation with a transaction serial number of 123, the data operation indicates that data with an identification code of 1 is inserted, in this embodiment, the identification code of 1 is extracted from the recovery log, and a field "delete from t where is 1" after the conversion is added to the data recovery information table.
In some embodiments, a situation that a user forgets identification information of a target data operation to be recovered often occurs, and in this situation, in order to find a data recovery field recorded in a data recovery information table in time, an embodiment of the present invention provides a method for finding a data recovery field matched with the identification information in a preset data recovery information table. In this embodiment, the identification information may be a serial number, database content, a data recovery field, and the like of the target data for performing data operation. In this embodiment, the identification information is a keyword, wherein the keyword is part of the above listed identification information. As shown in fig. 3, fig. 3 is a schematic basic flow chart of a method for searching a data recovery field matched with identification information in a preset data recovery information table according to an embodiment of the present invention.
Specifically, as shown in fig. 3, step S1200 includes the steps of:
s1211, searching a field list containing the key words in the data recovery information table;
the field list is a list of one or more fields containing a keyword screened from the data recovery information table, and in the data recovery information table shown in table 2, a row of data list indicates all information contained when data recovery is performed on a certain data operation.
S1212, acquiring a data operation list of the target data according to the selection of the user in the field list;
s1213, extracting the data recovery field from the data operation list.
As shown in fig. 2, after the field list is displayed, the user may select a data operation that requires data recovery, for example, click to select, from the field list, so as to extract a data recovery field from the data operation. In one embodiment, as shown in table 2, when the user selects a data operation with a transaction sequence number of 123, "delete from t where is 1" is extracted from the operation list, e.g., the conversion column.
An embodiment of the present invention further provides another method for finding a data recovery field matching identification information in a preset data recovery information table, where the identification information is a timestamp for performing a data operation on target data, as shown in fig. 4, and fig. 4 is a basic flowchart of another method for finding a data recovery field matching identification information in a preset data recovery information table according to an embodiment of the present invention.
Specifically, as shown in fig. 4, step S1200 includes the steps of:
s1221, extracting a timestamp for performing data operation on the target data from the database;
s1222, extracting the data recovery field having the mapping relation with the timestamp from the data recovery information table.
The time stamp indicates the execution time of the data operation, and in some embodiments, the data recovery information table further includes the execution time, such as the structure of the data recovery information table shown in table 1, which includes the execution time. When the user recovers the data, the user can extract the time stamp of the execution data operation from the database and select the data recovery field having a mapping relation with the time stamp in the data recovery information table.
In some embodiments, the identification information such as the transaction sequence number and the database content may be used to extract the data recovery field having a mapping relationship with the transaction sequence number and the database content from the data recovery information table.
An embodiment of the present invention further provides a method for clearing a data recovery field in a data recovery information table, as shown in fig. 5, fig. 5 is a basic flowchart diagram of the method for clearing a data recovery field in a data recovery information table according to the embodiment of the present invention.
Specifically, as shown in fig. 5, the method further includes the following steps:
s1301, judging whether the storage time length of a data recovery field in the data recovery information table is larger than a preset time length;
as shown in table 1, in some embodiments, exec _ time monitoring software may be preset in the data recovery field to monitor the storage time of the data recovery field in the data recovery information table.
S1302, when the storage duration of the data recovery field is longer than the preset duration, deleting the information in the list where the data recovery field is located, wherein the data recovery field is longer than the preset duration.
In one embodiment, whether the storage duration of each data recovery field in the data recovery information table is greater than a preset duration is judged, and when the storage duration is greater than the preset duration, the information in the list where the data recovery field of the data operation is located is deleted.
Therefore, the size of the data recovery information table can be ensured to be within a preset range, and the purpose of timely recovering data can be achieved. In practical application, the data recovery information table can ensure that data can be recovered in time within 2G.
In some embodiments, exec _ time monitoring software may be started for a preset period of time for a timed cleaning.
To solve the above technical problem, an embodiment of the present invention further provides a data recovery apparatus. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of the data recovery apparatus according to the present embodiment.
As shown in fig. 6, a data recovery apparatus includes: an acquisition module 2100, a processing module 2200, and an execution module 2300. The acquiring module 2100 is configured to acquire identification information of target data where an error operation occurs; a processing module 2200, configured to search a preset data recovery information table for a data recovery field matching the identification information; and an executing module 2300, configured to recover the data operation of the target data according to the data recovery field.
The data recovery device searches the data recovery field matched with the identification information in the preset data recovery information table and performs recovery operation on the target data subjected to misoperation according to the data recovery field.
In some embodiments, the method further comprises: the first obtaining submodule is used for extracting a recovery log from a preset database, wherein the recovery log is used for recording the data state before the target data is subjected to misoperation; the first processing submodule is used for converting the operation field in the recovery log into the data recovery field according to a database language; and the second execution submodule is used for storing the identification information and the data recovery field into the preset data recovery information table according to a mapping relation.
In some embodiments, the execution module comprises: the first execution submodule is used for carrying out deletion operation on the target data when the data recovery field indicates that the type of carrying out data operation on the target data is insertion; the second execution submodule is used for performing insertion operation of inserting data before deletion on the target data when the data recovery field indicates that the type of data operation performed on the target data is deletion; and the third execution submodule is used for recovering the target data into the recovery operation of the data before modification when the data recovery field indicates that the type of the data operation on the target data is modification.
In some embodiments, the identification information is a keyword, and the processing module includes: the second acquisition sub-module is used for searching a field list containing the key words in a data recovery information table; the third processing submodule is used for acquiring a data operation list of the target data according to the selection of the user in the field list; and the third acquisition submodule is used for extracting the data recovery field from the data operation list.
In some embodiments, the identification information is a timestamp of a data operation performed on the target data, and the processing module includes: the fourth acquisition submodule is used for extracting a timestamp for performing data operation on the target data from the database; and the fifth acquisition submodule is used for extracting a data recovery field which has a mapping relation with the timestamp from the data recovery information table.
In some embodiments, further comprising: the third processing submodule is used for judging whether the storage time length of the data recovery field in the data recovery information table is greater than the preset time length or not; and the fourth processing submodule is used for deleting the information in the list where the data recovery field with the length longer than the preset length is located when the storage length of the data recovery field is longer than the preset length.
In some embodiments, a search engine is disposed in the data recovery information table, and the processing module includes: and the fifth processing submodule searches the data recovery field in the data recovery information table through the search engine.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device. Referring to fig. 7, fig. 7 is a block diagram of a basic structure of a computer device according to the present embodiment.
Fig. 7 is a schematic diagram of the internal structure of the computer device. As shown in fig. 7, the computer apparatus includes a processor, a nonvolatile storage medium, a memory, and a network interface connected through a system bus. The non-volatile storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store control information sequences, and the computer readable instructions can enable a processor to realize a data recovery method when being executed by the processor. The processor of the computer device is used for providing calculation and control capability and supporting the operation of the whole computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, may cause the processor to perform a method of data recovery. The network interface of the computer device is used for connecting and communicating with the terminal. Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In this embodiment, the processor is configured to execute specific contents of the obtaining module 2100, the processing module 2200, and the executing module 2300 in fig. 6, and the memory stores program codes and various data required for executing the modules. The network interface is used for data transmission to and from a user terminal or a server. The memory in this embodiment stores program codes and data required for executing all the sub-modules in the data recovery method, and the server can call the program codes and data of the server to execute the functions of all the sub-modules.
The computer equipment searches the data recovery field matched with the identification information in the preset data recovery information table, and performs recovery operation on the target data subjected to misoperation according to the data recovery field.
The present invention also provides a storage medium storing computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the data recovery method of any of the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for data recovery, comprising the steps of:
acquiring identification information of target data with misoperation;
searching a data recovery field matched with the identification information in a preset data recovery information table;
and recovering the data operation of the target data according to the data recovery field.
2. The data recovery method according to claim 1, wherein before searching the data recovery field matching the identification information in the preset data recovery information table, the method further comprises:
extracting a recovery log from a preset database, wherein the recovery log is used for recording the data state before the target data is subjected to misoperation;
converting the operation field in the recovery log into the data recovery field according to a database language;
and storing the identification information and the data recovery field into the preset data recovery information table according to a mapping relation.
3. The data recovery method of claim 1, wherein the recovering the data operation of the target data according to the data recovery field comprises:
when the data recovery field indicates that the type of data operation on the target data is insertion, deleting the target data;
when the data recovery field indicates that the type of data operation on the target data is deletion, performing insertion operation of inserting data before deletion on the target data;
and when the data recovery field indicates that the type of the data operation performed on the target data is modification, recovering the target data into the data before modification.
4. The data recovery method according to claim 1, wherein the identification information is a keyword, and the searching for the data recovery field matching the identification information in a preset data recovery information table comprises:
searching a field list containing the key words in a data recovery information table;
acquiring a data operation list of the target data according to the selection of the user in the field list;
and extracting the data recovery field from the data operation list.
5. The data recovery method of claim 1, wherein the identification information is a timestamp of a data operation performed on the target data, and the searching for a data recovery field matching the identification information in a preset data recovery information table comprises:
extracting a timestamp for performing a data operation on the target data from the database;
and extracting a data recovery field having a mapping relation with the time stamp from the data recovery information table.
6. The data recovery method of claim 1, further comprising:
judging whether the storage time of a data recovery field in the data recovery information table is greater than a preset time;
and when the storage duration of the data recovery field is longer than the preset duration, deleting the information in the list where the data recovery field with the length longer than the preset duration is located.
7. The data recovery method according to claim 1, wherein a search engine is provided in the data recovery information table, and the searching for the data recovery field matching the identification information in the preset data recovery information table includes:
looking up the data recovery field in the data recovery information table by the search engine.
8. A data recovery apparatus, comprising:
the acquisition module is used for acquiring the identification information of the target data with misoperation;
the processing module is used for searching a data recovery field matched with the identification information in a preset data recovery information table;
and the execution module is used for recovering the data operation of the target data according to the data recovery field.
9. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to carry out the steps of the data recovery method according to any one of claims 1 to 7.
10. A storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the data recovery method of any one of claims 1 to 7.
CN201911052667.5A 2019-10-31 2019-10-31 Data recovery method and device, computer equipment and storage medium Pending CN110781036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911052667.5A CN110781036A (en) 2019-10-31 2019-10-31 Data recovery method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911052667.5A CN110781036A (en) 2019-10-31 2019-10-31 Data recovery method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110781036A true CN110781036A (en) 2020-02-11

Family

ID=69388089

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911052667.5A Pending CN110781036A (en) 2019-10-31 2019-10-31 Data recovery method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110781036A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732487A (en) * 2021-01-07 2021-04-30 中国银联股份有限公司 Data recovery method and device
CN112882861A (en) * 2021-02-18 2021-06-01 北京思特奇信息技术股份有限公司 Service configuration data loading and recovery system and method
CN113297220A (en) * 2021-05-21 2021-08-24 中国邮政储蓄银行股份有限公司 Data recovery method and device, computer readable storage medium and processor
CN113448777A (en) * 2021-07-08 2021-09-28 京东科技控股股份有限公司 Data recovery method and device
CN113687710A (en) * 2021-10-26 2021-11-23 西安羚控电子科技有限公司 Power failure processing method and system for flight control management computer of fixed-wing unmanned aerial vehicle

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01240943A (en) * 1988-03-23 1989-09-26 Fujitsu Ltd Data content recovery system
CN102096614A (en) * 2011-01-24 2011-06-15 上海银杏界信息科技有限公司 Data restoration method of application system
CN103838780A (en) * 2012-11-27 2014-06-04 阿里巴巴集团控股有限公司 Data recovery method of database and relevant device
CN106547801A (en) * 2015-09-23 2017-03-29 北京奇虎科技有限公司 Database data flash back method and apparatus
CN107241370A (en) * 2016-03-29 2017-10-10 西门子公司 The rollback method and system of resource operation under IaaS cloud environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01240943A (en) * 1988-03-23 1989-09-26 Fujitsu Ltd Data content recovery system
CN102096614A (en) * 2011-01-24 2011-06-15 上海银杏界信息科技有限公司 Data restoration method of application system
CN103838780A (en) * 2012-11-27 2014-06-04 阿里巴巴集团控股有限公司 Data recovery method of database and relevant device
CN106547801A (en) * 2015-09-23 2017-03-29 北京奇虎科技有限公司 Database data flash back method and apparatus
CN107241370A (en) * 2016-03-29 2017-10-10 西门子公司 The rollback method and system of resource operation under IaaS cloud environment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732487A (en) * 2021-01-07 2021-04-30 中国银联股份有限公司 Data recovery method and device
CN112732487B (en) * 2021-01-07 2024-01-23 中国银联股份有限公司 Data recovery method and device
CN112882861A (en) * 2021-02-18 2021-06-01 北京思特奇信息技术股份有限公司 Service configuration data loading and recovery system and method
CN112882861B (en) * 2021-02-18 2023-11-07 北京思特奇信息技术股份有限公司 Service configuration data loading and recovering system and method
CN113297220A (en) * 2021-05-21 2021-08-24 中国邮政储蓄银行股份有限公司 Data recovery method and device, computer readable storage medium and processor
CN113448777A (en) * 2021-07-08 2021-09-28 京东科技控股股份有限公司 Data recovery method and device
CN113687710A (en) * 2021-10-26 2021-11-23 西安羚控电子科技有限公司 Power failure processing method and system for flight control management computer of fixed-wing unmanned aerial vehicle

Similar Documents

Publication Publication Date Title
CN110781036A (en) Data recovery method and device, computer equipment and storage medium
CN110879813B (en) Binary log analysis-based MySQL database increment synchronization implementation method
EP1502213B1 (en) Method and apparatus for change data capture in a database system
US8296271B1 (en) System and method for optimizing data recovery in a parallel database
US5884310A (en) Distributed data integration method and system
US7552130B2 (en) Optimal data storage and access for clustered data in a relational database
US11055276B2 (en) Tracking change data in a database
US8099386B2 (en) Method and apparatus for synchronizing databases connected by wireless interface
US8150888B2 (en) Automatic elimination of functional dependencies between columns
US20100030777A1 (en) Method for taking automated inventory of assets and recognition of the same asset on multiple scans
US20070011142A1 (en) Method and apparatus for non-redundant search results
US20070073787A1 (en) Method and apparatus for synchronizing databases connected by wireless interface
US20050223032A1 (en) Loading data from a vertical database table into a horizontal database table
CN105493028A (en) Data consistency and rollback for cloud analytics
CN110609860A (en) Data ETL processing method, device, equipment and storage medium
CN111506621A (en) Data statistical method and device
US8275741B2 (en) Method and apparatus for memory management in an electronic device
CN111782703B (en) Method and system for automatically managing and displaying association relation between irrigation area object data
CN107169003B (en) Data association method and device
CN112835918A (en) MySQL database increment synchronization implementation method
CN109871380B (en) Crowd pack application method and system based on Redis
US11475031B2 (en) Identification and compiling of information relating to an entity
CN109491988B (en) Data real-time association method supporting full-scale updating
CN113961643A (en) Search engine updating method and device, equipment, medium and product thereof
US7599903B2 (en) Systems and methods for extracting data sets from an online relational database into a data warehouse

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 801-2, floor 8, building 3, No. 22, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Applicant after: Wanghai Kangxin (Beijing) Technology Co.,Ltd.

Address before: Room 07, Room 2, Building B, 12 Hongda North Road, Beijing Daxing District, Beijing

Applicant before: BEIJING NEUSOFT VIEWHIGH TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20200211

RJ01 Rejection of invention patent application after publication