Data updating method, device and system and storage medium

By generating a logical log file with specific indicators for data updates, the method addresses the inefficiency in data synchronization between primary and disaster recovery sites, conserving network and storage resources while maintaining data reliability.

CN119105903APending Publication Date: 2024-12-10HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310632526.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The synchronization of data between primary and disaster recovery sites in cloud service systems wastes significant network bandwidth resources due to the transmission of entire rows of data, leading to inefficient use of network and storage resources.

Method used

A method involving the generation of a logical log file with first and second information to indicate the primary data set and specific data to be modified, allowing for the update of disaster recovery data sets without transmitting the entire row of data, thereby reducing the data volume and bandwidth requirements.

Benefits of technology

This approach reduces the data volume of the logical log file, conserving network bandwidth and storage resources by only transmitting necessary data updates, ensuring efficient data synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105903A_ABST
    Figure CN119105903A_ABST
Patent Text Reader

Abstract

The invention discloses a data updating method, device and system and a storage medium, and belongs to the field of databases. The method is applied to a cloud service system, the cloud service system comprises a main site and a disaster recovery site, a main database in the main site comprises a first main data set, and a disaster recovery database in the disaster recovery site comprises a first disaster recovery data set which is the same as the first main data set. The method comprises the following steps: modifying at least one piece of first data in a first main data set into at least one piece of second data; a logic log file is generated, the logic log file comprises first information, second information and at least one piece of second data, the first information is used for indicating the first main data set, and the second information is used for indicating at least one piece of first data; and sending a logic log file to the disaster recovery site, wherein the logic log file is used for indicating the disaster recovery site to update at least one piece of first data in the first disaster recovery data set into at least one piece of second data. According to the invention, network bandwidth resources can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a method, device, system and storage medium for updating data. Background Art

[0002] The cloud service system has extremely high requirements for data reliability. In order to improve reliability, the primary site is used to provide services to users, and the disaster recovery site is used to back up the primary site. Usually, the primary site is located in a different area from the disaster recovery site. In this way, when the primary site fails and cannot provide services, the disaster recovery site takes over the services and continues to provide services to users.

[0003] The primary site includes a primary database, and the disaster recovery site includes a disaster recovery database. The primary database stores multiple rows of data, and the disaster recovery database also stores the multiple rows of data. The primary site can modify a row of data in the primary database, and after the modification, the primary site can synchronize the modified row of data to the disaster recovery database. Currently, a large amount of network bandwidth resources are wasted when synchronizing the row of data. Summary of the invention

[0004] The present application provides a method, device, system and storage medium for updating data, which saves network bandwidth resources. The technical solution is as follows:

[0005] In a first aspect, the present application provides a method for updating data, the method being applied to a cloud service system, the cloud service system comprising a primary site and a disaster recovery site, the primary database in the primary site comprising a first primary data set, the first primary data set being a row of data in the primary database, the first primary data set comprising a plurality of first data, each of the plurality of first data being a column of data in the row of data, the disaster recovery database in the disaster recovery site comprising a first disaster recovery data set identical to the first primary data set. In the method, at least one first data in the first primary data set is modified to at least one second data. A logical log file is generated, the logical log file comprising first information, second information and at least one second data, the first information being used to indicate the first primary data set, and the second information being used to indicate the at least one first data. The logical log file is sent to the disaster recovery site, the logical log file being used to instruct the disaster recovery site to update at least one first data in the first disaster recovery data set to the at least one second data.

[0006] Since the generated logical log file includes the first information, the second information and at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data. In this way, the first disaster recovery data set in the disaster recovery database can be obtained through the first information, and the at least one first data that needs to be modified in the first disaster recovery data set can be obtained through the second information, so that the logical log file can include the at least one second data, and does not need to include the modified entire line of data. Thereby reducing the data volume of the logical log file, reducing the network bandwidth resources required for transmitting the logical log file, and saving network bandwidth resources.

[0007] In a possible implementation, the first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set. When the first information includes the row identifier of a row to which the first master data set belongs or the hash value of the first master data set, the data volume of the first information is very small, thereby greatly reducing the data volume of the logical log file.

[0008] In another possible implementation, the second information includes one or more of the following information, a bitmap, or a column identifier of at least one column; wherein the bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, the at least one target data is data in the first master data set other than the at least one first data; the at least one column is the column to which the at least one first data belongs. This makes the data volume of the second information very small, thereby greatly reducing the data volume of the logical log file.

[0009] In another possible implementation, a first transaction is generated; the at least one first data in the first primary data set is modified to the at least one second data through the first transaction, wherein the logical log file also includes the transaction number of the first transaction, thereby ensuring that when the primary site fails, the transaction set required for querying the protection file from the protection site can be obtained based on the transaction number of the first transaction, thereby ensuring that the protection file can be queried from the protection site.

[0010] In another possible implementation, the cloud service system further includes a protection site, and the transmission delay between the main site and the protection site is less than the delay threshold. A first protection file is generated, wherein the file header of the first protection file includes a first transaction set, the payload of the first protection file includes the first information, the second information, and the at least one second data, and the first transaction set includes a transaction number of at least one transaction, and the at least one transaction is a transaction generated before the first transaction. The first protection file is sent to the protection site so that the protection site saves the first protection file.

[0011] In another possible implementation, the primary database also includes a second primary data set, the second primary data set includes a plurality of third data, and the disaster recovery database also includes a second disaster recovery data set that is the same as the second primary data set. A second transaction is generated, and the second transaction is the next transaction of the first transaction. At least one third data in the second primary data set is modified to at least one fourth data through the second transaction. A second protection file is generated, the file header of the second protection file includes the second transaction set, the payload of the second protection file includes the third information, the fourth information and the at least one fourth data, the third information is used to indicate the second primary data set, the fourth information is used to indicate the at least one third data, and the second transaction set includes the first transaction set and the transaction number of the first transaction. The second protection file is sent to the protection site so that the protection site saves the second protection file.

[0012] In this way, after the second protection file is sent, the primary site fails, so that the disaster recovery site can obtain the second transaction set based on the transaction number of the first transaction in the logical log file, obtain the second protection file from the protection site based on the second transaction set, and modify the at least one third data in the second disaster recovery data set to the at least one fourth data based on the second protection file. In this way, the second protection file can be quickly obtained through the transaction set in the file header, and data loss can be avoided based on the second protection file.

[0013] In another possible implementation, the master site and the protection site are located in the same machine room, or the master site and the protection site are located in different machine rooms in the same available area, so as to ensure that the transmission delay between the master site and the protection site is less than the delay threshold.

[0014] In a second aspect, the present application provides a method for updating data, the method being applied to a cloud service system, the cloud service system comprising a primary site and a disaster recovery site, the primary database in the primary site comprising a first primary data set, the first primary data set being a row of data in the primary database, the first primary data set comprising a plurality of first data, each of the plurality of first data being a column of data in the row of data, the disaster recovery database in the disaster recovery site comprising a first disaster recovery data set identical to the first primary data set. In the method, a logical log file is received, the logical log file comprising first information, second information and at least one second data, the first information being used to indicate the first primary data set, the second information being used to indicate at least one first data in the first primary data set, the at least one first data in the first primary data set being modified to the at least one second data. Based on the logical log file, the at least one first data in the first disaster recovery data set is updated to the at least one second data.

[0015] Since the received logical log file includes the first information, the second information and at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data. Thus, the first disaster recovery data set in the disaster recovery database can be obtained through the first information, and the at least one first data that needs to be modified in the first disaster recovery data set can be obtained through the second information, so that the logical log file can include the at least one second data, and does not need to include the modified entire row of data. Thus, the data volume of the logical log file is reduced, the network bandwidth resources required for transmitting the logical log file are reduced, and the network bandwidth resources are saved.

[0016] In a possible implementation, the first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set. When the first information includes the row identifier of a row to which the first master data set belongs or the hash value of the first master data set, the data volume of the first information is very small, thereby greatly reducing the data volume of the logical log file.

[0017] In another possible implementation, the second information includes one or more of the following information, a bitmap, or a column identifier of at least one column; wherein the bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, the at least one target data is data in the first master data set other than the at least one first data; the at least one column is the column to which the at least one first data belongs. This makes the data volume of the second information very small, thereby greatly reducing the data volume of the logical log file.

[0018] In another possible implementation, the logical log file further includes a transaction number of the first transaction. Based on the transaction number of the first transaction, the first transaction is allocated. Based on the first information and the second information, the at least one first data in the first disaster recovery data set is updated to the at least one second data through the first transaction.

[0019] In another possible implementation, the cloud service system further includes a protection site, the transmission delay between the main site and the protection site is less than the delay threshold, the main database further includes a second main data set, the second main data set includes multiple third data, the disaster recovery database further includes a second disaster recovery data set that is the same as the second main data set, the protection site stores a second protection file, the file header of the second protection file includes a second transaction set, the payload of the second protection file includes third information, fourth information and at least one fourth data, the third information is used to indicate the second main data set, the fourth information is used to indicate at least one third data in the second main data set, the at least one third data in the second main data set is modified to the at least one fourth data, and the second transaction set includes the transaction number of the first transaction and the transaction number of at least one transaction that occurred before the first transaction. When the main site fails, the second transaction set is obtained based on the transaction number of the first transaction included in the logical log file. The second protection file whose file header includes the second transaction set is obtained from the protection site. Based on the payload of the second protection file, the at least one third data in the second disaster recovery data set is updated to the at least one fourth data.

[0020] Since the second transaction set is obtained based on the transaction number of the first transaction in the logical log file, the second protection file is obtained from the protection site based on the second transaction set, and the at least one third data in the second disaster recovery data set is modified to the at least one fourth data based on the second protection file, the second protection file can be quickly obtained through the transaction set in the file header, and data loss can be avoided based on the second protection file.

[0021] In another possible implementation, the master site and the protection site are located in the same machine room, or the master site and the protection site are located in different machine rooms in the same available area, so as to ensure that the transmission delay between the master site and the protection site is less than the delay threshold.

[0022] In a third aspect, the present application provides a device for updating data, which is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a unit for executing the method in the first aspect or any possible implementation of the first aspect.

[0023] In a fourth aspect, the present application provides a device for updating data, which is used to execute the method in the second aspect or any possible implementation of the second aspect. Specifically, the device includes a unit for executing the method in the second aspect or any possible implementation of the second aspect.

[0024] In a fifth aspect, the present application provides a computing device cluster, wherein the computing device cluster includes at least one computing device, each of the at least one computing device includes at least one processor and at least one memory, and the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method in the first aspect, the second aspect, any possible implementation of the first aspect, or any two possible implementations of the first aspect.

[0025] In a sixth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the method in the above-mentioned first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.

[0026] In the seventh aspect, the present application provides a computer-readable storage medium for storing a computer program, which is loaded by a processor to execute the method in the above-mentioned first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.

[0027] In an eighth aspect, the present application provides a chip comprising a memory and a processor, the memory being used to store computer instructions, and the processor being used to call and run the computer instructions from the memory to execute the method in the above-mentioned first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.

[0028] In a ninth aspect, the present application provides a system for updating data, comprising the apparatus described in the third aspect and the apparatus described in the fourth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a structural diagram of a cloud service system provided by an embodiment of the present application;

[0030] Figure 2 It is a structural diagram of another cloud service system provided in an embodiment of the present application;

[0031] Figure 3 is a flow chart of a method for updating data provided by an embodiment of the present application;

[0032] Figure 4 is a flow chart of another method for updating data provided by an embodiment of the present application;

[0033] Figure 5 is a schematic diagram of a device structure for updating data provided in an embodiment of the present application;

[0034] Figure 6 is a schematic diagram of the structure of another device for updating data provided in an embodiment of the present application;

[0035] Figure 7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0036] Figure 8 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0037] Fig. 9 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;

[0038] Fig.10 is a schematic diagram of the structure of another computing device provided in an embodiment of the present application;

[0039] Fig.11 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;

[0040] Fig.12 It is a structural diagram of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0042] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.

[0043] To facilitate understanding of the solutions of the embodiments of the present application, the technical terms involved in this document are first explained below.

[0044] The primary database is the database on the primary site, through which the primary site provides services to users.

[0045] The disaster recovery database is a database on the disaster recovery site, which is used to back up the primary database. When the primary site fails, the disaster recovery site provides the service to users through the disaster recovery database.

[0046] Binlog, a logical log file, is a log file used to record a row of data before and after the modification when a row of data in the primary database is modified.

[0047] The payload is the part of the logical log file other than the file header, and is the file content part of the logical log file.

[0048] A transaction is used to describe a sequence of operations on a database. The sequence of operations includes at least one operation on the database. The at least one operation described by the transaction is either fully executed or not executed at all, and is an indivisible unit of work.

[0049] Transaction number, used to identify the transaction.

[0050] The protection site is a cluster or server whose transmission delay with the primary site is less than the delay threshold, and is used to provide backup services for the logical log files generated by the primary site.

[0051] More and more systems have extremely high requirements for data reliability and availability. In order to ensure high availability of services, the primary site is used to provide services, and the disaster recovery site is used to back up the primary site. The primary site and the disaster recovery site are located in two different areas. When the primary site fails due to a disaster, the disaster recovery site quickly takes over the business to ensure business availability.

[0052] The primary site includes a primary database, and the disaster recovery site includes a disaster recovery database, which is used to back up the primary database. The primary database includes multiple rows of data, each row of data includes multiple data, and the multiple data belong to different columns. The disaster recovery database also includes the multiple rows of data.

[0053] The primary site can modify a row of data in the primary database. Usually, the primary site modifies part of the data in the row of data. After the modification is completed, the primary site needs to send a logical log file (binlog) to the disaster recovery site. The logical log file includes the row of data before the modification and the row of data after the modification. The disaster recovery site receives the logical log file, determines the row of data stored in the disaster recovery database based on the row of data before the modification, and updates the row of data stored in the disaster recovery database to the row of data after the modification, so that the disaster recovery database backs up the primary database.

[0054] However, the primary site usually requires a large amount of network bandwidth resources to send the logical log file to the disaster recovery site, resulting in a serious waste of network bandwidth resources. In addition, the primary site may also save the logical log file, and the primary site requires more storage resources to store the logical log file, resulting in a waste of storage resources. In order to save network bandwidth resources and storage resources, it can be achieved by any of the following embodiments.

[0055] See also Figure 1 An embodiment of the present application provides a cloud service system 100 , wherein the cloud service system 100 includes a primary site 101 and a disaster recovery site 102 , and the primary site 101 can communicate with the disaster recovery site 102 .

[0056] In some embodiments, the primary site 101 is located in a first available area, and the disaster recovery site 102 is located in a second available area. The first available area and the second available area may be two available areas in different locations.

[0057] The so-called off-site means that the first available area and the second available area are areas in two different cities, or areas in two different provinces, or areas in two different countries.

[0058] Since the first available area where the primary site 101 is located and the second available area where the disaster recovery site 102 is located are two available areas in different locations, the distance between the primary site 101 and the disaster recovery site 102 is relatively long, resulting in a large transmission delay between the primary site 101 and the disaster recovery site 102, resulting in the transmission delay between the primary site 101 and the disaster recovery site 102 may be much greater than the delay threshold.

[0059] For example, the delay threshold is a millisecond threshold, and the transmission delay between the primary site 101 and the disaster recovery site 102 is in the second level, so the transmission delay between the primary site 101 and the disaster recovery site 102 may be much greater than the delay threshold. For example, assuming that the delay threshold may be 5 milliseconds, 7 milliseconds, or 8 milliseconds, etc., the transmission delay between the primary site 101 and the disaster recovery site 102 may be 3 seconds, 4 seconds, 5 seconds, or 6 seconds, etc., and the transmission delay is much greater than the time threshold.

[0060] In some embodiments, the primary site 101 and the disaster recovery site 102 may be different clusters (eg, different data centers). The primary site 101 includes at least one computing device, and the disaster recovery site 102 includes at least one computing device.

[0061] See also Figure 1 The primary site 101 further includes a primary database, and the disaster recovery site 102 further includes a disaster recovery database. The disaster recovery database is a backup database of the primary data, and is used to back up the primary database.

[0062] The primary site 101 further includes at least one service, and the primary site 101 is used to run the at least one service. The disaster recovery site 102 also includes the at least one service. When the primary site 101 is normal, the primary site 101 runs the at least one service, obtains data of the at least one service during the running of the at least one service, and saves the data into the primary database.

[0063] When the primary site 101 is normal, the disaster recovery site 102 backs up the data stored in the primary database. That is, the primary site 101 needs to store the data stored in the primary database into the disaster recovery database in the disaster recovery site 102. In this way, when the primary site 101 fails, the disaster recovery site 102 takes over the at least one service and runs the at least one service based on the data stored in the disaster recovery database.

[0064] For any row of data in the primary database, for the sake of convenience, the row of data is called the first primary data set, that is, the primary database includes the first primary data set, and the disaster recovery database also includes the first disaster recovery data set that is the same as the first primary data set. The first primary data set includes multiple first data, and the multiple first data are multiple columns of data in the row of data.

[0065] The master site 101 may modify at least one first data in the first master data set, and modify the at least one first data into at least one second data.

[0066] In some embodiments, before modifying the at least one first data in the first master data set, the master site 101 generates a first transaction, and modifies the at least one first data in the first master data set through the first transaction.

[0067] In order to enable the disaster recovery database to back up the primary database, it is also necessary to modify the at least one first data in the first disaster recovery data set in the disaster recovery database to the at least one second data.

[0068] The primary site 101 generates a first logical log file, which includes first information, second information and the at least one second data, wherein the first information is used to indicate the first primary data set, and the second information is used to indicate the at least one first data in the first primary data set, and sends the first logical log file to the disaster recovery site 102.

[0069] The disaster recovery site 102 receives the first logical log file, and updates the at least one first data in the first disaster recovery data set included in the disaster recovery database to the at least one second data based on the first logical log file.

[0070] Among them, since the first logical log file includes the first information, the second information and the at least one second data, that is, the first logical log file does not need to include the modified entire row of data, the data volume of the first logical log file becomes smaller, thereby reducing the network bandwidth resources required to transmit the first logical log file.

[0071] In some embodiments, the first logical log file also includes the transaction number of the first transaction, and the transaction number of the first transaction is obtained by adding the transaction number of the last transaction assigned by the master site 101. For example, the transaction number of the first transaction is obtained by adding the offset value to the transaction number of the last transaction assigned by the master site 101. Assuming that the offset value is 1 and the transaction number of the last transaction assigned is 9, the transaction number of the first transaction is 10.

[0072] Since the distance between the primary site 101 and the disaster recovery site 102 is long, the primary site 101 needs a long time to send the first logical log file. For example, the primary site 101 may need 2 to 3 seconds to send the first logical log file, or the primary site 101 may need even longer time to send the first logical log file.

[0073] The primary site 101 may fail before sending the first logical log file, so that the disaster recovery site 102 may not receive the first logical log file, and the disaster recovery site 102 cannot update the at least one first data in the first primary data set included in the disaster recovery database to the at least one second data.

[0074] See also Figure 2 The cloud service system 100 also includes a protection site 103, which can communicate with the primary site 101 and the disaster recovery site 103 respectively, and the transmission delay between the primary site 101 and the protection site 103 is less than the delay threshold.

[0075] In some embodiments, the network bandwidth between the primary site 101 and the protection site 103 is also large. Optionally, the network bandwidth between the primary site 101 and the protection site 103 is greater than a bandwidth threshold, so that the primary site 101 can send data to the protection site 103 quickly and earlier.

[0076] In some embodiments, the main site 101 can also generate a first protection file, the file header of the first protection file includes a first transaction set, the payload of the first protection file includes first information, second information and the at least one second data, the first transaction set includes the transaction number of at least one transaction, and the at least one transaction is a transaction generated before the first transaction, and the first protection file is sent to the protection site 103.

[0077] The protection site 103 receives the first protection file and saves the first protection file.

[0078] The primary site 101 generates the first logical log file and the first protection file in parallel, so the primary site 101 may obtain the first logical log file and the first protection file at the same time.

[0079] Since the primary site 101 only needs a short time to send the first protection file to the protection site 103 , the primary site 101 has successfully sent the first protection file to the protection site 103 after generating the first protection file and before the primary site 101 fails.

[0080] In this way, when the first logical log file is not successfully sent to the disaster recovery site 102 before the failure of the primary site 101, the disaster recovery site 102 can query the first protection file whose file header includes the first transaction set from the protection site 103 based on the first transaction set, and based on the payload of the first protection file, update the at least one first data in the first disaster recovery data set included in the disaster recovery database to the at least one second data.

[0081] In some embodiments, the protection site 103 may be a cluster or a server, etc.

[0082] The present application embodiment provides a method 300 for updating data, wherein the method 300 is applied to Figure 1 or Figure 2 The cloud service system 100 shown in FIG. 1 includes a primary database in the cloud service system 100. The primary database includes a first primary data set, which is a row of data in the primary database. The first primary data set includes multiple first data, which are multiple columns of data included in the row of data. The disaster recovery site of the cloud service system 100 includes a disaster recovery database, which includes a first disaster recovery data set that is the same as the first primary data set. Figure 3 , the method 300 includes the following process to update data.

[0083] Step 301: modify at least one first data included in a first master data set in a master database into at least one second data.

[0084] In step 301, a modification request is received from a user, the modification request being used to request modification of the at least one first data in the first master data set to the at least one second data. Based on the modification request, the first master data set in the master database is determined, and the at least one first data in the first master data set is modified to the at least one second data.

[0085] In some embodiments, after receiving the modification request, a first transaction is generated, a transaction number of the first transaction is assigned, and the at least one first data in the first master data set is modified to the at least one second data through the first transaction.

[0086] In some embodiments, the transaction number of the first transaction is increased based on the transaction number of the last transaction generated.

[0087] For a process of modifying the at least one first data in the first master data set into the at least one second data, the first transaction is used to isolate the process. That is, before the at least one first data in the first master data set is successfully modified into the at least one second data, the at least one second data is not visible and cannot be accessed by other users.

[0088] Next, an example is given, referring to the main database shown in Table 1 below, which is a user information table. That is, the main site includes the main database shown in Table 1 below, and the disaster recovery site also includes the disaster recovery database shown in Table 1 below.

[0089] Table 1: User info

[0090] Line Number Name Unit Address telephone number Education Profession Workplace 1 Name1 Address1 Phone1 Undergraduate engineer Enterprise 1 2 Name2 Address2 Phone2 postgraduate front desk Enterprise 2 3 Name3 Address3 Phone3 PhD Department Manager Enterprise 3 …… …… …… …… …… …… ……

[0091] Assume that the first master data set is a row of data with row number 2 in the master database shown in Table 1, the first master data set includes multiple first data, and the multiple first data are row number "2", name "Name2", unit address "Address2", telephone number "Phone2", academic qualification "graduate student", occupation "front desk" and work unit "Enterprise 2".

[0092] Assume that for the work unit "Enterprise 2" and the unit address "Address2" in a row of data with row number "2", the user needs to request to modify the work unit "Enterprise 2" and the unit address "Address2" to "Enterprise 4" and "Address4" respectively. That is, at least one first data that needs to be modified in the first master data set includes the unit address "Address2" and the work unit "Enterprise 2". The user sends a modification request, which includes the row number 2, the work unit "Enterprise 4" and the unit address "Address4". For example, the modification request can be a structured query language (SQL) statement as shown below.

[0093] Update User info

[0094] Set unit address = Address4, work unit = Enterprise 4

[0095] Where Name = Name2.

[0096] Assume that the transaction number of the last transaction is 9. After receiving the modification request, the first transaction is generated, and 1 is added to the transaction number "9" of the last transaction to obtain the transaction number "10" of the first transaction. Based on the modification request, the first master data set (a row of data with row number "2" in Table 1) is determined in the master database shown in Table 1 through the first transaction, and the unit address "Address2" included in the first master data set is modified to "Address4", and the work unit "Enterprise 2" included in the first master data set is modified to "Enterprise 4", and the master database shown in Table 2 is obtained.

[0097] Table 2: User info

[0098] Line Number Name Unit Address telephone number Education Profession Workplace 1 Name1 Address1 Phone1 Undergraduate engineer Enterprise 1 2 Name2 Address4 Phone2 postgraduate front desk Enterprise 4 3 Name3 Address3 Phone3 PhD Department Manager Enterprise 3 …… …… …… …… …… …… ……

[0099] Step 302: Generate a first logical log file, the first logical log file includes first information, second information and the at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data in the first master data set.

[0100] In step 302, when the at least one first data in the first primary data set is modified to the at least one second data, a first logical log file is generated.

[0101] In some embodiments, the first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

[0102] The hash value of the first master data set is obtained by performing a hash operation on the first master data set. Optionally, each row of data in some master databases may not have a row identifier, in which case the first information is the hash value of the first master data set or the first master data set.

[0103] In some embodiments, the second information includes one or more of the following information, a bitmap, or a column identifier of at least one column. The bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, the at least one target data is data in the first master data set other than the at least one first data; the at least one column is the column to which the at least one first data belongs.

[0104] Since the second information may be a bitmap and / or a column identifier of the at least one column, the data volume of the first logical log file can be reduced.

[0105] Since the first information may be a row identifier of a row to which the first primary data set belongs and / or a hash value of the first primary data set, the data volume of the first logical log file can be further reduced.

[0106] In some embodiments, the first logical log file is saved in the master site. Since the data volume of the first logical log file is reduced, the storage resources required to save the first logical log file are reduced. Optionally, the master site may periodically upload the saved logical log file to the file storage system for the user to download the logical log file from the file storage system.

[0107] In some embodiments, the first logical log file also includes a transaction number of the first transaction.

[0108] In some embodiments, when the storage time of the first logical log file reaches a time threshold, the first logical log file is deleted from the primary site. Alternatively, the logical log files stored in the primary site are deleted periodically.

[0109] For example, in the above example, after the unit address "Address2" in the first master data set is modified to "Address4" and the work unit "Enterprise 2" is modified to "Enterprise 4", a first logical log file is generated, and the first logical log file includes the transaction number "10" of the first transaction, the first information, the second information, the unit address "Address4" and the work unit "Enterprise 4". The first information is the row identifier of the row to which the first master data set belongs, and the row identifier is the row number "2". The second information is a bitmap, and the bitmap is 0010001. The bitmap includes two first bits "1" corresponding to the two first data that need to be modified, and five second bits "0" corresponding to the five first data that do not need to be modified. The two first data are the unit address "Address2" and the work unit "Enterprise 2", and the five data are the row number "2", the name "Name2", the phone number "Phone2", the academic qualification "graduate student" and the occupation "front desk".

[0110] In some embodiments, a first protection file may also be generated, the file header of the first protection file includes a first transaction set, the payload of the first protection file includes the first information, the second information and the at least one second data, the first transaction set includes a transaction number of at least one transaction, and the at least one transaction is a transaction generated before the first transaction. Optionally, during implementation:

[0111] When the at least one first data in the first master data set is modified into the at least one second data, a first protection file is generated.

[0112] In some embodiments, the first protected file also includes a transaction number of the first transaction.

[0113] In some embodiments, the first logical log file and the first protection file may be generated in parallel. Optionally, during implementation:

[0114] When the at least one first data in the first master data set is modified to the at least one second data, the first process and the second process are started, a first logical log file is generated by the first process, and a first protection file is generated by the second process. Alternatively, when the primary site modifies the at least one first data in the first master data set to the at least one second data, the first thread and the second thread are started, a first logical log file is generated by the first thread, and a first protection file is generated by the second thread.

[0115] For example, after the unit address "Address2" in the first master data set is modified to "Address4" and the work unit "Enterprise 2" is modified to "Enterprise 4", a first protection file is generated. The file header of the first protection file includes the first transaction set, and the payload of the first protection file includes the above-mentioned first information, the above-mentioned second information, the unit address "Address4" and the work unit "Enterprise 4".

[0116] The first transaction set includes transaction numbers of nine transactions, all of which are transactions occurring before the first transaction, and the transaction numbers of the nine transactions are transaction numbers "1", "2", "3", "4", "5", "6", "7", "8" and "9".

[0117] Step 303: Send a first logical log file to the disaster recovery site, where the first logical log file is used to instruct the disaster recovery site to update the at least one first data in the first disaster recovery data set included in the disaster recovery database to the at least one second data.

[0118] Since the distance between the primary site and the disaster recovery site is relatively long, it may take a long time to send the first logical log file to the disaster recovery site after the first logical log file is generated.

[0119] For example, it may take 2 to 3 seconds to send the first logical log file to the disaster recovery site after the first logical log file is generated, or it may take more than 3 seconds to send the first logical log file to the disaster recovery site after the first logical log file is generated.

[0120] In some embodiments, the first protection file is sent to the protection site, so that the protection site receives the first protection file and saves the first protection file.

[0121] In some embodiments, when the storage time of the first protection file reaches a time threshold, the first protection file is deleted from the protection site. Alternatively, the protection files stored in the protection site are deleted periodically.

[0122] Since the transmission time between the main site and the protection site is less than the delay threshold, the first protection file can be sent to the protection site in a short time after the first protection file is generated. For example, it takes 1 millisecond or several milliseconds to send the first protection file to the protection site after the first protection file is generated.

[0123] In some embodiments, another row of data in the main database may also be modified. For ease of explanation, the other row of data in the main database is referred to as the second main data set. The second main data set includes multiple third data, and the disaster recovery database includes a second disaster recovery data set that is the same as the second main data set.

[0124] That is to say, the first master data set is a row of data in the master database. That is, a row of data in the master database is called the first master data set, and the first master data set includes multiple data, and the multiple data belong to different columns.

[0125] The first disaster recovery data set is a row of data in the disaster recovery database that is the same as the first primary data set. That is, a row of data in the disaster recovery database that is the same as the first primary data set is called the first disaster recovery data set, and the first disaster recovery data set includes multiple data, and the multiple data belong to different columns.

[0126] The second master data set is another row of data in the master database, that is, another row of data in the master database is called the second master data set, and the second master data set also includes multiple data, and the multiple data belong to different columns.

[0127] The second disaster recovery data set is another row of data in the disaster recovery database that is the same as the second main data set. That is, another row of data in the disaster recovery database that is the same as the second main data set is called the second disaster recovery data set, and the second disaster recovery data set also includes multiple data, and the multiple data belong to different columns.

[0128] When a request is received to modify at least one third data in the second master data set into at least one fourth data, a second transaction is generated. The second transaction is the next transaction of the first transaction. The transaction number of the second transaction is increased based on the transaction number of the first transaction. The at least one third data in the second master data set in the master database is modified into the at least one fourth data through the second transaction.

[0129] A second logical log file and a second protection file are generated in parallel. The second logical log file includes third information, fourth information and the at least one fourth data, the third information is used to indicate the second primary data set, and the fourth information is used to indicate the at least one third data. The file header of the second protection file includes a second transaction set, the payload of the second protection file includes the third information, the fourth information and the at least one fourth data, and the second transaction set includes the first transaction set and the transaction number of the first transaction.

[0130] In some embodiments, the second logical log file further includes the transaction number of the second transaction. And / or, the second protection file further includes the transaction number of the second transaction.

[0131] Among them, after the second logical log file and the second protection file are generated, since the transmission delay between the main site and the protection site is short, the second protection file is successfully sent to the protection site in a very short time after the second protection file is generated, so that the protection site saves the second protection file.

[0132] Due to the long transmission delay between the primary site and the disaster recovery site, after sending the second protection file, before sending the second logical log file or during sending the second logical log file, the primary site may fail, causing the disaster recovery site to be unable to receive the second logical log file.

[0133] For example, in the above example, it is assumed that the second master data set is a row of data with row number 3 in the master database shown in Table 2, and the second master data set includes multiple third data, which are row number "3", name "Name3", unit address "Address3", telephone number "Phone3", academic degree "Doctor", occupation "Department Manager" and work unit "Enterprise 3".

[0134] Assume that for the telephone number "Phone3" in the row of data with row number "3", the user needs to request to modify the telephone number "Phone3" to "Phone4". That is, at least one third data to be modified in the second master data set includes the telephone number "Phone3". The user sends a modification request, which includes the row number 3 and the telephone number "Phone4". For example, the modification request can be an SQL statement as shown below.

[0135] Update User info

[0136] Set phone number = Phone4

[0137] Where Name = Name3.

[0138] Assume that the last transaction generated is the first transaction, and the transaction number of the first transaction is 10. After receiving the modification request, a second transaction is generated, and 1 is added to the transaction number "10" of the first transaction to obtain the transaction number "11" of the second transaction. Based on the modification request, the second master data set (a row of data with row number "3" in Table 2) is determined in the master database shown in Table 2 through the second transaction, and the phone number "Phone 3" included in the second master data set is modified to "Phone 4", and the master database shown in Table 3 is obtained.

[0139] Table 3: User info

[0140] Line Number Name Unit Address telephone number Education Profession Workplace 1 Name1 Address1 Phone1 Undergraduate engineer Enterprise 1 2 Name2 Address4 Phone2 postgraduate front desk Enterprise 4 3 Name3 Address3 Phone4 PhD Department Manager Enterprise 3 …… …… …… …… …… …… ……

[0141] A second logical log file and a second protection file are generated in parallel, and the second logical log file includes the transaction number "10" of the second transaction, the third information, the fourth information and the telephone number "Phone4". The third information is the row number "3" of the row to which the second primary data set belongs, and the fourth information is a bitmap, and the bitmap is 0001000. The file header of the second protection file includes the second transaction set, and the payload of the second protection file includes the third information, the fourth information and the telephone number "Phone4", and the second transaction set includes transaction numbers "1", "2", "3", "4", "5", "6", "7", "8", "9" and "10".

[0142] The second protection file is sent to the protection site so that the protection site saves the second protection file. However, after the second protection file is sent, the primary site fails to send the second logical log file, that is, the disaster recovery site cannot receive the second logical log file because the primary site fails.

[0143] In an embodiment of the present application, when at least one first data in the first master data set in the master database is modified to at least one second data, a first logical log file is generated, the first logical log file includes first information, second information and the at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first information. Since the first logical log file includes the first information, the second information and the at least one first data, it is not necessary to include the entire row of data after modification, thereby reducing the amount of data in the first logical log file. In this way, sending the first logical log file to the disaster recovery site reduces the network bandwidth resources required to transmit the first logical log file, thereby avoiding wasting network bandwidth resources. And when saving the first logical log file in the master site, the occupation of the storage resources of the master site is reduced.

[0144] The present application embodiment provides a method 400 for updating data, wherein the method 400 is applied to Figure 1 or Figure 2The cloud service system 100 shown in FIG. 1 includes a primary database in the cloud service system 100. The primary database includes a first primary data set, which is a row of data in the primary database. The first primary data set includes multiple first data, which are multiple columns of data included in the row of data. The disaster recovery site of the cloud service system 100 includes a disaster recovery database, which includes a first disaster recovery data set that is the same as the first primary data set. Figure 4 , the method 400 includes the following process to update data.

[0145] Step 401: Receive a first logical log file, the first logical log file comprising first information, second information and the at least one second data, the first information is used to indicate a first master data set, and the second information is used to indicate the at least one first data in the first master data set.

[0146] In some embodiments, the first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

[0147] The hash value of the first master data set is obtained by performing a hash operation on the first master data set.

[0148] In some embodiments, the second information includes one or more of the following information, a bitmap, or a column identifier of at least one column. The bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, the at least one target data is data in the first master data set other than the at least one first data; the at least one column is the column to which the at least one first data belongs.

[0149] In some embodiments, the first logical log file further includes a transaction number of a first transaction, where the first transaction is used to modify at least one first data in the first master data information in the master database into at least one second data.

[0150] For example, the first logical log file sent by the primary site is received, and the first logical log file includes the transaction number "10" of the first transaction, the first information, the second information, the unit address "Address4" and the work unit "Enterprise 4". The first information is the row identifier of the row to which the first primary data set belongs, and the row identifier is the row number "2", and the second information is a bitmap, and the bitmap is 0010001.

[0151] Step 402: Based on the first logical log file, update the at least one first data in the first disaster recovery data set in the disaster recovery database to the at least one second data.

[0152] In step 402, a first transaction is allocated based on the transaction number of the first transaction; based on the first information and the second information, the at least one first data in the first disaster recovery data set in the disaster recovery database is updated to the at least one second data through the first transaction.

[0153] In step 402, the at least one first data in the first disaster recovery data set in the disaster recovery database may be updated to the at least one second data through the following processes 4021-4023.

[0154] 4021: Determine a first disaster recovery data set in a disaster recovery database based on the first information.

[0155] In some embodiments, the first information includes a row identifier of the first primary data set. Based on the row identifier, a row of data identical to the first primary data set is determined from the disaster recovery database, and the row of data is the first disaster recovery data set.

[0156] For example, the disaster recovery site includes the disaster recovery database shown in Table 1 above, and the first information includes a row identifier of the first primary data set, the row identifier is row number "2", and based on the row number "2", a row of data identical to the first primary data set is determined from the disaster recovery database shown in Table 1 above, and the row of data is a row of data with row number "2" in Table 1. That is, the first disaster recovery data set is a row of data with row number "2" in Table 1.

[0157] In some embodiments, the first information includes a hash value of the first primary data set, and the hash value of each row of data in the disaster recovery database is calculated to obtain a row of data having the same hash value as the first primary data set, which is the first disaster recovery data set.

[0158] In some embodiments, the first information includes a first master data set, a hash value of the first master data set is calculated, and a hash value of each row of data in the disaster recovery database is calculated to obtain a row of data whose hash value is the same as the hash value of the first master data set, which row of data is the first disaster recovery data set.

[0159] 4022: Based on the second information, determine the at least one first data in the first disaster recovery data set.

[0160] In some embodiments, the second information is a bitmap, and based on at least one first bit in the bitmap, at least one first data in the first disaster recovery data set corresponding to the at least one first bit is determined.

[0161] For example, the first disaster recovery data set is a row of data with row number "2" in the above Table 1. The second information is a bitmap, the bitmap is 0010001, the bitmap includes two first bits "1", based on the two first bits "1", two first data corresponding to the two first bits in the first disaster recovery data set are determined, and the two first data are the unit address "Address2" and the work unit "Enterprise 2".

[0162] In some embodiments, the second information is a column identifier of at least one column, and based on the column identifier of the at least one column, at least one first data belonging to the at least one column in the first disaster recovery data set is determined.

[0163] 4023: Modify the at least one first data in the first disaster recovery data set into the at least one second data.

[0164] For example, the first logical log file includes two second data, which are the unit address "Address4" and the work unit "Enterprise 4". The unit address "Address2" included in the row numbered "2" in Table 1 is modified to "Address4", and the work unit "Enterprise 2" is modified to "Enterprise 4", and the disaster recovery database shown in Table 2 is obtained.

[0165] After receiving the first logical log file, it may be detected that the primary site fails. In this way, when the primary site fails, the following operations 11 to 13 are also performed.

[0166] 11: Obtain a second transaction set based on the transaction number of the first transaction included in the first logical log file, where the second transaction set includes the transaction number of the first transaction and the transaction number of at least one transaction generated before the first transaction.

[0167] For example, the transaction number of the first transaction included in the first logical log file is "10", and nine transactions are generated before the first transaction. The transaction numbers of the nine transactions are "1", "2", "3", "4", "5", "6", "7", "8" and "9", so the second transaction set including transaction numbers "1", "2", "3", "4", "5", "6", "7", "8", "9" and "10" is obtained.

[0168] 12: Obtain from the protection site a second protection file whose file header includes a second transaction set.

[0169] In some embodiments, the protection site stores the received protection files in the order in which they are received, so that the storage order of the protection files in the protection site is the same as the generation order of the protection files. Optionally, the second protection file and the protection files whose storage order is after the second protection file can be obtained from the protection site, and the required protection files can be obtained at one time, thereby improving the acquisition efficiency.

[0170] During implementation, a request is sent to the protection site, the request includes the second transaction set, so that the protection site obtains the second protection file whose file header includes the second transaction set, and receives the second protection file sent by the protection site. Optionally, each protection file sent by the protection site and whose storage order is after the second protection file is also received.

[0171] In some embodiments, the protection site may obtain a second protection file including a second transaction set in the file header through the following process (1)-(4).

[0172] (1): Start scanning from the last protected file saved by the protection site.

[0173] (2): Compare the transaction set included in the file header of the scanned protected file with the second transaction set. If the two are found to be the same, execute (3); if the two are found to be different, execute (4).

[0174] (3): Determine that the scanned protection file is the second protection file whose file header includes the second transaction set, and end and return.

[0175] (4): Scan the last protected file and return to execute (2).

[0176] If the two are found to be different, it is determined that the scanned protected file is not the second protected file whose file header includes the second transaction set.

[0177] The file header of the protection file includes a transaction set, and the transaction set can be easily obtained from the file header of the protection file. In addition, the amount of calculation required to compare the two transaction sets is small, so the protection site can quickly obtain the second protection file from the saved protection file. In addition, by scanning the protection files in reverse order, that is, scanning from the last saved protection file forward, the number of protection files that need to be compared can be reduced, and the speed of obtaining the second protection file can be accelerated.

[0178] Starting the scan from the last protected file saved in the protection site can reduce the number of protected files that need to be compared, and quickly scan the second protected file whose file header includes the second transaction set.

[0179] The protection site also obtains each protection file whose storage order is after the second protection file, and sends the second protection file and each protection file whose storage order is after the second protection file. As for each logical log file generated in parallel with the protection file, due to the failure of the primary site, none of them is successfully sent to the disaster recovery site by the primary site.

[0180] For example, the protection site stores a first protection file and a second protection file. The file header of the first protection file includes a first transaction set, the first transaction set includes transaction numbers "1", "2", "3", "4", "5", "6", "7", "8" and "9", and the payload of the first protection file includes first information, second information, unit address "Address4" and work unit "Enterprise 4".

[0181] The file header of the second protected file includes a second transaction set, the second transaction set includes transaction numbers "1", "2", "3", "4", "5", "6", "7", "8", "9" and "10", and the payload of the second protected file includes third information, fourth information and telephone number "Phone4".

[0182] The protection site receives an acquisition request, the acquisition request includes a second transaction set, and the second transaction set includes transaction numbers "1", "2", "3", "4", "5", "6", "7", "8", "9" and "10". The second transaction set is compared with the transaction set in the file header of the last protection file (the second protection file) saved in the protection site, and the two are compared to be the same, and it is determined that the last protection file is the second protection file whose file header includes the second transaction set.

[0183] 13: Based on the payload of the second protection file, update the at least one third data in the second disaster recovery data set to the at least one fourth data.

[0184] For a detailed implementation process of updating the at least one third data in the second disaster recovery data set to the at least one fourth data, refer to the above-mentioned processes 4021-4023, which will not be described in detail here.

[0185] For example, the payload of the second protection file includes the third information, the fourth information and the telephone number "Phone4", the third information is the row number "3", and the fourth information is the bitmap 0001000. Based on the row number "3", the second disaster recovery data set (a row of data with the row number "3" in Table 2) is determined in the disaster recovery database shown in Table 2 above, and based on the first bit "1" in the fourth information, the telephone number "Phone3" included in the second disaster recovery data set is determined, and the telephone number "Phone3" is modified to "Phone 4", thereby obtaining the disaster recovery database shown in Table 3 above.

[0186] For each protection file that is stored after the second protection file in order, based on the payload of each protection file, the data in the disaster recovery database is updated with reference to the above-mentioned processes 4021 to 4023.

[0187] In an embodiment of the present application, the first logical log file includes first information, second information and at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first information. Since the first logical log file includes the first information, the second information and the at least one first data, it is not necessary to include the entire row of modified data, thereby reducing the amount of data in the first logical log file. In this way, when the primary site sends the first logical log file, it reduces the network bandwidth resources required to transmit the first logical log file, thereby avoiding wasting network bandwidth resources. In addition, the second protection file can be quickly compared through the second transaction set, and the second protection file can be used to avoid missing data in the primary database, and the efficiency of updating data in the disaster recovery database can be improved.

[0188] See also Figure 5 The embodiment of the present application provides a device 500 for updating data, which is applied to a cloud service system. The cloud service system includes the device 500 and a disaster recovery site. The master database in the device 500 includes a first master data set, which is a row of data in the master database. The first master data set includes multiple first data, each of which is a column of data in the row of data. The disaster recovery database in the disaster recovery site includes a first disaster recovery data set that is the same as the first master data set. The device 500 can be deployed at Figure 1 or Figure 2 The main site 101 in the cloud service system 100 shown in FIG. 1 may be deployed on the Figure 3 The method 300 is shown on the main site. The device 500 includes:

[0189] The processing unit 501 is configured to modify at least one first data in the first master data set into at least one second data;

[0190] The processing unit 501 is further used to generate a logical log file, the logical log file including the first information, the second information and the at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data;

[0191] The sending unit 502 is used to send a logical log file to the disaster recovery site, where the logical log file is used to instruct the disaster recovery site to update the at least one first data in the first disaster recovery data set to the at least one second data.

[0192] Optionally, the detailed implementation process of the processing unit 501 modifying at least one first data in the first master data set into at least one second data is shown in Figure 3 The relevant contents in step 301 of the method 300 are not described in detail here.

[0193] Optionally, the detailed implementation process of the processing unit 501 generating the logical log file is shown in Figure 3 The relevant contents in step 302 of the method 300 are not described in detail here.

[0194] Optionally, the detailed implementation process of the sending unit 502 sending the logical log file to the disaster recovery site is shown in Figure 3 The relevant contents in step 302 of the method 300 are not described in detail here.

[0195] Optionally, the first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

[0196] Optionally, the second information includes one or more of the following information: a bitmap, or a column identifier of at least one column;

[0197] The bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, wherein the at least one target data is data in the first main data set other than the at least one first data; and the at least one column is the column to which the at least one first data belongs.

[0198] Optionally, the processing unit 501 is configured to:

[0199] generating a first transaction;

[0200] The at least one first data in the first primary data set is modified into the at least one second data through a first transaction, wherein the logical log file further includes a transaction number of the first transaction.

[0201] Optionally, the processing unit 501 generates a first transaction, and the detailed implementation process of modifying the at least one first data in the first master data set into the at least one second data through the first transaction is shown in FIG. Figure 3 The relevant contents in step 301 of the method 300 are not described in detail here.

[0202] Optionally, the cloud service system further includes a protection site, and the transmission delay between the device 500 and the protection site is less than a delay threshold;

[0203] The processing unit 501 is further configured to generate a first protection file, wherein the file header of the first protection file includes a first transaction set, the payload of the first protection file includes the first information, the second information and the at least one second data, the first transaction set includes a transaction number of at least one transaction, and the at least one transaction is a transaction generated before the first transaction;

[0204] The sending unit 502 is further configured to send the first protection file to the protection site, so that the protection site saves the first protection file.

[0205] Optionally, the detailed implementation process of the processing unit 501 generating the first protection file is shown in Figure 3 The relevant contents in step 302 of the method 300 are not described in detail here.

[0206] Optionally, the detailed implementation process of the sending unit 502 sending the first protection file to the protection site is shown in Figure 3 The relevant contents in step 303 of the method 300 are not described in detail here.

[0207] Optionally, the primary database further includes a second primary data set, the second primary data set includes a plurality of third data, and the disaster recovery database further includes a second disaster recovery data set that is the same as the second primary data set;

[0208] The processing unit 501 is further configured to generate a second transaction, where the second transaction is a next transaction of the first transaction; modify at least one third data in the second main data set to at least one fourth data through the second transaction; generate a second protection file, where the file header of the second protection file includes the second transaction set, the payload of the second protection file includes third information, fourth information and the at least one fourth data, the third information is used to indicate the second main data set, the fourth information is used to indicate the at least one third data, and the second transaction set includes the first transaction set and the transaction number of the first transaction;

[0209] The sending unit is further used to send the second protection file to the protection site so that the protection site saves the second protection file.

[0210] Optionally, the processing unit 501 generates a second transaction, modifies at least one third data in the second master data set into at least one fourth data through the second transaction, and generates a second protection file. Figure 3 The relevant contents in step 303 of the method 300 are not described in detail here.

[0211] Optionally, the detailed implementation process of the sending unit 502 sending the second protection file to the protection site is shown in Figure 3 The relevant contents in step 303 of the method 300 are not described in detail here.

[0212] Optionally, the device 500 and the protection site are located in the same machine room, or the device 500 and the protection site are located in different machine rooms in the same available area.

[0213] In the embodiment of the present application, since the logical log file generated by the processing unit includes the first information, the second information and at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data. In this way, the first disaster recovery data set in the disaster recovery database can be obtained through the first information, and the at least one first data that needs to be modified in the first disaster recovery data set can be obtained through the second information, so that the logical log file can include the at least one second data, and does not need to include the modified entire line of data. Thereby reducing the amount of data in the logical log file, reducing the network bandwidth resources required by the sending unit to transmit the logical log file, and saving network bandwidth resources.

[0214] See also Figure 6 The embodiment of the present application provides a device 600 for updating data, the device 600 is applied to a cloud service system, the cloud service system includes a master site and the device 600, the master database in the master site includes a first master data set, the first master data set is a row of data in the master database, the first master data set includes multiple first data, each of the multiple first data is a column of data in the row of data, and the disaster recovery database in the device 600 includes the first disaster recovery data set that is the same as the first master data set. The device 600 can be deployed at Figure 1 or Figure 2 Alternatively, it can be deployed on the disaster recovery site 102 in the cloud service system 100 shown in FIG. Figure 4 The method 400 is shown at the disaster recovery site. The device 600 includes:

[0215] A receiving unit 601 is used to receive a logical log file, where the logical log file includes first information, second information, and at least one second data, where the first information is used to indicate a first master data set, and the second information is used to indicate at least one first data in the first master data set, where the at least one first data in the first master data set is modified to the at least one second data;

[0216] The processing unit 602 is configured to update the at least one first data in the first disaster recovery data set to the at least one second data based on the logical log file.

[0217] Optionally, the detailed implementation process of receiving the logical log file by the receiving unit 601 is shown in Figure 4 The relevant contents in step 401 of the method 400 are not described in detail here.

[0218] Optionally, the processing unit 602 updates the at least one first data in the first disaster recovery data set to the at least one second data based on the logical log file. Figure 4 The relevant contents in step 402 of the method 400 are not described in detail here.

[0219] Optionally, the first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

[0220] Optionally, the second information includes one or more of the following information: a bitmap, or a column identifier of at least one column;

[0221] The bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, wherein the at least one target data is data in the first main data set other than the at least one first data; or, the at least one column is the column to which the at least one first data belongs.

[0222] Optionally, the logical log file further includes a transaction number of the first transaction. The processing unit 602 is configured to:

[0223] Allocating the first transaction based on the transaction number of the first transaction;

[0224] Based on the first information and the second information, the at least one first data in the first disaster recovery data set is updated to the at least one second data through a first transaction.

[0225] Optionally, the processing unit 602 allocates the first transaction based on the transaction number of the first transaction. Figure 4 The relevant contents in step 402 of the method 400 are not described in detail here.

[0226] Optionally, the processing unit 602 updates the at least one first data in the first disaster recovery data set to the at least one second data through the first transaction based on the first information and the second information. Figure 4 The relevant contents in step 402 of the method 400 are not described in detail here.

[0227] Optionally, the cloud service system also includes a protection site, the transmission delay between the main site and the protection site is less than a delay threshold, the main database also includes a second main data set, the second main data set includes multiple third data, the disaster recovery database also includes a second disaster recovery data set that is identical to the second main data set, the protection site stores a second protection file, the file header of the second protection file includes a second transaction set, the payload of the second protection file includes third information, fourth information and at least one fourth data, the third information is used to indicate the second main data set, the fourth information is used to indicate at least one third data in the second main data set, the at least one third data in the second main data set is modified to the at least one fourth data, and the second transaction set includes the transaction number of the first transaction and the transaction number of at least one transaction that occurred before the first transaction.

[0228] The processing unit 602 is further configured to:

[0229] When the primary site fails, obtaining a second transaction set based on a transaction number of a first transaction included in the logical log file;

[0230] Obtaining from the protection site a second protection file whose file header includes a second transaction set;

[0231] Based on the payload of the second protection file, the at least one third data in the second disaster recovery data set is updated to the at least one fourth data.

[0232] Optionally, the detailed implementation process of the processing unit 602 obtaining the second transaction set based on the transaction number of the first transaction included in the logical log file is shown in Figure 4 The relevant contents in operation 11 of the method 400 are not described in detail here.

[0233] Optionally, the processing unit 602 obtains the second protection file whose file header includes the second transaction set from the protection site. Figure 4 The relevant contents in operation 12 of the method 400 are not described in detail here.

[0234] Optionally, the processing unit 602 updates the at least one third data in the second disaster recovery data set to the at least one fourth data based on the payload of the second protection file. Figure 4 The relevant contents in operation 13 of the method 400 are not described in detail here.

[0235] Optionally, the primary site and the protection site are located in the same computer room, or the primary site and the protection site are located in different computer rooms in the same available area.

[0236] In the embodiment of the present application, since the logical log file received by the receiving unit includes the first information, the second information and at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data. In this way, the processing unit can obtain the first disaster recovery data set in the disaster recovery database through the first information, and can obtain the at least one first data that needs to be modified in the first disaster recovery data set through the second information, so that the logical log file can include the at least one second data, and does not need to include the modified entire line of data. Thereby reducing the data volume of the logical log file, reducing the network bandwidth resources required for transmitting the logical log file, and saving network bandwidth resources.

[0237] See also Figure 7 , the present application embodiment provides a computing device 700. For example, the computing device 700 may be Figure 1 or Figure 2 The equipment in the main site of the cloud service system shown, or Figure 3 Devices in a primary site in method 300 are shown.

[0238] like Figure 7 As shown, computing device 700 includes: bus 702, processor 704, memory 706 and communication interface 708. Processor 704, memory 706 and communication interface 708 communicate through bus 702. Computing device 700 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 700.

[0239] The bus 702 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus 704 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 704 may include a path for transmitting information between various components of the computing device 700 (eg, the processor 704, the memory 706, and the communication interface 708).

[0240] The processor 704 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

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

[0242] See also Figure 7 , the memory 706 stores executable program codes, and the processor 704 executes the executable program codes to respectively implement Figure 5 The functions of the processing unit 501 and the sending unit 502 in the device 500 are shown in the figure, so as to realize the above Figure 3 The method 300 for updating data provided in the illustrated embodiment. That is, the memory 706 stores the data for executing the above Figure 3 The illustrated embodiment provides instructions for the method 300 of updating data. Or,

[0243] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks.

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

[0245] like Figure 8 As shown, the computing device cluster includes at least one computing device 700. The memory 706 in one or more computing devices 700 in the computing device cluster may store the same Figure 3 The illustrated embodiment provides instructions for a method 300 of updating data.

[0246] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store a program for executing Figure 3 The illustrated embodiment provides a partial instruction of the method 300 for updating data. In other words, the combination of one or more computing devices 700 can jointly execute the method for executing Figure 3 The illustrated embodiment provides instructions for a method 300 of updating data.

[0247] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig. 9 A possible implementation is shown. Fig. 9 As shown, two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.

[0248] In this type of possible implementation, the memory 706 in the computing device 700A stores the execution Figure 5 Instructions for the functions of the processing unit 501 in the illustrated embodiment. Meanwhile, the memory 706 in the computing device 700B stores instructions for executing the functions of the processing unit 501 in the illustrated embodiment. Figure 5 Instructions for the functionality of the sending unit 502 in the illustrated embodiment.

[0249] It should be understood that Fig. 9 The functions of the computing device 700A shown in FIG. 7 may also be completed by multiple computing devices 700. Similarly, the functions of the computing device 700B may also be completed by multiple computing devices 700.

[0250] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig. 9 The difference is that the memory 706 in one or more computing devices 700 in the computing device cluster may store the same memory for executing Figure 3 The illustrated embodiment provides instructions for a method 300 of updating data.

[0251] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store a program for executing Figure 3 The illustrated embodiment provides a partial instruction of the method 300 for updating data. In other words, the combination of one or more computing devices 700 can jointly execute the method for executing Figure 3 The illustrated embodiment provides instructions for a method 300 of updating data.

[0252] See also Fig.10 , the present application embodiment provides a computing device 1000. For example, the computing device 1000 may be Figure 1 or Figure 2 The equipment in the disaster recovery site in the cloud service system shown, or Figure 4 The device in the disaster recovery site in the method 400 is shown.

[0253] like Fig.10As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006 and communication interface 1008. Processor 1004, memory 1006 and communication interface 1008 communicate through bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1000.

[0254] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 The bus 1004 may include a path for transmitting information between various components of the computing device 1000 (eg, the processor 1004, the memory 1006, and the communication interface 1008).

[0255] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

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

[0257] See also Fig.10 , the memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to respectively implement Figure 6 The functions of the receiving unit 601 and the processing unit 602 in the device 600 are shown in FIG. Figure 4The embodiment shown provides a method 400 for updating data. That is, the memory 1006 stores the data for executing the above Figure 4 The illustrated embodiment provides instructions for a method 400 for updating data. Or,

[0258] The communication interface 1008 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.

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

[0260] like Fig.11 As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same Figure 4 The illustrated embodiment provides instructions for a method 400 of updating data.

[0261] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store a program for executing Figure 4 The illustrated embodiment provides a partial instruction of the method 400 for updating data. In other words, the combination of one or more computing devices 1000 can jointly execute the method for executing Figure 4 The illustrated embodiment provides instructions for a method 400 of updating data.

[0262] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.12 A possible implementation is shown. Fig.12 As shown, two computing devices 1000A and 1000B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.

[0263] In this type of possible implementation, the memory 1006 in the computing device 1000A stores the execution Figure 6 Instructions for the functions of the processing unit 602 in the illustrated embodiment. Meanwhile, the memory 1006 in the computing device 1000B stores instructions for executing the functions of the processing unit 602 in the illustrated embodiment. Figure 6 Instructions for the functionality of the receiving unit 601 in the illustrated embodiment.

[0264] It should be understood that Fig.12 The functions of the computing device 1000A shown in FIG. 1000A may also be completed by multiple computing devices 1000. Similarly, the functions of the computing device 1000B may also be completed by multiple computing devices 1000.

[0265] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig.12 The difference is that the memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same memory for executing Figure 4 The illustrated embodiment provides instructions for a method 400 of updating data.

[0266] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store a program for executing Figure 4 The illustrated embodiment provides a partial instruction of the method 400 for updating data. In other words, the combination of one or more computing devices 1000 can jointly execute the method for executing Figure 4 The illustrated embodiment provides instructions for a method 400 of updating data.

[0267] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes Figure 3 or Figure 4 The illustrated embodiment provides a method for updating data.

[0268] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute Figure 3 or Figure 4 The illustrated embodiment provides a method for updating data.

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

[0270] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for updating data, It is characterized in that The method is applied to a cloud service system, the cloud service system includes a primary site and a disaster recovery site, the primary database in the primary site includes a first primary data set, the first primary data set is a row of data in the primary database, the first primary data set includes a plurality of first data, each first data in the plurality of first data is a column of data in the row of data, the disaster recovery database in the disaster recovery site includes a first disaster recovery data set that is the same as the first primary data set, the method includes: modifying at least one first data in the first master data set into at least one second data; Generate a logical log file, the logical log file comprising first information, second information and the at least one second data, the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data; The logical log file is sent to the disaster recovery site, where the logical log file is used to instruct the disaster recovery site to update the at least one first data in the first disaster recovery data set to the at least one second data.

2. The method according to claim 1, It is characterized in that The first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

3. The method according to claim 1 or 2, It is characterized in that The second information includes one or more of the following information: a bitmap, or a column identifier of at least one column; Wherein, the bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, wherein the at least one target data is data in the first main data set other than the at least one first data; and the at least one column is the column to which the at least one first data belongs.

4. The method according to any one of claims 1 to 3, It is characterized in that The modifying at least one first data in the first master data set into at least one second data comprises: generating a first transaction; The at least one first data in the first primary data set is modified into the at least one second data through the first transaction, wherein the logical log file further includes a transaction number of the first transaction.

5. The method according to claim 4, It is characterized in that The cloud service system further includes a protection site, the transmission delay between the primary site and the protection site is less than a delay threshold, and the method further includes: Generate a first protection file, wherein the file header of the first protection file includes a first transaction set, the payload of the first protection file includes the first information, the second information and the at least one second data, the first transaction set includes a transaction number of at least one transaction, and the at least one transaction is a transaction generated before the first transaction; The first protection file is sent to the protection site, so that the protection site saves the first protection file.

6. The method according to claim 5, It is characterized in that The primary database further includes a second primary data set, the second primary data set includes a plurality of third data, the disaster recovery database further includes a second disaster recovery data set that is the same as the second primary data set, and after the first transaction is generated, further includes: generating a second transaction, where the second transaction is a next transaction of the first transaction; modifying at least one third data in the second master data set into at least one fourth data through the second transaction; Generate a second protection file, wherein the file header of the second protection file includes a second transaction set, the payload of the second protection file includes third information, fourth information and the at least one fourth data, the third information is used to indicate the second primary data set, the fourth information is used to indicate the at least one third data, and the second transaction set includes the first transaction set and the transaction number of the first transaction; The second protection file is sent to the protection site, so that the protection site saves the second protection file.

7. The method according to claim 5 or 6, It is characterized in that The primary site and the protection site are located in the same computer room, or the primary site and the protection site are located in different computer rooms in the same available area.

8. A method for updating data, It is characterized in that The method is applied to a cloud service system, the cloud service system includes a primary site and a disaster recovery site, the primary database in the primary site includes a first primary data set, the first primary data set is a row of data in the primary database, the first primary data set includes a plurality of first data, each first data in the plurality of first data is a column of data in the row of data, the disaster recovery database in the disaster recovery site includes a first disaster recovery data set that is the same as the first primary data set, the method includes: receiving a logical log file, the logical log file comprising first information, second information, and at least one second data, the first information being used to indicate the first master data set, the second information being used to indicate at least one first data in the first master data set, the at least one first data in the first master data set being modified to the at least one second data; Based on the logical log file, the at least one first data in the first disaster recovery data set is updated to the at least one second data.

9. The method according to claim 8, It is characterized in that The first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

10. The method according to claim 8 or 9, It is characterized in that The second information includes one or more of the following information: a bitmap, or a column identifier of at least one column; The bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, wherein the at least one target data is data in the first main data set other than the at least one first data; or, the at least one column is the column to which the at least one first data belongs.

11. The method according to any one of claims 8 to 10, It is characterized in that The logical log file further includes a transaction number of the first transaction, and the updating of the at least one first data in the first disaster recovery data set to the at least one second data based on the logical log file includes: allocating the first transaction based on the transaction number of the first transaction; Based on the first information and the second information, the at least one first data in the first disaster recovery data set is updated to the at least one second data through the first transaction.

12. The method according to claim 11, It is characterized in that The cloud service system further includes a protection site, a transmission delay between the primary site and the protection site is less than a delay threshold, the primary database further includes a second primary data set, the second primary data set includes a plurality of third data, the disaster recovery database further includes a second disaster recovery data set that is the same as the second primary data set, the protection site stores a second protection file, a file header of the second protection file includes a second transaction set, a payload of the second protection file includes third information, fourth information and at least one fourth data, the third information is used to indicate the second primary data set, the fourth information is used to indicate at least one third data in the second primary data set, the at least one third data in the second primary data set is modified to the at least one fourth data, and the second transaction set includes a transaction number of the first transaction and a transaction number of at least one transaction that occurred before the first transaction; After receiving the logical log file, the method further includes: When the primary site fails, acquiring the second transaction set based on the transaction number of the first transaction included in the logical log file; Acquire, from the protection site, the second protection file whose file header includes the second transaction set; Based on the payload of the second protection file, the at least one third data in the second disaster recovery data set is updated to the at least one fourth data.

13. The method according to claim 12, It is characterized in that The primary site and the protection site are located in the same computer room, or the primary site and the protection site are located in different computer rooms in the same available area.

14. A device for updating data, It is characterized in that The device is applied to a cloud service system, the cloud service system includes the device and a disaster recovery site, the master database in the device includes a first master data set, the first master data set is a row of data in the master database, the first master data set includes a plurality of first data, each of the plurality of first data is a column of data in the row of data, the disaster recovery database in the disaster recovery site includes a first disaster recovery data set that is the same as the first master data set, and the device includes: a processing unit, configured to modify at least one first data in the first master data set into at least one second data; The processing unit is further used to generate a logical log file, wherein the logical log file includes first information, second information and the at least one second data, wherein the first information is used to indicate the first master data set, and the second information is used to indicate the at least one first data; A sending unit is used to send the logical log file to the disaster recovery site, where the logical log file is used to instruct the disaster recovery site to update the at least one first data in the first disaster recovery data set to the at least one second data.

15. The device according to claim 14, It is characterized in that The first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

16. The device according to claim 14 or 15, It is characterized in that The second information includes one or more of the following information: a bitmap, or a column identifier of at least one column; Wherein, the bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, wherein the at least one target data is data in the first main data set other than the at least one first data; and the at least one column is the column to which the at least one first data belongs.

17. The device according to any one of claims 14 to 16, It is characterized in that The processing unit is used for: generating a first transaction; The at least one first data in the first primary data set is modified into the at least one second data through the first transaction, wherein the logical log file further includes a transaction number of the first transaction.

18. The device according to claim 17, It is characterized in that The cloud service system further includes a protection site, and a transmission delay between the device and the protection site is less than a delay threshold; The processing unit is further configured to obtain a first protection file, wherein a file header of the first protection file includes a first transaction set, a payload of the first protection file includes the first information, the second information, and the at least one second data, the first transaction set includes a transaction number of at least one transaction, and the at least one transaction is a transaction generated before the first transaction; The sending unit is further configured to send the first protection file to the protection site, so that the protection site saves the first protection file.

19. The device according to claim 18, It is characterized in that The primary database further includes a second primary data set, the second primary data set includes a plurality of third data, and the disaster recovery database further includes a second disaster recovery data set that is the same as the second primary data set; The processing unit is further configured to generate a second transaction, where the second transaction is a next transaction of the first transaction; modifying at least one third data in the second master data set into at least one fourth data through the second transaction; Generate a second protection file, wherein the file header of the second protection file includes a second transaction set, the payload of the second protection file includes third information, fourth information and the at least one fourth data, the third information is used to indicate the second primary data set, the fourth information is used to indicate the at least one third data, and the second transaction set includes the first transaction set and the transaction number of the first transaction; The sending unit is further configured to send the second protection file to the protection site, so that the protection site saves the second protection file.

20. The device according to claim 18 or 19, It is characterized in that The device and the protection site are located in the same machine room, or the device and the protection site are located in different machine rooms in the same available area.

21. A device for updating data, It is characterized in that The device is applied to a cloud service system, the cloud service system includes a main site and the device, the main database in the main site includes a first main data set, the first main data set is a row of data in the main database, the first main data set includes a plurality of first data, each of the plurality of first data is a column of data in the row of data, the disaster recovery database in the device includes a first disaster recovery data set that is the same as the first main data set, and the device includes: a receiving unit, configured to receive a logical log file, the logical log file comprising first information, second information, and at least one second data, the first information being used to indicate the first master data set, the second information being used to indicate at least one first data in the first master data set, the at least one first data in the first master data set being modified to the at least one second data; A processing unit is used to update the at least one first data in the first disaster recovery data set to the at least one second data based on the logical log file.

22. The device according to claim 21, It is characterized in that The first information includes one or more of the following information: a row identifier of a row to which the first master data set belongs, a hash value of the first master data set, or the first master data set.

23. The device according to claim 21 or 22, It is characterized in that The second information includes one or more of the following information: a bitmap, or a column identifier of at least one column; The bitmap includes at least one first bit corresponding to the at least one first data, and a second bit corresponding to at least one target data, wherein the at least one target data is data in the first main data set other than the at least one first data; or, the at least one column is the column to which the at least one first data belongs.

24. The device according to any one of claims 21 to 23, It is characterized in that The logical log file further includes a transaction number of the first transaction, and the processing unit is configured to: allocating the first transaction based on the transaction number of the first transaction; Based on the first information and the second information, the at least one first data in the first disaster recovery data set is updated to the at least one second data through the first transaction.

25. The device according to claim 24, It is characterized in that The cloud service system further includes a protection site, a transmission delay between the primary site and the protection site is less than a delay threshold, the primary database further includes a second primary data set, the second primary data set includes a plurality of third data, the disaster recovery database further includes a second disaster recovery data set that is the same as the second primary data set, the protection site stores a second protection file, a file header of the second protection file includes a second transaction set, a payload of the second protection file includes third information, fourth information and at least one fourth data, the third information is used to indicate the second primary data set, the fourth information is used to indicate at least one third data in the second primary data set, the at least one third data in the second primary data set is modified to the at least one fourth data, and the second transaction set includes a transaction number of the first transaction and a transaction number of at least one transaction that occurred before the first transaction; The processing unit is further used for: When the primary site fails, acquiring the second transaction set based on the transaction number of the first transaction included in the logical log file; Acquire, from the protection site, the second protection file whose file header includes the second transaction set; Based on the payload of the second protection file, the at least one third data in the second disaster recovery data set is updated to the at least one fourth data.

26. The device according to claim 25, It is characterized in that The primary site and the protection site are located in the same computer room, or the primary site and the protection site are located in different computer rooms in the same available area.

27. A system for updating data, It is characterized in that The system comprises the device according to any one of claims 14-20 and the device according to any one of claims 21-26.

28. A computing device cluster, It is characterized in that The computing device cluster includes at least one computing device, each of the at least one computing device includes at least one processor and at least one memory, and the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method according to any one of claims 1 to 13.

29. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a computer, the method according to any one of claims 1 to 13 is implemented.

30. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Cited By

  • Data update method and apparatus, system, and storage medium

    EP4708054A1

  • Data update method and apparatus, system, and storage medium

    WO2024244390A1