Data backup method and device

In the multi-computer room database architecture, each computer room application layer reads the local and other computer rooms' database partition data, and realizes full backup, solving the problem of poor data read disaster recovery performance caused by changes in master-slave relationship topology and strong coupling, and improving the robustness of data acquisition and read disaster recovery performance.

CN120029820APending Publication Date: 2025-05-23NETSUNION CLEARING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311578925.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the multi-computer room database architecture, changes in master-slave relationship topology and strong coupling lead to poor data read disaster recovery performance.

Method used

By reading the local and other computer rooms' database partition data in the application layer of each computer room, a full backup of the data is realized, thereby decoupling the database relationship in multiple computer rooms and avoiding synchronization requirements.

Benefits of technology

It realizes the reading and writing of multi-computer room data, decouples the multi-computer room database, and improves the robustness of data acquisition and read disaster recovery performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029820A_ABST
    Figure CN120029820A_ABST
Patent Text Reader

Abstract

The invention provides a data backup method and device.The method comprises the steps that an application layer of each machine room is controlled, and local partition data of each data table in a local database is read; the application layer of each machine room is controlled, other partition data of each data table in the databases of other machine rooms are read, and data table partitions corresponding to the other partition data and the local partition data are different; and according to the local partition data and other partition data of each data table, backing up full data of each data table in an application layer of each computer room. Therefore, data reading and writing are achieved through the multiple machine rooms, the databases of the multiple machine rooms are decoupled through data partition storage, synchronization does not need to be kept between the databases of the multiple machine rooms any more, and the robustness of data obtaining is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a data backup method and device. Background Art

[0002] Usually, the multi-computer room application architecture often adopts a one-master-multiple-slave model, that is, only one computer room has read and write capabilities, and the other computer rooms synchronize data from the main computer room. The applications in the other computer rooms can only read data but not write data. The other computer rooms achieve data synchronization by backing up the data in the main computer room.

[0003] However, when the database in a writable computer room fails and one of the other computer rooms becomes writable, the database master-slave relationship topology changes. At the same time, each application that relies on the database needs to know which computer room is writable and which is readable. There is strong coupling between databases in multiple computer rooms and between applications and databases, resulting in poor data reading disaster recovery performance. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the above-mentioned technology at least to some extent.

[0005] To this end, the first purpose of the present invention is to propose a data backup method to realize data reading and writing through multiple computer rooms. Through data partition storage, the databases of multiple computer rooms are decoupled, and there is no need to keep synchronization between the databases of multiple computer rooms, thereby ensuring the robustness of data acquisition.

[0006] A second objective of the present invention is to provide a data backup device.

[0007] A third object of the present invention is to provide a computer device.

[0008] A fourth object of the present invention is to provide a non-transitory computer-readable storage medium.

[0009] To achieve the above object, a first embodiment of the present invention provides a data backup method, comprising:

[0010] Control the application layer of each computer room to read the local partition data of each data table in the local database; control the application layer of each computer room to read the other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other; and back up the full data of each data table at the application layer of each computer room according to the local partition data and the other partition data of each data table.

[0011] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a data backup device, including: a first reading module, used to control the application layer of each computer room, and read the local partition data of each data table in the local database; a second reading module, used to control the application layer of each computer room, and read the other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other; a backup module, used to back up the full data of each data table at the application layer of each computer room according to the local partition data and the other partition data of each data table.

[0012] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the data backup method described in the first aspect of the present invention is implemented.

[0013] In order to achieve the above objectives, the fourth aspect of the present invention provides a non-temporary computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the data backup method described in the first aspect of the present invention is implemented.

[0014] The embodiments of the present invention have at least the following technical effects:

[0015] Control the application layer of each computer room, read the local partition data of each data table in the local database, control the application layer of each computer room, read the other partition data of each data table in the database of each other computer room, where the data table partitions corresponding to the other partition data and the local partition data are different from each other, and finally, back up the full data of each data table at the application layer of each computer room based on the local partition data and other partition data of each data table. In this way, data reading and writing are realized through multiple computer rooms, and the databases of multiple computer rooms are decoupled through data partition storage, and the databases of multiple computer rooms no longer need to be synchronized, which ensures the robustness of data acquisition.

[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0018] Figure 1 A schematic diagram of a data backup method provided by an embodiment of the present invention;

[0019] Figure 2 A schematic diagram of a data backup scenario provided by an embodiment of the present invention;

[0020] Figure 3 A flowchart of another data backup method provided by an embodiment of the present invention;

[0021] Figure 4 A flowchart of another data backup method provided by an embodiment of the present invention;

[0022] Figure 5 A schematic diagram of another data backup scenario provided by an embodiment of the present invention;

[0023] Figure 6 A schematic diagram of the structure of a data backup device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0025] The data backup method and device according to the embodiments of the present invention are described below with reference to the accompanying drawings.

[0026] In order to solve the technical problem of poor data reading disaster tolerance caused by the master-slave architecture in the related technology, the present invention provides support for multi-computer room applications to have simultaneous reading and writing capabilities through the idea of ​​multi-computer room data partitioning. Even if some computer rooms fail, there is no need to perceive which computer room the error occurred in, which computer room is currently reading data, etc. when reading data, thereby improving the robustness of data reading.

[0027] Figure 1 A flowchart of a data backup method provided by an embodiment of the present invention.

[0028] like Figure 1 As shown, the method comprises the following steps:

[0029] Step 101, controlling the application layer of each computer room to read the local partition data of each data table in the local database.

[0030] In this embodiment, the application layer in each database is controlled to read the local partition data of each data table in the local database, wherein the local database stores the partition data corresponding to each data table, thereby ensuring that the local partition data read is read by the most efficient computer room.

[0031] Step 102, controlling the application layer of each computer room to read other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other.

[0032] It can be understood that for each data table, each computer room stores the data of one partition, so the sum of the partition data corresponding to all computer rooms is the full data. Therefore, in order to ensure that the application layer of each computer room can cache the full data of each data table, the application layer of each computer room is controlled to read the other partition data of each data table in the database of each other computer room. In order to further improve the data reading efficiency, the data of the local database can be loaded first, and then the data of the database of other computer rooms can be loaded.

[0033] It should be emphasized that in this embodiment, in order to avoid repeated reading of data and to avoid the need to know which computer room is readable and writable when backing up data, in this embodiment, each computer room participates in the acquisition of partition data, and the data table partitions corresponding to other partition data and local partition data are different.

[0034] In some possible embodiments, the local database of each computer room stores a large amount of data from data tables. Therefore, in order to facilitate searching, the local database of each computer room stores data table identifiers and data corresponding to the data table identifiers. Therefore, in this embodiment, the data table identifier of each data table can be determined, and a data acquisition request carrying the data table identifier can be sent to each other computer room, thereby obtaining the partition data corresponding to the data table identifier stored in the database fed back by each other computer room.

[0035] In some other possible embodiments, the database of each computer room is controlled to store each data table in a uniform order, and thus the order of each data table is determined, thereby obtaining the partition data stored in the local database of each computer room in the corresponding order.

[0036] For example, refer to Figure 2 , if there are 5 computer rooms in the current scenario, for data table A, if data table A is divided into 5 partitions a1-a5, the local database in control room 1 stores the data of partition a1 of data table A, the local database in control room 2 stores the data of partition a2 of data table A, the local database in control room 3 stores the data of partition a3 of data table A, the local database in control room 4 stores the data of partition a4 of data table A, and the local database in control room 5 stores the data of partition a5 of data table A.

[0037] The application layer of each computer room stores the partition data of the data table stored in the local database. Figure 2The application layer of computer room 1 reads the a1 partition data of data table A from the local database, the application layer of computer room 2 reads the a2 partition data of data table A from the local database, the application layer of computer room 3 reads the a3 partition data of data table A from the local database, the application layer of computer room 4 reads the a4 partition data of data table A from the local database, and the application layer of computer room 5 reads the a5 partition data of data table A from the local database.

[0038] Furthermore, the application layer of each computer room also obtains data of other partitions from other computer rooms. For example, for computer room 1, the a2-a5 partition data is obtained from the local database of computer rooms 2-5; for computer room 2, the a1 and a3-a5 partition data is obtained from the local databases of computer rooms 1 and 3-5; for computer room 3, the a1-a2 and a4-a5 partition data is obtained from the local databases of computer rooms 1-2 and 4-5; for computer room 4, the a1-a3 and a5 partition data is obtained from the local databases of computer rooms 1-3 and 5; for computer room 5, the a1-a4 partition data is obtained from the local databases of computer rooms 1-4.

[0039] Step 103: back up the full amount of data of each data table at the application layer of each computer room according to the local partition data and other partition data of each data table.

[0040] In this embodiment, since the application layer of each computer room obtains the data of each partition of each data table, that is, the local partition data and other partition data, the full data of each data table can be backed up at the application layer of each computer room based on the local partition data and other partition data of each data table.

[0041] It should be noted that in different application scenarios, different methods can be used to back up the full data of each data table at the application layer of each computer room based on the local partition data and other partition data of each data table. The examples are as follows:

[0042] Example 1:

[0043] In this example, the correspondence between the computer room identification of each computer room and the partition number of each data table is stored in a preset storage location in advance. After obtaining the partition data stored in each computer room, the above correspondence is queried to determine the partition number corresponding to each computer room, and the full order of each data table is generated in the order of the partition numbers.

[0044] Example 2:

[0045] In this example, the data table format in each partition data is unified, and each row of data contains its corresponding ID in the data table. The ID can be the number of rows in the data table, etc. Therefore, all partition data can be directly spliced ​​according to the number of rows of the first row of data in each partition data to obtain the full data of the data table.

[0046] Therefore, on the one hand, each computer room's application maintains a cache in order to isolate direct database dependencies and avoid failures in real-time data acquisition due to network or database failures, thereby affecting data consistency during application. On the other hand, direct caching at the application layer also helps speed up data access efficiency.

[0047] In summary, the data backup method of the embodiment of the present invention controls the application layer of each computer room, reads the local partition data of each data table in the local database, controls the application layer of each computer room, reads the other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other, and finally, according to the local partition data of each data table and the other partition data, backs up the full data of each data table at the application layer of each computer room. Thus, data reading and writing are realized through multiple computer rooms, and the databases of multiple computer rooms are decoupled through data partition storage, and the databases of multiple computer rooms no longer need to be synchronized, thereby ensuring the robustness of data acquisition.

[0048] During the actual execution process, the database of some computer rooms may suddenly go offline or other reasons may occur, resulting in the failure of the application layer of the local computer room to read data from other computer rooms. Therefore, in order to ensure the successful reading of partition data in other computer rooms, a fallback strategy is also set in an embodiment of the present invention to ensure successful data reading.

[0049] In one embodiment of the present invention, Figure 3 As shown, in Figure 1 On the basis of the above steps, after reading the other partition data of each data table in the database of each other computer room, it also includes:

[0050] Step 301: If the target partition data in the database of the target computer room in each of the other computer rooms is not read, a data request for the target partition data is sent to the application layer of the target computer room.

[0051] In this embodiment, if the target partition data in the database of the target computer room in each other computer room is not read, a data request for the target partition data is sent to the application layer of the target computer room, for example, a data request carrying the partition identifier of the target partition data is sent.

[0052] Of course, in some possible embodiments, it is also possible to retry to read the target partition data from the database of the target computer room, and when the number of retry failures reaches a preset value, send a data request for the target partition data to the application layer of the target computer room.

[0053] Step 302: Obtain target partition data fed back by the application layer of the target computer room.

[0054] As described above, the application layer of each computer room caches the data in the local database, and thus obtains the target partition data fed back by the application layer of the target computer room.

[0055] Step 303: If the target partition data is not obtained, the target partition data is read from other remaining computer rooms in a round-robin manner.

[0056] In some embodiments, if the target partition data is not obtained, the target partition data is read from other remaining computer rooms by polling. Other remaining computer rooms can be understood as computer rooms that store data based on partition strategies except the local computer room and the target computer room.

[0057] It can be understood that in this embodiment, the polling computer room for polling and reading the target partition data from the other remaining computer rooms can be determined according to the computer room number sequence of the other remaining computer rooms, or can be determined according to the distance from the local computer room. For example, polling is performed in order from near to far, and one other computer room is polled each time. The polling interval can be set according to the polling capacity. If the target partition data is not obtained after each polling, the next round of polling will be performed again after a fixed interval.

[0058] Step 304: If the target partition data is read, stop polling to read the target partition data.

[0059] Step 305: If the target partition data is not read, restart the application layer of each computer room.

[0060] In this embodiment, if the target partition data is read, polling to read the target partition data is stopped. If the target partition data is not read, it can be understood that there is a problem with the application layer of the local computer room. Therefore, the application layer of the corresponding computer room is restarted.

[0061] In another embodiment of the present invention, if the target partition data in the database of the target computer room in each other computer room is not read, a request for obtaining the target partition data can also be sent to all other computer rooms so that the computer room containing the target partition data can feedback the target partition data.

[0062] In summary, in the data backup method of the embodiment of the present invention, when the application loads the data of the specified computer room, it first obtains the data from the database of the specified computer room. If the acquisition fails, the corresponding partitioned data is read from other locations through a fallback strategy to ensure that the application layer caches the full data.

[0063] Based on the above embodiments, the idea of ​​data partitioning in the present invention decouples the databases in multiple computer rooms. Therefore, how to partition the data is also the main focus of the embodiments of the present invention.

[0064] In one embodiment of the present invention, Figure 4 As shown, before the application layer controlling each computer room reads the local partition data of each data table in the local database, it also includes:

[0065] Step 401, determine the total number of records in each data table and the number of computer rooms.

[0066] The unit of each record number in the total record number may be a row, or may be all data of a certain monitoring object, etc.

[0067] In addition, the number of computer rooms can be understood as the number of computer rooms involved in partition backup data.

[0068] Step 402: Determine the number of first records of each partition of each data table recorded in the database of each computer room according to the total number of records and the number of computer rooms.

[0069] In some possible embodiments, the ratio of the total number of records to the number of computer rooms can be calculated. If the ratio is an integer, the ratio is directly used as the first number of records in each computer room. For example, the total number of records is 3N, N is a natural number greater than 1, and the number of computer rooms is 3. Then N can be directly used as the first number of records in the partition of each data table recorded in each computer room. For example, computer room 1 records data in rows 1-N of the data table, computer room 2 records data in rows N+1-2N of the data table, and computer room 3 records data in rows 2N+1-3N of the data table.

[0070] If the ratio is not an integer, the ratio is directly used as the initial number of records for each computer room, and the remaining number of records is allocated to any one or more computer rooms. The allocated number can be determined according to the remaining storage space of each computer room, wherein the allocated number of each computer room is proportional to the remaining storage space. In this embodiment, the first number of records may be different between computer rooms.

[0071] Step 403: Allocate a partition for each data table to each computer room according to the first number of records.

[0072] In this embodiment, a partition for each data table is allocated to each computer room according to the first number of records. For example, according to the order of the rows of the data table and the numbering order of the computer rooms, the data table corresponding to the rows with the first number of records is allocated to each computer room as the corresponding partition data.

[0073] For example, if the number of first records is 10, the data in rows 1 to 10 of the data table are stored in the first computer room.

[0074] Step 404, controlling each computer room to store partition data in a database according to the corresponding partition.

[0075] In this embodiment, after the data table is divided into different partitions, each computer room is controlled to store partition data in the database according to the corresponding partition.

[0076] In another embodiment of the present invention, the remaining storage space of each computer room participating in partitioned data storage is obtained, and a partition of the data table is allocated to each computer room according to the remaining storage space of each computer room.

[0077] For example, each data table can be directly divided into partitions of corresponding proportions according to the ratio of the remaining storage space in each computer room, so that the partitions are allocated to computer room storage of corresponding proportions. When the partitions corresponding to the proportions cannot be divided because they are not integers, the partitions of any computer room can be reduced or increased in the corresponding data table partition ratio. The specific adjustment method can be achieved by existing technologies and will not be repeated here.

[0078] Of course, in the actual execution process, the computer room may change, such as adding a new computer room or deleting a computer room. No matter how the computer room changes, you can modify the database-related configuration and restart the application, and the application code logic does not need to be modified. For example, if a computer room is offline, you only need to modify the database configuration, and the application code logic does not need to be modified. If a new computer room is added, the application layer of all computer rooms needs to synchronize and back up the database of the new computer room.

[0079] If the computer room changes, such as if the changed computer room participates in the partition storage of the data table, it is necessary to appropriately adjust the partition data to be stored in each computer room.

[0080] In this embodiment, if a change in the computer room is detected, the number of the computer room after the change is obtained, and the second number of records for the partition of each data table recorded in the database of each computer room after the change is determined based on the total number of records and the number of computer rooms after the change, wherein the determination of the second number of records can refer to the determination of the first number of records mentioned above, which will not be repeated here.

[0081] Furthermore, a partition for each data table is allocated to each changed computer room according to the second number of records, and each changed computer room is controlled to store partition data in the database according to the corresponding partition.

[0082] In order to enable technical personnel in this field to have a more comprehensive understanding, the data backup process of an embodiment of the present invention is exemplified in combination with a specific application scenario. In this application scenario, the computer rooms include computer rooms 1-3, and the data tables include t1, t2, etc. The data table corresponding to the backup process shown in this scenario is data table t1, db is the database corresponding to each computer room, and the row number identifier of the partitioned data table can be expressed as ID.

[0083] Specifically, in this embodiment, refer to Figure 5 The data table adopts the idea of ​​partitioning. The data of the same table in each computer room is used as a data partition. The partition strategy is divided according to the ID range. For example, for table t1, the ID range in the first computer room is: [1-N), the ID range in the second computer room is: [N-2N), and the ID range in the third computer room is: [2N-3N).

[0084] In this example, each computer room application can read and write tables in this computer room, and the databases of multiple computer rooms do not need to be synchronized. For a data table, each computer room application will obtain data from multiple computer rooms in order to obtain the full amount of data and achieve data consistency during application. At startup, each computer room application first loads the data in this computer room, and then loads the data in other computer rooms. 6) When the application loads the data of the specified computer room, it will first obtain the data from the database of the specified computer room. If the acquisition fails, the fallback solution is: retry to obtain from the application in the specified computer room, because the application caches the data of the specified computer room. If the acquisition of partition data fails, retry to read the partition data of the specified computer room from other computer rooms (excluding the specified computer room) because the application cache contains the partition data of the specified computer room. The retry mechanism adopts a polling strategy, with an interval of X seconds (X is configurable) between each retry. Only when all retries fail, the application startup is considered a failure.

[0085] For example, when the application layer of computer room 1 restarts, the partition data of computer room 2 needs to be loaded. The partition data is read from the database of computer room 2 first. If it fails, the partition data of computer room 2 is read from the application of computer room 3, because the application of computer room 3 has cached the partition data of computer room 2.

[0086] In this embodiment, for a newly added computer room, all existing computer room applications need to obtain the new computer room data (this part can be achieved through configuration), modify the database-related configuration and restart the application, and the application code logic does not need to be modified. For a offline computer room, only the database configuration needs to be modified, and the application code logic does not need to be modified.

[0087] In summary, the data backup method of the embodiment of the present invention and the idea of ​​data partitioning decouple the databases in multiple computer rooms, and the databases in multiple computer rooms no longer need to be synchronized. Each database can use multiple channels to read the full amount of data in the data table, thereby improving the disaster tolerance of data reading.

[0088] In order to implement the above embodiment, the present invention also provides a data backup device.

[0089] Figure 6 A schematic diagram of the structure of a data backup device provided by an embodiment of the present invention.

[0090] like Figure 6 As shown, the data backup device includes: a first reading module 610 , a second reading module 620 and a backup module 630 .

[0091] The first reading module 610 is used to control the application layer of each computer room to read the local partition data of each data table in the local database;

[0092] The second reading module 620 is used to control the application layer of each computer room to read other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other;

[0093] The backup module 630 is used to back up the full amount of data of each data table at the application layer of each computer room according to the local partition data and the other partition data of each data table.

[0094] Furthermore, in a possible implementation of the embodiment of the present invention, it also includes:

[0095] A sending module, configured to send a data request for the target partition data to the application layer of the target computer room when the target partition data in the database of the target computer room in each of the other computer rooms is not read;

[0096] The first acquisition module is used to acquire the target partition data fed back by the application layer of the target computer room.

[0097] In this embodiment, it also includes: a third reading module, which is used to poll and read the target partition data from other remaining computer rooms when the target partition data is not obtained;

[0098] A reading control module, used for stopping polling and reading the target partition data when the target partition data is read;

[0099] The reading control module is further used to restart the application layer of each computer room when the target partition data is not read.

[0100] In a possible implementation manner of the embodiment of the present invention, the second reading module 620 is specifically configured to:

[0101] Determine a data table identifier of each data table;

[0102] Sending a data acquisition request carrying the data table identifier to each of the other computer rooms;

[0103] The partition data corresponding to the data table identifier and stored in the database fed back by each other computer room is obtained.

[0104] In a possible implementation manner of the embodiment of the present invention, the present invention further includes:

[0105] A first determination module is used to determine the total number of records in each data table and the number of computer rooms;

[0106] A second determination module is used to determine the first number of records of the partition of each data table recorded in the database of each computer room according to the total number of records and the number of computer rooms;

[0107] A storage allocation module, used for allocating a partition for each data table to each computer room according to the first number of records;

[0108] The storage control module is used to control each computer room to store partition data in the database according to the corresponding partition.

[0109] In this embodiment, it also includes: a second acquisition module, which is used to acquire the number of the changed computer rooms when a change in the computer room is detected;

[0110] A third determination module, configured to determine the number of second records of the partition of each data table recorded in the database of each computer room after the change according to the total number of records and the number of computer rooms after the change;

[0111] The storage allocation module is further used to allocate a partition for each data table to each computer room after the change according to the second number of records;

[0112] The storage control module is also used to control each of the changed computer rooms to store partition data in the database according to the corresponding partition.

[0113] It should be noted that the aforementioned explanation of the data backup method embodiment is also applicable to the data backup device of this embodiment, and will not be repeated here.

[0114] In summary, the data backup device of the embodiment of the present invention controls the application layer of each computer room, reads the local partition data of each data table in the local database, controls the application layer of each computer room, reads the other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other, and finally, according to the local partition data and other partition data of each data table, backs up the full data of each data table at the application layer of each computer room. Thus, data reading and writing are realized through multiple computer rooms, and the databases of multiple computer rooms are decoupled through data partition storage, and the databases of multiple computer rooms no longer need to be synchronized, thereby ensuring the robustness of data acquisition.

[0115] In order to implement the above embodiments, the present invention also proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the data backup method described in the above embodiments is implemented.

[0116] In order to implement the above embodiments, the present invention further proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the data backup method described in the above embodiments is implemented.

[0117] In order to implement the above embodiments, the present invention further proposes a computer program product. When an instruction processor in the computer program product executes, the data backup method described in the above embodiments is implemented.

[0118] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0119] In addition, the terms "target" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "target" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0120] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0121] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0122] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0123] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0124] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0125] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A data backup method, It is characterized in that The following steps are involved: Control the application layer of each computer room and read the local partition data of each data table in the local database; Control the application layer of each computer room to read other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other; Based on the local partition data and the other partition data of each data table, the full amount of data of each data table is backed up at the application layer of each computer room.

2. The method according to claim 1, It is characterized in that After reading the other partition data of each data table in the database of each other computer room, the method further includes: If the target partition data in the database of the target computer room in each of the other computer rooms is not read, sending a data request for the target partition data to the application layer of the target computer room; The target partition data fed back by the application layer of the target computer room is obtained.

3. The method according to claim 2, Its characteristics are, After sending the data request for the target partition data to the application layer of the target computer room, the method further includes: If the target partition data is not obtained, polling and reading the target partition data from other remaining computer rooms; If the target partition data is read, stop polling to read the target partition data; If the target partition data is not read, the application layer of each computer room is restarted.

4. The method according to claim 1, It is characterized in that The application layer controlling each of the computer rooms reads other partition data of each of the data tables in the database of each of the other computer rooms, including: Determine a data table identifier of each data table; Sending a data acquisition request carrying the data table identifier to each of the other computer rooms; The partition data corresponding to the data table identifier and stored in the database fed back by each other computer room is obtained.

5. The method according to claim 1, It is characterized in that Before the application layer controlling each computer room reads the local partition data of each data table in the local database, it also includes: Determine the total number of records in each data table and the number of computer rooms; Determine the first number of records of the partition of each data table recorded in the database of each data table according to the total number of records and the number of computer rooms; Allocating a partition for each data table to each computer room according to the first number of records; Control each of the computer rooms to store partition data in a database according to the corresponding partition.

6. The method according to claim 5, It is characterized in that Also includes: If a change in the computer room is detected, the number of the changed computer room is obtained; Determine the second number of records of each partition of the data table recorded in the database of each computer room after the change according to the total number of records and the number of computer rooms after the change; Allocating a partition for each data table to each of the changed computer rooms according to the second number of records; Each computer room after the change is controlled to store partition data in a database according to the corresponding partition.

7. A data backup device, It is characterized in that include: The first reading module is used to control the application layer of each computer room and read the local partition data of each data table in the local database; A second reading module is used to control the application layer of each computer room to read other partition data of each data table in the database of each other computer room, wherein the data table partitions corresponding to the other partition data and the local partition data are different from each other; The backup module is used to back up the full amount of data of each data table at the application layer of each computer room according to the local partition data and the other partition data of each data table.

8. The device according to claim 7, It is characterized in that Also includes: A sending module, configured to send a data request for the target partition data to the application layer of the target computer room when the target partition data in the database of the target computer room in each of the other computer rooms is not read; The first acquisition module is used to acquire the target partition data fed back by the application layer of the target computer room.

9. A computer device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the data backup method as described in any one of claims 1 to 6 is implemented.

10. A non-transitory computer-readable storage medium having stored thereon a computer program, It is characterized in that When the computer program is executed by a processor, the data backup method according to any one of claims 1 to 6 is implemented.