Data synchronization method, device, electronic device and storage medium

By counting the number of pair relationships between the primary and backup volumes during data synchronization, including pair relationships in common and consistency groups, and determining whether the number is less than the preset value, the problem of pair relationships exceeding the threshold is solved, and the stability and reliability of data synchronization are achieved.

CN115793962BActive Publication Date: 2025-09-26JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211347149.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2025-09-26
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

During data synchronization, the pair relationship between the primary and backup volumes can easily exceed the threshold, resulting in unstable data synchronization.

Method used

By counting the number of pair relationships between the primary and backup volumes, including common pair relationships and pair relationships in consistency groups, the system determines whether the number is less than the preset value. If so, the system allows the creation or addition of pair relationships; otherwise, the system prohibits the creation or addition of pair relationships to prevent the number of pair relationships from exceeding the threshold.

Benefits of technology

This effectively prevents the pair relationship between the primary and backup volumes from exceeding the threshold, ensuring the stability and reliability of the data synchronization process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115793962B_ABST
    Figure CN115793962B_ABST
Patent Text Reader

Abstract

The present application discloses a data synchronization method, device, electronic device and computer-readable storage medium, the method comprising: when receiving a command to create a normal pair relationship, obtaining the number of pair relationships between the current primary-end volume and the backup-end volume; wherein the pair relationship includes the number of normal pair relationships and the pair relationship in the consistency group; judging whether the number of the pair relationships is less than a first preset value; if so, creating a first target pair relationship between the primary-end volume and the backup-end volume, and performing data synchronization between the primary-end volume and the backup-end volume based on the first target pair relationship. The data synchronization method provided by the present application avoids the pair relationship between the primary-end volume and the backup-end volume from exceeding a threshold value during the data synchronization process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a data synchronization method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] As digitalization advances across industries, data has become increasingly central to enterprise operations. Users are placing increasing demands on the stability of the storage systems that carry this data. Traditional single data centers are no longer sufficient to guarantee the security of enterprise data. A storage failure in a single data center can lead to prolonged business interruptions and even data loss. To ensure continuous, recoverable, and highly available data access, remote disaster recovery solutions have emerged. By deploying data centers across multiple locations and achieving synchronous data replication, they minimize data loss caused by natural disasters or human sabotage.

[0003] In a remote disaster recovery system, remote replication requires synchronizing data on the primary storage system to the backup storage system. Data synchronization can be achieved between the primary and backup sites through single-volume remote replication synchronization and remote replication consistency group synchronization. Single-volume remote replication has only one pair relationship, one corresponding relationship between the primary volume and the backup volume; a consistency group contains multiple corresponding pair relationships. The threshold for normal pair relationships is 10,240. When the number of pair relationships exceeds 10,240, a normal pair relationship cannot be created. The threshold for adding pair relationships in consistency group remote replication is 512. When the number of pair relationships exceeds 512, the consistency group remote replication cannot add pair relationships.

[0004] The consistency group remote replication pair relationship is removed, and the pair relationship can be synchronized as an independent unit of normal pair relationship. When the number of normal pair relationships reaches 10240, the pair relationship in the consistency group remote replication is deleted, and the consistency group pair relationship is converted to a normal pair relationship. The pair relationship data will exceed 10240, causing the number of normal pair relationships to reach 10240, exceeding the pair relationship threshold.

[0005] Therefore, how to prevent the pair relationship between the primary volume and the backup volume from exceeding a threshold during data synchronization is a technical problem that those skilled in the art need to solve. Summary of the Invention

[0006] The purpose of the present application is to provide a data synchronization method, device, electronic device and computer-readable storage medium, which avoid the pair relationship between the primary end volume and the backup end volume exceeding a threshold during the data synchronization process.

[0007] To achieve the above objectives, this application provides a data synchronization method, including:

[0008] When a command to create a common pair relationship is received, the number of pair relationships between the current primary volume and the backup volume is obtained; wherein the pair relationships include the number of common pair relationships and pair relationships in the consistency group;

[0009] Determining whether the number of the pair relationships is less than a first preset value;

[0010] If so, a first target pair relationship is created between the primary volume and the backup volume, and data synchronization is performed between the primary volume and the backup volume based on the first target pair relationship.

[0011] The step of obtaining the number of pair relationships between the current primary volume and the backup volume includes:

[0012] If no consistency group exists between the primary volume and the backup volume, the number of common pair relationships between the primary volume and the backup volume is obtained.

[0013] The number of common pair relationships is used as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0014] The step of obtaining the number of pair relationships between the current primary volume and the backup volume includes:

[0015] If a consistency group exists between the primary volume and the backup volume, the number of common pair relationships between the primary volume and the backup volume and the number of pair relationships in the consistency group are obtained.

[0016] The sum of the number of common pair relationships and the number of pair relationships in the consistency group is used as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0017] Among them, also include:

[0018] When receiving a command to add a second target pair relationship in the consistency group, determining whether the second target pair relationship is a common pair relationship;

[0019] If so, add the second target pair relationship to the consistency group.

[0020] After determining whether the second target pair relationship is a common pair relationship, the method further includes:

[0021] If the second target pair relationship is a non-normal pair relationship, the number of pair relationships between the current primary volume and the backup volume is obtained;

[0022] Determining whether the number of the pair relationships is less than a first preset value;

[0023] If so, add the second target pair relationship to the consistency group.

[0024] Before adding the second target pair relationship to the consistency group, the method further includes:

[0025] Determining whether the number of pair relationships in the current consistency group is less than a second preset value;

[0026] If so, perform the step of adding the second target pair relationship in the consistency group.

[0027] The step of obtaining the number of pair relationships between the current primary volume and the backup volume includes:

[0028] Obtain the number of common pair relationships between the current primary volume and the backup volume, and the number of pair relationships in the consistency group;

[0029] The sum of the number of common pair relationships and the number of pair relationships in the consistency group is used as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0030] To achieve the above objectives, the present application provides a data synchronization device, comprising:

[0031] A first acquisition module is configured to, upon receiving a command to create a common pair relationship, acquire the number of pair relationships between the current primary volume and the backup volume; wherein the pair relationships include the number of common pair relationships and pair relationships in a consistency group;

[0032] A first judging module, configured to judge whether the number of the pair relationships is less than a first preset value;

[0033] A creation module is used to create a first target pair relationship between the primary volume and the backup volume when the number of the pair relationships is less than the first preset value, and synchronize data between the primary volume and the backup volume based on the first target pair relationship.

[0034] To achieve the above objectives, the present application provides an electronic device, comprising:

[0035] memory for storing computer programs;

[0036] A processor is used to implement the steps of the above-mentioned data synchronization method when executing the computer program.

[0037] To achieve the above objectives, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above data synchronization method are implemented.

[0038] From the above scheme, it can be seen that a data synchronization method provided by the present application includes: when a command to create a normal pair relationship is received, obtaining the number of pair relationships between the current primary-end volume and the backup-end volume; wherein the pair relationship includes the number of normal pair relationships and the pair relationship in the consistency group; judging whether the number of pair relationships is less than a first preset value; if so, creating a first target pair relationship between the primary-end volume and the backup-end volume, and performing data synchronization between the primary-end volume and the backup-end volume based on the first target pair relationship.

[0039] The data synchronization method provided by the present application adopts a pair relationship between the primary-end volume and the backup-end volume for data synchronization. When creating a normal pair relationship between the primary-end volume and the backup-end volume, it is determined whether the number of pair relationships between the current primary-end volume and the backup-end volume is less than a first preset value. If so, the creation of the first target pair relationship is allowed, otherwise the creation of the first target pair relationship is not allowed. The present application modifies the statistical method of the pair relationship between the primary-end volume and the backup-end volume in the related art, and not only counts the number of normal pair relationships, but also counts the number of pair relationships in the consistency group, that is, the current pair relationship between the primary-end volume and the backup-end volume includes the number of normal pair relationships and the pair relationship in the consistency group, to avoid the pair relationship in the consistency group from exceeding the threshold after the pair relationship is converted into a normal pair relationship. It can be seen that the data synchronization method provided by the present application avoids the pair relationship between the primary-end volume and the backup-end volume from exceeding the threshold during the data synchronization process. The present application also discloses a data synchronization device, an electronic device and a computer-readable storage medium, which can also achieve the above-mentioned technical effects.

[0040] It should be understood that the foregoing general description and the following detailed description are merely illustrative and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure, but do not constitute a limitation of the present disclosure. In the drawings:

[0042] Figure 1 is a flow chart showing a data synchronization method according to an exemplary embodiment;

[0043] Figure 2 is a flow chart showing another data synchronization method according to an exemplary embodiment;

[0044] Figure 3 is a flow chart showing another data synchronization method according to an exemplary embodiment;

[0045] Figure 4 4 is a flowchart illustrating a method for creating a pair relationship according to an exemplary embodiment;

[0046] Figure 5 This is a flowchart of adding a pair relationship to a consistency group according to an exemplary embodiment;

[0047] Figure 6 is a structural diagram of a data synchronization device according to an exemplary embodiment;

[0048] Figure 7 The figure is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0050] An embodiment of the present application discloses a data synchronization method, which prevents the pair relationship between a primary-end volume and a backup-end volume from exceeding a threshold during the data synchronization process.

[0051] See also Figure 1, according to an exemplary embodiment, a flow chart of a data synchronization method is shown, such as Figure 1 Shown, including:

[0052] S101: When a command to create a common pair relationship is received, the number of pair relationships between the current primary volume and the backup volume is obtained; wherein the pair relationships include the number of common pair relationships and pair relationships in the consistency group;

[0053] In this embodiment, when a normal pair relationship needs to be created, the number of current pair relationships between the primary and backup volumes is counted. Specifically, when counting the number of current pair relationships between the primary and backup volumes, not only the number of normal pair relationships is counted, but also the number of pair relationships in the consistency group is counted. That is, the current pair relationships between the primary and backup volumes include both normal pair relationships and pair relationships in the consistency group. It should be noted that the attributes of each pair relationship in the consistency group are the same.

[0054] As a feasible implementation method, obtaining the number of pair relationships between the current primary volume and the backup volume includes: if there is no consistency group between the primary volume and the backup volume, obtaining the number of ordinary pair relationships between the current primary volume and the backup volume; and using the number of ordinary pair relationships as the number of pair relationships between the current primary volume and the backup volume.

[0055] In a specific implementation, if there is no consistency group between the primary and backup volumes, that is, the number of pair relationships in the consistency group is zero, then only the current common pair relationships between the primary and backup volumes need to be counted.

[0056] As another feasible implementation method, obtaining the number of pair relationships between the current primary-side volume and the backup-side volume includes: if there is a consistency group between the primary-side volume and the backup-side volume, obtaining the number of ordinary pair relationships between the current primary-side volume and the backup-side volume and the number of pair relationships in the consistency group; and taking the sum of the number of ordinary pair relationships and the number of pair relationships in the consistency group as the number of pair relationships between the current primary-side volume and the backup-side volume.

[0057] In specific implementation, if there is a consistency group between the primary volume and the backup volume, it is necessary to count not only the number of ordinary pair relationships, but also the number of pair relationships in the consistency group. That is, the current pair relationship between the primary volume and the backup volume includes the number of ordinary pair relationships and the pair relationships in the consistency group.

[0058] S102: Determine whether the number of the pair relationships is less than a first preset value; if so, proceed to S103;

[0059] In this step, it is determined whether the number of pair relationships between the current primary volume and the backup volume is less than a first preset value. This embodiment does not limit the specific value of the first preset value, but it can be preferably set to 10240. If the number of pair relationships between the current primary volume and the backup volume is less than the first preset value, the process proceeds to S103.

[0060] S103: Creating a first target pair relationship between the primary volume and the backup volume, and performing data synchronization between the primary volume and the backup volume based on the first target pair relationship.

[0061] In this step, if the number of pair relationships between the current primary volume and the backup volume is less than a first preset value, creation of the first target pair relationship is allowed.

[0062] Furthermore, if the number of pair relationships between the current primary volume and the backup volume is greater than or equal to a first preset value, creation of the first target pair relationship is not allowed.

[0063] That is to say, when a normal pair is created, the total number of pair relationships is counted based on the number of current normal pair relationships and the number of pairs in the consistency group, and it is determined whether the total number of pair relationships is less than the first preset value. If the total number of pair relationships is less than the first preset value, the first target pair relationship can be created as a normal pair relationship. If the total number of pair relationships is greater than or equal to the first preset value, the pair relationship cannot be created.

[0064] The data synchronization method provided by the embodiment of the present application adopts a pair relationship between the primary-end volume and the backup-end volume for data synchronization. When creating a normal pair relationship between the primary-end volume and the backup-end volume, it is determined whether the number of pair relationships between the current primary-end volume and the backup-end volume is less than a first preset value. If so, the creation of the first target pair relationship is allowed, otherwise the creation of the first target pair relationship is not allowed. The embodiment of the present application modifies the statistical method of the pair relationship between the primary-end volume and the backup-end volume in the related art, and not only counts the number of normal pair relationships, but also counts the number of pair relationships in the consistency group, that is, the current pair relationship between the primary-end volume and the backup-end volume includes the number of normal pair relationships and the pair relationship in the consistency group, to avoid the pair relationship in the consistency group from exceeding the threshold after the pair relationship is converted into a normal pair relationship. It can be seen that the data synchronization method provided by the embodiment of the present application avoids the pair relationship between the primary-end volume and the backup-end volume from exceeding the threshold during the data synchronization process.

[0065] The embodiment of this application discloses a data synchronization method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0066] See also Figure 2 , a flowchart of another data synchronization method according to an exemplary embodiment is shown, such as Figure 2 Shown, including:

[0067] S201: When receiving a command to add a second target pair relationship in a consistency group, determine whether the second target pair relationship is a common pair relationship; if so, directly proceed to S204; if not, proceed to S202;

[0068] In this embodiment, when it is necessary to add a second target pair relationship to the consistency group, it is determined whether the second target pair relationship is a normal pair relationship. If so, it means that the second target pair relationship is a created pair relationship, and adding it to the consistency group will not cause the number of normal pair relationships to exceed the threshold. Therefore, directly enter S204 and add the second target pair relationship to the consistency group.

[0069] S202: Obtain the number of pair relationships between the current primary volume and the backup volume;

[0070] In a specific implementation, if the second target pair relationship is not an ordinary pair relationship, it is necessary to create a second target pair relationship and then add it to the consistency group. In order to prevent the pair relationship between the primary volume and the backup volume from exceeding the threshold, before creating the second target pair relationship, the number of current pair relationships between the primary volume and the backup volume is first counted. Among them, when counting the number of current pair relationships between the primary volume and the backup volume, not only the number of ordinary pair relationships is counted, but also the number of pair relationships in the consistency group is counted, that is, the current pair relationship between the primary volume and the backup volume includes the number of ordinary pair relationships and the pair relationships in the consistency group.

[0071] As a feasible implementation method, obtaining the number of pair relationships between the current primary-end volume and the backup-end volume includes: obtaining the number of ordinary pair relationships between the current primary-end volume and the backup-end volume, and the number of pair relationships in the consistency group; and taking the sum of the number of ordinary pair relationships and the number of pair relationships in the consistency group as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0072] S203: Determine whether the number of the pair relationships is less than a first preset value; if so, proceed to S204;

[0073] In this step, it is determined whether the number of pair relationships between the current primary volume and the backup volume is less than a first preset value. This embodiment does not limit the specific value of the first preset value, but preferably, it can be set to 10240. If the number of pair relationships between the current primary volume and the backup volume is less than the first preset value, the process proceeds to S204.

[0074] S204: Add the second target pair relationship to the consistency group.

[0075] In this step, if the number of pair relationships between the current primary volume and the backup volume is less than the first preset value, a second target pair relationship is allowed to be created and added to the consistency group. It should be noted that the attributes of the second target pair relationship are the same as those in the consistency group.

[0076] Furthermore, if the number of pair relationships between the current primary volume and the backup volume is greater than or equal to a first preset value, the creation of the second target pair relationship is not allowed, and it is not allowed to be added to the consistency group.

[0077] That is to say, when adding a pair relationship in a consistency group, if the added pair relationship is in the current ordinary pair relationship, the pair relationship can be added to the consistency group; if the added pair relationship is not in the current ordinary pair relationship, the total number of pair relationships is counted according to the number of current ordinary pair relationships and the number of pairs in the consistency group, and it is determined whether the total number of pair relationships is less than the first preset value. If the total number of pair relationships is less than the first preset value, the pair relationship can be added to the consistency group; if the total number of pair relationships is greater than or equal to the first preset value, the pair relationship cannot be added to the consistency group.

[0078] The data synchronization method provided by the embodiment of the present application adopts a pair relationship between the primary-end volume and the backup-end volume for data synchronization. When adding a pair relationship to the consistency group, it is determined whether the number of pair relationships between the current primary-end volume and the backup-end volume is less than a first preset value. If so, the pair relationship is allowed to be added, otherwise the pair relationship is not allowed to be added. The embodiment of the present application modifies the statistical method of the pair relationship between the primary-end volume and the backup-end volume in the related art, and not only counts the number of ordinary pair relationships, but also counts the number of pair relationships in the consistency group, that is, the pair relationship between the current primary-end volume and the backup-end volume includes the number of ordinary pair relationships and the pair relationship in the consistency group, to avoid the pair relationship in the consistency group from exceeding the threshold after the pair relationship is converted into an ordinary pair relationship. It can be seen that the data synchronization method provided by the embodiment of the present application avoids the pair relationship between the primary-end volume and the backup-end volume from exceeding the threshold during the data synchronization process.

[0079] The embodiment of this application discloses a data synchronization method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0080] See also Figure 3 , according to an exemplary embodiment, a flow chart of another data synchronization method is shown, such as Figure 3 Shown, including:

[0081] S301: When receiving a command to add a second target pair relationship in a consistency group, determine whether the second target pair relationship is a common pair relationship; if so, directly proceed to S304; if not, proceed to S302;

[0082] In this embodiment, when it is necessary to add a second target pair relationship to the consistency group, it is determined whether the second target pair relationship is a normal pair relationship. If so, it means that the second target pair relationship is an already created pair relationship, and adding it to the consistency group will not cause the number of normal pair relationships to exceed the threshold. Therefore, directly enter S304.

[0083] S302: Obtain the number of pair relationships between the current primary volume and the backup volume;

[0084] In a specific implementation, if the second target pair relationship is not an ordinary pair relationship, it is necessary to create a second target pair relationship and then add it to the consistency group. In order to prevent the pair relationship between the primary volume and the backup volume from exceeding the threshold, before creating the second target pair relationship, the number of current pair relationships between the primary volume and the backup volume is first counted. Among them, when counting the number of current pair relationships between the primary volume and the backup volume, not only the number of ordinary pair relationships is counted, but also the number of pair relationships in the consistency group is counted, that is, the current pair relationship between the primary volume and the backup volume includes the number of ordinary pair relationships and the pair relationships in the consistency group.

[0085] As a feasible implementation method, obtaining the number of pair relationships between the current primary-end volume and the backup-end volume includes: obtaining the number of ordinary pair relationships between the current primary-end volume and the backup-end volume, and the number of pair relationships in the consistency group; and taking the sum of the number of ordinary pair relationships and the number of pair relationships in the consistency group as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0086] S303: Determine whether the current number of pair relationships is less than a first preset value; if so, proceed to S304;

[0087] In this step, it is determined whether the number of pair relationships between the current primary volume and the backup volume is less than a first preset value. This embodiment does not limit the specific value of the first preset value, but it can be preferably set to 10240. If the number of pair relationships between the current primary volume and the backup volume is less than the first preset value, the process proceeds to S304.

[0088] S304: Determine whether the number of pair relationships in the current consistency group is less than a second preset value; if so, proceed to S305;

[0089] In this step, it is determined whether the number of existing pair relationships in the consistency group is less than a second preset value. This embodiment does not limit the specific value of the first preset value, and preferably, it can be set to 512. If the number of pair relationships between the current primary volume and the backup volume is less than the second preset value, then proceed to S305.

[0090] S305: Add the second target pair relationship in the consistency group.

[0091] In this step, if the number of pair relationships between the current primary volume and the backup volume is less than the first preset value and the number of existing pair relationships in the consistency group is less than the second preset value, then the second target pair relationship is allowed to be created and added to the consistency group. Otherwise, the second target pair relationship is not allowed to be added to the consistency group. It should be noted that the attributes of the second target pair relationship are the same as those in the consistency group.

[0092] The data synchronization method provided by the embodiment of the present application adopts a pair relationship between the primary-end volume and the backup-end volume for data synchronization. When adding a pair relationship to the consistency group, it is determined whether the number of pair relationships between the current primary-end volume and the backup-end volume is less than a first preset value and whether the number of existing pair relationships in the consistency group is less than a second preset value. If both are true, the pair relationship is allowed to be added, otherwise the pair relationship is not allowed to be added. The embodiment of the present application modifies the statistical method of the pair relationship between the primary-end volume and the backup-end volume in the related art, and not only counts the number of ordinary pair relationships, but also counts the number of pair relationships in the consistency group, that is, the pair relationship between the current primary-end volume and the backup-end volume includes the number of ordinary pair relationships and the pair relationship in the consistency group, avoiding the pair relationship in the consistency group from exceeding the threshold after the pair relationship is converted into an ordinary pair relationship, and avoiding the number of pair relationships in the consistency group from exceeding the threshold. It can be seen that the data synchronization method provided by the embodiment of the present application avoids the pair relationship between the primary-end volume and the backup-end volume from exceeding the threshold during the data synchronization process.

[0093] The following describes an application embodiment provided by this application. The process of creating a pair relationship is as follows: Figure 4 As shown, it mainly includes the following steps:

[0094] Step 1: Get the total number of common pairs and consistency group pairs.

[0095] Step 2: When creating a pair, determine the total number of pairs in step 1. If the total number is less than 10240, the pair can be created; if the total number is equal to 10240, the pair cannot be created.

[0096] The process of adding a pair relationship to a consistency group is as follows: Figure 5 As shown, it mainly includes the following steps:

[0097] Step 1: When adding a pair to a consistency group, if the added pair is a normal pair, you can add the pair to the consistency group;

[0098] Step 2: If the pair being added is not a common pair, first obtain the total number of common pairs and consistency group pairs. Determine the total number of pairs. If the total number is less than 10240, the pair can be added. If the total number is equal to 10240, the pair cannot be added.

[0099] When creating a pair or adding a pair to a consistency group in a distributed storage system, determine whether the total number of common pairs and consistency group pairs exceeds the threshold. Otherwise, the consistency group will remove pairs that exceed the threshold. When creating a common pair, determine whether the total number of common pairs and consistency group pairs exceeds the threshold of 10240. If the number is less than 10240, the pair can be created; if the number is equal to 10240, the pair cannot be created. When adding a pair consistently, if the added pair exists in the current common pair, the pair can be added to the consistency group remote replication; if the added pair does not exist in the current common pair, determine whether the total number of common pairs and consistency group pairs exceeds the threshold of 10240. If the number is less than 10240, the pair can be added to the consistency group; if the number is equal to 10240, the pair cannot be added to the consistency group.

[0100] A data synchronization device provided in an embodiment of the present application is introduced below. The data synchronization device described below and the data synchronization method described above can be referenced to each other.

[0101] See also Figure 6 , a structural diagram of a data synchronization device according to an exemplary embodiment is shown as follows Figure 6Shown, including:

[0102] The first acquisition module 601 is configured to acquire the number of pair relationships between the current primary volume and the backup volume upon receiving a command to create a common pair relationship; wherein the pair relationships include the number of common pair relationships and pair relationships in a consistency group;

[0103] A first judging module 602 is configured to judge whether the number of the pair relationships is less than a first preset value;

[0104] The creation module 603 is used to create a first target pair relationship between the primary volume and the backup volume when the number of the pair relationships is less than the first preset value, and synchronize data between the primary volume and the backup volume based on the first target pair relationship.

[0105] The data synchronization device provided by the embodiment of the present application adopts a pair relationship between the primary-end volume and the backup-end volume for data synchronization. When creating a normal pair relationship between the primary-end volume and the backup-end volume, it determines whether the number of pair relationships between the current primary-end volume and the backup-end volume is less than a first preset value. If so, the creation of the first target pair relationship is allowed, otherwise the creation of the first target pair relationship is not allowed. The embodiment of the present application modifies the statistical method of the pair relationship between the primary-end volume and the backup-end volume in the related art, and not only counts the number of normal pair relationships, but also counts the number of pair relationships in the consistency group, that is, the current pair relationship between the primary-end volume and the backup-end volume includes the number of normal pair relationships and the pair relationship in the consistency group, to avoid the pair relationship in the consistency group from exceeding the threshold after the pair relationship is converted into a normal pair relationship. It can be seen that the data synchronization device provided by the embodiment of the present application avoids the pair relationship between the primary-end volume and the backup-end volume from exceeding the threshold during the data synchronization process.

[0106] Based on the above embodiment, as a preferred implementation mode, the first acquisition module 601 is specifically used for: when receiving a command to create a normal pair relationship, if there is no consistency group between the primary-end volume and the backup-end volume, then obtaining the number of normal pair relationships between the current primary-end volume and the backup-end volume; and using the number of normal pair relationships as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0107] Based on the above embodiment, as a preferred implementation mode, the first acquisition module 601 is specifically used for: when receiving a command to create a normal pair relationship, if there is a consistency group between the primary-end volume and the backup-end volume, then obtaining the number of normal pair relationships between the current primary-end volume and the backup-end volume and the number of pair relationships in the consistency group; and taking the sum of the number of normal pair relationships and the number of pair relationships in the consistency group as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0108] Based on the above embodiment, as a preferred implementation, it further includes:

[0109] a second judging module configured to, upon receiving a command to add a second target pair relationship to the consistency group, judge whether the second target pair relationship is a common pair relationship;

[0110] The first adding module is configured to add the second target pair relationship to the consistency group when the second target pair relationship is a common pair relationship.

[0111] Based on the above embodiment, as a preferred implementation, it further includes:

[0112] A second acquisition module is configured to acquire the number of pair relationships between the current primary volume and the backup volume when the second target pair relationship is a non-normal pair relationship;

[0113] A third judgment module is used to judge whether the number of the pair relationships is less than a first preset value;

[0114] The second adding module is configured to add the second target pair relationship to the consistency group when the number of the pair relationships is less than a first preset value.

[0115] Based on the above embodiment, as a preferred implementation, it further includes:

[0116] A fourth judgment module is used to judge whether the number of pair relationships in the current consistency group is less than a second preset value;

[0117] The second adding module is configured to add the second target pair relationship in the consistency group when the number of pair relationships in the current consistency group is less than a second preset value.

[0118] Based on the above embodiment, as a preferred implementation mode, the second acquisition module is specifically used to: when the second target pair relationship is a non-ordinary pair relationship, obtain the number of ordinary pair relationships between the current primary-end volume and the backup-end volume and the number of pair relationships in the consistency group; and use the sum of the number of ordinary pair relationships and the number of pair relationships in the consistency group as the number of pair relationships between the current primary-end volume and the backup-end volume.

[0119] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0120] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an electronic device, Figure 7 FIG. 1 is a structural diagram of an electronic device according to an exemplary embodiment. Figure 7 As shown, the electronic equipment includes:

[0121] Communication interface 1, capable of exchanging information with other devices such as network devices;

[0122] The processor 2 is connected to the communication interface 1 to implement information exchange with other devices and is used to execute the data synchronization method provided by one or more of the above technical solutions when running a computer program. The computer program is stored in the memory 3.

[0123] Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 4.

[0124] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.

[0125] It is understood that the memory 3 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), 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 rambus random access memory (DRRAM).The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0126] The method disclosed in the above-mentioned embodiment of the present application can be applied to processor 2 or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above-mentioned method can be completed by the integrated logic circuit of the hardware in processor 2 or instructions in the form of software. The above-mentioned processor 2 can be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the above-mentioned method in combination with its hardware.

[0127] When the processor 2 executes the program, the corresponding processes in the various methods of the embodiments of the present application are implemented. For the sake of brevity, they are not repeated here.

[0128] In an exemplary embodiment, the present application also provides a storage medium, namely, a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 storing a computer program. The computer program can be executed by a processor 2 to perform the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0129] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, ROM, RAM, disks or optical disks, etc. Various media that can store program codes.

[0130] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0131] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A data synchronization method, characterized in that: include: When a command to create a common pair relationship is received, the number of pair relationships between the current primary volume and the backup volume is obtained; wherein the pair relationships include common pair relationships and pair relationships in a consistency group; Determining whether the number of the pair relationships is less than a first preset value; If so, creating a first target pair relationship between the primary volume and the backup volume, and performing data synchronization between the primary volume and the backup volume based on the first target pair relationship; The step of obtaining the number of pair relationships between the current primary volume and the backup volume includes: If a consistency group exists between the primary volume and the backup volume, the number of common pair relationships between the primary volume and the backup volume and the number of pair relationships in the consistency group are obtained. The sum of the number of common pair relationships and the number of pair relationships in the consistency group is used as the number of pair relationships between the current primary-end volume and the backup-end volume.

2. The data synchronization method according to claim 1, characterized in that: The method of obtaining the number of pair relationships between the current primary volume and the backup volume includes: If no consistency group exists between the primary volume and the backup volume, the number of common pair relationships between the primary volume and the backup volume is obtained. The number of common pair relationships is used as the number of pair relationships between the current primary-end volume and the backup-end volume.

3. The data synchronization method according to claim 1, characterized in that: Also includes: When receiving a command to add a second target pair relationship in the consistency group, determining whether the second target pair relationship is a common pair relationship; If so, add the second target pair relationship to the consistency group.

4. The data synchronization method according to claim 3, characterized in that: After determining whether the second target pair relationship is a common pair relationship, the method further includes: If the second target pair relationship is a non-normal pair relationship, the number of pair relationships between the current primary volume and the backup volume is obtained; Determining whether the number of the pair relationships is less than a first preset value; If so, add the second target pair relationship to the consistency group.

5. The data synchronization method according to claim 3 or 4, characterized in that: Before adding the second target pair relationship to the consistency group, the method further includes: Determining whether the number of pair relationships in the current consistency group is less than a second preset value; If so, perform the step of adding the second target pair relationship in the consistency group.

6. The data synchronization method according to claim 4, characterized in that: The method of obtaining the number of pair relationships between the current primary volume and the backup volume includes: Obtain the number of common pair relationships between the current primary volume and the backup volume, and the number of pair relationships in the consistency group; The sum of the number of common pair relationships and the number of pair relationships in the consistency group is used as the number of pair relationships between the current primary-end volume and the backup-end volume.

7. A data synchronization device, characterized in that: include: A first acquisition module is configured to, upon receiving a command to create a common pair relationship, acquire the number of pair relationships between the current primary volume and the backup volume; wherein the pair relationships include common pair relationships and pair relationships in a consistency group; A first judging module, configured to judge whether the number of the pair relationships is less than a first preset value; a creation module configured to, when the number of the pair relationships is less than the first preset value, create a first target pair relationship between the primary volume and the backup volume, and synchronize data between the primary volume and the backup volume based on the first target pair relationship; Among them, the first acquisition module is specifically used to: if there is a consistency group between the primary-end volume and the backup-end volume, then obtain the number of common pair relationships between the current primary-end volume and the backup-end volume and the number of pair relationships in the consistency group; and use the sum of the number of common pair relationships and the number of pair relationships in the consistency group as the number of pair relationships between the current primary-end volume and the backup-end volume.

8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the data synchronization method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the data synchronization method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Synchronous transmission method, slave device and system

    CN106815091A

  • Asynchronous remote replication method and device and medium

    CN114996284A