Data update method and apparatus, system, and storage medium
By generating a logical log file containing the first information of row identification or hash value and the second information of bitmap or column identification, the problem of network bandwidth waste in the cloud service system when data synchronization is synchronized after the main site failure is solved, and resources are realized savings and data synchronization efficiency improvement.
Patent Information
- Application Number
- PCT/CN2023/138865
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-30
- Filing Date
- 2023-12-14
- Publication Date
- 2024-12-05
AI Technical Summary
After the main site fails, the cloud service system wastes a lot of network bandwidth resources when synchronizing data to the disaster recovery site, resulting in increased resource waste and storage resource utilization.
By generating a logical log file, including the first information and the second information, it indicates the data that needs to be modified in the disaster recovery database, thereby reducing the amount of data transmitted and saving network bandwidth resources. The first information may include a row identification or hash value, the second information may include a bitmap or column identification, and the logical log file does not need to contain modified entire rows of data.
It effectively reduces the amount of data in logical log files, saves network bandwidth and storage resources, improves data synchronization efficiency, and avoids resource waste.
Smart Images

Figure CN2023138865_05122024_PF_FP_ABST
Abstract
Description
Method, device, system and storage medium for updating data
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 30, 2023, with application number 202310632526.0 and application name “Method, device, system and storage medium for updating data”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] 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
[0003] Cloud service systems have extremely high requirements for data reliability. To improve reliability, a primary site is used to provide services to users, while a redundancy site is used to back up the primary site. Typically, the primary site and the redundancy site are located in different regions. This way, if the primary site fails and becomes unavailable, the redundancy site can take over and continue providing services to users.
[0004] 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 these rows. The primary site can modify a row of data in the primary database and then synchronize the modified row with the disaster recovery database. Currently, synchronizing this row of data wastes a significant amount of network bandwidth.
[0005] Summary of the Invention
[0006] This application provides a method, device, system, and storage medium for updating data to save network bandwidth resources. The technical solution is as follows:
[0007] 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 at 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 multiple first data, each first data in the multiple first data being a column of data in the row of data, and the disaster recovery database at 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 the at least one first data in the first disaster recovery data set to the at least one second data.
[0008] Because the generated logical log file includes first information, second information, and at least one second data item, the first information indicates the first primary data set, and the second information indicates the at least one first data item. Thus, the first information can be used to obtain the first disaster recovery data set in the disaster recovery database, and the second information can be used to obtain the at least one first data item that needs to be modified in the first disaster recovery data set. This allows the logical log file to include the at least one second data item without including the entire row of modified data. This reduces the data size of the logical log file and the network bandwidth resources required to transmit the logical log file, thus conserving network bandwidth resources.
[0009] In one possible implementation, the first information includes one or more of the following: a row identifier of the 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 the row to which the first master data set belongs or the hash value of the first master data set, the amount of data in the first information is very small, thereby significantly reducing the amount of data in the logical log file.
[0010] In another possible implementation, the second information includes one or more of the following: a bitmap, or a column identifier for at least one column; the bitmap includes at least one first bit corresponding to the at least one first data item, and a second bit corresponding to at least one target data item, the at least one target data item being data other than the at least one first data item in the first primary data set; and the at least one column is the column to which the at least one first data item belongs. This reduces the size of the second information, thereby significantly reducing the size of the logical log file.
[0011] 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.
[0012] In another possible implementation, the cloud service system further includes a protection site, and the transmission delay between the primary site and the protection site is less than a delay threshold. A first protected file is generated, wherein the file header of the first protected file includes a first transaction set, the payload of the first protected file includes the first information, the second information, and the at least one second data item, and the first transaction set includes the transaction number of at least one transaction, where the at least one transaction is generated before the first transaction. The first protected file is sent to the protection site so that the protection site stores the first protected file.
[0013] In another possible implementation, the primary database further includes a second primary data set, the second primary data set including multiple third data, and the disaster recovery database further includes a second disaster recovery data set identical to the second primary data set. A second transaction is generated, the second transaction being the next transaction after 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 including the second transaction set, the payload of the second protection file including third information, fourth information, and the at least one fourth data, the third information being used to indicate the second primary data set, the fourth information being used to indicate the at least one third data, and the second transaction set including 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.
[0014] In this way, after the second protection file is sent, if a failure occurs at the primary site, 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.
[0015] In another possible implementation, the primary site and the protection site are located in the same computer room, or in different computer rooms in the same availability zone, thereby ensuring that the transmission delay between the primary site and the protection site is less than a delay threshold.
[0016] In a second aspect, the present application provides a method for updating data, which is applied to a cloud service system, wherein the cloud service system includes a primary site and a disaster recovery site, wherein the primary database in the primary site includes a first primary data set, wherein the first primary data set is a row of data in the primary database, and wherein the first primary data set includes multiple first data, wherein each first data in the multiple first data is a column of data in the row of data, and wherein the disaster recovery database in the disaster recovery site includes a first disaster recovery data set that is identical to the first primary data set. In the method, a logical log file is received, wherein the logical log file includes first information, second information, and 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 at least one first data in the first primary data set, wherein the at least one first data in the first primary data set is 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.
[0017] Because the received logical log file includes first information, second information, and at least one second data item, the first information indicates the first primary data set, and the second information indicates the at least one first data item. Thus, the first information can be used to obtain the first disaster recovery data set in the disaster recovery database, and the second information can be used to obtain the at least one first data item that needs to be modified in the first disaster recovery data set. This allows the logical log file to include the at least one second data item without including the entire row of modified data. This reduces the data size of the logical log file and the network bandwidth resources required to transmit the logical log file, thus conserving network bandwidth resources.
[0018] In one possible implementation, the first information includes one or more of the following: a row identifier of the 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 the row to which the first master data set belongs or the hash value of the first master data set, the amount of data in the first information is very small, thereby significantly reducing the amount of data in the logical log file.
[0019] In another possible implementation, the second information includes one or more of the following: a bitmap, or a column identifier for at least one column; the bitmap includes at least one first bit corresponding to the at least one first data item, and a second bit corresponding to at least one target data item, the at least one target data item being data other than the at least one first data item in the first primary data set; and the at least one column is the column to which the at least one first data item belongs. This reduces the size of the second information, thereby significantly reducing the size of the logical log file.
[0020] In another possible implementation, the logical log file further includes a transaction number of the first transaction. The 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 is updated to the at least one second data through the first transaction.
[0021] In another possible implementation, the cloud service system further includes a protection site, wherein the 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 including multiple third data, the disaster recovery database further includes a second disaster recovery data set identical to the second primary data set, the protection site stores a second protection file, the 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 indicating the second primary data set, the fourth information indicating at least one third data in the second primary data set, the at least one third data in the second primary data set being modified to the at least one fourth data, the second transaction set including the transaction number of the first transaction and the transaction number of at least one transaction occurring before the first transaction. Upon a failure of the primary site, 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 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.
[0022] 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.
[0023] In another possible implementation, the primary site and the protection site are located in the same computer room, or in different computer rooms in the same availability zone, thereby ensuring that the transmission delay between the primary site and the protection site is less than a delay threshold.
[0024] In a third aspect, the present application provides a device for updating data, configured 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.
[0025] In a fourth aspect, the present application provides a device for updating data, configured to execute the method in the second aspect or any possible implementation of the second aspect. Specifically, the device includes a unit configured to execute the method in the second aspect or any possible implementation of the second aspect.
[0026] In a fifth aspect, the present application provides a computing device cluster, wherein the computing device cluster includes at least one computing device, each device in 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.
[0027] 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, second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.
[0028] 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, second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.
[0029] 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, second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.
[0030] 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
[0031] FIG1 is a schematic diagram of the structure of a cloud service system provided in an embodiment of the present application;
[0032] FIG2 is a schematic diagram of the structure of another cloud service system provided in an embodiment of the present application;
[0033] FIG3 is a flow chart of a method for updating data provided in an embodiment of the present application;
[0034] FIG4 is a flow chart of another method for updating data provided in an embodiment of the present application;
[0035] FIG5 is a schematic diagram of the structure of a device for updating data provided in an embodiment of the present application;
[0036] FIG6 is a schematic diagram of the structure of another device for updating data provided in an embodiment of the present application;
[0037] FIG7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0038] FIG8 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0039] FIG9 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;
[0040] FIG10 is a schematic diagram of the structure of another computing device provided in an embodiment of the present application;
[0041] FIG11 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;
[0042] FIG12 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
[0044] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "including" and "having" and any variations thereof 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 may optionally include steps or units that are not listed, or may optionally include 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 this application can be understood according to the specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "and / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B 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 in an "or" relationship.
[0045] To facilitate understanding of the solutions of the embodiments of the present application, the technical terms involved in this document are first explained below.
[0046] The primary database is the database on the primary site, through which the primary site provides services to users.
[0047] The disaster recovery database is a database at the disaster recovery site that backs up the primary database. When the primary site fails, the disaster recovery site provides services to users through the disaster recovery database.
[0048] Binlog, a logical log file, is a log file used to record the data in a row before and after the modification when a row of data in the main database is modified.
[0049] The payload is the portion of the logical log file other than the file header, and is the file content portion of the logical log file.
[0050] A transaction is used to describe a sequence of operations on a database. The sequence includes at least one operation on the database. The at least one operation described by the transaction is either executed in its entirety or not at all, and is an indivisible unit of work.
[0051] Transaction number, used to identify the transaction.
[0052] 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.
[0053] An increasing number of systems are placing extremely high demands on data reliability and availability. To ensure high availability, a primary site is typically used to provide services, while a redundancy site is used to back up the primary site. The primary and redundancy sites are located in different regions. If the primary site fails due to a disaster, the redundancy site quickly takes over the service, ensuring service availability.
[0054] The primary site includes a primary database, and the disaster recovery site includes a disaster recovery database. The disaster recovery database 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.
[0055] The primary site can modify a row of data in the primary database, typically modifying only part of that row. After the modification is complete, the primary site sends a logical log file (binlog) to the disaster recovery site. This log file contains both the pre-modified and post-modified data for the row. The disaster recovery site receives the log file, determines the row of data stored in the disaster recovery database based on the pre-modified data, and updates the row to the post-modified data, allowing the disaster recovery database to back up the primary database.
[0056] However, the primary site typically requires a significant amount of network bandwidth to send logical log files to the redundancy site, resulting in a significant waste of network bandwidth. Furthermore, the primary site may also store the logical log files, requiring significant storage resources, resulting in a waste of storage resources. To conserve network bandwidth and storage resources, any of the following embodiments can be used.
[0057] 1 , an embodiment of the present application provides a cloud service system 100 , which includes a primary site 101 and a disaster recovery site 102 . The primary site 101 can communicate with the disaster recovery site 102 .
[0058] In some embodiments, the primary site 101 is located in a first availability zone, and the disaster recovery site 102 is located in a second availability zone. The first availability zone and the second availability zone may be two availability zones in different locations.
[0059] The so-called different locations 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.
[0060] Since the first availability zone where the primary site 101 is located and the second availability zone where the disaster recovery site 102 is located are two availability zones in different locations, the distance between the primary site 101 and the disaster recovery site 102 is long, resulting in a large transmission delay between the primary site 101 and the disaster recovery site 102, which may cause the transmission delay between the primary site 101 and the disaster recovery site 102 to be much greater than the delay threshold.
[0061] For example, the delay threshold is in milliseconds, and the transmission delay between primary site 101 and redundancy site 102 is in seconds. Therefore, the transmission delay between primary site 101 and redundancy site 102 may be much longer than the delay threshold. For example, assuming the delay threshold may be 5 milliseconds, 7 milliseconds, or 8 milliseconds, the transmission delay between primary site 101 and redundancy site 102 may be 3 seconds, 4 seconds, 5 seconds, or 6 seconds, which is much longer than the delay threshold.
[0062] 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.
[0063] 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.
[0064] Primary site 101 also includes at least one service, and is configured to run the at least one service. Disaster recovery site 102 also includes the at least one service. When primary site 101 is operating normally, primary site 101 runs the at least one service, obtains data from the at least one service during the execution of the at least one service, and stores the data in a primary database.
[0065] When primary site 101 is operating normally, redundancy site 102 backs up the data stored in the primary database. That is, primary site 101 needs to store the data stored in the primary database in the redundancy database at redundancy site 102. In this way, if primary site 101 fails, redundancy site 102 takes over the at least one service and runs the at least one service based on the data stored in the redundancy database.
[0066] For ease of explanation, any row of data in the primary database is referred to as the first primary data set. That is, the primary database includes the first primary data set, and the disaster recovery database also includes the same first disaster recovery data set. The first primary data set includes multiple first data, each of which represents multiple columns of data in the row.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] The primary site 101 generates a first logical log file, which includes first information, second information and the at least one second data. 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. The first logical log file is sent to the disaster recovery site 102.
[0071] 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.
[0072] 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.
[0073] In some embodiments, the first logical log file also includes a transaction number of the first transaction. The transaction number of the first transaction is obtained by adding an offset value to 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 an 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.
[0074] Since the distance between the primary site 101 and the disaster recovery site 102 is long, the primary site 101 may need 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.
[0075] The primary site 101 may fail before sending the first logical log file, causing the disaster recovery site 102 to be unable to receive the first logical log file, and making it impossible for the disaster recovery site 102 to 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.
[0076] 2 , the cloud service system 100 further 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.
[0077] 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 early.
[0078] 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 the first information, the 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.
[0079] The protection site 103 receives the first protection file and saves the first protection file.
[0080] 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.
[0081] 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.
[0082] 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 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 based on the payload of the first protection file.
[0083] In some embodiments, the protection site 103 may be a cluster or a server.
[0084] An embodiment of the present application provides a method 300 for updating data, and the method 300 is applied to the cloud service system 100 shown in Figure 1 or Figure 2. The main site in the cloud service system 100 includes a main database, and the main database includes a first main data set. The first main data set is a row of data in the main database, and the first main data set includes multiple first data, and the multiple first data 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, and the disaster recovery database includes a first disaster recovery data set that is the same as the first main data set. Referring to Figure 3, the method 300 includes the following process to update data.
[0085] 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.
[0086] In step 301, a modification request is received from a user, requesting that at least one first data in a first master data set be modified to at least one second data. Based on the modification request, a first master data set in a 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.
[0087] 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.
[0088] In some embodiments, the transaction number of the first transaction is obtained by adding the transaction number of the last transaction.
[0089] The first transaction is used to isolate the process of modifying the at least one first data in the first master data set into the at least one second data. That is, until 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.
[0090] As an example, consider the primary database shown in Table 1 below. The primary database is a user information table. The primary site includes the primary database shown in Table 1, and the disaster recovery site also includes the disaster recovery database shown in Table 1.
[0091] Table 1: User info
[0092] 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".
[0093] Assume that, for a row of data with row number "2" containing the work unit "Enterprise 2" and the work unit address "Address2," a user requests that these be modified to "Enterprise 4" and "Address4," respectively. In other words, the at least one first data item in the first master data set that needs to be modified includes the work unit address "Address2" and the work unit "Enterprise 2." The user sends a modification request that includes the row number 2, the work unit "Enterprise 4," and the work unit address "Address4." For example, the modification request can be a structured query language (SQL) statement as shown below.
[0094] Update User info
[0095] Set unit address = Address4, work unit = Enterprise 4
[0096] Where Name=Name2.
[0097] Assume that the transaction number of the last transaction is 9. After receiving the modification request, a first transaction is generated, adding 1 to the transaction number of the last transaction, "9," to obtain the transaction number "10." Based on this modification request, the first transaction determines the first master data set (the row numbered "2" in Table 1) in the master database shown in Table 1. 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," resulting in the master database shown in Table 2 below.
[0098] Table 2: User info
[0099] Step 302: Generate a first logical log file, the first logical log file including 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 this 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 being data in the first master 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.
[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 stored at the master site. This reduces the amount of data in the first logical log file, thereby reducing the storage resources required to store the first logical log file. Alternatively, the master site may periodically upload the stored logical log file to a file storage system, allowing users to download the logical log file from the file storage system.
[0107] In some embodiments, the first logical log file further 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 work 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. The first logical log file includes the transaction number "10" of the first transaction, the first information, the second information, the work 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 row number "2". The second information is a bitmap with the bitmap bits 0010001. The bitmap includes two first bits "1" corresponding to two first data items that need to be modified, and five second bits "0" corresponding to five first data items that do not need to be modified. The two first data items are the work unit address "Address2" and the work unit "Enterprise 2". The five data items are the row number "2", the name "Name2", the phone number "Phone2", the academic qualification "graduate student", and the occupation "receptionist".
[0110] In some embodiments, a first protection file may also be 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 the transaction number of at least one transaction, where the at least one transaction is 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 further 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, a first process and a 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 at least one first data in the first master data set is modified to the at least one second data at the primary site, a first thread and a 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 that occurred before the first transaction. 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 protected file reaches a time threshold, the first protected file is deleted from the protection site. Alternatively, the protected files stored in the protection site are deleted periodically.
[0122] Since the transmission time between the primary site and the protection site is less than the delay threshold, the first protection file can be sent to the protection site very quickly after it is generated. For example, it can take 1 millisecond or several milliseconds to send the first protection file to the protection site after it is generated.
[0123] In some embodiments, another row of data in the primary database may also be modified. For ease of explanation, the other row of data in the primary database is referred to as the second primary data set. The second primary 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 primary data set.
[0124] In other words, 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 identical to the first primary data set. Specifically, a row of data in the disaster recovery database that is identical to the first primary data set is called the first disaster recovery data set. The first disaster recovery data set includes multiple data items, each of which belongs to different columns.
[0126] The second master data set is another row of data in the master database. That is, the other row of data in the master database is called the second master data set. 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 identical to the second primary data set. Specifically, another row of data in the disaster recovery database that is identical to the second primary data set is called the second disaster recovery data set. The second disaster recovery data set also includes multiple data items, each of which belongs to different columns.
[0128] When a request is received to modify at least one third data in the second master data set to 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 to 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 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. 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 can save 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, resulting in the disaster recovery site being 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 qualification "Doctor", occupation "Department Manager" and work unit "Enterprise 3".
[0134] Assume that a user requests to modify the phone number "Phone3" in a row of data with row number "3" to "Phone4." In other words, the at least one third data item in the second master data set that needs to be modified includes the phone number "Phone3." The user sends a modification request that includes row number 3 and the phone number "Phone4." For example, the modification request can be an SQL statement like the following.
[0135] Update User info
[0136] Set phone number = Phone4
[0137] Where Name=Name3.
[0138] Assume that the last transaction was the first transaction, with transaction number 10. After receiving the modification request, a second transaction is generated, adding 1 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 transaction determines the second master data set (the row numbered "3" in Table 2) in the master database shown in Table 2. The phone number "Phone 3" included in the second master data set is modified to "Phone 4," resulting in the master database shown in Table 3 below.
[0139] Table 3: User info
[0140] A second logical log file and a second protection file are generated in parallel. 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. The fourth information is a bitmap with the bits set to 0001000. The 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 telephone number "Phone4." The second transaction set includes transaction numbers "1," "2," "3," "4," "5," "6," "7," "8," "9," and "10."
[0141] The second protection file is sent to the protection site so that the protection site can save the second protection file. However, after the second protection file is sent, the primary site fails to send the second logical log file, because the primary site fails. That is, the disaster recovery site cannot receive the second logical log file.
[0142] 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 does not need to include the entire row of modified data, 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 to the master site, the storage resources occupied by the master site are reduced.
[0143] An embodiment of the present application provides a method 400 for updating data, which is applied to the cloud service system 100 shown in Figure 1 or Figure 2. The main site in the cloud service system 100 includes a main database, and the main database includes a first main data set. The first main data set is a row of data in the main database, and the first main data set includes multiple first data, and the multiple first data 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, and the disaster recovery database includes a first disaster recovery data set that is the same as the first main data set. Referring to Figure 4, the method 400 includes the following process to update data.
[0144] Step 401: Receive a first logical log file, the first logical log file including 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.
[0145] 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.
[0146] The hash value of the first master data set is obtained by performing a hash operation on the first master data set.
[0147] 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 being data in the first master 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.
[0148] 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.
[0149] For example, the first logical log file received from the primary site 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, which is row number "2." The second information is a bitmap, and the bit in the bitmap is 0010001.
[0150] 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.
[0151] 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.
[0152] 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 .
[0153] 4021: Determine a first disaster recovery data set in the disaster recovery database based on the first information.
[0154] 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.
[0155] For example, the disaster recovery site includes the disaster recovery database shown in Table 1 above. The first information includes a row identifier of the first primary data set, which is row number "2." Based on 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. This row of data is the row numbered "2" in Table 1. That is, the first disaster recovery data set is the row numbered "2" in Table 1.
[0156] In some embodiments, the first information includes a hash value of the first primary data set, the hash value of each row of data in the disaster recovery database is calculated, and a row of data having the same hash value as the first primary data set is obtained, which is the first disaster recovery data set.
[0157] 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. The row of data is the first disaster recovery data set.
[0158] 4022: Based on the second information, determine the at least one first data in the first disaster recovery data set.
[0159] 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 corresponding to the at least one first bit in the first disaster recovery data set is determined.
[0160] For example, the first disaster recovery data set is a row of data numbered "2" in Table 1. The second information is a bitmap, which is 0010001 and includes two first bits "1." Based on these two first bits "1," two first data items in the first disaster recovery data set corresponding to the two first bits are determined. These two first data items are the unit address "Address2" and the work unit "Enterprise 2."
[0161] 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.
[0162] 4023: Modify the at least one first data in the first disaster recovery data set into the at least one second data.
[0163] For example, the first logical log file includes two pieces of second data: the work unit address "Address4" and the work unit "Enterprise 4." Change the work unit address "Address2" in row number "2" of Table 1 to "Address4," and change the work unit "Enterprise 2" to "Enterprise 4," to obtain the disaster recovery database shown in Table 2.
[0164] After receiving the first logical log file, it may be detected that the primary site has failed. In this way, when the primary site fails, the following operations 11 to 13 are also performed.
[0165] 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.
[0166] 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.
[0167] 12: Obtain a second protected file whose file header includes a second transaction set from the protection site.
[0168] In some embodiments, the protection site stores each received protection file in the order in which it is received, such that the order in which the protection files are stored on the protection site is the same as the order in which they were generated. Alternatively, the second protection file and each protection file stored after the second protection file can be retrieved from the protection site, allowing all required protection files to be retrieved at once, improving retrieval efficiency.
[0169] During implementation, a request is sent to the protection site, the request including the second transaction set, causing the protection site to retrieve a second protected file whose file header includes the second transaction set, and receive the second protected file from the protection site. Optionally, each protected file that is stored after the second protected file and that is sent by the protection site is also received.
[0170] In some embodiments, the protection site may obtain the second protection file including the second transaction set in the file header through the following process (1)-(4).
[0171] (1): Start scanning from the last protected file saved by the protection site.
[0172] (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).
[0173] (3): Determine that the scanned protection file is the second protection file whose file header includes the second transaction set, and end and return.
[0174] (4): Scan the last protected file and return to execute (2).
[0175] 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.
[0176] The transaction set included in the protected file header can be easily obtained from the protected file header. Furthermore, comparing two transaction sets requires minimal computation, allowing the protection site to quickly retrieve the second protected file from the stored protected files. Furthermore, scanning protected files in reverse order, starting with the last stored protected file and working backwards, reduces the number of protected files required for comparison and accelerates the acquisition of the second protected file.
[0177] 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.
[0178] The protection site also retrieves each protection file that is stored after the second protection file and sends the second protection file and each protection file that is stored after the second protection file. Due to the failure of the primary site, the primary site failed to successfully send each logical log file generated in parallel with the protection file to the disaster recovery site.
[0179] For example, a 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, which includes transaction numbers "1," "2," "3," "4," "5," "6," "7," "8," and "9." The payload of the first protection file includes first information, second information, the unit address "Address4," and the work unit "Enterprise4."
[0180] 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".
[0181] The protection site receives a request including a second transaction set, where the second transaction set includes transaction numbers "1," "2," "3," "4," "5," "6," "7," "8," "9," and "10." The protection site compares the second transaction set with the transaction set in the file header of the last protected file (the second protected file) stored in the protection site. If the two transaction sets are found to be identical, the protection site determines that the last protected file is the second protected file whose file header includes the second transaction set.
[0182] 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.
[0183] 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, please refer to the above processes 4021-4023, which will not be described in detail here.
[0184] For example, the payload of the second protected file includes the third information, the fourth information, and the phone number "Phone4." The third information is row number "3," and the fourth information is bitmap 0001000. Based on row number "3," the second disaster recovery data set (the row of data with row number "3" in Table 2) is determined in the disaster recovery database shown in Table 2. Based on the first bit "1" in the fourth information, the phone number "Phone3" included in the second disaster recovery data set is determined. The phone number "Phone3" is modified to "Phone 4," resulting in the disaster recovery database shown in Table 3.
[0185] For each protection file that is stored after the second protection file, the data in the disaster recovery database is updated based on the payload of each protection file and with reference to the above-mentioned processes 4021 to 4023.
[0186] 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 primary 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 does not need 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 avoid missing data in the primary database and improve the efficiency of data updates in the disaster recovery database.
[0187] Referring to Figure 5, an 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 the multiple first data is a column of data in the row of data, and 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 on the master site 101 in the cloud service system 100 shown in Figure 1 or Figure 2, or it can be deployed on the master site of the method 300 shown in Figure 3. The device 500 includes:
[0188] 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;
[0189] The processing unit 501 is further configured to generate a logical log file, the logical log file including first information, second information, and the 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;
[0190] The sending unit 502 is configured 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.
[0191] 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 can be found in the relevant content of step 301 of the method 300 shown in FIG3 , which will not be described in detail here.
[0192] Optionally, the detailed implementation process of the processing unit 501 generating the logical log file can be found in the relevant content of step 302 of the method 300 shown in FIG3 , which will not be described in detail here.
[0193] Optionally, the detailed implementation process of the sending unit 502 sending the logical log file to the disaster recovery site refers to the relevant content in step 302 of the method 300 shown in FIG3 , which will not be described in detail here.
[0194] 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.
[0195] Optionally, the second information includes one or more of the following information: a bitmap, or a column identifier of at least one column;
[0196] 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.
[0197] Optionally, the processing unit 501 is configured to:
[0198] Generate the first transaction;
[0199] 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.
[0200] 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 to the at least one second data through the first transaction refers to the relevant content in step 301 of the method 300 shown in Figure 3, which will not be described in detail here.
[0201] Optionally, the cloud service system further includes a protection site, and the transmission delay between the apparatus 500 and the protection site is less than a delay threshold;
[0202] The processing unit 501 is further configured to generate a first protected file, wherein the file header of the first protected file includes a first transaction set, the payload of the first protected 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;
[0203] 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.
[0204] Optionally, the detailed implementation process of the processing unit 501 generating the first protection file refers to the relevant content in step 302 of the method 300 shown in FIG3 , which will not be described in detail here.
[0205] Optionally, the detailed implementation process of the sending unit 502 sending the first protection file to the protection site refers to the relevant content in step 303 of the method 300 shown in FIG3 , which will not be described in detail here.
[0206] 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 identical to the second primary data set;
[0207] The processing unit 501 is further configured to generate a second transaction, the second transaction being a subsequent transaction of the first transaction; modify at least one third data in the second primary data set to at least one fourth data through the second transaction; and generate a second protection file, wherein the 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 being used to indicate the second primary data set, the fourth information being used to indicate the at least one third data, and the second transaction set including the first transaction set and the transaction number of the first transaction.
[0208] 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.
[0209] 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. For the detailed implementation process, please refer to the relevant content in step 303 of the method 300 shown in Figure 3, which will not be described in detail here.
[0210] Optionally, the detailed implementation process of the sending unit 502 sending the second protection file to the protection site refers to the relevant content in step 303 of the method 300 shown in FIG3 , which will not be described in detail here.
[0211] Optionally, the device 500 and the protection site are located in the same computer room, or the device 500 and the protection site are located in different computer rooms in the same available area.
[0212] In an embodiment of the present application, the logical log file generated by the processing unit includes first information, second information, and at least one second data. 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. Thus, the first disaster recovery data set in the disaster recovery database can be derived from the first information, and the at least one first data that needs to be modified in the first disaster recovery data set can be derived from the second information. This allows the logical log file to include the at least one second data without including the entire row of modified data. This reduces the data volume of the logical log file, reduces the network bandwidth resources required by the sending unit to transmit the logical log file, and conserves network bandwidth resources.
[0213] Referring to FIG6 , an embodiment of the present application provides a device 600 for updating data, the device 600 being applied to a cloud service system, the cloud service system including a primary site and the device 600, the primary database in the primary site including a first primary data set, the first primary data set being a row of data in the primary database, the first primary data set including multiple first data, each first data in the multiple first data being a column of data in the row of data, the disaster recovery database in the device 600 including a first disaster recovery data set identical to the first primary data set. The device 600 can be deployed on the disaster recovery site 102 in the cloud service system 100 shown in FIG1 or FIG2 , or can be deployed on the disaster recovery site of the method 400 shown in FIG4 . The device 600 includes:
[0214] A receiving unit 601 is configured to receive a logical log file, the logical log file including first information, second information, and at least one second data, the first information being used to indicate a 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;
[0215] 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.
[0216] Optionally, the detailed implementation process of the receiving unit 601 receiving the logical log file refers to the relevant content in step 401 of the method 400 shown in FIG4 , which will not be described in detail here.
[0217] Optionally, the detailed implementation process of the processing unit 602 updating 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 can be found in the relevant content of step 402 of the method 400 shown in Figure 4, which will not be described in detail here.
[0218] 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.
[0219] Optionally, the second information includes one or more of the following information: a bitmap, or a column identifier of at least one column;
[0220] 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.
[0221] Optionally, the logical log file further includes a transaction number of the first transaction. The processing unit 602 is configured to:
[0222] allocating the first transaction based on the transaction number of the first transaction;
[0223] 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.
[0224] Optionally, for a detailed implementation process of the processing unit 602 allocating the first transaction based on the transaction number of the first transaction, please refer to the relevant content in step 402 of the method 400 shown in FIG4 , which will not be described in detail here.
[0225] 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. For the detailed implementation process, please refer to the relevant content in step 402 of the method 400 shown in Figure 4, which will not be described in detail here.
[0226] Optionally, the cloud service system also includes a protection site, the transmission delay between the main site and the protection site is less than the 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 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.
[0227] The processing unit 602 is further configured to:
[0228] When the primary site fails, obtaining a second transaction set based on a transaction number of the first transaction included in the logical log file;
[0229] Obtaining from the protection site a second protection file having a file header including a second transaction set;
[0230] 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.
[0231] Optionally, the detailed implementation process of the processing unit 602 acquiring the second transaction set based on the transaction number of the first transaction included in the logical log file refers to the relevant content of operation 11 of the method 400 shown in FIG4 , which will not be described in detail here.
[0232] Optionally, the detailed implementation process of the processing unit 602 obtaining the second protected file whose file header includes the second transaction set from the protection site refers to the relevant content in operation 12 of the method 400 shown in FIG4 , which will not be described in detail here.
[0233] 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. For the detailed implementation process, please refer to the relevant content in operation 13 of the method 400 shown in Figure 4, which will not be described in detail here.
[0234] 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 availability zone.
[0235] In an embodiment of the present application, the logical log file received by the receiving unit includes first information, second information, and 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. Thus, the processing unit can derive the first disaster recovery data set in the disaster recovery database using the first information, and can derive the at least one first data that needs to be modified in the first disaster recovery data set using the second information. This allows the logical log file to include the at least one second data without including the entire row of modified data. This reduces the data size of the logical log file, reduces the network bandwidth resources required to transmit the logical log file, and conserves network bandwidth resources.
[0236] 7 , an embodiment of the present application provides a computing device 700. For example, the computing device 700 may be a device in a primary site in the cloud service system shown in FIG1 or FIG2 , or a device in a primary site in the method 300 shown in FIG3 .
[0237] As shown in Figure 7, computing device 700 includes a bus 702, a processor 704, a memory 706, and a communication interface 708. Processor 704, memory 706, and communication interface 708 communicate with each other via bus 702. Computing device 700 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 700.
[0238] Bus 702 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG7 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 704 may include a path for transmitting information between various components of computing device 700 (e.g., processor 704, memory 706, and communication interface 708).
[0239] The processor 704 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0240] The memory 706 may include volatile memory, such as random access memory (RAM), or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0241] 7 , the memory 706 stores executable program code, and the processor 704 executes the executable program code to respectively implement the functions of the processing unit 501 and the sending unit 502 in the apparatus 500 shown in FIG5 , thereby implementing the method 300 for updating data provided in the embodiment shown in FIG3 . In other words, the memory 706 stores instructions for executing the method 300 for updating data provided in the embodiment shown in FIG3 . Alternatively,
[0242] 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 a communication network.
[0243] Embodiments of the present application also provide 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 smartphone.
[0244] As shown in Figure 8, the computing device cluster includes at least one computing device 700. The memory 706 of one or more computing devices 700 in the computing device cluster may store the same instructions for executing the method 300 for updating data provided in the embodiment shown in Figure 3 above.
[0245] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also respectively store partial instructions for executing the method 300 for updating data provided in the embodiment shown in FIG3 . In other words, the combination of one or more computing devices 700 may jointly execute the instructions for executing the method 300 for updating data provided in the embodiment shown in FIG3 .
[0246] In some possible implementations, one or more computing devices in the computing device cluster can be connected via a network. The network can be a wide area network (WAN) or a local area network (LAN), among others. FIG. 9 illustrates one possible implementation. As shown in FIG. 9 , two computing devices 700A and 700B are connected via a network. Specifically, each computing device is connected to the network via a communication interface within the computing device.
[0247] In this type of possible implementation, the memory 706 in the computing device 700A stores instructions for executing the functions of the processing unit 501 in the embodiment shown in FIG5 . Meanwhile, the memory 706 in the computing device 700B stores instructions for executing the functions of the sending unit 502 in the embodiment shown in FIG5 .
[0248] It should be understood that the functionality of the computing device 700A shown in FIG9 may also be implemented by multiple computing devices 700. Similarly, the functionality of the computing device 700B may also be implemented by multiple computing devices 700.
[0249] The present application also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to the connection method of the computing device cluster described in FIG9 . However, the memory 706 in one or more computing devices 700 in the computing device cluster can store the same instructions for executing the data updating method 300 provided in the embodiment shown in FIG3 .
[0250] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also respectively store partial instructions for executing the method 300 for updating data provided in the embodiment shown in FIG3 . In other words, the combination of one or more computing devices 700 may jointly execute the instructions for executing the method 300 for updating data provided in the embodiment shown in FIG3 .
[0251] 10 , an embodiment of the present application provides a computing device 1000. For example, the computing device 1000 may be a device in a disaster recovery site in the cloud service system shown in FIG1 or FIG2 , or a device in a disaster recovery site in the method 400 shown in FIG4 .
[0252] As shown in Figure 10, computing device 1000 includes a bus 1002, a processor 1004, a memory 1006, and a communication interface 1008. Processor 1004, memory 1006, and communication interface 1008 communicate with each other via bus 1002. Computing device 1000 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1000.
[0253] Bus 1002 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG10 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 1004 may include a path for transmitting information between various components of computing device 1000 (e.g., processor 1004, memory 1006, and communication interface 1008).
[0254] The processor 1004 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0255] The memory 1006 may include volatile memory, such as random access memory (RAM). The memory 1006 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0256] 10 , the memory 1006 stores executable program code, and the processor 1004 executes the executable program code to respectively implement the functions of the receiving unit 601 and the processing unit 602 in the apparatus 600 shown in FIG6 , thereby implementing the method 400 for updating data provided in the embodiment shown in FIG4 . In other words, the memory 1006 stores instructions for executing the method 400 for updating data provided in the embodiment shown in FIG4 . Alternatively,
[0257] 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.
[0258] Embodiments of the present application also provide 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 smartphone.
[0259] As shown in Figure 11, the computing device cluster includes at least one computing device 1000. The memory 1006 of one or more computing devices 1000 in the computing device cluster may store the same instructions for executing the method 400 for updating data provided in the embodiment shown in Figure 4 above.
[0260] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also respectively store partial instructions for executing the method 400 for updating data provided in the embodiment shown in FIG4 . In other words, the combination of one or more computing devices 1000 may jointly execute the instructions for executing the method 400 for updating data provided in the embodiment shown in FIG4 .
[0261] In some possible implementations, one or more computing devices in the computing device cluster can be connected via a network. The network can be a wide area network (WAN) or a local area network (LAN), among others. FIG. 12 illustrates one possible implementation. As shown in FIG. 12 , two computing devices 1000A and 1000B are connected via a network. Specifically, each computing device is connected to the network via a communication interface within the computing device.
[0262] In this type of possible implementation, the memory 1006 in the computing device 1000A stores instructions for executing the functions of the processing unit 602 in the embodiment shown in Figure 6. Simultaneously, the memory 1006 in the computing device 1000B stores instructions for executing the functions of the receiving unit 601 in the embodiment shown in Figure 6.
[0263] It should be understood that the functionality of the computing device 1000A shown in FIG12 may also be accomplished by multiple computing devices 1000. Similarly, the functionality of the computing device 1000B may also be accomplished by multiple computing devices 1000.
[0264] The present application also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to the connection method of the computing device cluster described in FIG12 . However, the memory 1006 in one or more computing devices 1000 in the computing device cluster can store the same instructions for executing the data updating method 400 provided in the embodiment shown in FIG4 .
[0265] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also respectively store partial instructions for executing the method 400 for updating data provided in the embodiment shown in FIG4 . In other words, the combination of one or more computing devices 1000 may jointly execute the instructions for executing the method 400 for updating data provided in the embodiment shown in FIG4 .
[0266] 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 on any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute the data updating method provided in the embodiment shown in FIG. 3 or FIG. 4 .
[0267] The present application also provides a computer-readable storage medium. The computer-readable storage medium can 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 can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the method for updating data provided in the embodiment shown in Figure 3 or Figure 4.
[0268] Those 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 a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0269] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for updating data, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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
Patent Citations
Data updating method, device and system and storage medium
CN119105903A
Relational database data replication method based on log logic analysis
CN111061594A
Power utilization information acquisition system capable of achieving key business disaster tolerance and operation method thereof
CN112235142A
Data storage system, control method and device, electronic equipment and storage medium
CN114205368A
Database system, data processing method and equipment
CN114254035A
