Database data parallel backup method and device, database data parallel restoration method and device, equipment and medium

By splitting data blocks and parallelizing backup and restore methods, the performance bottleneck caused by serial execution in existing technologies is solved, thereby improving the efficiency and performance of database backup and restore.

CN121880104APending Publication Date: 2026-04-17SHANGHAI DAMENG DATABASE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing database backup and restore methods are executed serially, which fails to fully utilize the read/write bandwidth of storage devices and the computing power of CPUs, resulting in slow backup and restore operations.

Method used

By splitting the data to be backed up into multiple data blocks, determining the target parallelism based on the number of data blocks and the initial parallelism, creating a backup task thread group, and using the thread group to perform data backup and restoration in parallel, the device's read/write bandwidth and CPU computing power are fully utilized.

Benefits of technology

It enables parallelization of the database backup and restore process, improving overall performance and making full use of equipment resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880104A_ABST
    Figure CN121880104A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a database data parallel backup method and device, a database data parallel restoration method and device, equipment and a medium, and the method comprises the steps that in response to a parallel backup instruction, to-be-backed-up data is obtained; splitting the to-be-backed-up data based on a preset split block size to determine a split data block set; each split data block corresponds to one backup task; determining a target backup parallelism degree according to the total number of the split data block sets and the initial backup parallelism degree; according to the use state of each backup thread in the backup task thread group set, distributing a corresponding target backup task thread group for each backup task; the backup task thread group set is created based on the target backup parallelism degree; and performing data backup on the corresponding split data blocks in parallel by utilizing the target backup task thread groups corresponding to the backup tasks respectively. According to the technical scheme, the read-write bandwidth and the CPU computing power of equipment are fully utilized, and the overall performance of the database backup and restoration process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of database technology, and in particular to a method, apparatus, device, and medium for parallel backup and restoration of database data. Background Technology

[0002] Databases utilize backup and restore for disaster recovery, ensuring data security. During normal database operation, valid data pages are copied from the database files and saved to a backup set. In the event of a database failure, the data is restored to a usable state by restoring the backup set.

[0003] When performing database backup and restore, a common method is to perform the process serially, as follows: 1) During backup, the system first collects information on all data files to be backed up. Then, the system creates a single backup thread to serially load the data files to be backed up, without splitting them, and writes all the data into the backup fragment files of the same backup set. Finally, a metadata file is generated in the backup set to record the backup set information. 2) During restore, the system first parses the metadata file of the backup set to be restored to obtain the backup set information. Then, similarly, a single restore thread serially reads data from the backup set and writes it one by one into the data files under the restore target path.

[0004] However, because this method can only perform backup and restore serially, it fails to fully utilize the read and write bandwidth of storage devices and the computing power of the CPU in most backup and restore scenarios, resulting in slow backup and restore execution. Summary of the Invention

[0005] This disclosure provides a method, apparatus, device, and medium for parallel backup and restoration of database data, which fully utilizes the read / write bandwidth and CPU computing power of the device to improve the overall performance of the data backup and restoration process.

[0006] Firstly, a parallel database backup method is provided, including:

[0007] In response to a parallel backup command, the data to be backed up is acquired; the parallel backup command includes an initial backup parallelism and a preset split block size.

[0008] The data to be backed up is split based on the preset split block size to determine a set of split data blocks; the set of split data blocks includes at least two split data blocks, and each split data block corresponds to a backup task;

[0009] The target backup parallelism is determined based on the total number of split data block sets and the initial backup parallelism.

[0010] Based on the usage status of each backup thread in the backup task thread group set, a corresponding target backup task thread group is assigned to each backup task; the backup task thread group set is created based on the target backup parallelism, and the backup task thread group set includes at least two backup task thread groups;

[0011] The corresponding split data blocks are backed up in parallel using the target backup task thread groups corresponding to each backup task to determine the parallel backup set.

[0012] Secondly, a database parallel backup device is provided, comprising:

[0013] The backup data acquisition module is used to acquire backup data in response to a parallel backup command; the parallel backup command includes an initial backup parallelism and a preset split block size.

[0014] The splitting module is used to split the data to be backed up based on the preset splitting block size to determine a set of split data blocks; the set of split data blocks includes at least two split data blocks, and each split data block corresponds to a backup task;

[0015] The target backup parallelism determination module is used to determine the target backup parallelism based on the total number of split data block sets and the initial backup parallelism.

[0016] The target backup task thread group determination module is used to allocate a corresponding target backup task thread group to each backup task according to the usage status of each backup thread in the backup task thread group set; the backup task thread group set is created based on the target backup parallelism, and the backup task thread group set includes at least two backup task thread groups.

[0017] The data backup module is used to perform parallel data backups on the corresponding split data blocks using the target backup task thread groups corresponding to each of the backup tasks, so as to determine the parallel backup set.

[0018] Thirdly, a parallel data restoration method for databases is provided, including:

[0019] In response to the parallel restore command, the main backup set is obtained according to the restore main backup set path; the main backup set includes the target backup parallelism and the identifiers of each sub-backup set; the parallel restore command includes the restore main backup set path, the restore path, and the initial restore parallelism.

[0020] Each sub-backup set is determined based on its path, and each sub-backup set corresponds to a restore task; wherein, each sub-backup set path is determined based on the restore master backup set path, the target backup parallelism, and the identifier of each sub-backup set.

[0021] The target restoration parallelism is determined based on the total number of sub-backup sets and the initial restoration parallelism.

[0022] Each restoration task is assigned a corresponding target restoration task thread group based on the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups;

[0023] The corresponding sub-backup sets are restored in parallel using the target restoration task thread groups corresponding to each restoration task.

[0024] Fourthly, a parallel data restoration device for databases is provided, comprising:

[0025] The main backup set acquisition module is used to acquire the main backup set according to the main backup set restoration path in response to the parallel restore command; the main backup set includes the target backup parallelism and the identifiers of each sub-backup set; the parallel restore command includes the main backup set restoration path, the restore path, and the initial restore parallelism.

[0026] The restore task determination module is used to determine each sub-backup set according to each sub-backup set path, and each sub-backup set corresponds to a restore task; wherein, each sub-backup set path is determined based on the restore main backup set path, the target backup parallelism, and the identifier of each sub-backup set;

[0027] The target restoration parallelism determination module is used to determine the target restoration parallelism based on the total number of sub-backup sets and the initial restoration parallelism.

[0028] The target restoration task thread group determination module is used to allocate a corresponding target restoration task thread group to each restoration task according to the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups;

[0029] The data restoration module is used to perform parallel data restoration on the corresponding sub-backup sets using the target restoration task thread groups corresponding to each of the restoration tasks.

[0030] Fifthly, an electronic device is provided, comprising:

[0031] At least one processor; and,

[0032] A memory communicatively connected to the at least one processor; wherein,

[0033] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the database data parallel backup method as described in the first aspect above or the database data parallel restoration method as described in the second aspect above.

[0034] In a sixth aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the database data parallel backup method as described in the first aspect above or the database data parallel restoration method as described in the second aspect above.

[0035] In a seventh aspect, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the database parallel backup method as described in the first aspect or the database parallel restoration method as described in the second aspect.

[0036] This disclosure provides a method, apparatus, device, and medium for parallel backup and restoration of database data. The method includes: in response to a parallel backup command, acquiring data to be backed up; the parallel backup command includes an initial backup parallelism and a preset split block size; splitting the data to be backed up based on the preset split block size to determine a set of split data blocks; the set of split data blocks includes at least two split data blocks, each split data block corresponding to a backup task; determining a target backup parallelism based on the total number of split data blocks and the initial backup parallelism; allocating a corresponding target backup task thread group to each backup task based on the usage status of each backup thread in the backup task thread group set; the backup task thread group set is created based on the target backup parallelism and includes at least two backup task thread groups; and using the target backup task thread groups corresponding to each backup task to perform parallel data backup on the corresponding split data blocks to determine a parallel backup set. In this technical solution, after responding to the parallel backup command, the data to be backed up is split into multiple data blocks according to the preset split block size, with each data block corresponding to a backup task. The target backup parallelism is determined based on the initial backup parallelism and the total number of data blocks. Then, a corresponding number of backup task thread groups are created, and each backup task is assigned a thread group according to the thread usage status. This ultimately achieves parallel backup of the data to be backed up, making full use of the device's read / write bandwidth and CPU computing power, and improving the overall performance of the data backup and restore process.

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

[0038] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart of a parallel database backup method provided in Embodiment 1 of this disclosure;

[0040] Figure 2 This is a schematic diagram of a backup process provided in Embodiment 1 of this disclosure;

[0041] Figure 3 This is a flowchart of a parallel database data restoration method provided in Embodiment 2 of this disclosure;

[0042] Figure 4 This is a schematic diagram of a restoration process provided in Embodiment 2 of this disclosure;

[0043] Figure 5 This is a schematic diagram of the structure of a database parallel backup device provided in Embodiment 3 of this disclosure;

[0044] Figure 6 This is a schematic diagram of the structure of a database parallel data restoration device provided in Embodiment 4 of this disclosure;

[0045] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this disclosure. Detailed Implementation

[0046] To enable those skilled in the art to better understand the solutions of the embodiments of this disclosure, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of the embodiments of this disclosure.

[0047] 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.

[0048] Example 1

[0049] Figure 1 This is a flowchart illustrating a parallel database backup method according to Embodiment 1 of this disclosure. This embodiment is applicable to situations where data in a database is backed up in parallel. The method can be executed by a parallel database backup device, which can be implemented in hardware and / or software. This device can be configured in an electronic device, including but not limited to computers, PCs, electronic devices, and servers, which are devices with data processing capabilities. Figure 1 As shown, the method includes:

[0050] S110, in response to the parallel backup command, obtain the data to be backed up; the parallel backup command includes the initial backup parallelism and the preset split block size.

[0051] In this embodiment, during parallel backup, the user can initiate the backup operation using a parallel backup command and specify parameters to control the backup process. The parallel backup command is a user-initiated instruction to begin parallel backup. This command may include an initial backup parallelism and a preset block size. The initial backup parallelism is a user-specified initial parallelism of the backup operation, i.e., the number of threads or tasks performing backup operations simultaneously. During parallel backup, the data to be backed up can be divided into several units of equal size, called blocks. Each block can correspond to a backup task to be executed. The preset block size is a user-specified size for dividing the data to be backed up into multiple blocks, each block being an independent backup unit. For example, if the preset block size is 10MB, the data to be backed up can be divided into multiple 10MB blocks.

[0052] For example, a parallel backup command can be a user-input SQL statement, which includes the initial backup parallelism and a preset split block size. It should be explained that users can also specify the backup set target path, a parallelism greater than 1 (initial backup parallelism), etc., in advance within the SQL statement. Additionally, users can specify parameters such as backup level, split block size, encryption method during backup, and backup piece file size.

[0053] As described above, a parallel backup command can be executed to retrieve the data to be backed up. This data can be information about the data files to be backed up collected from the database file system. For example, if it is a database backup, all data files of the entire database can be collected as the data to be backed up; if it is a tablespace backup, all data files of the specified tablespace can be collected as the data to be backed up.

[0054] S120. Split the data to be backed up based on the preset split block size to determine the set of split data blocks; the set of split data blocks includes at least two split data blocks, and each split data block corresponds to a backup task.

[0055] Specifically, after obtaining the preset split block size, the data to be backed up can be split based on the preset split block size, thereby obtaining a set of split data blocks. The set of split data blocks can include at least two split data blocks, and each split data block can correspond to a backup task.

[0056] It should be noted that each data file can be divided into several blocks according to the preset split block size. The remaining part of the file that is less than the size of a split block can also be divided into a separate block. Each split block can generate a corresponding backup task.

[0057] S130. Determine the target backup parallelism based on the total number of split data block sets and the initial backup parallelism.

[0058] Specifically, after obtaining the set of split data blocks, the total number of split data blocks contained in the set can be counted. For example, the total number = (the size of the data file to be backed up / the size of the split blocks) rounded up. For example, if the total size of the data to be backed up is 100MB and the preset size of the split blocks is 10MB, then the total number of split data blocks is 10 (100MB / 10MB = 10 data blocks).

[0059] As described above, after obtaining the total number of data blocks, the target backup parallelism can be determined by comparing the total number with the size of the initial backup data. This ensures that the actual parallelism does not exceed the actual number of data blocks, avoiding resource waste and ineffective parallel tasks. The target backup parallelism can be the final parallelism calculated based on the actual total number of data blocks and the initial backup parallelism.

[0060] S140. Based on the usage status of each backup thread in the backup task thread group set, assign a corresponding target backup task thread group to each backup task; the backup task thread group set is created based on the target backup parallelism, and the backup task thread group set includes at least two backup task thread groups.

[0061] It is known that after obtaining the target backup parallelism, a set of backup task thread groups can be created based on the target backup parallelism. The set of backup task thread groups can contain at least two backup task thread groups. The number of backup task thread groups can be the same as the target backup parallelism, and each backup task thread group can correspond to a backup set.

[0062] As described above, each backup task can be assigned a corresponding target backup task thread group based on the usage status of each backup thread in the backup task thread group set. Backup tasks are processed in groups, with each task assigned to a specific task thread group, which serves as the target backup task thread group for that task. Each backup task thread group can include a read backup data thread (e.g., READ thread), several backup data processing threads (e.g., PROC thread), and a write backup data thread (e.g., FLUSH thread). The read backup data thread reads the data corresponding to the backup task, the backup data processing threads handle data processing, and the write backup data threads write data. The usage status of each backup thread can include active and inactive (idle) states. Threads can interact via queues, allowing threads within the same thread group to run concurrently in a pipelined manner, improving overall efficiency.

[0063] It's important to note that during parallel backup, when there's only one task thread group in the entire backup task, the backup execution method differs from regular parallel backup. In this case, the backup will proceed in a non-parallel backup mode, and the generated backup set will not contain sub-backup sets. Furthermore, even if the initial backup parallelism setting is greater than 1, if the set partition size is too large, the entire backup task may actually only have one partition, resulting in an actual parallelism of 1. In this situation, although the initial setup intended for parallelism, due to the partition size setting, ultimately only one task thread group participates in the backup.

[0064] S150. Use the target backup task thread group corresponding to each backup task to perform parallel data backup on the corresponding split data blocks to determine the parallel backup set.

[0065] It is known that each backup task corresponds to a backup operation of a split data block. After determining the target backup task thread group for each backup, the split data blocks corresponding to each backup task can be backed up in parallel using the target backup task thread group. This allows us to determine the resulting parallel backup set, which can include a main backup set and various sub-backup sets. The main backup set contains a metadata file that registers information about the entire main backup set and each sub-backup set. The main backup set does not have backup piece files; data is stored in the sub-backup sets. Each sub-backup set can store backup data, and each sub-backup set contains a metadata file and several backup piece files. Backup pieces are files used to store backup data.

[0066] This embodiment provides a parallel database backup method, comprising: acquiring data to be backed up in response to a parallel backup instruction; the parallel backup instruction including an initial backup parallelism and a preset split block size; splitting the data to be backed up based on the preset split block size to determine a set of split data blocks; the set of split data blocks including at least two split data blocks, each split data block corresponding to a backup task; determining a target backup parallelism based on the total number of split data block sets and the initial backup parallelism; allocating a corresponding target backup task thread group to each backup task based on the usage status of each backup thread in the backup task thread group set; the backup task thread group set being created based on the target backup parallelism, and including at least two backup task thread groups; and using the target backup task thread groups corresponding to each backup task to perform parallel data backup on the corresponding split data blocks to determine a parallel backup set. This technical solution achieves parallel backup of the data to be backed up, fully utilizing the device's read / write bandwidth and CPU computing power, and improving the overall performance of the data backup and restoration process.

[0067] As an optional implementation of this embodiment, the target backup task thread group includes a read backup data thread, a backup data processing thread, and a write backup data thread; the step of using the target backup task thread group corresponding to each backup task to perform parallel data backup on the corresponding split data blocks to determine the parallel backup set includes:

[0068] 1) For any backup task, based on the preset package size, the read backup data thread is used to divide the split data block corresponding to the backup task to obtain each first backup package.

[0069] Specifically, the target backup task thread group corresponding to each backup task can be determined based on the usage status of each backup thread in the backup task thread group set. The target backup task thread group can include a read backup data thread, a backup data processing thread, and a write backup data thread. Each backup task can correspond to a target backup task thread group. For each backup task, based on a preset package size, the split data blocks corresponding to the backup task can be segmented using the read backup data thread to obtain various first backup packages. The read backup data thread can be an idle READ thread. The preset package size can be a pre-set package size. The header of each first backup package can include data file information for the split data blocks, which may include tablespace ID, data file ID, backup package start page number, backup package end page number, etc.

[0070] It should be noted that after obtaining each first backup package, the generated first backup packages can be stored sequentially in the PROC queue.

[0071] 2) The backup data processing thread is used to verify and preprocess each first backup package to determine each second backup package.

[0072] In this embodiment, the backup data processing thread can be an idle backup data processing thread, such as an idle PROC thread. The idle backup data processing thread can be used to extract each first backup package stored in the PROC queue, and to perform verification and data processing (e.g., encryption and compression) on each first backup package to determine each second backup package.

[0073] It should be noted that after obtaining each second backup package, the generated second backup packages can be stored sequentially into the FLUSH queue.

[0074] 3) Using the write backup data thread, each second backup package is written to the backup set corresponding to the target backup task thread group to determine each sub-backup set.

[0075] In this embodiment, the write backup thread can be an idle write backup thread, such as an idle FLUSH thread. The idle write backup data thread can be used to sequentially retrieve each processed second backup package from the FLUSH queue. Each target backup task thread group can correspond to a sub-backup set, and each second backup package can be written to the sub-backup set corresponding to the target backup task thread group. By performing the above operations in parallel on each backup task, parallel backup of the data to be backed up is completed.

[0076] 4) Determine the parallel backup set based on each sub-backup set; the parallel backup set includes a main backup set and each sub-backup set, and the main backup set is used to register information of the parallel backup set and each sub-backup set.

[0077] Specifically, after obtaining each sub-backup set, the sub-backup sets can be aggregated to obtain a parallel backup set. The parallel backup set may include a main backup set and each sub-backup set. The main backup set is used to register the information of the parallel backup set and each sub-backup set.

[0078] It's important to note that each sub-backup set stores the data to be backed up using backup piece files, which may have the .bak extension. After processing, the data is stored in the backup piece files of each sub-backup set. Once the sub-backup sets are obtained, they can be aggregated into a master backup set. The master backup set may include a metadata file, which records information about the master backup set and each sub-backup set, and has the .meta extension. The metadata file provides information about the entire parallel backup set, including the backup data files, backup pieces, the master backup set, and each sub-backup set. It's worth noting that the master backup set does not have backup piece files; all data is stored in the sub-backup sets. Each sub-backup set contains a metadata file and several backup piece files.

[0079] As described above, the path to the primary backup set can be the path specified by the user when initiating parallel backups. The paths to each sub-backup set within the primary backup set can be determined by the primary backup set path, backup name, and sub-backup set ID. For example, the sub-backup set ID is 0. (Parallelism minus 1), use the primary backup set path concatenated with the backup name and sub-backup set ID as the path for each backup set, i.e. Primary backup set path / Backup name Sub-backup set ID For example, if the primary backup set path is / home / bak and the parallelism is 2, then the primary backup set includes 2 sub-backup sets, and the paths of each sub-backup set can be represented as / home / bak / bak_0 and / home / bak / bak_1.

[0080] Taking a backup task as an example, Figure 2 This embodiment provides a schematic diagram of a backup process, such as... Figure 2As shown, 1) Select an idle READ thread to execute the backup task and count the number of currently idle READ threads. 2) The task thread group executes the original data backup process, specifically: the READ thread first obtains the backup task, reads data from the data file to be backed up and generates backup packages (first backup package) one by one according to the preset package size, registers the corresponding data file information in the package header, and then adds the backup package to the PROC queue; when the PROC thread is idle, it retrieves the backup package from the PROC queue, performs verification and encryption compression (if necessary), and then adds the backup package (second backup package) to the FLUSH queue; finally, when the FLUSH thread is idle, it retrieves the backup package (second backup package) from the FLUSH queue, writes the data to the backup piece file of the corresponding sub-backup set, and generates a new backup piece if the backup piece file size exceeds the specified upper limit. 3) If there are still backup tasks that have not been sent, and there are currently idle READ threads, the main process selects the next backup task and goes to 1). Otherwise, it only needs to wait for the currently executing task to finish.

[0081] As an optional implementation of this embodiment, determining the target backup parallelism based on the total number of split data block sets and the initial backup parallelism includes:

[0082] 1) If the total number of split data block sets is less than the initial backup parallelism, then the total number is determined as the target backup parallelism.

[0083] Specifically, after obtaining the total number of split data block sets, it is possible to determine the size of the total number of split data block sets and the initial backup parallelism. If the total number of split data block sets is less than the initial backup parallelism, then the total number is determined as the target backup parallelism.

[0084] For example, if the total number of data blocks in the split set is 5 and the initial backup parallelism is 10, the user's initial parallelism exceeds the actual number of data blocks and needs to be adjusted to the actual number of data blocks to avoid unnecessary parallel tasks. Therefore, 5 can be used as the target backup parallelism.

[0085] 2) If the total number of split data block sets is greater than or equal to the initial backup parallelism, then the initial backup parallelism is determined as the target backup parallelism.

[0086] Specifically, if the total number of data block sets is greater than or equal to the initial backup parallelism, then the initial backup parallelism is determined as the target backup parallelism. That is, if the user-specified parallelism is greater than the total number of blocks, the actual parallelism is adjusted to the total number of blocks; otherwise, the user-specified parallelism is the actual parallelism during backup. For example, if the total number of data block sets is 10 and the initial backup parallelism is 5, the initial parallelism is within a reasonable range and can be used directly; therefore, 5 can be used as the target backup parallelism.

[0087] Example 2

[0088] Figure 3 This is a flowchart of a parallel database data restoration method provided in Embodiment 1 of this disclosure. This embodiment is applicable to the parallel restoration of data in a database. The method can be executed by a parallel database data restoration device, which can be implemented in hardware and / or software. This device can be configured in an electronic device, including but not limited to computers, PCs, electronic devices, and servers, which are devices with data processing capabilities. Figure 3 As shown, the method includes:

[0089] S210. In response to the parallel restore command, obtain the main backup set according to the restore main backup set path; the main backup set includes the target backup parallelism and the identifiers of each sub-backup set; the parallel restore command includes the restore main backup set path, the restore path and the initial restore parallelism.

[0090] In this embodiment, after generating a parallel backup set, the generated parallel backup set can also be restored in parallel. The parallel restore command can include the restore master backup set path, the restore path, and the initial restore parallelism. The restore master backup set path can be the storage path of the master backup set; when performing a database restore operation, the restore path refers to the path where the database to be restored is located. Whether restoring the entire database or only restoring a specific tablespace, the database path must first be specified. Furthermore, if restoring a tablespace, the name of the tablespace to be restored must be explicitly specified. The initial restore parallelism can be the initial parallelism of the parallel restore operation, i.e., the number of threads or tasks performing the restore operation simultaneously.

[0091] Specifically, in response to a parallel restore command, the primary backup set can be retrieved based on the path to the primary backup set. By parsing the primary backup set, the target backup parallelism and the identifiers (IDs) of each sub-backup set can be obtained. The target backup parallelism can be the final parallelism calculated during the parallel backup process based on the actual total number of data blocks and the initial backup parallelism.

[0092] For example, a parallel restore command can be an SQL statement, which the user executes to initiate a parallel restore. The user must specify the path to the primary backup set, the target path, and a parallelism degree greater than 1 (initial parallelism) in the SQL statement beforehand. The primary backup set is then located based on the user-specified path. The metadata file of the primary backup set can be read to parse out relevant information about the primary backup set and all sub-backup sets needed for the restore, including the target backup parallelism, encryption and compression information, and identifier IDs.

[0093] S220. Determine each sub-backup set according to the path of each sub-backup set, and each sub-backup set corresponds to a restore task; wherein, the path of each sub-backup set is determined based on the restore master backup set path, the target backup parallelism and the identifier of each sub-backup set.

[0094] Specifically, after restoring the main backup set path, the target backup parallelism, and the identifiers of each sub-backup set, the path of each sub-backup set can be determined based on the restored main backup set path, the target backup parallelism, and the identifiers of each sub-backup set. The determination process is the same as the path determination process during the backup process, and will not be repeated here.

[0095] As described above, after obtaining the paths of each sub-backup set, each sub-backup set can be determined based on its path, and each sub-backup set can correspond to a restore task.

[0096] S230. Determine the target restoration parallelism based on the total number of sub-backup sets and the initial restoration parallelism.

[0097] In this embodiment, after determining each sub-backup set, the total number of each sub-backup set can be determined. Based on the total number of each sub-backup set and the initial restore parallelism, the target restore parallelism can then be determined.

[0098] S240. Assign a corresponding target restoration task thread group to each restoration task according to the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups.

[0099] Specifically, after obtaining the target restoration parallelism, a set of restoration task thread groups can be created based on the target restoration parallelism. The set of restoration task thread groups includes at least two restoration task thread groups, and the number of restoration task thread groups can be the same as the target restoration parallelism.

[0100] Based on the above description, a corresponding target restore task thread group can be assigned to each restore task according to the usage status of each restore task thread in the restore task thread group set. The usage status of each restore task thread can include an active state and an inactive (idle) state. Threads in the restore task thread group set that are in an idle state can be randomly assigned to various restore tasks. Each restore task can correspond to three restore task threads, and these three threads can form a restore task thread group for each restore task. Each restore task thread group can include a read restore data thread (e.g., READ thread), several restore data processing threads (e.g., PROC thread), and a write restore data thread (e.g., FLUSH thread). The read restore data thread is used to read the data corresponding to the restore task, the restore data processing threads are responsible for data processing, and the write restore data threads are responsible for writing data. Threads can interact with each other through queues, and threads within the same thread group run concurrently, improving overall efficiency.

[0101] S250. Use the target restoration task thread group corresponding to each restoration task to restore the corresponding sub-backup set in parallel.

[0102] Specifically, after obtaining the target restoration task thread group corresponding to each restoration task, the target restoration task thread group corresponding to each restoration task can be used to restore the corresponding sub-backup sets in parallel.

[0103] This embodiment provides a parallel database data restoration method, including: responding to a parallel restoration command, obtaining a main backup set according to the main backup set restoration path; the main backup set includes a target backup parallelism and identifiers of each sub-backup set; the parallel restoration command includes the main backup set restoration path, a restoration path, and an initial restoration parallelism; determining each sub-backup set according to each sub-backup set path, with each sub-backup set corresponding to a restoration task; wherein each sub-backup set path is determined based on the main backup set restoration path, the target backup parallelism, and the identifiers of each sub-backup set; determining the target restoration parallelism based on the total number of sub-backup sets and the initial restoration parallelism; allocating a corresponding target restoration task thread group to each restoration task according to the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups; and using the target restoration task thread groups corresponding to each restoration task to perform parallel data restoration on the corresponding sub-backup sets. The above technical solution achieves parallel restoration of backup sets, fully utilizing the device's read / write bandwidth and CPU computing power, and improving the overall performance of the data backup and restoration process.

[0104] As an optional implementation of this embodiment, determining the target restore parallelism based on the total number of sub-backup sets and the initial restore parallelism includes:

[0105] If the initial restore parallelism is greater than or equal to the total number of sub-backup sets, then the total number of sub-backup sets is determined as the target restore parallelism; if the initial restore parallelism is less than the total number of sub-backup sets, then the initial restore parallelism is determined as the target restore parallelism.

[0106] Specifically, after obtaining the total number of sub-backup sets, the target restoration parallelism can be determined by comparing the initial restoration parallelism with the total number of sub-backup sets. If the initial restoration parallelism is greater than or equal to the total number of sub-backup sets, then the total number of sub-backup sets is determined as the target restoration parallelism; if the initial restoration parallelism is less than the total number of sub-backup sets, then the initial restoration parallelism is determined as the target restoration parallelism.

[0107] As an optional implementation of this embodiment, the target restoration task thread group includes a read restoration data thread, a restoration data processing thread, and a write restoration data thread; the step of using the target restoration task thread group corresponding to each restoration task to perform parallel data restoration on the corresponding sub-backup set includes:

[0108] 1) For any restore task, the read restore data thread is used to read each backup package from the backup piece file of the sub-backup set corresponding to the restore task.

[0109] Specifically, the target restore task thread group corresponding to each restore task can be determined based on the usage status of each restore thread in the restore task thread group set. The target restore task thread group can include a read restore data thread, a restore data processing thread, and a write restore data thread. Each restore task can correspond to a separate target restore task thread group. For each restore task, the read restore data thread can be used to read various backup packages from the backup piece files of the sub-backup set corresponding to the restore task. The read restore data thread can be an idle READ thread.

[0110] It should be noted that after obtaining each backup package, each backup package can be stored in the PROC queue.

[0111] 2) Use the data restoration processing thread to perform verification and restoration preprocessing on each backup package to determine the processed backup packages.

[0112] In this embodiment, the data restoration processing thread can be an idle data restoration processing thread, such as an idle PROC thread. The idle data restoration processing thread can be used to extract each backup package stored in the PROC queue, and to verify and process each backup package (e.g., decrypt and decompress) to determine the processed backup packages, and then store the processed backup packages in the FLUSH queue.

[0113] 3) Using the write-restore data thread, the processed backup packages are written into the database corresponding to the restore path to complete the data restoration.

[0114] Specifically, the write-to-restore-data thread can be an idle write-to-restore-data thread, such as an idle FLUSH thread. This thread can be used to write the data of the corresponding data packets from the data file information stored in the header of each processed backup packet into the database corresponding to the restore path, thereby achieving the restoration of the backup set.

[0115] Taking a restore task as an example, Figure 4 This is a schematic diagram of a restoration process provided in this embodiment, as shown below. Figure 4 As shown, 1) Select an idle READ thread to execute the restore task and count the number of currently idle READ threads in response to the main process. 2) The task thread group executes the restore task: The READ thread reads backup packages one by one from the backup fragment files of the corresponding sub-backup set according to the restore task and adds them to the PROC queue; the PROC thread retrieves the package data and verifies and decrypts and decompresses it (if necessary) and adds it to the FLUSH queue; the FLUSH thread retrieves the package data and writes it to the corresponding database file under the restore path according to the information registered in the packet header. 3) If there are still restore tasks that have not been sent and there are currently idle READ threads, the next restore task can be selected, and proceed to 1). Otherwise, it is only necessary to wait for the currently executing task to finish.

[0116] Example 3

[0117] Figure 5 This is a schematic diagram of the structure of a database parallel backup device provided in Embodiment 3 of this disclosure; as shown below. Figure 5 As shown, the device includes: a data acquisition module 310 to be backed up, a splitting module 320, a target backup parallelism determination module 330, a target backup task thread group determination module 340, and a data backup module 350.

[0118] The backup data acquisition module 310 is used to acquire backup data in response to a parallel backup command; the parallel backup command includes an initial backup parallelism and a preset split block size.

[0119] The splitting module 320 is used to split the data to be backed up based on the preset splitting block size to determine a set of split data blocks; the set of split data blocks includes at least two split data blocks, and each split data block corresponds to a backup task.

[0120] The target backup parallelism determination module 330 is used to determine the target backup parallelism based on the total number of split data block sets and the initial backup parallelism.

[0121] The target backup task thread group determination module 340 is used to allocate a corresponding target backup task thread group to each backup task according to the usage status of each backup thread in the backup task thread group set; the backup task thread group set is created based on the target backup parallelism, and the backup task thread group set includes at least two backup task thread groups.

[0122] The data backup module 350 is used to perform parallel data backup on the corresponding split data blocks using the target backup task thread group corresponding to each of the backup tasks, so as to determine the parallel backup set.

[0123] Embodiment 3 of this disclosure provides a database parallel backup device, which realizes parallel backup of the data to be backed up, makes full use of the device's read and write bandwidth and CPU computing power, and improves the overall performance of the data backup and restore process.

[0124] Furthermore, the target backup task thread group includes a read backup data thread, a backup data processing thread, and a write backup data thread; the data backup module 350 is also used for:

[0125] For any backup task, based on the preset package size, the read backup data thread is used to divide the split data block corresponding to the backup task to obtain each first backup package;

[0126] The backup data processing thread is used to verify and preprocess each first backup package to determine each second backup package.

[0127] Using the write backup data thread, each second backup package is written into the backup set corresponding to the target backup task thread group to determine each sub-backup set;

[0128] The parallel backup set is determined based on each sub-backup set; the parallel backup set includes a main backup set and each sub-backup set, and the main backup set is used to register information about the parallel backup set and each sub-backup set.

[0129] Furthermore, the target backup parallelism determination module 330 is also used for:

[0130] If the total number of data block sets is less than the initial backup parallelism, then the total number is determined as the target backup parallelism.

[0131] If the total number of split data block sets is greater than or equal to the initial backup parallelism, then the initial backup parallelism is determined as the target backup parallelism.

[0132] The database parallel backup device provided in this disclosure can execute the database parallel backup method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method execution.

[0133] Example 4

[0134] Figure 6 This is a schematic diagram of the structure of a parallel database data restoration device provided in Embodiment 4 of this disclosure; as shown... Figure 6 As shown, the device includes: a primary backup set acquisition module 410, a restore task determination module 420, a target restore parallelism determination module 430, a target restore task thread group determination module 440, and a data restore module 450.

[0135] The main backup set acquisition module 410 is used to acquire the main backup set according to the main backup set restoration path in response to the parallel restore command; the main backup set includes the target backup parallelism and the identifiers of each sub-backup set; the parallel restore command includes the main backup set restoration path, the restore path and the initial restore parallelism.

[0136] The restore task determination module 420 is used to determine each sub-backup set according to each sub-backup set path, and each sub-backup set corresponds to a restore task; wherein, each sub-backup set path is determined based on the restore main backup set path, the target backup parallelism, and the identifier of each sub-backup set;

[0137] The target restoration parallelism determination module 430 is used to determine the target restoration parallelism based on the total number of sub-backup sets and the initial restoration parallelism.

[0138] The target restoration task thread group determination module 440 is used to allocate a corresponding target restoration task thread group to each restoration task according to the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups.

[0139] The data restoration module 450 is used to perform parallel data restoration on the corresponding sub-backup sets using the target restoration task thread groups corresponding to each of the restoration tasks.

[0140] Embodiment 4 of this disclosure provides a database parallel data restoration device, which realizes parallel restoration of backup sets, makes full use of the device's read / write bandwidth and CPU computing power, and improves the overall performance of the data backup and restoration process.

[0141] Furthermore, the target restoration parallelism determination module 430 is also used for:

[0142] If the initial restoration parallelism is greater than or equal to the total number of sub-backup sets, then the total number of sub-backup sets is determined as the target restoration parallelism.

[0143] If the initial restoration parallelism is less than the total number of sub-backup sets, then the initial restoration parallelism is determined as the target restoration parallelism.

[0144] Furthermore, the target restoration task thread group includes a read restoration data thread, a restoration data processing thread, and a write restoration data thread; the data restoration module 450 is also used for:

[0145] For any restore task, the read backup data thread reads each backup package from the backup piece file of the backup set corresponding to the restore task;

[0146] The data restoration processing thread is used to verify and restore each backup package in order to determine the processed backup packages.

[0147] Using the write-restore data thread, the processed backup packages are written into the database corresponding to the restore path to complete the data restoration.

[0148] The database parallel data restoration apparatus provided in this disclosure can execute the database parallel data restoration method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method execution.

[0149] Example 5

[0150] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement embodiments of the present disclosure is shown. 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 components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present disclosure described and / or claimed herein.

[0151] like Figure 7As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0152] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0153] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 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 processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microprocessor, etc. Processor 11 performs the various methods and processes described above, such as database parallel backup methods and database parallel restoration methods.

[0154] In some embodiments, the database parallel backup method and the database parallel restoration method can be implemented as computer programs tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the database parallel backup method and the database parallel restoration method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the database parallel backup method and the database parallel restoration method by any other suitable means (e.g., by means of firmware).

[0155] Various embodiments of the systems and techniques described above 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 embodiments 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 transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0156] Computer programs for implementing the methods of embodiments of this disclosure may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0157] In the context of embodiments of this disclosure, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-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.

[0158] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0159] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0160] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0161] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the embodiments of this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of the embodiments of this disclosure can be achieved, and this document does not impose any limitations.

[0162] The specific embodiments described above do not constitute a limitation on the scope of protection of the embodiments disclosed herein. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the embodiments disclosed herein should be included within the scope of protection of the embodiments disclosed herein.

[0163] This disclosure also provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements the database parallel backup method and the database parallel restoration method provided in any embodiment of this application.

[0164] In implementing a computer program product, computer program code for performing the operations of the embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0165] Note that the above are merely preferred embodiments and the technical principles applied in this disclosure. Those skilled in the art will understand that this disclosure is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the protection scope of this disclosure. Therefore, although the embodiments of this disclosure have been described in detail above, this disclosure is not limited to the above embodiments. More other equivalent embodiments may be included without departing from the concept of this disclosure, and the scope of this disclosure is determined by the scope of the appended claims.

Claims

1. A method for parallel backup of database data, characterized in that, include: In response to a parallel backup command, the data to be backed up is acquired; the parallel backup command includes an initial backup parallelism and a preset split block size. The data to be backed up is split based on the preset split block size to determine a set of split data blocks; the set of split data blocks includes at least two split data blocks, and each split data block corresponds to a backup task; The target backup parallelism is determined based on the total number of split data block sets and the initial backup parallelism. Based on the usage status of each backup thread in the backup task thread group set, assign a corresponding target backup task thread group to each backup task. The backup task thread group set is created based on the target backup parallelism, and the backup task thread group set includes at least two backup task thread groups; The corresponding split data blocks are backed up in parallel using the target backup task thread groups corresponding to each backup task to determine the parallel backup set.

2. The method according to claim 1, characterized in that, The target backup task thread group includes a read backup data thread, a backup data processing thread, and a write backup data thread; The step of using the target backup task thread group corresponding to each of the backup tasks to perform parallel data backup on the corresponding split data blocks to determine the parallel backup set includes: For any backup task, based on the preset package size, the read backup data thread is used to divide the split data block corresponding to the backup task to obtain each first backup package; The backup data processing thread is used to verify and preprocess each first backup package to determine each second backup package. Using the write backup data thread, each second backup package is written into the backup set corresponding to the target backup task thread group to determine each sub-backup set; The parallel backup set is determined based on each sub-backup set; the parallel backup set includes a main backup set and each sub-backup set, and the main backup set is used to register information about the parallel backup set and each sub-backup set.

3. The method according to claim 1, characterized in that, The step of determining the target backup parallelism based on the total number of split data block sets and the initial backup parallelism includes: If the total number of data block sets is less than the initial backup parallelism, then the total number is determined as the target backup parallelism. If the total number of split data block sets is greater than or equal to the initial backup parallelism, then the initial backup parallelism is determined as the target backup parallelism.

4. A method for parallel data restoration of a database, characterized in that, include: In response to the parallel restore command, the primary backup set is obtained according to the path of the primary backup set to be restored; The primary backup set includes the target backup parallelism and the identifiers of each sub-backup set; The parallel restore instruction includes the restore master backup set path, the restore path, and the initial restore parallelism. Each sub-backup set is determined based on its path, and each sub-backup set corresponds to a restore task; wherein, each sub-backup set path is determined based on the restore master backup set path, the target backup parallelism, and the identifier of each sub-backup set. The target restoration parallelism is determined based on the total number of sub-backup sets and the initial restoration parallelism. Each restoration task is assigned a corresponding target restoration task thread group based on the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups; The corresponding sub-backup sets are restored in parallel using the target restoration task thread groups corresponding to each restoration task.

5. The method according to claim 4, characterized in that, The step of determining the target restore parallelism based on the total number of sub-backup sets and the initial restore parallelism includes: If the initial restoration parallelism is greater than or equal to the total number of sub-backup sets, then the total number of sub-backup sets is determined as the target restoration parallelism. If the initial restoration parallelism is less than the total number of sub-backup sets, then the initial restoration parallelism is determined as the target restoration parallelism.

6. The method according to claim 4, characterized in that, The target restoration task thread group includes a read restoration data thread, a restoration data processing thread, and a write restoration data thread; The step of using the target restoration task thread group corresponding to each of the restoration tasks to perform parallel data restoration on the corresponding sub-backup sets includes: For any restore task, the read restore data thread reads each backup package from the backup piece file of the sub-backup set corresponding to the restore task; The data restoration processing thread is used to verify and restore each backup package in order to determine the processed backup packages. Using the write-restore data thread, the processed backup packages are written into the database corresponding to the restore path to complete the data restoration.

7. A database parallel backup device, characterized in that, include: The backup data acquisition module is used to acquire backup data in response to a parallel backup command; the parallel backup command includes an initial backup parallelism and a preset split block size. The splitting module is used to split the data to be backed up based on the preset splitting block size to determine a set of split data blocks; the set of split data blocks includes at least two split data blocks, and each split data block corresponds to a backup task; The target backup parallelism determination module is used to determine the target backup parallelism based on the total number of split data block sets and the initial backup parallelism. The target backup task thread group determination module is used to allocate a corresponding target backup task thread group to each backup task according to the usage status of each backup thread in the backup task thread group set. The backup task thread group set is created based on the target backup parallelism, and the backup task thread group set includes at least two backup task thread groups; The data backup module is used to perform parallel data backups on the corresponding split data blocks using the target backup task thread groups corresponding to each of the backup tasks, so as to determine the parallel backup set.

8. A parallel data restoration device for databases, characterized in that, include: The main backup set acquisition module is used to acquire the main backup set according to the main backup set path in response to the parallel restore command; The primary backup set includes the target backup parallelism and the identifiers of each sub-backup set; The parallel restore instruction includes the restore master backup set path, the restore path, and the initial restore parallelism. The restore task determination module is used to determine each sub-backup set according to each sub-backup set path, and each sub-backup set corresponds to a restore task; wherein, each sub-backup set path is determined based on the restore main backup set path, the target backup parallelism, and the identifier of each sub-backup set; The target restoration parallelism determination module is used to determine the target restoration parallelism based on the total number of sub-backup sets and the initial restoration parallelism. The target restoration task thread group determination module is used to allocate a corresponding target restoration task thread group to each restoration task according to the usage status of each restoration thread in the restoration task thread group set; the restoration task thread group set is created based on the target restoration parallelism, and the target task thread group set includes at least two restoration task thread groups; The data restoration module is used to perform parallel data restoration on the corresponding sub-backup sets using the target restoration task thread groups corresponding to each of the restoration tasks.

9. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the database parallel backup method as described in any one of claims 1-3 or the database parallel restoration method as described in any one of claims 4-6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the database data parallel backup method as described in any one of claims 1-3 or the database data parallel restoration method as described in any one of claims 4-6.

11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the database parallel backup method as described in any one of claims 1-3 or the database parallel restoration method as described in any one of claims 4-6.