Data backup method and device, storage medium and electronic equipment
By introducing a front-end service gateway for the first cluster into the disaster recovery system, generating probe data packets and verifying the data source before writing them to the first cluster, the problem of low data backup efficiency in existing technologies is solved, achieving efficient and secure data backup and rapid switching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2022-12-23
- Publication Date
- 2026-04-21
AI Technical Summary
Existing disaster recovery methods suffer from low data backup efficiency, and discrepancies exist in the write progress of different write ends, which accumulate over time and affect the efficiency of data backup.
By introducing a front-end service gateway for the first cluster into the disaster recovery system, probe data packets are generated and sent to the front-end service gateways of other clusters. Data to be backed up with larger storage timestamps is detected and obtained. After verifying the data source using public key decryption and digest algorithms, the data is written to the first cluster, thus achieving efficient data backup.
It improves data backup efficiency, saves production resources, ensures data source security, reduces data loss, and supports active-active application deployment and rapid switching.
Smart Images

Figure CN116382970B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data backup method and apparatus, storage medium and electronic device. Background Technology
[0002] Currently, with the development of cloud computing technology and industry, data security is becoming increasingly important. Targeted mitigation measures are implemented from the initial design stage of information system architecture to address data loss caused by unforeseen circumstances. Among these measures, off-site data disaster recovery is one of the most common and crucial.
[0003] Existing disaster recovery methods typically involve the production server simultaneously writing data to multiple clusters located in different regions. This approach not only requires increased resources for the data writing end but is also affected by wide area network transmission latency, leading to differences in writing progress between different ends. These differences accumulate over time, resulting in low data backup efficiency. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a data backup method that can improve data backup efficiency.
[0005] The present invention also provides a data backup device to ensure the implementation and application of the above method in practice.
[0006] A data backup method, applied to the first front-end service gateway of the first cluster in a disaster recovery system, the method comprising:
[0007] In response to a probe command, a probe data packet is generated; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is: the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster;
[0008] The probe data packet is sent to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier.
[0009] Receive the first detection results sent by each of the second front-end service gateways;
[0010] If at least one of the first detection results indicates the existence of data to be backed up, the source gateway corresponding to the data to be backed up is determined in each of the second front-end service gateways;
[0011] Obtain the data to be backed up from the source gateway corresponding to the data to be backed up;
[0012] The acquired data to be backed up is written into the first cluster.
[0013] Optionally, in the above method, writing the acquired data to be backed up into the first cluster includes:
[0014] Obtain the public key of the source gateway corresponding to the data to be backed up;
[0015] Using the public key of the source gateway corresponding to the data to be backed up, the signature information of the data to be backed up is decrypted to obtain a first digest value of the data to be backed up; and using a preset digest algorithm, the data to be backed up is calculated to obtain a second digest value of the data to be backed up.
[0016] If the first digest value and the second digest value of the data to be backed up are the same, the data to be backed up is decrypted using a preset decryption key to obtain the original data corresponding to the data to be backed up; the original data corresponding to the data to be backed up is written into the first cluster.
[0017] Optionally, after writing the original data corresponding to the data to be backed up into the first cluster, the above method further includes:
[0018] Generate a storage timestamp for the original data, and encrypt the original data using a preset encryption key to obtain encrypted data;
[0019] The target digest value of the encrypted data is calculated based on a preset digest algorithm;
[0020] The target digest value is signed using the private key of the first cluster to obtain the encrypted digest value of the encrypted data;
[0021] The storage timestamp of the original data, the encrypted data, and the encrypted digest value are stored in the storage area of the first front-end service gateway.
[0022] Optionally, after writing the acquired data to be backed up into the first cluster, the above method further includes:
[0023] When a probe request is received from the second front-end service gateway of the target second cluster, the system checks whether the data to be backed up corresponding to the probe request exists in the storage area corresponding to the first front-end service gateway, and obtains a second detection result.
[0024] The second detection result is sent to the second front-end service gateway of the target second cluster.
[0025] Optionally, in the above method, detecting whether the data to be backed up corresponding to the probe request exists in the storage area corresponding to the first front-end service gateway includes:
[0026] Obtain the target cluster identifier and the target storage timestamp corresponding to the target cluster identifier contained in the probe request;
[0027] Determine the storage timestamps of each candidate data corresponding to the target cluster identifier stored in the storage area corresponding to the first front-end service gateway;
[0028] If at least one of the candidate data has a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier, then the candidate data with a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier is determined as the data to be backed up corresponding to the probe request.
[0029] If the storage timestamps of the candidate data are all not greater than the target storage timestamp corresponding to the target cluster identifier, then it is determined that there is no data to be backed up in the storage area corresponding to the first front-end service gateway.
[0030] Optionally, in the above method, if at least one of the candidate data has a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier, then after sending the second detection result to the second front-end service gateway of the target second cluster, the method further includes:
[0031] When a pull data packet is received from the second front-end service gateway of the target second cluster based on the second detection result, the backup data corresponding to the pull data packet is sent to the second front-end service gateway of the target second cluster.
[0032] Optionally, after sending the backup data corresponding to the pull data packet to the second front-end service gateway of the target second cluster to the above method, it further includes:
[0033] Determine whether the data to be backed up corresponding to the retrieved data packet meets the preset clearing conditions;
[0034] If the backup data corresponding to the fetched data packet meets the clearing condition, the backup data corresponding to the fetched data packet is cleared in the storage area of the first front-end service gateway.
[0035] A data backup device is applied to the first front-end service gateway of the first cluster in a disaster recovery system, the device comprising:
[0036] A generation unit is configured to generate a probe data packet in response to a probe command; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster;
[0037] The sending unit is used to send the probe data packet to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier.
[0038] The receiving unit is used to receive the first detection results sent by each of the second front-end service gateways;
[0039] The determining unit is configured to determine the source gateway corresponding to the data to be backed up among each of the second front-end service gateways when at least one of the first detection results indicates the existence of data to be backed up.
[0040] The acquisition unit is used to acquire the data to be backed up from the source gateway corresponding to the data to be backed up;
[0041] The writing unit is used to write the acquired data to be backed up into the first cluster.
[0042] A storage medium includes storage instructions, wherein when the instructions are executed, the device in which the storage medium resides executes the data backup method described above.
[0043] An electronic device includes a memory and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described above for data backup.
[0044] Based on the above embodiments of the present invention, a data backup method, apparatus, storage medium, and electronic device are provided. The method includes: generating a probe data packet in response to a probe command; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster; sending the probe data packet to a second front-end service gateway of each second cluster in the disaster recovery system, such that each second front-end service gateway, based on the probe... The data packet checks whether the data to be backed up corresponding to each cluster identifier exists in its corresponding storage area, and obtains a first detection result. The data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier. The first detection result sent by each of the second front-end service gateways is received. If at least one of the first detection results indicates the existence of data to be backed up, the source gateway corresponding to the data to be backed up is determined among the second front-end service gateways. The data to be backed up is obtained from the source gateway corresponding to the data to be backed up. The obtained data to be backed up is written into the first cluster. By applying the method provided in this embodiment of the invention, resources on the production end can be saved, and the first front-end service gateway of the first cluster in the disaster recovery system can obtain the data to be backed up from the front-end service gateways of each second cluster in the disaster recovery system, which can effectively improve data backup efficiency. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0046] Figure 1 A flowchart of a data backup method provided by the present invention;
[0047] Figure 2 A flowchart of the process of writing data to be backed up into a first cluster is provided by the present invention;
[0048] Figure 3 An example diagram illustrating an implementation scenario of the present invention;
[0049] Figure 4 A flowchart of a data writing process provided by the present invention;
[0050] Figure 5 A flowchart of a data backup process provided by the present invention;
[0051] Figure 6 A schematic diagram of the structure of a data backup device provided by the present invention;
[0052] Figure 7 This is a schematic diagram of the structure of an electronic device provided by the present invention. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0055] This invention provides a data backup method, which can be applied to the first front-end service gateway of the first cluster in a disaster recovery system. The flowchart of the method is shown below. Figure 1 As shown, it specifically includes:
[0056] S101: In response to the probe command, generate a probe data packet; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is: the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster.
[0057] In this embodiment, the disaster recovery system may include multiple clusters, each cluster having its own front-end service gateway. The first cluster may be any cluster among the clusters, and the first front-end service gateway is the front-end service gateway of the first cluster. Each cluster in the disaster recovery system can be used to back up data of other clusters and store externally written data.
[0058] For example, if the first cluster stores data A1, data A2, and data A3 corresponding to the cluster identifier of the second cluster A, and the storage timestamp of data A3 is greater than the storage timestamps of data A1 and data A2; and the first cluster stores data B1, data B2, and data B3 corresponding to the cluster identifier of the second cluster B, and the storage timestamp of data B3 is greater than the storage timestamps of data B1 and data B2; then the storage timestamp of data A3 will be used as the target storage timestamp corresponding to the cluster identifier of the second cluster A; and the storage timestamp of data B3 will be used as the target storage timestamp corresponding to the cluster identifier of the second cluster B.
[0059] In some embodiments, when the first front-end service gateway of the first cluster receives an external write request, it obtains the request content from the external write request; writes the request content into the first cluster; after successfully writing the request content into the first cluster, it generates a storage timestamp based on the time the external write request was received, compresses the request content, and then encrypts the compressed request content using a preset encryption key to obtain first encrypted data; it calculates the digest value of the first encrypted data, and signs the digest value of the first encrypted data using the encryption key corresponding to the first cluster to obtain signed data. The storage timestamp, the cluster identifier of the first cluster, the first encrypted data, and the signed data are stored together in the storage area of the first front-end service gateway.
[0060] Optionally, the detection command can be a command triggered by the control program at a preset time interval, or a command triggered by the user clicking a preset virtual control or button.
[0061] Optionally, the data stored in the first cluster can be of various types, such as document data, business data, multimedia data, etc. In some embodiments, the data stored in the first cluster can be distributed time-series database and search engine (ElasticSearch, ES) document data.
[0062] S102: Send the probe data packet to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier.
[0063] In this embodiment, the storage area of each second front-end service gateway can store data corresponding to each cluster identifier. For each cluster identifier contained in the probe data packet, the target storage timestamp corresponding to the cluster identifier can be compared with the storage timestamps of each piece of data corresponding to the cluster identifier stored in the storage area of the second front-end service gateway. If at least one piece of data corresponding to the cluster identifier stored in the storage area of the second front-end service gateway has a storage timestamp greater than the target storage timestamp, then the data with a storage timestamp greater than the target storage timestamp is determined as the data to be backed up corresponding to that cluster identifier. If no data with a storage timestamp greater than the target storage timestamp is stored in the storage area of the second front-end service gateway, then it is determined that there is no data to be backed up for that cluster identifier.
[0064] For example, the storage area of the second front-end service gateway of the second cluster A stores data B1, data B2, B3 and data B4 corresponding to the cluster identifier of the second cluster B. Among them, the storage timestamp of data B4 is greater than the target storage timestamp corresponding to the cluster identifier of the second cluster B. Then, the second front-end service gateway of the second cluster A determines that data B4 in its storage area is the data to be backed up.
[0065] Optionally, after receiving the probe data packet, each second front-end service gateway obtains the cluster identifier of each second cluster in the probe data packet, as well as the target storage timestamp corresponding to each cluster identifier; and detects whether there is data to be backed up corresponding to each cluster identifier in the storage area of the second front-end service gateway.
[0066] In this embodiment, the storage area can be a local cache or a side-mounted cache.
[0067] In this embodiment, the first detection result can indicate whether there is data to be backed up or not; wherein, the first detection result indicating the existence of data to be backed up includes the storage timestamp of the data to be backed up and the cluster identifier corresponding to the data to be backed up.
[0068] In this embodiment, the front-end service gateway of each cluster in the disaster recovery system pre-stores the cluster identifier, IP address, domain name information, listening port information, public key for signing, and agreed encryption key of all clusters in the disaster recovery system.
[0069] Optionally, the probe data packets are sent via multicast to the second front-end service gateway of each of the second clusters in the disaster recovery system.
[0070] S104: If at least one of the first detection results indicates the existence of data to be backed up, determine the source gateway corresponding to the data to be backed up in each of the second front-end service gateways.
[0071] In this embodiment, the first detection result sent by each of the second front-end service gateways can be received first, and the receiving order of the first detection result indicating the existence of data to be backed up can be determined. Based on the storage timestamp of the data to be backed up, the cluster identifier corresponding to the data to be backed up, and the receiving order included in the first detection result, the source gateway corresponding to the data to be backed up can be determined among the second front-end service gateways.
[0072] In this embodiment, if the first detection results sent by multiple second front-end service gateways indicate the existence of the same data to be backed up, the source gateway of the data to be backed up can be determined from the multiple second front-end service gateways according to the receiving order of the first detection results.
[0073] S105: Obtain the data to be backed up from the source gateway corresponding to the data to be backed up.
[0074] In this embodiment, a pull data packet for the data to be backed up can be sent to the source gateway corresponding to the data to be backed up, so as to obtain the data to be backed up from the source gateway.
[0075] S106: Write the acquired data to be backed up into the first cluster.
[0076] By applying the method provided in this embodiment of the invention, the first front-end service gateway of the first cluster in the disaster recovery system can obtain the data to be backed up from the front-end service gateways of each second cluster in the disaster recovery system, which can effectively improve the data backup efficiency.
[0077] In one embodiment of the present invention, based on the above implementation process, optionally, the process of writing the acquired data to be backed up into the first cluster is as follows: Figure 2 As shown, it includes:
[0078] S201: Obtain the public key of the source gateway corresponding to the data to be backed up.
[0079] S202: Using the public key of the source gateway corresponding to the data to be backed up, decrypt the encrypted digest value of the data to be backed up to obtain a first digest value of the data to be backed up; and using a preset digest algorithm to calculate the data to be backed up to obtain a second digest value of the data to be backed up.
[0080] In this embodiment, the first front-end service gateway pre-stores the public keys of each of the second front-end service gateways. The public key of each second front-end service gateway can be used to decrypt the encrypted digest value of the data to be backed up obtained from the second front-end service gateway. The second front-end service gateway pre-encrypts the digest value of the data to be backed up using its private key to obtain the encrypted digest value of the data to be backed up.
[0081] S203: If the first digest value and the second digest value of the data to be backed up are consistent, the data to be backed up is decrypted using a preset decryption key to obtain the original data corresponding to the data to be backed up; the original data corresponding to the data to be backed up is written into the first cluster.
[0082] In this embodiment, if the first digest value and the second digest value of the data to be backed up are consistent, it indicates that the source of the data to be backed up is correct. In this case, the data to be backed up can be decrypted and written into the first cluster, which can effectively ensure the security of the data source.
[0083] Optionally, the data to be backed up can be decrypted using a preset decryption key to obtain decrypted data, and the decrypted data can be decompressed to obtain the original data corresponding to the data to be backed up.
[0084] In one embodiment of the present invention, based on the above implementation process, optionally, after writing the original data corresponding to the data to be backed up into the first cluster, the method further includes:
[0085] Generate a storage timestamp for the original data, and encrypt the original data using a preset encryption key to obtain encrypted data;
[0086] The target digest value of the encrypted data is calculated based on a preset digest algorithm;
[0087] The target digest value is signed using the private key of the first cluster to obtain the encrypted digest value of the encrypted data;
[0088] The storage timestamp of the original data, the encrypted data, and the encrypted digest value are stored in the storage area of the first front-end service gateway.
[0089] In this embodiment, the storage timestamp of the original data can be the timestamp corresponding to the time when the data to be backed up was received.
[0090] Optionally, the storage timestamp, the encrypted data, the encrypted digest value, and the cluster identifier corresponding to the data to be backed up can be associated and stored in the storage area of the first front-end service gateway.
[0091] In one embodiment of the present invention, based on the above implementation process, optionally, after writing the acquired data to be backed up into the first cluster, the method further includes:
[0092] When a probe request is received from the second front-end service gateway of the target second cluster, the system checks whether the data to be backed up corresponding to the probe request exists in the storage area corresponding to the first front-end service gateway, and obtains a second detection result.
[0093] The second detection result is sent to the second front-end service gateway of the target second cluster.
[0094] In this embodiment, the probe request may be a probe data packet sent by the second front-end service gateway.
[0095] In one embodiment of the present invention, based on the above implementation process, optionally, detecting whether the data to be backed up corresponding to the probe request exists in the storage area corresponding to the first front-end service gateway includes:
[0096] Obtain the target cluster identifier and the target storage timestamp corresponding to the target cluster identifier contained in the probe request;
[0097] Determine the storage timestamps of each candidate data corresponding to the target cluster identifier stored in the storage area corresponding to the first front-end service gateway;
[0098] If at least one of the candidate data has a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier, then the candidate data with a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier is determined as the data to be backed up corresponding to the probe request.
[0099] If the storage timestamps of the candidate data are all not greater than the target storage timestamp corresponding to the target cluster identifier, then it is determined that there is no data to be backed up in the storage area corresponding to the first front-end service gateway.
[0100] Optionally, the process and principle of the first front-end service gateway detecting whether there is data to be backed up are the same as those of the second front-end service gateway.
[0101] In one embodiment of the present invention, based on the above implementation process, optionally, if at least one of the candidate data has a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier, then after sending the second detection result to the second front-end service gateway of the target second cluster, the method further includes:
[0102] When a pull data packet is received from the second front-end service gateway of the target second cluster based on the second detection result, the backup data corresponding to the pull data packet is sent to the second front-end service gateway of the target second cluster.
[0103] In one embodiment of the present invention, based on the above implementation process, optionally, after sending the backup data corresponding to the pull data packet to the second front-end service gateway of the target second cluster, the method further includes:
[0104] Determine whether the data to be backed up corresponding to the retrieved data packet meets the preset clearing conditions;
[0105] If the backup data corresponding to the fetched data packet meets the clearing condition, the backup data corresponding to the fetched data packet is cleared in the storage area of the first front-end service gateway.
[0106] In this embodiment, after sending the data to be backed up corresponding to the pull data packet to the second front-end service gateway of the target second cluster, the data to be backed up can be marked as expired for the target second cluster, and it can be determined whether the data to be backed up has expired for all second clusters in the disaster recovery system. If so, it is determined that the data to be backed up meets the clearing conditions, and the data to be backed up can be cleared from the storage area of the first front-end service gateway; if not, it is determined that the data to be backed up does not meet the clearing conditions.
[0107] The data backup method provided in this invention can be applied to various scenarios, such as the backup of Elasticsearch data. See [link to relevant documentation]. Figure 3 The diagram illustrates an implementation scenario of the present invention, showing an implementation scenario including a disaster recovery system. The disaster recovery system includes ES cluster A, front-end service gateway A, ES cluster B, front-end service gateway B, ES cluster C, and front-end service gateway C, and each cluster can be deployed in different regions.
[0108] Optionally, this solution can provide cluster-level disaster recovery data replication. Each remote cluster front-end service gateway in the disaster recovery system stores the identifiers, IP addresses or domain names, listening port information, public keys used for signing, and agreed-upon encryption keys for all clusters within the disaster recovery system. Data transmission between the front-end service gateways of each cluster uses UDP to improve performance; see [reference].
[0109] See Figure 4This is a flowchart illustrating a data writing process provided by an embodiment of the present invention. In this process, any cluster's front-end service gateway intercepts a received data write request and then writes the request content to its local cluster until the data write request returns successfully. Priority is given to ensuring successful local data writing. If the write fails, no new data is added to the local cluster, and other clusters do not need to replicate the data. The timestamp of the received data write request is determined and used as the storage timestamp for the request content. The intercepted write request content is compressed and encrypted using a symmetric encryption algorithm and an agreed-upon encryption key. This step ensures that bandwidth consumption is minimized during data transmission and that the data is not stolen or tampered with. A hash digest is generated from the encrypted data to obtain the digest value. This step verifies the integrity of the data. The digest value is signed using the private key of the local cluster. This step allows other clusters to verify the data source. Signature algorithms are generally inefficient, so signing a short digest value is sufficient. After completing the above operations, the resulting data is stored in the local cache of the front-end service gateway or a side-mounted cache such as Redis.
[0110] See Figure 5 This is a flowchart illustrating a data backup process provided by an embodiment of the present invention. Each front-end service gateway periodically multicasts probe data packets to other front-end service gateways within the disaster recovery system. The front-end service gateway sending the probe data packets can be referred to as the first front-end service gateway, and the front-end service gateway receiving the probe data packets can be referred to as the second front-end service gateway. The probe data packet contains the storage timestamps of other clusters within the disaster recovery system that the local cluster has already obtained. When the remote front-end service gateway, i.e., the second front-end service gateway, receives the probe data packet, it obtains the cluster identifier and the corresponding storage timestamp, and compares it with the corresponding fields in the processed write request data stored in the local cache or side-mounted cache. For example, if the received probe data packet contains the identifier of cluster A and time point T, then it searches for all write requests for cluster A at all times. If there are write requests belonging to cluster A in the local cache or side-mounted cache that are later than time point T, it sends the storage timestamps of all the newer data and the corresponding cluster identifier to the requester as a positive response data packet. The positive response data packet corresponds one-to-one with the write request data in the cache that meets the conditions; that is, each write request data in the cache that meets the conditions sends a positive response. Otherwise, a negative response data packet is sent. The positive response data packet and the negative response data packet are the same as the first detection result mentioned above.
[0111] Optionally, based on the order of received positive response data packets, the first front-end gateway will use the second front-end gateway that sent the first arriving positive response data packet within the same cluster and for the same storage timestamp as the source gateway for that storage timestamp. At this time, the first front-end gateway will send a data retrieval request data packet to the corresponding source gateway, which includes a cluster identifier and a storage timestamp.
[0112] In this embodiment, when the second front-end service gateway receives a data retrieval request data packet, it first checks the local cache or side-mounted cache to see if the write request data for that storage timestamp exists in the cluster. If it exists, it sends it to the data retrieval requester. Otherwise, it sends a data retrieval error response data packet.
[0113] In this embodiment, if the first front-end service gateway receives incremental data from a checkpoint in a cluster, it first decrypts the data digest value using the public key of the source gateway, and then calculates the data digest value using the same digest algorithm. The two digest values are compared to determine the data source. If they match, the data source is considered reliable. Otherwise, the data is considered potentially forged and discarded.
[0114] If the two digest values are identical, the received data is decrypted and decompressed using the encryption key agreed upon by the disaster recovery system to obtain the original write request content. The original write request content is then replayed on the local cluster, and the data is written to the local cluster.
[0115] The solution provided in this invention achieves data replication by intercepting original write requests and compressing, encrypting, and signing them during transmission through a front-end service gateway. Secure transmission is ensured from three aspects: data confidentiality, integrity, and non-repudiation. Each cluster within the disaster recovery system is of equal status and can simultaneously support read and write operations, supporting multi-active application deployment. It can reduce data loss caused by disasters while ensuring application data read and write performance, and provides the highest possible transmission efficiency while maintaining physical boundaries. Because the relationships and status of each cluster within the disaster recovery system are completely equal, there are no dedicated backup clusters, and no one-to-one or many-to-one primary / backup clusters. All clusters are simultaneously both primary and backup clusters, thus easily enabling multi-active application deployment. In the event of a disaster, switching can be easily achieved through technologies such as CDN, with a rapid and secure switching process and minimal data loss.
[0116] and Figure 1 Corresponding to the method described above, embodiments of the present invention also provide a data backup device for backing up data. Figure 1 In a specific implementation of the method, the data backup device provided in this embodiment of the invention can be applied to the first front-end service gateway of the first cluster in a disaster recovery system, as shown in the schematic diagram below. Figure 6As shown, it specifically includes:
[0117] The generation unit 601 is configured to generate a probe data packet in response to a probe command; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is: the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster;
[0118] The sending unit 602 is used to send the probe data packet to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier.
[0119] The receiving unit 603 is used to receive the first detection result sent by each of the second front-end service gateways;
[0120] The determining unit 604 is used to determine the source gateway corresponding to the data to be backed up among each of the second front-end service gateways when at least one of the first detection results indicates the existence of data to be backed up.
[0121] The acquisition unit 605 is used to acquire the data to be backed up from the source gateway corresponding to the data to be backed up;
[0122] The writing unit 606 is used to write the acquired data to be backed up into the first cluster.
[0123] In one embodiment of the present invention, based on the above-described solution, optionally, the display unit includes:
[0124] The specific principles and execution processes of each unit and module in the data backup device disclosed in the above embodiments of the present invention are the same as those of the data backup method disclosed in the above embodiments of the present invention. Please refer to the corresponding parts of the data backup method provided in the above embodiments of the present invention, and they will not be repeated here.
[0125] This invention also provides a storage medium, which includes storage instructions, wherein the execution of the instructions controls the device where the storage medium is located to perform the above-described data backup method.
[0126] This invention also provides an electronic device, the structural schematic of which is shown below. Figure 7 As shown, it specifically includes a memory 701 and one or more instructions 702, wherein one or more instructions 702 are stored in the memory 701 and configured to be executed by one or more processors 703 to perform the following operations:
[0127] In response to a probe command, a probe data packet is generated; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is: the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster;
[0128] The probe data packet is sent to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier.
[0129] Receive the first detection results sent by each of the second front-end service gateways;
[0130] If at least one of the first detection results indicates the existence of data to be backed up, the source gateway corresponding to the data to be backed up is determined in each of the second front-end service gateways;
[0131] Obtain the data to be backed up from the source gateway corresponding to the data to be backed up;
[0132] The acquired data to be backed up is written into the first cluster.
[0133] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0134] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0135] For ease of description, the above apparatus is described in terms of its functions, divided into various units. Of course, in implementing this invention, the functions of each unit can be implemented in one or more software and / or hardware components.
[0136] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
[0137] The above provides a detailed description of a data backup method provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data backup method, characterized in that, The method includes: A first front-end service gateway for a first cluster in a disaster recovery system. In response to a probe command, a probe data packet is generated; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is: the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster; The probe data packet is sent to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier. Receive the first detection results sent by each of the second front-end service gateways; If at least one of the first detection results indicates the existence of data to be backed up, the source gateway corresponding to the data to be backed up is determined in each of the second front-end service gateways; Obtain the data to be backed up from the source gateway corresponding to the data to be backed up; The acquired data to be backed up is written into the first cluster.
2. The method according to claim 1, characterized in that, The step of writing the acquired data to be backed up into the first cluster includes: Obtain the public key of the source gateway corresponding to the data to be backed up; Using the public key of the source gateway corresponding to the data to be backed up, the signature information of the data to be backed up is decrypted to obtain a first digest value of the data to be backed up; and using a preset digest algorithm, the data to be backed up is calculated to obtain a second digest value of the data to be backed up. If the first digest value and the second digest value of the data to be backed up are the same, the data to be backed up is decrypted using a preset decryption key to obtain the original data corresponding to the data to be backed up; the original data corresponding to the data to be backed up is written into the first cluster.
3. The method according to claim 2, characterized in that, After writing the original data corresponding to the data to be backed up into the first cluster, the process further includes: Generate a storage timestamp for the original data, and encrypt the original data using a preset encryption key to obtain encrypted data; The target digest value of the encrypted data is calculated based on a preset digest algorithm; The target digest value is signed using the private key of the first cluster to obtain the encrypted digest value of the encrypted data; The storage timestamp of the original data, the encrypted data, and the encrypted digest value are stored in the storage area of the first front-end service gateway.
4. The method according to claim 1, characterized in that, After writing the acquired data to be backed up into the first cluster, the process further includes: When a probe request is received from the second front-end service gateway of the target second cluster, the system checks whether the data to be backed up corresponding to the probe request exists in the storage area corresponding to the first front-end service gateway, and obtains a second detection result. The second detection result is sent to the second front-end service gateway of the target second cluster.
5. The method according to claim 4, characterized in that, The step of detecting whether the data to be backed up corresponding to the probe request exists in the storage area corresponding to the first front-end service gateway includes: Obtain the target cluster identifier and the target storage timestamp corresponding to the target cluster identifier contained in the probe request; Determine the storage timestamps of each candidate data corresponding to the target cluster identifier stored in the storage area corresponding to the first front-end service gateway; If at least one of the candidate data has a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier, then the candidate data with a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier is determined as the data to be backed up corresponding to the probe request. If the storage timestamps of the candidate data are all not greater than the target storage timestamp corresponding to the target cluster identifier, then it is determined that there is no data to be backed up in the storage area corresponding to the first front-end service gateway.
6. The method according to claim 5, characterized in that, If at least one of the candidate data has a storage timestamp greater than the target storage timestamp corresponding to the target cluster identifier, then after sending the second detection result to the second front-end service gateway of the target second cluster, the method further includes: When a pull data packet is received from the second front-end service gateway of the target second cluster based on the second detection result, the backup data corresponding to the pull data packet is sent to the second front-end service gateway of the target second cluster.
7. The method according to claim 6, characterized in that, After sending the backup data corresponding to the pull data packet to the second front-end service gateway of the target second cluster, the method further includes: Determine whether the data to be backed up corresponding to the retrieved data packet meets the preset clearing conditions; If the backup data corresponding to the fetched data packet meets the clearing condition, the backup data corresponding to the fetched data packet is cleared in the storage area of the first front-end service gateway.
8. A data backup device, characterized in that, A first front-end service gateway for a first cluster in a disaster recovery system, the device comprising: A generation unit is configured to generate a probe data packet in response to a probe command; the probe data packet includes at least one cluster identifier of a second cluster, and a target storage timestamp corresponding to each cluster identifier; the second cluster is a cluster in the disaster recovery system other than the first cluster; the target storage timestamp corresponding to each cluster identifier is the largest storage timestamp among the storage timestamps of each data corresponding to each cluster identifier already stored in the first cluster; The sending unit is used to send the probe data packet to the second front-end service gateway of each second cluster in the disaster recovery system, so that each second front-end service gateway detects whether there is data to be backed up corresponding to each cluster identifier in its corresponding storage area based on the probe data packet, and obtains a first detection result; the data to be backed up corresponding to each cluster identifier is: among the data corresponding to the cluster identifier stored in the storage area, the data whose storage timestamp is greater than the target storage timestamp corresponding to the cluster identifier. The receiving unit is used to receive the first detection results sent by each of the second front-end service gateways; The determining unit is configured to determine the source gateway corresponding to the data to be backed up among each of the second front-end service gateways when at least one of the first detection results indicates the existence of data to be backed up. The acquisition unit is used to acquire the data to be backed up from the source gateway corresponding to the data to be backed up; The writing unit is used to write the acquired data to be backed up into the first cluster.
9. A storage medium, characterized in that, The storage medium includes storage instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to perform the data backup method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes a memory, and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described in any one of claims 1 to 7.
Citation Information
Patent Citations
An application disaster recovery system and method of a dual-active data center
CN109901949A
Data query method and device, computer equipment and storage medium
CN113672640A