A data backup method, device, system, and storage medium
By setting up log nodes and off-site disaster recovery nodes in the disaster backup system and forwarding business requests in the event of a failure, the data integrity problem of off-site disaster recovery nodes is solved, ensuring the integrity and business continuity of data backup.
Patent Information
- Application Number
- CN202011148568.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-23
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2040-10-23
AI Technical Summary
When the existing disaster backup system faces regional disasters, the integrity of backup data of off-site disaster recovery nodes is difficult to ensure, resulting in the loss of important data, resulting in economic losses or public opinion influence.
In the data backup system, the log node and the off-site disaster recovery node are set in the same area, and the service requests are received and recorded are forwarded to the same-city disaster recovery node when the production node fails. When the same-city disaster recovery node fails, the off-city disaster recovery node is forwarded to the off-site disaster recovery node when the same-city disaster recovery node fails. The disaster recovery node processes compensation data to ensure data integrity.
Through the forwarding mechanism of log nodes, we ensure that the business request processing results of production nodes and city disaster recovery nodes are not omitted, ensuring the integrity of backup data of off-site disaster recovery nodes, and avoiding economic losses to users.
Smart Images

Figure CN114490173B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data backup technology, and relate to but are not limited to a data backup method and device, system, and storage medium. Background Art
[0002] With the rapid development of the information technology industry, massive amounts of data are being generated in all fields, and data disaster recovery has become an inevitable problem that must be solved by database systems. In related technologies, data disaster recovery solutions include: active-standby disaster recovery solutions and intra-city active-active data center solutions. Although the above two solutions can cope with most disasters, in the face of regional disasters such as wars, floods, and earthquakes, the data centers in these two solutions may be destroyed at the same time, causing business interruptions.
[0003] In order to cope with regional disasters, the two-site three-center disaster recovery solution came into being. By establishing a disaster backup system in a different location, namely a remote disaster recovery node, business data is replicated from the production node to the local disaster recovery node and the remote disaster recovery node, ensuring business continuity in the event of a production node or regional disaster.
[0004] Although the existing disaster backup system has improved the data's disaster recovery capabilities to a certain extent, it cannot guarantee the integrity of the backup data in the off-site disaster recovery nodes. Once important data is lost and not backed up, it will cause economic losses or public opinion impact to users. Summary of the invention
[0005] The embodiments of the present application provide a data backup method and device, a system, and a storage medium, which can ensure the integrity of backup data of off-site disaster recovery nodes and avoid economic losses for users.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] The embodiment of the present application provides a data backup method, which is applied to a log node, wherein the log node and the remote disaster recovery node are arranged in the same region; comprising:
[0008] Receiving a service request and recording the service request;
[0009] In the event of a production node failure, the service request is forwarded to the disaster recovery node in the same city;
[0010] When it is determined that the same-city disaster recovery node has failed, the recorded business request is forwarded to the off-site disaster recovery node, and the off-site disaster recovery node is used to process the business request to obtain compensation data; the compensation data includes the processing result that the corresponding business request has been forwarded to the same-city disaster recovery node but has not been synchronized to the off-site disaster recovery node.
[0011] The embodiment of the present application provides a data backup method, which is applied to a data backup system, wherein the data backup system includes: a production node, a local disaster recovery node, a remote disaster recovery node, and a log node that is arranged in the same area as the remote disaster recovery node; the method includes:
[0012] The log node receives the service request and records the service request;
[0013] When the production node fails, the log node forwards the service request to the disaster recovery node in the same city;
[0014] When the log node determines that the local disaster recovery node fails, the log node forwards the service request to the remote disaster recovery node;
[0015] The remote disaster recovery node processes the service request to obtain compensation data; the compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node.
[0016] The embodiment of the present application provides a data backup device, which is applied to a log node, wherein the log node and the remote disaster recovery node are arranged in the same area; the device comprises:
[0017] A receiving module, used for receiving a service request and recording the service request;
[0018] A forwarding module, used to forward the service request to a disaster recovery node in the same city in case of a production node failure;
[0019] The forwarding module is also used to forward the recorded business request to the off-site disaster recovery node when it is determined that the same-city disaster recovery node has a fault. The off-site disaster recovery node is used to process the business request to obtain compensation data; the compensation data includes the processing result that the corresponding business request has been forwarded to the same-city disaster recovery node but has not been synchronized to the off-site disaster recovery node.
[0020] The embodiment of the present application also provides a data backup system, including: a production node, a local disaster recovery node, a remote disaster recovery node, and a log node that is arranged in the same area as the remote disaster recovery node;
[0021] The log node receives the service request and records the service request;
[0022] When the production node fails, the log node forwards the service request to the disaster recovery node in the same city;
[0023] When the log node determines that the local disaster recovery node fails, the log node forwards the service request to the remote disaster recovery node;
[0024] The remote disaster recovery node processes the service request to obtain compensation data; the compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node.
[0025] An embodiment of the present application also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned data backup method is implemented.
[0026] The data backup method, apparatus, device and storage medium provided in the embodiments of the present application receive business requests and record the business requests; in the event of a production node failure, forward the business requests to the local disaster recovery node; in the event that the local disaster recovery node fails, forward the recorded business requests to the remote disaster recovery node, and the remote disaster recovery node is used to process the business requests to obtain compensation data; the compensation data includes the processing results of the corresponding business requests that have been forwarded to the local disaster recovery node but not synchronized to the remote disaster recovery node; thereby, in the event of a production node and a local disaster recovery node failure, the remote disaster recovery node then processes the business requests that have been sent to the local disaster recovery node but the processing results have not been synchronized to the remote disaster recovery node, so that there are no omissions in the business requests processed by the data backup system before and after the local disaster recovery node failure, thereby ensuring the integrity of the backup data of the remote disaster recovery node. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 An optional structural diagram of a data processing system provided in an embodiment of the present application;
[0028] Figure 2 An optional structural diagram of a data backup system provided in an embodiment of the present application;
[0029] Figure 3 An optional structural diagram of a data processing system provided in an embodiment of the present application;
[0030] Figure 4 An optional structural diagram of a data backup method provided in an embodiment of the present application;
[0031] Figure 5 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0032] Figure 6 An optional flow chart of a data backup system provided in an embodiment of the present application;
[0033] Figure 7 An optional flow chart of a data backup system provided in an embodiment of the present application;
[0034] Figure 8 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0035] Fig. 9 An optional flow chart of a data backup system provided in an embodiment of the present application;
[0036] Fig.10 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0037] Fig.11 An optional flow chart of a data backup system provided in an embodiment of the present application;
[0038] Fig.12 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0039] Fig.13 A schematic diagram of an optional structure of a data backup device provided in an embodiment of the present application;
[0040] Fig.14 An optional structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0042] The embodiments of the present application can provide a data backup method and device, equipment and storage medium. In practical applications, the data backup method can be implemented in a data backup device, and each functional entity in the data backup device can be collaboratively implemented by hardware resources of an electronic device (such as a terminal device), such as computing resources such as a processor, and communication resources (such as for supporting various communication methods such as optical cables and cellular).
[0043] The data backup method provided in the embodiment of the present application is applied to a data processing system, and the data processing system is composed of a business system and a data backup system.
[0044] As an example, the structure of the data processing system can be as follows Figure 1 As shown, it includes: a business system 10 and a data backup system 20. The business system 10 and the data backup system 20 are different physical entities, and the business system 10 and the data backup system 20 interact with each other through a network 30.
[0045] Here, a browser or application capable of accessing web pages is installed on the business system 10, and the user sends a business request to the data backup system 20 by operating the browser or application. The data backup system stores the data of each user and processes the data corresponding to the business request based on the received business request.
[0046] In one example, if Figure 2 As shown, the data backup system 20 includes: a production node 201, a local disaster recovery node 202, a remote disaster recovery node 203 and a log node 204, wherein the production node 201 and the local disaster recovery node 202 are located in the same region 205, and the remote disaster recovery node 203 and the production node 201 are located in different regions, wherein the remote disaster recovery node 203 is located in region 206 and the remote disaster recovery node 203 and the log node 204 are located in the same region 206, and the remote disaster recovery node 203 and the log node 204 are independent physical entities.
[0047] In one example, the log node 204 in the data backup system 20 is set on the off-site disaster recovery node 203, that is, the off-site disaster recovery node 203 and the log node 204 are integrated on the same physical entity.
[0048] In the present application embodiment, based on Figure 2 and Figure 3 In the data backup system shown, the log node 204 receives the business request and records the business request; in the case of a failure of the production node 201, the business request is forwarded to the disaster recovery node 202 in the same city; in the case of determining that the disaster recovery node 202 in the same city has failed, the recorded business request is forwarded to the disaster recovery node 203 in a different location, and the disaster recovery node 203 in a different location is used to process the business request to obtain compensation data; the compensation data includes the processing result that the corresponding business request has been forwarded to the disaster recovery node in the same city but has not been synchronized to the disaster recovery node in a different location.
[0049] Combination Figure 2 or Figure 3 The data backup system shown in the present embodiment proposes a data backup method, in which the log node forwards the business request to the production node, the disaster recovery node in the same city, and the disaster recovery node in a different location. In the event of failure of the production node and the disaster recovery node in the same city, the disaster recovery node in the different location continues to process the business request that has been sent to the disaster recovery node in the same city but the processing result has not been synchronized to the disaster recovery node in the different location, so that the business requests processed by the data backup system before and after the failure of the disaster recovery node in the same city are not missed, thereby ensuring the integrity of the backup data of the disaster recovery node in the different location.
[0050] Next, combine Figure 2 or Figure 3The schematic diagram of the data backup system shown illustrates various embodiments of the data backup method and device, system and storage medium provided in the embodiments of the present application.
[0051] This embodiment provides a data backup method, which is applied to a data backup device, wherein the data backup device can be implemented on an electronic device as a log node. The function implemented by the method can be implemented by a processor in the electronic device calling a program code, and of course the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium.
[0052] The electronic device may be any device with information processing capabilities. In one embodiment, the electronic device may be a smart terminal, such as a notebook or other electronic device with wireless communication capabilities, an AR / VR device, or a mobile terminal. In another embodiment, the electronic device may also be a terminal device with computing functions that is not easy to move, such as a desktop computer, a desktop computer, etc.
[0053] Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and there may be multiple implementation methods, such as providing as a storage medium (storing instructions for executing the data backup method provided by the embodiments of the present application).
[0054] Figure 4 A schematic diagram of the implementation process of a data backup method according to an embodiment of the present application is shown in FIG. Figure 4 As shown, the method comprises the following steps:
[0055] S401: Receive a service request and record the service request.
[0056] The business system is installed with a browser or application that can access web pages. Users send business requests to the data backup system by operating the browser or application. Business requests may include: query requests, data addition requests, modification requests, deletion requests and other different types of operation requests, so that the data backup system performs data query, data addition, data modification, data deletion and other operations according to the received business requests.
[0057] When the business system sends a business request to the data backup system, the business request is sent to the log node. After the log node receives the business request sent by the business system, it records the business request locally and records the time when the business request is received, and generates a business request log based on the recorded information. In an embodiment of the present application, the log system can generate a receiving queue consisting of received business requests based on the received business requests. Among them, the received business requests are arranged in the receiving queue according to the time sequence of the received business requests.
[0058] In an embodiment of the present application, the log node and the off-site disaster recovery node are located in the same region, wherein the log node may be independent of the off-site disaster recovery node or may be located on the off-site disaster recovery node.
[0059] When the log node is located on a remote disaster recovery node, the remote disaster recovery node receives the business request sent by the business system and distributes the business request to the log node.
[0060] S402: When a production node fails, forward the service request to a disaster recovery node in the same city.
[0061] After receiving the business request, the log node forwards the business request and attempts to forward the business request to the disaster recovery node in the same city in the event of a production node failure.
[0062] In the embodiment of the present application, before S402, the method further includes: detecting a second communication connection between the local and the production node; and determining that the production node is faulty when the second communication connection is in a disconnected state.
[0063] In the case of a production node failure, the second communication connection between the production and log nodes is disconnected, and communication is impossible. When the log node detects that the second communication connection between the log node and the production node is disconnected, it determines that the production node is faulty and determines that the forwarding of this service request is unsuccessful.
[0064] S403: When it is determined that the local disaster recovery node fails, forward the recorded service request to a remote disaster recovery node.
[0065] The remote disaster recovery node is used to process the business request to obtain compensation data; the compensation data includes the processing result that the corresponding business request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node.
[0066] In some embodiments, the log node detects a first communication connection between the local node and the disaster recovery node in the same city; when the first communication connection is disconnected, it is determined that the disaster recovery node in the same city has failed.
[0067] In the case of a failure of the local disaster recovery node, the first communication connection between the local disaster recovery node and the log node is disconnected, and communication is impossible. If the log node detects that the first communication connection between the log node and the local disaster recovery node is disconnected, it determines that the local disaster recovery node is faulty and determines that the forwarding of this business request is unsuccessful. Among them, the log node can detect that the first communication connection between the log node and the local disaster recovery node is disconnected in the following situations:
[0068] Scenario 1: When sending a service request to the disaster recovery node in the same city;
[0069] Case 2: After the service request is forwarded to the local disaster recovery node, the service processing corresponding to the service request returned by the local disaster recovery node is not received.
[0070] In the following situation, when the log node sends a service request to the disaster recovery node in the same city, it detects that the first communication connection between the disaster recovery node in the same city and the log node is disconnected, that is, it is determined that the disaster recovery node in the same city has failed, and the service request has been sent to the disaster recovery node in the same city, but the data of the service request is not stored in the disaster recovery node in the same city. The disaster recovery node in a different location receives the service request, processes the service request, and obtains the processing result of the service request, that is, the compensation data.
[0071] In one example, the log node sends business request 1, business request 2, business request 3 and business request 4 to the disaster recovery node in the same city in sequence. After sending business request 1, when sending business request 2 to the disaster recovery node in the same city, it detects that the disaster recovery node in the same city has a failure, and then sends business request 2 to the disaster recovery node in a different location. At this time, the disaster recovery node in a different location receives business request 2 for processing, and obtains the processing result of business request 2, namely, compensation data.
[0072] In the second scenario, after the log node sends the service request to the disaster recovery node in the same city, if it does not receive the corresponding service processing completion response for the forwarded service request, it detects that the first communication connection between the disaster recovery node in the same city and the log node is disconnected, that is, it determines that the disaster recovery node in the same city is faulty, and then forwards the service request to the disaster recovery node in another location, and the disaster recovery node in another location processes the service request. Although the disaster recovery node in the same city has received the service request, it has not synchronized the processing result of the service request to the disaster recovery node in another location. The disaster recovery node in another location receives the service request again and processes the service request to obtain the processing result of the service request, that is, the compensation data. Among them, for the disaster recovery node in the same city, it receives the service request processing, and may not process the service request, or it may process the service request. Among them, the processing result of the service request includes at least one of the following information: service request identifier, data obtained after the service request, processing time, etc.
[0073] In one example, the log node sends business request 1, business request 2, business request 3, and business request 4 to the local disaster recovery node in sequence. After sending business request 1 and business request 2, the log node receives the business processing completion response corresponding to business request 1, but does not receive the business processing completion response corresponding to business request 2. If the local disaster recovery node is detected to have a failure, business request 2 is sent to the remote disaster recovery node. At this time, the remote disaster recovery node receives business request 2 for processing and obtains the processing result of business request 2. Here, based on the fact that the log node has received the business processing completion response corresponding to business request 1, the log node can determine that the processing result of business request 1 has been synchronized to the remote disaster recovery system.
[0074] In the embodiment of the present application, when the production node and the local disaster recovery node fail, the types of business requests sent by the log node to the remote disaster recovery node include:
[0075] Type 1: Business requests that are forwarded to the local disaster recovery node but whose processing results are not synchronized to the remote disaster recovery node;
[0076] Type 2: Business requests that are not forwarded to the disaster recovery node in the same city.
[0077] The processing result of the service request of type one is called compensation data.
[0078] The log node sends the business request to the disaster recovery node in the same city. If the disaster recovery node in the same city operates normally, the disaster recovery node in the same city processes the business request, obtains the processing result of the business result, and synchronizes the processing result to the disaster recovery node in a different location. The business processing completion response corresponding to the business request is returned to the log node. The business processing completion response may carry indication information, and the indication information is used to indicate to the log node that the processing result of the business request has been synchronized to the disaster recovery node in a different location, that is, the current business request processing is completed.
[0079] In the existing disaster backup system, when a production node is in operation, a business request is sent to a disaster recovery node in the same city. If a failure occurs at the disaster recovery node in the same city when the business system sends the business request or thereafter, the business system believes that the business request has been sent to the disaster recovery node in the same city, and will not send the business request to the disaster recovery node in a different location again. Instead, the business system directly sends a new business request to the disaster recovery node in a different location. At this time, due to the time delay between the disaster recovery node in the same city and the disaster recovery node in a different location due to cross-regional reasons, the disaster recovery node in the same city does not synchronize the processing results of some of the received business requests to the disaster recovery node in a different location, so that this part of the processing results is not backed up in the disaster recovery node in a different location, resulting in incomplete data, causing economic losses or public opinion impact on users.
[0080] In an embodiment of the present application, a log node receives a business request and records the received business request. When both the production node and the local disaster recovery node fail, the recorded business request is forwarded to a remote disaster recovery node. The recorded business request includes business requests that have been sent to the local disaster recovery node but whose processing results have not been synchronized to the remote disaster recovery node. The remote disaster recovery node reprocesses these business requests, thereby ensuring that business requests before and after the failure of the local disaster recovery node are not missed through log compensation, and ensuring that the processing results of all business requests can be saved in the remote disaster recovery node, thereby ensuring the integrity of the backup data of the remote disaster recovery node.
[0081] In an embodiment of the present application, the business request forwarded to the disaster recovery node in the same city and forwarded to the disaster recovery node in a different location due to the failure of the disaster recovery node in the same city may include multiple requests. At this time, the log node forwards the multiple business requests to the disaster recovery node in a different location according to the order in which the multiple business requests to be processed are received. In one example, the log node receives business request 1, forwards business request 1 to the disaster recovery node in the same city, then receives business request 2, and after business request 1, forwards business request 2 to the disaster recovery node in the same city. In the event of a failure of the disaster recovery node in the same city, business request 1 and business request 2 are forwarded to the disaster recovery node in a different location according to the order in which the business requests are received. The disaster recovery node in a different location processes business request 1 and business request 2, and obtains the processing results of business request 1 and business request 2, i.e., compensation data.
[0082] In an embodiment of the present application, when the local disaster recovery node that receives the service request operates normally, the local disaster recovery node processes the received service request to obtain the processing result, and synchronizes the processing result to the remote disaster recovery node.
[0083] In some embodiments, forwarding the recorded business request to the off-site disaster recovery node in S403 includes: obtaining a set of synchronized business requests corresponding to the off-site disaster recovery node; the synchronized business request set is composed of business requests corresponding to the processing results synchronized by the off-site disaster recovery node; if the synchronized business request set does not include the business request, forwarding the business request to the off-site disaster recovery node.
[0084] Here, the log node records the business requests that have been processed by the off-site disaster recovery node, and records them in the form of a synchronized business request set. Before forwarding the business request to the off-site disaster recovery node, it is determined whether the business request to be forwarded is included in the synchronized business request set corresponding to the off-site disaster recovery node. In the case where the business request to be forwarded is included in the synchronized business request set corresponding to the off-site disaster recovery node, it indicates that the off-site disaster recovery node has completed the backup of the data of the business request, and the business request is not forwarded. In the case where the business request to be forwarded is not included in the synchronized business request set corresponding to the off-site disaster recovery node, it indicates that the off-site disaster recovery node has not completed the backup of the data of the business request, and the business request is forwarded, and the off-site disaster recovery node completes the processing of the business request.
[0085] In an embodiment of the present application, the business requests included in the synchronized business request set corresponding to the off-site disaster recovery node are business requests that have been processed by the disaster recovery node in the same city and are synchronized with the processing results of the business requests completed by the off-site disaster recovery node.
[0086] When the local disaster recovery node completes the processing of a business request and synchronizes the processing result to the remote disaster recovery node, the local disaster recovery node can send a business completion response to the log node, indicating that the business request has been processed and the data synchronization has been completed, or after the remote disaster recovery node completes the synchronization of the processing result of the business request, it sends a business request synchronization completion notification to the log node, and the log node adds the business request to the synchronized business request set corresponding to the remote disaster recovery node.
[0087] In one example, the synchronized business request set corresponding to the off-site disaster recovery node includes business request 7, business request 8, business request 9, and business request 10. When the log node forwards business request 10 to the disaster recovery node in the same city, and detects that the disaster recovery node in the same city has a fault, it is determined that the synchronized business request set corresponding to the disaster recovery node in the off-site disaster recovery node includes business request 10, which indicates that the processing result of business request 10 has been synchronized, and the off-site disaster recovery node does not need to process business request 4 again; when the log node forwards business request 11 to the disaster recovery node in the same city, and detects that the disaster recovery node in the same city has a fault, it is determined that the synchronized business request set corresponding to the disaster recovery node in the off-site disaster recovery node does not include business request 11, which indicates that the processing result of business request 11 has not been synchronized, and the off-site disaster recovery node needs to process business request 11 again.
[0088] In an embodiment of the present application, the log node can accurately determine whether the processing result of the business request has been synchronized on the off-site disaster recovery node, that is, whether the off-site disaster recovery node has completed the backup of the data of the business request, by comparing the business request to be forwarded with the set of completed synchronized business requests corresponding to the off-site disaster recovery node. This ensures the accuracy of data backup and avoids repeated processing of business requests whose processing results have been synchronized.
[0089] In some embodiments, the log node is set in the off-site disaster recovery node; the method also includes: after forwarding the recorded business request to the off-site disaster recovery node, suspending receiving new business requests until the off-site disaster recovery node completes processing of the business request.
[0090] When the log node is set in the off-site disaster recovery node, the database system in the off-site disaster recovery node processes the business request. The production node and the local disaster recovery node fail and cannot provide services. When the log node forwards the business request to the off-site disaster recovery node, that is, forwards it to the database system of the off-site disaster recovery node, the off-site disaster recovery node is processing the business request received before the local disaster recovery node fails, and a high-availability switch has been completed, completing the transition from the stage of copying data to the stage of directly processing the received business requests. At this time, the off-site disaster recovery node suspends receiving new business requests to avoid excessive system load and data leakage.
[0091] In actual applications, at this time, the off-site disaster recovery node can only receive new business requests, distinguish and identify the new business requests from the business requests that have not been processed by the same-city disaster recovery node, and continue to process the received new business requests after completing the processing of the business requests that should have been processed by the same-city disaster recovery node.
[0092] It should be noted that when the log node detects a failure of the disaster recovery node in the same city, it instructs the off-site disaster recovery node to perform high-availability switching. After the off-site disaster recovery node completes the business processing of the business request forwarded to the disaster recovery node in the same city, it completes the high-availability switching. The log node directly forwards the received business request to the off-site disaster recovery node, so that the off-site disaster recovery node processes the received business request.
[0093] based on Figure 2 Or the data backup system shown in 3, the embodiment of the present application provides a data backup method, such as Figure 5 As shown, including:
[0094] S501: The log node receives a service request and records the service request.
[0095] S502: When the production node fails, the log node forwards the service request to a disaster recovery node in the same city.
[0096] S503: When determining that the local disaster recovery node fails, the log node forwards the recorded service request to the remote disaster recovery node.
[0097] S504: The remote disaster recovery node processes the service request to obtain compensation data.
[0098] The compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node.
[0099] In the event of a failure of the disaster recovery node in the same city, the disaster recovery node in a different location enters high-availability switching, receives the business request that the log node originally forwarded to the disaster recovery node in the same city, and processes the unfinished business request received from the disaster recovery node in the same city. After completing the processing of the business request that was originally forwarded to the disaster recovery node in the same city, the high-availability switching is completed, and the log node directly forwards the business request received from the business request sending order to the disaster recovery node in a different location, which provides business request processing services. Here, the business request that has been forwarded to the disaster recovery node in the same city but has not been completed, that is, the processing result has not been synchronized to the disaster recovery node in a different location can be called a compensation business request. The disaster recovery node in a different location processes the received compensation business request, and the processing result obtained is called compensation data.
[0100] In an embodiment of the present application, business requests may include requests for different types of operations such as query requests, data addition requests, modification requests, and deletion requests, so that the standby node performs operations such as data query, data addition, data modification, and data deletion according to the received business requests.
[0101] The data backup method provided by the embodiment of the present application forwards business requests to the production node, the disaster recovery node in the same city, and the disaster recovery node in a different location by the log node. In the event of failure of the production node and the disaster recovery node in the same city, the disaster recovery node in the different location continues to process the business requests that have been sent to the disaster recovery node in the same city but the processing results have not been synchronized to the disaster recovery node in the different location. This ensures that there are no omissions in the business requests processed by the data backup system before and after the failure of the disaster recovery node in the same city, thereby ensuring the integrity of the backup data of the disaster recovery node in the different location.
[0102] In some embodiments, when the production node operates normally, the method further includes: the log node forwards the business request to the production node; the production node processes the business request to obtain a processing result; the production node locally stores the processing result; the production node and the disaster recovery node in the same city synchronize the processing result through semi-synchronous replication; the production node and the disaster recovery node in a different location synchronize the processing result through asynchronous replication.
[0103] When the log node sends the business request to the production node and the production node operates normally, the production node processes the business request locally, obtains the processing result, and synchronizes the processing result of the business request with the disaster recovery node in the same city and the disaster recovery node in a different location to complete data synchronization.
[0104] The production node synchronizes the processing results with the disaster recovery node in the same city through semi-synchronous replication. That is, for each business request, the production node can ensure that the log file corresponding to the business request is synchronized to the disaster recovery node in the same city in real time. The production node can complete the submission operation of the processing result of the business request only after receiving the response from the disaster recovery node in the same city.
[0105] The production node synchronizes the processing results with the remote disaster recovery node through asynchronous replication. That is, the production node does not guarantee that the data is synchronized to the remote disaster recovery node in real time, and there may be synchronization delays.
[0106] Compared with the network conditions in the same city, the network delay between the production nodes and the off-site disaster recovery nodes is large and the bandwidth is relatively small. In the data backup method provided in the embodiment of the present application, the off-site disaster recovery nodes and the production nodes are synchronized by asynchronous replication, and the disaster recovery nodes in the same city are synchronized with the production nodes by semi-synchronous replication. While ensuring the switching speed of the disaster recovery nodes in the same city when a production node fails, the strong service capability of the production nodes is guaranteed.
[0107] In some embodiments, when the production node fails and the local disaster recovery node operates normally, the method further includes: the local disaster recovery node processes the business request to obtain a processing result; the local disaster recovery node locally stores the processing result; the local disaster recovery node synchronizes the processing result with the remote disaster recovery node through asynchronous replication.
[0108] In some embodiments, the method further includes: the local disaster recovery node locally storing the processing result; the local disaster recovery node and the remote disaster recovery node synchronizing the processing result through asynchronous replication.
[0109] In the event of a production node failure, the disaster recovery node in the same city performs high-availability switching, and the log node sends a new business request to the backup node of the production node: the disaster recovery node in the same city, and the disaster recovery node in the same city continues to process the new business request.
[0110] The local disaster recovery node processes the received business request under normal operation and synchronizes the processing result to the remote disaster recovery node. Here, the local disaster recovery node synchronizes the processing result to the remote disaster recovery node through asynchronous replication.
[0111] In some embodiments, after the same-city disaster recovery node synchronizes the processing results with the remote disaster recovery node through asynchronous replication, the method further includes: the same-city disaster recovery node sends a business processing completion response to the log node; the log node adds the business request to the synchronized business request set corresponding to the remote disaster recovery node based on the business processing completion response; the synchronized business request set is composed of business requests corresponding to the processing results synchronized by the remote disaster recovery node.
[0112] After the off-site disaster recovery node synchronizes the processing results, the same-city disaster recovery node sends a business processing completion response to the log node, instructing the log node to: the same-city disaster recovery node and the off-site disaster recovery node complete the synchronization of the processing results of the business request; after receiving the business processing completion response, the log node adds the business request to the synchronized business request set.
[0113] After the off-site disaster recovery node completes synchronization with the processing results of the local disaster recovery node, the local disaster recovery node returns a business request completion response to the log node to notify the log node that the current business request has completed processing at the local disaster recovery node and completed synchronization at the off-site disaster recovery node, so that the log node can promptly learn the current synchronization status of the off-site disaster recovery node and the local disaster recovery node. Based on the business request completion response, the log node adds the business request corresponding to the synchronized processing result to the synchronized business request set corresponding to the off-site disaster recovery node.
[0114] In some embodiments, the implementation of S503 includes: obtaining a set of synchronized business requests corresponding to the off-site disaster recovery node; the set of synchronized business requests corresponding to the off-site disaster recovery node is composed of business requests synchronized by the off-site disaster recovery node; if the synchronized business request set does not include the business request, forwarding the business request to the off-site disaster recovery node.
[0115] The business requests in the synchronized business request set can be used by the log node to determine whether to forward a business request to a remote disaster recovery node when the local disaster recovery node is determined to be faulty.
[0116] When a business request is included in the synchronized business request set corresponding to the off-site disaster recovery node, it indicates that the off-site disaster recovery node has completed the synchronization of the processing results of the business request and does not need to process the business request. When a business request is not included in the synchronized business request set corresponding to the off-site disaster recovery node, it indicates that the off-site disaster recovery node has not completed the synchronization of the processing results of the business request and needs to process the business request. The log node needs to forward the business request to the off-site disaster recovery node, and the off-site disaster recovery node will re-process the business request.
[0117] The data backup system provided in the embodiment of the present application includes three states:
[0118] Status 1: The production nodes, local disaster recovery nodes, and remote disaster recovery nodes are all operating normally;
[0119] At this time, the log node forwards the received business request to the production node, and after the production node completes the processing of the business request and obtains the processing result, it synchronizes the processing result to the disaster recovery node in the same city and the disaster recovery node in a different location.
[0120] Status 2: The production node fails, but the local disaster recovery node and the remote disaster recovery node are operating normally.
[0121] At this time, the log node forwards the received business request to the disaster recovery node in the same city, and after the disaster recovery node in the same city completes the processing of the business request and obtains the processing result, it synchronizes the processing result to the disaster recovery node in the other place.
[0122] Status 3: The production node and the local disaster recovery node fail, but the remote disaster recovery node operates normally.
[0123] At this time, the log node forwards the received business request to the off-site disaster recovery node.
[0124] When the log node detects a production node failure, the local disaster recovery node performs a high-availability switch, and the data backup system needs to switch from state one to state two. The log node forwards the business requests that have been forwarded to the production node but have not been processed by the production node, that is, the business requests that have not been synchronized by the local disaster recovery node are forwarded to the local disaster recovery node. The local disaster recovery node processes these business requests. After completing the processing of these business requests, the high-availability switch ends and the data backup system switches to state two.
[0125] When the log node detects a failure in the local disaster recovery node, the remote disaster recovery node performs a high availability switch, and the data backup system needs to switch from state two to state three. The log node forwards the business requests that have been forwarded to the local disaster recovery node but have not been processed by the local disaster recovery node, that is, the business requests that have not been synchronized by the remote disaster recovery node, to the remote disaster recovery node. The remote disaster recovery node reprocesses these business requests. After completing the processing of these business requests, the high availability switch ends and the data backup system switches to state three.
[0126] Among them, the log node can forward a new business request that has not been forwarded to the disaster recovery node in the same city to the disaster recovery node in a different location. If the recorded business requests contain business requests that have been forwarded to the disaster recovery node in the same city but the processing results have not been synchronized to the disaster recovery node in a different location, that is, compensation business requests, the log node will forward the recorded business request to the disaster recovery node in a different location, and the disaster recovery node in a different location will re-process the business request.
[0127] The data backup method provided in the embodiment of the present application ensures the integrity of the backup data of the off-site disaster recovery node by means of log compensation. Data synchronization is performed between the disaster recovery node and the production node in the same city by means of semi-synchronous replication. Under the network conditions of small network delay and large bandwidth between the production node and the disaster recovery node in the same city, the delay and concurrency requirements of the business are met while ensuring the switching speed of the disaster recovery node in the same city when a production node fails. In addition, data synchronization is performed between the off-site disaster recovery node and the production node by means of asynchronous replication. Under the network conditions of large network delay and relatively small bandwidth between the production node and the off-site disaster recovery node, without the need to lay dedicated network facilities, the database service capability of the production node is guaranteed while ensuring the data integrity of the off-site disaster recovery node, providing off-site disaster recovery capability.
[0128] Below, the data backup method provided in the embodiment of the present application is further explained through specific application scenarios.
[0129] In the data backup system, the network delay between the production center (i.e., production node) and the disaster recovery center in the same city (i.e., disaster recovery node in the same city) is small and the bandwidth is large, while the network delay between the production center and the disaster recovery center in a different location (i.e., disaster recovery node in a different location) is large and the bandwidth is relatively small. In order to ensure the database service capability of the production center, the disaster recovery center in a different location synchronizes data with the production center through asynchronous replication; in order to ensure the switching speed of the disaster recovery center in the same city when a failure occurs in the production center, the disaster recovery center in the same city synchronizes data with the production center through semi-synchronous replication; in order to ensure the data integrity of the disaster recovery center in a different location, this proposal adds a log system in the disaster recovery center in a different location, and uses log compensation to ensure data integrity when switching the disaster recovery center in a different location.
[0130] Based on the status of each data processing center, the data backup system provided by the embodiment of the present application includes the following three situations:
[0131] Situation 1: Processing business requests;
[0132] Scenario 2: The disaster recovery center in the same city processes the business request. At this time, the production center fails.
[0133] Case 3: The off-site disaster recovery center processes the business request. At this time, the production center and the disaster recovery center in the same city fail.
[0134] In the present application embodiment, Figure 6As shown, a production center 6011 and a disaster recovery center 6012 in the same city are built in city 601, and a disaster recovery center 6021 in a different location is built in city 602. The production center 6011 and the disaster recovery center 6012 in the same city each include a database system: database system 60111 and database system 60121. In addition to a database system 60211, the disaster recovery center 6021 in a different location also includes a log system, i.e., a log node 60212. The log system 60212 is used to receive business requests, and to record business requests in sequence, and is also responsible for forwarding business requests. Each database system is used to process business requests.
[0135] In the case of Figure 7 As shown, the log system 60212 forwards the business request to the production center 6011, which processes the business request. The production center 6011 and the disaster recovery center 6012 in the same city perform data synchronization through semi-synchronous replication, and the production center 6011 and the disaster recovery center 6021 in a different location perform data synchronization through asynchronous replication.
[0136] The method by which the data backup system processes business requests, such as Figure 8 As shown, including:
[0137] S801. The log system receives the business request and forwards it to the production center.
[0138] Here, the business system sends a business request to the data backup system. The log system located in the off-site disaster recovery center receives the business request, records the business request locally in the log system, and forwards the business request to the database system in the production center.
[0139] S802. The production center processes the business request.
[0140] S803. The production center synchronizes data with the disaster recovery center in the same city.
[0141] After the production center completes the processing of the business request, it synchronizes the processing results of the business request to the disaster recovery center in the same city through semi-synchronous replication.
[0142] S804. The production center returns the processing result of the business request to the business system.
[0143] After the production center completes the synchronization of data with the disaster recovery center in the same city, it returns the processing result of the business request to the business system to complete the business processing.
[0144] S805. The production center synchronizes data with the remote disaster recovery center.
[0145] After the production center completes business processing, it synchronizes data to the off-site disaster recovery center through asynchronous replication.
[0146] In case 2, if Fig. 9 As shown, the production center 6011 fails, and the log system 60212 forwards the business request to the local disaster recovery center 6012, which processes the business request. The local disaster recovery center 6012 and the remote disaster recovery center 6021 synchronize data through asynchronous replication.
[0147] At this time, the data backup system processes the service request in the following way: Fig.10 As shown, including:
[0148] S1001. The log system receives a business request and forwards the business request to the production center, but the forwarding fails.
[0149] Here, the business system sends a business request to the data backup system. The log system located in the off-site disaster recovery center receives the business request and records the business request locally in the log system. At the same time, the business request is forwarded to the database system in the production center. If the log system detects that the communication connection with the production center is disconnected before or after forwarding, it will be judged that the business forwarding is unsuccessful and it is necessary to switch from the production center to the disaster recovery center in the same city.
[0150] S1002. The log system forwards the business request to the disaster preparedness center in the same city.
[0151] S1003. The local disaster preparedness center processes the service request.
[0152] At this time, the local disaster preparedness center provides database services to the outside world.
[0153] S1004. The local disaster recovery center synchronizes data with the remote disaster recovery center.
[0154] After the local disaster recovery center completes the processing of the business request, it synchronizes the processing results of the business request to the remote disaster recovery center through asynchronous replication.
[0155] In case three, if Fig.11 As shown, the production center 6011 and the local disaster recovery center 6012 fail, and the log system 60212 forwards the business request to the remote disaster recovery center 6021, which processes the business request.
[0156] At this time, the data backup system processes the service request in the following way: Fig.12 As shown, including:
[0157] S1201. The log system receives a business request and forwards the business request to the production center and the disaster recovery center in the same city, but the forwarding fails.
[0158] Here, the business system sends a business request to the data backup system. The log system located in the off-site disaster recovery center receives the business request and records the business request locally in the log system. At the same time, the business request is forwarded to the database system in the production center. If the log system detects that the communication connection with the production center is disconnected before or after forwarding, it will be judged that the business forwarding is unsuccessful and it is necessary to switch from the production center to the disaster recovery center in the same city.
[0159] The log system forwards the recorded business requests to the local disaster recovery center. If the log system detects that the communication connection with the local disaster recovery center is disconnected before or after forwarding, it will determine that the business forwarding is unsuccessful and it is necessary to switch from the local disaster recovery center to the remote disaster recovery center.
[0160] S1202: The log system stops receiving service requests.
[0161] S1203: The database of the remote disaster recovery center requests log compensation from the log system of the remote disaster recovery center.
[0162] S1204. The log system sends the unexecuted business requests of the local disaster recovery center to the database system of the remote disaster recovery center.
[0163] Among them, the business requests that are not executed by the disaster recovery center in the same city are business requests that have not been synchronized between the disaster recovery center in the same city and the disaster recovery center in a different location.
[0164] S1205. The database system of the remote disaster recovery center processes the business request.
[0165] Here, the database system of the remote disaster recovery center redoes the received business requests.
[0166] S1206. The database system of the remote disaster recovery center provides database services.
[0167] After the database system of the off-site disaster recovery center completes the redoing of unsynchronized business requests, it receives business requests from the business system and provides database services to the outside world.
[0168] The data backup method provided in the embodiment of the present application solves the problem of data synchronization between the remote disaster recovery center and the production center in the two-site three-center solution of the database. Compared with the network conditions in the same city, the network delay between the production center and the remote disaster recovery center is large and the bandwidth is relatively small. It is difficult to have both the strong service capability of the production center and the data integrity of the remote disaster recovery center. The data backup method provided in the embodiment of the present application adds a log system in the remote disaster recovery center to receive business requests and record the current business requests locally, and then forward the current business requests to the database system in the production center. Based on the architectural design of this proposal, the remote disaster recovery center and the production center synchronize data through asynchronous replication, and the disaster recovery center in the same city synchronizes data with the production center through semi-synchronous replication. This ensures the strong service capability of the production center, and the remote disaster recovery center ensures the data integrity of the remote disaster recovery center when switching the remote disaster recovery center through log compensation.
[0169] Fig.13 Schematic diagram of the implementation process of a data backup device according to an embodiment of the present application. The device is applied to a log node, and the log node and the remote disaster recovery node are set in the same area; Fig.13 As shown, the apparatus 1300 includes:
[0170] The receiving module 1301 is used to receive a service request and record the service request;
[0171] The forwarding module 1302 is used to forward the service request to the disaster recovery node in the same city when the production node fails;
[0172] The forwarding module 1302 is also used to forward the recorded business request to the off-site disaster recovery node when it is determined that the same-city disaster recovery node has a fault. The off-site disaster recovery node is used to process the business request to obtain compensation data; the compensation data includes the processing result that the corresponding business request has been forwarded to the same-city disaster recovery node but has not been synchronized to the off-site disaster recovery node.
[0173] In some embodiments, the forwarding module 1302 is further configured to:
[0174] Acquire a synchronized service request set corresponding to the remote disaster recovery node; the synchronized service request set is composed of service requests corresponding to the synchronized processing results of the remote disaster recovery node;
[0175] When the synchronized service request set does not include the service request, the service request is forwarded to the remote disaster recovery node.
[0176] In some embodiments, the apparatus 1300 further includes: a first determination module, configured to:
[0177] Detecting a first communication connection between a local node and the disaster recovery node in the same city;
[0178] When the first communication connection is in a disconnected state, it is determined that the same-city disaster recovery node is faulty.
[0179] In some embodiments, the receiving module 1301 is also used to: after forwarding the recorded business request to the off-site disaster recovery node, suspend receiving new business requests until the off-site disaster recovery node completes processing of the business request, wherein the log node is set in the off-site disaster recovery node.
[0180] In some embodiments, the apparatus 1300 further includes: a second determination module, configured to:
[0181] Detecting a second communication connection between the local node and the production node;
[0182] When the second communication connection is in a disconnected state, it is determined that the production node fails.
[0183] The present application also provides a data backup system. Figure 2 or Figure 3 As shown, the data backup system 20 includes: a production node 201, a local disaster recovery node 202, a remote disaster recovery node 203, and a log node 204 that is set in the same area as the remote disaster recovery node 203;
[0184] The log node 204 receives the service request and records the service request;
[0185] When the production node 201 fails, the log node 204 forwards the service request to the disaster recovery node 202 in the same city;
[0186] When the log node 204 determines that the local disaster recovery node 202 fails, the log node 204 forwards the recorded service request to the remote disaster recovery node 203;
[0187] The remote disaster recovery node 203 processes the service request to obtain compensation data; the compensation data includes the processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node.
[0188] In some embodiments, when the production node 201 operates normally,
[0189] The log node 204 forwards the service request to the production node 201;
[0190] The production node 201 processes the service request and obtains a processing result;
[0191] The production node 201 stores the processing result locally;
[0192] The production node 201 and the disaster recovery node 202 in the same city synchronize the processing results through semi-synchronous replication;
[0193] The production node 201 and the remote disaster recovery node 203 synchronize the processing results by asynchronous replication.
[0194] In some embodiments, when the production node 201 fails and the local disaster recovery node 202 operates normally, the local disaster recovery node 202 processes the service request and obtains a processing result;
[0195] The local disaster recovery node 202 stores the processing result locally;
[0196] The local disaster recovery node 202 synchronizes the processing result with the remote disaster recovery node 203 by asynchronous replication.
[0197] In some embodiments, Figure 3 As shown, after the local disaster recovery node 202 synchronizes the processing result with the remote disaster recovery node 203 through asynchronous replication,
[0198] The local disaster recovery node 202 sends a business processing completion response to the log node 204;
[0199] The log node 204 adds the business request to the synchronized business request set corresponding to the remote disaster recovery node according to the business processing completion response; the synchronized business request set is composed of the business requests corresponding to the synchronized processing results of the remote disaster recovery node.
[0200] In some embodiments, the log node 204 obtains a synchronized business request set corresponding to the remote disaster recovery node 203; the synchronized business request set is composed of business requests corresponding to the synchronized processing results of the remote disaster recovery node;
[0201] When the synchronized service request set does not include the service request, the log node 204 forwards the service request to the remote disaster recovery node 203 .
[0202] It should be noted that the data backup device provided in the embodiment of the present application includes the various units included, which can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Micro Processor Unit), a digital signal processor (DSP, Digital Signal Processor) or a field programmable gate array (FPGA, Field-Programmable Gate Array), etc.
[0203] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0204] It should be noted that in the embodiments of the present application, if the above-mentioned data backup method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0205] Correspondingly, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the data backup method provided in the above embodiment are implemented.
[0206] Correspondingly, an embodiment of the present application provides a storage medium, that is, a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data backup method provided in the above embodiment are implemented.
[0207] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0208] It should be noted that Fig.14 A hardware entity diagram of an electronic device according to an embodiment of the present application is shown in FIG. Fig.14 As shown, the electronic device 1400 includes: a processor 1401, at least one communication bus 1402, a user interface 1403, at least one external communication interface 1404 and a memory 1405. The communication bus 1402 is configured to achieve connection and communication between these components. The user interface 1403 may include a display screen, and the external communication interface 1404 may include a standard wired interface and a wireless interface.
[0209] The memory 1405 is configured to store instructions and applications executable by the processor 1401, and can also cache data to be processed or processed by the processor 1401 and various modules in the electronic device (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0210] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0211] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0212] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0213] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0214] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0215] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memories (ROM), magnetic disks or optical disks.
[0216] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0217] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data backup method, characterized in that: Applied to a log node, the log node and the remote disaster recovery node are arranged in the same region; the method comprises: Receive a service request, record the service request, and forward the service request to a production node; In the event of a failure of the production node, forwarding the service request to a disaster recovery node in the same city; In the case where it is determined that the local disaster recovery node fails, obtaining a synchronized service request set corresponding to the local disaster recovery node, and in the case where the synchronized service request set does not include the service request, forwarding the service request to the remote disaster recovery node, and the remote disaster recovery node is used to process the service request to obtain compensation data; the compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node; The synchronized business request set is composed of business requests corresponding to the processing results synchronized by the remote disaster recovery node, and the business requests corresponding to the synchronized processing results are processed by the local disaster recovery node.
2. The method according to claim 1, characterized in that The method further comprises: Detecting a first communication connection between a local node and the disaster recovery node in the same city; When the first communication connection is in a disconnected state, it is determined that the same-city disaster recovery node is faulty.
3. The method according to claim 1, characterized in that The log node is set in the remote disaster recovery node; the method also includes: After forwarding the recorded service request to the remote disaster recovery node, receiving new service requests is suspended until the remote disaster recovery node completes processing of the service request.
4. The method according to claim 1, characterized in that: The method further comprises: Detecting a second communication connection between the local node and the production node; When the second communication connection is in a disconnected state, it is determined that the production node fails.
5. A data backup method, characterized in that: Applied to a data backup system, the data backup system includes: a production node, a local disaster recovery node, a remote disaster recovery node, and a log node set in the same area as the remote disaster recovery node; the method includes: The log node receives the service request, records the service request, and forwards the service request to the production node; When the production node fails, the log node forwards the service request to the disaster recovery node in the same city; When determining that the local disaster recovery node fails, the log node obtains a synchronized service request set corresponding to the local disaster recovery node, and forwards the service request to the remote disaster recovery node when the synchronized service request set does not include the service request; The remote disaster recovery node processes the service request to obtain compensation data; the compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node; The synchronized business request set is composed of business requests corresponding to the processing results synchronized by the remote disaster recovery node, and the business requests corresponding to the synchronized processing results are processed by the local disaster recovery node.
6. The method according to claim 5, characterized in that When the production node operates normally, the method further includes: The log node forwards the service request to the production node; The production node processes the service request to obtain a processing result; The production node locally stores the processing result; The production node and the disaster recovery node in the same city synchronize the processing results by means of semi-synchronous replication; The production node and the remote disaster recovery node synchronize the processing results by asynchronous replication.
7. The method according to claim 5, characterized in that In the case where the production node fails and the disaster recovery node in the same city operates normally, the method further includes: The local disaster recovery node processes the service request and obtains a processing result; The local disaster recovery node locally stores the processing result; The local disaster recovery node synchronizes the processing result with the remote disaster recovery node by asynchronous replication.
8. The method according to claim 7, characterized in that After the local disaster recovery node synchronizes the processing result with the remote disaster recovery node by asynchronous replication, the method further includes: The local disaster recovery node sends a business processing completion response to the log node; The log node adds the business request to the synchronized business request set corresponding to the remote disaster recovery node according to the business processing completion response.
9. A data backup device, applied to a log node, wherein the log node and the remote disaster recovery node are arranged in the same area; the device comprises: A receiving module, used to receive a service request, record the service request, and forward the service request to a production node; A forwarding module, used for forwarding the service request to a disaster recovery node in the same city when the production node fails; The forwarding module is further used to obtain a synchronized service request set corresponding to the local disaster recovery node when it is determined that the local disaster recovery node fails, and forward the service request to the remote disaster recovery node when the synchronized service request set does not include the service request, and the remote disaster recovery node is used to process the service request to obtain compensation data; the compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node; The synchronized business request set is composed of business requests corresponding to the processing results synchronized by the remote disaster recovery node, and the business requests corresponding to the synchronized processing results are processed by the local disaster recovery node.
10. A data backup system, comprising: Production nodes, local disaster recovery nodes, remote disaster recovery nodes, and log nodes that are located in the same region as the remote disaster recovery nodes; The log node receives the service request, records the service request, and forwards the service request to the production node; When the production node fails, the log node forwards the service request to the disaster recovery node in the same city; When determining that the local disaster recovery node fails, the log node obtains a synchronized service request set corresponding to the local disaster recovery node, and forwards the service request to the remote disaster recovery node when the synchronized service request set does not include the service request; The remote disaster recovery node processes the service request to obtain compensation data; the compensation data includes a processing result that the corresponding service request has been forwarded to the local disaster recovery node but has not been synchronized to the remote disaster recovery node; The synchronized business request set is composed of business requests corresponding to the processing results synchronized by the remote disaster recovery node, and the business requests corresponding to the synchronized processing results are processed by the local disaster recovery node.
11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the data backup method described in any one of claims 1 to 4, or implements the data backup method described in any one of claims 5 to 8.
