Storage disaster recovery method and apparatus, and electronic device and storage medium

By synchronizing data across storage clusters and generating consistency instructions, the problem of data loss in traditional disaster recovery methods is solved, achieving more efficient disaster recovery performance and data consistency in the storage system.

WO2026114171A1PCT designated stage Publication Date: 2026-06-04CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2025-11-24
Publication Date
2026-06-04

AI Technical Summary

Technical Problem

Traditional periodic snapshot backup disaster recovery methods can lead to significant data loss between the moment the primary cluster fails and the moment the last backup was successful, resulting in low disaster recovery performance of the storage system.

Method used

By synchronizing the stored data of the first storage cluster to the second storage cluster, and generating input/output instructions for the first and second storage clusters based on the input/output instructions of the target user, the input/output operations are executed synchronously when the data is consistent. Abnormal instructions are recorded and repeatedly executed, the number of failures is counted, and fault prompts or data synchronization are sent to ensure data consistency.

Benefits of technology

This avoids massive data loss in the event of a primary storage cluster failure, improves the disaster recovery performance of the storage system, and ensures high availability and consistency of data during failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025137164_04062026_PF_FP_ABST
    Figure CN2025137164_04062026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a storage disaster recovery method and apparatus, and an electronic device and a storage medium. The method comprises: synchronizing storage data of a first storage cluster to a second storage cluster; on the basis of a target input / output instruction sent by a target user, generating a first input / output instruction for the first storage cluster and a second input / output instruction for the second storage cluster; and when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, sending the first input / output instruction to the first storage cluster, and synchronously sending the second input / output instruction to the second storage cluster, such that the first storage cluster and the second storage cluster synchronously execute an input / output operation corresponding to the target input / output instruction. Therefore, it is possible to avoid a process during which a main storage cluster incrementally updates a backup storage cluster multiple times, the loss of a large amount of data caused by a fault of the main storage cluster can thus be avoided, and the disaster recovery performance of a storage system is improved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

A storage disaster recovery method, apparatus, electronic device, and storage medium

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202411725836.8, filed on November 28, 2024, entitled “A storage disaster recovery method, apparatus, electronic device and storage medium”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of data storage technology, and in particular to a storage disaster recovery method, apparatus, electronic device, and storage medium. Background Technology

[0004] As more and more enterprise core data and systems run in cloud environments, the requirements for high availability of cloud data are becoming increasingly stringent. Occasional failures within traditional single data centers can lead to data loss for enterprises and users, causing significant losses. Against this backdrop, new demands are being placed on the disaster recovery capabilities of storage systems.

[0005] In related technologies, a periodic snapshot backup disaster recovery method as shown in Figure 1 can be adopted. Snapshots are made on the virtual block device (RadosBlockDevice, RBD) volume of the primary cluster at a certain period (e.g., every 15 minutes). During the first backup, the full data of the snapshot is read and written to the backup cluster. Subsequent backups can export the incremental modification data between the two snapshot points and synchronize it to the backup cluster.

[0006] However, in the method shown in Figure 1, if the primary cluster fails at some point, it needs to be switched to the backup cluster. This will result in the loss of a large amount of data between the time of primary cluster failure and the time of the last successful backup (i.e., the data transferred to the primary storage volume between the time of snapshot 2 in Figure 1 and the time of failure). The disaster recovery performance of the above storage system is still low. Summary of the Invention

[0007] In view of the above problems, embodiments of this application provide a storage disaster recovery method, apparatus, electronic device, and readable storage medium to overcome or at least partially solve the above problems.

[0008] In a first aspect, embodiments of this application provide a storage disaster recovery method, which includes:

[0009] Synchronize the storage data of the first storage cluster to the second storage cluster;

[0010] Based on the target input / output instructions sent by the target user, generate the first input / output instructions for the first storage cluster and the second input / output instructions for the second storage cluster;

[0011] When the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, a first input / output instruction is sent to the first storage cluster, and a second input / output instruction is sent synchronously to the second storage cluster, so that the first and second storage clusters execute the input / output operations corresponding to the target input / output instruction synchronously.

[0012] In some embodiments of this application, the storage disaster recovery method further includes:

[0013] If the second input / output instruction fails to execute, the failed second input / output instruction will be written as an abnormal input / output instruction to the fault log.

[0014] Repeatedly execute the abnormal input / output commands in the fault log.

[0015] In some embodiments of this application, the storage disaster recovery method further includes:

[0016] Count the number of times abnormal input / output commands failed to execute;

[0017] If the number of execution failures is greater than or equal to the preset number, a fault message is sent or the step of synchronizing the storage data of the first storage cluster to the second storage cluster is executed.

[0018] In some embodiments of this application, the storage disaster recovery method further includes:

[0019] If an abnormal input / output command is executed successfully, the abnormal input / output command will be removed from the fault log.

[0020] With the fault log cleared, it was determined that the storage data in the second storage cluster was consistent with the storage data in the first storage cluster.

[0021] In some embodiments of this application, the storage disaster recovery method further includes:

[0022] Obtain the first number of first input / output instructions that were successfully executed, and the second number of second input / output instructions that were successfully executed, corresponding to the target input / output instructions;

[0023] If the sum of the first and second quantities equals the total number of the first and second storage clusters, then the stored data in the second storage cluster is determined to be consistent with the stored data in the first storage cluster.

[0024] In some embodiments of this application, the storage disaster recovery method further includes:

[0025] If the second input / output instruction fails to execute and the first input / output instruction executes successfully, a success message for the target input / output instruction is sent to the target user so that the target user can continue to submit input / output instructions.

[0026] In some embodiments of this application, the storage disaster recovery method further includes:

[0027] If the second input / output instruction times out or the input / output instruction queue containing the second input / output instruction overflows, the execution of the second input / output instruction is deemed to have failed.

[0028] Secondly, embodiments of this application provide a storage disaster recovery device, which includes:

[0029] The synchronization module is used to synchronize the storage data of the first storage cluster to the second storage cluster;

[0030] The generation module is used to generate first input / output instructions for the first storage cluster and second input / output instructions for the second storage cluster based on the target input / output instructions sent by the target user.

[0031] The first sending module is used to send a first input / output instruction to the first storage cluster and simultaneously send a second input / output instruction to the second storage cluster when the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, so that the first storage cluster and the second storage cluster can synchronously execute the input / output operation corresponding to the target input / output instruction.

[0032] In some embodiments of this application, the storage disaster recovery device further includes:

[0033] The writing module is used to write the failed second input / output instruction as an abnormal input / output instruction to the fault log in the event that the second input / output instruction fails to execute.

[0034] The execution module is used to repeatedly execute abnormal input / output instructions in the fault log.

[0035] In some embodiments of this application, the storage disaster recovery device further includes:

[0036] The statistics module is used to count the number of times abnormal input / output commands failed to execute.

[0037] The second sending module is used to send a fault prompt message or perform the step of synchronizing the storage data of the first storage cluster to the second storage cluster when the number of execution failures is greater than or equal to a preset number.

[0038] In some embodiments of this application, the storage disaster recovery device further includes:

[0039] The removal module is used to remove abnormal input / output commands from the fault log if the abnormal input / output commands are executed successfully.

[0040] The first determination module is used to determine whether the storage data of the second storage cluster is consistent with the storage data of the first storage cluster when the fault log is cleared.

[0041] In some embodiments of this application, the storage disaster recovery device further includes:

[0042] The acquisition module is used to acquire the first number of first input / output instructions that have been successfully executed and the second number of second input / output instructions that have been successfully executed, corresponding to the target input / output instructions.

[0043] The second determining module is used to determine that the stored data of the second storage cluster is consistent with the stored data of the first storage cluster when the sum of the first quantity and the second quantity is equal to the total number of the first storage cluster and the second storage cluster.

[0044] In some embodiments of this application, the storage disaster recovery device further includes:

[0045] The third sending module is used to send a success message for the target input / output instruction to the target user when the second input / output instruction fails to execute and the first input / output instruction executes successfully, so that the target user can continue to submit input / output instructions.

[0046] In some embodiments of this application, the storage disaster recovery device further includes:

[0047] The determination module is used to determine if the second input / output instruction fails to execute when the second input / output instruction times out or the input / output instruction queue containing the second input / output instruction overflows.

[0048] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any of the above-mentioned storage disaster recovery methods.

[0049] Fourthly, embodiments of this application provide a readable storage medium on which a program or instruction is stored, and when the program or instruction is executed by a processor, it implements any of the above-mentioned storage disaster recovery methods.

[0050] The specific beneficial effects are as follows:

[0051] This application embodiment synchronizes the stored data of the first storage cluster to the second storage cluster. Based on the target input / output instructions sent by the target user, it generates a first input / output instruction for the first storage cluster and a second input / output instruction for the second storage cluster. When the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, the first input / output instruction is sent to the first storage cluster, and the second input / output instruction is sent to the second storage cluster simultaneously. This enables the first and second storage clusters to execute the input / output operations corresponding to the target input / output instructions synchronously. The data of the primary storage cluster can be synchronized to the backup storage cluster in advance, and when a data storage task occurs, the data is sent to the primary storage cluster and the backup storage cluster respectively. This avoids the process of multiple incremental updates from the primary storage cluster to the backup storage cluster, and also avoids the large amount of data loss caused by the failure of the primary storage cluster, thus improving the disaster recovery performance of the storage system to a certain extent. Attached Figure Description

[0052] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of some embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 is a schematic diagram of a storage disaster recovery mode provided by some embodiments of this application;

[0054] Figure 2 is a flowchart illustrating a storage disaster recovery method provided in some embodiments of this application;

[0055] Figure 3 is a flowchart illustrating another storage disaster recovery method provided by some embodiments of this application;

[0056] Figure 4 is a schematic diagram of a storage system provided by some embodiments of this application;

[0057] Figure 5 is a schematic diagram of a storage disaster recovery state transition provided by some embodiments of this application;

[0058] Figure 6 is a logical block diagram of a storage disaster recovery device provided in some embodiments of this application;

[0059] Figure 7 is a schematic diagram of an electronic device provided by some embodiments of this application. Detailed Implementation

[0060] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0061] Referring to Figure 2, which is a schematic flowchart of a storage disaster recovery method provided in some embodiments of this application, the storage disaster recovery method includes:

[0062] Step 101: Synchronize the storage data of the first storage cluster to the second storage cluster.

[0063] In some embodiments of this application, data storage involves storing data in physical or logical storage media for later use. The following is a detailed description of data storage:

[0064] Durability: Data storage is durable, meaning that data can be stored in storage media and will not be lost when a program exits or the computer is shut down.

[0065] Scalability: Data storage can be expanded as needed, can store large amounts of data, and can be scaled up as the amount of data increases.

[0066] Security: Data storage needs to ensure data security, which can be protected through measures such as data encryption, access control, and backup.

[0067] High efficiency: Data storage needs to ensure high efficiency, which can be achieved through technologies such as data indexing, caching, and compression to improve data read and write speed and storage efficiency.

[0068] Data management: Data storage requires data management, including data backup, recovery, migration, and cleanup, to ensure data integrity and reliability.

[0069] In general, data storage is an important component of modern information technology. It involves not only the preservation and management of data, but also data security, availability, and performance optimization.

[0070] In some embodiments of this application, a storage cluster is a system that organizes multiple independent computer nodes (servers) through physical connections or logical means to achieve data storage and management. A storage cluster typically refers to the physical connection of independent computer nodes (servers) and the control functions for distributing load to each node (server) and managing load transfer between nodes. For enterprise data storage, a cluster usually requires a shared storage system, such as a Storage Area Network (SAN). Alternatively, a method can be used that directly connects to each node and replicates data within the storage system. General-purpose storage cluster applications provide fault recovery capabilities for critical processes to ensure load balancing for high-performance processes. DAS (Direct Attached Storage), NAS (Network Attached Storage), and SAN (Storage Area Network) are three common types of storage clusters. Each type has its unique advantages and disadvantages and is suitable for different application scenarios. The main technologies in clustered storage include block storage, file storage, and object storage. Block storage is commonly found in devices such as USB flash drives, optical discs, and hard drives. High availability can be achieved through technologies like RAID (Redundant Array of Independent Disks) and LVM (Logical Volume Manager). File storage and network storage are commonly found in devices like Samba (Windows Interoperability Suite) and NFS (Network File System). These have lower construction costs and can share storage across different hosts. Object storage, distributed storage, and storage buckets offer advantages such as high read / write efficiency and the ability to share storage across different hosts, but they are expensive and technically complex to implement. Common clustered storage architectures include block storage + DAS (Direct-Attached Storage), block storage + NAS (Network Attached Storage), block storage + SAN (Storage Area Network), file storage + NAS, and object storage + SAN. Each architecture has its own characteristics and can be selected based on specific needs. Storage clusters offer advantages such as high availability, high throughput, strong scalability, and high cost-effectiveness. Even if a node in the cluster fails, other healthy nodes can still handle requests, ensuring the system continues to operate normally. In summary, storage clusters are an efficient and reliable data storage solution suitable for various application scenarios that require high performance, high availability, and scalability.In practical applications, the appropriate storage cluster type and technical architecture should be selected based on specific needs.

[0071] In some embodiments of this application, writing or reading data from a storage cluster requires the use of the storage cluster's input / output ports, implemented through input / output processes (i.e., IO (Input / Output) processes) adapted to those ports. An IO process is a trigger of the operating system's IO functions initiated by an application, i.e., calling the IO process via input / output instructions. IO processes involve transferring data from external devices (such as hard drives or networks) to the computer's internal system, or vice versa. This process is fundamental to the computer's interaction with the external world; without IO operations, the computer cannot receive user instructions or display processing results. IO processes are crucial for any system that needs to interact with the external environment. For example, database management systems frequently read and write data on disks, and Web (World Wide Web) servers handle network requests from clients. IO operation modes include synchronous and asynchronous. In synchronous IO mode, the program waits for the IO operation to complete before continuing execution; asynchronous IO allows the program to continue performing other tasks while the IO operation is in progress. IO performance optimization can be achieved through zero-copy techniques and caching. Zero-copy technology improves I / O efficiency by reducing the number of times data is copied between kernel space and user space. Caching strategies, on the other hand, can use buffers to reduce frequent I / O operations, thereby improving system performance.

[0072] In some embodiments of this application, a storage cluster can refer to a cluster of devices composed of multiple storage devices used for storing data. A first storage cluster and a second storage cluster can reside in the same data storage system, wherein the first storage cluster can be a primary storage cluster, and the second storage cluster can be a backup storage cluster. To ensure consistency between the data stored in the first and second storage clusters, the stored data in the first storage cluster can be synchronized to the second storage cluster. This can be viewed as an initialization process for the data storage systems containing the second and first storage clusters.

[0073] Step 102: Based on the target input / output instructions sent by the target user, generate the first input / output instructions for the first storage cluster and the second input / output instructions for the second storage cluster.

[0074] In some embodiments of this application, a target user can send target input / output instructions to the data storage system where the first storage cluster and the second storage cluster reside. Based on these target input / output instructions, a first input / output instruction for the first storage cluster and a second input / output instruction for the second storage cluster can be generated. The first input / output instruction is used to write target data to or read target data from the first storage cluster, and the second input / output instruction is used to write target data to or read target data from the second storage cluster.

[0075] Step 103: If the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, send a first input / output instruction to the first storage cluster and simultaneously send a second input / output instruction to the second storage cluster, so that the first and second storage clusters execute the input / output operations corresponding to the target input / output instruction synchronously.

[0076] In some embodiments of this application, it can first be determined whether the stored data of the second storage cluster and the stored data of the first storage cluster are consistent. If the two sets of stored data are consistent, a first input / output instruction can be sent to the first storage cluster, and a second input / output instruction can be sent to the second storage cluster simultaneously. This allows the first and second storage clusters to synchronously execute the input / output operations corresponding to the target input / output instruction. If the input / output operation is a data write operation, the target data is written to the first and second storage clusters respectively based on the first and second input / output instructions. If the input / output operation is a data read operation, the target data is read from the first and second storage clusters respectively into the cache device based on the first and second input / output instructions for the target user to view. Simultaneously, if the read operation is successfully executed, an extra copy of the target data can be deleted from the cache device, allowing the cache device to hold a larger cache space.

[0077] In some embodiments of this application, by synchronizing the stored data of the first storage cluster to the second storage cluster, and generating a first input / output instruction for the first storage cluster and a second input / output instruction for the second storage cluster based on the target input / output instruction sent by the target user, and when the stored data of the second storage cluster is consistent with the stored data of the first storage cluster, the first input / output instruction is sent to the first storage cluster, and the second input / output instruction is sent to the second storage cluster simultaneously. This enables the first and second storage clusters to synchronously execute the input / output operations corresponding to the target input / output instruction. The data of the primary storage cluster can be synchronized to the backup storage cluster in advance, and when a data storage task occurs, the data is sent to the primary storage cluster and the backup storage cluster respectively. This avoids the process of multiple incremental updates from the primary storage cluster to the backup storage cluster, and also avoids the large amount of data loss caused by the failure of the primary storage cluster, thus improving the disaster recovery performance of the storage system to a certain extent.

[0078] Referring to Figure 3, which is a flowchart illustrating another storage disaster recovery method provided by some embodiments of this application, the storage disaster recovery method may include:

[0079] Step 201: Synchronize the storage data of the first storage cluster to the second storage cluster.

[0080] In some embodiments of this application, the implementation of this step can be referred to the embodiment of step 101, and will not be repeated here.

[0081] Step 202: Based on the target input / output instructions sent by the target user, generate the first input / output instructions for the first storage cluster and the second input / output instructions for the second storage cluster.

[0082] In some embodiments of this application, the implementation of this step can be referred to the embodiment of step 102, and will not be repeated here.

[0083] Step 203: If the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, send a first input / output instruction to the first storage cluster and simultaneously send a second input / output instruction to the second storage cluster, so that the first and second storage clusters execute the input / output operations corresponding to the target input / output instruction synchronously.

[0084] In the embodiments of this application, the implementation of this step can be referred to the embodiment of step 103, and will not be repeated here.

[0085] Step 204: If the second input / output instruction fails to execute, write the failed second input / output instruction as an abnormal input / output instruction into the fault log.

[0086] In some embodiments of this application, a log refers to a record generated by a system or application during operation, used to track and record various operations, events, and error information. The following is a detailed description of logs:

[0087] 1. Basic Concepts of Logs

[0088] Definition: Logs are records generated by a system or application during operation, used to track and record various operations, events, and error information.

[0089] Importance: Logs are crucial for system monitoring, troubleshooting, performance optimization, and security auditing.

[0090] 2. Log type

[0091] Operating system logs: Record operating system-level events, such as login / logout and changes in system service status.

[0092] Application logs: generated by the application, recording various information during application runtime, including user behavior, transaction processing, etc.

[0093] Security Log: Specifically records events related to system security, such as intrusion attempts and permission changes.

[0094] 3. Log Level

[0095] DEBUG: Detailed information, usually only used when diagnosing problems.

[0096] INFO: A normal message confirming that the program is working as expected.

[0097] WARN: A warning message indicating a potential problem.

[0098] ERROR: A more serious problem that may cause the program to crash.

[0099] FATAL: A very serious error that caused the program to terminate.

[0100] 4. Log format

[0101] Plain text format: The most common log format, easy to read and analyze.

[0102] JSON format: a structured data format that is easy for programs to parse and process.

[0103] XML format: Another structured data format suitable for complex log structures.

[0104] In summary, logs are an indispensable component of computer systems, helping developers and system administrators understand the system's operational status and promptly identify and resolve issues. Understanding the basic concepts, types, levels, and formats of logs is crucial for effective system management and monitoring.

[0105] In some embodiments of this application, if the second input / output instruction corresponding to the second storage cluster fails to execute, the failed second input / output instruction can be written as an abnormal input / output instruction into the fault log. Execution failure means that the data transmission task corresponding to the input / output instruction was not executed correctly. The fault log can be stored in a persistent storage device, serving as a power-loss protection mechanism. The fault log can be in plain text, JSON, or XML format, and may include information about the failed second input / output instruction, a timestamp indicating the failure, and the error type of the failed second input / output instruction.

[0106] Step 205: Repeat the abnormal input / output instructions in the fault log.

[0107] In some embodiments of this application, when abnormal input / output instructions exist in the fault log, the abnormal input / output instructions stored in the fault log can be repeatedly executed. The frequency and maximum number of repetitions of the abnormal input / output instructions can be manually set.

[0108] In some embodiments of this application, in the event that the second input / output instruction fails to execute, the failed second input / output instruction is written as an abnormal input / output instruction into the fault log, and the abnormal input / output instruction in the fault log is repeatedly executed. This allows the failed second input / output instruction to be recorded in a log format, and the abnormal input / output instruction can be repeatedly executed based on the fault log. This can largely ensure that the abnormal input / output instruction is executed correctly, and to a certain extent improve the disaster recovery performance of the storage system composed of the first storage cluster and the second storage cluster.

[0109] Step 206: Count the number of times abnormal input / output instructions failed to execute.

[0110] In some embodiments of this application, the number of execution failures of abnormal input / output instructions can be counted. Each abnormal input / output instruction has its own corresponding number of execution failures, and when an abnormal input / output instruction is executed successfully, the execution failure count of that abnormal input / output instruction is reset to 0.

[0111] Step 207: If the number of execution failures is greater than or equal to the preset number, send a fault prompt message or execute the step of synchronizing the storage data of the first storage cluster to the second storage cluster.

[0112] In some embodiments of this application, if the number of failed executions of an abnormal input / output command is greater than or equal to a preset number, a fault notification message can be sent to the target user; alternatively, the step of synchronizing the stored data of the first storage cluster to the second storage cluster can be performed. The preset number can be the maximum number of times the abnormal input / output command can be repeatedly executed. The fault notification message can be used to alert the target user to data operation failures in the second storage cluster. For example, if the target input / output command is a data write command, a "Second storage cluster data write failed" or similar fault notification message can be sent to the target user; if the target input / output command is a data read command, a "Second storage cluster data read failed" or similar fault notification message can be sent to the target user.

[0113] In some embodiments of this application, by counting the number of execution failures of abnormal input / output instructions, and when the number of execution failures is greater than or equal to a preset number, a fault prompt message is sent or the step of synchronizing the stored data of the first storage cluster to the second storage cluster is performed. This can send a fault prompt message or synchronize the stored data of the first storage cluster to the second storage cluster when the number of execution failures of abnormal input / output instructions reaches a preset number. This can promptly notify the user of the fault and also initialize the storage system composed of the first and second storage clusters. It can reduce the data differences stored in the first and second storage clusters to a certain extent and improve the disaster recovery performance of the storage system composed of the first and second storage clusters to a certain extent.

[0114] Step 208: If the abnormal input / output command is executed successfully, remove the abnormal input / output command from the fault log.

[0115] In some embodiments of this application, if an abnormal input / output instruction in the fault log is executed successfully, the abnormal input / output instruction can be removed from the fault log.

[0116] Step 209: With the fault log cleared, determine that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.

[0117] In some embodiments of this application, if the fault log is cleared, that is, if there is no abnormal input / output instruction related content in the fault log, it can be determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.

[0118] In some embodiments of this application, if an abnormal input / output instruction is successfully executed, the abnormal input / output instruction is removed from the fault log. If the fault log is cleared, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster. The data consistency between the storage data of the second storage cluster and the storage data of the first storage cluster can be determined from the perspective of the fault log. This ensures that the first and second storage clusters can ensure that the current input / output instruction is successfully executed and can execute the next input / output instruction when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster. This improves the disaster recovery performance of the storage system composed of the first and second storage clusters to a certain extent.

[0119] Step 210: Obtain the first number of first input / output instructions that were successfully executed and the second number of second input / output instructions that were successfully executed, corresponding to the target input / output instructions.

[0120] In some embodiments of this application, the first number of first input / output instructions successfully executed and the second number of second input / output instructions successfully executed can be obtained from the first input / output instructions and the second input / output instructions corresponding to the target input / output instruction.

[0121] Step 211: If the sum of the first quantity and the second quantity is equal to the total number of the first storage cluster and the second storage cluster, determine that the stored data of the second storage cluster is consistent with the stored data of the first storage cluster.

[0122] In some embodiments of this application, each first storage cluster may correspond to a first input / output instruction, and each second storage cluster may correspond to a second input / output instruction. If the sum of the first and second quantities is equal to the total number of the first and second storage clusters, it can be determined that the stored data of the second storage cluster is consistent with the stored data of the first storage cluster. After determining that the two sets of stored data are consistent, a prompt message can be sent to the target user, thereby enabling the target user to continue initiating new input / output instructions.

[0123] In some embodiments of this application, by obtaining a first number of successfully executed first input / output instructions and a second number of successfully executed second input / output instructions corresponding to a target input / output instruction, and when the sum of the first and second numbers equals the total number of the first and second storage clusters, it is determined that the stored data of the second storage cluster is consistent with the stored data of the first storage cluster. This allows for data consistency between the stored data of the second and first storage clusters to be determined from the perspective of the number of successfully executed first and second input / output instructions. This ensures that the current input / output instruction is successfully executed, and the next input / output instruction can be executed, provided that the stored data of the second and second storage clusters are consistent. This improves the disaster recovery performance of the storage system comprised of the first and second storage clusters to some extent.

[0124] Step 212: If the second input / output instruction fails to execute and the first input / output instruction executes successfully, send a success message for the target input / output instruction to the target user so that the target user can continue to submit input / output instructions.

[0125] In some embodiments of this application, if the second input / output instruction fails to execute and the first input / output instruction succeeds, it means that the target user has successfully completed the data read / write target corresponding to the target input / output instruction in the first storage cluster. At this time, the execution success information for the target input / output instruction can be sent to the target user, so that the target user can continue to submit new input / output instructions.

[0126] In some embodiments of this application, by sending a success message for the target input / output instruction to the target user when the second input / output instruction fails to execute and the first input / output instruction succeeds, the target user can continue to submit input / output instructions. This allows the target user to submit new input / output instructions, even when the first input / output instruction succeeds and the second input / output instruction fails. This improves the data read / write efficiency of the storage system consisting of the first and second storage clusters to some extent.

[0127] Step 213: If the second input / output instruction times out or the input / output instruction queue containing the second input / output instruction overflows, determine that the second input / output instruction has failed to execute.

[0128] In some embodiments of this application, if the second input / output instruction times out, it can be determined that the second input / output instruction has failed to execute. Here, "second input / output instruction timeout" can mean that the execution time of the second input / output instruction exceeds a preset duration. When the input / output instruction queue containing the second input / output instruction overflows, the second input / output instruction cannot be executed correctly, and in this case, it can also be determined that the second input / output instruction has failed to execute.

[0129] In some embodiments of this application, by determining that the second input / output instruction has failed to execute when the second input / output instruction times out or when the input / output instruction queue containing the second input / output instruction overflows, it is possible to determine that the second input / output instruction has failed to execute when the second input / output instruction times out or when the input / output instruction queue containing the second input / output instruction overflows. This can avoid the situation where the storage cluster is paralyzed due to the second input / output instruction being stuck, and to a certain extent improves the disaster recovery performance of the storage system composed of the first storage cluster and the second storage cluster.

[0130] Referring to Figure 4, which is a schematic diagram of a storage system provided by some embodiments of this application, the storage system consists of a first storage cluster, a second storage cluster, and a disaster recovery coordination module connecting the first and second storage clusters. After a target user initiates a target input / output command, the disaster recovery coordination module can send input / output sub-commands to the first and second storage clusters respectively, so that the first and second storage clusters can execute the target input / output tasks corresponding to the target input / output command according to their respective input / output sub-commands. If the input / output sub-command corresponding to the second storage cluster fails to execute, a fault log object can be generated in the disaster recovery coordination module and stored in permanent storage space. The disaster recovery coordination module can re-execute the abnormal input / output sub-commands stored in the log according to the fault log object. If the execution is successful and the fault record in the log is cleared, it can be confirmed that the data stored in the first and second storage clusters are consistent. At this time, the disaster recovery coordination module can start processing the next input / output command.

[0131] Referring to Figure 5, which is a schematic diagram of a storage disaster recovery state transition provided by some embodiments of this application, the first and second storage clusters can first be initialized, that is, the data in the first storage cluster is synchronized to the second storage cluster. After synchronization, the first and second storage clusters can enter a parallel commit state. At this time, data read and write operations performed on the first storage cluster will also be performed synchronously in the second storage cluster. If the input / output sub-instructions in the second storage cluster fail to execute, the first and second storage clusters can enter a catch-up state. At this time, the second storage cluster can repeatedly execute the previously failed input / output sub-instructions. If the number of failed executions of the above-mentioned input / output sub-instructions reaches a preset number, the first and second storage clusters can enter an error state and send an error prompt instruction to the user so that the user can manually repair the first and second storage clusters. After the user completes the repair, the first and second storage clusters can re-enter the initialization state and synchronize the data in the first storage cluster to the second storage cluster.

[0132] Referring to Figure 6, which is a logical block diagram of a storage disaster recovery device according to some embodiments of this application, the storage disaster recovery device 600 may include:

[0133] Synchronization module 601 is used to synchronize the storage data of the first storage cluster to the second storage cluster;

[0134] The generation module 602 is used to generate a first input / output instruction for the first storage cluster and a second input / output instruction for the second storage cluster based on the target input / output instructions sent by the target user.

[0135] The first sending module 603 is used to send a first input / output instruction to the first storage cluster and simultaneously send a second input / output instruction to the second storage cluster when the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, so that the first storage cluster and the second storage cluster can synchronously execute the input / output operation corresponding to the target input / output instruction.

[0136] In some embodiments of this application, the storage disaster recovery device 600 further includes:

[0137] The writing module is used to write the failed second input / output instruction as an abnormal input / output instruction to the fault log in the event that the second input / output instruction fails to execute.

[0138] The execution module is used to repeatedly execute abnormal input / output instructions in the fault log.

[0139] In some embodiments of this application, the storage disaster recovery device 600 further includes:

[0140] The statistics module is used to count the number of times abnormal input / output commands failed to execute.

[0141] The second sending module is used to send a fault prompt message or perform the step of synchronizing the storage data of the first storage cluster to the second storage cluster when the number of execution failures is greater than or equal to a preset number.

[0142] In some embodiments of this application, the storage disaster recovery device 600 further includes:

[0143] The removal module is used to remove abnormal input / output commands from the fault log if the abnormal input / output commands are executed successfully.

[0144] The first determination module is used to determine whether the storage data of the second storage cluster is consistent with the storage data of the first storage cluster when the fault log is cleared.

[0145] In some embodiments of this application, the storage disaster recovery device 600 further includes:

[0146] The acquisition module is used to acquire the first number of first input / output instructions that have been successfully executed and the second number of second input / output instructions that have been successfully executed, corresponding to the target input / output instructions.

[0147] The second determining module is used to determine that the stored data of the second storage cluster is consistent with the stored data of the first storage cluster when the sum of the first quantity and the second quantity is equal to the total number of the first storage cluster and the second storage cluster.

[0148] In some embodiments of this application, the storage disaster recovery device 600 further includes:

[0149] The third sending module is used to send a success message for the target input / output instruction to the target user when the second input / output instruction fails to execute and the first input / output instruction executes successfully, so that the target user can continue to submit input / output instructions.

[0150] In some embodiments of this application, the storage disaster recovery device 600 further includes:

[0151] The determination module is used to determine if the second input / output instruction fails to execute when the second input / output instruction times out or the input / output instruction queue containing the second input / output instruction overflows.

[0152] The storage disaster recovery device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a GPU box, mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0153] In some embodiments of this application, the storage disaster recovery device can be a device with an operating system. This operating system can be Android, Linux, Windows, or other possible operating systems; this application does not specifically limit the specific operating system used.

[0154] The storage disaster recovery device provided in some embodiments of this application can implement the various processes implemented in the method embodiments of Figures 1 to 4. To avoid repetition, it will not be described again here.

[0155] Some embodiments of this application provide an electronic device. Referring to FIG7, the electronic device 70 includes: a processor 701, a memory 702, and a computer program 7021 stored in the memory 702 and executable on the processor 701. When the processor 701 executes the program, it implements the storage disaster recovery method of the aforementioned embodiments.

[0156] In some embodiments of this application, memory 702 can be used to store software programs and various data. Memory 702 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback function, image playback function, etc.). Furthermore, memory 702 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 702 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0157] Processor 701 may include one or more processing units; optionally, processor 701 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 701.

[0158] Some embodiments of this application also provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps in the storage disaster recovery method disclosed in the embodiments of this application.

[0159] Some embodiments of this application also provide a computer program product that, when run on an electronic device, causes a processor to execute the steps in the storage disaster recovery method disclosed in the embodiments of this application.

[0160] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0161] Some embodiments of this application are described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, electronic devices, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal equipment to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal equipment, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0162] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable terminal equipment, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0164] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0165] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device 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 terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the element.

[0166] The above provides a detailed description of a storage disaster recovery method provided by this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. 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 this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A storage disaster recovery method, characterized by, The method includes: Synchronize the stored data from the first storage cluster to the second storage cluster; Based on the target input / output instructions sent by the target user, generate the first input / output instructions for the first storage cluster and the second input / output instructions for the second storage cluster; When the stored data in the second storage cluster is consistent with the stored data in the first storage cluster, the first input / output instruction is sent to the first storage cluster, and the second input / output instruction is sent to the second storage cluster simultaneously, so that the first storage cluster and the second storage cluster execute the input / output operation corresponding to the target input / output instruction synchronously.

2. The method of claim 1, wherein, The method further includes: If the second input / output instruction fails to execute, the failed second input / output instruction will be written as an abnormal input / output instruction into the fault log. Repeatedly execute the abnormal input / output instructions in the fault log.

3. The method according to claim 2, characterized in that, The method further includes: Count the number of times the abnormal input / output instructions failed to execute; If the number of execution failures is greater than or equal to a preset number, a fault prompt message is sent or the step of synchronizing the storage data of the first storage cluster to the second storage cluster is executed.

4. The method of claim 2, wherein, The method further includes: If the abnormal input / output command is executed successfully, the abnormal input / output command will be removed from the fault log. If the fault log is cleared, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.

5. The method of claim 1, wherein, The method further includes: Obtain the first number of first input / output instructions that were successfully executed, and the second number of second input / output instructions that were successfully executed, corresponding to the target input / output instructions; If the sum of the first quantity and the second quantity equals the total number of the first storage cluster and the second storage cluster, then the stored data of the second storage cluster is determined to be consistent with the stored data of the first storage cluster.

6. The method of claim 1, wherein, The method further includes: If the second input / output instruction fails to execute and the first input / output instruction succeeds, a success message for the target input / output instruction is sent to the target user so that the target user can continue to submit input / output instructions.

7. The method of claim 2, wherein, The method further includes: If the second input / output instruction times out, or if the input / output instruction queue containing the second input / output instruction overflows, the execution of the second input / output instruction is determined to have failed.

8. A storage disaster recovery apparatus, characterized by comprising: The device includes: The synchronization module is used to synchronize the storage data of the first storage cluster to the second storage cluster; The generation module is used to generate first input / output instructions for the first storage cluster and second input / output instructions for the second storage cluster based on the target input / output instructions sent by the target user. The first sending module is configured to send the first input / output instruction to the first storage cluster and simultaneously send the second input / output instruction to the second storage cluster when the stored data of the second storage cluster is consistent with the stored data of the first storage cluster, so that the first storage cluster and the second storage cluster simultaneously execute the input / output operation corresponding to the target input / output instruction.

9. An electronic device, comprising: The method includes a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the storage disaster recovery method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores a program or instructions, which, when executed by a processor, implement the storage disaster recovery method according to any one of claims 1 to 7.