Data recovery method, device and storage medium

By using the target index file and operation log during the database backup and archive, the client can obtain the only backup data from the server, solving the problems of high resource occupation and low efficiency in the existing technology, and achieving efficient and flexible data archive.

CN112363871BActive Publication Date: 2025-04-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011321886.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-23
Publication Date
2025-04-11
Estimated Expiration
2040-11-23

AI Technical Summary

Technical Problem

In the prior art, during the full physical backup and archive of the database, the client needs to download and import the entire backup file, resulting in high resource utilization, low efficiency, and import unnecessary data.

Method used

By sending a crawl back instruction for the target data to the server, the server determines the target index file based on the crawl back requirement information, including the location information in the backup data packet. The client extracts location information from the index file and sends instructions to the server to obtain backup data. The server only sends the required backup data and operation logs. The client performs operations and playback to obtain the archived data.

Benefits of technology

It reduces unnecessary data import and resource usage, improves the efficiency and flexibility of data retrieval, and can accurately and quickly obtain the retrieval data of the target data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112363871B_ABST
    Figure CN112363871B_ABST
Patent Text Reader

Abstract

The present application discloses a data rollback method, device and storage medium, the method comprising sending a rollback instruction of target data to a server, so that the server determines a target index file, the target index file includes the location information of multiple backup data in a target backup data packet; receiving the target index file sent by the server; extracting the target location information of the backup data corresponding to the target data from the target index file; sending a backup data acquisition instruction to the server, the backup data acquisition instruction carries the target location information, so that the server obtains the corresponding backup data from the target backup data packet based on the target location information; receiving the corresponding backup data and target operation log sent by the server; replaying the corresponding backup data based on the target operation log to obtain the rollback data of the target data. The technical solution provided by the present application can generate an index file when backing up a database, thereby improving the efficiency and flexibility of data rollback in the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database management, and in particular to a data recovery method, device and storage medium. Background Art

[0002] Data is a vital asset of an enterprise. Once data crashes, becomes chaotic or is lost, it will bring huge losses. Therefore, data backup and rollback is an extremely important task in data management. Existing database data backup methods are mainly divided into two categories: physical backup and logical backup. Among them, physical backup backs up the data in the database itself, and has a high efficiency when rolling back. Logical backup is equivalent to backing up the data operation. When rolling back, it is necessary to execute the SQL statement corresponding to the data to be rolled back. During the execution process, the statement needs to be loaded and interpreted, which takes up a lot of resources and has low rollback efficiency.

[0003] In the prior art, when performing data rollback based on a full physical backup of a database, the client often needs to download and import a full physical backup file (which may include backup files of data tables in multiple databases), then start an instance with the backup file and then select and export the required data to achieve data rollback. This will import unnecessary data, cause unnecessary resource usage, and result in low rollback efficiency. Therefore, a more efficient and reliable solution is needed. Summary of the invention

[0004] In order to solve the problems of the prior art, the present application provides a data recovery method, device and storage medium. The technical solution is as follows:

[0005] On one hand, the present application provides a data recovery method, the method comprising:

[0006] Sending a target data rollback instruction to a server, wherein the target data rollback instruction carries rollback requirement information, so that the server determines a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data packet;

[0007] Receiving the target index file sent by the server;

[0008] Extracting target location information of backup data corresponding to the target data from the target index file;

[0009] Sending a backup data acquisition instruction to the server, wherein the backup data acquisition instruction carries the target location information, so that the server acquires the corresponding backup data from the target backup data packet based on the target location information;

[0010] receiving the corresponding backup data and target operation log sent by the server, wherein the target operation log represents operation information of the plurality of backup data during the backup period;

[0011] The corresponding backup data is replayed based on the target operation log to obtain the restored data of the target data.

[0012] On one hand, the present application provides another data recovery method, the method comprising:

[0013] Receive a target data rollback instruction sent by a client, wherein the target data rollback instruction carries rollback requirement information;

[0014] Determine a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in the target backup data package;

[0015] Sending the target index file to the client, so that the client extracts target location information of the backup data corresponding to the target data from the target index file;

[0016] receiving a backup data acquisition instruction sent by the client, wherein the backup data acquisition instruction carries the target location information;

[0017] Based on the target location information, acquiring the corresponding backup data from the target backup data packet;

[0018] The corresponding backup data and target operation log are sent to the client, wherein the target operation log represents the operation information of the multiple backup data during the backup period; so that the client can replay the operation of the corresponding backup data based on the target operation log to obtain the restored data of the target data.

[0019] On the other hand, the present application provides a data rollback device, the device comprising:

[0020] A rollback instruction sending module, used for sending a rollback instruction of target data to a server, wherein the rollback instruction of target data carries rollback requirement information, so that the server determines a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data packet;

[0021] An index file receiving module, used for receiving the target index file sent by the server;

[0022] A location information extraction module, used to extract target location information of backup data corresponding to the target data from the target index file;

[0023] A data acquisition instruction sending module, used for sending a backup data acquisition instruction to the server, wherein the backup data acquisition instruction carries the target location information, so that the server acquires the corresponding backup data from the target backup data packet based on the target location information;

[0024] A data receiving module, configured to receive the corresponding backup data and a target operation log sent by the server, wherein the target operation log represents operation information of the plurality of backup data during the backup period;

[0025] The operation playback module is used to perform operation playback on the corresponding backup data based on the target operation log to obtain the restored data of the target data.

[0026] On the other hand, the present application provides another data recovery device, the device comprising:

[0027] A rollback instruction receiving module, used for receiving a rollback instruction of target data sent by a client, wherein the rollback instruction of the target data carries rollback requirement information;

[0028] An index file determination module, used to determine a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data package;

[0029] An index file sending module, used for sending the target index file to the client, so that the client can extract the target location information of the backup data corresponding to the target data from the target index file;

[0030] A data acquisition instruction receiving module, used to receive a backup data acquisition instruction sent by the client, wherein the backup data acquisition instruction carries the target location information;

[0031] A backup data acquisition module, used to acquire the corresponding backup data from the target backup data packet based on the target location information;

[0032] A data sending module is used to send the corresponding backup data and a target operation log to the client, wherein the target operation log represents the operation information of the multiple backup data during the backup period; so that the client can replay the operation of the corresponding backup data based on the target operation log to obtain the restored data of the target data.

[0033] On the other hand, the present application provides a data rollback device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data rollback method as described above.

[0034] On the other hand, the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the data rollback method as described above.

[0035] The data recovery method, device and storage medium provided by the present application have the following technical effects:

[0036] This application determines the target index file based on the rollback demand information by the server and sends it to the client, and the target index file includes the location information of multiple backup data in the target backup data package; so that the client can extract the target location information of the backup data corresponding to the above target data from the target index file, and then send a backup data acquisition instruction to the server, so that the server can obtain the above corresponding backup data from the above target backup data package and send it to the client, without downloading or importing the entire backup data package, avoiding unnecessary data import and resource occupation, in addition, the server can also send a target operation log to the client, the target operation log represents the operation information of the above multiple backup data during the backup period; finally, the client can replay the above corresponding backup data based on the target operation log, and accurately obtain the rollback data of the above target data. The technical solution provided by the embodiments of this specification can quickly and accurately perform data rollback, reduce resource occupation, and improve the efficiency and flexibility of data rollback.

[0037] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0040] Figure 2 It is a flowchart of a data recovery method provided in an embodiment of the present application;

[0041] Figure 3 It is a flowchart of another data recovery method provided in an embodiment of the present application;

[0042] Figure 4It is a flowchart of another data recovery method provided in an embodiment of the present application;

[0043] Figure 5 It is a flowchart of another data recovery method provided in an embodiment of the present application;

[0044] Figure 6 It is a flowchart of another data recovery method provided in an embodiment of the present application;

[0045] Figure 7 It is a flowchart of another data recovery method provided in an embodiment of the present application;

[0046] Figure 8 This is a schematic diagram of a full physical backup process provided by an embodiment of the present application;

[0047] Fig. 9 It is a schematic diagram of a data recovery device provided in an embodiment of the present application;

[0048] Fig.10 is a schematic diagram of another data rollback device provided in an embodiment of the present application;

[0049] Fig.11 It is a hardware structure block diagram of a client for implementing a data rollback method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of this application. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions.

[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0052] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0053] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0054] In short, a database can be seen as an electronic filing cabinet - a place where electronic files are stored, and users can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application.

[0055] A database management system (DBMS) is a computer software system designed for managing databases, and generally has basic functions such as storage, retrieval, security, and backup. Database management systems can be classified according to the database models they support, such as relational, XML (Extensible Markup Language); or according to the types of computers they support, such as server clusters, mobile phones; or according to the query language used, such as SQL (Structured Query Language), XQuery; or according to performance impulse focus, such as maximum scale, maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, support multiple query languages ​​at the same time. The data rollback method provided in this application can be applied to the rollback of a cloud database (CDB) as a way of relational database rollback.

[0056] See also Figure 1 , Figure 1 This is a schematic diagram of an application environment provided by this application, such as Figure 1As shown, the application environment may include a client 01 and a server 02 .

[0057] In an embodiment of the present specification, the client 01 can be used to send a rollback instruction of the target data carrying rollback demand information to the server 02, and receive the target index file sent by the server 02 and extract the target location information of the backup data corresponding to the target data, and then send a backup data acquisition instruction to the server 02, receive the corresponding backup data and the target operation log to perform an operation playback on the above corresponding backup data, and obtain the rollback data of the target data; in some embodiments, the client 01 can also be used to establish a hash table and a hash bucket according to the target operation log to improve the search speed, and create a temporary instance based on the rollback data of the above target data to import the rollback data of the above target data into the target instance, so as to apply the rollback data to the target instance. Optionally, the client 01 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this.

[0058] In the embodiments of the present specification, server 02 can be used to store multiple backup data packets and corresponding index files, determine the target index file and send it to client 01 when receiving the target data rollback instruction sent by client 01, and obtain the corresponding backup data from the target backup data packet based on the target location information carried by the backup data acquisition instruction sent by client 01. Optionally, server 02 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0059] In actual applications, the client 01 can send a rollback instruction of the target data to the server 02, and the rollback instruction of the target data carries the rollback requirement information; the server 02 determines the target index file based on the rollback requirement information and sends it to the client 01, and the target index file includes the location information of multiple backup data in the target backup data package; the client 01 extracts the target location information of the backup data corresponding to the above target data from the target index file and sends a backup data acquisition instruction to the server 02, and the backup data acquisition instruction carries the target location information; the server 02 acquires the above corresponding backup data from the above target backup data package based on the target location information; the server 02 sends the above corresponding backup data and the target operation log to the client 01, and the target operation log represents the operation information of the above multiple backup data during the backup period; the client 01 replays the operation of the above corresponding backup data based on the target operation log to obtain the rollback data of the above target data.

[0060] In the embodiments of this specification, the client 01 and the server 02 may be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitation thereto.

[0061] In addition, it should be noted that Figure 1 This is merely a schematic diagram of an application environment provided by an embodiment of the present application, and the present application is not limited thereto.

[0062] Figure 2 It is a flow chart of a data rollback method provided in an embodiment of the present application. This specification provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 2 As shown, the method may include:

[0063] S201: The client sends a target data rollback instruction to the server.

[0064] In the embodiments of the present specification, the above-mentioned target data represents data that needs to be rolled back. In a specific embodiment, the above-mentioned target data may include at least one data table (for example, an ibd file in a database); in actual applications, for example, when a data table is confused or crashed, or some data tables are deleted by mistake, and it is hoped that it will be rolled back to the state at a certain time in the past, while other data tables remain unchanged, the client can send a rollback instruction of the target data to the server to roll back the data for the data table that needs to be rolled back.

[0065] Specifically, the rollback instruction of the target data may carry rollback requirement information; the rollback requirement information may represent the data rollback requirement, and in practical applications, the rollback requirement information may include but is not limited to at least one of time information, project identification, and path information; the server may store backup data packets at multiple different times and index files corresponding to each backup data packet. In a specific embodiment, when the rollback requirement information includes time information, the subsequent server may determine the backup data packet and index file with a matching time identification according to the time information, and use the backup data packet and index file with a matching time identification as the target backup data packet and target index file, respectively. For example, for a backup data packet generated at 11:00 on January 1, 2020, the time stamp of the backup data packet may include 11:00 on January 1, 2020. If the rollback requirement information carried by the rollback instruction of the target data sent by the client includes the time information of 11:00 on January 1, 2020, the server can determine the backup data packet and index file with the time stamp of 11:00 on January 1, 2020 based on the time stamp of the backup data packet and the index file, and use them as the target backup data packet and target index file.

[0066] In actual applications, when data rollback is required for a small number of data tables, the client can send a rollback instruction for the target data to the server, so that the target data can be subsequently rolled back to reduce the download and import of unnecessary data, reduce resource usage, and improve the efficiency of data rollback.

[0067] S203: The server determines the target index file based on the above rollback requirement information.

[0068] Specifically, the target index file may include the location information of multiple backup data in the target backup data packet; in the embodiment of the specification, the target index file may be pre-generated and stored in the server according to the location information of multiple backup data in the target backup data packet at the same time or after the target backup data packet is generated. In one embodiment, the location information of each backup data may include the offset of the backup data, and the above-mentioned offset may represent the address information of the backup data in the corresponding backup data packet; since each data table may be divided into blocks and packaged for output when performing data backup in actual applications, a data table may correspond to multiple compressed data blocks, and these multiple compressed data blocks may be distributed in multiple positions in the backup data packet, so each compressed data block may correspond to an offset, and when generating the corresponding index file, the offset of all compressed data blocks of each data table may be obtained, and the offset of all compressed data blocks of a data table is used as the offset set corresponding to the data table. When a backup data includes the data table, the location information of the backup data may include the offset set of the data table.

[0069] S205: The server sends the target index file to the client.

[0070] After the server determines the target index file based on the above-mentioned rollback demand information, it can send the target index file to the client so that the client can extract information. Since the index file is only used to record the location information of multiple backup data in the backup data package, the file is often small and the download speed is fast. The client does not need to download or import the entire backup data package, which is conducive to improving the efficiency of data rollback.

[0071] S207: The client extracts target location information of the backup data corresponding to the target data from the target index file.

[0072] Since the target index file includes location information of multiple backup data in the target backup data package, the client can extract the target location information of the backup data corresponding to the target data from the target index file, that is, extract the target location information of the backup data corresponding to the target data from the location information of the multiple backup data.

[0073] In actual applications, the client can determine the backup data corresponding to the target data based on the data identifier of the target data, and then extract the target location information of the backup data corresponding to the above target data from the target index file; for example, if the target data includes data table 1, the target location information of data table 1 can be extracted from the above target index file (in one embodiment, the target location information may include an offset set of data table 1). By extracting the target location information of the backup data corresponding to the above target data from the target index file by the client, it is beneficial for the subsequent server to obtain data from the target backup data packet, thereby improving the efficiency and flexibility of data rollback.

[0074] S209: The client sends a backup data acquisition instruction to the server.

[0075] Specifically, the backup data acquisition instruction carries the above-mentioned target location information.

[0076] S211: The server obtains the corresponding backup data from the target backup data packet based on the target location information.

[0077] When the server receives a rollback instruction of the target data carrying rollback requirement information, the target backup data packet may be determined from a large number of backup data packets according to the rollback requirement information. At this time, the server receives a backup data acquisition instruction carrying the target location information sent by the client, and may acquire the corresponding backup data from the target backup data packet based on the target location information. In one embodiment, when the target location information includes an offset set of the corresponding backup data, the server may acquire the corresponding backup data from the target backup data packet based on the target location information, including:

[0078] The server obtains all compressed data blocks of the corresponding backup data from the target backup data packet based on the offset set of the corresponding backup data;

[0079] The server decompresses and merges all the compressed data blocks, uses the decompressed and merged data as the corresponding backup data, and sends the corresponding backup data to the client.

[0080] In another embodiment, after the server obtains all the compressed data blocks of the corresponding backup data from the target backup data packet, it can also send these compressed data blocks to the client as the corresponding backup data, and the client decompresses and merges these compressed data blocks. Subsequently, the decompressed and merged data can be replayed based on the target operation log, but the present application is not limited to this.

[0081] Based on the target location information, the server obtains the corresponding backup data from the target backup data package, and then sends the corresponding backup data to the client. The client does not need to download or import the entire target backup data package (full backup data package), and can directly obtain the required backup data, avoiding the import of unnecessary data, reducing resource occupation and waste, and helping to improve the efficiency and flexibility of data rollback.

[0082] S213: The server sends the corresponding backup data and target operation log to the client.

[0083] Specifically, the target operation log represents the operation information of the plurality of backup data in the target backup data package during the backup period.

[0084] Please refer to Figure 3 In the embodiment of the present specification, the target index file also includes the location information of the target operation log. Before receiving the target operation log sent by the server, the method may further include:

[0085] S301: The client extracts the location information of the target operation log from the target index file.

[0086] In an embodiment of the present specification, the target operation log is similar to the data table in the above-mentioned target backup data packet, and may also correspond to multiple compressed data blocks, and each compressed data block may be distributed in multiple locations in the backup data packet. When generating the corresponding index file, in addition to obtaining the offset of each data table, the offset of all compressed data blocks of the operation log can also be obtained as the offset set corresponding to the operation log. The location information of the target operation log may include the offset set corresponding to the target operation log.

[0087] In the embodiment of the present specification, the specific process of the client extracting the location information of the target operation log from the above-mentioned target index file is similar to S207. The process of the client extracting the target location information of the backup data corresponding to the above-mentioned target data from the target index file is similar. Please refer to the relevant description of S207 and will not be repeated here.

[0088] S303: The client sends a log data acquisition instruction to the server.

[0089] Specifically, the log data acquisition instruction carries the location information of the target operation log. In practical applications, the log data acquisition instruction can be sent in combination with the above backup data acquisition instruction, or sent separately, and the present application is not limited thereto.

[0090] S305: The server obtains the target operation log from the target backup data packet based on the location information of the target operation log.

[0091] In the embodiment of the present specification, the specific process of the server obtaining the target operation log from the above-mentioned target backup data packet based on the location information of the target operation log is similar to S211. The process of the server obtaining the above-mentioned corresponding backup data from the above-mentioned target backup data packet based on the target location information is similar. Please refer to the relevant description of S211 and will not be repeated here.

[0092] The client extracts the location information of the target operation log from the above-mentioned target index file, and the client sends a log data acquisition instruction to the server, so that the server obtains the target operation log from the above-mentioned target backup data packet based on the location information of the target operation log. This is equivalent to the server extracting the target operation log from the target backup data packet according to the location information and then sending it to the client, which avoids the import of unnecessary data, reduces resource occupation and waste, and is conducive to improving the efficiency and flexibility of data rollback.

[0093] S215: The client performs an operation playback on the corresponding backup data based on the target operation log to obtain the archived data of the target data.

[0094] In the embodiment of the present specification, the target operation log may include operation records of multiple backup data in the target backup data package during the backup period.

[0095] In practical applications, the operation log can be used to record the physical changes of the data pages of each data table during the backup period. During the backup process, each data table in the database is still operational and may still change during the backup period (for example, adding, deleting and / or modifying data in the data table). Therefore, when the backup is completed, the backup data (each data table file) in the backup data packet is often not at a consistent time point. For example, a backup data packet generated at 11:00 on January 1, 2020, the time identifier of the backup data packet may include 11:00 on January 1, 2020, but the backup data packet may include 11:00 on January 1, 2020. The backup starts at 10:00 on January 1, 2020. Some of the multiple backup data in this backup data package may be backed up at 10:10, and some may be backed up at 10:30, which is relatively scattered and disordered. In order to obtain backup data with consistent time points (each backup data at 11:00), you can start recording operations at the start of the backup (10:00) and stop recording operations at the end of the backup (11:00). At this time, the operation log can record the operations of each data table during the backup period, and replay the operations during the subsequent rollback to obtain the data table at 11:00 on January 1, 2020.

[0096] Since the target operation log may include a large amount of operation records of the backup data during the backup period, playing them back one by one will cause a waste of time and resources. Therefore, it is necessary to screen the operation records in the target operation log.

[0097] Please refer to Figure 4 The client replays the corresponding backup data based on the target operation log, and the replay data of the target data may include:

[0098] S401: The client determines the operation record of the corresponding backup data during the backup period from the operation records of the plurality of backup data during the backup period.

[0099] In one embodiment, each operation record in the target operation log may correspond to an attribute identifier. When the operation log is used to record operations on data pages of each data table during backup, the above attribute identifier may be composed of a data table ID and a page number. For example, (1,2) may represent page 2 of data table 1.

[0100] Please refer to Figure 5 In one embodiment, the client determines the operation record of the corresponding backup data during the backup period from the operation records of the plurality of backup data during the backup period, which may include:

[0101] S501: The client creates a hash table with the attribute identifier as a key and the operation record as a value according to the operation records of the plurality of backup data during the backup period;

[0102] A hash table (also called a hash table) is a data structure that is directly accessed based on a key value. It accesses records by mapping the key value to a position in the table, improving the speed of data search. By establishing a hash table, it is helpful to improve the speed of record search and screening, thereby improving the efficiency of data retrieval.

[0103] S503: The client generates a hash bucket corresponding to each key according to the hash table;

[0104] Based on the hash table, the client generates a hash bucket corresponding to each key, that is, the operation records of the same page in a data table are in the same hash bucket. By generating hash buckets, hash conflicts can be effectively resolved, the reliability of record search can be improved, and the search speed can be improved.

[0105] S505: The client extracts the target data identifier of the corresponding backup data;

[0106] S507: When the key of any hash bucket matches the target data identifier, the client uses the operation record in the hash bucket as the operation record of the corresponding backup data during the backup period.

[0107] In an embodiment of the present specification, when the above-mentioned attribute identifier is composed of a data table ID and a page number, the target data identifier may include the data table ID. For example, at this time, the corresponding backup data is data table 1. When the key of any hash bucket includes data table 1, that is, the key matches the target data identifier, the operation record in this hash bucket can be used as the operation record of the corresponding backup data during the backup period, and the operation can be replayed subsequently until all the operation records in the hash bucket that meet the conditions are played back.

[0108] By establishing a hash table for data search, it is helpful to improve the speed of record search and screening, thereby improving the efficiency of data retrieval.

[0109] S403: The client replays the operations on the corresponding backup data according to the operation records of the corresponding backup data during the backup period to obtain the restored data of the target data.

[0110] After the client determines the operation records of the above-mentioned corresponding backup data during the backup period from the operation records of the above-mentioned multiple backup data during the backup period, the above-mentioned corresponding backup data can be replayed according to the operation records of the above-mentioned corresponding backup data during the backup period, and the above-mentioned corresponding backup data after the operation replay is completed is used as the archived data of the above-mentioned target data; in the above-mentioned embodiment, the hash buckets whose keys include data table 1 are screened out, and the operation records in these hash buckets are replayed until all the operation records in the hash buckets that meet the conditions are replayed. For example, the table that needs to be archived is data table 1. The server obtains the backup data of data table 1 from the backup data packet at 11:00 on January 1, 2020 and sends it to the client. The client determines the operation records of the backup data of data table 1 during the backup period from the target operation log and replays the backup data of data table 1 sent by the server. After the replay is completed, the archived data of data table 1 (that is, data table 1 at 11:00 on January 1, 2020) is obtained.

[0111] The client determines the operation records of the above-mentioned corresponding backup data during the backup period from the operation records of the above-mentioned multiple backup data during the backup period, and then according to the operation records of the above-mentioned corresponding backup data during the backup period, it is only necessary to replay the operations of the above-mentioned corresponding backup data to obtain the archived data of the above-mentioned target data, which is beneficial to improving the efficiency of data archived and reducing resource waste, and can obtain the above-mentioned corresponding archived data with consistent time points, thereby improving the reliability of data archived.

[0112] Please refer to Figure 6 In the embodiments of this specification, the above method may further include:

[0113] S601: The client creates a temporary instance based on the archived data of the target data;

[0114] S603: The client imports the archived data of the target data in the temporary instance into the target instance;

[0115] In actual applications, the client can start a temporary instance with the rollback data of the above target data. At this time, the file name of the rollback data of the target data is consistent with the file name of the target data in the target instance. For example, if data table 1 needs to be rolled back, data table 1 in the target instance may still be in use. After creating a temporary instance based on the rollback data of the above target data, the rollback data of the above target data can be renamed, for example, the original file name "Data Table 1" can be changed to "A Data Table 1", and then imported into the target instance.

[0116] S605: The client performs a rollback accuracy check based on the target data in the target instance and the rollback data of the target data.

[0117] After the client imports the archived data of the above target data into the target instance, taking the above-mentioned data table 1 as an example, the target instance can now include "Data Table 1" (Table 1 that has not been archived) and "A Data Table 1" (archived data of the target data, that is, Table 1 at 11:00 on January 1, 2020) at the same time. At this time, these two data tables can be combined to perform archive accuracy detection, for example, to determine whether the data after the archive is the required data, which is conducive to improving the reliability of data archive.

[0118] S607: When the rollback accuracy check passes, the client updates the target data in the target instance based on the rollback data of the target data.

[0119] In one embodiment, when the rollback accuracy test passes, the client updates the above target data in the target instance based on the rollback data of the above target data, which may include: the client deletes the above target data in the target instance, and renames the rollback data of the above target data, and uses it as the new target data in the target instance, and subsequently uses this new target data to perform subsequent operations; taking the rollback of the above data table 1 as an example, at this time, the "Data Table 1" in the target instance can be deleted, and "A Data Table 1" can be modified to "Data Table 1" for continued use.

[0120] Please refer to Figure 7 In the embodiments of this specification, the above method may further include:

[0121] S701: The client performs data backup on multiple data in the backup database in response to the data backup instruction to obtain a backup data packet.

[0122] In an embodiment of the present specification, the above-mentioned database to be backed up may include at least one database, and each database may include at least one data table, and one data table may be regarded as one data; in one embodiment, the above-mentioned data backup instruction may be issued by the client in combination with actual backup requirements; in another embodiment, the above-mentioned data backup instruction may also be automatically issued at preset time intervals by a timer preset by the client, and the preset time may be set in combination with actual application requirements, such as 24 hours, or 48 hours, but the present application is not limited thereto.

[0123] In a specific embodiment, the client performs data backup on multiple data in the backup database in response to the data backup instruction, and obtaining the backup data packet may include the following steps:

[0124] 1) Determine the multiple data in the above database to be backed up;

[0125] 2) reading and compressing each of the above-mentioned multiple data in blocks to obtain multiple sub-data packets;

[0126] In practical applications, please refer to Figure 8 , Figure 8 This is a schematic diagram of a full physical backup process provided by an embodiment of this specification. A backup thread can be established for the backup of each data in the above-mentioned database to be backed up, such as Figure 8 As shown, the database to be backed up includes 10 data tables (data table 1 to data table 10), so 10 backup threads can be established, each backup thread performs a backup operation on a data table, and each backup thread can read, compress, cache, stream package and output its corresponding data table in blocks without affecting each other.

[0127] 3) Cache the data of the above-mentioned multiple sub-data packets, and perform streaming packaging output to generate backup data packets.

[0128] In a specific embodiment, a buffer area of ​​preset capacity may be used for data caching. For example, the preset capacity may include 1MB. In practical applications, the sub-data packets may be buffered in the buffer area for data caching, and whenever the buffer area reaches a preset capacity threshold (for example, 1MB), the sub-data packets therein are output to the downstream for continued streaming packaging output (in practical applications, streaming packaging may be packaged into a compressed data block and output whenever the received buffer data reaches 10MB, such as Figure 8As shown in the figure, the compressed data block size of each data table in the output step is 10MB, for example, the compressed data block 1 of data table 1 is 10MB). By caching the data and then outputting it to the next step, it is beneficial to improve the I / O performance of the system.

[0129] The client responds to the data backup instruction to back up multiple data in the backup database to obtain a backup data packet, which is beneficial to improving the timeliness of data backup and reducing the loss of data loss.

[0130] S703: The client obtains location information of multiple backup data in the backup data package.

[0131] In one embodiment, the above-mentioned location information may include an offset, and the offset of the backup data A may characterize the location of the backup data A in its corresponding backup data packet, which is conducive to quickly finding the required data from the backup data packet according to the offset later; from the above-mentioned backup process, it can be seen that in actual applications, one backup data may correspond to multiple compressed data blocks, and when output after streaming packaging, each compressed data block may be output in a random order, so the multiple compressed data blocks corresponding to one backup data may be distributed in different positions of this backup data packet, at this time, each compressed data block corresponds to an offset, and the location information of the backup data may include an offset set composed of the offsets of each compressed data block; for example, data table 1 corresponds to 3 compressed data blocks in total, wherein the offset of compressed data block 1 is 200-299, the offset of compressed data block 2 is 300-399, and the offset of compressed data block 3 is 700-799, at this time, the location information of this backup data (data table 1) may include an offset set {200-299, 300-399, 700-799}.

[0132] S705: The client generates an index file corresponding to the backup data package based on the location information of the multiple backup data in the backup data package.

[0133] In an embodiment of the present specification, for example, the backup data packet includes a total of 10 backup data (data table 1 to data table 10), then the location information of the 10 backup data (for example, 10 offset sets) can be obtained respectively to generate an index file corresponding to the backup data packet. At this time, the index file may include 10 index information. For example, the index information of data table 1 may be "Data table 1: {200-299, 300-399, 700-799}".

[0134] By pre-generating an index file based on the location information of multiple backup data in the backup data package when generating a backup data package, you only need to download the index file first when you subsequently restore the data to determine the location information of the data to be restored in the backup data package. This allows you to accurately and quickly obtain the required data from the backup data package without downloading the entire full backup file, reducing resource usage and improving the efficiency and flexibility of data restoration.

[0135] S707: The client sends the backup data package and the index file corresponding to the backup data package to the server.

[0136] In an embodiment of the present specification, the client sends the backup data package and the index file corresponding to the backup data package to the server. The server can store the backup data package and the corresponding index file, and then the client can delete the local backup data package and the corresponding index file, thereby reducing space occupancy and improving client performance.

[0137] In actual applications, when the client sends the backup data packet and the index file corresponding to the backup data packet to the server, it can also send the category tag of the backup data packet and the index file at the same time (for example, the category tag can include a time mark). The server can then mark and classify the backup data packet and the index file according to the category tag. This is beneficial for the server to quickly and accurately determine the required backup data packets and index files according to the category tag when it receives the rollback instruction sent by the client that carries the rollback requirement information, thereby improving the efficiency and accuracy of data rollback.

[0138] It can be seen from the technical solution provided by the above embodiment of this specification that the embodiment of this specification determines the target index file based on the rollback demand information by the server and sends it to the client, and the target index file includes the location information of multiple backup data in the target backup data packet; so that the client can extract the target location information of the backup data corresponding to the above target data from the target index file, and then send the backup data acquisition instruction to the server, so that the server can obtain the above corresponding backup data from the above target backup data packet and send it to the client, without downloading or importing the entire backup data packet, avoiding unnecessary data import and resource occupation, in addition, the server can also send a target operation log to the client, which characterizes the operation information of the above multiple backup data during the backup period; finally, the client can replay the above corresponding backup data based on the target operation log, accurately obtain the rollback data of the above target data, and improve the efficiency and flexibility of data rollback. By establishing a hash table and a hash bucket for data search, it is beneficial to improve the speed of record search and screening, and can effectively solve hash conflicts, thereby improving the efficiency and reliability of data rollback. When the client imports the rollback data into the target instance, the rollback accuracy detection is performed based on the above target data in the target instance and the rollback data of the above target data, which is beneficial to improve the reliability of data rollback. By pre-generating an index file based on the location information of multiple backup data in the backup data package when generating a backup data package, you only need to download the index file first when restoring data later to determine the location information of the data to be restored in the backup data package, so that you can accurately and quickly obtain the required data from the backup data package without downloading the entire full backup file, reducing resource usage and improving the efficiency and flexibility of data restoration. After the client backup is completed, the backup data will be sent to the server for storage, which is conducive to reducing the client's local space usage and improving the client's performance.

[0139] The present application also provides a data recovery device. Fig. 9 As shown, the device may include:

[0140] A rollback instruction sending module 910 is used to send a rollback instruction of target data to a server, wherein the rollback instruction of the target data carries rollback requirement information, so that the server determines a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data packet;

[0141] An index file receiving module 920, configured to receive the target index file sent by the server;

[0142] A location information extraction module 930, configured to extract target location information of backup data corresponding to the target data from the target index file;

[0143] A data acquisition instruction sending module 940 is used to send a backup data acquisition instruction to the server, wherein the backup data acquisition instruction carries the target location information, so that the server acquires the corresponding backup data from the target backup data packet based on the target location information;

[0144] A data receiving module 950 is used to receive the corresponding backup data and target operation log sent by the server, wherein the target operation log represents operation information of the plurality of backup data during the backup period;

[0145] The operation playback module 960 is used to perform operation playback on the corresponding backup data based on the target operation log to obtain the restored data of the target data.

[0146] In the embodiment of the present specification, the target operation log includes the operation records of the plurality of backup data during the backup period, and the operation playback module 960 may include:

[0147] an operation record screening unit, configured to determine the operation record of the corresponding backup data during the backup period from the operation records of the plurality of backup data during the backup period;

[0148] The operation playback unit is used to play back the operation of the corresponding backup data according to the operation record of the corresponding backup data during the backup period to obtain the restored data of the target data.

[0149] In one embodiment, each operation record corresponds to an attribute identifier, and the operation record screening unit may include:

[0150] A hash table establishment unit, used to establish a hash table with the attribute identifier as a key and the operation record as a value according to the operation records of the plurality of backup data during the backup period;

[0151] A hash bucket generating unit, used to generate a hash bucket corresponding to each key according to the hash table;

[0152] A target data identifier extraction unit, used to extract the target data identifier of the corresponding backup data;

[0153] The matching unit is used to, when the key of any hash bucket matches the target data identifier, use the operation record in the hash bucket whose key matches the target data identifier as the operation record of the corresponding backup data during the backup period.

[0154] In the embodiment of this specification, the above-mentioned data recovery device may further include:

[0155] A data backup module, used for backing up multiple data in the backup database in response to the data backup instruction to obtain a backup data packet;

[0156] A location acquisition module, used to acquire location information of multiple backup data in the backup data packet;

[0157] An index file generating module, used for generating an index file corresponding to the backup data packet based on the location information of the plurality of backup data in the backup data packet;

[0158] The data packet sending module is used to send the backup data packet and the index file corresponding to the backup data packet to the server.

[0159] In the embodiment of the present specification, the target index file further includes the location information of the target operation log, and the data recovery device may further include:

[0160] A log location extraction module, used to extract the location information of the target operation log from the target index file before receiving the target operation log sent by the server;

[0161] The log data acquisition module is used to send a log data acquisition instruction to the server, wherein the log data acquisition instruction carries the location information of the target operation log, so that the server obtains the target operation log from the target backup data packet based on the location information of the target operation log.

[0162] In the embodiment of this specification, the above-mentioned data recovery device may further include:

[0163] A temporary instance creation module, used to create a temporary instance based on the back-filed data of the target data;

[0164] A data import module, used for importing the archived data of the target data in the temporary instance into the target instance;

[0165] An accuracy detection module, configured to perform a rollback accuracy detection based on the target data in the target instance and the rollback data of the target data;

[0166] A data updating module is used to update the target data in the target instance based on the back-filed data of the target data when the back-filed accuracy detection passes.

[0167] The present application also provides another data recovery device. Fig.10 As shown, the device may include:

[0168] The rollback instruction receiving module 1010 is used to receive a rollback instruction of target data sent by a client, wherein the rollback instruction of the target data carries rollback requirement information;

[0169] An index file determination module 1020, configured to determine a target index file based on the archive rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data package;

[0170] An index file sending module 1030, configured to send the target index file to the client, so that the client can extract target location information of backup data corresponding to the target data from the target index file;

[0171] The data acquisition instruction receiving module 1040 is used to receive the backup data acquisition instruction sent by the client, wherein the backup data acquisition instruction carries the target location information;

[0172] A backup data acquisition module 1050, configured to acquire the corresponding backup data from the target backup data packet based on the target location information;

[0173] The data sending module 1060 is used to send the corresponding backup data and the target operation log to the client, wherein the target operation log represents the operation information of the multiple backup data during the backup period; so that the client can replay the operation of the corresponding backup data based on the target operation log to obtain the restored data of the target data.

[0174] The device and method embodiments in the described device embodiments are based on the same application concept.

[0175] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data rollback method provided in the above method embodiment.

[0176] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0177] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device, that is, the above-mentioned computer device may include a mobile terminal, a computer terminal, a server or a similar computing device. Among them, the above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. Taking running on the client as an example, Fig.11 is a schematic diagram of the structure of a client provided in an embodiment of the present application, such as Fig.11 As shown, the client can be used to implement the data rollback method provided in the above embodiment. Specifically:

[0178] The client may include an RF (Radio Frequency) circuit 1110, a memory 1120 including one or more computer-readable storage media, an input unit 1130, a display unit 1140, a sensor 1150, an audio circuit 1160, a WiFi (wireless fidelity) module 1170, a processor 1180 including one or more processing cores, and a power supply 1190. Those skilled in the art will appreciate that Fig.11 The client structure shown in the figure does not constitute a limitation on the client, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0179] The RF circuit 1110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 1180 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 1110 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 1110 can also communicate with the network and other clients through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobilecommunication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0180] The memory 1120 can be used to store software programs and modules, and the processor 1180 executes various functional applications and data processing by running the software programs and modules stored in the memory 1120. The memory 1120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the client, etc. In addition, the memory 1120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1120 may also include a memory controller to provide the processor 1180 and the input unit 1130 with access to the memory 1120.

[0181] The input unit 1130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 1130 may include a touch-sensitive surface 1131 and other input devices 1132. The touch-sensitive surface 1131, also known as a touch display screen or touch pad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 1131), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 1131 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1180, and can receive and execute commands sent by the processor 1180. In addition, the touch-sensitive surface 1131 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1131, the input unit 1130 may further include other input devices 1132. Specifically, the other input devices 1132 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0182] The display unit 1140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the client, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 1140 may include a display panel 1141. Optionally, the display panel 1141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like. Further, the touch-sensitive surface 1131 may cover the display panel 1141. When the touch-sensitive surface 1131 detects a touch operation on or near it, it is transmitted to the processor 1180 to determine the type of the touch event, and then the processor 1180 provides corresponding visual output on the display panel 1141 according to the type of the touch event. Among them, the touch-sensitive surface 1131 and the display panel 1141 can be two independent components to realize the input and output functions, but in some embodiments, the touch-sensitive surface 1131 and the display panel 1141 can also be integrated to realize the input and output functions.

[0183] The client may also include at least one sensor 1150, such as a light sensor, a motion sensor, and other sensors.

[0184] The audio circuit 1160 , the speaker 1161 , and the microphone 1162 may provide an audio interface between the user and the client.

[0185] WiFi is a short-range wireless transmission technology. The client can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1170, which provides users with wireless broadband Internet access. Fig.11 A WiFi module 1170 is shown, but it is understandable that it is not a necessary component of the above-mentioned client and can be omitted as needed without changing the essence of the application.

[0186] The processor 1180 is the control center of the client, and uses various interfaces and lines to connect various parts of the entire client. By running or executing software programs and / or modules stored in the memory 1120, and calling data stored in the memory 1120, the processor 1180 performs various functions of the client and processes data, thereby monitoring the client as a whole. Optionally, the processor 1180 may include one or more processing cores; preferably, the processor 1180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1180.

[0187] The client also includes a power supply 1190 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1180 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 1190 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0188] Although not shown, the client may also include a camera, a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the display unit of the client is a touch screen display, and the client also includes a memory, and one or more programs, wherein one or more programs are stored in the memory and are configured to be executed by one or more processors to execute instructions in the method embodiment of the present application.

[0189] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to a data rollback method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the data rollback method provided in the above method embodiment.

[0190] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0191] The embodiments of the present application also provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the above various optional implementations.

[0192] It can be seen from the embodiments of the data rollback method, device, equipment or storage medium or computer program provided by the present application that in the present application, the target index file is determined by the server based on the rollback demand information and sent to the client, and the target index file includes the location information of multiple backup data in the target backup data packet; so that the client can extract the target location information of the backup data corresponding to the above target data from the target index file, and then send the backup data acquisition instruction to the server, so that the server can obtain the above corresponding backup data from the above target backup data packet and send it to the client, without downloading or importing the entire backup data packet, avoiding unnecessary data import and resource occupation, in addition, the server can also send a target operation log to the client, and the target operation log represents the operation information of the above multiple backup data during the backup period; finally, the client can replay the above corresponding backup data based on the target operation log, accurately obtain the rollback data of the above target data, and improve the efficiency and flexibility of data rollback. By establishing a hash table and a hash bucket for data search, it is beneficial to improve the speed of record search and screening, and can effectively resolve hash conflicts, thereby improving the efficiency and reliability of data rollback. When the client imports the restored data into the target instance, the restore accuracy is checked based on the target data in the target instance and the restored data of the target data, which is helpful to improve the reliability of data restore. When generating a backup data packet, an index file is pre-generated according to the location information of multiple backup data in the backup data packet, and then when performing data restore, only the index file needs to be downloaded first to determine the location information of the data to be restored in the backup data packet, so that the required data can be obtained from the backup data packet accurately and quickly without downloading the entire full backup file, reducing resource usage and improving the efficiency and flexibility of data restore. After the client backup is completed, the backup data is sent to the server for storage, which is helpful to reduce the local space occupied by the client and improve the performance of the client.

[0193] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0194] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0195] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

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

Claims

1. A data recovery method, characterized in that: The method comprises: Sending a target data rollback instruction to a server, wherein the target data rollback instruction carries rollback requirement information, so that the server determines a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data packet; Receiving the target index file sent by the server; Extracting target location information of backup data corresponding to the target data from the target index file; Sending a backup data acquisition instruction to the server, wherein the backup data acquisition instruction carries the target location information, so that the server acquires the corresponding backup data from the target backup data packet based on the target location information; receiving the corresponding backup data and target operation log sent by the server, wherein the target operation log represents operation information of the plurality of backup data during the backup period; The corresponding backup data is replayed based on the target operation log to obtain the restored data of the target data.

2. The method according to claim 1, characterized in that The target operation log includes operation records of the plurality of backup data during the backup period, and the operation playback of the corresponding backup data based on the target operation log to obtain the restored data of the target data includes: Determining the operation record of the corresponding backup data during the backup period from the operation records of the plurality of backup data during the backup period; According to the operation record of the corresponding backup data during the backup period, the operation of the corresponding backup data is played back to obtain the restored data of the target data.

3. The method according to claim 2, characterized in that Each operation record corresponds to an attribute identifier, and determining the operation record of the corresponding backup data during the backup period from the operation records of the plurality of backup data during the backup period includes: According to the operation records of the plurality of backup data during the backup period, a hash table is established with the attribute identifier as a key and the operation record as a value; According to the hash table, generate a hash bucket corresponding to each key; Extracting the target data identifier of the corresponding backup data; When the key of any hash bucket matches the target data identifier, the operation record in the hash bucket whose key matches the target data identifier is used as the operation record of the corresponding backup data during the backup period.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In response to the data backup instruction, back up the multiple data in the backup database to obtain a backup data packet; Acquire location information of multiple backup data in the backup data packet; Based on the location information of the plurality of backup data in the backup data package, generating an index file corresponding to the backup data package; The backup data package and the index file corresponding to the backup data package are sent to the server.

5. The method according to any one of claims 1 to 3, characterized in that: The target index file also includes location information of the target operation log. Before receiving the target operation log sent by the server, the method further includes: Extracting the location information of the target operation log from the target index file; A log data acquisition instruction is sent to the server, wherein the log data acquisition instruction carries the location information of the target operation log, so that the server acquires the target operation log from the target backup data packet based on the location information of the target operation log.

6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Creating a temporary instance based on the back-filed data of the target data; Importing the archived data of the target data in the temporary instance into the target instance; Performing a rollback accuracy test based on the target data in the target instance and the rollback data of the target data; When the rollback accuracy check passes, the target data in the target instance is updated based on the rollback data of the target data.

7. A data rollback method, characterized in that: The method comprises: Receive a target data rollback instruction sent by a client, wherein the target data rollback instruction carries rollback requirement information; Determine a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in the target backup data package; Sending the target index file to the client, so that the client extracts target location information of the backup data corresponding to the target data from the target index file; receiving a backup data acquisition instruction sent by the client, wherein the backup data acquisition instruction carries the target location information; Based on the target location information, acquiring the corresponding backup data from the target backup data packet; The corresponding backup data and target operation log are sent to the client, wherein the target operation log represents the operation information of the multiple backup data during the backup period; so that the client can replay the operation of the corresponding backup data based on the target operation log to obtain the restored data of the target data.

8. A data recovery device, characterized in that: The device comprises: A rollback instruction sending module, used for sending a rollback instruction of target data to a server, wherein the rollback instruction of target data carries rollback requirement information, so that the server determines a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data packet; An index file receiving module, used for receiving the target index file sent by the server; A location information extraction module, used to extract target location information of backup data corresponding to the target data from the target index file; A data acquisition instruction sending module, used for sending a backup data acquisition instruction to the server, wherein the backup data acquisition instruction carries the target location information, so that the server acquires the corresponding backup data from the target backup data packet based on the target location information; A data receiving module, configured to receive the corresponding backup data and a target operation log sent by the server, wherein the target operation log represents operation information of the plurality of backup data during the backup period; The operation playback module is used to perform operation playback on the corresponding backup data based on the target operation log to obtain the restored data of the target data.

9. A data recovery device, characterized in that: The device comprises: A rollback instruction receiving module, used for receiving a rollback instruction of target data sent by a client, wherein the rollback instruction of the target data carries rollback requirement information; An index file determination module, used to determine a target index file based on the rollback requirement information, wherein the target index file includes location information of multiple backup data in a target backup data package; An index file sending module, used for sending the target index file to the client, so that the client can extract the target location information of the backup data corresponding to the target data from the target index file; A data acquisition instruction receiving module, used to receive a backup data acquisition instruction sent by the client, wherein the backup data acquisition instruction carries the target location information; A backup data acquisition module, used to acquire the corresponding backup data from the target backup data packet based on the target location information; A data sending module is used to send the corresponding backup data and a target operation log to the client, wherein the target operation log represents the operation information of the multiple backup data during the backup period; so that the client can replay the operation of the corresponding backup data based on the target operation log to obtain the restored data of the target data.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data recovery method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data retreating method and device

    CN108228390A

  • A computer data backhaul system

    CN110008063A