(19)
(11)EP 4 075 252 A1

(12)EUROPEAN PATENT APPLICATION
published in accordance with Art. 153(4) EPC

(43)Date of publication:
19.10.2022 Bulletin 2022/42

(21)Application number: 20912213.4

(22)Date of filing:  29.12.2020
(51)International Patent Classification (IPC): 
G06F 3/06(2006.01)
(86)International application number:
PCT/CN2020/141063
(87)International publication number:
WO 2021/139571 (15.07.2021 Gazette  2021/28)
(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
Designated Extension States:
BA ME
Designated Validation States:
KH MA MD TN

(30)Priority: 08.01.2020 CN 202010018706
17.02.2020 CN 202010096222

(71)Applicant: Huawei Technologies Co., Ltd.
Longgang District Shenzhen, Guangdong 518129 (CN)

(72)Inventors:
  • CHEN, Can
    Shenzhen, Guangdong 518129 (CN)
  • CHEN, Ming
    Shenzhen, Guangdong 518129 (CN)
  • TAN, Chunyi
    Shenzhen, Guangdong 518129 (CN)

(74)Representative: Pfenning, Meinig & Partner mbB 
Patent- und Rechtsanwälte Theresienhöhe 11a
80339 München
80339 München (DE)

  


(54)DATA STORAGE METHOD, APPARATUS, AND SYSTEM AND DATA READING METHOD, APPARATUS, AND SYSTEM IN STORAGE SYSTEM


(57) This application discloses a data storage method, a data reading method, and an apparatus in a storage system, and the system, and belongs to the field of information technologies. The method includes: A first device generates N check units for M data units, where M and N are both positive integers, and M + N = K. The first device stores the K units in K hard disk modules in the storage system, where the K units include the M data units and the N check units. Each of the K hard disk modules stores one of the K units. Each hard disk module includes an interface module and a hard disk, and the interface module communicates with the hard disk. In this application, storage resources in the storage system can be fully utilized.




Description


[0001] This application claims priority to Chinese Patent Application No. 202010018706.6, filed on January 8, 2020 and entitled "DATA STORAGE METHOD IN STORAGE SYSTEM AND STORAGE SYSTEM", and claims priority to Chinese Patent Application No. 202010096222.3, filed on February 17, 2020 and entitled "DATA STORAGE METHOD, DATA READING METHOD, AND APPARATUS IN STORAGE SYSTEM, AND SYSTEM", both of which are incorporated herein by reference in their entireties.

TECHNICAL FIELD



[0002] This application relates to the field of information technologies, and in particular, to a data storage method, a data reading method, and an apparatus in a storage system, and the system.

BACKGROUND



[0003] A distributed storage system may include a plurality of storage nodes. The storage nodes are storage servers, and each storage server includes storage resources, for example, a plurality of hard disks. The distributed storage system organizes storage resources on the storage nodes to provide storage services.

[0004] When storing data in the distributed storage system, a client usually divides the data into M data units, and obtains N check units of the data units according to an erasure coding (EC) algorithm. The client stores the M data units and the N check units in M + N storage nodes, that is, one of the M + N storage nodes stores one corresponding unit (a data unit or a check unit).

[0005] Although a capacity of a hard disk increases, and more hard disks can be mounted to a storage node, the client still uses the storage node as an EC algorithm-based storage granularity when storing data. Consequently, storage resources of hard disks cannot be fully utilized.

SUMMARY



[0006] This application provides a data storage method, a data reading method, and an apparatus in a storage system, and the system, to fully utilize storage resources in the storage system. The technical solutions are as follows:

[0007] According to a first aspect, an embodiment of this application provides a data storage method in a storage system. The method includes: A first device generates N check units for M data units, where M and N are both positive integers, and M + N = K. The first device stores the K units in K hard disk modules in the storage system, where the K units include the M data units and the N check units. Each of the K hard disk modules stores one of the K units. Each hard disk module includes an interface module and a hard disk, and the interface module communicates with the hard disk.

[0008] In this way, storage is performed at a granularity of a hard disk module in the storage system, that is, the K hard disk modules are used to store the K corresponding units. Compared with a conventional technology in which storage is performed at a granularity of a storage node, this can fully utilize storage resources in the storage system because a quantity of hard disk modules is greater than a quantity of storage nodes.

[0009] In a possible implementation, the storage system includes a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules. Because each storage node communicates with interface modules of a plurality of hard disk modules, computing resources of the storage node can be fully utilized, and a computing capability of a CPU of the storage node is fully utilized, thereby reducing a waste of computing resources.

[0010] In another possible implementation, the first device is a client of the storage system. The client sends the K units to a target storage node in the plurality of storage nodes, and the target storage node stores the K units in the K hard disk modules in the storage system. In this way, storage is performed at a granularity of a hard disk module in the storage system, so that storage resources in the storage system can be fully utilized.

[0011] In another possible implementation, the first device is one of the plurality of storage nodes.

[0012] In another possible implementation, the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.

[0013] In another possible implementation, the storage system includes a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the first device. In this way, when the first device is faulty, the second device may take over hard disk modules corresponding to the first device. In this way, data stored in the hard disk modules corresponding to the first device does not need to be recovered, thereby improving reliability of the storage system.

[0014] According to a second aspect, an embodiment of this application provides a data reading method in a storage system. In the method, the first device receives a read request, where the read request includes a data identifier of to-be-read data. The first device determines, from K hard disk modules in the storage system based on the data identifier, a hard disk module that stores the to-be-read data. The first device reads the to-be-read data from the hard disk module that stores the to-be-read data, where the to-be-read data belongs to data in M data units. The storage system further includes N check units of the M data units. M and N are both positive integers, and M + N = K. Each of the K hard disk modules stores one of the K units. The K units include the M data units and the N check units. Each hard disk module includes an interface module and a hard disk, and the interface module communicates with the hard disk. Because each of the K hard disk modules stores one of the K units, storage is performed at a granularity of a hard disk module in the storage system. Compared with a conventional technology in which storage is performed at a granularity of a storage node, this can fully utilize storage resources in the storage system because a quantity of hard disk modules is greater than a quantity of storage nodes.

[0015] In a possible implementation, the storage system includes a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules. Because each storage node communicates with a plurality of hard disk modules, computing resources of the storage node can be fully utilized, and a computing capability of a CPU of the storage node is fully utilized, thereby reducing a waste of computing resources.

[0016] In another possible implementation, the first device is a client of the storage system. The client sends the data read request to a target storage node in the plurality of storage nodes, where the data read request carries the data identifier. The target storage node reads, based on the data identifier, the to-be-read data from the hard disk module that stores the to-be-read data. Because the target storage node may read, based on the data identifier, the to-be-read data from the hard disk module that stores the to-be-read data, data may be stored at a granularity of a hard disk module in the storage system.

[0017] In another possible implementation, the first device is one of the plurality of storage nodes.

[0018] In another possible implementation, the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.

[0019] In another possible implementation, the storage system includes a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the first device. In this way, when the first device is faulty, the second device may take over hard disk modules corresponding to the first device. In this way, data stored in the hard disk modules corresponding to the first device does not need to be recovered, thereby improving reliability of the storage system.

[0020] According to a third aspect, this application provides a data storage apparatus in a storage system, configured to perform the method in any one of the first aspect or the possible implementations of the first aspect. Specifically, the apparatus includes units configured to perform the method in any one of the first aspect or the possible implementations of the first aspect.

[0021] According to a fourth aspect, this application provides a data reading apparatus in a storage system, configured to perform the method in any one of the second aspect or the possible implementations of the second aspect. Specifically, the apparatus includes units configured to perform the method in any one of the second aspect or the possible implementations of the second aspect.

[0022] According to a fifth aspect, this application provides a data storage apparatus in a storage system. The apparatus includes a processor and a communication interface. The processor communicates with the communication interface. The processor and the communication interface are configured to perform corresponding steps in the method in any one of the first aspect or the possible implementations of the first aspect.

[0023] According to a sixth aspect, this application provides a data reading apparatus in a storage system. The apparatus includes a processor and a communication interface. The processor communicates with the communication interface. The processor and the communication interface are configured to perform corresponding steps in the method in any one of the second aspect or the possible implementations of the second aspect.

[0024] According to a seventh aspect, this application provides a computer-readable storage medium. The computer-readable storage medium stores program code. When the program code is run on a computer, the computer is enabled to perform the method in any one of the first aspect, the second aspect, the possible implementations of the first aspect, or the possible implementations of the second aspect.

[0025] According to an eighth aspect, this application provides a computer program product including program code. When the computer program product runs on a computer, the computer is enabled to perform the method in any one of the first aspect, the second aspect, the possible implementations of the first aspect, or the possible implementations of the second aspect.

[0026] According to a ninth aspect, this application provides a storage system. The storage system includes a storage device and K hard disk modules. The storage device is configured to perform the method in any one of the first aspect, the possible implementations of the first aspect, the second aspect, or the possible implementations of the second aspect.

BRIEF DESCRIPTION OF DRAWINGS



[0027] 

FIG. 1 is a schematic structural diagram of a storage system according to an embodiment of this application;

FIG. 2 is a schematic structural diagram of another storage system according to an embodiment of this application;

FIG. 3 is a schematic structural diagram of another storage system according to an embodiment of this application;

FIG. 4 is a schematic structural diagram of another storage system according to an embodiment of this application;

FIG. 5 is a schematic structural diagram of another storage system according to an embodiment of this application;

FIG. 6 is a flowchart of a data storage method in a storage system according to an embodiment of this application;

FIG. 7 is a flowchart of another data storage method in a storage system according to an embodiment of this application;

FIG. 8 is a schematic structural diagram of a data storage apparatus in a storage system according to an embodiment of this application;

FIG. 9 is a schematic structural diagram of a data reading apparatus in a storage system according to an embodiment of this application;

FIG. 10 is a schematic structural diagram of another data storage apparatus in a storage system according to an embodiment of this application; and

FIG. 11 is a schematic structural diagram of another data reading apparatus in a storage system according to an embodiment of this application.


DESCRIPTION OF EMBODIMENTS



[0028] The following further describes in detail the embodiments of this application with reference to accompanying drawings.

[0029] Refer to FIG. 1. An embodiment of this application provides a storage system. The storage system includes a plurality of storage nodes, each storage node corresponds to a plurality of hard disk modules, and the storage node accesses hard disks in the plurality of hard disk modules. The hard disk module includes an interface module and a plurality of hard disks. The hard disk may be a mechanical disk, a solid state drive (Solid State Drive, SSD), or the like. The interface module may be a host bus adapter (Host Bus Adapter, HBA), a redundant array of independent disks (Redundant Array of Independent Disks, RID), an expander (Expander) card, a network interface controller (Network Interface Controller, NIC), or the like. This is not limited in this embodiment of the present invention. The interface module in the hard disk module communicates with the hard disks. The storage node communicates with the interface module of the hard disk module, to access the hard disks in the hard disk module.

[0030] The interface module may be implemented as a card, that is, the interface module may be an interface card.

[0031] An interface of the hard disk may be a serial attached small computer system interface (Serial Attached Small Computer System Interface, SAS), a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA), a high-speed serial computer expansion bus standard (Peripheral Component Interconnect express, PCIe), or the like.

[0032] The storage node may communicate with the hard disk module through a bus, for example, a PCIe bus. The storage node may alternatively communicate with the hard disk module through a network, for example, the Ethernet. This is not limited in this embodiment of the present invention.

[0033] In this embodiment of the present invention, the storage nodes communicate with each other. There is a mutual-backup relationship between one storage node and one or more other storage nodes in the storage system. The mutual-backup relationship means that one storage node can access a plurality of hard disk modules corresponding to another storage node. In other words, one storage node communicates with a hard disk module of another storage node that has a mutual-backup relationship with the one storage node, that is, the one storage node communicates with an interface module of the hard disk module of the another storage node that has the mutual-backup relationship with the one storage node.

[0034] It should be noted that when all storage nodes in a mutual-backup relationship are in a normal state, each storage node establishes a communication connection only to a plurality of hard disk modules corresponding to each storage node. That is, each storage node directly performs read and write access only to the plurality of hard disk modules corresponding to the storage node. When one of the storage nodes in the mutual-backup relationship is faulty, another storage node of the storage nodes takes over the faulty storage node and accesses a plurality of hard disk modules of the faulty storage node.

[0035] Optionally, there is alternatively a primary-secondary relationship between one storage node and one or more other storage nodes in the storage system. In other words, the one storage node is a primary storage node, the one or more other storage nodes are one or more secondary storage nodes, and the secondary storage nodes perform backup for the primary storage node. In this way, if the primary storage node is faulty, the secondary storage node may take over the primary storage node.

[0036] For example, refer to FIG. 2. It is assumed that a first storage node and a second storage node are any two storage nodes that have a mutual-backup relationship or a primary-secondary relationship in the storage system. An example in which a storage node communicates with a hard disk module through a bus is used for description. The first storage node corresponds to a plurality of first hard disk modules. The second storage node corresponds to a plurality of second hard disk modules. The first storage node is connected to the plurality of first hard disk modules and the plurality of second hard disk modules through a first bus. The second storage node is connected to the plurality of first hard disk modules and the plurality of second hard disk modules through a second bus.

[0037] In an implementation, the first storage node and the second storage node are in a mutual-backup relationship. When both the first storage node and the second storage node are in a normal state, the first storage node establishes a communication connection to the plurality of first hard disk modules through the first bus, and the first storage node directly performs read and write access only to the plurality of first hard disk modules; and the second storage node establishes a communication connection to the plurality of second hard disk modules through the second bus, and the second storage node directly performs read and write access only to the plurality of second hard disk modules. Assuming that the second storage node is faulty, the first storage node takes over the second storage node, and accesses the plurality of second hard disk modules of the second storage node. In this case, the first storage node may directly perform read and write access to the plurality of first hard disk modules corresponding to the first storage node and the plurality of second hard disk modules corresponding to the second storage node.

[0038] Refer to FIG. 3. A first storage node includes a first communication interface, a processing unit, and a second communication interface. The processing unit is connected to the first communication interface and the second communication interface. The first storage node establishes a communication connection to another storage node in a storage system through the first communication interface. The second communication interface of the first storage node is connected to a plurality of first hard disk modules corresponding to the first storage node and a plurality of second hard disk modules corresponding to a second storage node through a first bus.

[0039] When the first storage node is in a normal state, the second communication interface of the first storage node establishes a communication connection to the plurality of first hard disk modules through the first bus. In this case, the processing unit of the first storage node may send data to another storage node in the storage system through the first communication interface of the first storage node, or receive data or an access request sent by the another storage node. Alternatively, the processing unit of the first storage node may send data to a client through the first communication interface of the first storage node, or receive an access request sent by the client. The processing unit of the first storage node performs read and write access to the plurality of first hard disk modules through the second communication interface of the first storage node. In other words, a unit of the first storage node communicates with interface modules of the plurality of first hard disk modules through the second communication interface. When the second storage node is faulty, the second communication interface of the first storage node establishes a communication connection to the plurality of second hard disk modules through the first bus. In this case, the processing node of the first storage node may further perform read and write access to the plurality of second hard disk modules through the second communication interface.

[0040] Optionally, the first communication interface and the processing unit in the first storage node are two separate modules. The first communication interface and the processing unit may be connected through a high-speed bus. The high-speed bus may be a PCIe, an intel quickpath interconnect (QPI), or the like. Alternatively, the first communication interface and the processing unit in the first storage node may be integrated together.

[0041] Optionally, the second communication interface and the processing unit in the first storage node are two separate modules. Alternatively, the second communication interface and the processing unit may be connected through a high-speed bus. Alternatively, the second communication interface and the processing unit in the first storage node may be integrated together.

[0042] Optionally, the first communication interface in the first storage node may be a network interface card or the like. For example, refer to FIG. 4. A first communication interface may be a 10G network interface card. A processing unit in the first storage node may be a central processing unit (Central Processing Unit, CPU) or a processing unit including one or more chips. For example, the processing unit may be a data compression card, an artificial intelligence (Artificial Intelligence, AI) inference card, an image processing card, a video capture card, or the like. A second communication interface in the first storage node may be a PCIe switch chip, a SAS switch chip, or the like.

[0043] Optionally, a storage node and a hard disk module may be connected to each other through a shared link board, and the shared link board includes a bus constituted by one or more physical lines.

[0044] Optionally, refer to FIG. 3. The second communication interface of the first storage node is connected to the plurality of first hard disk modules and the plurality of second hard disk modules through the first bus. The second communication interface of the second storage node is connected to the plurality of first hard disk modules and the plurality of second hard disk modules through the second bus.

[0045] Optionally, refer to FIG. 5. One first hard disk module is communicatively connected to one second hard disk module. For example, the first hard disk module and the second hard disk module are connected to each other through a bus. A specific communication connection manner is not limited in this embodiment of the present invention. In this way, one first hard disk module and one second hard disk module form a cascading relationship. In this way, a second communication interface of a first storage node may not need to be connected to each second hard disk module, and a second communication interface of a second storage node may not need to be connected to each first hard disk module, either. Therefore, a quantity of connections to a second communication interface of a storage node can be reduced. For the second hard disk module cascaded to the first hard disk module, when the second storage node is faulty, the first storage node may access the second hard disk module based on the second communication interface of the first storage node, the first hard disk module, and the cascading relationship of the first hard disk module, that is, the first storage node communicates with an interface module of the second hard disk module. For example, the first storage node and the second storage node are storage nodes in a mutual-backup relationship. The first storage node and the second storage node may mutually determine whether a fault occurs on each other. For example, the first storage node and the second storage node determine, based on a heartbeat, whether a fault occurs.

[0046] Optionally, the storage node may scan a plurality of hard disk modules corresponding to another storage node, to obtain a hard disk module in a normal state corresponding to the another storage node, and establish a communication connection to the hard disk module in the normal state.

[0047] Optionally, a storage node in a storage system may store a correspondence between a node identifier of the storage node and a module identifier of a hard disk module.

[0048] Optionally, the node identifier of the storage node may be an address of the storage node. For example, the node identifier of the storage node may be an internet protocol (Internet Protocol, IP) address or a media access control address (Media Access Control Address, MAC) address. The module identifier of the hard disk module may be a number of the hard disk module in the storage system, an identifier of an interface module, an address of an interface module, or the like. This is not limited in this embodiment of the present invention.

[0049] When the storage node takes over a plurality of hard disk modules corresponding to the another storage node, the storage node updates a node identifier corresponding to a module identifier of each of the plurality of hard disk modules in a correspondence between a node identifier and a module identifier to a node identifier of the storage node, and sends an update request to other storage nodes of the storage system, where the update request includes the node identifier of the storage node and module identifiers of the plurality of hard disk modules.

[0050] Any one of the other storage nodes in the storage system receives the update request, and updates a node identifier corresponding to a module identifier of each of the plurality of hard disk modules in a correspondence between a node identifier and a module identifier to a node identifier of the any one of the other storage nodes.

[0051] For example, for the first storage node and the second storage node in a mutual-backup relationship, the first storage node may determine whether the second storage node is faulty, and the second storage node may also determine whether the first storage node is faulty. The first storage node and the second storage node may determine, in the following two manners, whether a fault occurs on each other. The two manners are as follows.

[0052] In a first manner, the first storage node periodically sends heartbeat information to the second storage node, and the second storage node also periodically sends heartbeat information to the first storage node. After receiving heartbeat information sent by the second storage node, if the first storage node does not receive, within a first time length, heartbeat information sent by the second storage node again, the first storage node determines that the second storage node is faulty. Similarly, after receiving heartbeat information sent by the first storage node, if the second storage node does not receive, within the first time length, the heartbeat information sent by the first storage node again, the second storage node determines that the first storage node is faulty.

[0053] In a second manner, when detecting that the first storage node is faulty, the first storage node may send interruption information to the second storage node, and the second storage node receives the interruption information to determine that the first storage node is faulty. Similarly, when detecting that the second storage node is faulty, the second storage node may send interruption information to the first storage node, and the first storage node receives the interruption information to determine that the second storage node is faulty.

[0054] Optionally, the storage system may further include a client, and the client may communicate with a storage node in the storage system. The client may store to-be-stored data in the storage system, or read to-be-read data from the storage system. For a detailed implementation process of storing to-be-stored data in the storage system, refer to the embodiment shown in FIG. 6 or FIG. 7. For a detailed implementation process of reading to-be-read data from the storage system, refer to the embodiment shown in FIG. 9. Details are not described herein.

[0055] Refer to FIG. 6. An embodiment of this application provides a data storage method in a storage system. The storage system may be the storage system shown in FIG. 1 to FIG. 5. In the method, a storage node in the storage system receives to-be-stored data sent by a client, divides the to-be-stored data into M data units, generates N check units for the M data units, and stores K units in K hard disk modules, where the K units include the M data units and the N check units, and M and N are both positive integers. The method includes the following steps.

[0056] Step 101: The client sends a storage request to a first storage node, where the storage request includes the to-be-stored data.

[0057] In this embodiment of the present invention, the first storage node may determine, based on a correspondence between a partition to which the K units belong and a hard disk module, the K hard disk modules that store the K units. In addition, a hard disk module recorded in a partition further includes a storage node to which the hard disk module belongs. In the partition, it is recorded that one storage node is used as a primary storage node. In this embodiment of the present invention, an example in which the first storage node is the primary storage node is used. The client determines a corresponding partition based on a data identifier of the to-be-stored data, and determines to send the storage request to the first storage node based on information about the primary storage node in the partition.

[0058] Optionally, the storage system in this embodiment of the present invention includes a plurality of partitions (Partition), and each hard disk module belongs to one or more partitions. A length of a stripe (Stripe) in the partition is determined according to an EC algorithm, and the length of the stripe is a sum of lengths of M data units and N check units, that is, M + N. According to the EC algorithm, one unit in the stripe is generally stored in one hard disk module, and M + N units require M + N hard disk modules. Therefore, one partition includes M + N hard disk modules. The storage node stores the correspondence between the partition and the hard disk module. Specifically, the correspondence between the partition and the hard disk module may include a partition identifier and a module identifier of the hard disk module of the storage node, where the module identifier of the hard disk module of the storage node includes a module identifier and an identifier of the storage node to which the hard disk module belongs. This is not limited in this embodiment of the present invention. The storage node divides the to-be-stored data into data units, calculates check units of the data units, and determines, based on a partition to which the data units belong, hard disk modules that store the data units and the check units. Generally, the storage system performs partition division in a hash (Hash) ring manner. A specific implementation is not limited in the present invention.

[0059] Step 102: The first storage node divides the to-be-stored data into the M data units, and generates the N check units for the M data units, where M and N are both positive integers.

[0060] The first storage node generates the N check units based on the M data units, where the N check units may be used to recover at least one of the M data units.

[0061] Step 103: The first storage node stores the K units in the K hard disk modules, where the K units include the M data units and the N check units, and each of the K hard disk modules stores one of the K units.

[0062] Each hard disk module includes an interface module and a hard disk, and the interface module communicates with the hard disk.

[0063] In this embodiment of the present invention, the first storage node may determine, based on the correspondence between the partition to which the K units belong and the hard disk module, the K hard disk modules that store the K units. In addition, each storage node stores a relationship between a hard disk module and a storage node to which the hard disk module belongs. Therefore, after determining the K hard disk modules that store the K units, the first storage node sends a corresponding storage request to a storage node to which a hard disk module other than a local hard disk module in the K hard disk modules belongs. To be specific, the first storage node sends a first storage command to a second storage node, where the first storage command includes K2 units. A third storage node corresponds to a quantity K3 of third hard disk modules. The first storage node sends a second storage command to the third storage node.

[0064] In an implementation, the K hard disk modules include K1 first hard disk modules corresponding to the first storage node, K2 second hard disk modules corresponding to the second storage node, and the K3 third hard disk modules corresponding to the third storage node. K1, K2, and K3 are all positive integers, and K1 + K2 + K3 = K.

[0065] In this step, the first storage node stores the K1 units in the K1 first hard disk modules, and sends the first storage command to the second storage node, where the first storage command includes the K2 units. The first storage node sends a second storage command to the third storage node, where the second storage command includes K3 units.

[0066] The second storage node receives the first storage command, and stores the K2 units included in the first storage command in hard disks in K2 second hard disk modules. The third storage node receives the second storage command, and stores the K3 units included in the second storage command in hard disks in the K3 hard disk modules.

[0067] Optionally, the first storage command includes the data identifier of the to-be-stored data, and the second storage command includes the data identifier of the to-be-stored data.

[0068] Optionally, after storing the K1 units and sending the first storage command and the second storage command, the first storage node sends a storage response to the client.

[0069] Optionally, when the second storage node is faulty, the first storage node stores the K1 units in the K1 first hard disk modules and stores the K2 units in the K2 second hard disk modules.

[0070] Optionally, when a storage node stores a unit in a hard disk module, the storage node sends the unit to an interface module included in the hard disk module, and the interface module receives the unit and stores the unit in a hard disk included in the hard disk module.

[0071] Optionally, before storing the unit in the hard disk module, the storage node may further compress the unit, and store the compressed unit in the hard disk module.

[0072] Optionally, after storing the K1 units in hard disks of the K1 first hard disk modules, the first storage node further obtains location information of the K1 units. For any one of the K1 units, location information of the unit includes a data type of the unit, a module identifier of a hard disk module that stores the unit, and address information of the unit in the hard disk module. The address information may include a hard disk identifier, a start storage address, a data length, and the like. When the unit is a data unit, a data type of the unit is a data unit. When the unit is a check unit, the data type of the unit is a check unit. When the unit is the data unit, the location information of the unit may further include a unit identifier of a check unit corresponding to the data unit; and/or when the unit is the check unit, the location information of the unit further includes a unit identifier of at least one data unit corresponding to the check unit. The first storage node correspondingly stores the data identifier of the to-be-stored data and the location information of the K1 units in a correspondence between a data identifier and location information.

[0073] Similarly, after storing the K2 units in the K2 second hard disk modules, the second storage node further obtains location information of the K2 units, and stores the data identifier of the to-be-stored data and the location information of the K2 units in the correspondence between the data identifier and the location information. After storing the K3 units in the K3 third hard disk modules, the third storage node further obtains location information of the K3 units, and stores the data identifier of the to-be-stored data and the location information of the K3 units in the correspondence between the data identifier and the location information.

[0074] The correspondence between the data identifier and the location information is further synchronized between storage nodes in the storage system, so that the storage nodes store the same correspondence between the data identifier and the location information.

[0075] In this embodiment of the present invention, storage nodes to which the K hard disk modules belonging to a same partition belong are storage nodes in a mutual-backup relationship or a primary-secondary relationship.

[0076] Optionally, before performing step 102, the first storage node receives the storage request, obtains a first quantity, and obtains M and N based on the first quantity, where the first quantity is a quantity of hard disk modules in a normal state that are included in the storage system.

[0077] An operation that the first storage node obtains the first quantity may be as follows: The first storage node obtains a quantity of hard disk modules in a normal state corresponding to the first storage node, and sends a query command to other storage nodes in a normal state in the storage system. For any other storage node in the storage system, the any other storage node receives the query command, obtains quantities of hard disk modules in a normal state that correspond to the any other storage nodes, and sends the quantity of the hard disk modules in the normal state to the first storage node. The first storage node receives quantities of hard disk modules sent by other storage nodes, and accumulates the obtained quantities of hard disk modules and the received quantities of the hard disk modules, to obtain the first quantity.

[0078] A communication connection is established between the first storage node and at least one hard disk module. When any one of the at least one hard disk module is faulty, a communication connection between the first storage node and the any one of the at least one hard disk module is disconnected. Therefore, that the first storage node obtains the quantity of the hard disk modules in the normal state that correspond to the first storage node may be as follows: The first storage node determines a hard disk module that has a communication connection to the first storage node, and calculates a quantity of determined hard disk modules to obtain the quantity of the hard disk modules in the normal state that correspond to the first storage node.

[0079] Similarly, a manner in which any other storage node obtains a quantity of hard disk modules in a normal state that correspond to the any other storage node is the same as the manner in which the first storage node obtains the quantity of the hard disk modules in the normal state that correspond to the first storage node.

[0080] Optionally, an operation that the first storage node obtains M and N may be as follows: The first storage node obtains stored M and N, obtains N based on the first quantity when M + N is less than the first quantity, and subtracts N from the first quantity to obtain M; and performs step 102 based on the stored M and N when M + N is greater than or equal to the first quantity. Alternatively, the first storage node compares the first quantity with a second quantity, where the second quantity is a quantity, obtained last time, of hard disk modules in the normal state that are included in the storage system. When the first quantity is different from the second quantity, the first storage node obtains N based on the first quantity, and subtracts N from the first quantity to obtain M. When the first quantity is the same as the second quantity, the first storage node obtains stored M and N that are obtained last time.

[0081] Optionally, when the first quantity is different from the second quantity, the first storage node may update the stored second quantity to the first quantity, and update values of the stored M and N to values of M and N obtained in this step, respectively.

[0082] Optionally, that the first storage node obtains N based on the first quantity may be as follows:

[0083] When the first quantity is less than a quantity threshold and N is greater than X, the first storage node sets that N = N - X, where X is an integer greater than 0. When the first quantity is greater than or equal to the quantity threshold and N is less than an initial value, the first storage node sets N to be equal to the initial value. When the first quantity is greater than or equal to the quantity threshold and N is equal to the initial value, the first storage node obtains the stored N.

[0084] The initial value may be a preset value. For example, the initial value may be a value such as 2, 3, 4, or 5.

[0085] In this embodiment of this application, storage is performed at a granularity of a hard disk module in the storage system. To be specific, data is divided into the M data units, data units are calculated to obtain the corresponding N check units, and M + N hard disk modules are selected to store the corresponding data units and the corresponding check units. Compared with a conventional technology in which storage is performed at a granularity of a storage node, this can fully utilize storage resources in the storage system because a quantity of hard disk modules is greater than a quantity of storage nodes. In addition, because each storage node corresponds to a plurality of hard disk modules, computing resources of the storage node can be fully utilized, and a computing capability of a CPU of the storage node is fully utilized, thereby reducing a waste of computing resources.

[0086] In this embodiment of the present invention, storage resources are managed at a granularity of a hard disk module, instead of at a granularity of a storage node. An implementation is that an interface module of a hard disk module creates a storage resource process, and the storage node identifies a storage resource granularity that can be used based on the storage resource process. The storage resource process includes a module identifier of the hard disk module.

[0087] Refer to FIG. 7. An embodiment of this application provides a data storage method in a storage system. The storage system may be the storage system shown in FIG. 1 to FIG. 5. In the method, a client divides to-be-stored data into M data units, generates N check units for the M data units, sends K units to K hard disk modules in the storage system, where the K units include the M data units and the N check units, and stores the K units in the K hard disk modules, that is, each of the K hard disk modules stores one of the K units, where M and N are both positive integers. The method includes the following steps.

[0088] Step 201: The client divides the to-be-stored data into the M data units, and generates the N check units for the M data units.

[0089] Step 202: The client sends the K units to the K hard disk modules in the storage system, where the K units include the M data units and the N check units.

[0090] In this embodiment of the present invention, the client may determine, based on a correspondence between a partition to which the K units belong and a hard disk module, the K hard disk modules that store the K units. In an implementation, the correspondence between the partition and the hard disk module includes information about a primary storage node. The first storage node is still used as an example. For the correspondence between the partition and the hard disk module, refer to the foregoing descriptions. Details are not described herein again. That the client sends the K units to the K hard disk modules in the storage system specifically includes that the client sends the K units to the first storage node. After determining the K hard disk modules that store the K units, the first storage node sends a corresponding storage request to a storage node to which a hard disk module other than a local hard disk module in the K hard disk modules belongs. To be specific, the first storage node sends a first storage command to a second storage node, where the first storage command includes K2 units. A third storage node corresponds to a quantity K3 of third hard disk modules. The first storage node sends a second storage command to the third storage node. K1, K2, and K3 are all positive integers, and K1 + K2 + K3 = K.

[0091] In this embodiment of the present invention, the client may determine, based on the correspondence between the partition to which the K units belong and the hard disk module, the K hard disk modules that store the K units. In an implementation, the correspondence between the partition to which the K units belong and the hard disk module further includes information about a storage node to which a hard disk module belongs. For example, the K hard disk modules include K1 hard disk modules of the first storage node, K2 hard disk modules of the second storage node, and the K3 hard disk modules of the third storage node. The client sends K1 units stored in the K1 hard disk modules to the first storage node, send the K2 units stored in the K2 hard disk modules to the second storage node, and send K3 units stored in the K3 hard disk modules to the third storage node.

[0092] In this embodiment of the present invention, storage nodes to which the K hard disk modules belonging to a same partition belong are storage nodes in a mutual-backup relationship or a primary-secondary relationship.

[0093] In this embodiment of the present invention, storage resources are managed at a granularity of a hard disk module, instead of at a granularity of a storage node. An implementation is that an interface module of a hard disk module creates a storage resource process, and the client identifies a storage resource granularity that can be used based on the storage resource process. The storage resource process includes a module identifier of the hard disk module. Further, the storage resource process further includes an identifier of a storage node to which the hard disk module belongs.

[0094] An embodiment of this application provides a data reading method in a storage system. The storage system may be the storage system shown in FIG. 1 to FIG. 5. In the method, a storage node in the storage system receives a read request sent by a client, where the read request includes a data identifier of to-be-read data. The storage node obtains the to-be-read data based on the data identifier, and sends the to-be-read data to the client.

[0095] In an implementation, a first storage node may determine, based on a correspondence between a partition to which K units belong and a hard disk module, K hard disk modules that store the K units. In addition, a hard disk module recorded in a partition further includes a storage node to which the hard disk module belongs. In the partition, it is recorded that one storage node is used as a primary storage node. In this embodiment of the present invention, an example in which the first storage node is the primary storage node is used. The client determines a corresponding partition based on the data identifier of the to-be-read data, and determines to send the read request to the first storage node based on information about the primary storage node in the partition. The read request includes the data identifier of the to-be-read data. The first storage node determines, based on the correspondence between the partition to which the K units belong and the hard disk module and the data identifier of the to-be-read data, a hard disk module in which the to-be-read data is located, and reads the to-be-read data from the determined hard disk module. With reference to the embodiment shown in FIG. 6, when the first storage node is faulty, because the second storage node and the third storage node have a mutual-backup relationship or a primary-secondary relationship with the first storage node, the second storage node or the third storage node takes over the first storage node, and is configured to execute the foregoing read request. In addition, a storage node that takes over the first storage node can directly access the K1 hard disk modules. In addition, when a hard disk module that stores the to-be-read data is faulty, or when a hard disk in a hard disk module in which the to-be-read data is located is faulty, or when the to-be-read data is lost because an error occurs on the to-be-read data stored in the hard disk module but the to-be-read data cannot be recovered locally in the hard disk module, in this embodiment of the present invention, a data unit in which the to-be-read data is located can be recovered by using a unit stored in another hard disk module in the K hard disk modules. That is, a capability that N data units in M data units can be recovered by using a check protection relationship formed between the M data units and the N check units is used.

[0096] In another implementation, the client determines a corresponding partition based on the data identifier of the to-be-read data, and determines, based on the partition, a hard disk module corresponding to the data identifier in the partition. The client determines, based on a correspondence between a hard disk module and a storage node in the partition, that is, based on a storage node to which the hard disk module belongs, a storage node to which the hard disk module in which the to-be-read data is located belongs, and sends the read request to the storage node. After receiving the read request, the storage node reads the to-be-read data from the hard disk module based on the data identifier of the to-be-read data carried in the read request. That is, the storage node communicates with the interface module of the hard disk module. For data recovery that is performed based on the M data units and the N check units, refer to descriptions in the foregoing embodiments. Details are not described herein again.

[0097] In another storage architecture of the present invention, the client may communicate with the interface module of the hard disk module, that is, the client can directly access the hard disk module without through the storage node. To be specific, the client directly sends the K units to the corresponding K hard disk modules based on the correspondence between the partition and the hard disk module, or reads data from a corresponding hard disk module.

[0098] Refer to FIG. 8. An embodiment of this application provides a data storage apparatus 300 in a storage system. The apparatus 300 may be deployed on the storage node or the client in any one of the foregoing embodiments, and includes:

a generation unit 301, configured to generate N check units for M data units, where M and N are both positive integers, and M + N = K; and

a storage unit 302, configured to store the K units in K hard disk modules in the storage system, where the K units include the M data units and the N check units, each of the K hard disk modules stores one of the K units, each hard disk module includes an interface module and a hard disk, and the interface module communicates with the hard disk.



[0099] Optionally, for a detailed operation that the storage unit 302 stores the K units in the K hard disk modules, refer to step 103 in the embodiment shown in FIG. 6 or related content in step 202 in the embodiment shown in FIG. 7.

[0100] Optionally, the storage system includes a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.

[0101] Optionally, the apparatus 300 is a client of the storage system. The apparatus 300 includes a sending unit 303.

[0102] The sending unit 303 is configured to send the K units to a target storage node in the plurality of storage nodes, so that the target storage node stores the K units in the K hard disk modules in the storage system.

[0103] Optionally, for a detailed operation that the target storage node stores the K units in the K hard disk modules in the storage system, refer to related content in step 202 in the embodiment shown in FIG. 7.

[0104] Optionally, the apparatus 300 is one of the plurality of storage nodes.

[0105] Optionally, the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.

[0106] Optionally, the storage system includes a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the apparatus.

[0107] In this embodiment of this application, the generation unit generates the N check units for the M data units. The storage unit stores the K units in the K hard disk modules in the storage system. In this way, the storage unit implements storage at a granularity of a hard disk module in the storage system, that is, the K hard disk modules are used to store the corresponding K units. Compared with a conventional technology in which storage is performed at a granularity of a storage node, this can fully utilize storage resources in the storage system because a quantity of hard disk modules is greater than a quantity of storage nodes.

[0108] Refer to FIG. 9. An embodiment of this application provides a data reading apparatus 400 in a storage system. The apparatus 400 may be deployed on the storage node or the client in any one of the foregoing embodiments, and includes:

a receiving unit 401, configured to receive a read request, where the read request includes a data identifier of to-be-read data; and

a processing unit 402, configured to determine, from K hard disk modules in the storage system based on the data identifier, a hard disk module that stores the to-be-read data.



[0109] The processing unit 402 is further configured to read the to-be-read data from the hard disk module that stores the to-be-read data, where the to-be-read data belongs to data in M data units. The storage system further includes N check units of the M data units. M and N are both positive integers, and M + N = K. Each of the K hard disk modules stores one of the K units. The K units include the M data units and the N check units. Each hard disk module includes an interface module and a hard disk, and the interface module communicates with the hard disk.

[0110] Optionally, the storage system includes a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.

[0111] Optionally, the apparatus 400 is a client of the storage system. The apparatus 400 further includes a sending unit 403.

[0112] The sending unit 403 is configured to send the data read request to a target storage node in the plurality of storage nodes, where the data read request carries the data identifier.

[0113] The processing unit 402 is configured to read, based on the data identifier, the to-be-read data from the hard disk module that stores the to-be-read data.

[0114] Optionally, the apparatus 400 is one of the plurality of storage nodes.

[0115] Optionally, the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.

[0116] Optionally, the storage system includes a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the apparatus 400.

[0117] In this embodiment of this application, the receiving unit receives the read request, where the read request includes the data identifier of the to-be-read data. The processing unit reads the to-be-read data from the hard disk module that stores the to-be-read data, where the to-be-read data belongs to data in M data units. The storage system further includes N check units of the M data units, where M + N = K. Each of the K hard disk modules in the storage system stores one of the K units. Because each of the K hard disk modules stores one of the K units, storage is performed at a granularity of a hard disk module in the storage system. Compared with a conventional technology in which storage is performed at a granularity of a storage node, this can fully utilize storage resources in the storage system because a quantity of hard disk modules is greater than a quantity of storage nodes.

[0118] Refer to FIG. 10. An embodiment of this application provides a data storage apparatus 500 in a storage system. The apparatus 500 may be the client or the storage node in any one of the foregoing embodiments. The apparatus 500 includes at least one processor 501, a bus system 502, and at least one communication interface 503.

[0119] Optionally, the storage system includes a plurality of hard disk modules, and the at least one processor 501 further communicates with a plurality of hard disk modules in the storage system through the at least one communication interface 503.

[0120] In specific implementation, the processor 501 may be a central processing unit (Central Processing Unit, CPU), a field programmable gate array (Field Programmable Gate Array, FPGA), an application-specific integrated circuit (Application-specific integrated circuit, ASIC), or another hardware. Alternatively, an FPGA or other hardware and the CPU together serve as the processor 501.

[0121] The apparatus 500 is an apparatus of a hardware structure, and can be configured to implement the functional modules in the apparatus 300 shown in FIG. 8.

[0122] Optionally, when the processor 501 is implemented by one or more CPUs, the generation unit 301 and the storage unit 302 in the apparatus 300 shown in FIG. 8 may be implemented by calling code in a memory by the one or more CPUs. The sending unit 303 in the apparatus 300 shown in FIG. 8 may be implemented by the communication interface 503.

[0123] The communication interface 503 is configured to communicate with another device or a communication network.

[0124] The memory may be a read-only memory (read-only memory, ROM) or another type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or another type of dynamic storage device that can store information and instructions; or may be an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory, CD-ROM) or another compact disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, or the like), a disk storage medium or another disk storage device, or any other medium that can be used to carry or store expected program code in a form of an instruction or data structure and that can be accessed by a computer. However, the memory is not limited thereto. The memory may exist independently, and is connected to the processor through the bus. Alternatively, the memory may be integrated with the processor.

[0125] The memory is configured to store application program code for executing the solutions of this application, and the processor 501 controls execution. The processor 501 is configured to execute the application program code stored in the memory, to implement functions in the method in this patent.

[0126] Refer to FIG. 11. An embodiment of this application provides a data reading apparatus 600 in a storage system. The apparatus 600 may be the storage node or the client in any one of the foregoing embodiments. The apparatus 600 includes at least one processor 601, a bus system 602, and at least one communication interface 603.

[0127] In specific implementation, the processor 601 may be a central processing unit (Central Processing Unit, CPU), a field programmable gate array (Field Programmable Gate Array, FPGA), an application-specific integrated circuit (Application-specific integrated circuit, ASIC), or another hardware. Alternatively, an FPGA or other hardware and the CPU together serve as the processor 601.

[0128] The apparatus 600 is an apparatus of a hardware structure, and can be configured to implement the functional modules in the apparatus 400 shown in FIG. 9. Optionally, when the processor 601 is implemented by one or more CPUs, the processing unit 402 in the apparatus 400 shown in FIG. 9 may be implemented by calling code in a memory by the one or more CPUs. The receiving unit 401 and the sending unit 403 in the apparatus 400 shown in FIG. 9 may be implemented by the communication interface 603.

[0129] The bus system 602 may include a path for transmitting information between the foregoing components.

[0130] The communication interface 603 is configured to communicate with another device or a communication network.

[0131] The memory may be a read-only memory (read-only memory, ROM) or another type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or another type of dynamic storage device that can store information and instructions; or may be an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory, CD-ROM) or another compact disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, or the like), a disk storage medium or another disk storage device, or any other medium that can be used to carry or store expected program code in a form of an instruction or data structure and that can be accessed by a computer. However, the memory is not limited thereto. The memory may exist independently, and is connected to the processor through the bus. Alternatively, the memory may be integrated with the processor.

[0132] The memory is configured to store application program code for executing the solutions of this application, and the processor 601 controls execution. The processor 601 is configured to execute the application program code stored in the memory, to implement functions in the method in this patent.

[0133] In this embodiment of the present invention, M in the M data units is 1, and N check units are copies of the data units. In other words, the data units are protected based on a plurality of copies and the data units are recovered based on the plurality of copies. For specific implementation, refer to the descriptions in the foregoing embodiment. Details are not described herein again.

[0134] In another embodiment of the present invention, a storage system is a storage array, and a storage node is an array controller of the storage array.

[0135] A person of ordinary skill in the art may understand that all or some of the steps of the embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may include: a read-only memory, a magnetic disk, or an optical disc.


Claims

1. A data storage method in a storage system, wherein the method comprises:

generating, by a first device, N check units for M data units, wherein M and N are both positive integers, and M + N = K; and

storing, by the first device, the K units in K hard disk modules in the storage system, wherein the K units comprise the M data units and the N check units, each of the K hard disk modules stores one of the K units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
2. The method according to claim 1, wherein the storage system comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
3. The method according to claim 2, wherein the first device is a client of the storage system, and the storing, by the first device, the K units in K hard disk modules in the storage system specifically comprises:

sending, by the client, the K units to a target storage node in the plurality of storage nodes; and

storing, by the target storage node, the K units in the K hard disk modules in the storage system.


 
4. The method according to claim 2, wherein the first device is one of the plurality of storage nodes.
 
5. The method according to any one of claims 1 to 4, wherein the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.
 
6. The method according to claim 1, wherein the storage system comprises a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the first device.
 
7. A data reading method in a storage system, wherein the method comprises:

receiving, by a first device, a read request, wherein the read request comprises a data identifier of to-be-read data;

determining, by the first device from K hard disk modules in the storage system based on the data identifier, a hard disk module that stores the to-be-read data; and

reading, by the first device, the to-be-read data from the hard disk module that stores the to-be-read data, wherein the to-be-read data belongs to data in M data units, the storage system further comprises N check units of the M data units, M and N are both positive integers, M + N = K, each of the K hard disk modules stores one of the K units, the K units comprise the M data units and the N check units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
8. The method according to claim 7, wherein the storage system comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
9. The method according to claim 7, wherein the first device is a client of the storage system, and the reading, by the first device, the to-be-read data from the hard disk module that stores the to-be-read data specifically comprises:

sending, by the client, the data read request to a target storage node in the plurality of storage nodes, wherein the data read request carries the data identifier; and

reading, by the target storage node based on the data identifier, the to-be-read data from the hard disk module that stores the to-be-read data.


 
10. The method according to claim 8, wherein the first device is one of the plurality of storage nodes.
 
11. The method according to any one of claims 7 to 10, wherein the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.
 
12. The method according to claim 7, wherein the storage system comprises a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the first device.
 
13. A data storage apparatus in a storage system, wherein the apparatus comprises:

a generation unit, configured to generate N check units for M data units, M and N are both positive integers, and M + N = K; and

a storage unit, configured to store the K units in K hard disk modules in the storage system, wherein the K units comprise M data units and N check units, each of the K hard disk modules stores one of the K units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
14. The apparatus according to claim 13, wherein the storage system comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
15. The apparatus according to claim 14, wherein the apparatus is a client of the storage system, and the apparatus comprises a sending unit, wherein
the sending unit is configured to send the K units to a target storage node in the plurality of storage nodes, so that the target storage node stores the K units in the K hard disk modules in the storage system.
 
16. The apparatus according to claim 14, wherein the apparatus is one of the plurality of storage nodes.
 
17. The apparatus according to any one of claims 13 to 16, wherein the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.
 
18. The apparatus according to claim 13, wherein the storage system comprises a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the apparatus.
 
19. A data reading apparatus in a storage system, wherein the apparatus comprises:

a receiving unit, configured to receive a read request, wherein the read request comprises a data identifier of to-be-read data; and

a processing unit, configured to determine, from K hard disk modules in the storage system based on the data identifier, a hard disk module that stores the to-be-read data, wherein

the processing unit is further configured to read the to-be-read data from the hard disk module that stores the to-be-read data, wherein the to-be-read data belongs to data in M data units, the storage system further comprises N check units of the M data units, M and N are both positive integers, M + N = K, each of the K hard disk modules stores one of the K units, the K units comprise the M data units and the N check units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
20. The apparatus according to claim 19, wherein the storage system comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
21. The apparatus according to claim 19, wherein the apparatus is a client of the storage system, and the apparatus further comprises a sending unit, wherein

the sending unit is configured to send the data read request to a target storage node in the plurality of storage nodes, wherein the data read request carries the data identifier; and

the processing unit is configured to read, based on the data identifier, the to-be-read data from the hard disk module that stores the to-be-read data.


 
22. The apparatus according to claim 20, wherein the apparatus is one of the plurality of storage nodes.
 
23. The apparatus according to any one of claims 19 to 22, wherein the interface module is a host bus adapter, a redundant array of independent disks, an expander card, or a network interface card.
 
24. The apparatus according to claim 19, wherein the storage system comprises a second device, and there is a mutual-backup relationship or a primary-secondary relationship between the second device and the apparatus.
 
25. A storage device in a storage system, wherein the storage device comprises a processor and a communication interface, the processor communicates with the communication interface, and the processor is configured to:

generate N check units for M data units, wherein M and N are both positive integers, and M + N =K; and

store the K units in K hard disk modules in the storage system, wherein the K units comprise M data units and N check units, each of the K hard disk modules stores one of the K units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
26. The storage device according to claim 25, wherein the storage system comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
27. The storage device according to claim 26, wherein the storage device is a client of the storage system, and the communication interface is configured to send the K units to a target storage node in the plurality of storage nodes, so that the target storage node stores the K units in the K hard disk modules in the storage system.
 
28. A storage device in a storage system, wherein the storage device comprises a processor and a communication interface, and the processor communicates with the communication interface;

the communication interface is configured to receive a read request, wherein the read request comprises a data identifier of to-be-read data; and

the processor is configured to determine, from K hard disk modules in the storage system based on the data identifier, a hard disk module that stores the to-be-read data; and

read the to-be-read data from the hard disk module that stores the to-be-read data, wherein the to-be-read data belongs to data in M data units, the storage system further comprises N check units of the M data units, M and N are both positive integers, M + N = K, each of the K hard disk modules stores one of the K units, the K units comprise the M data units and the N check units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
29. The storage device according to claim 28, wherein the storage system comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
30. The storage device according to claim 29, wherein the storage device is a client of the storage system, and the communication interface is further configured to send the data read request to a target storage node in the plurality of storage nodes, wherein the data read request carries the data identifier; and
the processor is further configured to read, based on the data identifier, the to-be-read data from the hard disk module that stores the to-be-read data.
 
31. A storage system, wherein the storage system comprises a storage device and K hard disk modules, wherein the storage device is configured to:

generate N check units for M data units, wherein M and N are both positive integers, and M + N =K; and

store the K units in K hard disk modules, wherein the K units comprise M data units and N check units, each of the K hard disk modules stores one of the K units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
32. The storage system according to claim 31, wherein the storage system further comprises a plurality of storage nodes, and each storage node communicates with interface modules of the K hard disk modules.
 
33. The storage system according to claim 32, wherein the first device is a client of the storage system, and that the storage device is configured to store the K units in K hard disk modules in the storage system specifically comprises:

the client is configured to send the K units to a target storage node in the plurality of storage nodes; and

the target storage node is configured to store the K units in the K hard disk modules in the storage system.


 
34. A storage system, wherein the storage system comprises a storage device and K hard disk modules, wherein
the storage device is configured to:

receive a read request, wherein the read request comprises a data identifier of to-be-read data;

determine, from the K hard disk modules based on the data identifier, a hard disk module that stores the to-be-read data; and

read the to-be-read data from the hard disk module that stores the to-be-read data, wherein the to-be-read data belongs to data in M data units, the storage system further comprises N check units of the M data units, M and N are both positive integers, M + N = K, each of the K hard disk modules stores one of the K units, the K units comprise the M data units and the N check units, each hard disk module comprises an interface module and a hard disk, and the interface module communicates with the hard disk.


 
35. A computer program product, wherein the computer program product comprises program code, and when a computer executes the program code, the computer is enabled to execute the method according to any one of claims 1 to 6.
 
36. A computer program product, wherein the computer program product comprises program code, and when a computer executes the program code, the computer is enabled to execute the method according to any one of claims 7 to 12.
 




Drawing

























Search report













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