Data deduplication method and device, equipment and medium

By simultaneously writing data blocks and check blocks in a four-controller disk array, and using hash values ​​to determine whether the same data blocks exist in the target controller, the problem of low data deduplication efficiency and high cost is solved, and data consistency is achieved. Improved performance and efficiency, avoiding performance degradation caused by the locking mechanism.

CN118778904APending Publication Date: 2024-10-15INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411030539.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The existing technology is inefficient and costly during the data deduplication process. Especially in four-control disk arrays, frequent data synchronization and locking operations are required, resulting in performance bottlenecks and rising costs.

Method used

By simultaneously writing data blocks and check blocks in a four-control disk array, and using hash values ​​to determine whether the same data blocks exist in the target controller, if so, the original data blocks are discarded, and only the logical block address mapping relationship is established. Avoid redundant writes, reduce costs and increase efficiency.

Benefits of technology

It achieves the guarantee of data consistency without the need for a locking mechanism, reduces the cost of data deduplication, avoids performance degradation caused by the locking mechanism, improves the efficiency of data deduplication, and saves storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778904A_ABST
    Figure CN118778904A_ABST
Patent Text Reader

Abstract

The invention discloses a data deduplication method, device and equipment and a medium, relates to the technical field of storage, is applied to any controller in a four-control disk array, and comprises the following steps: determining a local first target data block, and obtaining a target verification block; writing the first target data block and the target verification block into a local target disk at the same time; generating first target metadata of the first target data block and a data synchronization request, and sending the data synchronization request to a target controller; if a first request reply fed back by the target controller for the data synchronization request is received, sending the first target metadata to the target controller, and judging whether a second target data block which is the same as the first data block exists in the target controller or not through the target controller by utilizing the target verification block and the first target metadata, and if yes, discarding the first target metadata, and establishing a mapping relationship between the target logic block address of the second target data block and the first target data block. The data deduplication efficiency is improved; and the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a data deduplication method, device, equipment and medium. Background Art

[0002] With the continuous development of computer control technology, the synchronization of multiple controller nodes in data deduplication has attracted increasing attention. The goal of the synchronization algorithm is to ensure that different controller nodes maintain consistency in time, data or status, so as to achieve coordinated operation of the entire system. Circular mirroring is a data mirroring relationship established between multiple storage nodes, in which each node serves as the mirror source and target of other nodes. In circular mirroring, data modifications will be propagated to all nodes participating in the mirroring at the same time, forming a closed-loop data replication and synchronization process.

[0003] The Paxos algorithm can ensure that each node in a distributed system can safely and reliably reach a consensus on a certain value, thereby ensuring the consistency and reliability of the distributed system. However, since the Paxos algorithm needs to arrange each controller and then synchronize data in sequence, the efficiency is low. Furthermore, in a storage system, when a data block is modified, locking can prevent other processes or transactions from accessing or modifying the data block at the same time until the first process or transaction completes its operation and releases the lock, thereby ensuring the consistency and integrity of the data. However, the multiple controllers of the four-controller disk array already make the cost high. If a locking mechanism is introduced, the cost will increase and the performance may be reduced due to contention conditions.

[0004] It can be seen that how to improve the efficiency of data deduplication and reduce its cost is a problem that technical personnel in this field need to solve. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a data deduplication method, apparatus, device and medium, which can improve the efficiency of data deduplication and reduce its cost. The specific scheme is as follows:

[0006] In a first aspect, the present invention discloses a data deduplication method, which is applied to any controller in a four-controller disk array, comprising:

[0007] Determine a local first target data block, and obtain a target check block based on the first target data block;

[0008] Writing the first target data block and the target check block into a local target disk simultaneously;

[0009] Generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array;

[0010] If a first request reply is received from the target controller in response to the data synchronization request, the first target metadata is sent to the target controller so that the target check block is read from the target disk through the target controller, and the target check block and the first target metadata are used to determine whether a second target data block exists in the target controller. If so, the first target metadata is discarded, and a mapping relationship between the target logical block address of the second target data block and the first target data block is established; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0011] Optionally, determining a local first target data block and acquiring a target check block based on the first target data block includes:

[0012] Determine a target physical block address from each locally idle physical block address, and use the target physical block address as a first target data block;

[0013] The data read from the historical data block is saved to the first target data block, and the historical data block and the first target data block are calculated to obtain a verification intermediate value;

[0014] The historical check block and the check intermediate value are calculated to obtain check data, and the target check block is obtained based on the check data.

[0015] Optionally, the calculating the historical data block and the first target data block to obtain a verification intermediate value includes:

[0016] Performing bit-by-bit XOR calculation on each data of the historical data block and each data of the target data block, so as to obtain a verification intermediate value according to the XOR result of each data;

[0017] Accordingly, the historical check block and the check intermediate value are calculated to obtain the check data, including:

[0018] The XOR calculation is performed bit by bit on each data of the historical check block and each data of the check intermediate value, so as to obtain the check data according to the XOR result of each data.

[0019] Optionally, if a first request reply fed back by the target controller for the data synchronization request is received, sending the first target metadata to the target controller includes:

[0020] Monitoring whether a first request response fed back by the target controller in response to the data synchronization request is currently received;

[0021] If the first request reply is received and the data synchronization request sent by the target controller is not received, the first target metadata is sent to the target controller; if the first request reply and the data synchronization request sent by the target controller are received, the first target metadata is sent to the target controller and the data synchronization request sent by the target controller is suspended;

[0022] If the first request reply is not received and a data synchronization request sent by the target controller is received, generating a second request reply for the data synchronization request sent by the target controller, and feeding back the second request reply to the target controller, so as to receive metadata fed back by the target controller based on the second request reply;

[0023] If the data synchronization request sent by the target controller is not received currently, the process jumps again to the step of monitoring whether a first request reply fed back by the target controller for the data synchronization request is received currently.

[0024] Optionally, the first target metadata is a first target hash value of the first target data block;

[0025] Correspondingly, the target controller reads the target check block from the target disk, and uses the target check block and the first target metadata to determine whether the second target data block exists in the target controller, and if so, discards the first target metadata, including:

[0026] The target controller reads the target check block from the target disk, and searches out a second target hash value that is the same as the first target hash value and a pending data block corresponding to the second target hash value from each hash value of the target controller, and verifies the target check block and the pending data block. If the verification passes, the pending data block is determined to be the second target data block, and the first target metadata is discarded.

[0027] Optionally, each controller in the four-controller disk array is connected via a high-speed serial computer expansion bus standard;

[0028] The sending the data synchronization request to the target controller includes:

[0029] sending the data synchronization request to a target controller via the high-speed serial computer expansion bus standard;

[0030] Correspondingly, if a first request reply fed back by the target controller for the data synchronization request is received, sending the first target metadata to the target controller includes:

[0031] If a first request reply fed back by the target controller to the data synchronization request is received through the high-speed serial computer expansion bus standard, the first target metadata is sent to the target controller through the high-speed serial computer expansion bus standard.

[0032] Optionally, the data deduplication method further includes:

[0033] Monitor whether the current configuration information has changed;

[0034] If the current configuration information is monitored to change, the execution order of synchronizing the first target metadata is determined; wherein the synchronization execution order is the data synchronization order of each controller in the four-controller disk array determined by a data consistency algorithm;

[0035] The first target metadata is synchronized to the target controller according to the execution order.

[0036] In a second aspect, the present invention discloses a data deduplication device, which is applied to any controller in a four-controller disk array, and comprises:

[0037] A generating module, configured to determine a local first target data block, and obtain a target check block based on the first target data block;

[0038] A writing module, used for writing the first target data block and the target check block into a local target disk at the same time;

[0039] a sending module, configured to generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array;

[0040] A synchronization module, for, upon receiving a first request reply from the target controller in response to the data synchronization request, sending the first target metadata to the target controller, so as to read the target check block from the target disk through the target controller, and using the target check block and the first target metadata to determine whether a second target data block exists in the target controller, and if so, discarding the first target metadata, and establishing a mapping relationship between a target logical block address of the second target data block and the first target data block; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0041] In a third aspect, the present invention discloses an electronic device, comprising:

[0042] Memory, used to store computer programs;

[0043] The processor is used to execute the computer program to implement the steps of the aforementioned disclosed data deduplication method.

[0044] In a fourth aspect, the present invention discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed data deduplication method are implemented.

[0045] It can be seen that the present invention is applied to any controller in a four-controller disk array, including: determining a local first target data block, and obtaining a target check block based on the first target data block; writing the first target data block and the target check block into the local target disk at the same time; generating a first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and sending the data synchronization request to the target controller; wherein the target controller is another controller in the four-controller disk array; if a first request reply fed back by the target controller for the data synchronization request is received, the first target metadata is sent to the target controller, so as to read the target check block from the target disk through the target controller, and use the target check block and the first target metadata to determine whether there is a second target data block in the target controller, if so, discard the first target metadata, and establish a mapping relationship between the target logical block address of the second target data block and the first target data block; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0046] Beneficial effect: The present invention writes the first target data block and the target check block into the target disk of the four-controller disk array at the same time. In this way, the data of the check block in the target disk will not be inaccurate due to the fact that the data block is written but the check block is not written, that is, the consistency of the data is guaranteed, and there is no need to introduce a locking mechanism, thereby reducing the cost of data deduplication and avoiding the performance degradation caused by the contention condition of the locking mechanism; further, in the process of synchronizing the first target metadata to the target controller, if a first request reply is received from the target controller for the data synchronization request, the metadata synchronization request initiated locally is processed, which can reduce the time spent on determining the master controller, the slave controller and the processing order by using the Paxos algorithm, thereby improving the efficiency of data deduplication; the target controller uses the target check block and the first target metadata read from the target disk to determine whether there is a second target data block in the target controller that stores the same data as the first target data block. If so, there is no need to rewrite the first target data block at this time to avoid data redundancy and save storage space, that is, to achieve data deduplication, it is only necessary to establish a mapping relationship between the target logical block address and the first target data block. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 A data deduplication flow chart provided by an embodiment of the present invention;

[0049] Figure 2 A specific task execution diagram provided by an embodiment of the present invention;

[0050] Figure 3 A specific controller communication schematic diagram provided for an embodiment of the present invention;

[0051] Figure 4 A specific data deduplication flow chart provided by an embodiment of the present invention;

[0052] Figure 5 A schematic diagram of the structure of a data deduplication device provided by an embodiment of the present invention;

[0053] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0056] With the continuous development of computer control technology, the synchronization of multiple controller nodes in data deduplication has attracted increasing attention. The goal of the synchronization algorithm is to ensure that different controller nodes maintain consistency in time, data or status, so as to achieve coordinated operation of the entire system. Circular mirroring is a data mirroring relationship established between multiple storage nodes, in which each node serves as the mirror source and target of other nodes. In circular mirroring, data modifications will be propagated to all nodes participating in the mirroring at the same time, forming a closed-loop data replication and synchronization process.

[0057] The Paxos algorithm can ensure that each node in a distributed system can safely and reliably reach a consensus on a certain value, thereby ensuring the consistency and reliability of the distributed system. However, since the Paxos algorithm needs to arrange each controller and then synchronize data in sequence, the efficiency is low.

[0058] Furthermore, in a storage system, when a data block is modified, locking can prevent other processes or transactions from accessing or modifying the data block at the same time until the first process or transaction completes its operation and releases the lock. Controller stripe-level locking involves coordinating access to data blocks between multiple controllers to ensure that there is no conflict. However, both the four-controller disk array and the locking mechanism increase the complexity of the system. More controllers mean more coordination and synchronization, while the locking mechanism needs to deal with issues such as concurrency control and deadlock. Four-controller disk arrays are usually more expensive than single-controller or dual-controller systems. In addition, the locking mechanism may require additional hardware or software support, thereby increasing the overall cost. Although four-controller disk arrays can improve performance, in some cases, coordination and synchronization between controllers may become a performance bottleneck. Similarly, the locking mechanism may also cause contention conditions, thereby reducing performance. As storage needs grow, more disks or controllers may need to be added. However, the locking mechanism may also need to be adjusted to accommodate larger data sets and higher concurrency.

[0059] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0060] Next, a data deduplication solution provided by an embodiment of the present invention is introduced in detail. Figure 1 A data deduplication method provided in an embodiment of the present invention is applied to any controller in a four-controller disk array. The method includes:

[0061] Step S11: determine a local first target data block, and obtain a target check block based on the first target data block.

[0062] The four-controller disk array uses four controllers, each of which can manage a part of the disks. The disks contain multiple data blocks and check blocks to achieve data storage. When there is data that needs to be written locally, the target physical block address is first determined from each local free physical block address (Physical Block Address, PBA), and then the data is written to the target physical block address to obtain the first target data block, and the target check block is obtained based on the first target data block.

[0063] In this embodiment, each controller in the four-controller disk array is connected via a high-speed serial computer expansion bus standard. Each controller is connected via a high-speed serial computer expansion bus standard (peripheral component interconnect express, i.e. PCIE), that is, PCIE is used as a channel for realizing communication between any controllers. On this channel, the controller's message sending and receiving is realized through the async module inside the RAID (Redundant Array of Independent Disks).

[0064] Step S12: writing the first target data block and the target check block into the local target disk simultaneously.

[0065] When the controllers in a four-controller disk array do not use stripe locks for protection, a non-writing controller may read old verification data when reading data. The specific scenario may be: controller A has completed writing the data block for a stripe but has not completed writing the verification block; controllers B, C, and D read the old verification block when reading data. In this case, the data for the scenario where data is reconstructed using the old verification block is incorrect. Therefore, it is necessary to ensure that the verification blocks read by other controllers in the four-controller disk array are also the latest. To this end, the first target data block and the target verification block are controlled to be written to the local target disk at the same time. In this way, the verification blocks read by other controllers are also the latest, and there will be no inaccurate data in the verification block read from the target disk due to the fact that the data block has been written but the verification block has not been written. This ensures data consistency and does not require the introduction of a locking mechanism, thereby reducing the cost of data deduplication.

[0066] Step S13: Generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array.

[0067] In this embodiment, the first target metadata is the first target hash value of the first target data block. The hash value of the first target data block can be calculated and used as the metadata of the first target data block, that is, the first target hash value of the first target data block is generated, and then a data synchronization request corresponding to the first target hash value is generated, and the data synchronization request is sent to the target controller, that is, the data synchronization request is sent to other controllers in the four-controller disk array, for example, the first target hash value of the first target data block of controller A is generated, and then a data synchronization request corresponding to the first target hash value is generated, and the data synchronization request is sent to controllers B, C, and D.

[0068] In this embodiment, the sending of the data synchronization request to the target controller includes: sending the data synchronization request to the target controller through the high-speed serial computer expansion bus standard. The communication between the controllers is realized through the high-speed serial computer expansion bus standard, so the data synchronization request can be sent to the target controller through the high-speed serial computer expansion bus standard, for example, controller A sends the data synchronization request to the target controller through the high-speed serial computer expansion bus standard. It can be understood that any controller as the current node can send the data synchronization request to the other three nodes, namely controllers B, C, and D, at the same time through the high-speed serial computer expansion bus standard.

[0069] Step S14: If a first request reply is received from the target controller in response to the data synchronization request, the first target metadata is sent to the target controller so that the target check block is read from the target disk through the target controller, and the target check block and the first target metadata are used to determine whether a second target data block exists in the target controller. If so, the first target metadata is discarded, and a mapping relationship between the target logical block address of the second target data block and the first target data block is established; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0070] In this embodiment, if a first request reply is received from the target controller for the data synchronization request, the first target metadata is sent to the target controller, including: monitoring whether the first request reply is currently received from the target controller for the data synchronization request; if the first request reply is received and the data synchronization request sent by the target controller is not received, the first target metadata is sent to the target controller; if the first request reply and the data synchronization request sent by the target controller are received, the first target metadata is sent to the target controller, and the data synchronization request sent by the target controller is suspended; if the first request reply is not received and the data synchronization request sent by the target controller is received, a second request reply is generated for the data synchronization request sent by the target controller, and the second request reply is fed back to the target controller so as to receive the metadata fed back by the target controller based on the second request reply; if the data synchronization request sent by the target controller is not currently received, the step of jumping back to the step of monitoring whether the first request reply is currently received from the target controller for the data synchronization request.

[0071] The data synchronization initiated locally is regarded as a local task, and the request received from other controllers is regarded as a remote request. In order to make the local determine how to execute the local task and the remote request, the processing order is specified, as described in Table 1:

[0072] Table 1

[0073]

[0074] The processing order is as follows Figure 2 A specific task execution diagram is shown in FIG. 1 . This embodiment proposes a communication control model between controllers, which includes Figure 2The state relationship in the middle, through these states and state transition relationships, controls the message processing of the four controllers. Specifically, when local data synchronization is required, first send a data synchronization request to the target controller, that is, start a local task. For the target controller that receives the data synchronization request, it is equivalent to receiving a task request, that is, the local task is now in the remote stage, and real-time monitoring is performed to determine whether the first request response to the data synchronization request feedback from the target controller is received. At this time, it is mainly divided into three major situations:

[0075] 1) If the first request reply is received and the data synchronization request sent by the target controller is not received, the first target metadata is sent to the target controller; specifically, if the first request reply is received, a remote request is completed for the target controller, and then the first request reply is fed back to the local, and when the local receives the first request reply and does not receive the data synchronization request sent by the target controller, the first target metadata is sent to the target controller, so that the target controller receives the first target metadata to achieve data synchronization, that is, the local task is executed in the remote stage;

[0076] 2) If the first request reply and the data synchronization request sent by the target controller are received, the first target metadata is sent to the target controller, and the data synchronization request sent by the target controller is suspended; specifically, if the first request reply is received, a remote request is completed for the target controller, and then the first request reply is fed back to the local, and if the data synchronization request sent by the target controller is also received locally, it means that the local has received the remote request. At this time, the local task initiated by the local is processed first, that is, the first target metadata is sent to the target controller, and the data synchronization request sent by the target controller is suspended, and the data synchronization request sent by the target controller is processed after the first target metadata is sent.

[0077] 3) If the first request reply is not received:

[0078] 3.1) If the first request reply is not received and a data synchronization request sent by the target controller is received, a second request reply is generated for the data synchronization request sent by the target controller, and the second request reply is fed back to the target controller so as to receive metadata fed back by the target controller based on the second request reply; specifically, if the first request reply is not received, it means that the target controller has not completed the remote request initiated locally, but the data synchronization request sent by the target controller is received, which means that the remote request is received locally, then a second request reply is preferentially generated for the data synchronization request sent by the target controller, and the second request reply is fed back to the target controller so as to receive metadata fed back by the target controller based on the second request reply; it can be understood that if a first request reply is received when processing the data synchronization request sent by the target controller, the synchronization task of the first request reply needs to be executed after the data synchronization request sent by the target controller is processed.

[0079] 3.2) If the first request reply is not received and the data synchronization request sent by the target controller is not received, jump again to the step of monitoring whether the first request reply fed back by the target controller for the data synchronization request is received; specifically, if the first request reply is not received, it means that the target controller has not completed the remote request initiated locally, and has not received the data synchronization request sent by the target controller, which means that the remote request has not been received locally, so you only need to continue monitoring.

[0080] In this embodiment, the target controller reads the target check block from the target disk, and uses the target check block and the first target metadata to determine whether there is a second target data block in the target controller. If so, the first target metadata is discarded, including: the target controller reads the target check block from the target disk, and searches for a second target hash value that is the same as the first target hash value and a pending data block corresponding to the second target hash value from each hash value of the target controller, and verifies the target check block and the pending data block. If the verification passes, the pending data block is determined to be the second target data block, and the first target metadata is discarded. It can be understood that if the metadata of two data blocks are the same, and the verification result of one of the data blocks is characterized by passing the verification, it means that the data stored in the two data blocks are the same, that is, the target controller reads the target verification block from the target disk, and finds the second target hash value that is the same as the first target hash value and the pending data block corresponding to the second target hash value from each hash value of the target controller, and verifies the target verification block and the pending data block. If the verification passes, it is determined that the data stored in the pending data block is the same as the data stored in the first target data block, that is, the pending data block is the second target data block, so there is no need to write the first target data block to the target controller, and the first target metadata can be discarded to avoid data redundancy and save storage space, that is, to achieve data deduplication, and it is only necessary to establish a mapping relationship between the target logical block address (Logical Block Address, i.e. LBA) and the first target data block.

[0081] In this embodiment, if a first request reply to the data synchronization request fed back by the target controller is received, the first target metadata is sent to the target controller, including: if a first request reply to the data synchronization request fed back by the target controller is received via the high-speed serial computer expansion bus standard, the first target metadata is sent to the target controller via the high-speed serial computer expansion bus standard. For example Figure 3 A specific controller communication diagram is shown, in which each controller communicates through a high-speed serial computer expansion bus standard. Therefore, if a first request reply is received from the target controller for the data synchronization request feedback through the high-speed serial computer expansion bus standard, the first target metadata is sent to the target controller through the high-speed serial computer expansion bus standard. In other words, the high-speed serial computer expansion bus standard is used as a channel for receiving and sending messages.

[0082] In this embodiment, it also includes: monitoring whether the current configuration information has changed; if the current configuration information is monitored to have changed, then determining the execution order of synchronizing the first target metadata; wherein the synchronization execution order is the data synchronization order of each controller in the four-controller disk array determined by the data consistency algorithm; synchronizing the first target metadata to the target controller according to the execution order. Further, when the configuration information changes during the communication process, in order to ensure that the metadata can be correctly synchronized to other controllers, the message is synchronized to each controller through the cluster event, firstly the order of the message is determined by the data consistency algorithm, and according to the determined message order, the message is sent to each controller, each controller processes the same message at the same time, and the data is synchronized to each controller; for example, the order of data synchronization determined by the data consistency algorithm is controller B, controller C, controller A, controller D, that is, each controller first realizes the data synchronization of controller B, then realizes the data synchronization of controller C, realizes the data synchronization of controller A, and finally realizes the data synchronization of controller D; wherein the data consistency algorithm can be the Paxos algorithm.

[0083] In this embodiment, communication between controllers can also be achieved through FC (Fibre Channel). Fibre Channel is a high-bandwidth, low-latency network technology, and the Fibre Channel interface supports multi-protocol transmission, so it has good flexibility and compatibility. In the disk array, the Fibre Channel interface can provide high-speed and reliable data transmission services. Furthermore, when transmitting the first target metadata, the data is organized and transmitted in a specific format, which can handle complex data transmission requirements.

[0084] It can be seen that the present invention is applied to any controller in a four-controller disk array, including: determining a local first target data block, and obtaining a target check block based on the first target data block; writing the first target data block and the target check block into the local target disk at the same time; generating a first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and sending the data synchronization request to the target controller; wherein the target controller is another controller in the four-controller disk array; if a first request reply fed back by the target controller for the data synchronization request is received, the first target metadata is sent to the target controller, so as to read the target check block from the target disk through the target controller, and use the target check block and the first target metadata to determine whether there is a second target data block in the target controller, if so, discard the first target metadata, and establish a mapping relationship between the target logical block address of the second target data block and the first target data block; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0085] Beneficial effect: The present invention writes the first target data block and the target check block into the target disk of the four-controller disk array at the same time. In this way, the data of the check block in the target disk will not be inaccurate due to the fact that the data block is written but the check block is not written, that is, the consistency of the data is guaranteed, and there is no need to introduce a locking mechanism, thereby reducing the cost of data deduplication and avoiding the performance degradation caused by the contention condition of the locking mechanism; further, in the process of synchronizing the first target metadata to the target controller, if a first request reply is received from the target controller for the data synchronization request, the metadata synchronization request initiated locally is processed, which can reduce the time spent on determining the master controller, the slave controller and the processing order by using the Paxos algorithm, thereby improving the efficiency of data deduplication; the target controller uses the target check block and the first target metadata read from the target disk to determine whether there is a second target data block in the target controller that stores the same data as the first target data block. If so, there is no need to rewrite the first target data block at this time to avoid data redundancy and save storage space, that is, to achieve data deduplication, it is only necessary to establish a mapping relationship between the target logical block address and the first target data block.

[0086] See also Figure 4 The embodiment of the present invention discloses a specific data deduplication method, which is applied to any controller in a four-controller disk array. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. The method includes:

[0087] Step S21: determining a target physical block address from each locally idle physical block address, and using the target physical block address as a first target data block.

[0088] A mapping table can be set up locally to record the status of each physical block address, such as idle, used, or in a certain specific management state. According to the mapping table and the specific scenario, the target physical block address is selected from the idle physical block addresses, and the target physical block address is used as the first target data block.

[0089] Step S22: Save the data read from the historical data block to the first target data block, and perform calculations on the historical data block and the first target data block to obtain a verification intermediate value.

[0090] In this embodiment, the calculation of the historical data block and the first target data block to obtain the verification intermediate value includes: performing bit-by-bit XOR calculation on each data of the historical data block and each data of the target data block, so as to obtain the verification intermediate value according to the XOR result of each data. Each data unit in the historical data block and the data unit at the corresponding position in the target data block are taken out, and then an XOR operation is performed on each bit of the two data units. The characteristic of the XOR operation is: the same is 0, and the different is 1. Therefore, if the data of the historical data block and the target data block at a certain specific position are the same, the XOR result is 0; if they are different, the result is 1. This process will traverse all bits until all bits of the two data units are compared and XORed, so as to obtain the verification intermediate value according to the XOR result of each data.

[0091] Step S23: Calculate the historical check block and the check intermediate value to obtain check data, and obtain the target check block based on the check data.

[0092] In this embodiment, the calculation of the historical check block and the check intermediate value to obtain the check data includes: performing bit-by-bit XOR calculation on each data of the historical check block and each data of the check intermediate value, so as to obtain the check data according to the XOR result of each data. It can be understood that when the historical check block and the check intermediate value are XORed, each data of the historical check block and each data of the check intermediate value are also XORed bit-by-bit, so as to obtain the check data according to the XOR result of each data.

[0093] Step S24: writing the first target data block and the target check block into the local target disk simultaneously.

[0094] It should be noted that in order to avoid the situation where the data block is written completely but the check block is not written completely, resulting in inaccurate data in the check block read from the target disk, this embodiment controls the first target data block and the target check block to be written to the local target disk at the same time.

[0095] Step S25: Generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array.

[0096] Step S26: If a first request reply is received from the target controller in response to the data synchronization request, the first target metadata is sent to the target controller so that the target check block is read from the target disk through the target controller, and the target check block and the first target metadata are used to determine whether a second target data block exists in the target controller. If so, the first target metadata is discarded, and a mapping relationship between the target logical block address of the second target data block and the first target data block is established; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0097] Among them, for more specific processing procedures of the above steps S25 and S26, reference can be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0098] It can be seen that the method of obtaining the target check block by the XOR calculation method of the present invention greatly reduces the redundant overhead, and the calculation method is simpler, the computing resources used are less, and the performance of the four-controller disk array is avoided. Furthermore, the first target data block and the target check block are written to the target disk of the four-controller disk array at the same time. In this way, the data of the check block in the target disk will not be inaccurate due to the fact that the data block is written but the check block is not written, thus ensuring the consistency of the data; the order of the controller processing tasks is set to reduce the time spent on determining the main controller, the slave controller and the processing order, thereby improving the efficiency of data deduplication.

[0099] Figure 5 A structural schematic diagram of a data deduplication device provided in an embodiment of the present invention, which is applied to any controller in a four-controller disk array, includes:

[0100] A generating module 11 is used to determine a local first target data block, and obtain a target check block based on the first target data block;

[0101] A writing module 12, used for writing the first target data block and the target check block into a local target disk at the same time;

[0102] A sending module 13 is used to generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array;

[0103] The synchronization module 14 is used to send the first target metadata to the target controller if a first request reply is received from the target controller for the data synchronization request, so as to read the target check block from the target disk through the target controller, and use the target check block and the first target metadata to determine whether there is a second target data block in the target controller. If so, the first target metadata is discarded, and a mapping relationship between the target logical block address of the second target data block and the first target data block is established; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0104] It can be seen that the present invention is applied to any controller in a four-controller disk array, including: determining a local first target data block, and obtaining a target check block based on the first target data block; writing the first target data block and the target check block into the local target disk at the same time; generating a first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and sending the data synchronization request to the target controller; wherein the target controller is another controller in the four-controller disk array; if a first request reply fed back by the target controller for the data synchronization request is received, the first target metadata is sent to the target controller, so as to read the target check block from the target disk through the target controller, and use the target check block and the first target metadata to determine whether there is a second target data block in the target controller, if so, discard the first target metadata, and establish a mapping relationship between the target logical block address of the second target data block and the first target data block; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

[0105] Beneficial effect: The present invention writes the first target data block and the target check block into the target disk of the four-controller disk array at the same time. In this way, the data of the check block in the target disk will not be inaccurate due to the fact that the data block is written but the check block is not written, that is, the consistency of the data is guaranteed, and there is no need to introduce a locking mechanism, thereby reducing the cost of data deduplication and avoiding the performance degradation caused by the contention condition of the locking mechanism; further, in the process of synchronizing the first target metadata to the target controller, if a first request reply is received from the target controller for the data synchronization request, the metadata synchronization request initiated locally is processed, which can reduce the time spent on determining the master controller, the slave controller and the processing order by using the Paxos algorithm, thereby improving the efficiency of data deduplication; the target controller uses the target check block and the first target metadata read from the target disk to determine whether there is a second target data block in the target controller that stores the same data as the first target data block. If so, there is no need to rewrite the first target data block at this time to avoid data redundancy and save storage space, that is, to achieve data deduplication, it is only necessary to establish a mapping relationship between the target logical block address and the first target data block.

[0106] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part refer to the description of the embodiments of the method part, which will not be described here. In addition, the invention has the same beneficial effects as the above-mentioned data deduplication method.

[0107] Figure 6 A structural diagram of an electronic device provided by an embodiment of the present invention, such as Figure 6 As shown, the electronic device includes: a memory 20 for storing a computer program;

[0108] The processor 21 is used to implement the steps of the data deduplication method in the above embodiment when executing a computer program.

[0109] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0110] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0111] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the data deduplication method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to data transmitted by an external device and received by the electronic device, and may also include data collected by its own input and output interface 23, etc.

[0112] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power source 25 , and a communication bus 26 .

[0113] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.

[0114] It is understandable that if the data deduplication method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.

[0115] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data deduplication method are implemented.

[0116] The above is a detailed introduction to a data deduplication method, device, equipment and medium provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0118] The above is a detailed introduction to a data deduplication method, device, equipment and medium provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A data deduplication method, characterized in that: Applicable to any controller in a four-controller disk array, including: Determine a local first target data block, and obtain a target check block based on the first target data block; Writing the first target data block and the target check block into a local target disk simultaneously; Generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array; If a first request reply is received from the target controller in response to the data synchronization request, the first target metadata is sent to the target controller so that the target check block is read from the target disk through the target controller, and the target check block and the first target metadata are used to determine whether a second target data block exists in the target controller. If so, the first target metadata is discarded, and a mapping relationship between the target logical block address of the second target data block and the first target data block is established; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

2. The data deduplication method according to claim 1, characterized in that: The determining of a local first target data block and obtaining a target check block based on the first target data block includes: Determine a target physical block address from each locally idle physical block address, and use the target physical block address as a first target data block; The data read from the historical data block is saved to the first target data block, and the historical data block and the first target data block are calculated to obtain a verification intermediate value; The historical check block and the check intermediate value are calculated to obtain check data, and the target check block is obtained based on the check data.

3. The data deduplication method according to claim 2, characterized in that: The calculating the historical data block and the first target data block to obtain a verification intermediate value includes: Performing bit-by-bit XOR calculation on each data of the historical data block and each data of the target data block, so as to obtain a verification intermediate value according to the XOR result of each data; Accordingly, the historical check block and the check intermediate value are calculated to obtain the check data, including: The XOR calculation is performed bit by bit on each data of the historical check block and each data of the check intermediate value, so as to obtain the check data according to the XOR result of each data.

4. The data deduplication method according to claim 1, characterized in that: If a first request reply fed back by the target controller for the data synchronization request is received, sending the first target metadata to the target controller comprises: Monitoring whether a first request reply fed back by the target controller in response to the data synchronization request is currently received; If the first request reply is received and the data synchronization request sent by the target controller is not received, the first target metadata is sent to the target controller; if the first request reply and the data synchronization request sent by the target controller are received, the first target metadata is sent to the target controller and the data synchronization request sent by the target controller is suspended; If the first request reply is not received and a data synchronization request sent by the target controller is received, generating a second request reply for the data synchronization request sent by the target controller, and feeding back the second request reply to the target controller, so as to receive metadata fed back by the target controller based on the second request reply; If the data synchronization request sent by the target controller is not received currently, the process jumps again to the step of monitoring whether a first request reply fed back by the target controller for the data synchronization request is received currently.

5. The data deduplication method according to claim 1, characterized in that: The first target metadata is a first target hash value of the first target data block; Correspondingly, the target controller reads the target check block from the target disk, and uses the target check block and the first target metadata to determine whether the second target data block exists in the target controller, and if so, discards the first target metadata, including: The target controller reads the target check block from the target disk, and searches out a second target hash value that is the same as the first target hash value and a pending data block corresponding to the second target hash value from each hash value of the target controller, and verifies the target check block and the pending data block. If the verification passes, the pending data block is determined to be the second target data block, and the first target metadata is discarded.

6. The data deduplication method according to claim 1, characterized in that: Each controller in the four-controller disk array is connected via a high-speed serial computer expansion bus standard; The sending the data synchronization request to the target controller includes: sending the data synchronization request to a target controller via the high-speed serial computer expansion bus standard; Correspondingly, if a first request reply fed back by the target controller for the data synchronization request is received, sending the first target metadata to the target controller includes: If a first request reply fed back by the target controller to the data synchronization request is received through the high-speed serial computer expansion bus standard, the first target metadata is sent to the target controller through the high-speed serial computer expansion bus standard.

7. The data deduplication method according to claim 1, characterized in that: Also includes: Monitor whether the current configuration information has changed; If the current configuration information is monitored to change, the execution order of synchronizing the first target metadata is determined; wherein the synchronization execution order is the data synchronization order of each controller in the four-controller disk array determined by a data consistency algorithm; The first target metadata is synchronized to the target controller according to the execution order.

8. A data deduplication device, characterized in that: Applicable to any controller in a four-controller disk array, including: A generating module, configured to determine a local first target data block, and obtain a target check block based on the first target data block; A writing module, used for writing the first target data block and the target check block into a local target disk at the same time; a sending module, configured to generate first target metadata of the first target data block and a data synchronization request corresponding to the first target metadata, and send the data synchronization request to a target controller; wherein the target controller is another controller in the four-controller disk array; A synchronization module, for, upon receiving a first request reply from the target controller in response to the data synchronization request, sending the first target metadata to the target controller, so as to read the target check block from the target disk through the target controller, and using the target check block and the first target metadata to determine whether a second target data block exists in the target controller, and if so, discarding the first target metadata, and establishing a mapping relationship between a target logical block address of the second target data block and the first target data block; wherein the data stored in the second target data block is the same as the data stored in the first target data block.

9. A data deduplication device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the data deduplication method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data deduplication method according to any one of claims 1 to 7 are implemented.