(19)
(11)EP 3 321 792 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
29.07.2020 Bulletin 2020/31

(21)Application number: 16894804.0

(22)Date of filing:  28.09.2016
(51)International Patent Classification (IPC): 
G06F 3/06(2006.01)
G06F 11/14(2006.01)
(86)International application number:
PCT/CN2016/100629
(87)International publication number:
WO 2018/058382 (05.04.2018 Gazette  2018/14)

(54)

METHOD FOR DELETING DUPLICATED DATA IN STORAGE SYSTEM, STORAGE SYSTEM AND CONTROLLER

VERFAHREN ZUR ENTDUPLIZIERUNG IN EINEM SPEICHERSYSTEM, SPEICHERSYSTEM UND STEUERGERÄT

PROCÉDÉ DE SUPPRESSION DE DONNÉES DUPLIQUÉES DANS UN SYSTÈME DE STOCKAGE, SYSTÈME DE STOCKAGE ET CONTRÔLEUR


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(43)Date of publication of application:
16.05.2018 Bulletin 2018/20

(60)Divisional application:
20180403.6

(73)Proprietor: HUAWEI TECHNOLOGIES CO., LTD.
Guangdong 518129 (CN)

(72)Inventors:
  • LAN, Wenhai
    Shenzhen Guangdong 518129 (CN)
  • ZHANG, Wei
    Shenzhen Guangdong 518129 (CN)
  • YU, Xiaoan
    Shenzhen Guangdong 518129 (CN)
  • LIU, Xuyou
    Shenzhen Guangdong 518129 (CN)
  • ZHANG, Zhixiong
    Shenzhen Guangdong 518129 (CN)

(74)Representative: Thun, Clemens 
Mitscherlich PartmbB Patent- und Rechtsanwälte Sonnenstraße 33
80331 München
80331 München (DE)


(56)References cited: : 
CN-A- 104 246 774
CN-A- 105 701 024
US-A1- 2016 092 138
CN-A- 105 607 867
US-A1- 2014 281 361
  
      
    Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


    Description

    TECHNICAL FIELD



    [0001] The present invention relates to the field of information technologies, and in particular, to a method for deduplication in a storage system, a storage system, and a controller.

    BACKGROUND



    [0002] A deduplication function is an important characteristic in a storage system. After the deduplication function is introduced into the storage system, storage of duplicate data can be reduced, and storage space is therefore saved.

    [0003] In the prior art, a deduplication operation generally includes the following process:
    A fingerprint of a data block is obtained; a fingerprint table is queried to determine whether the fingerprint table includes the same fingerprint; if the fingerprint table does not include the fingerprint, a storage address is allocated in a storage area, and the data block is stored at the storage address; and a mapping relationship between the fingerprint and the storage address and a mapping relationship between a logical block address of the data block and the fingerprint are established in the fingerprint table. When a data block with the same fingerprint is repeatedly written, only a mapping relationship between a logical block address of the repeatedly written data block and the fingerprint needs to be established, and there is no need to store the repeatedly written data block again. By using a deduplication technology in the prior art, storage space is saved; however, there is a problem of a large amount of data in a fingerprint table.

    [0004] US 20140281361 A1 relates to updating a hash mapping table in deduplication when the number of collision counted exceeds a predetermined threshold value.

    SUMMARY



    [0005] The present invention is defined in the appended independent claims. Further implementations are disclosed in the appended dependent claims, description, and figures. If the term embodiment is used for describing unclaimed combinations of features, the term should be understood as referring to examples useful for understanding the present invention.

    [0006] According to a first aspect, the present invention provides a solution to deduplication in a storage system, and the storage system includes a controller and a storage device. The solution includes: receiving, by the controller, a first write request, where the first write request carries a first logical block address and first to-be-written data; obtaining, by the controller, a first fingerprint of the first to-be-written data; inserting the first fingerprint into the fingerprint table when a fingerprint table does not include the first fingerprint, and allocating a first storage address from the storage device to the first to-be-written data; storing, by the controller, the first to-be-written data at the first storage address; establishing, by the controller, a mapping relationship between the first logical block address and the first storage address; receiving, by the controller, a second write request, where the second write request carries a second logical block address and second to-be-written data; obtaining, by the controller, a fingerprint of the second to-be-written data, where the fingerprint of the second to-be-written data is the first fingerprint; allocating, by the controller, a second storage address from the storage device to the second to-be-written data when the controller queries the fingerprint table according to the first fingerprint of the second to-be-written data to determine that no storage address corresponding to the first fingerprint exists; storing, by the controller, the second to-be-written data at the second storage address; establishing, by the controller, a mapping relationship between the first fingerprint and the second storage address in the fingerprint table; and establishing, by the controller, a mapping relationship between the second logical block address and the second storage address.

    [0007] Generally, in deduplication, a fingerprint table is also referred to as a fingerprint index or fingerprint metadata, and is used to store a mapping relationship between a fingerprint and a storage address corresponding to the fingerprint. A data block corresponding to the fingerprint is stored at the storage address.

    [0008] When the foregoing solution is specifically implemented, a fingerprint entry in the fingerprint table may be used to store the mapping relationship between a fingerprint and a storage address corresponding to the fingerprint. A process of the inserting the first fingerprint into the fingerprint table when the fingerprint table does not include the first fingerprint specifically includes: creating, by the controller, a first fingerprint entry in the fingerprint table when no fingerprint entry in the fingerprint table includes the first fingerprint, and inserting the first fingerprint into the first fingerprint entry. A process in which the controller queries the fingerprint table according to the first fingerprint of the second to-be-written data to determine that no storage address corresponding to the first fingerprint exists specifically includes: querying, by the controller, the fingerprint table according to the first fingerprint of the second to-be-written data to determine that the first fingerprint corresponds to no storage address in the first fingerprint entry. A process of the establishing, by the controller, a mapping relationship between the first fingerprint and the second storage address in the fingerprint table is specifically: inserting, by the controller, the second storage address into the first fingerprint entry.

    [0009] In the foregoing solution, that no storage address corresponding to the first fingerprint exists in the fingerprint table may be specifically: no storage address corresponding to the first fingerprint is defined in the fingerprint table or the first fingerprint corresponds to no storage address. In an implementation of using a fingerprint entry to record a mapping relationship between a fingerprint and a storage address in a fingerprint table, when no fingerprint entry in the fingerprint table includes the first fingerprint, the controller creates the first fingerprint entry in the fingerprint table; when the first fingerprint is inserted into the first fingerprint entry, a storage address may not be defined in the first fingerprint entry, that is, a storage address parameter may not be defined in the first fingerprint entry, or there is no storage address, that is, a storage address parameter is defined with Null. These cases indicate that no storage address corresponding to the first fingerprint exists in the fingerprint table, that is, a mapping relationship between the first fingerprint and the first storage address is not established in the fingerprint table.

    [0010] In the foregoing solution, the fingerprints of the first to-be-written data and the second to-be-written data are both the first fingerprint, and it indicates that the first to-be-written data is the same as the second to-be-written data. The controller stores a data block that is written for the first time at the first storage address and inserts, into the fingerprint table, the first fingerprint of the first to-be-written data that is written for the first time, but does not establish the mapping relationship between the first fingerprint and the first storage address. When receiving the subsequently written second to-be-written data (the second to-be-written data is not limited to same data received by the controller for the second time), the controller allocates the second storage address to the duplicate second to-be-written data, stores the second to-be-written data at the second storage address, and establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table. That is, the controller performs deduplication only on same data that has been received for multiple times (twice at least), and this reduces an amount of data in the fingerprint table.

    [0011] Optionally, the controller counts a quantity of times that a received write request carries to-be-written data whose fingerprint value is the first fingerprint. the controller stores the second to-be-written data at the second storage address, and establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table when the quantity of times is greater than a preset quantity N of times, where N is an integer not less than 1. That is, duplicate data (the second to-be-written data) appearing for the (N+1)th time is stored at the second storage address, and the mapping relationship between the first fingerprint and the second storage address is established in the fingerprint table. Data stored in the second storage address is referenceable data. Therefore, deduplication on a data block whose duplication degree reaches a specific value may be set according to a requirement of the storage system. Referenceable data is data that is stored at a storage address corresponding to a fingerprint in the fingerprint table, and non-referenceable data is data that is stored in the storage system but that is not stored at a storage address corresponding to a fingerprint in the fingerprint table.

    [0012] Optionally, the controller allocates the first storage address from a first storage area of the storage device to the first to-be-written data, and the controller allocates the second storage address from a second storage area of the storage device to the second to-be-written data, where storage performance of the second storage area is higher than storage performance of the first storage area, and performance of the controller in accessing referenceable data can be improved.

    [0013] Optionally, the controller receives a third write request, where the third write request carries a third logical block address and third to-be-written data; the controller obtains a fingerprint of the third to-be-written data, where the fingerprint of the third to-be-written data is the first fingerprint; and when querying the fingerprint table according to the first fingerprint of the third to-be-written data to determine that a storage address corresponding to the first fingerprint is the second storage address, the controller establishes a mapping relationship between the third logical block address and the second storage address. When fingerprints of the first to-be-written data, the second to-be-written data, and the third to-be-written data are the first fingerprint, it indicates that the first to-be-written data, the second to-be-written data, and the third to-be-written data are the same. Based on this, the controller performs a deduplication operation on duplicate data, and storage space can be saved. In a specific implementation, when querying the first fingerprint entry in the fingerprint table according to the first fingerprint of the third to-be-written data to determine that the storage address corresponding to the first fingerprint is the second storage address, the controller establishes the mapping relationship between the third logical block address and the second storage address.

    [0014] Optionally, the controller records a quantity of reference times of the second storage address in the fingerprint table. A quantity of reference times is a quantity of times that a logical block address references a storage address corresponding to a fingerprint in the fingerprint table. The quantity of times that a logical block address references a storage address corresponding to a fingerprint in the fingerprint table is determined by a mapping relationship between the logical block address and the storage address. When the controller establishes a mapping relationship between the logical block address and the storage address, and the storage address is recorded in the fingerprint table, the logical block address references the storage address corresponding to the fingerprint in the fingerprint table once. In a specific implementation, the controller records the quantity of reference times of the second storage address in the first fingerprint entry in the fingerprint table. In this implementation, the quantity of reference times is a quantity of times that the logical block address references a storage address in the fingerprint entry. It may be determined, according to the quantity of reference times, whether data can be written at the second storage address again. When the quantity of reference times is 0, it indicates that no logical block address points to the second storage address, and the second storage address may be released, so that the second storage address becomes an idle storage address in the storage device and may be used for writing data again. Optionally, the controller stores, in a cache of the controller according to a quantity of reference times recorded in the fingerprint table, a mapping relationship between a fingerprint whose quantity of reference times is greater than a preset threshold and a storage address corresponding to the fingerprint, and this improves fingerprint search efficiency during deduplication. Specifically, the controller may implement this operation according to a quantity of reference times recorded in a fingerprint entry in the fingerprint table. Optionally, the controller records, in the fingerprint table, time when the first fingerprint is inserted. Specifically, the time when the first fingerprint is inserted may be recorded in the first fingerprint entry in the fingerprint table.

    [0015] Optionally, the controller deletes a second fingerprint from the fingerprint table. No storage address corresponding to the second fingerprint exists in the fingerprint table, and duration for which the second fingerprint has been inserted into the fingerprint table exceeds a preset duration. The controller may delete, from the fingerprint table, a fingerprint that exists in the fingerprint table for duration exceeding preset duration and that corresponds to no storage address, and this further reduces the amount of the data in the fingerprint table. In a specific implementation, it may be determined, according to time when the second fingerprint is inserted and that is recorded in the fingerprint table, that the duration for which the second fingerprint exists in the fingerprint table exceeds the preset duration. Optionally, a fingerprint entry is used as an example. For the second fingerprint recorded in a fingerprint entry by the controller, the second fingerprint corresponds to no storage address in a second fingerprint entry, and duration for which the second fingerprint exists in the second fingerprint entry exceeds the preset duration. For a meaning that no storage address corresponding to a fingerprint exists, refer to the foregoing description, and details are not described herein again.

    [0016] Optionally, the storage system may further include an inverse mapping table. An entry in the inverse mapping table is used to record a mapping relationship between a storage address corresponding to a fingerprint in the fingerprint table and a logical block address pointing to the storage address. For the second storage address corresponding to the first fingerprint, logical block addresses pointing to the second storage address are respectively the second logical block address and the third logical block address. When the storage device providing the second storage address is faulty (or the second storage area is faulty), the faulty storage device is replaced with a new storage device (the faulty second storage area is replaced with a new storage area). Therefore, when the second storage address is reallocated from the new storage device or the new storage area, the second logical block address and the third logical block address that are corresponding to the second storage address only need to be determined according to an entry in the inverse mapping table, and there is no need to determine the logical block addresses pointing to the second storage address by traversing mapping relationships between logical block addresses of all logical units in the storage system and storage addresses. Therefore, logical block address search efficiency during data recovery is improved. Optionally, a mapping relationship between a logical block address and a storage address may further include an identifier indicating whether data is referenceable data. For example, the mapping relationship between the first logical block address and the first storage address carries an identifier indicating whether the data is referenceable data, the mapping relationship between the second logical block address and the second storage address carries an identifier indicating whether the data is referenceable data, and the mapping relationship between the third logical block address and the second storage address carries an identifier indicating whether the data is referenceable data. The controller may easily identify whether the data stored at the storage addresses is referenceable data by using referenceable-data identifiers in the foregoing mapping relationships.

    [0017] In the present invention, when performing deduplication, a controller establishes a mapping relationship between a logical block address and a storage address, instead of a mapping relationship between a logical block address and a fingerprint and a mapping relationship between a fingerprint and a storage address storing data corresponding to the fingerprint in the prior art. Therefore, according to solutions provided by the present invention, the controller can still access data in a storage device, write data, and delete data from the storage device according to the mapping relationship between a logical block address and a storage address even when the controller does not perform deduplication. A case in which the controller does not perform deduplication includes: for example, deduplication logic of the controller is offline, and an entry in a fingerprint table cannot be accessed. Therefore, data accessibility of the storage system is improved.

    [0018] According to a second aspect, correspondingly, the present invention provides a storage system and a controller that are configured to implement various implementation solutions of the first aspect. The controller includes structural units for implementing the various implementation solutions of the first aspect of the present invention, or the controller includes an interface and a processor for separately executing the various implementation solutions of the first aspect of the present invention.

    [0019] Correspondingly, the present invention further provides a non-volatile computer readable storage medium and a computer program product. When a memory of a controller provided by the present invention loads a computer instruction included in the non-volatile computer readable storage medium and the computer program product, and a central processing unit (Central Processing Unit, CPU) of the controller executes the computer instruction, the storage device is enabled to separately execute the various possible implementation solutions of the first aspect of the present invention.

    BRIEF DESCRIPTION OF DRAWINGS



    [0020] 

    FIG. 1 is a schematic architectural diagram of a storage system according to an embodiment of the present invention;

    FIG. 2 is a schematic structural diagram of a controller according to an embodiment of the present invention;

    FIG. 3 is a schematic diagram of storage resource allocation in a storage system according to an embodiment of the present invention;

    FIG. 4 is a schematic diagram of a mapping relationship between a logical block address and a storage address according to an embodiment of the present invention;

    FIG. 5 is a schematic diagram of a fingerprint entry according to an embodiment of the present invention;

    FIG. 6 is a schematic diagram of a mapping relationship between a logical block address and a storage address according to an embodiment of the present invention;

    FIG. 7 is a schematic diagram of a fingerprint entry according to an embodiment of the present invention;

    FIG. 8 is a schematic diagram of a mapping relationship between a logical block address and a storage address according to an embodiment of the present invention;

    FIG. 9 is a schematic diagram of a fingerprint entry according to an embodiment of the present invention;

    FIG. 10 is a schematic structural diagram of an inverse mapping table according to an embodiment of the present invention;

    FIG. 11 is a schematic diagram of a fingerprint entry according to an embodiment of the present invention;

    FIG. 12 is a schematic diagram of a mapping relationship between a logical block address and a storage address according to an embodiment of the present invention;

    FIG. 13 is a flowchart according to an embodiment of the present invention; and

    FIG. 14 is a schematic structural diagram of a controller according to an embodiment of the present invention.


    EMBODIMENTS OF THE PRESENT INVENTION



    [0021] As shown in FIG. 1, a storage system in an embodiment of the present invention includes a controller and a storage device, and the storage device is one or more hard disks. The hard disk includes a solid state disk (Solid State Disk, SSD) or a mechanical hard disk, or a combination of an SSD and a mechanical hard disk. The mechanical hard disk may be an HDD (Hard Disk Drive) and the like. Optionally, the hard disk in the storage device may be a hybrid (Hybrid) hard disk, or the storage device may be a single hard disk, such as a hard disk with an extremely large capacity.

    [0022] As shown in FIG. 2, the controller includes a central processing unit (Central Processing Unit, CPU) 201 and a memory 202. The memory 202 stores a computer instruction. The CPU 201 executes the computer instruction in the memory 202 to manage the storage system and perform a deduplication operation. In addition, to save computing resources of the CPU 201, a field programmable gate array (Field Programmable Gate Array, FPGA) or other hardware may also be used to execute all operations of the CPU in this embodiment of the present invention, or an FPGA or other hardware and the CPU are separately used to execute some operations of the CPU in this embodiment of the present invention, so as to implement a technical solution described in this embodiment of the present invention. For ease of description, a common description in this embodiment of the present invention is that the processor in the controller is configured to implement technical solutions in the embodiments of the present invention. The processor includes storage resource management logic and deduplication logic. The storage resource management logic is used to implement storage resource management and allocation and logical unit (Logical Unit, LU) management. In this embodiment of the present invention, the logical unit is also referred to as a logical unit number (Logical Unit Number, LUN). The deduplication logic is used to implement a deduplication operation. In addition, the controller further includes an interface. The interface communicates with the processor, and is configured to receive an operation request, such as a write request, a deletion request, or a read request. The interface may be specifically a host bus adapter (Host Bus Adapter, HBA) card, a Peripheral Component Interconnect Express (Peripheral Component Interconnect Express, PCIe) interface card, or the like.

    [0023] Because storage performance of an SSD is better than that of an HDD, in an implementation shown in FIG. 3, the controller separately divides the mechanical hard disk and the solid state disk in the storage system into fixed-size chunks (Chunk), and the chunks form a storage area 1 and a storage area 2. In this embodiment of the present invention, a storage area is also referred to as a storage resource pool. The storage resource pool 1 includes chunks (

    ) obtained by the controller by dividing the mechanical hard disk, and the storage resource pool 2 includes chunks (

    ) obtained by the controller by dividing the solid state disk. Herein, the storage resource pool 2 is referred to as a first-level resource pool, and the storage resource pool 1 is referred to as a second-level resource pool. According to a redundant array of independent disks (Redundant Array of Independent Disks, RAID) algorithm, the controller randomly selects chunks distributed in multiple mechanical hard disks in the storage resource pool 1 to form a chunk group (Chunk Group). For example,

    form a chunk group, that is, four

    respectively come from different hard disks. Likewise, according to the RAID algorithm, the controller randomly selects chunks distributed in multiple solid state disks in the storage resource pool 2 to form a chunk group (Chunk Group). For example,

    form a chunk group, that is, four

    respectively come from different hard disks. The controller divides a chunk group into fixed-size extents (Extent) such as

    or

    , and allocates the extents to a LUN for use. As shown in FIG. 3, a LUN 1 uses an extent in the storage resource pool 1, and a LUN 2 uses extents in the storage resource pool 1 and the storage resource pool 2. That is, the LUN 1 uses the extent provided in the storage area 1, and the LUN 2 uses the extents provided in the storage area 1 and the storage area 2. Therefore, the LUN 1 is referred to as a non-hierarchical storage LUN, and the LUN 2 is referred to as a hierarchical storage LUN.

    [0024] Using the LUN 2 as an example, the controller receives a first write request, and the first write request generally carries an identifier of the LUN 2, a logical block address (Logical Block Address, LBA) 1, and first to-be-written data. The LBA 1 is a target logical block address of the first to-be-written data. The controller obtains a fingerprint A of the first to-be-written data, for example, obtains the fingerprint of the first to-be-written data by using a hash (Hash) algorithm. The controller queries a fingerprint table to determine whether the fingerprint A exists in the fingerprint table. When no fingerprint entry in the fingerprint table includes the fingerprint A, the controller creates a new fingerprint entry in the fingerprint table and inserts the fingerprint A into the new fingerprint entry. The controller allocates an extent from the storage resource pool 1 to the first to-be-written data, that is, allocates a storage address SD 1, stores the first to-be-written data at the SD 1, and establishes a mapping relationship between the LBA 1 and the SD 1, as shown in FIG. 4. That is, the LBA 1 in the LUN 2 points to the SD 1. Optionally, the mapping relationship may further carry an identifier indicating whether the data is referenceable data. For example, 0 is used to identify non-referenceable data, and 1 is used to identify referenceable data. In this embodiment of the present invention, referenceable data is data that is stored at a storage address in a fingerprint entry in the fingerprint table, and non-referenceable data is data that is stored in the storage system but that is not stored at a storage address recorded in a fingerprint entry in the fingerprint table. The controller can easily identify that the data stored at the SD 1 is not referenceable data by a referenceable-data identifier in the mapping relationship between the LBA 1 and the SD 1.

    [0025] In the prior art, when the first to-be-written data is data that is written for the first time, after the fingerprint A is inserted into the fingerprint table, a mapping relationship between the fingerprint A and the storage address SD 1 is established in the fingerprint table. However, in this embodiment of the present invention, as shown in FIG. 5, when the first to-be-written data is data that is written for the first time, after the controller inserts the fingerprint A into the new fingerprint entry, the fingerprint A corresponds to no storage address in the new fingerprint entry, that is, the first storage address is not inserted into the new fingerprint entry. In this embodiment of the present invention, optionally, a fingerprint entry in the fingerprint table may further include time when a fingerprint is inserted and a quantity of times that a logical block address references a storage address in the fingerprint entry. The quantity of times that a logical block address references a storage address in the fingerprint entry is also referred to as a quantity of reference times of a storage address corresponding to a fingerprint in the fingerprint entry. The quantity of times that a logical block address references a storage address in the fingerprint entry is determined by a mapping relationship between the logical block address and the storage address. When the controller establishes the mapping relationship between the logical block address and the storage address and the storage address is recorded in the fingerprint table, the logical block address references the storage address in the fingerprint entry once.

    [0026] In this embodiment of the present invention, time when the fingerprint A is inserted is T1 Because there is only the fingerprint A in the new fingerprint entry, and the fingerprint A corresponds to no storage address, a quantity of times that the logical block address references the data at the storage address is 0. When a fingerprint entry includes a fingerprint but includes no storage address corresponding to the fingerprint, it indicates that the storage system has no referenceable data corresponding to the fingerprint. Based on this, the controller may delete, from the fingerprint table, a fingerprint that exists in the fingerprint table for duration exceeding preset duration and that corresponds to no storage address, and this reduces an amount of data in the fingerprint table. Specifically, in this embodiment of the present invention, the time when the fingerprint A is inserted is T1, and at a moment T2, the controller needs to delete a fingerprint that exists in the fingerprint table for duration exceeding the preset duration and that corresponds to no storage address. Duration for which the fingerprint A exists in the fingerprint table, that is, duration from the moment T1 to the moment T2, may be determined according to a difference between T2 and T1. When the fingerprint A in the fingerprint entry in the fingerprint table corresponds to no storage address and the different between T2 and T1 exceeds the preset duration, the fingerprint A may be deleted from the fingerprint table.

    [0027] Generally, in deduplication, a fingerprint table is also referred to as a fingerprint index or fingerprint metadata, and is used to store a mapping relationship between a fingerprint and a storage address corresponding to the fingerprint. A data block corresponding to the fingerprint is stored at the storage address. In a specific implementation, a fingerprint entry may be used to store the mapping relationship between a fingerprint and a storage address corresponding to the fingerprint.

    [0028] In this embodiment of the present invention, that no storage address corresponding to the fingerprint A exists means: the storage address corresponding to the fingerprint A is not defined in the fingerprint table or the fingerprint A corresponds to no storage address. In an implementation of a fingerprint entry to record the mapping relationship between a fingerprint and a storage address, a storage address may not be defined in the new fingerprint entry, that is, a storage address parameter may not be defined in the new fingerprint entry; or there is no storage address, that is, the storage address parameter is defined with Null.

    [0029] When the controller receives a second write request, the second write request generally carries the identifier of the LUN 2, an LBA 2, and second to-be-written data. The LBA 2 is a target logical block address of the second to-be-written data. The controller obtains the fingerprint A of the second to-be-written data, for example, obtains the fingerprint A of the second to-be-written data by a hash (Hash) algorithm. The fingerprints of the first to-be-written data and the second to-be-written data are both the fingerprint A, and it indicates that the first to-be-written data is the same as the second to-be-written data. When querying the fingerprint table to determine that the fingerprint A corresponds to no storage address in the new fingerprint entry, the controller allocates an extent from the storage resource pool 2 to the second to-be-written data, that is, allocates a storage address SD 2, stores the second to-be-written data at the SD 2, and establishes a mapping relationship between the LBA 2 and the SD 2, as shown in FIG. 6. That is, the LBA 2 in the LUN 2 points to the SD 2. Optionally, the mapping relationship between the LBA 2 and the SD 2 may further carry an identifier indicating whether the data is referenceable data. For example, 1 is used to identify referenceable data. The controller can easily identify that the data stored at the SD 2 is referenceable data by a referenceable-data identifier in the mapping relationship between the LBA 2 and the SD 2. As shown in FIG. 7, the controller establishes a mapping relationship between the fingerprint A and the SD 2 in the new fingerprint entry, that is, the storage address corresponding to the fingerprint A inserted into the fingerprint entry is the SD 2. As shown in FIG. 7, the second to-be-written data is referenceable data, and a quantity of reference times in the new fingerprint entry is updated to 1.

    [0030] The controller counts a quantity of times that a received write request carries to-be-written data whose fingerprint value is fingerprint A. When the quantity of times is greater than a preset quantity N of times, the controller allocates the SD 2 from the storage resource pool 2 to the second to-be-written data, and inserts the SD 2 into the new fingerprint entry. N is an integer not less than 1, and specifically, may be set according to a requirement of the storage system. Therefore, according to the requirement of the storage system, when a quantity of times that to-be-written data received by the controller carries a same fingerprint is greater than N, duplicate data appearing for the (N+1)th time is stored at the SD 2, and the SD 2 is inserted into the fingerprint entry. That is, the controller performs deduplication only on same data that has been received for multiple times, and this reduces an amount of data in the fingerprint table.

    [0031] In this embodiment of the present invention, the controller stores a data block that is written for the first time at the first storage address and inserts a fingerprint of the data block that is written for the first time into a new fingerprint entry created in the fingerprint table, but does not insert a storage address at which the data block is stored. When receiving a subsequently written duplicate data block, the controller allocates a second storage address to the duplicate data block, stores the duplicate data block at the second storage address, and inserts the second storage address into a corresponding fingerprint entry in the fingerprint table. That is, the controller performs deduplication only on same data that has been received for multiple times, and this reduces the amount of the data in the fingerprint table. Further, the controller stores the referenceable data at a storage address of the storage area 2. Because storage performance of the storage area 2 is better than storage performance of the storage area 1, performance of the controller in accessing the referenceable data can be improved.

    [0032] When the controller receives a third write request, the third write request generally carries the identifier of the LUN 2, an LBA 3, and third to-be-written data. The LBA 3 is a target logical block address of the third to-be-written data. The controller obtains the fingerprint A of the third to-be-written data, for example, obtains the fingerprint A of the third to-be-written data by a hash (Hash) algorithm. The fingerprints of the first to-be-written data, the second to-be-written data, and the third to-be-written data are all the fingerprint A, and it indicates that the first to-be-written data, the second to-be-written data, and the third to-be-written data are identical. When querying the new fingerprint entry according to the fingerprint A to determine that the storage address corresponding to the fingerprint A is the SD 2, the controller establishes a mapping relationship between the LBA 3 and the SD 2, as shown in FIG. 6. That is, the LBA 3 in the LUN 2 points to the SD 2, and the third to-be-written data is not stored. Based on this, the controller performs a deduplication operation on duplicate data, and storage space can be saved. Optionally, the mapping relationship between the LBA 3 and the SD 2 may further carry an identifier indicating whether the data is referenceable data. For example, 1 is used to identify referenceable data. The controller can easily identify that the data stored at the SD 2 is referenceable data by ua referenceable-data identifier in the mapping relationship between the LBA 3 and the SD 2. As shown in FIG. 9, the controller updates the quantity of reference times in the new fingerprint entry to 2.

    [0033] Optionally, this embodiment of the present invention further provides an inverse mapping table. As shown in FIG. 10, an entry in the inverse mapping table is used to record a mapping relationship between a storage address in an entry in the fingerprint table and a logical block address pointing to the storage address. For example, for the SD 2 corresponding to the fingerprint A, logical block addresses pointing to the SD 2 are respectively the LBA 2 and the LBA 3; therefore, the entry in the inverse mapping table shown in FIG. 10 records the mapping relationships between the SD 2 and both of the LBA 2 and the LBA 3. When the SSD providing the storage area 2 is faulty, a new SSD replaces the faulty SSD. If the SD 2 is provided by the faulty SSD, when the SD 2 is reallocated from the new SSD, the LBA 2 and the LBA 3 that are corresponding to the SD 2 can be determined only by querying the entry in the inverse mapping table shown in FIG. 10 and data of the LBA 2 and the LBA 3 may be recovered at the SD 2 provided by the new SSD, and there is no need to determine the logical block address pointing to the SD 2 (in other words, the logical block address corresponding to the SD 2) by traversing mapping relationships between logical block addresses of all LUNs in the storage system and storage addresses. Therefore, logical block address search efficiency during data recovery is improved.

    [0034] When the first write request is a modification/write request, that is, before the first to-be-written data is written, a data block M has been written at the LBA 1, and a fingerprint corresponding to the data block M is a fingerprint B. A fingerprint entry in the fingerprint table includes information shown in FIG. 11: A storage address that stores the data block M is an SD 3 in the storage area 2, and a quantity of reference times is 1. A mapping relationship between the LBA 1 and the storage address SD 3 is shown in FIG. 12: A storage address to which the LBA 1 points is the SD 3, and data stored at the SD 3 is referenceable data. When storing the first to-be-written data at the SD 1 according to the first write request, the controller updates the mapping relationship shown in FIG. 12 to the mapping relationship shown in FIG. 4; the controller updates the quantity of reference times in the fingerprint entry shown in FIG. 11, that is, reduces the quantity of reference times to 0; and then the controller may directly delete the mapping relationship between the LBA 1 and the SD 3 or invalidate the mapping relationship, and release the storage address SD 3, so that the SD 3 becomes an idle storage address in the storage area 2, that is, the SD 3 is a storage address that is not allocated. Deleting the mapping relationship between the LBA 1 and the SD 3 is totally deleting the mapping relationship. A specific implementation of invalidating the mapping relationship may be using an invalid identifier to identify the mapping relationship, and the invalid identifier indicates that the mapping relationship is invalid.

    [0035] When the deduplication logic of the controller is offline, the controller writes the first to-be-written data at the SD 1 according to the first write request (the controller allocates a storage address from the storage area 1 to the to-be-written data), and establishes the mapping relationship between the LBA 1 and the SD 1. When a mapping relationship between the LBA 1 and a storage address is shown in FIG. 12, that is, the storage address corresponding to the LBA 1 is the SD 3 and the data stored at the SD 3 is referenceable data, the controller records a quantity decrease of reference times of the SD 3 in a log. After the deduplication logic of the controller is online, according to the record of the quantity decrease of reference times of the SD 3 in the log, the controller updates the quantity of reference times in the fingerprint entry shown in FIG. 11, that is, reduces a reference count to 0. In this embodiment of the present invention, that the deduplication logic of the controller is offline means: a deduplication function of the controller is disabled or faulty, and that the deduplication logic of the controller is online means: the deduplication function of the controller is in a working state. According to aspects described in this embodiment of the present invention, when the controller does not perform deduplication, the controller may still access data stored in the storage device, write data, and delete data from the storage device according to the mapping relationship between the logical block address and the storage address. Therefore, data accessibility of the storage system is improved. In this embodiment of the present invention, scenarios in which the controller does not perform deduplication may include a scenario in which the deduplication logic of the controller is offline, a scenario in which the controller cannot access an entry in the fingerprint table, and the like.

    [0036] Further, in this embodiment of the present invention, the controller receives a fourth deletion request, and the fourth deletion request generally carries the identifier of the LUN 2 and the LBA 3. The controller queries, according to the LBA 3, the mapping relationship shown in FIG. 8, and invalidates or deletes the mapping relationship between the LBA 3 and the SD 2 shown in FIG. 8. Deleting the mapping relationship between the LBA 3 and the SD 2 is totally deleting the mapping relationship. A specific implementation of invalidating the mapping relationship between the LBA 3 and the SD 2 may be using an invalid identifier to identify the mapping relationship, and the invalid identifier indicates that the mapping relationship is invalid.

    [0037] Because the LBA 3 no longer points to the SD 2, the quantity of reference times in the fingerprint entry shown in FIG. 9 is reduced by 1, that is, is updated to 1. When the controller deletes or invalidates the mapping relationship shown in FIG. 8 according to the fourth deletion request but the deduplication logic of the controller is offline, the controller records a quantity decrease of reference times of the SD 2 in a log. After the deduplication logic of the controller is online, according to the record of the quantity decrease of reference times of the SD 2 in the log, the controller updates the quantity of reference times in the fingerprint entry shown in FIG. 9, that is, reduces a reference count to 1.

    [0038] The solution described in this embodiment of the present invention is also applicable to the LUN 1. That is, storage addresses are allocated from a same storage area. Optionally, the solution described in this embodiment of the present invention is not only applicable to an operation request of one LUN, but also applicable to operation requests of multiple LUNs. This is not limited in the present invention. In this embodiment of the present invention, another storage address allocation manner may further be used based on the storage system shown in FIG. 1. For example, a storage address is directly provided for a LUN from a hard disk based on the RAID algorithm. This is not limited in the present invention.

    [0039] Further, in this embodiment of the present invention, a fingerprint entry whose quantity of reference times is greater than a preset threshold may be stored in a cache of the controller according to a quantity of reference times recorded in the fingerprint entry in the fingerprint table, so as to improve fingerprint search efficiency during deduplication.

    [0040] With reference to FIG. 1 to FIG. 3 and the storage system described in the foregoing embodiment, FIG. 13 provides a flowchart of an embodiment of a method for deduplication in a storage system of the present invention.

    [0041] Step 1301: A controller receives a first write request, where the first write request carries a first logical block address and first to-be-written data.

    [0042] Step 1302: The controller obtains a first fingerprint of the first to-be-written data.

    [0043] As described in the foregoing embodiment, the controller may obtain the first fingerprint by performing calculation on the first to-be-written data according to a hash algorithm or the like.

    [0044] Step 1303: When a fingerprint table does not include the first fingerprint, the controller inserts the first fingerprint into the fingerprint table, and allocates a first storage address from a storage device to the first to-be-written data.

    [0045] In a specific implementation, when a fingerprint entry is used to record a mapping relationship between a fingerprint and a storage address and no fingerprint entry in the fingerprint table includes the first fingerprint, the controller creates a first fingerprint entry in the fingerprint table, and inserts the first fingerprint into the first fingerprint entry.

    [0046] Step 1304: The controller stores the first to-be-written data at the first storage address, and establishes a mapping relationship between the first logical block address and the first storage address.

    [0047] Optionally, the controller records, in the fingerprint table, time when the first fingerprint is inserted.

    [0048] Specifically, the controller records, in the first fingerprint entry, the time when the first fingerprint is inserted.

    [0049] When the fingerprint table does not include the first fingerprint, the controller inserts the first fingerprint into the fingerprint table, but no storage address corresponding to the first fingerprint exists. Therefore, the first to-be-written data stored at the first storage address is not referenceable data. In a specific implementation, that no storage address corresponding to the first fingerprint exists in the fingerprint table may mean: the storage address corresponding to the first fingerprint is not defined in the fingerprint table or the first fingerprint corresponds to no storage address. In an implementation of using the fingerprint entry to record the mapping relationship between a fingerprint and a storage address, when no fingerprint entry in the fingerprint table includes the first fingerprint, the controller creates the first fingerprint entry in the fingerprint table; when the first fingerprint is inserted into the first fingerprint entry, the storage address may not be defined in the first fingerprint entry, that is, a storage address parameter may not be defined in the first fingerprint entry; or there is no storage address, that is, the storage address parameter is defined with Null. These cases indicate that no storage address corresponding to the first fingerprint exists in the fingerprint table, that is, a mapping relationship between the first fingerprint and the first storage address is not established in the fingerprint table.

    [0050] Step 1305: The controller receives a second write request, where the second write request carries a second logical block address and second to-be-written data.

    [0051] Step 1306: The controller obtains a fingerprint of the second to-be-written data, where the fingerprint of the second to-be-written data is the first fingerprint.

    [0052] As described in the foregoing embodiment, the controller may obtain the first fingerprint by performing calculation on the second to-be-written data according to a hash algorithm or the like. The fingerprints of the first to-be-written data and the second to-be-written data are the same, and it indicates that the first to-be-written data is the same as the second to-be-written data.

    [0053] Step 1307: When the controller queries the fingerprint table according to the first fingerprint of the second to-be-written data and determines that no storage address corresponding to the first fingerprint exists, the controller allocates a second storage address from the storage device to the second to-be-written data.

    [0054] Step 1308: The controller establishes a mapping relationship between the second logical block address and the second storage address, and establishes a mapping relationship between the first fingerprint and the second storage address in the fingerprint table.

    [0055] Optionally, the controller allocates the first storage address from a first storage area of the storage device to the first to-be-written data, and the controller allocates the second storage address from a second storage area of the storage device to the second to-be-written data, where storage performance of the second storage area is higher than storage performance of the first storage area, and performance of the controller in accessing referenceable data can be improved.

    [0056] Optionally, the controller records a quantity of reference times of the second storage address in the fingerprint table. In a specific implementation, the controller may record the quantity of reference times of the second storage address in the first fingerprint entry in the fingerprint table. A quantity of reference times is a quantity of times that a logical block address references a storage address corresponding to a fingerprint in the fingerprint table. The quantity of times that a logical block address references a storage address corresponding to a fingerprint in the fingerprint table is determined by a mapping relationship between the logical block address and the storage address. When the controller establishes the mapping relationship between the logical block address and the storage address, and the storage address is recorded in the fingerprint table, the logical block address references the storage address corresponding to the fingerprint in the fingerprint table once. In a specific implementation, the controller records the quantity of reference times of the second storage address in the first fingerprint entry in the fingerprint table, and the quantity of reference times is a quantity of times that the logical block address references a storage address in the fingerprint entry. It may be determined, according to the quantity of reference times, whether data can be written at the second storage address again. When the quantity of reference times is 0, it indicates that no logical block address points to the second storage address, and the second storage address may be released, so that the second storage address becomes an idle storage address in the storage device and may be used for writing data again. The controller stores, in a cache of the controller according to a quantity of reference times recorded in the fingerprint table, a mapping relationship between a fingerprint whose quantity of reference times is greater than a preset threshold and a storage address corresponding to the fingerprint, and this improves fingerprint search efficiency during deduplication.

    [0057] The controller counts a quantity of times that a received write request carries to-be-written data whose fingerprint value is the first fingerprint. When the quantity of times is greater than a preset quantity N of times, the controller stores the second to-be-written data at the second storage address, and establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table, where N is an integer not less than 1. That is, duplicate data (the second to-be-written data) appearing for the (N+1)th time is stored at the second storage address, and the mapping relationship between the first fingerprint and the second storage address is established in the fingerprint table. Data stored at the second storage address is referenceable data. As described above, a specific implementation of establishing, by the controller, the mapping relationship between the first fingerprint and the second storage address in the fingerprint table may be specifically inserting, by the controller, the second storage address into the first fingerprint entry in the fingerprint table. Therefore, deduplication on a data block whose duplication degree reaches a specific value may be set according to a requirement of the storage system. Referenceable data is data that is stored at a storage address corresponding to a fingerprint in the fingerprint table, and non-referenceable data is data that is stored in the storage system but that is not stored at a storage address corresponding to a fingerprint in the fingerprint table. In a specific implementation, referenceable data is data that is stored at a storage address in a fingerprint entry in the fingerprint table, and non-referenceable data is data that is stored in the storage system but that is not stored at a storage address recorded in a fingerprint entry in the fingerprint table.

    [0058] The controller establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table; therefore, the second to-be-written data stored at the second storage address is referenceable data.

    [0059] Optionally, the controller receives a third write request, where the third write request carries a third logical block address and third to-be-written data; the controller obtains a fingerprint of the third to-be-written data, where the fingerprint of the third to-be-written data is the first fingerprint; and when querying the fingerprint table according to the first fingerprint of the third to-be-written data to determine that a storage address corresponding to the first fingerprint is the second storage address, the controller establishes a mapping relationship between the third logical block address and the second storage address. The fingerprints of the first to-be-written data, the second to-be-written data, and the third to-be-written data are all the first fingerprint, and it indicates that the first to-be-written data, the second to-be-written data, and the third to-be-written data are identical. Based on this, the controller performs a deduplication operation on duplicate data, and storage space can be saved. In a specific implementation, when querying the first fingerprint entry in the fingerprint table according to the first fingerprint of the third to-be-written data to determine that the storage address corresponding to the first fingerprint is the second storage address, the controller establishes the mapping relationship between the third logical block address and the second storage address.

    [0060] Optionally, the controller deletes a second fingerprint from the fingerprint table. No storage address corresponding to the second fingerprint exists, and duration for which the second fingerprint exists in the fingerprint table exceeds preset duration, and this further reduces an amount of data in the fingerprint table. In a specific implementation, it may be determined, according to time when the second fingerprint is inserted and that is recorded in the fingerprint table, that the duration for which the second fingerprint exists in the fingerprint table exceeds the preset duration. Optionally, a fingerprint entry is used as an example. For the second fingerprint recorded in a fingerprint entry by the controller, the second fingerprint corresponds to no storage address in a second fingerprint entry, and duration for which the second fingerprint exists in the second fingerprint entry exceeds the preset duration.

    [0061] Optionally, the storage system further includes an inverse mapping table. An entry in the inverse mapping table is used to record a mapping relationship between a storage address corresponding to a fingerprint in the fingerprint table and a logical block address pointing to the storage address. For the second storage address corresponding to the first fingerprint, logical block addresses pointing to the second storage address are respectively the second logical block address and the third logical block address. When the second storage address provided by the storage device is faulty (or the second storage area is faulty), the faulty storage device is replaced with a new storage device (the faulty second storage area is replaced with a new storage area). Therefore, when the second storage address is reallocated from the new storage device or the new storage area, the second logical block address and the third logical block address that are corresponding to the second storage address only need to be determined according to an entry in the inverse mapping table, and there is no need to determine the logical block addresses pointing to the second storage address by traversing mapping relationships between logical block addresses of all logical units in the storage system and storage addresses. Therefore, logical block address search efficiency during data recovery is improved. Optionally, a mapping relationship between a logical block address and a storage address may further include an identifier indicating whether data is referenceable data. For example, the mapping relationship between the first logical block address and the first storage address carries an identifier indicating whether the data is referenceable data, the mapping relationship between the second logical block address and the second storage address carries an identifier indicating whether the data is referenceable data, and the mapping relationship between the third logical block address and the second storage address carries an identifier indicating whether the data is referenceable data. The controller may easily identify whether the data stored at the storage addresses is referenceable data by using referenceable-data identifiers in the foregoing mapping relationships.

    [0062] According to the flowchart shown in FIG. 13, the fingerprints of the first to-be-written data and the second to-be-written data are both the first fingerprint, and it indicates that the first to-be-written data is the same as the second to-be-written data. The controller stores a data block that is written for the first time at the first storage address and inserts, into the fingerprint table, the first fingerprint of the first to-be-written data that is written for the first time, but does not establish the mapping relationship between the first fingerprint and the first storage address. When receiving the subsequently written second to-be-written data (the second to-be-written data is not limited to same data received by the controller for the second time), the controller allocates the second storage address to the duplicate second to-be-written data, stores the second to-be-written data at the second storage address, and establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table. That is, the controller performs deduplication only on same data that has been received for multiple times, and this reduces the amount of the data in the fingerprint table.

    [0063] For a specific implementation of the flowchart shown in FIG. 13, refer to the description in the foregoing embodiment, and details are not described herein again.

    [0064] According to the solutions described in the embodiments of the present invention, another embodiment of the present invention provides a controller shown in FIG. 14, applied to a storage system in the embodiments of the present invention. The controller includes a receiving unit 1401, an obtaining unit 1402, an insertion unit 1403, an allocation unit 1404, a storage unit 1405, and an establishment unit 1406. The receiving unit 1401 is configured to receive a first write request, where the first write request carries a first logical block address and first to-be-written data. The obtaining unit 1402 is configured to obtain a first fingerprint of the first to-be-written data. The insertion unit 1403 is configured to: insert the first fingerprint into the fingerprint table when a fingerprint table does not include the first fingerprint. The allocation unit 1404 is configured to allocate a first storage address from a storage device to the first to-be-written data. The storage unit 1405 is configured to store the first to-be-written data at the first storage address. The establishment unit 1406 is configured to establish a mapping relationship between the first logical block address and the first storage address. The receiving unit 1401 is further configured to receive a second write request, where the second write request carries a second logical block address and second to-be-written data. The obtaining unit 1402 is further configured to obtain a fingerprint of the second to-be-written data, where the fingerprint of the second to-be-written data is the first fingerprint. The allocation unit 1404 is further configured to: allocate a second storage address from the storage device to the second to-be-written data when querying the fingerprint table according to the first fingerprint of the second to-be-written data to determine that no storage address corresponding to the first fingerprint exists in the fingerprint table. The storage unit 1405 is further configured to store the second to-be-written data at the second storage address. The establishment unit 1406 is further configured to establish a mapping relationship between the second logical block address and the second storage address, and establish a mapping relationship between the first fingerprint and the second storage address in the fingerprint table.

    [0065] Optionally, the allocation unit 1404 is specifically configured to allocate the first storage address from a first storage area of the storage device to the first to-be-written data, and allocate the second storage address from a second storage area of the storage device to the second to-be-written data. Storage performance of the second storage area is higher than storage performance of the first storage area.

    [0066] Optionally, the receiving unit 1401 is further configured to receive a third write request, where the third write request carries a third logical block address and third to-be-written data. The obtaining unit 1402 is further configured to obtain a fingerprint of the third to-be-written data, where the fingerprint of the third to-be-written data is the first fingerprint. The establishment unit 1406 is further configured to: establish a mapping relationship between the third logical block address and the second storage address when the fingerprint table is queried according to the first fingerprint of the third to-be-written data to determine that a storage address corresponding to the first fingerprint is the second storage address.

    [0067] Optionally, the controller further includes a record unit, and the record unit is configured to record a quantity of reference times of the second storage address in a first fingerprint entry. Optionally, the record unit is further configured to record the quantity of reference times of the second storage address in the fingerprint table.

    [0068] Optionally, the controller further includes a deletion unit, and the deletion unit is configured to delete a second fingerprint from the fingerprint table. No storage address corresponding to the second fingerprint exists, and duration for which the second fingerprint exists in the fingerprint table exceeds preset duration.

    [0069] Optionally, the controller further includes a counting unit, configured to count a quantity of times that a received write request carries to-be-written data whose fingerprint value is the first fingerprint. the storage unit 1405 stores the second to-be-written data at the second storage address, and the establishment unit 1406 establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table when the quantity of times is greater than a preset quantity N of times, where N is an integer not less than 1.

    [0070] For an effect implemented by the controller shown in FIG. 14 and for a further implementation, refer to the corresponding description in the foregoing embodiments, and details are not described herein again.

    [0071] For the controller shown in FIG. 14, an implementation is that the foregoing units are installed in the controller, the foregoing units may be loaded in a memory of the controller, and a CPU in the controller executes an instruction in the memory, so as to implement functions in the corresponding embodiments of the present invention; another implementation is that the units included in the controller may be implemented by hardware, or implemented by a combination of hardware and the instruction in the memory executed by the CPU. The foregoing units are also referred to as structural units.

    [0072] An embodiment of the present invention further provides a non-volatile computer readable storage medium and a computer program product, and a computer instruction included in the non-volatile computer readable storage medium and the computer program product. A CPU executes the computer instruction loaded in a memory, so as to implement functions corresponding to the controller in the embodiments of the present invention.

    [0073] According to aspects described in the embodiments of the present invention, when the controller cannot access an entry in a fingerprint table, the controller can still access data in the storage device, write data, and delete data from the storage device according to a mapping relationship between a logical block address and a storage address.

    [0074] In the embodiments of the present invention, a fingerprint entry in the fingerprint table and the mapping relationship between a logical block address and a storage address may be data structures or other proper descriptive structures, and are used to record corresponding information. An example description is given in the embodiments of the present invention. "First", "second", "third", and "fourth" in the embodiments of the present invention are not used to strictly limit a sequence. For example, when used to represent an operation request, "first", "second", and "third" are used to only distinguish between different operation requests, and when used to represent to-be-written data, "first", "second", and "third" are used to only represent to-be-written data carried in different write requests. The controller may further receive one or more write requests between the first write request and the second write request. Storage performance in the embodiments of the present invention may be measured by one or more indicators, such as bandwidth (Bandwidth), input/output operations per second (Input/Output Operations Per Second, IOPS), a sequential (Sequential) read/write speed, a random (Random) read/write speed, a sustained throughput (Sustained Throughput) capability, and a burst processing capability (Burst I/O), and the embodiments of the present invention sets no limitation thereto.

    [0075] In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the unit division in the described apparatus embodiment is merely logical function division and may be another division in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.

    [0076] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

    [0077] In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.


    Claims

    1. A method for deduplication in a storage system, wherein the storage system comprises a controller and a storage device, and the method comprises:

    receiving (1301), by the controller, a first write request, wherein the first write request carries a first logical block address and first to-be-written data;

    obtaining (1302), by the controller, a first fingerprint of the first to-be-written data;

    inserting (1303), by the controller, the first fingerprint into a fingerprint table when the fingerprint table does not comprise the first fingerprint, and allocating (1303) a first storage address from the storage device to the first to-be-written data, wherein there is no storage address corresponding to the first fingerprint in the fingerprint table;

    storing (1304), by the controller, the first to-be-written data at the first storage address;

    establishing (1308), by the controller, a mapping relationship between the first logical block address and the first storage address;

    receiving (1305), by the controller, a second write request, wherein the second write request carries a second logical block address and second to-be-written data;

    obtaining (1306), by the controller, a fingerprint of the second to-be-written data, wherein the fingerprint of the second to-be-written data is the first fingerprint;

    allocating (1307), by the controller, a second storage address from the storage device to the second to-be-written data when the controller queries the fingerprint table according to the first fingerprint of the second to-be-written data and determines that no storage address corresponding to the first fingerprint exists;

    storing, by the controller, the second to-be-written data at the second storage address;

    establishing, by the controller, a mapping relationship between the first fingerprint and the second storage address in the fingerprint table; and

    establishing, by the controller, a mapping relationship between the second logical block address and the second storage address.


     
    2. The method according to claim 1, wherein allocating (1303), by the controller, a first storage address from the storage device to the first to-be-written data specifically comprises: allocating, by the controller, the first storage address from a first storage area of the storage device to the first to-be-written data; and the allocating, by the controller, a second storage address from the storage device to the second to-be-written data specifically comprises: allocating, by the controller, the second storage address from a second storage area of the storage device to the second to-be-written data, wherein storage performance of the second storage area is higher than storage performance of the first storage area.
     
    3. The method according to claim 1 or 2, wherein the method further comprises:

    receiving, by the controller, a third write request, wherein the third write request carries a third logical block address and third to-be-written data;

    obtaining, by the controller, a fingerprint of the third to-be-written data, wherein the fingerprint of the third to-be-written data is the first fingerprint; and

    establishing, by the controller, a mapping relationship between the third logical block address and the second storage address when querying the fingerprint table according to the first fingerprint of the third to-be-written data to determine that a storage address corresponding to the first fingerprint is the second storage address.


     
    4. The method according to any one of claims 1 to 3, wherein the method further comprises:
    recording, by the controller, a quantity of reference times of the second storage address in the fingerprint table.
     
    5. The method according to any one of claims 1 to 4, wherein the method further comprises:
    recording, by the controller in the fingerprint table, time when the first fingerprint is inserted.
     
    6. The method according to claim 5, wherein the method further comprises:
    deleting, by the controller, a second fingerprint from the fingerprint table, wherein no storage address corresponding to the second fingerprint exists, and duration for which the second fingerprint exists in the fingerprint table exceeds preset duration.
     
    7. The method according to claim 1, wherein the method further comprises:
    counting, by the controller, a quantity of times that a received write request carries to-be-written data whose fingerprint value is the first fingerprint, storing, by the controller, the second to-be-written data at the second storage address, and establishing the mapping relationship between the first fingerprint and the second storage address in the fingerprint table when the quantity of times is greater than a preset quantity N of times,, wherein N is an integer not less than 1.
     
    8. A storage system, comprising a storage controller and a storage device, wherein the controller is configured to: receive a first write request, wherein the first write request carries a first logical block address and first to-be-written data; obtain a first fingerprint of the first to-be-written data; insert the first fingerprint into a fingerprint table when the fingerprint table does not comprise the first fingerprint, and allocate a first storage address from the storage device to the first to-be-written data; store the first to-be-written data at the first storage address; and establish a mapping relationship between the first logical block address and the first storage address, wherein there is no storage address corresponding to the first fingerprint in the fingerprint table;
    the controller is further configured to: receive a second write request, wherein the second write request carries a second logical block address and second to-be-written data; obtain a fingerprint of the second to-be-written data, wherein the fingerprint of the second to-be-written data is the first fingerprint; allocate a second storage address from the storage device to the second to-be-written data when querying the fingerprint table according to the first fingerprint of the second to-be-written data to determine that no storage address corresponding to the first fingerprint exists; store the second to-be-written data at the second storage address; establish a mapping relationship between the second logical block address and the second storage address; and establish a mapping relationship between the first fingerprint and the second storage address in the fingerprint table; and
    the storage device is configured to provide the first storage address and the second storage address.
     
    9. The storage system according to claim 8, wherein the controller is specifically configured to allocate the first storage address from a first storage area of the storage device to the first to-be-written data and allocate the second storage address from a second storage area of the storage device to the second to-be-written data, wherein storage performance of the second storage area is higher than storage performance of the first storage area.
     
    10. The storage system according to claim 8 or 9, wherein the controller is further configured to:
    receive a third write request, wherein the third write request carries a third logical block address and third to-be-written data; obtain a fingerprint of the third to-be-written data, wherein the fingerprint of the third to-be-written data is the first fingerprint; establish a mapping relationship between the third logical block address and the second storage address when querying the fingerprint table according to the first fingerprint of the third to-be-written data to determine that a storage address corresponding to the first fingerprint is the second storage address.
     
    11. The storage system according to any one of claims 8 to 10, wherein the controller is further configured to record a quantity of reference times of the second storage address in the fingerprint table.
     
    12. The storage system according to any one of claims 8 to 11, wherein the controller is further configured to record, in the fingerprint table, time when the first fingerprint is inserted.
     
    13. The storage system according to claim 12, wherein the controller is further configured to delete a second fingerprint, wherein no storage address corresponding to the second fingerprint exists, and duration for which the second fingerprint exists in the fingerprint table exceeds preset duration.
     
    14. The storage system according to claim 8, wherein the controller is further configured to:
    count a quantity of times that a received write request carries to-be-written data whose fingerprint value is the first fingerprint, store the second to-be-written data at the second storage address, and establish the mapping relationship between the first fingerprint and the second storage address in the fingerprint table when the quantity of times is greater than a preset quantity N of times,, wherein N is an integer not less than 1.
     
    15. A controller applied to a storage system, wherein the storage system comprises the controller and a storage device, the controller comprises a receiving unit (1401), an obtaining unit (1402), an insertion unit (1403), an allocation unit (1404), a storage unit (1405), and an establishment unit (1406), wherein the receiving unit (1401) is configured to receive a first write request, wherein the first write request carries a first logical block address and first to-be-written data;
    the obtaining unit (1402) is configured to obtain a first fingerprint of the first to-be-written data; the insertion unit (1403) is configured to: insert the first fingerprint into a fingerprint table when the fingerprint table does not comprise the first fingerprint, wherein there is no storage address corresponding to the first fingerprint in the fingerprint table;
    the allocation unit (1404) is configured to allocate a first storage address from the storage device to the first to-be-written data;
    the storage unit (1405) is configured to store the first to-be-written data at the first storage address;
    the establishment unit (1406) is configured to establish a mapping relationship between the first logical block address and the first storage address;
    the receiving unit (1401) is further configured to receive a second write request, wherein the second write request carries a second logical block address and second to-be-written data;
    the obtaining unit (1402) is further configured to obtain a fingerprint of the second to-be-written data, wherein the fingerprint of the second to-be-written data is the first fingerprint;
    the allocation unit (1404) is further configured to: allocate a second storage address from the storage device to the second to-be-written data when querying the fingerprint table according to the first fingerprint of the second to-be-written data to determine that no storage address corresponding to the first fingerprint exists in the fingerprint table;
    the storage unit (1405) is further configured to store the second to-be-written data at the second storage address; and
    the establishment unit (1406) is further configured to establish a mapping relationship between the second logical block address and the second storage address and establish a mapping relationship between the first fingerprint and the second storage address in the fingerprint table.
     
    16. The controller according to claim 15, wherein the allocation unit (1404) is specifically configured to allocate the first storage address from a first storage area of the storage device to the first to-be-written data and allocate the second storage address from a second storage area of the storage device to the second to-be-written data, wherein storage performance of the second storage area is higher than storage performance of the first storage area.
     
    17. The controller according to claim 15 or 16, wherein the receiving unit (1401) is further configured to receive a third write request, wherein the third write request carries a third logical block address and third to-be-written data;
    the obtaining unit (1402) is further configured to obtain a fingerprint of the third to-be-written data, wherein the fingerprint of the third to-be-written data is the first fingerprint; and
    the establishment unit (1406) is further configured to: establish a mapping relationship between the third logical block address and the second storage address when the fingerprint table is queried according to the first fingerprint of the third to-be-written data to determine that a storage address corresponding to the first fingerprint is the second storage address.
     
    18. The controller according to any one of claims 15 to 17, wherein the controller further comprises a record unit, and the record unit is configured to record a quantity of reference times of the second storage address in the fingerprint table.
     
    19. The controller according to any one of claims 15 to 18, wherein the record unit is further configured to record, in the fingerprint table, time when the first fingerprint is inserted.
     
    20. The controller according to claim 19, wherein the controller further comprises a deletion unit, and the deletion unit is configured to delete a second fingerprint from the fingerprint table, wherein no storage address corresponding to the second fingerprint exists, and duration for which the second fingerprint exists in the fingerprint table exceeds preset duration.
     
    21. The controller according to claim 15, wherein the controller further comprises a counting unit, configured to count a quantity of times that a received write request carries to-be-written data whose fingerprint value is the first fingerprint; the storage unit stores the second to-be-written data at the second storage address, and the establishment unit establishes the mapping relationship between the first fingerprint and the second storage address in the fingerprint table when the quantity of times is greater than a preset quantity N of times, wherein N is an integer not less than 1.
     


    Ansprüche

    1. Verfahren zur Deduplizierung in einem Speichersystem, wobei das Speichersystem eine Steuerung und eine Speichervorrichtung umfasst, und das Verfahren umfasst:

    Empfangen (1301) durch die Steuerung einer ersten Schreibanforderung, wobei die erste Schreibanforderung eine erste logische Blockadresse und erste zu schreibende Daten mitführt;

    Abrufen (1302) durch die Steuerung eines ersten Fingerabdrucks der ersten zu schreibenden Daten;

    Einfügen (1303) durch die Steuerung des ersten Fingerabdrucks in eine Fingerabdrucktabelle, wenn die Fingerabdrucktabelle den ersten Fingerabdruck nicht umfasst, und Zuweisen (1303) einer ersten Speicheradresse von der Speichervorrichtung zu den ersten zu schreibenden Daten, wobei es keine Speicheradresse gibt, die dem ersten Fingerabdruck in der Fingerabdrucktabelle entspricht;

    Speichern (1304) durch die Steuerung der ersten zu schreibenden Daten an der ersten Speicheradresse;

    Herstellen (1308) durch die Steuerung einer Zuordnungsbeziehung zwischen der ersten logischen Blockadresse und der ersten Speicheradresse;

    Empfangen (1305) durch die Steuerung einer zweiten Schreibanforderung, wobei die zweite Schreibanforderung eine zweite logische Blockadresse und zweite zu schreibende Daten mitführt;

    Abrufen (1306) durch die Steuerung eines Fingerabdrucks der zweiten zu schreibenden Daten, wobei der Fingerabdruck der zweiten zu schreibenden Daten der erste Fingerabdruck ist;

    Zuweisen (1307) durch die Steuerung einer zweiten Speicheradresse von der Speichervorrichtung zu den zweiten zu schreibenden Daten, wenn die Steuerung die Fingerabdrucktabelle gemäß dem ersten Fingerabdruck der zweiten zu schreibenden Daten abfragt und bestimmt, dass keine Speicheradresse vorhanden ist, die dem ersten Fingerabdruck entspricht;

    Speichern durch die Steuerung der zweiten zu schreibenden Daten an der zweiten Speicheradresse;

    Herstellen durch die Steuerung einer Zuordnungsbeziehung zwischen dem ersten Fingerabdruck und der zweiten Speicheradresse in der Fingerabdrucktabelle; und

    Herstellen durch die Steuerung einer Zuordnungsbeziehung zwischen der zweiten logischen Blockadresse und der zweiten Speicheradresse.


     
    2. Verfahren nach Anspruch 1, wobei das Zuweisen (1303) durch die Steuerung einer ersten Speicheradresse von der Speichervorrichtung zu den ersten zu schreibenden Daten insbesondere umfasst: Zuweisen durch die Steuerung der ersten Speicheradresse von einem ersten Speicherbereich der Speichervorrichtung zu den ersten zu schreibenden Daten; und das Zuweisen durch die Steuerung einer zweiten Speicheradresse von der Speichervorrichtung zu den zweiten zu schreibenden Daten insbesondere umfasst: Zuweisen durch die Steuerung der zweiten Speicheradresse von einem zweiten Speicherbereich der Speichervorrichtung zu den zweiten zu schreibenden Daten, wobei eine Speicherleistung des zweiten Speicherbereichs höher als eine Speicherleistung des ersten Speicherbereichs ist.
     
    3. Verfahren nach Anspruch 1 oder 2, wobei das Verfahren ferner umfasst:

    Empfangen durch die Steuerung einer dritten Schreibanforderung, wobei die dritte Schreibanforderung eine dritte logische Blockadresse und dritte zu schreibende Daten mitführt;

    Abrufen durch die Steuerung eines Fingerabdrucks der dritten zu schreibenden Daten, wobei der Fingerabdruck der dritten zu schreibenden Daten der erste Fingerabdruck ist; und

    Herstellen durch die Steuerung einer Zuordnungsbeziehung zwischen der dritten logischen Blockadresse und der zweiten Speicheradresse bei Abfrage der Fingerabdrucktabelle gemäß dem ersten Fingerabdruck der dritten zu schreibenden Daten, um zu bestimmen, dass eine Speicheradresse, die dem ersten Fingerabdruck entspricht, die zweite Speicheradresse ist.


     
    4. Verfahren nach einem der Ansprüche 1 bis 3, wobei das Verfahren ferner umfasst:
    Aufzeichnen durch die Steuerung einer Anzahl von Referenzmalen der zweiten Speicheradresse in der Fingerabdrucktabelle.
     
    5. Verfahren nach einem der Ansprüche 1 bis 4, wobei das Verfahren ferner umfasst:
    Aufzeichnen durch die Steuerung in der Fingerabdrucktabelle einer Zeit, zu welcher der erste Fingerabdruck eingefügt wird.
     
    6. Verfahren nach Anspruch 5, wobei das Verfahren ferner umfasst:
    Löschen durch die Steuerung eines zweiten Fingerabdrucks aus der Fingerabdrucktabelle, wobei keine Speicheradresse, die dem zweiten Fingerabdruck entspricht, vorhanden ist, und eine Dauer, für welche der zweite Fingerabdruck in der Fingerabdrucktabelle vorhanden ist, eine voreingestellte Dauer überschreitet.
     
    7. Verfahren nach Anspruch 1, wobei das Verfahren ferner umfasst:
    Zählen durch die Steuerung einer Anzahl von Malen, die eine empfangene Schreibanforderung zu schreibende Daten mitführt, deren Fingerabdruck der erste Fingerabdruck ist, Speichern durch die Steuerung der zweiten zu schreibenden Daten an der zweiten Speicheradresse und Herstellen der Zuordnungsbeziehung zwischen dem ersten Fingerabdruck und der zweiten Speicheradresse in der Fingerabdrucktabelle, wenn die Anzahl von Malen höher als eine voreingestellte Anzahl N von Malen ist, wobei N eine ganze Zahl von mindestens 1 ist.
     
    8. Speichersystem, umfassend eine Speichersteuerung und eine Speichervorrichtung, wobei die Steuerung konfiguriert ist zum: Empfangen einer ersten Schreibanforderung, wobei die erste Schreibanforderung eine erste logische Blockadresse und erste zu schreibende Daten mitführt; Abrufen eines ersten Fingerabdrucks der ersten zu schreibenden Daten; Einfügen des ersten Fingerabdrucks in eine Fingerabdrucktabelle, wenn die Fingerabdrucktabelle den ersten Fingerabdruck nicht umfasst, und Zuweisen einer ersten Speicheradresse von der Speichervorrichtung zu den ersten zu schreibenden Daten; Speichern der ersten zu schreibenden Daten an der ersten Speicheradresse; und Herstellen einer Zuordnungsbeziehung zwischen der ersten logischen Blockadresse und der ersten Speicheradresse, wobei es keine Speicheradresse gibt, die dem ersten Fingerabdruck in der Fingerabdrucktabelle entspricht;
    wobei die Steuerung ferner konfiguriert ist zum: Empfangen einer zweiten Schreibanforderung, wobei die zweite Schreibanforderung eine zweite logische Blockadresse und zweite zu schreibende Daten mitführt;
    Abrufen eines Fingerabdrucks der zweiten zu schreibenden Daten, wobei der Fingerabdruck der zweiten zu schreibenden Daten der erste Fingerabdruck ist; Zuweisen einer zweiten Speicheradresse von der Speichervorrichtung zu den zweiten zu schreibenden Daten bei Abfrage der Fingerabdrucktabelle gemäß dem ersten Fingerabdruck der zweiten zu schreibenden Daten, um zu bestimmen, dass keine Speicheradresse vorhanden ist, die dem ersten Fingerabdruck entspricht; Speichern der zweiten zu schreibenden Daten an der zweiten Speicheradresse; Herstellen einer Zuordnungsbeziehung zwischen der zweiten logischen Blockadresse und der zweiten Speicheradresse; und Herstellen einer Zuordnungsbeziehung zwischen dem ersten Fingerabdruck und der zweiten Speicheradresse in der Fingerabdrucktabelle; und wobei die Speichervorrichtung zum Bereitstellen der ersten Speicheradresse und der zweiten Speicheradresse konfiguriert ist.
     
    9. Speichersystem nach Anspruch 8, wobei die Steuerung insbesondere zum Zuweisen der ersten Speicheradresse von einem ersten Speicherbereich der Speichervorrichtung zu den ersten zu schreibenden Daten und Zuweisen der zweiten Speicheradresse von einem zweiten Speicherbereich der Speichervorrichtung zu den zweiten zu schreibenden Daten konfiguriert ist, wobei eine Speicherleistung des zweiten Speicherbereichs höher als eine Speicherleistung des ersten Speicherbereichs ist.
     
    10. Speichersystem nach Anspruch 8 oder 9, wobei die Steuerung ferner konfiguriert ist zum: Empfangen einer dritten Schreibanforderung, wobei die dritte Schreibanforderung eine dritte logische Blockadresse und dritte zu schreibende Daten mitführt; Abrufen eines Fingerabdrucks der dritten zu schreibenden Daten, wobei der Fingerabdruck der dritten zu schreibenden Daten der erste Fingerabdruck ist; und Herstellen einer Zuordnungsbeziehung zwischen der dritten logischen Blockadresse und der zweiten Speicheradresse bei Abfrage der Fingerabdrucktabelle gemäß dem ersten Fingerabdruck der dritten zu schreibenden Daten, um zu bestimmen, dass eine Speicheradresse, die dem ersten Fingerabdruck entspricht, die zweite Speicheradresse ist.
     
    11. Speichersystem nach einem der Ansprüche 8 bis 10, wobei die Steuerung ferner zum Aufzeichnen einer Anzahl von Referenzmalen der zweiten Speicheradresse in der Fingerabdrucktabelle konfiguriert ist.
     
    12. Speichersystem nach einem der Ansprüche 8 bis 11, wobei die Steuerung ferner so konfiguriert ist, dass sie in der Fingerabdrucktabelle eine Zeit aufzeichnet, zu welcher der erste Fingerabdruck eingefügt wird.
     
    13. Speichersystem nach Anspruch 12, wobei die Steuerung ferner zum Löschen eines zweiten Fingerabdrucks konfiguriert ist, wobei keine Speicheradresse, die dem zweiten Fingerabdruck entspricht, vorhanden ist, und eine Dauer, für welche der zweite Fingerabdruck in der Fingerabdrucktabelle vorhanden ist, eine voreingestellte Dauer überschreitet.
     
    14. Speichersystem nach Anspruch 8, wobei die Steuerung ferner konfiguriert ist zum: Zählen einer Anzahl von Malen, die eine empfangene Schreibanforderung zu schreibende Daten mitführt, deren Fingerabdruck der erste Fingerabdruck ist, Speichern der zweiten zu schreibenden Daten an der zweiten Speicheradresse und Herstellen der Zuordnungsbeziehung zwischen dem ersten Fingerabdruck und der zweiten Speicheradresse in der Fingerabdrucktabelle, wenn die Anzahl von Malen höher als eine voreingestellte Anzahl N von Malen ist, wobei N eine ganze Zahl von mindestens 1 ist.
     
    15. Steuerung, die auf ein Speichersystem angewendet wird, wobei das Speichersystem die Steuerung und eine Speichervorrichtung umfasst, und die Steuerung eine Empfangseinheit (1401), eine Abrufeinheit (1402), eine Einfügungseinheit (1403), eine Zuweisungseinheit (1404), eine Speichereinheit (1405) und eine Herstellungseinheit (1406) umfasst,
    wobei die Empfangseinheit (1401) zum Empfangen einer ersten Schreibanforderung konfiguriert ist, wobei die erste Schreibanforderung eine erste logische Blockadresse und erste zu schreibende Daten mitführt;
    die Abrufeinheit (1402) zum Abrufen eines ersten Fingerabdrucks der ersten zu schreibenden Daten konfiguriert ist;
    die Einfügungseinheit (1403) konfiguriert ist zum: Einfügen des ersten Fingerabdrucks in eine Fingerabdrucktabelle, wenn die Fingerabdrucktabelle den ersten Fingerabdruck nicht umfasst, wobei es keine Speicheradresse gibt, die dem ersten Fingerabdruck in der Fingerabdrucktabelle entspricht;
    die Zuweisungseinheit (1404) zum Zuweisen einer ersten Speicheradresse von der Speichervorrichtung zu den ersten zu schreibenden Daten konfiguriert ist;
    die Speichereinheit (1405) zum Speichern der ersten zu schreibenden Daten an der ersten Speicheradresse konfiguriert ist;
    die Herstellungseinheit (1406) zum Herstellen einer Zuordnungsbeziehung zwischen der ersten logischen Blockadresse und der ersten Speicheradresse konfiguriert ist; die Empfangseinheit (1401) ferner zum Empfangen einer zweiten Schreibanforderung konfiguriert ist, wobei die zweite Schreibanforderung eine zweite logische Blockadresse und zweite zu schreibende Daten mitführt;
    die Abrufeinheit (1402) ferner zum Abrufen eines Fingerabdrucks der zweiten zu schreibenden Daten konfiguriert ist, wobei der Fingerabdruck der zweiten zu schreibenden Daten der erste Fingerabdruck ist;
    die Zuweisungseinheit (1404) ferner konfiguriert ist zum: Zuweisen einer zweiten Speicheradresse von der Speichervorrichtung zu den zweiten zu schreibenden Daten bei Abfrage der Fingerabdrucktabelle gemäß dem ersten Fingerabdruck der zweiten zu schreibenden Daten, um zu bestimmen, dass keine Speicheradresse in der Fingerabdrucktabelle vorhanden ist, die dem ersten Fingerabdruck entspricht;
    die Speichereinheit (1405) zum Speichern der zweiten zu schreibenden Daten an der zweiten Speicheradresse konfiguriert ist; und
    die Herstellungseinheit (1406) ferner konfiguriert ist zum: Herstellen einer Zuordnungsbeziehung zwischen der zweiten logischen Blockadresse und der zweiten Speicheradresse und Herstellen einer Zuordnungsbeziehung zwischen dem ersten Fingerabdruck und der zweiten Speicheradresse in der Fingerabdrucktabelle.
     
    16. Steuerung nach Anspruch 15, wobei die Zuweisungseinheit (1404) insbesondere zum Zuweisen der ersten Speicheradresse von einem ersten Speicherbereich der Speichervorrichtung zu den ersten zu schreibenden Daten und Zuweisen der zweiten Speicheradresse von einem zweiten Speicherbereich der Speichervorrichtung zu den zweiten zu schreibenden Daten konfiguriert ist, wobei eine Speicherleistung des zweiten Speicherbereichs höher als eine Speicherleistung des ersten Speicherbereichs ist.
     
    17. Steuerung nach Anspruch 15 oder 16, wobei die Empfangseinheit (1401) ferner zum Empfangen einer dritten Schreibanforderung konfiguriert ist, wobei die dritte Schreibanforderung eine dritte logische Blockadresse und dritte zu schreibende Daten mitführt;
    die Abrufeinheit (1402) ferner zum Abrufen eines Fingerabdrucks der dritten zu schreibenden Daten konfiguriert ist, wobei der Fingerabdruck der dritten zu schreibenden Daten der erste Fingerabdruck ist; und
    die Herstellungseinheit (1406) ferner konfiguriert ist zum: Herstellen einer Zuordnungsbeziehung zwischen der dritten logischen Blockadresse und der zweiten Speicheradresse, wenn die Fingerabdrucktabelle gemäß dem ersten Fingerabdruck der dritten zu schreibenden Daten abgefragt wird, um zu bestimmen, dass eine Speicheradresse, die dem ersten Fingerabdruck entspricht, die zweite Speicheradresse ist.
     
    18. Steuerung nach einem der Ansprüche 15 bis 17, wobei die Steuerung ferner eine Aufzeichnungseinheit umfasst, und die Aufzeichnungseinheit zum Aufzeichnen einer Anzahl von Referenzmalen der zweiten Speicheradresse in der Fingerabdrucktabelle konfiguriert ist.
     
    19. Steuerung nach einem der Ansprüche 15 bis 18, wobei die Aufzeichnungseinheit ferner so konfiguriert ist, dass sie in der Fingerabdrucktabelle eine Zeit aufzeichnet, zu welcher der erste Fingerabdruck eingefügt wird.
     
    20. Steuerung nach Anspruch 19, wobei die Steuerung ferner eine Löscheinheit umfasst, und die Löscheinheit zum Löschen eines zweiten Fingerabdrucks aus der Fingerabdrucktabelle konfiguriert ist, wobei keine Speicheradresse, die dem zweiten Fingerabdruck entspricht, vorhanden ist, und eine Dauer, für welche der zweite Fingerabdruck in der Fingerabdrucktabelle vorhanden ist, eine voreingestellte Dauer überschreitet.
     
    21. Steuerung nach Anspruch 15, wobei die Steuerung ferner eine Zähleinheit umfasst, die so konfiguriert ist, dass sie eine Anzahl von Malen zählt, die eine empfangene Schreibanforderung zu schreibende Daten mitführt, deren Fingerabdruck der erste Fingerabdruck ist; wobei die Speichereinheit die zweiten zu schreibenden Daten an der zweiten Speicheradresse speichert, und die Herstellungseinheit die Zuordnungsbeziehung zwischen dem ersten Fingerabdruck und der zweiten Speicheradresse in der Fingerabdrucktabelle herstellt, wenn die Anzahl von Malen höher als eine voreingestellte Anzahl N von Malen ist, wobei N eine ganze Zahl von mindestens 1 ist.
     


    Revendications

    1. Procédé de déduplication exécuté dans un système de stockage, le système de stockage comprenant un contrôleur et un dispositif de stockage, et le procédé comprenant les étapes consistant à :

    recevoir (1301), par le contrôleur, une première demande d'écriture, la première demande d'écriture contenant une première adresse de bloc logique et des premières données à écrire ;

    obtenir (1302), par le contrôleur, une première empreinte digitale des premières données à écrire ;

    insérer (1303), par le contrôleur, la première empreinte digitale dans une table d'empreintes digitales lorsque la table d'empreintes digitales ne contient pas la première empreinte digitale, et attribuer (1303) une première adresse de stockage provenant du dispositif de stockage aux premières données à écrire, aucune adresse de stockage ne correspondant à la première empreinte digitale dans la table d'empreintes digitales ;

    stocker (1304), par le contrôleur, les premières données à écrire à la première adresse de stockage ;

    établir (1308), par le contrôleur, une relation de correspondance entre la première adresse de bloc logique et la première adresse de stockage ;

    recevoir (1305), par le contrôleur, une deuxième demande d'écriture, la deuxième demande d'écriture contenant une deuxième adresse de bloc logique et des deuxièmes données à écrire ;

    obtenir (1306), par le contrôleur, une empreinte digitale des deuxièmes données à écrire, l'empreinte digitale des deuxièmes données à écrire étant la première empreinte digitale ;

    attribuer (1307), par le contrôleur, une deuxième adresse de stockage provenant du dispositif de stockage aux deuxièmes données à écrire lorsque le contrôleur interroge la table d'empreintes digitales selon la première empreinte digitale des deuxièmes données à écrire et détermine qu'il n'existe aucune adresse de stockage correspondant à la première empreinte digitale ;

    stocker, par le contrôleur, les deuxièmes données à écrire à la deuxième adresse de stockage ;

    établir, par le contrôleur, une relation de correspondance entre la première empreinte digitale et la deuxième adresse de stockage dans la table d'empreintes digitales ; et

    établir, par le contrôleur, une relation de correspondance entre la deuxième adresse de bloc logique et la deuxième adresse de stockage.


     
    2. Procédé selon la revendication 1, dans lequel l'attribution (1303), par le contrôleur, d'une première adresse de stockage provenant du dispositif de stockage aux premières données à écrire comprend spécifiquement l'étape consistant à : attribuer, par le contrôleur, la première adresse de stockage provenant d'une première zone de stockage du dispositif de stockage aux premières données à écrire ; et l'attribution, par le contrôleur, d'une deuxième adresse de stockage provenant du dispositif de stockage aux deuxièmes données à écrire comprend spécifiquement l'étape consistant à : attribuer, par le contrôleur, la deuxième adresse de stockage provenant d'une deuxième zone de stockage du dispositif de stockage aux deuxièmes données à écrire, les performances de stockage de la deuxième zone de stockage étant supérieures aux performances de stockage de la première zone de stockage.
     
    3. Procédé selon la revendication 1 ou 2, le procédé comprenant également les étapes consistant à :

    recevoir, par le contrôleur, une troisième demande d'écriture, la troisième demande d'écriture contenant une troisième adresse de bloc logique et des troisièmes données à écrire ;

    obtenir, par le contrôleur, une empreinte digitale des troisièmes données à écrire, l'empreinte digitale des troisièmes données à écrire étant la première empreinte digitale ; et

    établir, par le contrôleur, une relation de correspondance entre la troisième adresse de bloc logique et la deuxième adresse de stockage lors de l'interrogation de la table d'empreintes digitales selon la première empreinte digitale des troisièmes données à écrire pour déterminer qu'une adresse de stockage correspondant à la première empreinte digitale est la deuxième adresse de stockage.


     
    4. Procédé selon l'une quelconque des revendications 1 à 3, le procédé comprenant également l'étape consistant à :
    enregistrer, par le contrôleur, une quantité d'instants de référence de la deuxième adresse de stockage dans la table d'empreintes digitales.
     
    5. Procédé selon l'une quelconque des revendications 1 à 4, le procédé comprenant également l'étape consistant à :
    enregistrer, par le contrôleur dans la table d'empreintes digitales, l'instant auquel la première empreinte digitale est insérée.
     
    6. Procédé selon la revendication 5, le procédé comprenant également l'étape consistant à :
    supprimer, par le contrôleur, une deuxième empreinte digitale dans la table d'empreintes digitales, aucune adresse de stockage ne correspondant à la deuxième empreinte digitale et la durée pendant laquelle la deuxième empreinte digitale existe dans la table d'empreintes digitales dépassant une durée prédéfinie.
     
    7. Procédé selon la revendication 1, le procédé comprenant également les étapes consistant à :
    compter, par le contrôleur, une quantité de fois où une demande d'écriture reçue contient des données à écrire dont la valeur d'empreinte digitale est la première empreinte digitale, stocker, par le contrôleur les deuxièmes données à écrire à la deuxième adresse de stockage, et établir la relation de correspondance entre la première empreinte digitale et la deuxième adresse de stockage dans la table d'empreintes digitales lorsque la quantité de fois est supérieure à une quantité prédéfinie N de fois, N étant un entier non inférieur à 1.
     
    8. Système de stockage, comprenant un contrôleur de stockage et un dispositif de stockage, le contrôleur étant configuré pour : recevoir une première demande d'écriture, la première demande d'écriture contenant une première adresse de bloc logique et des premières données à écrire ; obtenir une première empreinte digitale des premières données à écrire ; insérer la première empreinte digitale dans une table d'empreintes digitales lorsque la table d'empreintes digitales ne contient pas la première empreinte digitale, et attribuer une première adresse de stockage provenant du dispositif de stockage aux premières données à écrire ; stocker les premières données à écrire à la première adresse de stockage ; et établir une relation de correspondance entre la première adresse de bloc logique et la première adresse de stockage, aucune adresse de stockage ne correspondant à la première empreinte digitale dans la table d'empreintes digitales ;
    le contrôleur étant également configuré pour : recevoir une deuxième demande d'écriture, la deuxième demande d'écriture contenant une deuxième adresse de bloc logique et des deuxièmes données à écrire ; obtenir une empreinte digitale des deuxièmes données à écrire, l'empreinte digitale des deuxièmes données à écrire étant la première empreinte digitale ; attribuer une deuxième adresse de stockage provenant du dispositif de stockage aux deuxièmes données à écrire lors de l'interrogation de la table d'empreintes digitales selon la première empreinte digitale des deuxièmes données à écrire pour déterminer qu'il n'existe aucune adresse de stockage correspondant à la première empreinte digitale ; stocker les deuxièmes données à écrire à la deuxième adresse de stockage ; établir une relation de correspondance entre la deuxième adresse de bloc logique et la deuxième adresse de stockage ; et établir une relation de correspondance entre la première empreinte digitale et la deuxième adresse de stockage dans la table d'empreintes digitales ; et
    le dispositif de stockage étant configuré pour fournir la première adresse de stockage et la deuxième adresse de stockage.
     
    9. Système de stockage selon la revendication 8, dans lequel le contrôleur est spécifiquement configuré pour attribuer la première adresse de stockage provenant d'une première zone de stockage du dispositif de stockage aux premières données à écrire et attribuer la deuxième adresse de stockage provenant d'une deuxième zone de stockage du dispositif de stockage aux deuxièmes données à écrire, les performances de stockage de la deuxième zone de stockage étant supérieures aux performances de stockage de la première zone de stockage.
     
    10. Système de stockage selon la revendication 8 ou 9, dans lequel le contrôleur est également configuré pour :
    recevoir une troisième demande d'écriture, la troisième demande d'écriture contenant une troisième adresse de bloc logique et des troisièmes données à écrire ; obtenir une empreinte digitale des troisièmes données à écrire, l'empreinte digitale des troisièmes données à écrire étant la première empreinte digitale ; établir une relation de correspondance entre la troisième adresse de bloc logique et la deuxième adresse de stockage lors de l'interrogation de la table d'empreintes digitales selon la première empreinte digitale des troisièmes données à écrire pour déterminer qu'une adresse de stockage correspondant à la première empreinte digitale est la deuxième adresse de stockage.
     
    11. Système de stockage selon l'une quelconque des revendications 8 à 10, dans lequel le contrôleur est également configuré pour enregistrer une quantité d'instants de référence de la deuxième adresse de stockage dans la table d'empreintes digitales.
     
    12. Système de stockage selon l'une quelconque des revendications 8 à 11, dans lequel le contrôleur est également configuré pour enregistrer, dans la table d'empreintes digitales, l'instant auquel la première empreinte digitale est insérée.
     
    13. Système de stockage selon la revendication 12, dans lequel le contrôleur est également configuré pour supprimer une deuxième empreinte digitale, aucune adresse de stockage ne correspondant à la deuxième empreinte digitale et la durée pendant laquelle la deuxième empreinte digitale existe dans la table d'empreintes digitales dépassant une durée prédéfinie.
     
    14. Système de stockage selon la revendication 8, dans lequel le contrôleur est également configuré pour :
    compter une quantité de fois où une demande d'écriture reçue contient des données à écrire dont la valeur d'empreinte digitale est la première empreinte digitale, stocker les deuxièmes données à écrire à la deuxième adresse de stockage, et établir la relation de correspondance entre la première empreinte digitale et la deuxième adresse de stockage dans la table d'empreintes digitales lorsque la quantité de fois est supérieure à une quantité prédéfinie N de fois, N étant un entier non inférieur à 1.
     
    15. Contrôleur appliqué à un système de stockage, le système de stockage comprenant le contrôleur et un dispositif de stockage, le contrôleur comprenant une unité de réception (1401), une unité d'obtention (1402), une unité d'insertion (1403), une unité d'attribution (1404), une unité de stockage (1405), et une unité d'établissement (1406), l'unité de réception (1401) étant configurée pour recevoir une première demande d'écriture, la première demande d'écriture contenant une première adresse de bloc logique et des premières données à écrire ; dans lequel l'unité d'obtention (1402) est configurée pour obtenir une première empreinte digitale des premières données à écrire ;
    l'unité d'insertion (1403) est configurée pour : insérer la première empreinte digitale dans une table d'empreintes digitales lorsque la table d'empreintes digitales ne contient pas la première empreinte digitale, aucune adresse de stockage ne correspondant à la première empreinte digitale dans la table d'empreintes digitales ; l'unité d'attribution (1404) est configurée pour attribuer une première adresse de stockage provenant du dispositif de stockage aux premières données à écrire,
    l'unité de stockage (1405) est configurée pour stocker les premières données à écrire à la première adresse de stockage ;
    l'unité d'établissement (1406) est configurée pour établir une relation de correspondance entre la première adresse de bloc logique et la première adresse de stockage ;
    l'unité de réception (1401) est également configurée pour recevoir une deuxième demande d'écriture, la deuxième demande d'écriture contenant une deuxième adresse de bloc logique et des deuxièmes données à écrire ;
    l'unité d'obtention (1402) est également configurée pour obtenir une empreinte digitale des deuxièmes données à écrire, l'empreinte digitale des deuxièmes données à écrire étant la première empreinte digitale ;
    l'unité d'attribution (1404) est également configurée pour : attribuer une deuxième adresse de stockage provenant du dispositif de stockage aux deuxièmes données à écrire lors de l'interrogation de la table d'empreintes digitales selon la première empreinte digitale des deuxièmes données à écrire pour déterminer qu'il n'existe aucune adresse de stockage correspondant à la première empreinte digitale dans la table d'empreintes digitales ;
    l'unité de stockage (1405) est également configurée pour stocker les deuxièmes données à écrire à la deuxième adresse de stockage ; et
    l'unité d'établissement (1406) est également configurée pour établir une relation de correspondance entre la deuxième adresse de bloc logique et la deuxième adresse de stockage et établir une relation de correspondance entre la première empreinte digitale et la deuxième adresse de stockage dans la table d'empreintes digitales.
     
    16. Contrôleur selon la revendication 15, dans lequel l'unité d'attribution (1404) est spécifiquement configurée pour attribuer la première adresse de stockage provenant d'une première zone de stockage du dispositif de stockage aux premières données à écrire et attribuer la deuxième adresse de stockage provenant d'une deuxième zone de stockage du dispositif de stockage aux deuxièmes données à écrire, les performances de stockage de la deuxième zone de stockage étant supérieures aux performances de stockage de la première zone de stockage.
     
    17. Contrôleur selon la revendication 15 ou 16, dans lequel l'unité de réception (1401) est également configurée pour recevoir une troisième demande d'écriture, la troisième demande d'écriture contenant une troisième adresse de bloc logique et des troisièmes données à écrire ;
    l'unité d'obtention (1402) est également configurée pour obtenir une empreinte digitale des troisièmes données à écrire, l'empreinte digitale des troisièmes données à écrire étant la première empreinte digitale ; et
    l'unité d'établissement (1406) est également configurée pour : établir une relation de correspondance entre la troisième adresse de bloc logique et la deuxième adresse de stockage lorsque la table d'empreintes digitales est interrogée selon la première empreinte digitale des troisièmes données à écrire pour déterminer qu'une adresse de stockage correspondant à la première empreinte digitale est la deuxième adresse de stockage.
     
    18. Contrôleur selon l'une quelconque des revendications 15 à 17, le contrôleur comprenant également une unité d'enregistrement, et l'unité d'enregistrement étant configurée pour enregistrer une quantité d'instants de référence de la deuxième adresse de stockage dans la table d'empreintes digitales.
     
    19. Contrôleur selon l'une quelconque des revendications 15 à 18, dans lequel l'unité d'enregistrement est également configurée pour enregistrer, dans la table d'empreintes digitales, l'instant auquel la première empreinte digitale est insérée.
     
    20. Contrôleur selon la revendication 19, le contrôleur comprenant également une unité de suppression, et l'unité de suppression étant configurée pour supprimer une deuxième empreinte digitale dans la table d'empreintes digitales, aucune adresse de stockage ne correspondant à la deuxième empreinte digitale et la durée pendant laquelle la deuxième empreinte digitale existe dans la table d'empreintes digitales dépassant une durée prédéfinie.
     
    21. Contrôleur selon la revendication 15, le contrôleur comprenant également une unité de comptage, configurée pour compter une quantité de fois où une demande d'écriture reçue contient des données à écrire dont la valeur d'empreinte digitale est la première empreinte digitale ; l'unité de stockage stockant les deuxièmes données à écrire à la deuxième adresse de stockage, et l'unité d'établissement établissant la relation de correspondance entre la première empreinte digitale et la deuxième adresse de stockage dans la table d'empreintes digitales lorsque la quantité de fois est supérieure à une quantité prédéfinie N de fois, N étant un entier non inférieur à 1.
     




    Drawing























    Cited references

    REFERENCES CITED IN THE DESCRIPTION



    This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

    Patent documents cited in the description