Table recovery method and related device

By obtaining and utilizing the backup data metadata of the data table, directly recovering the data table at the target time point, the problem of low recovery efficiency in the existing technology is solved and faster table-level point-time recovery is achieved.

CN120196477APending Publication Date: 2025-06-24HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311791628.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The existing table-level point-in-time recovery method requires downloading full backup data from the historical backup data of the object storage service, resulting in inefficient recovery of the target table.

Method used

By obtaining the metadata in the backup data of the data table, directly restore the data table at the target time point, without restoring all the tables of the database, thereby improving the recovery speed.

Benefits of technology

The efficiency of restoring data tables at the target time is achieved, without downloading backup data from other data tables, significantly accelerating the table-level point-time recovery process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196477A_ABST
    Figure CN120196477A_ABST
Patent Text Reader

Abstract

The invention provides a table recovery method, which is applied to the field of cloud storage, and comprises the following steps: after a computing device obtains a first metadata file from a storage device, obtaining a first table fragment site from the first metadata file according to a table identifier, and sending a fragment obtaining request comprising the first table fragment site to the storage device, the first table fragment sent by the storage device is stored in the first file, the first file is recovered to be the data table at the first backup moment, then the log obtaining request is sent to the storage device, and the binary log sent by the storage device is used for playing back the data table, so that the data table can be recovered by obtaining backup data of the data table from the storage device. And backup data of all database tables does not need to be acquired from the storage device, so that the table-level time point recovery speed can be increased. The invention further provides a computing device, a storage device, a cloud service system, a computing device cluster, a computer readable storage medium and a computer program product which can implement the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud storage, and in particular, to a table recovery method, a computing device, a storage device, a cloud service system, a computing device cluster, a computer-readable storage medium, and a computer program product. Background Art

[0002] Table-level point-in-time recovery refers to restoring a table of a database to a specified point in time.

[0003] Currently, a method for table-level point-in-time recovery is generally as follows: Select the most recent full backup data from the historical backup data of the object storage service (OBS) and download it to a temporary instance for full recovery. Then, replay the binary log (binlog) on the temporary instance to the specified point in time, select the target table data from the replay result according to the table identifier sent by the user device, and write the target table data back to the target table of the original database instance.

[0004] This method takes a long time to restore all tables of the database instance based on the full backup, so the efficiency of restoring the target table is not high. Summary of the Invention

[0005] This application provides a table recovery method that can restore a data table at a target point in time based on the backup data of the data table, without restoring all tables of the database, so as to improve the efficiency of restoring the data table. This application also provides related devices for implementing the above method, such as a computing device, a storage device, a cloud service system, a computing device cluster, a computer-readable storage medium, and a computer program.

[0006] In a first aspect, a table recovery method is provided. This method can be executed by a computing device of a cloud service system. After the user device sends a table recovery request to the management device, the management device sends a first backup file identifier, a table identifier, and a binary log identifier to the computing device. The computing device obtains a first metadata identifier corresponding to the first backup file identifier, sends a metadata acquisition request including the first metadata identifier to the storage device. After the storage device obtains the first metadata file according to the metadata acquisition request, it sends the first metadata file to the computing device. Then, the computing device obtains a first table shard position from the first metadata file according to the table identifier, sends a shard acquisition request including the first table shard position to the storage device, receives the first table shard sent by the storage device, saves the first table shard sent by the storage device in a first file, restores the first file to a data table at the first backup time, and then sends a log acquisition request including the binary log identifier to the storage device, receives the binary log sent by the storage device, and uses the binary log to replay the data table at the first backup time to obtain the data table at the target point in time.

[0007] Among them, the first table shard is obtained by the storage device according to the first table shard position, the binary log is obtained by the storage device according to the binary log identifier, the binary log identifier corresponds to the binary log, and the first metadata identifier corresponds to the first metadata file.

[0008] In this way, the table shards of the data table can be retrieved from the storage device to restore the data table, without retrieving the backup data of all database tables from the storage device and without restoring all database tables, thus improving the table-level point-in-time recovery speed.

[0009] In some possible implementation manners, the computing device may back up all data tables as a first backup file, record the table shard identifier and the first table shard position of the first table shard in the first backup file in the first metadata file, and send the first backup file and the first metadata file to the storage device. The data table corresponds to one or more first table shards of the first backup file. The first table shard is any table shard in the first backup file, and the first table shard position is the offset address of the first table shard in the storage device. This can record the offset address of each table shard in the storage device to facilitate the quick restoration of the data table.

[0010] In some possible implementation manners, the computing device may search for the table shard identifier including the table identifier in the first metadata file; determine the first table shard position corresponding to the table shard identifier in the first metadata file. In this way, all table shards at the first backup moment can be retrieved according to the table identifier.

[0011] In some implementation manners, after the computing device sends a shard acquisition request including a plurality of first table shard positions to the storage device, the computing device receives a plurality of first table shards sent by the storage device in parallel, sorts the plurality of first table shards in the shard order, and saves the sorted first table shards in the first file. This can acquire a plurality of table shards in parallel, improve the transmission speed of the table shards, and thus improve the table restoration speed.

[0012] In some possible implementation manners, the computing device may traverse the database operation statements of the binary log; when the database operation statement includes the table identifier sent by the management device, the computing device replays the data table at the first backup moment according to the database operation statement; when the database operation statement does not include the above table identifier, the computing device does not execute the database operation statement. This can skip the database operation statements corresponding to the data tables not yet restored and prevent errors in the tables not yet restored.

[0013] In some possible implementation manners, the computing device obtains database operation statements including table identifiers from a binary log, caches the obtained database operation statements in chronological order; sequentially reads the database operation statements from the cache; and replays the data table at the first backup time using the read database operation statements, so as to obtain the data table at the target time point. In this way, the database operation statements related to the data table can be read and executed in a pipeline manner, and no judgment is required before executing each database operation statement, so the replay speed can be improved.

[0014] In some implementation manners, after the computing device detects an abnormal table shard sent by the storage device, it sends a failure message to the management device; receives the second backup file identifier, table identifier, and log identifier sequence sent by the management device, and obtains the second metadata identifier corresponding to the second backup file identifier; then sends a metadata acquisition request including the second metadata identifier to the storage device; the computing device receives the second metadata file sent by the storage device; the computing device obtains the second table shard position from the second metadata file according to the table identifier, and then the computing device sends a shard acquisition request including the second table shard position to the storage device. After the storage device obtains the second table shard according to the second table shard position, the computing device receives the second table shard sent by the storage device, saves the second table shard sent by the storage device in a second file, restores the second file to the data table at the second backup time, and then sends a log acquisition request including the log identifier sequence to the storage device; after the storage device obtains the binary log sequence corresponding to the log identifier sequence in response to the log acquisition request, the computing device receives the binary log sequence sent by the storage device, and the computing device replays the data table at the second backup time using the binary log sequence to obtain the data table at the target time point. Among them, the second backup time is earlier than the first backup time. When the backup file at the first backup time fails, an earlier table shard can be used for table time point recovery.

[0015] A second aspect provides a table recovery method, which can be executed by the storage device of the cloud service system. The method includes: after the storage device receives the metadata acquisition request sent by the computing device, determining the first metadata file according to the first metadata identifier included in the metadata acquisition request; sending the first metadata file to the computing device; then receiving the shard acquisition request including the first table shard position sent by the computing device, and obtaining the first table shard corresponding to the first table shard position; sending the first table shard to the computing device, then receiving the log acquisition request including the binary log identifier sent by the computing device, obtaining the binary log according to the binary log identifier, and sending the binary log to the computing device. In this way, the backup data of the data table can be sent to the computing device to restore the data table. Since the storage device does not need to send all the data tables of the database to the computing device when restoring the data table, the speed of table-level time point recovery can be improved.

[0016] In some possible implementations, the storage device may receive a first backup file and a first metadata file sent by the computing device, and store the first backup file and the first metadata file. The storage device may store the first metadata file including the first table sharding position for facilitating the recovery of the data table.

[0017] In some possible implementations, the storage device receives a metadata acquisition request including a second metadata identifier sent by the computing device, determines a second metadata file according to the second metadata identifier, sends the second metadata file to the computing device, then receives a shard acquisition request including a second table sharding position sent by the computing device, acquires a second table shard corresponding to the second table sharding position, sends the second table shard to the computing device, receives a log acquisition request including a log identifier sequence sent by the computing device, acquires a binary log sequence corresponding to the log identifier sequence, and sends the binary log sequence to the computing device. This can provide the binary log sequence to replay an earlier data table to recover the data table at the target time point.

[0018] A third aspect provides a computing device, which includes a communication module and a data recovery module. The communication module is configured to receive a first backup file identifier, a table identifier, and a binary log identifier sent by the management device; determine a first metadata identifier according to the first backup file identifier, and send a metadata acquisition request including the first metadata identifier to the storage device; receive the first metadata file sent by the storage device. The data recovery module is configured to obtain a first table sharding position from the first metadata file according to the table identifier. The communication module is further configured to send a shard acquisition request including the first table sharding position to the storage device; receive the first table shard sent by the storage device, and the data recovery module is further configured to save the first table shard sent by the storage device in a first file and restore the first file to the data table at the first backup time. The communication module is further configured to send a log acquisition request including the binary log identifier to the storage device and receive the binary log sent by the storage device, and the data recovery module is further configured to use the binary log to replay the data table at the first backup time to obtain the data table at the target time point.

[0019] In some possible implementations, the data recovery module is further configured to back up all data tables as a first backup file; record the table shard identifier and the first table sharding position of the first table shard in the first metadata file. The communication module is further configured to send the first backup file and the first metadata file to the storage device.

[0020] In some possible implementations, the data recovery module is specifically configured to search for a table shard identifier including the table identifier in the first metadata file; determine the first table sharding position corresponding to the table shard identifier in the first metadata file.

[0021] In some possible implementations, the communication module is specifically configured to receive multiple first table shards sent in parallel by the storage device when the shard request obtained includes multiple first table shard positions; the data recovery module is specifically configured to sort the multiple first table shards sent in parallel by the storage device in the shard order, and save the sorted first table shards in the first file.

[0022] In some possible implementations, the data recovery module is specifically configured to traverse the database operation statements in the binary log; when the database operation statement includes a table identifier, replay the data table corresponding to the table identifier at the first backup time according to the database operation statement; when the database operation statement does not include a table identifier, do not execute the database operation statement.

[0023] In some possible implementations, the data recovery module is specifically configured to obtain the database operation statements including table identifiers from the binary log, cache the obtained database operation statements in chronological order; sequentially read the database operation statements from the cache; and replay the data table at the first backup time using the read database operation statements.

[0024] In some possible implementations, the data recovery module is further configured that the communication module is further configured to, after the data recovery module detects an abnormality in the table shards sent by the storage device, send a failure message to the management device; receive the second backup file identifier, table identifier, and log identifier sequence sent by the management device, obtain the second metadata table identifier corresponding to the second backup file identifier, and send a metadata acquisition request including the second metadata identifier to the storage device; receive the second metadata file sent by the storage device; the data recovery module is further configured to obtain the second table shard position from the second metadata file; the communication module is further configured to send a shard acquisition request including the second table shard position to the storage device, and receive the second table shard sent by the storage device; the data recovery module is further configured to save the second table shard sent by the storage device in the second file, and restore the second file to the data table at the second backup time; the communication module is further configured to send a log acquisition request including the log identifier sequence to the storage device; receive the binary log sequence sent by the storage device, and the data recovery module is further configured to replay the data table at the second backup time using the binary log sequence to obtain the data table at the target time point.

[0025] For the glossary of terms, specific steps performed by each module, and technical effects in the third aspect, reference may be made to the corresponding descriptions in the first aspect.

[0026] The fourth aspect provides a storage device, which includes a communication module and a database management module; the communication module is configured to receive a metadata acquisition request including a first metadata identifier sent by a computing device; the database management module is configured to determine a first metadata file according to the first metadata identifier; the communication module is further configured to send the first metadata file to the computing device; receive a shard acquisition request including a first table shard position sent by the computing device, and the database management module is further configured to obtain a first table shard corresponding to the first table shard position; the communication module is further configured to send the first table shard to the computing device, and receive a log acquisition request including a binary log identifier sent by the computing device; the database management module is further configured to obtain a binary log according to the binary log identifier; the communication module is further configured to send the binary log to the computing device.

[0027] In some possible implementation manners, the communication module is further configured to receive a first backup file and a first metadata file sent by the computing device, and the database management module is further configured to store the first backup file and the first metadata file.

[0028] In some possible implementation manners, the communication module is further configured to receive a metadata acquisition request including a second metadata identifier sent by the computing device; the database management module is further configured to determine a second metadata file according to the second metadata identifier; the communication module is further configured to send the second metadata file to the computing device;

[0029] The communication module is further configured to receive a shard acquisition request including a second table shard position sent by the computing device, and the database management module is further configured to obtain a second table shard corresponding to the second table shard position; the communication module is further configured to send the second table shard to the computing device; receive a log acquisition request including a log identifier sequence sent by the computing device; the database management module is further configured to obtain a binary log sequence corresponding to the log identifier sequence; the communication module is further configured to send the binary log sequence to the computing device.

[0030] For the glossary of terms, the specific steps executed by each module, and the technical effects in the fourth aspect, reference may be made to the corresponding descriptions in the second aspect.

[0031] The fifth aspect provides a cloud service system, which includes a computing device in the third aspect or any one of the possible implementation manners of the third aspect, and a storage device in the fourth aspect or any one of the possible implementation manners of the fourth aspect.

[0032] The sixth aspect provides a cluster of computing devices, which includes at least one computing device, and each computing device includes a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the cluster of computing devices executes the method described in the first aspect or any possible implementation manner of the first aspect, or the method described in the second aspect or any possible implementation manner of the second aspect.

[0033] The seventh aspect provides a computer-readable storage medium, which includes computer program instructions. When the computer program instructions are executed by a cluster of computing devices, the cluster of computing devices executes the method described in the first aspect or any possible implementation manner of the first aspect, or the method described in the second aspect or any possible implementation manner of the second aspect.

[0034] The eighth aspect provides a computer program product containing instructions. When the instructions are run by a cluster of computing devices, the cluster of computing devices is caused to execute the method described in the first aspect or any possible implementation manner of the first aspect, or the method described in the second aspect or any possible implementation manner of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic diagram of a cloud service scenario in an embodiment of the present application;

[0036] Figure 2 It is a schematic diagram of a cloud service system in an embodiment of the present application;

[0037] Figure 3 It is a flowchart of a table recovery method in an embodiment of the present application;

[0038] Figure 4 It is a schematic diagram of a table recovery interface in an embodiment of the present application;

[0039] Figure 5 It is a flowchart of a table backup method in an embodiment of the present application;

[0040] Figure 6 It is a schematic diagram of a table backup and recovery method in an embodiment of the present application;

[0041] Figure 7 It is a structural diagram of a computing device in an embodiment of the present application;

[0042] Figure 8 It is a structural diagram of a storage device in an embodiment of the present application;

[0043] Figure 9 It is a structural diagram of a computing device in an embodiment of the present application;

[0044] Figure 10A schematic diagram of a computing device cluster in an embodiment of the present application;

[0045] Figure 11 Another schematic diagram of a computing device cluster in an embodiment of the present application. Detailed implementation manners

[0046] The table-level time point recovery method of the present application can be applied to a cloud service system, which refers to a system that provides cloud services. The cloud service system may include one or more data centers, or may include some servers in a data center.

[0047] Refer to Figure 1 , in one example, the cloud service system includes a cloud management platform and multiple servers in the data center. The cloud management platform and the multiple servers are connected through the internal network of the data center. The client can be connected to the cloud management platform through the Internet.

[0048] Functions of the cloud management platform: Provide access interfaces (such as interfaces or application programming interfaces). Tenants can operate the client to remotely access the access interfaces to register cloud accounts and passwords on the cloud management platform and log in to the cloud management platform. After the cloud management platform authenticates the cloud accounts and passwords successfully, tenants can further pay on the cloud management platform to select and purchase virtual machines of specific specifications (processors, memory, disks). After the successful payment and purchase, the cloud management platform provides the remote login account password of the purchased virtual machine, and the client can remotely log in to the virtual machine and install and run the tenant's applications in the virtual machine.

[0049] Logical function division of the cloud management platform: User console, computing management service, network management service, storage management service, authentication service, image management service. The user console provides an interface or application programming interface to interact with tenants. The computing management service is used to manage the servers running virtual machines and containers and bare metal servers. The network management service is used to manage network services (such as gateways, firewalls, etc.). The storage management service is used to manage storage services (such as data bucket services). The authentication service is used to manage the account passwords of tenants. The image management service is used to manage virtual machine images.

[0050] Functions of the cloud management platform client: Receive the control plane commands sent by the cloud management platform and create and perform full life cycle management on the virtual machine on the server according to the control plane control commands. The cloud management platform client can be installed on user devices.

[0051] Therefore, tenants can create, manage, log in to, and operate virtual machines in the cloud data center through the cloud management platform. Among them, the virtual machine can also be called an elastic compute service (ECS) or an elastic instance.

[0052] A virtual machine refers to a complete computer system with the functions of a complete hardware system simulated by software and running in a completely isolated environment. All the tasks that can be accomplished on a server can be achieved in a virtual machine. When creating a virtual machine on a server, a portion of the physical machine's hard disk and memory capacity is used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent hard disk and operating system, and users of the virtual machine can operate the virtual machine in the same way as they operate a server.

[0053] A server includes a hardware layer and a software layer. The hardware layer is the conventional configuration of the server. Among them, peripheral component interconnect (PCI) devices include network cards, graphics processing units (GPUs), offloading cards, and other devices that can be inserted into the PCI / PCIe slots of the server. The software layer includes the operating system installed and running on the server (which can be called the host operating system relative to the operating system of the virtual machine). The virtual machine manager (VMM) is set in the host operating system. The virtual machine manager is also called Hypervisor. The role of the virtual machine manager is to achieve computing virtualization, network virtualization, and storage virtualization of the virtual machine and is responsible for managing the virtual machine.

[0054] Computing virtualization means providing a portion of the server's processor and memory to the virtual machine. Network virtualization means providing some functions of the network card (such as bandwidth) to the virtual machine. Storage virtualization means providing some disks to the virtual machine. The virtual machine manager can also achieve logical isolation between different virtual machines and manage the virtual machine. For example, creating a virtual machine, simulating virtual hardware for the virtual machine according to the hardware layer (hardware simulation function), deleting the virtual machine, forwarding and / or processing network packets between all virtual machines (such as virtual machine 1 and virtual machine 2) running on this server, or forwarding network packets between the virtual machine on this server and the external network (virtual switching function), and processing the I / O generated by the virtual machine.

[0055] The running environments (such as virtual machine applications, operating systems, and virtual hardware) in different virtual machines are completely isolated. To communicate between virtual machine 1 and virtual machine 2, network packets need to be forwarded through the virtual manager. Tenants can remotely log in to the virtual machine and operate the installation, setting, and uninstallation of applications in the virtual machine operating system environment.

[0056] Multiple servers in a cloud service system can form a computing device cluster and a storage device cluster. As Figure 2 shown, the computing device cluster includes one or more computing devices 210 ( Figure 2Three computing devices 210 are shown (but not limited to three computing devices 210), and the various computing devices 210 can communicate with each other. The computing device 210 can be, but is not limited to, a server, a desktop computer, etc. Any one of the computing devices 210 can access any one of the storage devices 200 in the storage device cluster through the internal network of the data center. The storage device cluster includes multiple storage devices 200( Figure 2 Three storage devices 200 are shown (but not limited to three storage devices 200). It should be understood that the number of computing devices in the computing device cluster, the number of storage devices in the storage device cluster, the connection relationship between computing devices, the connection relationship between storage devices, and the connection relationship between computing devices and storage devices in this application are not limited to Figure 2 as shown

[0057] Based on the computing device and storage device of the present application below, the table-level time point recovery method of the present application will be introduced. Refer to Figure 3 , in one embodiment, the table recovery method of the present application includes:

[0058] Step 301, the user device sends a table recovery request to the management device.

[0059] In this embodiment, the user can fill in the recovery time, recovery level, recovery library table, etc. in the data recovery interface of the user device. Refer to Figure 4 , in one example, the recovery time is 2023 / 11 / 20 11:00:00, the recovery level is table-level recovery, the database to be recovered is rds-001, the tables to be recovered are tb1 and tb2, click the confirmation button, and the user device can send the table recovery request to the management device. The function of the management device can be implemented by the cloud management platform. The table recovery request may include one or more table identifiers, and the table identifier may be, but is not limited to, the table name. The database identifier may be, but is not limited to, the database name.

[0060] Step 302, the management device sends the first backup file identifier, the table identifier, and the binary log identifier to the computing device.

[0061] Specifically, the management device obtains the first backup file identifier, the table identifier, and the binary log identifier according to the table recovery request, and then sends the above information to the computing device.

[0062] Step 303, the computing device obtains the first metadata identifier corresponding to the first backup file identifier.

[0063] The first backup file identifier is used to identify the first backup file (i.e., the backup file at the first backup time), and the first metadata identifier is used to identify the first metadata file (i.e., the metadata file at the first backup time). The computing device can determine the first metadata identifier corresponding to the first backup file identifier according to the correspondence between the backup file identifier and the metadata identifier.

[0064] Step 304: The computing device sends a metadata acquisition request including the first metadata identifier to the storage device.

[0065] Step 305: The storage device determines the first metadata file according to the first metadata identifier.

[0066] After the storage device determines the first metadata file according to the above metadata acquisition request, it sends the first metadata file to the computing device. Optionally, the first metadata file includes the metadata of the most recent backup database.

[0067] Step 306: The computing device receives the first metadata file sent by the storage device.

[0068] Step 307: The computing device obtains the first table shard position from the first metadata file according to the table identifier.

[0069] Table sharding refers to the data shards corresponding to the data tables in the backup file. The first table shard position is the offset address of the first table shard in the storage device. The first table shard is any table shard in the backup file at the first backup time, and the first backup time can be, but is not limited to, the time of the most recent backup.

[0070] The metadata file of a database includes multiple records, and each record includes the table shard identifier of a table shard and the position of that table shard. In one example, the metadata file includes the records shown in Table 1:

[0071] Record Serial Number Table Sharding Identifier Table Sharding Site Table Sharding Size Table Sharding Checksum 1 mysql / tb1_001 0 65536 bytes Hash Value 1 2 mysql / tb1_002 65536 65536 bytes Hash Value 2 3 mysql / tb1_003 131072 65536 bytes Hash Value 3 … … … … … 100 mysql / tb10_001 6553600 65536 bytes Hash Value 100 101 mysql / tb10_002 6619136 65536 bytes Hash Value 101

[0072] Table 1

[0073] tb1 is the table name of the first table. The table shard identifiers corresponding to tb1 include: tb1_001, tb1_002, and tb1_003. The 001 in tb1_001 is the shard sequence number, and the other shards can be inferred accordingly. tb1 is the table name of the 10th table. The table shard identifiers corresponding to tb10 include: tb10_001 and tb10_002. The 001 in tb10_001 is the shard sequence number, and the other shards can be inferred accordingly. The table shard locus is used to indicate the starting address of the table shard. The address difference between two table shards can indicate the size of the previous table shard. For example, the locus of tb1_001 is 0, the locus of tb1_002 is 65536, and the size of tb_001 is 65536 bytes. It should be understood that the database identifier of the present application can be, but is not limited to, mysql. The table name, table shard identifier, table shard locus, and table shard size of the present application are not limited to the examples shown in Table 1 and can be specifically set according to actual situations.

[0074] In the metadata file, the table shard check code is optional. When the table shard check code in the metadata file is the same as the check code calculated for the table shard, it is determined that the table shard is correct; when the table shard check code in the metadata file is different from the check code calculated for the table shard, it is determined that the table shard is abnormal. The table shard check code can be the hash value calculated for the table shard using a hash algorithm.

[0075] In an optional embodiment, step 306 includes: the calculation device searches for the table shard identifier including the table identifier in the first metadata file; determines the first table shard locus corresponding to the table shard identifier. The table shard identifier includes the table identifier and the shard sequence number. For example, tb1 is the table identifier, and based on tb1, 10 table shard identifiers can be found, which are tb1_001, tb1_002, tb1_003, tb1_004, tb1_005, tb1_006, tb1_007, tb1_008, tb1_009, tb1_010 respectively, and the table shard loci corresponding to the 10 table shard identifiers are obtained. In this way, all the table shard loci corresponding to the table identifier at the first backup moment can be found according to the table identifier.

[0076] In step 308, the calculation device sends a shard acquisition request including the first table shard locus to the storage device.

[0077] After the calculation device obtains the first table shard locus corresponding to the above table identifier, it generates a shard acquisition request including the first table shard locus and sends the shard acquisition request to the storage device.

[0078] In step 309, the storage device acquires the first table shard corresponding to the first table shard locus.

[0079] The first table sharding point can indicate the offset address of the data table at the first backup moment in the storage device, and the storage device can determine the storage address of the first table shard according to the first table sharding point. Reading data of the table shard size from the storage address is the table shard.

[0080] In addition to obtaining the first table shard according to the sharding request, the storage device can also obtain the system libraries for restoring the data table and send the system libraries to the computing device. The system libraries include but are not limited to the sys library, the performance_schema library, and the information_schema library. The performance_schema library stores some status information during the operation of the storage device, including statistics on which statements have been executed recently, how long each stage of the execution process has taken, the memory usage, and other information. The information_schema library stores information about all other databases maintained by the storage device, such as which tables, which views, which triggers, which columns, and which indexes. The sys library can combine the information_schema library and the performance_schema library in the form of views.

[0081] Step 310: The computing device receives the first table shard sent by the storage device.

[0082] Step 311: The computing device saves the first table shard sent by the storage device in the first file.

[0083] It should be noted that the computing device can send a log acquisition request including multiple first table sharding points to the storage device, receive multiple first table shards sent by the storage device in parallel, then sort the multiple first table shards sent by the storage device in parallel according to the sharding order, and save the sorted first table shards in the first file. In this way, the parallel transmission method can improve the efficiency of transmitting the first table shard.

[0084] Step 312: The computing device restores the first file to the data table at the first backup moment.

[0085] Specifically, according to the table shard identifier, multiple table shards belonging to the same table can be restored to a data table.

[0086] Step 313: The computing device sends a log acquisition request including the binary log identifier to the storage device.

[0087] Step 314: The storage device obtains the binary log according to the binary log identifier.

[0088] Step 315: The computing device receives the binary log sent by the storage device.

[0089] The binary log is a logical log that records the statements for updating the database. The statements of the database include data definition language (DDL) and data manipulation language (DML) statements. The binary log file is saved on the disk in binary form and does not contain statements that do not modify any data, such as data query statements (e.g., select statements, show statements), etc.

[0090] Step 316: The computing device replays the data table at the first backup time using the binary log to obtain the data table at the target time point.

[0091] Optionally, step 316 includes: The computing device traverses the database operation statements in the binary log; when the database operation statement includes a table identifier, the computing device replays the data table at the first backup time corresponding to the table identifier according to the database operation statement; when the database operation statement does not include a table identifier, the computing device does not execute the database operation statement. In this way, the database operation statements can be obtained one by one, and then the data table can be replayed using the database operation statements to obtain the data of the data table at the target time point. For other tables, since the data of other tables is not obtained, skipping the replay means not modifying other tables, preventing errors in the data of other tables.

[0092] Another option is that step 316 includes: The computing device obtains the database operation statements including table identifiers from the binary log, caches the obtained database operation statements in chronological order; reads the database operation statements from the cache in sequence and replays the data table using the read database operation statements, thereby obtaining the data table at the target time point. In this way, the database operation statements related to the data table can be executed in a pipeline manner without the need to make a judgment before executing each database operation statement, so the replay speed can be improved.

[0093] In this embodiment, data recovery can be performed according to the table shards corresponding to the data table, without downloading the backup data of other data tables in the database, thereby improving the efficiency of recovering the data table.

[0094] Before restoring the table, the present application needs to record the sharding positions of the data table during the backup process. The following introduces the backup process of the table. Refer to Figure 5 , in one embodiment, the table recovery method of the present application further includes:

[0095] Step 501: The computing device backs up all the data tables at the first backup time as the first backup file.

[0096] In this embodiment, the computing device can perform backup at one or more backup time points. For example, the computing device backs up all data tables of the database instance as a first backup file at the first backup time, and the data table corresponds to one or more first table fragments in the first backup file.

[0097] Step 502: The computing device records the table fragment identifier and the first table fragment location of the first table fragment in the first backup file in the first metadata file. The first table fragment location is the offset address of the first table fragment in the storage device.

[0098] Step 503: The computing device sends the first backup file and the first metadata file to the storage device.

[0099] Step 504: The storage device stores the first backup file and the first metadata file.

[0100] Specifically, the storage device may store the first backup file and the first metadata file in a folder according to the same path.

[0101] In this embodiment, after backing up all data tables of the database, the locations of the table fragments are recorded to facilitate restoring the specified table.

[0102] For ease of understanding, the following Figure 6 For an introduction to the table backup process and data transferred during table recovery in this application, see Figure 6 In one example, the table backup and recovery method of the present application includes:

[0103] Step 601 : The computing device 210 sends the metadata file and the table fragments tb1 to tb10 to the storage device 200 .

[0104] After receiving the instruction to back up the database, the computing device 210 backs up the data table of the database. Taking tb1 to tb10 as an example, the computing device 210 sends the metadata file and the table shards of tb1 to tb10 to the storage device 200. In the metadata file, the table shard identifiers of tb1 include tb1_001, tb1_002 and tb1_003, and their corresponding table shard sites are 0, 65536, and 131072, respectively; the table shard identifiers of tb2 include tb2_001 and tb2_002, and their corresponding table shard sites are 196608 and 262144, respectively; the table shard identifiers of tb10 include tb10_001 and tb10_002, and their corresponding table shard sites are 6553600 and 6619136, respectively; and the same can be applied to other tables.

[0105] Step 602 : The storage device 200 sends the metadata file to the computing device 210 .

[0106] Step 603: The storage device 200 sends the table shards of tb1, the table shards of tb2, and the binary log to the computing device 210.

[0107] Taking the Figure 4 shown table as an example, after the storage device 200 sends the metadata file to the computing device 210, the computing device sequentially sends a shard acquisition request and a log acquisition request to the storage device 200 according to the Figure 4 shown table identifier. The storage device 200 sends the table shards of tb1, the table shards of tb2, and the binary log to the computing device 120 according to the above requests. The table shards of tb1 include tb1 shard 1, tb1 shard 2, tb1 shard 3, tb2 shard 1, and tb2 shard 2.

[0108] After receiving the table shards of tb1 and the table shards of tb2, the computing device 210 restores tb1 and tb2 based on the table shards of tb1 and the table shards of tb2, and then replays tb1 and tb2 according to the binary log to obtain tb1 and tb2 at 2023 / 11 / 20 11:00:00.

[0109] When the first backup time is the most recent backup time, the storage device can obtain the table shards at the most recent backup and send them to the computing device. The computing device has fewer steps to execute during replay and can quickly perform table-level point-in-time recovery. If the most recent backup file is damaged, the storage device can also obtain the table shards in the penultimate backup file or the table shards at other times and send them to the computing device, so that table-level point-in-time recovery can still be performed when a failure occurs. The following is an introduction to it:

[0110] In another optional embodiment, the table recovery method of the present application further includes: after the computing device detects an abnormality in the table shard sent by the storage device, it sends a failure message to the management device, receives the second backup file identifier, table identifier, and log identifier sequence sent by the management device, and then the computing device obtains the second metadata identifier according to the second backup file identifier, sends a metadata acquisition request including the second metadata identifier to the storage device, receives the second metadata file sent by the storage device, and obtains the second table shard position from the second metadata file according to the table identifier; obtains the second table shard position from the second metadata file, sends a shard acquisition request including the second table shard position to the storage device, the storage device obtains the second table shard according to the second table shard position, sends the second table shard to the computing device, the computing device saves the second table shard sent by the storage device in a second file, restores the second file to the data table at the second backup time, and then the computing device sends an acquisition log request including the log identifier sequence to the storage device, the storage device obtains the binary log sequence according to the log identifier sequence and then sends the binary log sequence to the computing device, and the computing device uses the binary log sequence to replay the data table at the second backup time to obtain the data table at the target time point.

[0111] In this embodiment, the computing device can determine whether the table shard is abnormal according to the checksum of the table shard. When the table shard checksum of the metadata file is the same as the checksum calculated for the table shard, it is determined that the table shard is correct; when the table shard checksum of the metadata file is different from the checksum calculated for the table shard, it is determined that the table shard is abnormal. The failure message is used to indicate that a failure has occurred in the first backup file, and the management device can obtain an earlier backup file (such as the backup file at the second backup time) according to the failure message. The log identifier sequence includes binary log identifiers from the second backup time to the target time point. Based on the log identifier sequence, the binary log from the second backup time to the target time point can be obtained. The binary log is selected from the binary log sequence in chronological order, and the binary log is used to replay the data table at the second backup time. The replay steps can refer to the corresponding records in the previous text. The second backup time is earlier than the first backup time, so that early table shards can be selected for table time point recovery, improving the reliability of table time point recovery.

[0112] The device for implementing the table recovery method of the present application will be introduced below. Refer to Figure 7, this application provides a computing device 210, which includes a communication module 701 and a data recovery module 702. The communication module 701 is configured to receive a first backup file identifier, a table identifier, and a binary log identifier sent by a management device; determine a first metadata identifier according to the first backup file identifier; send a metadata acquisition request including the first metadata identifier to a storage device; receive a first metadata file sent by the storage device; the data recovery module 702 is configured to obtain a first table shard position from the first metadata file according to the table identifier; the communication module 701 is further configured to send a shard acquisition request including the first table shard position to the storage device; receive a first table shard sent by the storage device, and the data recovery module 702 is further configured to save the first table shard sent by the storage device in a first file, and restore the first file to a data table at a first backup time; the communication module 701 is further configured to send a log acquisition request including the binary log identifier to the storage device; receive a binary log sent by the storage device, and the data recovery module 702 is further configured to replay the binary log on the data table at the first backup time to obtain a data table at a target time point.

[0113] In some possible implementation manners, the data recovery module 702 is further configured to back up all data tables as a first backup file; record the table shard identifier and the first table shard position of the first table shard in the first backup file in the first metadata file, and the communication module 701 is further configured to send the first backup file and the first metadata file to the storage device.

[0114] In some possible implementation manners, the data recovery module 702 is specifically configured to search for a table shard identifier including the table identifier in the first metadata file; determine a first table shard position corresponding to the table shard identifier in the first metadata file.

[0115] In some possible implementation manners, the communication module 701 is specifically configured to, when the shard acquisition request includes a plurality of first table shard positions, receive a plurality of first table shards sent by the storage device in parallel; the data recovery module 702 is specifically configured to sort the plurality of first table shards sent by the storage device in parallel according to the shard order, and save the sorted first table shards in a first file.

[0116] In some possible implementation manners, the data recovery module 702 is specifically configured to traverse the database operation statements of the binary log; when the database operation statement includes the table identifier, replay the database operation statement on the data table at the first backup time corresponding to the table identifier; when the database operation statement does not include the table identifier, do not execute the database operation statement.

[0117] In some possible implementation manners, the data recovery module 702 is specifically configured to obtain database operation statements including table identifiers from the binary log, cache the obtained database operation statements in chronological order; sequentially read the database operation statements from the cache; and replay the data table at the first backup time using the read database operation statements.

[0118] In some possible implementation manners, the communication module is further configured to, after the data recovery module detects an abnormal table sharding sent by the storage device, send a fault message to the management device; receive a second backup file identifier, a table identifier, and a log identifier sequence sent by the management device, and obtain a second metadata identifier corresponding to the second backup file identifier; send a metadata acquisition request including the second metadata identifier to the storage device; receive a second metadata file sent by the storage device; the data recovery module 702 is further configured to obtain a second table sharding position from the second metadata file; the communication module 701 is further configured to send a sharding acquisition request including the second table sharding position to the storage device, and receive a second table sharding sent by the storage device; the data recovery module 702 is further configured to save the second table sharding sent by the storage device in a second file, and restore the second file to the data table at the second backup time; the communication module 701 is further configured to send a log acquisition request including the log identifier sequence to the storage device; receive a binary log sequence sent by the storage device, and the data recovery module 702 is further configured to replay the data table at the second backup time using the binary log sequence to obtain the data table at the target time point.

[0119] Refer to Figure 8 In this application, a storage device 200 is provided, which includes a communication module 801 and a database management module 802; the communication module 801 is configured to receive a metadata acquisition request including a first metadata identifier sent by a computing device; the database management module 802 is configured to determine a first metadata file according to the first metadata identifier; the communication module 801 is further configured to send the first metadata file to the computing device; receive a sharding acquisition request including a first table sharding position sent by the computing device, and the database management module 802 is further configured to obtain a first table sharding corresponding to the first table sharding position; the communication module 801 is further configured to send the first table sharding to the computing device; the communication module 801 is further configured to receive a log acquisition request including a binary log identifier sent by the computing device; the database management module 802 is further configured to obtain a binary log according to the binary log identifier; the communication module 801 is further configured to send the binary log to the computing device.

[0120] In some possible implementation manners, the communication module 801 is further configured to receive a first backup file and a first metadata file sent by the computing device, and the database management module 802 is further configured to store the first backup file and the first metadata file.

[0121] In some possible implementations, the communication module 801 is further configured to receive a metadata acquisition request including a second metadata identifier sent by the computing device; the database management module 802 is further configured to determine a second metadata file according to the second metadata identifier; the communication module 801 is further configured to send the second metadata file to the computing device; the communication module 801 is further configured to receive a shard acquisition request including a second table sharding point sent by the computing device; the database management module 802 is further configured to obtain a second table shard corresponding to the second table sharding point; the communication module 801 is further configured to send the second table shard to the computing device; receive a log acquisition request including a log identifier sequence sent by the computing device; the database management module 802 is further configured to obtain a binary log sequence corresponding to the log identifier sequence; the communication module 801 is further configured to send the binary log sequence to the computing device.

[0122] Figure 7 For the glossary of terms, the steps performed by each module, and the technical effects in the illustrated embodiments, reference may be made to Figure 3 the corresponding descriptions in the illustrated embodiments.

[0123] Figure 8 For the glossary of terms, the steps performed by each module, and the technical effects in the illustrated embodiments, reference may be made to Figure 3 the corresponding descriptions in the illustrated embodiments.

[0124] This application further provides a cloud service system, which includes Figure 7 the computing device 210 in the illustrated embodiment, and Figure 8 the storage device 200 in the illustrated embodiment.

[0125] This application further provides a computing device 900. As Figure 9 shown, the computing device 900 includes: a bus 902, a processor 904, a memory 906, and a communication interface 908. The processor 904, the memory 906, and the communication interface 908 communicate with each other through the bus 902. The computing device 900 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 900.

[0126] The bus 902 may be a PCI bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 9 only one line is shown herein, but it does not mean that there is only one bus or one type of bus. The bus 904 may include a path for transmitting information between various components (for example, the memory 906, the processor 904, the communication interface 908) of the computing device 900.

[0127] The processor 904 may include any one or more of processors such as a central processing unit (CPU), a GPU, a micro processor (MP), or a digital signal processor (DSP). The processor 904 may perform calculations or processing on data, such as metadata management, deduplication, data compression, virtualized storage space, and address translation.

[0128] The memory 906 may include a volatile memory, such as a random access memory (RAM). The processor 904 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0129] In some embodiments, executable program code is stored in the memory 906, and the processor 904 executes the executable program code to respectively implement the functions of the foregoing data recovery module 702, thereby implementing the table recovery method. In other embodiments, executable program code is stored in the memory 906, and the processor 904 executes the executable program code to respectively implement the functions of the foregoing database management module 802, thereby implementing the table recovery method. That is, instructions for executing the table recovery method are stored on the memory 906.

[0130] The communication interface 908 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network. In some embodiments, the communication interface 908 may implement the functions of the communication module 701 under the control of the processor 904. In other embodiments, the communication interface 908 may implement the functions of the communication module 801 under the control of the processor 904.

[0131] The embodiments of the present application further provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device 900 may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device 900 may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0132] As Figure 10As shown, the computing device cluster includes at least one computing device 900. Instructions for executing the table recovery method may be stored in the memory 906 of one or more computing devices 900 in the computing device cluster.

[0133] In some possible implementations, partial instructions for executing the table recovery method may also be stored separately in the memory 906 of one or more computing devices 900 in the computing device cluster. In other words, the combination of one or more computing devices 900 can jointly execute the instructions for executing the table recovery method.

[0134] It should be noted that the memories 906 in different computing devices 900 in the computing device cluster can store different instructions, respectively for executing partial functions of the cloud service system. That is, the instructions stored in the memories 906 of different computing devices 900 can implement the functions of one or more of the computing device 210 and the storage device 200.

[0135] In some possible implementations, one or more computing devices in the computing device cluster can be connected through a network. Among them, the network can be a wide area network or a local area network, etc. Figure 11 A possible implementation is shown. As Figure 11 shown, two computing devices 900A and 900B are connected through a network. Specifically, they are connected to the network through the communication interfaces in each computing device. In this type of possible implementation, the memory 906 in the computing device 900A stores instructions for executing the functions of the data recovery module 702. At the same time, the memory 906 in the computing device 900B stores instructions for executing the functions of the database management module 802.

[0136] Figure 11 The connection method between the computing device clusters shown may be considered that since the table recovery method provided in this application requires a large amount of data storage, the functions implemented by the storage device 200 are considered to be executed by the computing device 900B. It should be understood that Figure 11 the functions of the computing device 900A shown in it can also be completed by multiple computing devices 900. Similarly, the functions of the computing device 900B can also be completed by multiple computing devices 900.

[0137] The embodiments of this application also provide a computer program product containing instructions. The computer program product can be software or a program product containing instructions that can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, it causes at least one computing device to execute the table recovery method.

[0138] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center including one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive), etc. The computer-readable storage medium includes instructions that direct the computing device to execute the table recovery method, or direct the computing device to execute the table recovery method.

[0139] The terms "first", "second", etc. in the description, claims and drawings of the present application 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 interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order different from that shown or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0140] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A table recovery method, characterized in that, The method is applied to a computing device of a cloud service system, and the method includes: The computing device receives a first backup file identifier, a table identifier, and a binary log identifier sent by a management device; The computing device obtains a first metadata identifier corresponding to the first backup file identifier; The computing device sends a metadata acquisition request including the first metadata identifier to the storage device; The computing device receives a first metadata file sent by the storage device; The computing device obtains a first table sharding position from the first metadata file according to the table identifier; The computing device sends a sharding acquisition request including the first table sharding position to the storage device; The computing device receives a first table shard sent by the storage device, where the first table shard is obtained by the storage device according to the first table sharding position; The computing device saves the first table shard sent by the storage device in a first file; The computing device restores the first file to a data table at a first backup time; The computing device sends a log acquisition request including the binary log identifier to the storage device; The computing device receives a binary log sent by the storage device; The computing device replays the data table at the first backup time using the binary log to obtain a data table at a target time point.

2. The method according to claim 1, characterized in that, Before the computing device receives the first backup file identifier, the table identifier, and the binary log identifier sent by the management device, the method further includes: The computing device backs up all data tables at the first backup time as a first backup file, where the data tables at least correspond to one first table shard in the first backup file; The computing device records the table sharding identifier of the first table shard and the first table sharding position in the first metadata file, where the first table sharding position is the offset address of the first table shard in the storage device; The computing device sends the first backup file and the first metadata file to the storage device.

3. The method according to claim 1, wherein The computing device obtaining the first table sharding position from the first metadata file according to the table identifier includes: The computing device searches for a table sharding identifier including the table identifier in the first metadata file; The computing device determines the first table sharding position corresponding to the table sharding identifier in the first metadata file.

4. The method according to claim 1, wherein The sharding acquisition request includes a plurality of first table sharding positions; The computing device receiving the first table shard sent by the storage device includes: the computing device receives a plurality of first table shards sent by the storage device in parallel; The computing device saving the first table shard sent by the storage device in a first file includes: the computing device sorts the plurality of first table shards sent by the storage device in parallel according to the sharding order, and saves the sorted first table shards in the first file.

5. The method according to any one of claims 1 to 4, characterized in that, The computing device using the binary log to replay the data table at the first backup time includes: The computing device traverses the database operation statements of the binary log; When the database operation statement includes the table identifier, the computing device replays the data table at the first backup time according to the database operation statement; When the database operation statement does not include the table identifier, the computing device does not execute the database operation statement.

6. The method according to any one of claims 1 to 4, characterized in that The computing device using the binary log to replay the data table at the first backup time includes: The computing device obtains a database operation statement including a table identifier from the binary log; The computing device caches the obtained database operation statements in chronological order; The computing device sequentially reads the database operation statements from the cache; The computing device replays the data table at the first backup time using the read database operation statement.

7. The method according to any one of claims 1 to 4, characterized in that The method further includes: After the computing device detects an abnormal table sharding sent by the storage device, it sends a failure message to the management device; The computing device receives a second backup file identifier, a table identifier, and a log identifier sequence sent by the management device, where the log identifier sequence includes binary log identifiers from the second backup time to the target time point, and the second backup time is earlier than the first backup time; The computing device obtains a second metadata identifier corresponding to the second backup file identifier; The computing device sends a metadata acquisition request including the second metadata identifier to the storage device; The computing device receives a second metadata file sent by the storage device, and the second metadata file corresponds to the second metadata identifier; The computing device obtains a second table sharding site from the second metadata file according to the table identifier; The computing device sends a sharding acquisition request including the second table sharding site to the storage device; The computing device receives a second table sharding sent by the storage device, and the second table sharding is obtained by the storage device according to the second table sharding site; The computing device saves the second table sharding sent by the storage device in a second file; The computing device restores the second file to the data table at the second backup time; The computing device sends a log acquisition request including the log identifier sequence to the storage device; The computing device receives a binary log sequence sent by the storage device, and the binary log sequence corresponds to the log identifier sequence; The computing device replays the data table at the second backup time using the binary log sequence to obtain the data table at the target time point.

8. A table recovery method, characterized in that, The method is applied to a storage device of a cloud service system, and the method includes: The storage device receives a metadata acquisition request including a first metadata identifier sent by the computing device; The storage device determines a first metadata file according to the first metadata identifier; The storage device sends the first metadata file to the computing device; The storage device receives a sharding acquisition request including a first table sharding site sent by the computing device; The storage device obtains a first table sharding corresponding to the first table sharding site; The storage device sends the first table sharding to the computing device; The storage device receives a log acquisition request including a binary log identifier sent by the computing device; The storage device acquires a binary log according to the binary log identifier; The storage device sends the binary log to the computing device.

9. The method according to claim 8, wherein The method further includes: The storage device receives a first backup file and a first metadata file sent by the computing device, and the first metadata file includes a first table sharding position; The storage device stores the first backup file and the first metadata file.

10. The method according to claim 8 or 9, characterized in that, The method further includes: The storage device receives a metadata acquisition request including a second metadata identifier sent by the computing device; The storage device determines a second metadata file according to the second metadata identifier; The storage device sends the second metadata file to the computing device; The storage device receives a sharding acquisition request including a second table sharding position sent by the computing device; The storage device acquires a second table shard corresponding to the second table sharding position; The storage device sends the second table shard to the computing device. The storage device receives a log acquisition request including a log identifier sequence sent by the computing device; The storage device acquires a binary log sequence corresponding to the log identifier sequence; The storage device sends the binary log sequence to the computing device.

11. A computing device, characterized in that, Including: A communication module, configured to receive a first backup file identifier, a table identifier, and a binary log identifier sent by a management device; Acquire a first metadata identifier corresponding to the first backup file identifier; Send a metadata acquisition request including the first metadata identifier to the storage device; Receive a first metadata file sent by the storage device; A data recovery module, configured to acquire a first table sharding position from the first metadata file according to the table identifier; The communication module is further configured to send a sharding acquisition request including the first table sharding position to the storage device; receive a first table shard sent by the storage device, and the first table shard is acquired by the storage device according to the first table sharding position; The data recovery module is further configured to save the first table shard sent by the storage device in a first file, and restore the first file to a data table at a first backup time; The communication module is further configured to send a log acquisition request including a binary log identifier to the storage device; receive a binary log sent by the storage device; The data recovery module is further configured to replay the binary log on the data table at the first backup time to obtain a data table at a target time point.

12. The device according to claim 11, wherein The data recovery module is further configured to back up all data tables at the first backup time as a first backup file, and the data tables at least correspond to one first table shard in the first backup file; Record the table sharding identifier of the first table shard and the first table sharding position in the first metadata file, and the first table sharding position is the offset address of the first table shard in the storage device; The communication module is further configured to send the first backup file and the first metadata file to the storage device.

13. The device according to claim 11, wherein The data recovery module is specifically configured to search for a table shard identifier including the table identifier in the first metadata file; determine a first table shard position corresponding to the table shard identifier in the first metadata file.

14. The device according to claim 11, characterized in that, The communication module is specifically configured to receive a plurality of first table shards sent by the storage device in parallel when the shard acquisition request includes a plurality of the first table shard positions. The data recovery module is specifically configured to sort the plurality of first table shards sent by the storage device in parallel according to the shard order, and save the sorted first table shards in a first file.

15. The device according to any one of claims 11 to 14, characterized in that, The data recovery module is specifically configured to traverse the database operation statements of the binary log; when the database operation statement includes the table identifier, replay the data table at the first backup time according to the database operation statement. When the database operation statement does not include the table identifier, the database operation statement is not executed.

16. The device according to any one of claims 11 to 14, characterized in that, The data recovery module is specifically configured to obtain database operation statements including the table identifier from the binary log, cache the obtained database operation statements in chronological order; sequentially read the database operation statements from the cache; and replay the data table at the first backup time using the read database operation statements.

17. The device according to any one of claims 11 to 14, characterized in that, The communication module is further configured to send a failure message to the management device when the data recovery module detects an abnormality in the table shard sent by the storage device; receive a second backup file identifier, a table identifier, and a log identifier sequence sent by the management device, where the log identifier sequence includes binary log identifiers from a second backup time to a target time point, and the second backup time is earlier than the first backup time. Obtain a second metadata identifier corresponding to the second backup file identifier. Send a metadata acquisition request including the second metadata identifier to the storage device. Receive a second metadata file sent by the storage device. The data recovery module is further configured to obtain a second table shard position from the second metadata file. The communication module is further configured to send a shard acquisition request including the second table shard position to the storage device; receive a second table shard sent by the storage device, where the second table shard is obtained by the storage device according to the second table shard position. The data recovery module is further configured to save the second table shard sent by the storage device in a second file, and restore the second file to the data table at the second backup time. The communication module is further configured to send a log acquisition request including the log identifier sequence to the storage device; receive a binary log sequence sent by the storage device, where the binary log sequence corresponds to the log identifier sequence. The data recovery module is further configured to replay the data table at the second backup time using the binary log sequence to obtain the data table at the target time point.

18. A storage device, characterized in that, Including: A communication module, configured to receive a metadata acquisition request including a first metadata identifier sent by the computing device. A database management module, configured to determine a first metadata file according to the first metadata identifier; The communication module is further configured to send the first metadata file to the computing device; receive a shard request including a first table sharding position sent by the computing device; The database management module is further configured to obtain a first table shard corresponding to the first table sharding position; The communication module is further configured to send the first table shard to the computing device; receive a log request including a binary log identifier sent by the computing device; The database management module is further configured to obtain a binary log according to the binary log identifier; The communication module is further configured to send the binary log to the computing device.

19. The apparatus according to claim 18, wherein The communication module is further configured to receive a first backup file and the first metadata file sent by the computing device, and the first metadata file includes the first table sharding position; The database management module is further configured to store the first backup file and the first metadata file.

20. The apparatus according to claim 18 or 19, wherein The communication module is further configured to receive a metadata request including a second metadata identifier sent by the computing device; The database management module is further configured to determine a second metadata file according to the second metadata identifier; The communication module is further configured to send the second metadata file to the computing device; The communication module is further configured to receive a shard request including a second table sharding position sent by the computing device; The database management module is further configured to obtain a second table shard corresponding to the second table sharding position; The communication module is further configured to send the second table shard to the computing device; receive a log request including a log identifier sequence sent by the computing device; The database management module is further configured to obtain a binary log sequence corresponding to the log identifier sequence; The communication module is further configured to send the binary log sequence to the computing device.

21. A cloud service system, characterized in that, Comprising a computing device according to any one of claims 11 to 17 and a storage device according to any one of claims 18 to 20.

22. A cluster of computing devices, characterized in that, Comprising at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 10.

23. A computer-readable storage medium, characterized in that, Comprising computer program instructions, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 10.

24. A computer program product comprising instructions, characterized in that, When the instructions are run by a computing device cluster, the computing device cluster is caused to execute the method according to any one of claims 1 to 10.