Method and device for backing up data table, electronic equipment and storage medium

CN114048069BActive Publication Date: 2026-08-11BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]本公开提供了一种备份数据表的方法、装置、电子设备及存储介质,以至少解决相关技术中数据库的备份恢复效率低下、数据备份效果差的技术问题

Benefits of technology

[0010]在本公开中,通过获取待备份数据信息;基于待备份数据信息向第一存储设备发送第一备份消息,以及向第二存储设备发送第二备份消息;其中,第一存储设备上设置有多个后端进程,第一备份消息用于请求第一存储设备通过多个后端进程将待备份数据表副本上传至第二存储设备,第二存储设备用于在第一存储设备发生异常时,对第一存储设备进行数据恢复,第二备份消息中携带的信息包括:待备份数据表副本对应的元数据,达到了快速准确地备份、恢复数据的目的,实现了提高数据库的备份恢复效率和备份数据准确性的效果,从而解决了相关技术中数据库的备份恢复效率低下、数据备份效果差的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048069B_ABST
    Figure CN114048069B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, electronic device, and storage medium for backing up data tables, relating to the field of computer technology, and particularly to the field of cloud storage technology, to at least solve the technical problems of low backup and recovery efficiency and poor data backup effect of databases in related technologies. The specific implementation scheme is as follows: obtaining data information to be backed up; sending a first backup message to a first storage device and a second backup message to a second storage device based on the data information to be backed up; wherein, the first storage device is equipped with multiple backend processes, the first backup message is used to request the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes, the second storage device is used to perform data recovery on the first storage device when an anomaly occurs, and the information carried in the second backup message includes: metadata corresponding to the copy of the data table to be backed up.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, further to the field of cloud storage technology, and in particular to a method, apparatus, electronic device, and storage medium for backing up data tables. Background Technology

[0002] With the development of big data, more and more enterprises are adopting distributed databases for data backup to ensure data security. In the event of major incidents such as full cluster outages or regional disasters that cannot be recovered online, it is crucial to know how to quickly and accurately restore the cluster offline to continue providing services to users.

[0003] The existing approach involves backing up the database by dumping Structured Query Language (SQL) statements and then restoring the database by injecting offline SQL statements. However, this approach consumes a significant amount of time during data backup and recovery, and the backed-up and restored data are not always completely consistent, resulting in poor data backup performance. Summary of the Invention

[0004] This disclosure provides a method, apparatus, electronic device, and storage medium for backing up data tables, to at least solve the technical problems of low backup and recovery efficiency and poor data backup effect of databases in related technologies.

[0005] According to one aspect of this disclosure, a method for backing up a data table is provided, comprising: obtaining data information to be backed up; sending a first backup message to a first storage device based on the data information to be backed up; and sending a second backup message to a second storage device; wherein, the first storage device is configured with multiple backend processes, the first backup message is used to request the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes, the second storage device is used to perform data recovery on the first storage device when an anomaly occurs, and the information carried in the second backup message includes: metadata corresponding to the copy of the data table to be backed up.

[0006] According to another aspect of this disclosure, an apparatus for backing up a data table is provided, comprising: an acquisition module for acquiring data information to be backed up; and a backup module for sending a first backup message to a first storage device and a second backup message to a second storage device based on the data information to be backed up; wherein the first storage device is provided with multiple backend processes, the first backup message is used to request the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes, the second storage device is used to perform data recovery on the first storage device when an anomaly occurs, and the information carried in the second backup message includes metadata corresponding to the copy of the data table to be backed up.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method for backing up a data table as proposed in this disclosure.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method for backing up a data table as proposed in this disclosure.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that is executed by a processor using a method for backing up a data table as disclosed in this disclosure.

[0010] In this disclosure, data to be backed up is obtained; a first backup message is sent to a first storage device based on the data to be backed up, and a second backup message is sent to a second storage device. The first storage device has multiple backend processes configured. The first backup message requests the first storage device to upload a copy of the data table to be backed up to the second storage device through these backend processes. The second storage device is used to recover data from the first storage device in the event of an anomaly. The second backup message carries metadata corresponding to the copy of the data table to be backed up. This achieves the goal of fast and accurate data backup and recovery, improving the efficiency and accuracy of database backup and recovery, thereby solving the technical problems of low database backup and recovery efficiency and poor data backup effect in related technologies.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0013] Figure 1 This is a schematic diagram of a distributed database backup and recovery method in the prior art;

[0014] Figure 2 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for backing up a data table according to an embodiment of the present disclosure;

[0015] Figure 3 This is a flowchart of a method for backing up a data table according to an embodiment of the present disclosure;

[0016] Figure 4 This is a schematic diagram illustrating a process for backing up a data table according to an embodiment of the present disclosure;

[0017] Figure 5 This is a schematic diagram illustrating a process for restoring a data table according to an embodiment of the present disclosure;

[0018] Figure 6 This is a structural block diagram of an apparatus for backing up a data table according to an embodiment of the present disclosure. Detailed Implementation

[0019] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] In the event of a major incident such as a complete cluster outage or a regional disaster that cannot be recovered online, rapid and accurate offline cluster recovery is essential to ensure that the services provided to users are not severely affected.

[0022] To perform offline data recovery, the existing solution involves backing up the database by dumping SQL statements and then restoring the database by injecting offline SQL statements. Figure 1 This is a schematic diagram of a distributed database backup and recovery method in the prior art. Figure 1As shown, when backing up a database, the SQL statements are dumped to the local file system. Generally, this dumping process is time-consuming and consumes significant computer resources. In the event of a major incident that cannot be recovered online, the local file system sends the dumped SQL statements to a distributed file system, which then re-implants the SQL statements back into the database. Offline SQL statement re-implantation also consumes considerable time, and this method of combining SQL statement dumping with SQL statement re-implantation cannot guarantee that the recovered data is completely consistent with the backup data.

[0023] Existing database backup and recovery solutions are time-consuming and suffer from low backup and recovery efficiency and poor data backup results.

[0024] According to embodiments of this disclosure, a method for backing up a data table is provided. It should be noted that the steps shown in the flowcharts in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0025] The method embodiments provided in this disclosure can be performed in a mobile terminal, computer terminal, or similar electronic device. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the disclosure described and / or claimed herein. Figure 2 A hardware block diagram of a computer terminal (or mobile device) for implementing a method for backing up data tables is shown.

[0026] like Figure 2 As shown, the computer terminal 200 includes a computing unit 201, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 202 or a computer program loaded from a storage unit 208 into a random access memory (RAM) 203. The RAM 203 may also store various programs and data required for the operation of the computer terminal 200. The computing unit 201, ROM 202, and RAM 203 are interconnected via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0027] Multiple components in computer terminal 200 are connected to I / O interface 205, including: input unit 206, such as keyboard, mouse, etc.; output unit 207, such as various types of monitors, speakers, etc.; storage unit 208, such as disk, optical disk, etc.; and communication unit 209, such as network card, modem, wireless transceiver, etc. Communication unit 209 allows computer terminal 200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0028] The computing unit 201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 201 executes the method of backing up a data table described herein. For example, in some embodiments, the method of backing up a data table can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 208. In some embodiments, part or all of the computer program can be loaded and / or installed on the computer terminal 200 via ROM 202 and / or communication unit 209. When the computer program is loaded into RAM 203 and executed by the computing unit 201, one or more steps of the method of backing up a data table described herein can be performed. Alternatively, in other embodiments, the computing unit 201 can be configured to execute the method of backing up a data table by any other suitable means (e.g., by means of firmware).

[0029] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0030] It should be noted here that, in some optional embodiments, the above... Figure 2The electronic device shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 2 This is only one instance of a specific particular example, and is intended to illustrate the types of components that may exist in the aforementioned electronic devices.

[0031] Under the aforementioned operating environment, this disclosure provides, for example... Figure 3 The method shown can be used to back up data tables. Figure 2 The computer terminal or similar electronic device shown is used for execution. Figure 3 This is a flowchart of a method for backing up a data table according to an embodiment of this disclosure. Figure 3 As shown, the method may include the following steps:

[0032] Step S31: Obtain the data information to be backed up;

[0033] The backup data information mentioned above may include data table range information and data table structure information, which can be used to determine the copy of the data table to be backed up.

[0034] Optionally, the aforementioned data to be backed up can be obtained from the target server, which stores the database's metadata, based on the request message. For example, the backup message can be obtained from the master database by the backup and restore (BR) client based on the request message.

[0035] Specifically, the process of obtaining backup data information can be referred to the further description of the embodiments of this disclosure, and will not be repeated here.

[0036] Step S32: Send a first backup message to the first storage device and a second backup message to the second storage device based on the data to be backed up.

[0037] The first storage device has multiple backend processes. The first backup message requests the first storage device to upload a copy of the data table to be backed up to the second storage device through these backend processes. The second storage device is used to recover data from the first storage device in case of an anomaly. The second backup message carries metadata corresponding to the copy of the data table to be backed up. The metadata also includes data table range information, data table structure information, and backup time.

[0038] According to steps S31 to S32 of this disclosure, the process involves obtaining data information to be backed up; sending a first backup message to a first storage device and a second backup message to a second storage device based on the data information to be backed up; wherein, the first storage device is equipped with multiple backend processes, the first backup message is used to request the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes, the second storage device is used to perform data recovery on the first storage device when an anomaly occurs, and the information carried in the second backup message includes: metadata corresponding to the copy of the data table to be backed up, thereby achieving the purpose of fast and accurate backup and recovery of data, improving the backup and recovery efficiency of the database and the accuracy of the backup data, and thus solving the technical problems of low backup and recovery efficiency and poor data backup effect of the database in related technologies.

[0039] The method for backing up data tables in the above embodiments will be further described below.

[0040] As an optional implementation, the first storage device is a distributed storage device, and the second storage device is a remote object storage device.

[0041] For example, the first storage device mentioned above can be the device where the backend (BE) is located, and the BE has multiple backend processes configured, such as BE1, BE2, and BE3. The second storage device mentioned above can be a remote storage device (BOS).

[0042] As an optional implementation, in step S31, obtaining the information of the data table to be backed up includes:

[0043] Step S311: Send a request message to the target server;

[0044] The request message is used to request the target server to obtain the data information to be backed up. The data information to be backed up includes: data table range information and data table structure information. The data table range information and data table structure information are used to determine the copy of the data table to be backed up.

[0045] Step S312: Receive the backup data information returned by the target server.

[0046] According to steps S311 to S312 of this disclosure, the backup and recovery client can quickly determine the copy of the data table to be backed up by sending a request message to the target server and then receiving the backup data information returned by the target server.

[0047] As an optional implementation, each of the multiple backend processes corresponds to multiple data table replicas, and the state of each data table replica includes one of the following: dominant state, follower state.

[0048] Optionally, if the data table replicas in the follower state and the data table replicas in the master state have the same data content in the same backend process, then only the data table replicas in the master state are backed up during backup, and there is no need to back up the data table replicas in the follower state.

[0049] For example, the first storage device is a BE (Backup Entity). Each BE has multiple backend processes, including BE1, BE2, and BE3. Each BE's backend process corresponds to multiple data table replicas. Each data table replica has a state that can be either leader or follower. For instance, BE1 includes three data table replicas: leader a, follower b, and leader c. When backing up BE1, only leader a and leader c are backed up. BE2 includes three data table replicas: follower a, leader b, and follower c. When backing up BE2, only leader b is backed up. BE3 includes follower a, follower b, and follower c. None of the three data table replicas in BE3 need to be backed up. Follower a has the same data content as leader a, follower b has the same data content as leader b, and follower c has the same data content as leader c.

[0050] As an optional implementation, some or all of the backend processes in a plurality of backend processes are used to convert the dominant copy of the data table to be backed up into a preset format file and upload the preset format file to a second storage device.

[0051] The aforementioned preset format file can be a Sorted Squence Table (SST) file, which converts the backup copy of the data table in its dominant state into a sorted data file. Backing up the data table copy in SST file format can accelerate data recovery and improve the overall backup and recovery efficiency of the database.

[0052] Each time some or all of the backend processes convert the dominant copy of the data table to be backed up into a preset format file and upload the preset format file to the second storage device for backup, the backed-up data is a snapshot of the database on the first storage device at the current backup moment. This means it obtains a mirror image of the entire database at that moment, and backing up the corresponding data tables from this mirror image ensures the accuracy of the backup data. Simultaneously, using some or all backend processes for distributed data backup ensures load balancing and even resource utilization throughout the backup process, further improving the overall backup speed.

[0053] As an optional implementation, the method for backing up data tables disclosed herein further includes:

[0054] Step S33: When an anomaly is detected in the first storage device, metadata is obtained from the second storage device, wherein the metadata includes: data table range information and data table structure information;

[0055] For example, when a major incident such as a full cluster outage or a regional disaster that cannot be recovered online is detected in the first storage device, metadata can be obtained from the second storage device.

[0056] Step S34: Create a new data table on the target server based on metadata.

[0057] According to steps S33 to S34 of this disclosure, when an anomaly is detected in the first storage device, metadata is obtained from the second storage device, and a new data table is created on the target server based on the metadata. This can quickly determine the range of data tables to be recovered and the data table structure information, further improving the efficiency of backup and recovery.

[0058] As an optional implementation, the method for backing up data tables disclosed herein further includes:

[0059] Step S35: Send a download request message to the first storage device;

[0060] The download request message is used to request the first storage device to download a preset format file from the second storage device through multiple backend processes. The preset format file is used to restore the copy of the data table to be backed up.

[0061] As an optional implementation, the method for backing up data tables disclosed herein further includes:

[0062] Step S36: Send an import request message to the first storage device. The import request message is used to request the primary backup data table copy in multiple backend processes to notify the secondary backup data table copy in the follower state to jointly perform the data import operation via log.

[0063] For example, the first storage device is a BE (Backend Execution Unit). Each BE has multiple backend processes, including BE1, BE2, and BE3. Each BE's backend process corresponds to multiple data table replicas, and each data table replica has either a leader state or a follower state. For instance, BE1 includes two data table replicas: leader a and follower b; BE2 includes two data table replicas: follower a and leader b; and BE3 includes two data table replicas: follower a and follower b. Follower a and leader a have the same data content, and follower b and leader b have the same data content. During data recovery, leader a and leader b notify follower a and follower b respectively via logs based on import request messages to jointly perform the data import operation.

[0064] The following is based on Figure 4 The process of backing up data tables in this disclosure will be introduced using an example.

[0065] Figure 4 This is a schematic diagram illustrating a process for backing up a data table according to an embodiment of this disclosure, such as... Figure 4 As shown, the process of backing up a data table includes the following steps:

[0066] Step S41: Send a request message to the target server;

[0067] Step S42: Receive the backup data information returned by the target server;

[0068] Step S43: Send a first backup message to the first storage device based on the data to be backed up;

[0069] Step S44: Send a second backup message to the second storage device based on the data to be backed up;

[0070] Step S45: Convert the copy of the data table to be backed up, which is in the dominant state, into a preset format file and upload the preset format file to the second storage device.

[0071] Through steps S41 to S45 above, by converting the dominant copy of the data table to be backed up in the first storage device into a preset format file by some or all of the backend processes in the first storage device, and uploading the preset format file to the second storage device for backup, the backed-up data is a snapshot of the database of the first storage device at the current backup time, which can ensure the accuracy of the backup data; by distributing the backup of the dominant copy of the data table to be backed up in multiple backend processes, resources can be evenly allocated and used to achieve backup balance.

[0072] The following is based on Figure 5 The process of restoring the data table disclosed herein will be introduced using an example.

[0073] Figure 5 This is a schematic diagram illustrating a process for restoring a data table according to an embodiment of this disclosure, such as... Figure 5 As shown, the process of restoring a data table includes the following steps:

[0074] Step S51: When an anomaly is detected in the first storage device, metadata is obtained from the second storage device;

[0075] Step S52: Create a new data table on the target server based on metadata;

[0076] Step S53: Send a download request message to the first storage device;

[0077] Step S54: The first storage device downloads a preset format file from the second storage device;

[0078] Step S55: Send an import request message to the first storage device;

[0079] In step S56, based on the import request information, the copy of the data table to be backed up in the leading state among multiple backend processes notifies the copy of the data table to be backed up in the following state to jointly perform the data import operation through the log.

[0080] Through steps S51 to S56 above, metadata can be quickly retrieved from the second storage device when the first storage device malfunctions, and a new data table can be created on the target server. This data table is completely consistent with the backup data table. The first storage device downloads the preset format file of the backup from the second storage device based on the download request message. After the download is completed, the first storage device notifies each copy of the backup data table in the leading state to perform the data import operation through the log based on the import request information. This can quickly restore the data of the first storage device, improve the backup and recovery efficiency, and at the same time ensure that the backup and restored data are completely consistent, without affecting the normal service provided to users.

[0081] This disclosure achieves the goal of fast and accurate data backup and recovery by acquiring data information to be backed up; sending a first backup message to a first storage device based on the data information to be backed up; and sending a second backup message to a second storage device. The first storage device is equipped with multiple backend processes. The first backup message requests the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes. The second storage device is used to recover data from the first storage device in the event of an anomaly. The second backup message carries metadata corresponding to the copy of the data table to be backed up. This achieves the goal of improving the efficiency and accuracy of database backup and recovery, thereby solving the technical problems of low database backup and recovery efficiency and poor data backup effect in related technologies.

[0082] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.

[0084] This disclosure also provides an apparatus for backing up data tables, which is used to implement the above embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0085] Figure 6 This is a structural block diagram of an apparatus for backing up a data table according to one embodiment of the present disclosure, such as... Figure 6 As shown, a backup data table device 600 includes: an acquisition module 601 and a backup module 602.

[0086] Module 601 is used to acquire information about the data to be backed up;

[0087] Backup module 602 is used to send a first backup message to a first storage device and a second backup message to a second storage device based on the data to be backed up.

[0088] The first storage device is equipped with multiple backend processes. The first backup message is used to request the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes. The second storage device is used to restore the data of the first storage device when the first storage device fails. The information carried in the second backup message includes the metadata corresponding to the copy of the data table to be backed up.

[0089] Optionally, the first storage device is a distributed storage device, and the second storage device is a remote object storage device.

[0090] Optionally, the acquisition module 601 is used to acquire information about the data table to be backed up, including: sending a request message to the target server, wherein the request message is used to request the target server to acquire the data information to be backed up, the data information to be backed up includes: data table range information and data table structure information, the data table range information and data table structure information are used to determine the copy of the data table to be backed up; and receiving the data information to be backed up returned by the target server.

[0091] Optionally, each of the multiple backend processes corresponds to multiple data table replicas, and the state of each data table replica includes one of the following: dominant state, follower state.

[0092] Optionally, some or all of the backend processes in a plurality of backend processes are used to convert the dominant copy of the data table to be backed up into a preset format file and upload the preset format file to a second storage device.

[0093] Optionally, the acquisition module 601 is further configured to acquire metadata from the second storage device when an anomaly is detected in the first storage device, wherein the metadata includes: data table range information and data table structure information; and create a new data table on the target server based on the metadata.

[0094] Optionally, the backup data table apparatus 600 further includes: a sending unit 603, configured to send a download request message to a first storage device, wherein the download request message is used to request the first storage device to download a preset format file from a second storage device through multiple backend processes, and the preset format file is used to restore a copy of the data table to be backed up.

[0095] Optionally, the sending module 603 is further configured to send an import request message to the first storage device, wherein the import request message is used to request the copy of the data table to be backed up in the leading state among multiple backend processes to notify the copy of the data table to be backed up in the following state to jointly perform the data import operation through a log.

[0096] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0097] According to embodiments of this disclosure, this disclosure also provides an electronic device including a memory and at least one processor, the memory storing computer instructions, the processor being configured to execute the computer instructions to perform the steps in any of the above method embodiments.

[0098] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0099] Optionally, in this disclosure, the processor described above can be configured to perform the following steps via a computer program:

[0100] S1, obtain the data to be backed up;

[0101] S2, based on the data to be backed up, sends a first backup message to the first storage device and a second backup message to the second storage device.

[0102] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0103] According to embodiments of the present disclosure, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to perform the steps in any of the above method embodiments at runtime.

[0104] Optionally, in this embodiment, the aforementioned non-transitory computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0105] S1, obtain the data to be backed up;

[0106] S2, based on the data to be backed up, sends a first backup message to the first storage device and a second backup message to the second storage device.

[0107] Optionally, in this embodiment, the aforementioned non-transitory computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0108] According to embodiments of this disclosure, a computer program product is also provided. Program code for implementing the audio processing methods of this disclosure can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on a machine, partially on a machine, partially on a remote machine as a standalone software package, or entirely on a remote machine or server.

[0109] In the above embodiments of this disclosure, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0110] In the several embodiments provided in this disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0111] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0112] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0113] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0114] The above description is only a preferred embodiment of this disclosure. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of this disclosure, and these improvements and modifications should also be considered within the scope of protection of this disclosure.

Claims

1. A method for backing up a data table, comprising: Send a request message to the target server, wherein the request message is used to request the target server to obtain the data information to be backed up, and the data information to be backed up includes: data table range information and data table structure information; Receive the data to be backed up returned by the target server; Based on the data to be backed up, a first backup message is sent to a first storage device, and a second backup message is sent to a second storage device. The first storage device is a distributed storage device, and the second storage device is a remote object storage device. Multiple backend processes are configured on the first storage device. The first backup message requests the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes. Some or all of the multiple backend processes are used to convert the copy of the data table to be backed up, which is in a dominant state, into a preset format file, and upload the preset format file to the second storage device. The information carried in the second backup message includes: metadata corresponding to the copy of the data table to be backed up; each of the multiple backend processes corresponds to multiple data table copies; and the state corresponding to each data table copy includes one of the following: dominant state, follower state. When an anomaly is detected in the first storage device, the metadata is obtained from the second storage device. The metadata includes data table range information and data table structure information. The data table range information and the data table structure information are used to determine the data table copy to be backed up. A new data table is created on the target server based on the metadata, wherein the new data table is identical to the data table to be backed up; A download request message is sent to the first storage device, wherein the download request message is used to request the first storage device to download a preset format file from the second storage device through the multiple backend processes, and the preset format file is used to restore the copy of the data table to be backed up; Send an import request message to the first storage device, wherein the import request message is used to request the copy of the data table to be backed up in the leading state among the multiple backend processes to notify the copy of the data table to be backed up in the following state to jointly perform the data import operation through the log.

2. An apparatus for backing up a data table, comprising: The acquisition module is used to send a request message to the target server, wherein the request message is used to request the target server to obtain data information to be backed up, the data information to be backed up includes: data table range information and data table structure information; and to receive the data information to be backed up returned by the target server. A backup module is configured to send a first backup message to a first storage device and a second backup message to a second storage device based on the data to be backed up. The first storage device is a distributed storage device, and the second storage device is a remote object storage device. Multiple backend processes are configured on the first storage device. The first backup message requests the first storage device to upload a copy of the data table to be backed up to the second storage device through the multiple backend processes. Some or all of the multiple backend processes are configured to convert the copy of the data table to be backed up, which is in a dominant state, into a preset format file and upload the preset format file to the second storage device. The information carried in the second backup message includes: metadata corresponding to the copy of the data table to be backed up; each of the multiple backend processes corresponds to multiple data table copies; and the state corresponding to each data table copy includes one of the following: dominant state or follower state. The acquisition module is further configured to acquire the metadata from the second storage device when an anomaly is detected in the first storage device. The metadata includes: data table range information and data table structure information. The data table range information and the data table structure information are used to determine the copy of the data table to be backed up. Based on the metadata, a new data table is created on the target server, wherein the new data table is consistent with the data table to be backed up. The device further includes: a sending module, configured to send a download request message to the first storage device, wherein the download request message is configured to request the first storage device to download a preset format file from the second storage device through the plurality of backend processes, and the preset format file is configured to restore the copy of the data table to be backed up; The sending module is further configured to send an import request message to the first storage device, wherein the import request message is configured to request the copy of the data table to be backed up in the dominant state among the multiple backend processes to notify the copy of the data table to be backed up in the follower state to jointly perform the data import operation through a log.

3. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of claim 1.

4. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to claim 1.

5. A computer program product comprising a computer program that, when executed by a processor, implements the method according to claim 1.

Citation Information

Patent Citations

  • Method and apparatus used for storage system

    CN106933698A

  • Data center disaster tolerance method, device and equipment and storage medium

    CN112506702A