Data processing method and device, electronic equipment and storage medium

CN117311606BActive Publication Date: 2026-10-16INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311091530.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2026-10-16
Estimated Expiration
2043-08-28

AI Technical Summary

Technical Problem

[0004]本发明提供一种数据处理方法、装置、电子设备及存储介质,用以解决现有技术中各节点之间的处理数据的准确性以及一致性差的缺陷,实现提高主端集群和辅端集群的数据准确性和一致性

Benefits of technology

[0018] The data processing method, apparatus, electronic device, and storage medium provided by this invention determine the node type of the target node upon receiving a processing instruction for the data to be processed from the host. Based on the node type of the target node, the volume space corresponding to the data to be processed in each node of the node mirror pair is locked and the bitmap is initialized. After the data to be processed is processed, the lock is released and the bitmap is updated in the volume space corresponding to the data to be processed in each node of the node mirror pair according to the node type of the target node. This ensures that while one piece of data to be processed is being processed, read and write operations on other data to be processed by nodes in the same space are prohibited. This ensures the accuracy and consistency of data processing among nodes during remote replication, thereby ensuring data consistency and accuracy between the slave cluster and the master cluster and improving data storage performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117311606B_ABST
    Figure CN117311606B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device, electronic equipment and storage medium, and relates to the technical field of computers. The method comprises the following steps: determining the node type of a target node receiving a processing instruction of to-be-processed data issued by a host; performing corresponding initial operations on other nodes in a target node and a node mirror pair except the target node according to the node type and the to-be-processed data; executing the processing instruction on the to-be-processed data; performing corresponding update operations on the target node and the other nodes when the to-be-processed data processing is completed; the corresponding initial operations comprise a first operation of a locking operation and a bitmap initialization operation or a second operation of a locking completion message sending operation and a bitmap initialization operation; and the corresponding update operations comprise a third operation of a lock release operation and a bitmap update operation or a fourth operation of a lock release message sending operation and a bitmap update operation. The application improves the data accuracy and consistency of the primary cluster and the secondary cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] In storage systems, remote replication is supported. This allows creating a remote replication relationship between two volumes on different clusters, consisting of a volume on the primary cluster and a volume on the secondary cluster. When the primary cluster volume receives a processing instruction (IO) from the host, the tasks it needs to perform include: first, sending the IO to the primary cluster volume; second, forwarding the IO to the secondary cluster volume; third, the secondary cluster volume sending the IO; and finally, modifying the bitmap of all nodes in the mirror pair to which the IO belongs, thus achieving process replication of the IO.

[0003] In multi-controller storage systems, multiple nodes are required to participate in remote IO replication. In actual processing, multiple different IOs need to be processed at the same time, resulting in multiple different IO read and write operations on each node in the same space of the mirror pair. This leads to poor accuracy and consistency of data processing between nodes, making it impossible to guarantee the data accuracy and consistency between the master cluster and the slave cluster during remote replication. Summary of the Invention

[0004] This invention provides a data processing method, apparatus, electronic device, and storage medium to address the shortcomings of poor accuracy and consistency of data processing between nodes in the prior art, thereby improving the data accuracy and consistency of the master cluster and the slave cluster.

[0005] This invention provides a data processing method applied to node mirror pairs, comprising: Determine the node type of the target node for receiving the processing instructions for the data to be processed from the host. Based on the node type and the data to be processed, perform corresponding initial operations on the target node and the other nodes in the node mirror pair, excluding the target node. Upon completion of the initial operation, the processing instructions are executed on the data to be processed in the target node and the other nodes. Once it is determined that the data to be processed has been processed, corresponding update operations are performed on the target node and the other nodes according to the node type and the data to be processed. The corresponding initial operation includes a first operation or a second operation. The first operation includes a locking operation and a bitmap initialization operation. The second operation includes a locking completion message sending operation and the bitmap initialization operation. The corresponding update operation includes a third operation or a fourth operation. The third operation includes a lock release operation and a bitmap update operation. The fourth operation includes a lock release message sending operation and the bitmap update operation.

[0006] According to a data processing method provided by the present invention, the step of performing corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node according to the node type and the data to be processed includes: When the target node is determined to be the master node based on the node type, the initial operation corresponding to the target node includes the first operation, and the initial operation corresponding to the other nodes includes the second operation; According to the first operation, the volume space corresponding to the data to be processed is locked in the target node and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized; If the initial operation corresponding to the target node is determined to be completed, based on the target node and according to the second operation, a locking completion message for the data to be processed is sent to the other nodes, and the bitmap of the volume space corresponding to the data to be processed in the other nodes is initialized.

[0007] According to a data processing method provided by the present invention, the step of sending a locking completion message of the data to be processed to other nodes and initializing the bitmap of the volume space corresponding to the data to be processed in the other nodes, based on the target node and according to the second operation, includes: In the case where the node mirror pair includes three nodes, based on the target node, according to the second operation, the locking completion message is sent to the first candidate node among the other nodes and the bitmap in the first candidate node is initialized; Based on the first candidate node, according to the second operation, the locking completion message is sent to the second candidate node among the other nodes, and the bitmap in the second candidate node is initialized.

[0008] According to a data processing method provided by the present invention, the step of performing corresponding update operations on the target node and the other nodes based on the node type and the data to be processed includes: When the target node is determined to be the master node based on the node type, the update operation corresponding to the target node includes the third operation, and the update operation corresponding to the other nodes includes the fourth operation. According to the third operation, in the target node, the lock on the volume space corresponding to the data to be processed is released and the bitmap of the initialized volume space corresponding to the data to be processed in the target node is updated; If the update operation corresponding to the target node is determined to be completed, based on the target node and according to the fourth operation, the lock release message is sent to the other nodes and the initialized bitmap in the other nodes is updated.

[0009] According to a data processing method provided by the present invention, the step of sending the lock release message to other nodes and updating the initialized bitmap in the other nodes based on the target node and according to the fourth operation includes: In the case where the node mirror pair includes three nodes, based on the target node, according to the fourth operation, the lock release message is sent to the first candidate node among the other nodes and the initialized bitmap in the first candidate node is updated; If it is determined that the update operation corresponding to the first candidate node has been completed, based on the first candidate node, according to the fourth operation, the lock release message is sent to the second candidate node among the other nodes, and the initialized bitmap in the second candidate node is updated.

[0010] According to a data processing method provided by the present invention, the step of performing corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node according to the node type and the data to be processed includes: When the target node is determined to be a candidate node based on the node type, the initial operation corresponding to the target master node among the other nodes includes the first operation, and the initial operation corresponding to the target node includes the second operation. Based on the target node, according to the first operation, the volume space corresponding to the data to be processed is locked in the target master node and the bitmap of the volume space corresponding to the data to be processed in the target master node is initialized; If the initial operation corresponding to the target master node is completed, according to the second operation, a locking completion message for the data to be processed is sent to the target node, and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized.

[0011] According to a data processing method provided by the present invention, after sending a locking completion message of the data to be processed to the target node and initializing the bitmap of the volume space corresponding to the data to be processed in the target node, the method further includes: In the case that the node mirror pair includes three nodes, it is determined that the other nodes also include the target candidate node; The initial operation corresponding to the target candidate node includes the second operation, which involves sending the locking completion message to the target candidate node and initializing the bitmap in the target candidate node based on the target node and according to the second operation.

[0012] According to a data processing method provided by the present invention, the step of performing corresponding update operations on the target node and the other nodes based on the node type and the data to be processed includes: When the target node is determined to be a candidate node based on the node type, the update operation corresponding to the target node includes the fourth operation, and the update operation corresponding to the target master node among the other nodes includes the third operation; According to the fourth operation, a lock release message is sent from the target node to the target master node, and the bitmap of the volume space corresponding to the data to be processed in the target node is updated after initialization. According to the third operation, the lock on the volume space corresponding to the data to be processed is released in the target master node, and the initialized bitmap in the target master node is updated.

[0013] According to a data processing method provided by the present invention, the step of sending a lock release message from the target node to the target master node includes: In the case that the node mirror pair includes three nodes, it is determined that the other nodes also include the target candidate node; The update operation corresponding to the target candidate node includes the fourth operation, which involves sending the lock release message to the target candidate node based on the target node and updating the initialized bitmap in the target candidate node according to the fourth operation; If the update operation corresponding to the target candidate node is determined to be completed, the lock release message is sent from the target node to the target master node.

[0014] The present invention also provides a data processing apparatus for use with node mirror pairs, comprising: The determining unit is used to determine the node type of the target node receiving the processing instruction for the data to be processed from the host. The first processing unit is configured to perform corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node, according to the node type and the data to be processed. The second processing unit is configured to execute the processing instructions on the data to be processed in the target node and the other nodes after the initial operation has been completed. The third processing unit is used to perform corresponding update operations on the target node and the other nodes according to the node type and the data to be processed, when it is determined that the data to be processed has been processed. The corresponding initial operation includes a first operation or a second operation. The first operation includes a locking operation and a bitmap initialization operation. The second operation includes a locking completion message sending operation and the bitmap initialization operation. The corresponding update operation includes a third operation or a fourth operation. The third operation includes a lock release operation and a bitmap update operation. The fourth operation includes a lock release message sending operation and the bitmap update operation.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the data processing methods described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the data processing methods described above.

[0018] The data processing method, apparatus, electronic device, and storage medium provided by this invention determine the node type of the target node upon receiving a processing instruction for the data to be processed from the host. Based on the node type of the target node, the volume space corresponding to the data to be processed in each node of the node mirror pair is locked and the bitmap is initialized. After the data to be processed is processed, the lock is released and the bitmap is updated in the volume space corresponding to the data to be processed in each node of the node mirror pair according to the node type of the target node. This ensures that while one piece of data to be processed is being processed, read and write operations on other data to be processed by nodes in the same space are prohibited. This ensures the accuracy and consistency of data processing among nodes during remote replication, thereby ensuring data consistency and accuracy between the slave cluster and the master cluster and improving data storage performance. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 This is one of the flowcharts illustrating the data processing method provided by the present invention; Figure 2 This is the second flowchart of the data processing method provided by the present invention; Figure 3 This is one of the timing diagrams of the interaction between the target node and other nodes provided by the present invention; Figure 4 This is the second timing diagram of the interaction between the target node and other nodes provided by the present invention; Figure 5 This is the third timing diagram of the interaction between the target node and other nodes provided by the present invention; Figure 6 This is the fourth timing diagram of the interaction between the target node and other nodes provided by the present invention; Figure 7 This is a schematic diagram of the data processing device provided by the present invention; Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0022] The data processing method provided in this embodiment can be applied to a multi-controller storage system, which includes multiple control nodes. The specific number can be set according to actual needs, such as three or four control nodes. This embodiment does not specifically limit this. The following four-controller storage system formed by four control nodes is used as an example to describe the data processing method provided in this embodiment. It is also applicable to other multi-controller storage systems, and will not be elaborated here.

[0023] This multi-controller storage system supports remote replication, enabling the creation of remote replication relationships between two volumes on different clusters. The two volumes refer to the volume on the primary cluster (hereinafter referred to as the primary volume) and the volume on the secondary cluster (hereinafter referred to as the secondary volume). The primary volume can receive host I / O and simultaneously synchronize the I / O to the secondary volume synchronously or asynchronously. The secondary volume serves as a backup of the primary volume, ensuring that even in the event of power failure or data corruption on the primary cluster, the secondary cluster still stores valid data. Users can recover data from the primary cluster from the secondary cluster, guaranteeing no data loss.

[0024] The so-called four-controller storage system includes four control nodes: Node 1, Node 2, Node 3, and Node 4. These four nodes are mirrored in pairs, such as Node 1 and Node 2, Node 2 and Node 3, Node 3 and Node 4, and Node 4 and Node 1. Typically, the remotely replicated bitmap is backed up on both nodes of each mirror pair. When a node comes online, the mirror pairs are reassembled. For a period, a mirror pair may contain three nodes. During this time, the remotely replicated bitmap needs to be synchronized across all three nodes, with each node's bitmap serving as a backup.

[0025] During remote replication, after receiving an I / O, the primary volume needs to handle the following tasks: First, it sends the I / O to the primary volume; then, it forwards the I / O to the secondary volume, which then sends the I / O; finally, it modifies the bitmap of all nodes within the mirror to which the I / O belongs.

[0026] In multi-controller storage systems, multiple nodes are required to participate in remote IO replication. However, in actual processing, multiple different IOs need to be processed at the same time. This results in multiple different IO read and write operations on each node in the same space of the mirror pair, leading to poor accuracy and consistency of the processed data between nodes. Consequently, the accuracy and consistency of the data between the master cluster and the slave cluster cannot be guaranteed during remote replication.

[0027] To address the aforementioned issues, this embodiment provides a data processing method. Upon receiving a processing instruction for the data to be processed from the host, the method determines the node type of the target node. Based on the node type of the target node, it locks and initializes the bitmap of the volume space corresponding to the data to be processed in each node of the node mirror pair. After the data to be processed is completed, it releases the lock and updates the bitmap of the volume space corresponding to the data to be processed in each node of the node mirror pair based on the node type of the target node. This ensures that while one piece of data to be processed is being processed, read and write operations on other data to be processed by nodes in the same space are prohibited. In other words, it ensures that all nodes in the node mirror pair have only one piece of data to be processed at any given time, i.e., I / O is being processed, and the bitmap space corresponding to the I / O can be accurately updated simultaneously. This ensures the accuracy and consistency of data processing between nodes during remote replication, thereby ensuring the data consistency and accuracy between the secondary cluster and the primary cluster, preventing any data to be processed that has not been copied to the secondary cluster from being missed, and improving data storage performance.

[0028] The following is combined with Figures 1-6 The data processing method of the present invention is described. The execution subject of the method is a node mirror pair. The node mirror pair includes multiple nodes that are mutually primary and backup. The specific number can be adaptively determined according to the actual application scenario. For example, there can be two mutually primary and backup nodes, that is, one is a backup node and the other is a primary node; or there can be three mutually primary and backup nodes, that is, one is a primary node and the other two are backup nodes. This embodiment does not specifically limit this.

[0029] Figure 1 The data processing method provided in this embodiment includes the following steps: Step 101: Determine the node type of the target node receiving the processing instruction for the data to be processed from the host. The data to be processed can be input / output data, i.e., I / O.

[0030] Node types include primary nodes or alternative nodes.

[0031] Optionally, the processing instruction for the data to be processed is issued by the host to the multi-controller storage system via I / O, and the remote replication primary volume in the multi-controller storage system receives the I / O. When the remote replication primary volume receives the I / O, the node mirror determines the target node in the primary volume that actually receives the processing instruction for the data to be processed issued by the host. It is then determined whether the target node is a primary node or a backup node to further determine the node type of the target node.

[0032] Step 102: Based on the node type and the data to be processed, perform corresponding initial operations on the target node and other nodes in the node mirror pair excluding the target node; wherein, the corresponding initial operations include a first operation or a second operation, the first operation includes a locking operation and a bitmap initialization operation, and the second operation includes a locking operation to complete message sending and a bitmap initialization operation. Step 103: Execute processing instructions on the data to be processed in the target node and other nodes; Step 104: If it is determined that the data to be processed has been processed, perform corresponding update operations on the target node and other nodes according to the node type and the data to be processed; the corresponding update operations include a third operation or a fourth operation. The third operation includes a lock release operation and a bitmap update operation, and the fourth operation includes a lock release message sending operation and a bitmap update operation.

[0033] The processing command referred to is the remote copy command, which is used to perform remote data copying.

[0034] The other nodes referred to are the nodes in the node mirror pair other than the target node. The number of these nodes is determined based on the number of nodes contained in the node mirror pair. For example, if the node mirror pair contains two nodes, the number of other nodes is 1; if the node mirror pair contains three nodes, the number of other nodes is 2.

[0035] Optionally, after determining the type of the target node, the node types of other nodes can be determined based on the type of the target node and the number of nodes contained in the node mirror pair. Then, based on the type of the target node, the initial operation corresponding to the target node (i.e., the first or second operation) can be obtained, as well as the initial operations corresponding to other nodes (i.e., the first or second operation) can be obtained. Furthermore, based on the type of the target node, the update operation corresponding to the target node (i.e., the third or fourth operation) can be obtained, as well as the update operations corresponding to other nodes (i.e., the third or fourth operation) can be obtained.

[0036] For example, if the target node is the master node, the initial operation corresponding to the target node is determined as the first operation, which means that the target node needs to be locked and the bitmap initialized. The update operation corresponding to the target node is determined as the third operation, which means that the target node needs to be locked and the bitmap updated. When the target node is a candidate node, the initial operation corresponding to the target node is determined as the second operation, which means that the target node needs to be locked to complete the message sending operation and the bitmap initialization operation. The update operation corresponding to the target node is determined as the fourth operation, which means that the target node needs to be locked to release the message sending operation and the bitmap update operation.

[0037] In remote replication, a bitmap can be used to record which data has been synchronized from the primary cluster to the secondary cluster and which data has not yet been synchronized. One bit (Binary digit) of the bitmap manages one grain (granularity, the smallest unit of data allocation or addressable unit in a storage device), which is typically 256KB. If the bit is 1, it indicates that the data in that 256KB volume is synchronized between the primary and secondary clusters; if the bit is 0, it indicates that the data in that 256KB volume is not synchronized. For example, after creating a remote replication relationship, before the primary and secondary clusters begin synchronizing, the bitmap's flag is initialized to 0, indicating that all space in that volume is not yet synchronized to the secondary cluster. After starting the remote replication relationship, each time data in a 256KB space is synchronized, its corresponding bit is updated from 0 to 1.

[0038] Therefore, the initialization mentioned above can be to initialize the bitmap to 0, which is used to represent the data in the volume space corresponding to the data to be processed in the master cluster that is out of sync; the update mentioned above can be to update the bitmap to 1, which is used to represent the data in the volume space corresponding to the data to be processed in the master cluster that is synchronized; or the bitmap can be kept at 0, which represents the data in the volume space corresponding to the data to be processed in the master cluster that is out of sync.

[0039] Next, the corresponding initial operations are performed on the target node and other nodes to lock the volume space corresponding to the data to be processed and initialize the bitmap. After each node has completed locking the volume space corresponding to the data to be processed and initializing the bitmap, it is determined that the lock acquisition of the volume space corresponding to the data to be processed has been completed.

[0040] Next, the primary volume begins copying I / O to the secondary volume. After the I / O copy is complete, it is distributed to the corresponding storage space on the local side. Specifically, based on the target node in the node mirror pair, I / O is copied to other nodes. After the copy to other nodes is complete, the I / O is distributed to the target node, that is, stored in the corresponding storage space of the target node. In this way, the I / O is stored in the corresponding storage space of each node (including the target node and other nodes), so that the processing instructions for the data to be processed can be executed on each node.

[0041] Once it is confirmed that the data to be processed has been completed, i.e., all nodes have completed their I / O processing, the lock release process is initiated. Specifically, corresponding update operations are performed on the target node and other nodes to release the lock and update the bitmap of the volume space corresponding to the data to be processed. After the lock release and bitmap update of the volume space corresponding to the data to be processed are completed, it is determined that the data to be processed has been completed.

[0042] Figure 2 This is the second flowchart illustrating the data processing method provided in this embodiment, as shown below. Figure 2 As shown, the following will elaborate on steps 101-104 above with specific examples, including: The master cluster determines the node type of the target node and the types of other nodes based on the IO processing instructions issued by the host received by the target node, and determines the master node and backup nodes within the node mirror pair.

[0043] The first operation is performed on the primary node (i.e., the target node or other nodes) in the node mirror pair. Specifically, a lock is acquired in the primary node, that is, the volume space corresponding to the data to be processed is locked. After successfully acquiring the lock, the bitmap of the volume space corresponding to the data to be processed in the primary node is set to 0.

[0044] The second operation is performed on the candidate node (i.e., the target node or other nodes) in the node mirror pair. Specifically, a lock acquisition completion message for the data to be processed is sent to the candidate node, thereby notifying the candidate node that the lock corresponding to the data to be processed has been acquired, and the bitmap of the volume space corresponding to the data to be processed in the candidate node is initialized by setting the bits of the bitmap to 0.

[0045] Next, after confirming that the lock acquisition process for the data to be processed is complete, the primary volume begins copying IO to the secondary volume. After the IO copy is complete, the IO is sent to the corresponding storage space on this side. Specifically, based on the target node in the node mirror pair, IO is copied to other nodes. After the copy to other nodes is complete, the IO is sent to the target node to store the IO in the corresponding storage space of each node (including the target node and other nodes), thereby enabling the execution of processing instructions for the data to be processed on each node.

[0046] Next, once it is confirmed that the data to be processed has been completed, that is, all nodes have completed the IO processing, the lock release process is initiated, which involves releasing the lock and modifying the bitmap.

[0047] Optionally, a third operation is performed on the master node, specifically releasing the lock on the volume space corresponding to the data to be processed in the master node and modifying the initialized bitmap of the volume space corresponding to the data to be processed in the master node; a fourth operation is performed on the backup node, specifically sending a lock release message to the backup node so that the backup node can receive the lock release message, update the bitmap, and clear various intermediate information generated by IO processing. Finally, after confirming that all update operations on all nodes within the node mirror pair have been completed, the lock-release process is considered complete, thus confirming the completion of the entire IO process.

[0048] The data processing method provided in this embodiment determines the node type of the target node when it receives the processing instruction for the data to be processed from the host. Based on the node type of the target node, it locks and initializes the bitmap of the volume space corresponding to the data to be processed in each node of the node mirror pair. After the data to be processed is processed, it releases the lock and updates the bitmap of the volume space corresponding to the data to be processed in each node of the node mirror pair based on the node type of the target node. This ensures that while one piece of data to be processed is being processed, read and write operations on other data to be processed by nodes in the same space are prohibited. This ensures the accuracy and consistency of data processing between nodes during remote replication, thereby ensuring the data consistency and accuracy between the slave cluster and the master cluster and improving data storage performance.

[0049] In some embodiments, based on the node type and the data to be processed, corresponding initial operations are performed on the target node and other nodes in the node mirror pair besides the target node, including: When the target node is determined to be the master node based on the node type, the initial operation for determining the target node includes the first operation, and the initial operation for determining the other nodes includes the second operation. According to the first operation, the volume space corresponding to the data to be processed in the target node is locked and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized. Once the initial operation corresponding to the target node is confirmed to be completed, based on the target node and according to the second operation, a locking completion message for the data to be processed is sent to other nodes, and the bitmap of the volume space corresponding to the data to be processed in other nodes is initialized.

[0050] Optionally, when determining the target node as the master node, the initial operation corresponding to the target node includes the first operation, and the initial operation corresponding to other nodes includes the second operation.

[0051] Furthermore, the initialization steps for each node within a node mirror can be as follows: According to the first operation, a lock is acquired in the target node, that is, the volume space corresponding to the data to be processed is locked. After successfully acquiring the lock, the bitmap of the volume space corresponding to the data to be processed in the target node is set to 0.

[0052] Once the initial operation corresponding to the target node is completed, based on the target node and according to the second operation, a lock completion message for the data to be processed is sent to other nodes, thereby notifying other nodes that the lock corresponding to the data to be processed has been acquired, and the bitmap of the volume space corresponding to the data to be processed in other nodes is initialized by setting the bits of the bitmap to 0.

[0053] It should be noted that the number of nodes included in a node mirror pair can be 2 or 3. That is, when the target node is the master node, the other nodes can include 1 or 2 alternative nodes.

[0054] In some embodiments, when the number of nodes in a node mirror pair is two, the other nodes include a candidate node, and the initialization steps of the candidate node are as follows: When the initial operation corresponding to the target node is completed, a lock completion message for the data to be processed can be sent directly to the candidate node based on the target node and according to the second operation. This notifies the candidate node that the lock corresponding to the data to be processed has been acquired, and initializes the bitmap of the volume space corresponding to the data to be processed in the candidate node by setting the bits of the bitmap to 0.

[0055] In some embodiments, when a node mirror pair includes three nodes, the other nodes include a first alternative node and a second alternative node. The initialization steps for the first alternative node and the second alternative node are as follows: Based on the target node, according to the second operation, a lock completion message is sent to the first candidate node among the other nodes, and the bitmap in the first candidate node is initialized; Based on the first candidate node, according to the second operation, a lock completion message is sent to the second candidate node among the other nodes, and the bitmap in the second candidate node is initialized.

[0056] Optionally, if the initial operation corresponding to the target node is completed, based on the target node and according to the second operation, a lock completion message for the data to be processed is sent to the first alternative node, thereby notifying the first alternative node that the lock corresponding to the data to be processed has been acquired, and the bitmap of the volume space corresponding to the data to be processed in the first alternative node is initialized, and the bits of the bitmap are set to 0.

[0057] Next, after the initial operation corresponding to the first candidate node is completed, based on the first candidate node and according to the second operation, a lock completion message for the data to be processed is sent to the second candidate node, thereby notifying the second candidate node that the lock corresponding to the data to be processed has been acquired, and the bitmap of the volume space corresponding to the data to be processed in the second candidate node is initialized by setting the bits of the bitmap to 0.

[0058] The method provided in this embodiment initializes each node in a node mirror with different numbers of nodes, locks the master node at a granular level, sends a lock completion message to the alternative nodes, and initializes the bitmap. This ensures that only one IO write operation based on the same granularity is allowed at a time, thereby guaranteeing the accuracy and consistency of data processing between nodes during remote replication. This ensures the data consistency and accuracy between the slave cluster and the master cluster, and improves data storage performance.

[0059] In some embodiments, when the target node is determined to be the master node based on the node type, the step of updating each node within the mirror pair further includes: Determining the update operation corresponding to the target node includes the third operation; determining the initial operation corresponding to other nodes includes the fourth operation. According to the third operation, the lock is released in the volume space corresponding to the data to be processed in the target node, and the bitmap of the initialized volume space corresponding to the data to be processed in the target node is updated. Once the update operation corresponding to the target node is confirmed to be completed, based on the target node and according to the fourth operation, lock release messages are sent to other nodes and the initialized bitmaps in other nodes are updated.

[0060] Optionally, when determining the target node as the master node, determining the update operation corresponding to the target node includes a third operation, and the update operations corresponding to other nodes include a fourth operation.

[0061] Furthermore, the steps for updating each node within a node mirror can be as follows: According to the third operation, the lock is released in the target node, that is, the lock is released in the volume space corresponding to the data to be processed. After the lock is released successfully, the bitmap of the volume space corresponding to the data to be processed in the target node is updated according to the processing status of the target node's IO, that is, whether the processing is successful or failed.

[0062] Once the update operation on the target node is completed, the fourth operation is performed on other nodes based on the target node. Specifically, a lock release message is sent to other nodes for them to receive the lock release message, and the bitmap is updated. Various intermediate information generated by the IO process is also cleared. After the update operation is completed, a message indicating that the update operation is completed is returned to the target node. After the target node receives the message indicating that the update operation is completed from all other nodes, the lock release process is considered to have ended, and the entire IO process is considered to be complete.

[0063] It should be noted that the number of nodes included in a node mirror pair can be 2 or 3. That is, when the target node is the master node, the other nodes can include 1 or 2 alternative nodes.

[0064] In some embodiments, when the number of nodes in a node mirror pair is two, and the other nodes include only one candidate node, the steps for updating the candidate node are as follows: When the update operation corresponding to the target node is completed, a fourth operation can be performed on the candidate node based on the target node. Specifically, a lock release message is sent to the candidate node so that the candidate node can receive the lock release message, update the bitmap, and clear various intermediate information generated by the IO process. After the update operation is completed, a message indicating that the update operation is completed is returned to the target node. After receiving update operation completion messages from all other nodes based on the target node, the lock release process is determined to be over, and the entire IO process is determined to be complete.

[0065] In some embodiments, when a node mirror pair includes three nodes, the other nodes include a first alternative node and a second alternative node. The update operations for the first alternative node and the second alternative node are as follows: Based on the target node, according to the fourth operation, a lock release message is sent to the first candidate node among the other nodes, and the initialized bitmap in the first candidate node is updated; If the update operation corresponding to the first candidate node is completed, based on the first candidate node, according to the fourth operation, a lock release message is sent to the second candidate node among the other nodes, and the initialized bitmap in the second candidate node is updated.

[0066] Optionally, after the update operation corresponding to the target node is completed, based on the target node and according to the fourth operation, a lock release message is sent to the first alternative node so that the first alternative node can receive the lock release message, update the bitmap, and clear various intermediate information generated by the IO processing.

[0067] Next, after the update operation corresponding to the first alternative node is completed, based on the first alternative node, according to the fourth operation, a lock release message is sent to the second alternative node, so that the second alternative node can receive the lock release message, update the bitmap, and clear various intermediate information generated by the IO process. After the update operation is completed, a message indicating that the update operation is completed is returned to the target node. After the target node receives the message indicating that the update operation is completed returned by the second alternative node, the lock release process is determined to be over, and the entire IO process is determined to be complete.

[0068] The method provided in this embodiment updates each node in a node mirror with different numbers of nodes. It releases the lock on the master node and sends the lock release to the alternative nodes, as well as updating the bitmap, in order to ensure the accuracy and consistency of data processing between nodes during remote replication. This ensures the data consistency and accuracy between the auxiliary cluster and the master cluster, and improves data storage performance.

[0069] Figure 3 The diagram shown is one of the timing diagrams illustrating the interaction between the target node and other nodes provided in this embodiment; as shown... Figure 3 As shown, for a target node as the primary node, and a node mirror pair including two nodes, with other nodes including one backup node, i.e., a multi-controller storage system performing remote replication with two replicas, the specific data processing flow is as follows: First, receive I / O based on the target node; Next, acquire the lock in the target node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target node to 0; Next, the target node sends a lock acquisition completion message for the data to be processed to the candidate nodes (i.e., other nodes) to notify the candidate nodes that the lock corresponding to the data to be processed has been acquired. Next, initialize the bitmap of the volume space corresponding to the data to be processed in the candidate node to 0; Next, based on the candidate node, a message indicating that the initialization operation is complete is returned to the target node, thus confirming that the IO lock has been successfully acquired; Next, the target node issues IO locally and copies the IO to the alternative node to achieve IO processing; Next, once the IO processing is complete, the lock is released on the target node, and the bitmap of the target node is updated according to the IO processing status. Next, a lock release message is sent to the candidate node based on the target node; Next, the candidate node is updated with a bitmap, and various intermediate information generated by IO processing is cleared. Next, after the update operation is completed, the alternative node returns a message indicating that the update operation has been completed to the target node. Based on the target node receiving the message indicating that the update operation has been completed from the alternative node, the lock-release process is considered to have ended, and the entire IO process is considered to be complete.

[0070] Figure 4 The diagram shown is a second timing illustration of the interaction between the target node and other nodes provided in this embodiment; as shown... Figure 4As shown, for a target node as the master node, and a node mirror pair including three nodes, with other nodes including the first and second backup nodes, i.e., a multi-controller storage system performing three-replica remote replication, the specific data processing flow is as follows: First, receive I / O based on the target node; Next, acquire the lock in the target node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target node to 0; Next, the target node sends a lock acquisition completion message for the data to be processed to the first alternative node, in order to notify the first alternative node that the lock corresponding to the data to be processed has been acquired; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the first candidate node to 0; Next, the first backup node sends a lock acquisition completion message for the data to be processed to the second backup node, in order to notify the second backup node that the lock corresponding to the data to be processed has been acquired; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the second candidate node to 0; Next, the second alternative node returns a message to the target node indicating that the initialization operation is complete, thus confirming that the IO lock has been successfully acquired. Next, the target node issues IO locally and copies the IO to the first and second backup nodes to achieve IO processing; Next, once the IO processing is complete, the lock is released on the target node, and the bitmap of the target node is updated according to the IO processing status. Next, a lock release message is sent to the first alternative node based on the target node; Next, the bitmap of the first candidate node is updated, and various intermediate information generated by the IO process is cleared. Next, a lock release message is sent from the first candidate node to the second candidate node; Next, the bitmap of the second candidate node is updated, and various intermediate information generated by the IO process is cleared. Next, after the update operation is completed, the second alternative node returns a message indicating that the update operation has been completed to the target node. Based on the target node receiving the message indicating that the update operation has been completed from the second alternative node, the lock-release process is considered to have ended, and the entire IO process is considered to be complete.

[0071] In some embodiments, when the target node is determined to be a candidate node based on the node type, the initialization steps for each node within the node mirror pair include: When the target node is determined to be a candidate node based on the node type, the initial operation for determining the target master node among other nodes includes the first operation, and the initial operation for determining the target node includes the second operation. Based on the target node, according to the first operation, the volume space corresponding to the data to be processed is locked in the target master node, and the bitmap of the volume space corresponding to the data to be processed in the target master node is initialized; Once the initial operation corresponding to the target master node is confirmed to be completed, according to the second operation, a locking completion message for the data to be processed is sent to the target node, and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized.

[0072] Optionally, when the target node is a candidate node, the initial operation corresponding to the target node includes the second operation, and the initial operation corresponding to the target master node among other nodes includes the first operation.

[0073] Furthermore, the initialization steps for each node within a node mirror can be as follows: The target node sends a lock acquisition request to the master node. Upon receiving the lock acquisition request, the target master node performs the first operation, which is to lock the volume space corresponding to the data to be processed. After successfully acquiring the lock, the bitmap of the volume space corresponding to the data to be processed in the target master node is set to 0.

[0074] Once the initial operation corresponding to the target master node is confirmed to be completed, a lock completion message for the data to be processed is sent to the target node based on the target master node, and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized to 0.

[0075] It should be noted that the number of nodes included in a node mirror pair can be 2 or 3. That is, when the target node is the master node, the other nodes can include 1 or 2 alternative nodes.

[0076] In some embodiments, when the number of nodes in a node mirror pair is two, and the other nodes only include the target master node, it can be determined that the lock corresponding to the data to be processed has been successfully acquired after the target node initialization operation is completed.

[0077] In some embodiments, when the node mirror pair includes three nodes, the other nodes include the target master node and the target candidate node. After the target node initialization operation is completed, the target candidate node also needs to undergo the following initialization steps: The initial operations corresponding to the target candidate node include the second operation, which involves sending a lock completion message to the target candidate node and initializing the bitmap in the target candidate node based on the target node and according to the second operation.

[0078] Optionally, after the initial operation corresponding to the target node is completed, based on the target node and according to the second operation, a lock acquisition completion message for the data to be processed is sent to the target candidate node. This notifies the target candidate node that the lock corresponding to the data to be processed has been acquired, and the bitmap of the volume space corresponding to the data to be processed in the target candidate node is initialized by setting the bits of the bitmap to 0. If the target node receives the initialization operation completion message returned by the target candidate node, it can be determined that the lock corresponding to the data to be processed has been successfully acquired.

[0079] The method provided in this embodiment initializes each node in a node mirror with different numbers of nodes, locks the master node at a granular level, sends a lock completion message to the alternative nodes, and initializes the bitmap. This ensures that only one IO write operation based on the same granularity is allowed at a time, thereby guaranteeing the accuracy and consistency of data processing between nodes during remote replication. This ensures the data consistency and accuracy between the slave cluster and the master cluster, and improves data storage performance.

[0080] In some embodiments, when the target node is determined to be a candidate node based on the node type, the step of updating each node within the mirror pair further includes: Determining the update operation corresponding to the target node includes the fourth operation, and determining the update operation corresponding to the target master node among other nodes includes the third operation. According to the fourth operation, a lock release message is sent from the target node to the target master node, and the bitmap of the volume space corresponding to the data to be processed in the target node is updated after initialization. Based on the target node, according to the third operation, the lock on the volume space corresponding to the data to be processed is released in the target master node, and the initialized bitmap in the target master node is updated.

[0081] Optionally, when the target node is determined as a candidate node, the update operation corresponding to the target node includes the fourth operation, and the update operation corresponding to the target master node among other nodes includes the third operation.

[0082] Furthermore, the steps for updating each node within a node mirror can be as follows: According to the fourth operation, a lock release message is sent from the target node to the target master node, and the bitmap of the volume space corresponding to the data to be processed in the target node is updated according to the processing status of the target node's IO, i.e., processing success or processing failure. Once the target node update operation is completed, based on the third operation, the target master node responds to the lock release message sent by the target node and releases the lock, that is, releases the lock on the volume space corresponding to the data to be processed. After the lock is successfully released, the bitmap of the volume space corresponding to the data to be processed in the target master node is updated according to the processing status of the target master node's IO, that is, whether the processing is successful or failed.

[0083] It should be noted that the number of nodes included in a node mirror pair can be 2 or 3. That is, when the target node is the master node, the other nodes can include 1 or 2 alternative nodes.

[0084] In some embodiments, when the number of nodes in the node mirror pair is 2, and the other nodes include only one target master node, the target master node and the target node are updated according to the above initialization steps. After the target node receives the message that the target master node update operation is completed, the lock-release process is determined to be over, and the IO processing corresponding to the data to be processed is determined to be completed.

[0085] In some embodiments, when the node mirror pair includes three nodes, the other nodes include a target master node and a target candidate node. Before sending a lock release message to the target master node based on the target node, the following update operation needs to be performed on the target candidate node: The update operation corresponding to the target candidate node includes the fourth operation, which involves sending a lock release message to the target candidate node based on the target node and updating the initialized bitmap in the target candidate node. Once the update operation corresponding to the target candidate node is confirmed to be completed, a lock release message is sent from the target node to the target master node.

[0086] Optionally, after the update operation corresponding to the target node is completed, based on the target node and according to the fourth operation, a lock release message is sent to the target candidate node so that the target candidate node can receive the lock release message, update the bitmap, and clear various intermediate information generated by the IO processing.

[0087] Next, after the update operation corresponding to the target candidate node is completed, that is, after confirming that the target node has received the message from the target candidate node indicating that the update operation has been completed, based on the third operation, the target master node responds to the lock release message sent by the target node and releases the lock, that is, releases the lock on the volume space corresponding to the data to be processed. After the lock is successfully released, the initialized bitmap of the volume space corresponding to the data to be processed in the target master node is updated according to the processing status of the target master node's IO, that is, processing success or processing failure. And after confirming that the target node has received the message from the target master node indicating that the update operation has been completed, the lock release process is considered to have ended, and the IO processing corresponding to the data to be processed is considered complete.

[0088] The method provided in this embodiment updates each node in a node mirror with different numbers of nodes. It releases the lock on the master node and sends the lock release to the alternative nodes, as well as updating the bitmap, in order to ensure the accuracy and consistency of data processing between nodes during remote replication. This ensures the data consistency and accuracy between the auxiliary cluster and the master cluster, and improves data storage performance.

[0089] Figure 5 The diagram shown is the third in the series illustrating the timing of interactions between the target node and other nodes in this embodiment. Figure 5 As shown, when the target node is a candidate node, and the node mirror pair includes two nodes, while other nodes include one target master node, i.e., when the multi-controller storage system performs remote replication between two replicas, the specific data processing flow is as follows: First, receive I / O based on the target node; Next, a lock acquisition request is sent from the target node to the target master node; Next, acquire the lock in the target master node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target master node to 0; Next, a locking completion message for the data to be processed is sent from the target master node to the target node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target node to 0; Next, once the target node initialization operation is confirmed to be complete, the IO lock acquisition is considered successful. Next, the target node issues IO locally and copies the IO to the alternative node to achieve IO processing; Next, once the IO processing is complete, the target node initiates a lock release message and updates its bitmap based on the IO processing status. Next, a lock release message is sent from the target node to the target master node; Next, the target master node performs bitmap updates, clears various intermediate information generated by IO processing, and releases locks; Next, after the update operation is completed, the target master node returns a message indicating that the update operation has been completed to the target node. Based on the target node, after receiving the message indicating that the update operation has been completed from the target master node, the lock-release process is considered to have ended, and the entire IO process is considered to be complete.

[0090] Figure 6 The diagram shown is the fourth in a series illustrating the timing of interactions between the target node and other nodes in this embodiment. Figure 6 As shown, when the target node is a candidate node, and the node mirror pair includes 3 nodes, and the other nodes include the target candidate node and the target master node, i.e., when the multi-controller storage system performs three-replica remote replication, the specific process of data processing is as follows: First, receive I / O based on the target node; Next, a lock acquisition request is sent from the target node to the target master node; Next, acquire the lock in the target master node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target master node to 0; Next, a locking completion message for the data to be processed is sent from the target master node to the target node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target node to 0; Next, a locking completion message for the data to be processed is sent from the target node to the target candidate node; Next, initialize the bitmap of the volume space corresponding to the data to be processed in the target candidate node to 0; Next, once the target node receives a message from the target candidate node indicating that the initialization operation is complete, it is confirmed that the IO lock has been successfully acquired. Next, the target node issues IO locally and copies the IO to other nodes to achieve IO processing; Next, once the IO processing is complete, the target node initiates a lock release message and updates its bitmap based on the IO processing status. Next, the target node sends a lock release message to the target candidate node; Next, the target candidate nodes are updated with bitmaps, and various intermediate information generated by IO processing is cleared. Next, after the update operation is completed, the target candidate node returns a message to the target node indicating that the update operation has been completed. Next, a lock release message is sent from the target node to the target master node; Next, the target master node performs bitmap updates, clears various intermediate information generated by IO processing, and releases locks; Next, after the update operation is completed, the target master node returns a message indicating that the update operation has been completed to the target node. Based on the target node, after receiving the message indicating that the update operation has been completed from the target master node, the lock-release process is considered to have ended, and the entire IO process is considered to be complete.

[0091] The following describes the data processing method provided in this embodiment using specific examples, including: When the remote replication primary volume receives IO, it first determines the node type of the target node receiving the IO, that is, whether the target node is the primary node. If the target node is the primary node, the first operation is performed on the target node itself, which is to acquire a lock in the target node, that is, to lock the volume space corresponding to the data to be processed. After successfully acquiring the lock, the bitmap of the volume space corresponding to the data to be processed in the target node is set to 0.

[0092] Next, based on the target node, the second operation is performed on other nodes in the mirror pair (i.e., candidate nodes), that is, sending a lock acquisition completion message for the data to be processed to other nodes, thereby notifying other nodes that the lock corresponding to the data to be processed has been acquired, and initializing the bitmap of the volume space corresponding to the data to be processed in other nodes by setting the bits of the bitmap to 0. After the initialization operation of other nodes is completed, the initialization operation completion message is returned to the target node, so that the lock acquisition process corresponding to the data to be processed is completed when the target node receives the initialization operation completion messages returned by all other nodes.

[0093] Next, the primary volume begins copying I / O to the secondary volume. After the I / O copy is complete, the I / O is distributed to the corresponding storage space on this side. Specifically, based on the target node in the node mirror pair, I / O is copied to other nodes. After the copy to other nodes is complete, the I / O is distributed to the target node to store the I / O in the volume space corresponding to each node (including the target node and other nodes), thereby enabling the execution of processing instructions on the data to be processed on each node.

[0094] Next, once it is confirmed that the data to be processed has been completed, that is, all nodes have completed the IO processing, the lock release process is initiated.

[0095] Optionally, a third operation is performed on the target node. Specifically, the lock on the volume space corresponding to the data to be processed in the target node is released, and the initialized bitmap of the volume space corresponding to the data to be processed in the target node is modified according to the IO processing status of the target node. If the IO processing is successful, the initialized bitmap is changed from 0 to 1, indicating that the data is synchronized with the volume space corresponding to the data to be processed in the master cluster. If the IO processing fails, the initialized bitmap is kept at 0, indicating that the data is not synchronized with the volume space corresponding to the data to be processed in the master cluster, and the IO is retried. It is then updated to 1 after the IO processing is successful, thereby ensuring the consistency of the data of all nodes with the volume space corresponding to the data to be processed in the master cluster.

[0096] Next, based on the target node, the fourth operation is performed on other nodes, specifically sending lock release messages to other nodes so that they can receive the lock release messages, update the bitmap, and clear various intermediate information generated by the IO process. After the update operation is completed, a message indicating that the update operation is completed is returned to the target node. After the target node receives the message indicating that the update operation is completed from all other nodes, the lock release process is determined to be over, and the entire IO process is determined to be complete.

[0097] If the target node is a candidate node, then the master node is determined from the other nodes. First, a lock message is sent to the master node based on the target node, so that the master node can perform the first operation after receiving the lock message. Specifically, the lock is acquired in the master node, that is, the volume space corresponding to the data to be processed is locked. After successfully acquiring the lock, the bitmap of the volume space corresponding to the data to be processed in the master node is set to 0. Next, the second operation is performed on the target node, or the target node and other alternative nodes. Specifically, the locking completion message is sent to mark the volume space location corresponding to the data to be processed as locked, to prevent other IO processing, and the bitmap of the volume space corresponding to the data to be processed is set to 0.

[0098] After the lock acquisition process corresponding to the data to be processed is completed, the I / O is copied from the target node in the node mirror pair to other nodes. After the copying to other nodes is completed, the I / O is issued in the target node to store the I / O in the volume space corresponding to each node (including the target node and other nodes), thereby realizing the execution of processing instructions on the data to be processed in each node.

[0099] Next, once it is confirmed that the data to be processed has been completed, that is, all nodes have completed the IO processing, the lock release process is initiated.

[0100] Optionally, a fourth operation is performed on the target node or alternative nodes among the target node and other nodes. Specifically, the initialized bitmap of the volume space corresponding to the data to be processed is modified according to the IO processing situation. If the IO processing is successful, the initialized bitmap is changed from 0 to 1, indicating that the data is synchronized with the volume space corresponding to the data to be processed in the master cluster. If the IO processing fails, the initialized bitmap is kept at 0, indicating that the data is not synchronized with the volume space corresponding to the data to be processed in the master cluster, and the IO is retried. It is then updated to 1 after the IO processing is successful. At the same time, a lock release message is sent to the target node so that the master node among other nodes can perform the third operation. Specifically, after receiving the lock release message, the lock is released and the bitmap is modified. After the update operation is completed, a message indicating that the update operation has been completed is sent to the target node. After receiving the update operation completion message from all other nodes based on the target node, the lock release process is determined to be over, and the entire IO processing is determined to be complete.

[0101] The data processing method provided in this embodiment uses locking and unlocking during remote replication IO. Specifically, when locking, the bitmap of each node is marked, and when unlocking, the bitmap of each node is modified. This ensures that the data of the remote replication slave and master are consistent and supports multiple replicas, such as two-replica and three-replica scenarios, to handle data processing scenarios corresponding to multiple types of nodes receiving IO. It has strong applicability.

[0102] The data processing apparatus provided by the present invention is described below. The data processing apparatus described below and the data processing method described above can be referred to each other. For details, please refer to the methods provided in the above embodiments.

[0103] like Figure 7 The diagram shown is a structural schematic of a data processing device provided in this embodiment. The device includes: The determining unit 701 is used to determine the node type of the target node receiving the processing instruction for the data to be processed issued by the host; The first processing unit 702 is used to perform corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node according to the node type and the data to be processed. The second processing unit 703 is used to execute processing instructions on the data to be processed in the target node and other nodes; The third processing unit 704 is used to perform corresponding update operations on the target node and other nodes according to the node type and the data to be processed, after determining that the data to be processed has been processed. The corresponding initial operations include either the first operation or the second operation. The first operation includes a locking operation and a bitmap initialization operation. The second operation includes a locking completion message sending operation and a bitmap initialization operation. The corresponding update operations include either the third operation or the fourth operation. The third operation includes a lock release operation and a bitmap update operation. The fourth operation includes a lock release message sending operation and a bitmap update operation.

[0104] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804. The processor 801 can call logical instructions in the memory 803 to execute a data processing method, which includes: determining the node type of the target node receiving the processing instructions for the data to be processed from the host; performing corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node according to the node type and the data to be processed; executing the processing instructions for the data to be processed on the target node and other nodes; and, if it is determined that the processing of the data to be processed is complete, performing corresponding update operations on the target node and other nodes according to the node type and the data to be processed. The corresponding initial operations include a first operation or a second operation, the first operation including a locking operation and a bitmap initialization operation, and the second operation including a lock completion message sending operation and a bitmap initialization operation. The corresponding update operations include a third operation or a fourth operation, the third operation including a lock release operation and a bitmap update operation, and the fourth operation including a lock release message sending operation and a bitmap update operation.

[0105] Furthermore, the logical instructions in the aforementioned memory 803 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data processing methods provided by the above methods. The method includes: determining the node type of the target node receiving the processing instruction for the data to be processed issued by the host; performing corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node according to the node type and the data to be processed; executing the processing instruction for the data to be processed on the target node and other nodes; and, if it is determined that the processing of the data to be processed is complete, performing corresponding update operations on the target node and other nodes according to the node type and the data to be processed. The corresponding initial operations include a first operation or a second operation, the first operation including a locking operation and a bitmap initialization operation, the second operation including a lock completion message sending operation and a bitmap initialization operation; and the corresponding update operations include a third operation or a fourth operation, the third operation including a lock release operation and a bitmap update operation, and the fourth operation including a lock release message sending operation and a bitmap update operation.

[0107] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the data processing methods provided by the above methods. The method includes: determining the node type of the target node receiving a processing instruction for data to be processed from a host; performing corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node according to the node type and the data to be processed; executing the processing instruction for the data to be processed on the target node and other nodes; and, upon determining that the processing of the data to be processed is complete, performing corresponding update operations on the target node and other nodes according to the node type and the data to be processed. The corresponding initial operations include a first operation or a second operation, the first operation including a locking operation and a bitmap initialization operation, and the second operation including a lock completion message sending operation and a bitmap initialization operation; the corresponding update operations include a third operation or a fourth operation, the third operation including a lock release operation and a bitmap update operation, and the fourth operation including a lock release message sending operation and a bitmap update operation.

[0108] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data processing method, characterized in that, Applied to node mirror pairs, including: Determine the node type of the target node for receiving the processing instructions for the data to be processed from the host. Based on the node type and the data to be processed, perform corresponding initial operations on the target node and the other nodes in the node mirror pair, excluding the target node. Upon completion of the initial operation, the processing instructions are executed on the data to be processed in the target node and the other nodes. Once it is determined that the data to be processed has been processed, corresponding update operations are performed on the target node and the other nodes according to the node type and the data to be processed. The step of performing corresponding initial operations on the target node and other nodes in the node mirror pair, excluding the target node, based on the node type and the data to be processed includes: When the target node is determined to be the master node based on the node type, the initial operation corresponding to the target node includes a first operation, and the initial operation corresponding to the other nodes includes a second operation. According to the first operation, the volume space corresponding to the data to be processed is locked in the target node and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized; If the initial operation corresponding to the target node is determined to be completed, based on the target node and according to the second operation, a locking completion message for the data to be processed is sent to the other nodes and the bitmap of the volume space corresponding to the data to be processed in the other nodes is initialized; The step of performing corresponding update operations on the target node and the other nodes according to the node type and the data to be processed includes: When the target node is determined to be the master node based on the node type, the update operation corresponding to the target node includes a third operation, and the update operation corresponding to the other nodes includes a fourth operation. According to the third operation, in the target node, the lock on the volume space corresponding to the data to be processed is released and the bitmap of the initialized volume space corresponding to the data to be processed in the target node is updated; If the update operation corresponding to the target node is determined to be completed, based on the target node and according to the fourth operation, a lock release message is sent to the other nodes and the initialized bitmap in the other nodes is updated.

2. The data processing method according to claim 1, characterized in that, Based on the target node, according to the second operation, sending the locking completion message of the data to be processed to the other nodes and initializing the bitmap of the volume space corresponding to the data to be processed in the other nodes includes: In the case where the node mirror pair includes three nodes, based on the target node, according to the second operation, the locking completion message is sent to the first candidate node among the other nodes and the bitmap in the first candidate node is initialized; Based on the first candidate node, according to the second operation, the locking completion message is sent to the second candidate node among the other nodes, and the bitmap in the second candidate node is initialized.

3. The data processing method according to claim 1, characterized in that, Based on the target node, according to the fourth operation, sending the lock release message to the other nodes and updating the initialized bitmap in the other nodes includes: In the case where the node mirror pair includes three nodes, based on the target node, according to the fourth operation, the lock release message is sent to the first candidate node among the other nodes and the initialized bitmap in the first candidate node is updated; If it is determined that the update operation corresponding to the first candidate node has been completed, based on the first candidate node, according to the fourth operation, the lock release message is sent to the second candidate node among the other nodes, and the initialized bitmap in the second candidate node is updated.

4. The data processing method according to claim 1, characterized in that, The step of performing corresponding initial operations on the target node and other nodes in the node mirror pair, excluding the target node, based on the node type and the data to be processed includes: When the target node is determined to be a candidate node based on the node type, the initial operation corresponding to the target master node among the other nodes includes the first operation, and the initial operation corresponding to the target node includes the second operation. Based on the target node, according to the first operation, the volume space corresponding to the data to be processed is locked in the target master node and the bitmap of the volume space corresponding to the data to be processed in the target master node is initialized; If the initial operation corresponding to the target master node is completed, according to the second operation, a locking completion message for the data to be processed is sent to the target node, and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized.

5. The data processing method according to claim 4, characterized in that, After sending the lock completion message for the data to be processed to the target node and initializing the bitmap of the volume space corresponding to the data to be processed in the target node, the method further includes: In the case that the node mirror pair includes three nodes, it is determined that the other nodes also include the target candidate node; The initial operation corresponding to the target candidate node includes the second operation, which involves sending the locking completion message to the target candidate node and initializing the bitmap in the target candidate node based on the target node and according to the second operation.

6. The data processing method according to claim 1, characterized in that, The step of performing corresponding update operations on the target node and the other nodes according to the node type and the data to be processed includes: When the target node is determined to be a candidate node based on the node type, the update operation corresponding to the target node includes the fourth operation, and the update operation corresponding to the target master node among the other nodes includes the third operation; According to the fourth operation, a lock release message is sent from the target node to the target master node, and the bitmap of the volume space corresponding to the data to be processed in the target node is updated after initialization. According to the third operation, the lock on the volume space corresponding to the data to be processed is released in the target master node, and the initialized bitmap in the target master node is updated.

7. The data processing method according to claim 6, characterized in that, Sending a lock release message from the target node to the target master node includes: In the case that the node mirror pair includes three nodes, it is determined that the other nodes also include the target candidate node; The update operation corresponding to the target candidate node includes the fourth operation, which involves sending the lock release message to the target candidate node based on the target node and updating the initialized bitmap in the target candidate node according to the fourth operation; If the update operation corresponding to the target candidate node is determined to be completed, the lock release message is sent from the target node to the target master node.

8. A data processing apparatus, characterized in that, Applied to node mirror pairs, including: The determining unit is used to determine the node type of the target node receiving the processing instruction for the data to be processed from the host. The first processing unit is configured to perform corresponding initial operations on the target node and other nodes in the node mirror pair other than the target node, according to the node type and the data to be processed. The second processing unit is configured to execute the processing instructions on the data to be processed in the target node and the other nodes after the initial operation has been completed. The third processing unit is used to perform corresponding update operations on the target node and the other nodes according to the node type and the data to be processed, when it is determined that the data to be processed has been processed. The first processing unit is specifically used for: When the target node is determined to be the master node based on the node type, the initial operation corresponding to the target node includes a first operation, and the initial operation corresponding to the other nodes includes a second operation. According to the first operation, the volume space corresponding to the data to be processed is locked in the target node and the bitmap of the volume space corresponding to the data to be processed in the target node is initialized; If the initial operation corresponding to the target node is determined to be completed, based on the target node and according to the second operation, a locking completion message for the data to be processed is sent to the other nodes and the bitmap of the volume space corresponding to the data to be processed in the other nodes is initialized; The third processing unit is specifically used for: When the target node is determined to be the master node based on the node type, the update operation corresponding to the target node includes a third operation, and the update operation corresponding to the other nodes includes a fourth operation. According to the third operation, in the target node, the lock on the volume space corresponding to the data to be processed is released and the bitmap of the initialized volume space corresponding to the data to be processed in the target node is updated; If the update operation corresponding to the target node is determined to be completed, based on the target node and according to the fourth operation, a lock release message is sent to the other nodes and the initialized bitmap in the other nodes is updated.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the data processing method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data processing method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Target-driven independent data integrity and redundancy recovery in a shared-nothing distributed storage system

    CN105659213A

  • Data storage method, device and system, electronic equipment and storage medium

    CN115268776A