A storage device, a solid state disk, and a data access method

CN122551855APending Publication Date: 2026-08-11HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

随着SSD的容量增大,对故障的SSD进行隔离,将会导致SSD内大量的数据丢失,重构新的SSD的过程中需要对故障的SSD中的数据进行恢复,这样会增加重构新的SSD的耗时,这种处理SSD中故障的效率较低

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551855A_ABST
    Figure CN122551855A_ABST
Patent Text Reader

Abstract

A storage device, a solid-state drive (SSD), and a data access method are disclosed. The storage device includes a logical block group and multiple SSDs, with the logical storage space of the logical block group derived from the multiple SSDs. The logical block group comprises multiple logical blocks, and the logical storage space of each logical block originates from a media module of one SSD. The media module includes multiple flash memory chips, and the media module is either detachably connected to the SSD or soldered integrally into the SSD. The logical block group supports data redundancy strategies at the media module level, including multiple-copy data storage or erasure coding (EC) data storage. A correspondence exists between logical blocks and media modules. If some flash memory chips in the SSD fail, only the logical blocks corresponding to the media module containing the failed flash memory chips will be affected; the logical blocks corresponding to the remaining media modules will remain usable. When handling faults, only the failed media module needs to be isolated, effectively ensuring efficient fault handling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage, and more particularly to a storage device, a solid-state drive, and a data access method. Background Technology

[0002] Solid-state drives (SSDs) are commonly used in storage systems for persistent data storage. In a storage system, when an SSD fails, the entire SSD needs to be isolated and a new SSD needs to be built to replace the failed one. As SSD capacity increases, isolating a failed SSD can lead to significant data loss. The data recovery process from the failed SSD during reconstruction further increases the time required for rebuilding, making this method of handling SSD failures inefficient. Summary of the Invention

[0003] This application provides a storage device, a solid-state drive (SSD), and a data access method to improve the efficiency of handling faults in SSDs.

[0004] In a first aspect, this application provides a storage device, which includes a logical block group and a plurality of solid-state drives (SSDs), wherein the logical storage space in the logical block group comes from the plurality of SSDs.

[0005] A logical block group is a logical concept. The logical block group includes multiple logical blocks. The logical storage space of a logical block comes from a media module contained in a solid-state drive. That is, there is a correspondence between logical blocks and media modules. One logical block corresponds to one media module.

[0006] For any media module in a solid-state drive (SSD), the media module includes multiple NAND flash memory chips. For any given media module, it is either detachably connected to one of the multiple SSDs as a whole, or the media module is soldered as a whole into one of the multiple SSDs. The SSD to which the media module is connected or soldered is the SSD to which the media module belongs.

[0007] The logical block group supports data redundancy strategies at the media module level. These strategies include storing data using multiple replicas or erasure coding (EC) methods. Specifically, in multiple replica storage, each replica can be distributed across different media modules. In EC storage, data fragments can be distributed across different media modules.

[0008] In this storage device, there is a correspondence between logical blocks in the logical block group and media modules. If some flash memory chips in the SSD fail, only the logical blocks corresponding to the media module containing the failed flash memory chip will be affected. The remaining media modules can be used normally, and the logical blocks corresponding to the remaining media modules can also be used normally. Therefore, when dealing with SSD failures, only the media module containing the failed flash memory chip needs to be isolated, without isolating the entire SSD. Similarly, when recovering data from the SSD, only the data in the media module containing the failed flash memory chip needs to be recovered, effectively ensuring the processing efficiency of the failed SSD. Furthermore, when the media module is detachably connected to the SSD as a whole, the media module can be flexibly removed and installed within the SSD. When dealing with SSD failures, only the media module containing the failed flash memory chip needs to be replaced, further ensuring the efficiency of handling SSD failures. In addition, the logical block group supports a data redundancy strategy at the media module level, so that if data in the logical block corresponding to a media module is lost or damaged, it can be recovered using data from other logical blocks, effectively ensuring the reliability of data in the storage device.

[0009] In one possible implementation, the media modules from which the logical storage space of multiple logical blocks originates can be located on different solid-state drives (SSDs), meaning that the media modules corresponding to different logical blocks belong to different SSDs. Of course, in practical applications, the media modules corresponding to different logical blocks can also belong to the same SSD.

[0010] In this storage device, the distribution of media modules corresponding to different logical blocks is quite flexible. When different logical blocks correspond to different solid-state drives (SSDs), if one SSD fails, rendering the entire SSD unusable, the failed SSD will only affect one logical block in the logical block group. The data in that logical block may be lost, but other logical blocks will remain unaffected. The data in the other logical blocks will not be corrupted, and the amount of corrupted data is relatively small. Consequently, data recovery time is also shorter.

[0011] In one possible implementation, the flash memory chips in the SSD are contained within a media module. Media module failures (such as flash memory chip failures within the media module) can occur in the SSD. Taking a first media module corresponding to a first logical block out of multiple logical blocks as an example, if the first logical block fails, it indicates a fault in the first media module. The processor in the storage device can output a prompt command to indicate the failure of the first media module corresponding to the first logical block, or to suggest replacing the first media module. The recipient of this prompt command is not limited; the storage device can output the prompt command to a user or to a device connected to the storage device.

[0012] In this storage device, when a media module fails, the storage device (the processor in the storage device) can promptly notify the first media module that it needs to be replaced or that it has failed, ensuring that the fault in the SSD can be handled in a timely manner.

[0013] In one possible implementation, the storage device also includes a hot-spare SSD. The hot-spare SSD is an additional SSD set up besides the multiple SSDs in the storage device. The hot-spare SSD is primarily used to handle media module failures in the multiple SSDs. Taking the first media module corresponding to the first logical block in a set of multiple logical blocks as an example, in the event of a failure of the first logical block, the processor in the storage device replaces the first media module with the media module in the hot-spare SSD. In other words, for the storage device (the processor in the storage device), replacing the first media module means updating the mapping between the first logical block and the first media module, such as updating the mapping between the first logical block and the first media module to the mapping between the first logical block and the media module in the hot-spare SSD.

[0014] It is worth noting that if the first media module in the storage device is removed and a new media module is installed, the storage device can also replace the first media module, that is, update the correspondence between the first logical block and the first media module to the correspondence between the first logical block and the new media module.

[0015] The storage device is equipped with a hot-spare SSD. When the first media module of multiple SSDs fails, the storage device can replace the first media module to ensure the normal use of the first logical block. This fault handling method does not require isolating the entire SSD, but only the failed first media module, which effectively shortens the fault isolation radius.

[0016] In one possible implementation, after the first media module is replaced, the storage device (the processor in the storage device) recovers the data stored in the first logical block using data stored in other logical blocks among a plurality of logical blocks.

[0017] In this storage device, because the logical block group supports a data redundancy strategy, after the first media module is replaced, the storage device can use the data stored in other logical blocks to recover the data stored in the first logical block, thus avoiding data loss or damage.

[0018] In one possible implementation, taking the first target data as an example, the method of storing data in the storage device is explained. In the storage device, the processor of the storage device obtains the first target data to be stored; after obtaining the first target data, it stores the first target data in the logical block group according to the data redundancy strategy.

[0019] In this storage device, the first target data can be stored in the first logical block group, and the storage of the first target data within the first logical block satisfies the data redundancy strategy. This data storage method can ensure the reliability of the data. When the first target data within the logical block group is damaged or lost, there is a certain probability that the complete first target data can be recovered.

[0020] In one possible implementation, taking the first target data as an example, we will explain how to read data from the storage device.

[0021] If the data redundancy strategy uses a multi-replica storage method, each logical block stores the first target data (or, in this embodiment, each logical block stores a copy of the first target data; no distinction is made between the first target data and its copy in this application). The processor in the storage device can obtain the first target data (or a copy of the first target data) from the first logical block. If the first media module fails (i.e., the first logical block fails), the processor will be unable to successfully obtain the first target data from the first logical block. In this case, the processor in the storage device can obtain the first target data from other logical blocks in the logical block group.

[0022] If the data redundancy strategy is EC (Extremely Compromised) storage, each logical block stores a fragment of the first target data. Let's assume the first target data comprises M fragments: m data fragments and k parity fragments. Therefore, the redundancy in EC is k, and the first target data can be obtained through m fragments. When the storage device's processor reads the first target data, it can obtain m fragments of the first target data from the m logical blocks in the logical block group. Specifically, it retrieves one fragment of the first target data from each logical block. After retrieving m fragments, the processor uses these m fragments to obtain the first target data.

[0023] When the first logic block is included in the m logic blocks, if the first medium module fails (i.e., the first logic block fails), the processor will be unable to successfully obtain the fragment of the first target data from the first logic block. In this case, the processor can obtain other fragments of the first target data from other logic blocks in the logic block group (such as logic blocks other than the m logic blocks), and obtain the first target data based on the other fragments of the first target data (and the fragments obtained from the m logic blocks).

[0024] In this storage device, since the logical block group supports a data redundancy strategy, if the first logical block fails during the process of reading the first target data, the storage device can use other logical blocks to obtain the first target data.

[0025] In one possible implementation, the storage device can take many forms. For example, it could be a host containing multiple SSDs, with its processor located on the host connected to the SSDs. Alternatively, it could be a disk enclosure containing multiple SSDs, connected to a computing device to provide persistent data storage space. The processor in this storage device resides within the disk enclosure to manage the SSDs.

[0026] The storage devices come in various forms to suit different application scenarios.

[0027] Secondly, this application provides a solid-state drive (SSD). Similar to storage devices, the SSD also contains logical block groups and the concept of logical block groups. That is, the SSD includes logical block groups, and the logical storage space in the logical block groups comes from the SSD.

[0028] A logical block group is a logical concept, constructed by solid-state drives (SSDs) to facilitate storage space management. A logical block group comprises multiple logical blocks, and the logical storage space of these multiple logical blocks comes from the flash memory chips of the media modules contained in the SSD. That is, the logical storage space of one logical block comes from one flash memory chip of one media module of the SSD, meaning that one logical block corresponds to one flash memory chip, and each logical block corresponds to a different flash memory chip.

[0029] A media module is a hardware component in a solid-state drive (SSD). A media module consists of multiple flash memory chips. The media module can be either detached from the SSD as a whole or soldered into the SSD as a whole.

[0030] Among them, the logical block group supports data redundancy strategies, which include storing data in a multi-replica manner or storing data in an erasure coding (EC) manner.

[0031] In this embodiment, both the storage device and the solid-state drive (SSD) contain logical concepts such as logical block groups and logical blocks. Logical block groups and logical blocks essentially represent logical storage spaces formed by mapping physical storage space. In this embodiment, to easily distinguish between the logical block groups and logical block sets within the storage device and the SSD, the logical block groups and logical block sets within the SSD are referred to as internal logical block groups and internal logical blocks.

[0032] In this solid-state drive (SSD), there is a correspondence between the logical blocks in the internal logical block group and the flash memory chips. If some flash memory chips in the SSD fail, only the corresponding internal logical block will be affected, while the remaining internal logical blocks will function normally. When the media module is detachably connected to the SSD as a whole, it can be flexibly removed and installed within the SSD. When dealing with faults in the SSD, especially flash memory chip failures, only the media module containing the faulty flash memory chip needs to be replaced, further ensuring efficient fault handling in the SSD. In addition, the internal logical block group supports a data redundancy strategy, allowing data from other logical blocks to be recovered if data in the logical block corresponding to a flash memory chip is lost or corrupted, effectively ensuring the reliability of data in the SSD.

[0033] In one possible implementation, the logical storage space of multiple internal logical blocks originates from flash memory chips located in different media modules. That is, the flash memory chips corresponding to different internal logical blocks belong to different media modules. Of course, in practical applications, the flash memory chips corresponding to different internal logical blocks can also belong to the same media module.

[0034] In this solid-state drive (SSD), the distribution of flash memory chips corresponding to different logical blocks is quite flexible. When the flash memory chips corresponding to different logical blocks belong to different media modules, if one media module of the SSD fails, the failed media module will only affect a portion of the internal logical blocks within the internal logical block group. The data in that internal logical block may be lost, while other internal logical blocks will remain unaffected.

[0035] In one possible implementation, the flash memory chips in the solid-state drive (SSD) are contained within a media module. Media module failures (such as flash memory chip failures) can occur within the SSD. Taking a second media module corresponding to a first internal logical block among multiple internal logical blocks as an example, in the event of a failure in the first internal logical block, the SSD's main controller outputs a prompt command. This prompt command indicates a failure in the second media module corresponding to the first internal logical block, or it prompts for replacement of the second media module. This application embodiment does not limit the recipient of the prompt command; the SSD's main controller can output the prompt command to a host connected to the SSD, or it can output the prompt command to a user.

[0036] In this solid-state drive (SSD), when the media module fails, the SSD (the main controller in the SSD) can promptly notify the second media module that it needs to be replaced or that it has failed, ensuring that the fault in the SSD can be dealt with in a timely manner.

[0037] In one possible implementation, the solid-state drive (SSD) also includes a hot-spare media module. This hot-spare media module is an additional media module within the SSD, primarily used to handle media module failures. Taking the second media module corresponding to the first internal logical block among multiple internal logical blocks as an example, in the event of a failure of the first internal logical block, the main controller in the SSD replaces the second media module with the hot-spare media module. That is, the flash memory chips in the second media module corresponding to the first internal logical block group are replaced with flash memory chips from the hot-spare media module. In other words, for the SSD, replacing the second media module means updating the mapping between the first internal logical block and the flash memory chips in the second media module, such as updating the mapping between the first internal logical block and the flash memory chips in the second media module to the mapping between the first internal logical block and the hot-spare media module.

[0038] It is worth noting that if the second media module in the solid-state drive (SSD) is removed and a new media module is installed, the SSD (the main controller in the SSD) can also have its second media module replaced. This means that the correspondence between the first internal logic block and the flash memory chips in the second media module will be updated to the correspondence between the first internal logic block and the flash memory chips in the new media module.

[0039] This solid-state drive (SSD) is equipped with a hot-spare media module. When the second media module fails, the SSD can replace the second media module to ensure the normal use of the first internal logical block. This fault handling method does not isolate the entire SSD, but only the failed second media module, effectively shortening the fault isolation radius.

[0040] In one possible implementation, after replacing the second media module, the SSD's main controller recovers the data stored in the first internal logic block using data stored in other internal logic blocks among multiple internal logic blocks.

[0041] In this solid-state drive, because the internal logical block group supports a data redundancy strategy, after the second media module is replaced, the solid-state drive can use the data stored in other internal logical blocks to recover the data stored in the first internal logical block, thus avoiding data loss or damage.

[0042] In one possible implementation, taking the second target data as an example, the method of storing data in the solid-state drive (SSD) is explained. The SSD's main controller acquires the second target data to be stored; and stores the second target data in an internal logical block group according to a data redundancy strategy.

[0043] In this solid-state drive, the storage of the second target data satisfies the data redundancy strategy. This data storage method can ensure data reliability. If the second target data in the internal logical block group is damaged or lost, there is a certain probability that the complete first target data can be recovered.

[0044] In one possible implementation, we will use the second target data as an example to illustrate how data is read from a solid-state drive.

[0045] If the data redundancy strategy uses a multi-replica storage method, each internal logical block stores the second target data (or, in this embodiment, each internal logical block stores a copy of the second target data; no distinction is made between the second target data and its copy in this application). The main controller in the solid-state drive (SSD) can obtain the second target data (or a copy of the second target data) from the first internal logical block. If the second media module fails (i.e., the first internal logical block fails), the main controller will be unable to successfully obtain the second target data from the first internal logical block. In this case, the main controller in the SSD can obtain the second target data from other internal logical blocks in the internal logical block group.

[0046] If the data redundancy strategy is EC (Extended Constraints) for data storage, each internal logical block stores a fragment of the second target data. Let's assume the second target data comprises M fragments: m data fragments and k parity fragments. Therefore, the redundancy in EC is k, and the second target data can be obtained through m fragments. When the SSD's main controller reads the second target data, it can obtain m fragments of the second target data from the m internal logical blocks in the internal logical block group. Specifically, it obtains one fragment of the second target data from each internal logical block. After obtaining m fragments, the main controller retrieves the second target data based on these m fragments.

[0047] When the first internal logic block is included in the m internal logic blocks, if the second media module fails (i.e., the first internal logic block fails), the main controller will be unable to successfully obtain the fragment of the second target data from the first internal logic block. In this case, the main controller can obtain other fragments of the second target data from other internal logic blocks in the internal logic block group (such as internal logic blocks other than the m internal logic blocks), and obtain the second target data based on the other fragments of the second target data (and the fragments obtained from the m internal logic blocks).

[0048] In this solid-state drive (SSD), because the internal logical block group supports a data redundancy strategy, if the first internal logical block fails during the process of reading the second target data, the SSD can use other logical blocks to obtain the first target data.

[0049] Thirdly, this application provides a data access method applied to a storage device. The internal structure of the storage device can be found in the foregoing description, and its beneficial effects can be found in the relevant description of the first aspect, which will not be repeated here. In this method:

[0050] The storage device accesses data in the logical block group according to the data redundancy strategy. The logical block group supports the data redundancy strategy at the media module level. The data redundancy strategy includes storing data in a multi-replica manner or storing data in an erasure coding (EC) manner. The logical block group includes multiple logical blocks. The logical storage space of a logical block comes from a media module contained in a solid-state drive (SSD). The media module includes multiple flash memory chips. The media module is detachably connected to an SSD as a whole or is soldered into an SSD as a whole.

[0051] In one possible implementation, the logical storage space of multiple logical blocks originates from media modules located on different solid-state drives.

[0052] In one possible implementation, in the event of a failure in the first logical block among multiple logical blocks, the storage device outputs a prompt instruction. The prompt instruction is used to indicate a failure in the first media module corresponding to the first logical block, or to prompt for replacement of the first media module.

[0053] In one possible implementation, the storage device also includes a hot-standby SSD, which replaces the first media module with the media module in the hot-standby SSD in the event of a failure of the first logical block among multiple logical blocks.

[0054] In one possible implementation, after replacing the first media module, the storage device recovers the data stored in the first logical block using data stored in other logical blocks among a plurality of logical blocks.

[0055] In one possible implementation, when the storage device stores the first target data in the logical block group according to the data redundancy strategy, the storage device obtains the first target data to be stored; the storage device stores the first target data in the logical block group according to the data redundancy strategy.

[0056] In one possible implementation, when the storage device reads the first target data from the logical block group according to the data redundancy strategy, if the data redundancy strategy is to store data in a multi-replica manner, and each logical block stores the first target data, the storage device can obtain the first target data from other logical blocks in the logical block group if the first logical block fails.

[0057] If the data redundancy strategy is EC mode for storing data, each logical block stores a fragment of the first target data. In the event of a failure of the first logical block, the storage device obtains other fragments of the first target data from other logical blocks in the logical block group, and obtains the first target data based on the other fragments of the first target data.

[0058] In one possible implementation, the storage device is either a host connected to multiple SSDs, or a disk enclosure containing multiple SSDs. That is, the processor in the storage device is located on the host connected to the multiple SSDs, or within the disk enclosure containing the multiple SSDs.

[0059] Fourthly, this application provides a data access method applied to a solid-state drive (SSD). The internal structure of the SSD can be found in the foregoing description, and its beneficial effects can be found in the relevant description of the first aspect, which will not be repeated here. In this method:

[0060] Solid-state drives (SSDs) access data within internal logical block groups based on data redundancy strategies. These strategies include multiple copy storage or erasure coding (EC) data storage. Each internal logical block group comprises multiple internal logical blocks. The logical storage space of these internal logical blocks originates from the flash memory chips within the media modules of the SSD. Specifically, the logical storage space of one internal logical block comes from one flash memory chip in one media module of the SSD. A media module comprises multiple flash memory chips and can be either detachably connected to the SSD as a whole or soldered integrally into the SSD.

[0061] In one possible implementation, the logical storage space of multiple internal logical blocks originates from flash memory chips located in different media modules.

[0062] In one possible implementation, in the event of a failure in the first internal logical block among multiple internal logical blocks, the solid-state drive outputs a prompt command. The prompt command is used to indicate a failure in the second media module corresponding to the first internal logical block, or to prompt for replacement of the second media module.

[0063] In one possible implementation, the solid-state drive also includes a hot spare media module, which replaces the second media module with the hot spare media module in the event of a failure of the first internal logic block among multiple internal logic blocks.

[0064] In one possible implementation, after replacing the second media module, the solid-state drive recovers the data stored in the first internal logical block using data stored in other internal logical blocks among multiple internal logical blocks.

[0065] In one possible implementation, when the solid-state drive (SSD) stores the second target data in the internal logical block group according to the data redundancy strategy, the SSD acquires the second target data to be stored; the SSD stores the second target data in the internal logical block group according to the data redundancy strategy.

[0066] In one possible implementation, when the solid-state drive (SSD) reads the second target data from the internal logical block group according to the data redundancy strategy, if the data redundancy strategy is to store data in a multi-copy manner, and each internal logical block stores the second target data, the SSD can obtain the second target data from other internal logical blocks in the internal logical block group if the first internal logical block fails.

[0067] If the data redundancy strategy is EC mode for storing data, each internal logical block stores a shard of the second target data. In the event of a failure of the first internal logical block, the solid-state drive obtains other shards of the second target data from other internal logical blocks in the internal logical block group, and obtains the second target data based on the other shards of the second target data.

[0068] Fifthly, this application provides a computer-readable storage medium, which, when executed by a storage device (or computing device), performs the method executed by the storage device in the aforementioned third aspect or any possible implementation thereof. Alternatively, when the computer-readable storage medium is executed by a solid-state drive (or storage device), the solid-state drive (or storage device) performs the method executed by the solid-state drive in the aforementioned fourth aspect or any possible implementation thereof.

[0069] The computer-readable storage medium stores computer program instructions. This computer-readable storage medium includes, but is not limited to, volatile memory, such as random access memory, and non-volatile memory, such as flash memory.

[0070] Sixthly, this application provides a computing device program product, which includes computer program instructions. When executed by a storage device (or computing device), the storage device (or computing device) performs the method executed by the storage device in the aforementioned third aspect or any possible implementation thereof. Alternatively, when executed by a solid-state drive (or storage device), the solid-state drive (or storage device) performs the method executed by the solid-state drive in the aforementioned fourth aspect or any possible implementation thereof.

[0071] The computer program product may be a software installation package, which may be downloaded and executed on a computing device when the methods provided in the aforementioned third aspect or any possible implementation thereof (or: the fourth aspect or any possible implementation thereof) are required.

[0072] Seventhly, this application also provides a computer chip deployed in a storage device, on which computer program instructions are embedded to execute the methods executed by the storage device in the third aspect and various possible implementations thereof. Alternatively, the chip is embedded with computer program instructions to execute the methods executed by the solid-state drive in the fourth aspect and various possible implementations thereof.

[0073] For the technical effects that can be achieved in the second to seventh aspects mentioned above, please refer to the description of the technical effects that can be achieved by the corresponding design schemes in the first and second aspects mentioned above. This application will not repeat them here. Attached Figure Description

[0074] Figure 1 This is a schematic diagram of the structure of a storage device provided in an embodiment of this application;

[0075] Figure 2 This application provides a schematic diagram of the deployment of a logic block group according to an embodiment of the present application.

[0076] Figure 3 This application provides a schematic diagram of the deployment of a logic block group according to an embodiment of the present application.

[0077] Figure 4 This application provides a schematic diagram of the deployment of an internal logic block group according to an embodiment of the present application.

[0078] Figure 5 This application provides a schematic diagram of the deployment of an internal logic block group according to an embodiment of the present application.

[0079] Figure 6 This is a schematic diagram of a data access method provided in an embodiment of this application;

[0080] Figure 7 This is a schematic diagram of a data access method provided in an embodiment of this application. Detailed Implementation

[0081] Before introducing the storage device, solid-state drive, and data access method provided in the embodiments of this application, the data redundancy methods involved in the embodiments of this application will be explained first.

[0082] Data redundancy is a measure to ensure data reliability, preventing data loss or corruption. This application's embodiments describe methods for ensuring data reliability through data redundancy strategies. Only two methods are listed here: multiple copies and erasure coding.

[0083] 1) Data is stored using a multi-copy method.

[0084] Multiple replicas refer to creating n replicas of the data to be stored (such as the first target data involved in the embodiments of this application), where n is a positive integer greater than 1. Each replica is the same as the data to be stored, and these n replicas can be distributed in different storage spaces. For example, in the embodiments of this application, each replica can be stored in each logical block of a logical block group, with one replica stored in each logical block.

[0085] The redundancy of the multi-replica mechanism is n-1, meaning it can tolerate n-1 copies being damaged or lost. Even if n-1 copies are lost or damaged, there will still be one complete copy.

[0086] 2) Data is stored using erasure coding (EC).

[0087] Data is stored using erasure coding. The data to be stored (such as the first target data in this embodiment) is divided into m data fragments. An erasure coding algorithm is called to generate k check fragments based on the data to be stored, where m and k are both positive integers. Then, the m data fragments and k check fragments are stored respectively. For ease of explanation, both data fragments and check fragments can be referred to as data fragments; that is, when storing data using erasure coding, M fragments are generated, where the value of M is equal to the sum of m and k. There are many types of erasure coding algorithms, such as Reed-Solomon (RS) coding.

[0088] Erasure coding can tolerate the loss or corruption of k fragments (which can be data fragments or parity fragments). That is, if k fragments out of M fragments are damaged or lost, the original data (such as the first target data) can be recovered using the remaining m fragments. If the number of damaged or lost fragments out of the M fragments exceeds k, the original data cannot be recovered. k can be considered the redundancy of the erasure coding mechanism.

[0089] It should be noted that M and k shards refer to the number of shards. The remaining m shards can be all data shards, or they can include both data shards and parity shards.

[0090] like Figure 1 The diagram shown is a structural schematic of a storage device provided in an embodiment of this application. The storage device 100 includes a plurality of solid-state drives 110 (SSDs), which can provide storage space to the storage device 100 for persistent storage of data.

[0091] Storage device 100 manages the storage space provided by the plurality of SSDs 110 through logical block groups 120. Logical block group 120 is a logical concept constructed by storage device 100 to manage the storage space in SSDs 110. Correspondingly, the storage space of logical block group 120 is logical storage space, which originates from the SSDs 110.

[0092] The storage device 100 can be configured with one or more logical block groups 120. Each logical block group 120 includes multiple logical blocks 121. Similarly, each logical block 121 is a logical concept. The logical storage space within each logical block 121 also originates from the SSD 110. The logical storage space of one logical block 121 originates from one media module 111 of one SSD 110; that is, one logical block 121 corresponds to one media module 111 of one SSD 110. The media module 111 of the SSD 110 includes multiple flash memory chips 112. The data stored in the logical block 121 is essentially stored in the media module 111 corresponding to the logical block 121.

[0093] To ensure the reliability of the data stored in storage device 100, the logical block groups 120 of storage device 100 support data redundancy strategies. Each logical block group 120 can independently support a data redundancy strategy, which includes storing data in a multi-replica manner or in an EC (Extended Constraint) manner. That is, in each logical block group 120, the data in the logical block 121 is stored in a multi-replica or EC manner. Specifically, within any logical block group 120, the data redundancy strategy is supported at the granularity of media module 111 (or logical block 121). It can be understood that within any logical block group 120, the copies of the data (when storing data in a multi-replica manner) or the fragments of the data (when storing data in an EC manner) required to achieve data redundancy can be stored in the media module 111 corresponding to each logical block 121 in that logical block group 120.

[0094] In storage device 100, for any logical block group 120, the logical block group 120 can be formed across SSDs 110 or within a single SSD 110. The following are two deployment methods for logical block groups 120.

[0095] Deployment Method 1: Cross-SSD110.

[0096] like Figure 2As shown, for any logical block group 120, the logical storage space of the logical block group 120 originates from different SSDs 110. One logical block 121 in this logical block group 120 corresponds to one media module 111 of one SSD 110. The media module 111 corresponding to each logical block 121 in this logical block group 120 belongs to a different media module 111. That is, the media modules 111 from which the logical storage space of multiple logical blocks 121 originates are located on different solid-state drives 110.

[0097] With this deployment method, if some flash memory chips in SSD110 are damaged, only the media module 111 to which the flash memory chips belong needs to be replaced. Moreover, even if one SSD110 fails and becomes unusable, the data in the logical block group 120 will not be completely lost because the other SSD110s are normal, thus ensuring good data reliability.

[0098] Deployment Method 2: Within SSD110.

[0099] like Figure 3 As shown, for any logical block group 120, the logical storage space of the logical block group 120 originates from the same SSD 110. A logical block 121 within this logical block group 120 corresponds to a media module 111 within the SSD 110. Each logical block 121 in this logical block group 120 corresponds to the same media module 111.

[0100] With this deployment method, if some flash memory chips in SSD110 are damaged, only the media module 111 to which the flash memory chips belong needs to be replaced. When one SSD110 of storage device 100 fails, causing it to become unusable, it will only affect one logical block group 120 and will not affect other logical block groups 120.

[0101] From a hardware perspective, in addition to the SSD 110, the storage device 100 also includes a processor 130. Optionally, the storage device 100 also includes memory 150 and a network card 140. The structure and function of each hardware component in the storage device 100 are described below.

[0102] (1) Processor 130.

[0103] Processor 130 is the management core of storage device 100. It can be a central processing unit (CPU) or other specific integrated circuits. Processor 130 can also be other general-purpose processors, data processing units (DPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0104] In this embodiment, the processor 130 can manage the storage space in the SSD 110 through the logic block group 120. The processor 130's "management" of the storage space in the SSD 110 is manifested in the following aspects:

[0105] Aspect 1: The correspondence between the processor 130 management logic block 121 and the media module 111 in the SSD 110.

[0106] For the processor 130, the processor 130 can establish the correspondence between the logical block 121 and the media module 111 in the SSD 110 to construct the logical block group 120. After constructing the logical block group 120, the processor 130 can also perform operations such as deleting or modifying the existing correspondence between the logical block 121 and the media module 111.

[0107] For example, when a media module 111 in SSD 110 fails, processor 130 can delete the correspondence between logical block group 120 and the failed media module 111. When the failed media module 111 is removed from SSD 110 and a new media module 111 is added to SSD 110, processor 130 modifies the correspondence between logical block 121 and the failed media module 111 to the correspondence between logical block 121 and the new media module 111. That is, processor 130 can replace the media module 111 corresponding to the block group. The "replacement of media module 111" implemented by processor 130 refers to the modification of the correspondence. If a media module 111 in SSD 110 fails and a hot spare SSD exists in storage device 100, processor 130 can modify the correspondence between logic block 121 and the failed media module 111 to the correspondence between logic block 121 and the media module 111 of the hot spare SSD. In other words, the media module 111 corresponding to logic block 121 is replaced with the media module 111 in the hot spare SSD.

[0108] Second, the processor 130 performs data recovery on the data in logic block 121.

[0109] Since the logic block group 120 supports a data redundancy strategy with the medium module 111 (or logic block 121) as the granularity, when the data in the logic block 121 in the logic block group 120 is lost or damaged (that is, the data in the medium module 111 corresponding to the logic block 121 is lost or damaged), the processor 130 can use the data in other logic blocks 121 in the logic block group 120 to recover the data of the logic block 121.

[0110] For example, if the data redundancy strategy supported by the logical block group 120 is to store data in a multi-copy manner, when data in a logical block 121 is lost, the processor 130 can obtain a copy of the data from any other logical block 121 in that logical block 121 and store the copy of the data in the logical block 121 where the data was lost.

[0111] If the data redundancy strategy supported by the logical block group 120 is to store data in EC mode, when a fragment of storage in a logical block 121 is lost, the processor 130 can obtain the remaining fragments of data from other logical blocks 121 in the logical block 121, generate the lost fragment in the logical block 121 based on the remaining fragments, and write the generated fragment back into the logical block 121 with the lost fragment.

[0112] Thirdly, the processor 130 accesses the data in the media module 111 of the SSD 110 through the logic block group 120.

[0113] The processor 130 integrates the storage space of multiple SSDs 110 through the logical block group 120, which means that the processor 130's access to the data in the logical block group 120 is the same as the access to the data in the SSD 110.

[0114] The term "access" as used here includes both writing and reading data.

[0115] In the data writing scenario, the processor 130 needs to store the first target data to be stored into the SSD 110. After obtaining the first target data, the processor 130 determines the logical block group 120 that needs to store the first target data and stores the first target data in the logical block group 120. When storing the first target data in the logical block group 120, the processor 130 determines the media module 111 corresponding to each logical block 121 in the logical block group 120 and sends a data write command to the SSD 110 to which each media module 111 belongs, instructing the SSD 110 to store data in the media module 111 corresponding to the logical block 121.

[0116] In a data reading scenario, the processor 130 needs to read first target data from the SSD 110. The processor 130 determines the logical block group 120 storing the first target data and retrieves the first target data from the logical block group 120. Specifically, when reading the first target data from the logical block group 120, the processor 130 determines the media module 111 corresponding to logical block 121 within the logical block group 120 and sends a data read command to the SSD 110 belonging to the media module 111, instructing the SSD 110 to read data from the media module 111 corresponding to logical block 121. If the data redundancy strategy supported by the logical block group 120 is to store data in a multi-copy manner, then the processor 130 can send a data read command to the SSD 110 belonging to the media module 111 corresponding to one logical block 121, instructing the SSD 110 to read the first target data from the media module 111 corresponding to logical block 121. When the data redundancy strategy supported by the logical block group 120 is to store data in EC mode, the processor 130 can send a data read instruction to the SSD 110 to which the media module 111 corresponding to the m logical blocks 121 in the logical block group 120 belongs, so as to instruct the SSD 110 to read the fragment of the first target data in the media module 111 corresponding to the logical block 121. After receiving the fragment of the first target data fed back by the SSD 110, the processor 130 obtains the first target data according to the fragment of the first target data.

[0117] In addition, the processor 130 also has other functions in this embodiment. The processor 130 has a prompting function, and can output a prompting command when a certain media module 111 in the SSD 110 fails. The prompting command is used to indicate that the media module 111 corresponding to the logic block 121 is faulty, or to prompt the replacement of the media module 111.

[0118] (2) Memory 150.

[0119] Memory 150 refers to the internal memory that directly exchanges data with the processor 130, and can be used as a storage device for computer program instructions or temporary data storage. Memory 150 may include random access memory (RAM) or read-only memory (ROM). For example, the RAM may be dynamic random access memory (DRAM) or storage class memory (SCM). Memory 150 may also include other types of random access memory, such as static random access memory (SRAM). Memory 150 may also include dual in-line memory modules (DIMMs). This application does not limit the specific type of memory 150 or the types of memory included in memory 150.

[0120] (3) Network card 140.

[0121] The network interface card 140 is used to communicate with devices outside the storage device 100. Inside the storage device 100, the network interface card 140 is connected to the processor 130. The processor 130 communicates with devices outside the storage device 100 through the network interface card 140.

[0122] Network card 140 exchanges data with processor 130 via a bus. The bus can be a Peripheral Component Interconnect Express (PCIe) bus, or a Compute Express Link (CXL), Universal Serial Bus (USB) protocol, or other protocol bus.

[0123] (4) SSD110.

[0124] SSD110 is a storage device 100 that primarily uses NAND Flash as permanent storage. NAND Flash can also be referred to as flash memory chips.

[0125] Unlike the common structure of SSD110, in this embodiment, the flash memory chips 112 in the SSD110 are deployed in a "group," with each group of flash memory chips 112 forming a media module 111 within the SSD110. That is, the SSD110 includes multiple media modules 111, and each media module 111 includes multiple flash memory chips 112. The media module 111, as a hardware component of the SSD110, can be detachably connected to the SSD110. "Detachable connection" means that the media module 111 can be removed from the SSD110 as a whole, or it can be connected to the SSD110 as a whole. This connection method allows for the removal of the faulty media module 111 and the installation of a fault-free media module 111 in the event of a failure. Of course, in practical applications, the media module 111 can also be soldered into the SSD110, thus fixing the media module 111 to the SSD110 and preventing easy replacement.

[0126] This application embodiment does not limit the number of media modules 111 in the SSD 110, nor does it limit the number of flash memory chips 112 included in the media module 111. For example, the SSD 110 may include four media modules 111, each media module 111 including 16 flash memory chips 112. The 16 flash memory chips 112 can be packaged together to form a media module 111, which can be connected to the SSD 110 via a snap-fit ​​structure to form a detachable connection.

[0127] In addition to the media module 111, the SSD 110 also includes a main controller (master controller). The master controller is the central brain of the SSD 110, responsible for complex tasks such as managing data storage and maintaining the SSD 110's performance and lifespan. The master controller is essentially a processing chip, including a processor 130. This processor 130 is similar in type to the processor 130 in the aforementioned storage device 100, and will not be described further here. The master controller is the command center of the SSD 110. It controls the media module 111 by sending commands to it, such as performing read / write operations on the flash memory chips 112 of the media module 111, garbage collection of data in the media module 111, and wear leveling of the media module 111.

[0128] In this embodiment, the main controller is capable of processing data access instructions (such as data write instructions or data read instructions) sent by the processor 130 in the storage device 100, and the main controller writes or reads data in the media module 111 according to the data access instructions.

[0129] As described in the SSD110 description, the flash memory chips 112 are no longer distributed, but rather exist within the SSD110 in the form of media modules 111. This structure provides the SSD110 with a certain degree of scalability; that is, the capacity of the SSD110 can be expanded or reduced by adding or removing media modules 111, further increasing the capacity limit of the high-capacity SSD110. Since the media modules 111 are removable, the capacity adjustment of the SSD110 is also more flexible.

[0130] Optionally, as mentioned in the foregoing description, storage device 100 can manage the storage space of SSD 110 through logical block groups 120. Inside SSD 110, the main controller can also manage the storage space within SSD 110 in a similar manner.

[0131] Inside the SSD 110, the main controller can also construct logical block groups and logical blocks. To distinguish them from the logical block group 120 constructed by the storage device 100, the logical block groups and logical blocks constructed by the main controller are referred to as internal logical block group 113 and internal logical block 114. Similar to logical block group 120, internal logical block group 113 is also a logical concept, and the logical storage space of internal logical block group 113 originates from the media module 111 of the SSD 110.

[0132] For any internal logical block group 113, the internal logical block group 113 includes multiple internal logical blocks 114. Similarly, internal logical blocks 114 are also logical concepts. The logical storage space in the internal logical block 114 also originates from the SSD 110. The logical storage space of the multiple internal logical blocks 114 respectively comes from the flash memory chips of the media modules contained in the SSD 110. The logical storage space of one internal logical block 114 comes from one flash memory chip 112 of one media module 111, that is, there is a correspondence between one logical block 111 and one flash memory chip 112 of one media module 111.

[0133] Similarly, to ensure the reliability of the data inside the SSD110, the internal logical block group 113 of the SSD110 supports a data redundancy strategy. Each internal logical block group 113 can independently support a data redundancy strategy, which includes storing data in a multi-replica or EC (Extended Constraint) manner. That is, within each internal logical block group 113, the data in the internal logical block 114 is stored in a multi-replica or EC manner. Specifically, within any internal logical block group 113, the data redundancy strategy is supported at the granularity of flash memory chips 112 (or internal logical blocks 114). It can be understood that within any internal logical block group 113, the copies of the data required to achieve data redundancy (when storing data in a multi-replica manner) or the fragments of data (when storing data in an EC manner) can be stored in the flash memory chips 112 corresponding to each internal logical block 114 in that internal logical block group 113.

[0134] Within the SSD110, internal logical block groups 113 can be formed across media modules 111 or within a single media module 111. Two deployment methods for internal logical block groups 113 are listed below.

[0135] Deployment Method 1: Cross-media Module 111.

[0136] like Figure 4 As shown, for any internal logical block group 113, the logical storage space of the internal logical block group 113 originates from different media modules 111 of the SSD 110. A logical block 121 within this internal logical block group 113 corresponds to a flash memory chip 112 in a media module 111. Each flash memory chip 112 corresponding to each logical block 121 in this internal logical block group 113 belongs to a different media module 111.

[0137] Deployment method 3: Within media module 111.

[0138] like Figure 5 As shown, for any internal logical block group 113, the logical storage space of the internal logical block group 113 originates from the same media module 111 of the SSD 110. A logical block 121 in the internal logical block group 113 corresponds to a flash memory chip 112 in the media module 111. The flash memory chip 112 corresponding to each logical block 121 in the internal logical block group 113 belongs to the same media module 111.

[0139] In this embodiment, the controller can manage the storage space in the SSD 110 through the internal logic block group 113. The controller's "management" of the storage space in the SSD 110 is reflected in the following aspects:

[0140] Aspect 1: The correspondence between the main controller's internal logic block 114 and the flash memory chip 112 in the SSD 110.

[0141] For the controller, it can establish a correspondence between internal logical blocks 114 and flash memory chips 112 in SSD 110 to construct internal logical block group 113. After constructing internal logical block group 113, the controller can also perform operations such as deleting or modifying the existing correspondence between internal logical blocks 114 and flash memory chips 112.

[0142] For example, when a flash memory chip 112 in the SSD110 fails, the controller can delete the correspondence between the internal logical block group 113 and the failed flash memory chip 112. If a flash memory chip 112 in the SSD110 fails, and there are redundant flash memory chips 112 in the SSD110 (such as flash memory chips 112 in the hot spare media module), the controller can modify the correspondence between the internal logical block 114 and the failed flash memory chip 112 to a correspondence between the internal logical block 114 and the redundant flash memory chip 112, that is, replace the flash memory chip 112 corresponding to the internal logical block 114 with the redundant flash memory chip 112.

[0143] Second, the main controller recovers the data in the internal logic block 114.

[0144] Since the internal logic block group 113 supports a data redundancy strategy with flash memory chips 112 (or internal logic blocks 114) as the granularity, when data in internal logic block 114 within the internal logic block group 113 is lost or damaged (i.e., data in the flash memory chip 112 corresponding to internal logic block 114 is lost or damaged), the controller uses data from other internal logic blocks 114 within the internal logic block group 113 to recover data from that internal logic block 114. The method by which the controller recovers data from other internal logic blocks 114 within the internal logic block group 113 is similar to the method by which the processor 130 recovers data from other logic blocks 121 within the logic block group 120; details can be found in the foregoing description and will not be repeated here.

[0145] Thirdly, the controller accesses the data in the flash memory chip 112 of the SSD 110 through the internal logic block group 113.

[0146] The controller integrates the storage space of multiple SSDs 110 through the internal logical block group 113, which means that the controller's access to the data in the internal logical block group 113 is equivalent to accessing the data in the flash memory chips 112 in the SSD 110.

[0147] The term "access" as used here includes both writing and reading data.

[0148] In the data writing scenario, the controller needs to store the second target data to be stored in the SSD 110. After obtaining the second target data, the controller determines the internal logical block group 113 where the second target data needs to be stored, and stores the second target data in the internal logical block group 113. When storing the second target data in the internal logical block group 113, the controller determines the flash memory chips 112 corresponding to each internal logical block 114 in the internal logical block group 113, and sends a write command to the media module 111 to which each flash memory chip 112 belongs, instructing that data be stored in the flash memory chip 112 corresponding to the internal logical block 114.

[0149] In a data reading scenario, the controller needs to read second target data from SSD 110. The controller determines the internal logical block group 113 storing the second target data and retrieves the second target data from this internal logical block group 113. Specifically, when reading the second target data from the internal logical block group 113, the controller determines the flash memory chip 112 corresponding to the internal logical block 114 within the internal logical block group 113 and sends a read command to the media module 111 to which the flash memory chip 112 belongs, instructing that data be read from the flash memory chip 112 corresponding to the internal logical block 114. When the data redundancy strategy supported by the internal logical block group 113 is to store data in a multi-copy manner, the controller can send a read command to the media module 111 to which the flash memory chip 112 corresponding to one internal logical block 114 belongs, instructing that the second target data be read from the flash memory chip 112 corresponding to the internal logical block 114. When the data redundancy strategy supported by the internal logic block group 113 is to store data in EC mode, the main controller can send read instructions to the m internal logic blocks 114 in the internal logic block group 113 (that is, to the media module 111 to which the flash memory chip 112 corresponding to the internal logic block 114 belongs) to instruct the main controller to read the fragment of the second target data in the flash memory chip 112 corresponding to the internal logic block 114. After receiving the fragment of the second target data fed back by the media module 111, the main controller obtains the second target data according to the fragment of the second target data.

[0150] In addition, the main controller in this embodiment also has other functions. The main controller has a prompting function, and can output a prompting command (such as outputting a prompting command to the processor 130 in the storage device 100, or outputting a prompting command to the user) when a certain media module 111 in the SSD 110 fails. The prompting command is used to indicate that the media module 111 corresponding to the internal logic block 114 has failed, or to prompt the replacement of the media module 111.

[0151] In the foregoing description, the specific form of the storage device 100 in this application embodiment is not limited. The storage device 100 can be a computing device containing multiple SSDs 110, such as a server, terminal device, smart home device, etc. The storage device 100 can also be a disk enclosure containing multiple SSDs 110. In this case, the aforementioned components such as the processor 130, memory 150, and network card 140 are components deployed outside the SSDs 110 within the disk enclosure, used to manage the SSDs 110.

[0152] As described in the description of storage device 100, a logical block group 120 is constructed within it. Logical blocks 121 within the logical block group 120 correspond to media modules 111 of the SSD 110. This deployment effectively shortens the failure radius of the SSD 110. In other words, when a flash memory chip 112 within the SSD 110 fails, only the media module 111 to which the failed flash memory chip 112 belongs needs to be disabled; the remaining media modules 111 within the SSD 110 can still be used. Furthermore, since the logical block group 120 supports data redundancy strategies at the media module 111 granularity, the reliability of the data in the storage device 100 can be guaranteed. Within the logical block group 120, when some data is lost, the lost data can be recovered using the unlost data.

[0153] The following is combined Figure 6 The data access methods mentioned in the embodiments of this application will be described, such as... Figure 6 The diagram illustrates a data access method provided in this application embodiment. The method comprises three parts: The first part is an initialization process, during which the storage device 100 constructs a logical block group 120. See step 600 for details. The second part is the data access process, during which the storage device 100 writes and reads first target data through the logical block group 120. See steps 601 to 604 for details. The third part is a media module 111 failure handling process. In the event of a media module 111 failure, the storage device 100 can automatically replace the media module 111 and / or recover data. During this process, the user does not need to be aware of the data recovery and / or media module 111 replacement, thereby reducing reliance on manual intervention and improving the user experience. See steps 605 to 606 for details.

[0154] Step 600: Storage device 100 is initialized. During the initialization process, storage device 100 constructs one or more logical block groups 120 and configures the data redundancy strategy of logical block groups 120.

[0155] When storage device 100 is first started or powered on again, it needs to complete a series of initialization operations. During the initialization process, each SSD 110 connected to storage device 100 can report device information to storage device 100, which includes some or all of the following: the identifier of SSD 110, the number of media modules 111 in SSD 110, the identifier of media module 111 in SSD 110, and the capacity of media module 111 in SSD 110.

[0156] Storage device 100 can obtain the number of SSDs 110 currently connected to the storage device 100 and the distribution of media modules 111 in each SSD 110 through the device information reported by SSD 110.

[0157] Storage device 100 constructs logical block group 120 based on the device information of SSD 110. The essence of constructing logical block group 120 lies in establishing the correspondence between logical blocks 121 and media modules 111. There are many ways for storage device 100 to establish the correspondence between logical blocks 121 and media modules 111. Two methods are listed below:

[0158] Method 1: The storage device 100 stores the construction strategy of the logical block group 120, and the storage device 100 constructs the logical block group 120 according to the construction strategy.

[0159] This construction strategy describes the deployment method of logical block group 120 (e.g., across SSD 110, or within SSD 110) and the attributes of logical block group 120 (e.g., the number of logical blocks 121 in logical block group 120, the capacity of logical blocks 121, etc.). Storage device 100 can construct logical block group 120 according to this construction strategy.

[0160] For example, if the construction strategy indicates that the deployment mode of the logical block group 120 is across SSD 110, and the logical block group 120 needs to contain 4 logical blocks 121, the storage device 100 can select one media module 111 from each of the 4 SSDs 110 to establish the correspondence between the media module 111 and the logical block 121.

[0161] Method 2: Storage device 100 constructs logical block group 120 according to user instructions.

[0162] Storage device 100 provides users with an interface for constructing logical block groups 120. Through this interface, users can transmit construction information for logical block groups 120, such as the deployment method of logical block groups 120 (e.g., across SSD 110, or within SSD 110) and the attributes of logical block groups 120 (e.g., the number of logical block groups 120, the number of logical blocks 121 within logical block groups 120, and the capacity of logical blocks 121). Storage device 100 can construct logical block groups 120 based on this construction information.

[0163] For example, storage device 100 uses this interface to notify the user of the device information of SSD 110 in storage device 100. After the user understands the device information of SSD 110 in storage device 100, he / she can transmit the construction information of logical block group 120 through this interface.

[0164] It is worth noting that the interface represents a function provided by the storage device 100 to the user, namely, that the storage device 100 supports custom configuration of the logical block group 120. This application embodiment does not limit the specific form of the interface. The interface can be a visual interface in which the user can see some information provided by the storage device 100 (such as device information of the SSD 110). In this visual interface, the user can also select or enter the build information of the logical block group 120. The interface can also be a build command format, which carries the build information of the logical block group 120. The format of the build command specifies the position of the build information of the logical block group 120 within the build command. The user can transmit the build information to the storage device 100 by entering a build command that conforms to this format.

[0165] This application embodiment does not limit the number of logical block groups 120 constructed by the storage device 100. The storage device 100 can construct one logical block group 120 or multiple logical block groups 120. In step 600, in addition to constructing the logical block group 120, the storage device 100 can also configure a data redundancy policy for the logical block group 120. This application embodiment does not limit the configuration method of the data redundancy policy. For example, the storage device 100 may pre-store a data redundancy policy and configure the pre-stored data redundancy policy into the logical block group 120 to ensure that data is stored in the logical block group 120 according to the method described by the data redundancy policy. Another example is that the storage device 100 can configure a data redundancy policy for the logical block group 120 according to user instructions. That is, the user can inform the storage device 100 of the data redundancy policy (through a visual interface or command), and the storage device 100 configures the data redundancy policy for the logical block group 120 after learning of the data redundancy policy.

[0166] The above description only introduces the content related to the construction of logic block group 120 during the initialization process. In fact, other operations may be performed during the initialization process. The embodiments of this application do not limit the specific content of other operations required to be performed during the initialization process.

[0167] After constructing the logical block group 120 and configuring the data redundancy strategy, the storage device 100 can access data through the logical block group 120. The processes of writing and reading the first target data using the logical block group 120 are described below. Specifically, the process of writing the first target data using the logical block group 120 is described in steps 601-602, and the process of reading the first target data using the logical block group 120 is described in steps 603-604.

[0168] Step 601: Storage device 100 acquires the first target data to be stored.

[0169] There are many ways for storage device 100 to execute step 601. The specific form of storage device 100 is different, and the way storage device 100 obtains the first target data to be stored is different.

[0170] When the storage device 100 is a computing device containing multiple SSDs 110, the storage device 100 can receive a first data write request from outside the storage device 100. The first data write request is used to request the writing of first target data, and the first data write request carries the first target data. After receiving the first data write request, the storage device 100 obtains the first target data from the first data write request.

[0171] In addition to the first target data, the first data write request may also carry other information about the first target data, such as its logical address or location information, which indicates the location of the first target data within its respective data set. This location information may include the data set identifier and the offset of the first target data within that data set. The specific form of the data set depends on the organization of the data in the storage device 100. When the storage device 100 organizes data as files, the data set is the file to which the first target data belongs; when the storage device 100 organizes data as objects, the data set is the object to which the first target data belongs.

[0172] When the storage device 100 is a disk enclosure containing multiple SSDs 110, the storage device 100 is connected to the host and provides storage space to the host for persistent storage of data. When the host needs to store the first target data, it can send a second data write request to the storage device 100. The second data write request is used to request the writing of the first target data. After receiving the second data write request, the storage device 100 obtains the first target data from the second data write request.

[0173] In addition to the first target data, the second data write request may also carry other information about the first target data, such as the logical address of the first target data.

[0174] Step 602: Storage device 100 determines a logical block group 120 that needs to store the first target data, and stores the first target data in the logical block group 120.

[0175] When there are multiple logical block groups 120 in the storage device 100, the storage device 100 needs to store the first target data in one of the multiple logical block groups 120.

[0176] There are many ways for storage device 100 to select logical block group 120 for storing the first target data. Here are a few possible methods:

[0177] Method 1: Storage device 100 determines the logical block group 120 that needs to store the first target data based on the logical address of the first target data.

[0178] The data storage space provided by storage device 100 exists in the form of logical storage space. That is, the storage space that devices outside storage device 100 can perceive is logical storage space, and correspondingly, the addresses within this logical storage space are logical addresses. Therefore, the first data write request and the second data write request received by storage device 100 can carry the logical address of the first target data.

[0179] As mentioned above, logical block group 120 is a logical concept, and the storage space of logical block group 120 is logical storage space. Storage device 100 records the logical address range of each logical block group 120, that is, the starting logical address and the ending logical address of the logical block group 120.

[0180] After obtaining the logical address of the first target data from the first data write request and the second data write request, the storage device 100 determines the logical address range to which the logical address belongs based on the logical address of the first target data, and then determines the logical block group 120 where the logical address of the first target data is located.

[0181] It should be noted that when the second data write request does not carry the logical address of the first target data, but carries the location information of the first target data, the storage device 100 can query the metadata of the first target data based on the location information, and then determine the logical address of the first target data based on the metadata. Metadata, also known as intermediary data or relay data, is data about data, mainly describing data properties, such as the logical address of the data, the data modification history, the data size, and the data creation date.

[0182] Method 2: The storage device 100 performs address translation on the logical address of the first target data to obtain the logical address of the first target data in the logical block group 120, and determines the logical block group 120 that needs to store the first target data based on the address of the first target data in the logical block group 120.

[0183] In Method 1, the logical address of the first target data is the logical address within logical block group 120. This means that devices outside of storage device 100 can perceive the logical storage space provided by logical block group 120. However, in some scenarios, to ensure data storage security or for other needs, storage device 100 does not need to expose the logical storage space provided by logical block group 120. In other words, devices outside of storage device 100 do not need to perceive the logical storage space of logical block group 120, or the logical storage space perceived by devices outside of storage device 100 is not the logical storage space provided by logical block group 120.

[0184] Therefore, storage device 100 can utilize the logical storage space of each logical block group 120 to construct another logical storage space, which is the logical storage space that can be perceived by devices other than storage device 100. For convenience, this other logical storage space is referred to as the first logical storage space, and the logical storage space of each logical block group 120 is referred to as the second logical storage space.

[0185] Therefore, there is a correspondence between the logical addresses of the first logical storage space and the logical addresses of the second logical storage space. In other words, a logical address in the first logical storage space can be translated into a logical address in the second logical storage space, and vice versa.

[0186] The logical address of the first target data obtained by storage device 100 from a first data write request or a second data write request, or the logical address of the first target data determined based on the location information of the first target data, is the logical address in the first logical storage space. When storage device 100 determines that the logical block group 120 to which the first target data needs to be stored needs to be converted, the logical address of the first target data needs to be converted into a logical address in the second logical storage space. Storage device 100 can determine the logical block group 120 to which the logical address belongs based on the logical address of the first target data in the second logical storage space, and the logical block group 120 is the logical block group 120 to which the first target data needs to be stored.

[0187] Method 3: Storage device 100 uses a hash method to determine the logical block group 120 that needs to store the first target data.

[0188] In method three, storage device 100 can hash the logical address / location information of the first target data to obtain a hash value. The logical block group 120 pointed to by this hash value is the logical block 121 where the first target data needs to be stored. That is, each logical block group 120 has its own hash value, and different logical block groups 120 have different hash values.

[0189] After determining the logical block group 120 where the first target data needs to be stored, the storage device 100 can store the first target data in the logical block group 120. The way the storage device 100 stores the first target data in the logical block group 120 is related to the data redundancy strategy of the logical block group 120.

[0190] When the data redundancy strategy is to store data in a multi-replica manner, the storage device 100 creates n replicas of the first target data, where the value of n is the same as the number of logical blocks 121 in the logical block group 120, and the storage device 100 stores one replica of the first target data in each logical block 121 in the logical block group 120.

[0191] Specifically, regarding the interaction between storage device 100 and SSD 110, when storage device 100 stores a copy of the first target data in any logical block 121, it sends a data write instruction to the SSD 110 belonging to the media module 111 corresponding to the logical block 121. This data write instruction instructs the SSD 110 to store the copy of the first target data in the media module 111. The data write instruction may carry the identifier of the media module 111 and the copy of the first target data. It may also carry the logical address of the first target data in the logical block group 120. In methods one and three mentioned above, the logical address of the first target data in the logical block group 120 is the logical address of the first target data carried in the first data write request or the second data write request. In method two mentioned above, the logical address of the first target data in the logical block group 120 is the logical address of the first target data obtained after address translation in the second logical storage space.

[0192] After receiving a data write command, SSD 110 stores a copy of the first target data in media module 111 according to the data write command. It also records the correspondence between the logical address of the first target data in logical block group 120 and the physical address of the first target data.

[0193] When the data redundancy strategy is to store data in EC mode, the storage device 100 generates M fragments of the first target data based on the first target data. The method for generating M fragments can be found in the aforementioned description of EC, and will not be repeated here. The value of M is the same as the number of logical blocks 121 in the logical block group 120. The storage device 100 stores one fragment of the first target data in each logical block 121 in the logical block group 120.

[0194] Specifically, regarding the interaction between storage device 100 and SSD 110, when storage device 100 stores a fragment of the first target data in any logical block 121, it sends a data write instruction to the SSD 110 belonging to the media module 111 corresponding to the logical block 121. This data write instruction instructs the SSD 110 to store the fragment of the first target data in the media module 111. The data write instruction may carry the identifier of the media module 111 and the fragment of the first target data. It may also carry the logical address of the first target data in the logical block group 120. In methods one and three mentioned above, the logical address of the first target data in the logical block group 120 is the logical address of the first target data carried in the first data write request or the second data write request. In method two mentioned above, the logical address of the first target data in the logical block group 120 is the address in the second logical storage space obtained after address translation of the logical address of the first target data.

[0195] After receiving a data write command, SSD 110 stores a fragment of the first target data in media module 111 according to the data write command. It also records the correspondence between the logical address of the first target data in logical block group 120 and the physical address of the fragment of the first target data.

[0196] After the first target data is written to the storage device 100, the storage device 100 can also read the first target data. The process of reading the first target data can be found in steps 603 to 604.

[0197] Step 603: Storage device 100 determines that it needs to read the first target data.

[0198] The specific form of the storage device 100 is different, and the way the storage device 100 determines that it needs to read the first target data is different.

[0199] When the storage device 100 is a computing device containing multiple SSDs 110, the storage device 100 can receive a first data read request from outside the storage device 100. The first data read request is used to request the reading of first target data. After receiving the first data read request, the storage device 100 determines that it needs to read the first target data.

[0200] In addition to the first target data, the first data read request may also carry other information about the first target data, such as the logical address of the first target data or the location information of the first target data. For an explanation of the location information, please refer to the foregoing description, which will not be repeated here.

[0201] When the storage device 100 is a disk enclosure containing multiple SSDs 110, the storage device 100 is connected to the host and provides storage space to the host for persistent storage of data. When the host needs to read the first target data, it can send a second data read request to the storage device 100. The second data read request is used to request to read the first target data. After receiving the second data read request, the storage device 100 determines that it needs to read the first target data.

[0202] In addition to the first target data, the second data read request may also carry other information about the first target data, such as the logical address of the first target data.

[0203] Step 604: Storage device 100 determines the logical block group 120 where the first target data is located, and obtains the first target data from the logical block group 120.

[0204] The way in which storage device 100 determines the logical block group 120 where the first target data is located is similar to the way in step 602 where storage device 100 determines the logical block group 120 that needs to store the first target data. For details, please refer to the relevant description in step 603, which will not be repeated here.

[0205] After determining the logical block group 120 where the first target data is located, the storage device 100 reads the first target data from the logical block group 120. The method by which the storage device 100 reads the first target data from the logical block group 120 is related to the data redundancy strategy of the logical block group 120.

[0206] When the data redundancy strategy is to store data in a multi-copy manner, the storage device 100 obtains a copy of the first target data from a logical block 121 in the logical block group 120.

[0207] Specifically, regarding the interaction between storage device 100 and SSD 110, when storage device 100 reads a copy of the first target data from a logical block 121, it sends a data read instruction to the SSD 110 belonging to the media module 111 corresponding to the logical block 121. This data read instruction instructs the SSD 110 to retrieve a copy of the first target data from the media module 111. This data read instruction may carry the identifier of the media module 111 and the logical address of the first target data within the logical block group 120. For an explanation of the logical address of the first target data within the logical block group 120, please refer to the foregoing description; it will not be repeated here.

[0208] After receiving a data read command, SSD 110 determines the physical address of the first target data based on the recorded correspondence between the logical address and physical address of the first target data in the logical block group 120 and the logical address carried in the data read command. SSD 110 then reads a copy of the first target data from the location indicated by the physical address in the media module 111. SSD 110 then sends the copy of the first target data back to the storage device 100.

[0209] It is worth noting that during the process of the storage device 100 reading a copy of the first target data from a logical block 121 of the logical block group 120, there may be a reading failure, such as a failure of the media module 111 corresponding to the logical block 121, or a failure of the SSD 110 where the media module 111 corresponding to the logical block 121 is located. The storage device 100 can read a copy of the first target data from other logical blocks 121 in the logical block group 120. The reading process can be referred to the foregoing description, and will not be repeated here.

[0210] When the data redundancy strategy is to store data in EC mode, the storage device 100 reads the fragments of the first target data from the m logical blocks 121 in the logical block group 120, that is, obtains the m fragments of the first target data, and the storage device 100 obtains the first target data based on the m fragments of the first target data.

[0211] Specifically, regarding the interaction between storage device 100 and SSD 110, when storage device 100 reads a fragment of the first target data from a logical block 121, it sends a data read instruction to the SSD 110 belonging to the media module 111 corresponding to the logical block 121. This data read instruction instructs the SSD 110 to read the fragment of the first target data from the media module 111. The data read instruction may carry the identifier of the media module 111 and the logical address of the first target data within the logical block group 120.

[0212] After receiving a data read command, SSD 110 determines the physical address of the first target data based on the recorded correspondence between the logical address and physical address of the first target data in the logical block group 120 and the logical address carried in the data read command. SSD 110 then reads a fragment of the first target data from the location indicated by the physical address in the media module 111. SSD 110 then sends the fragment of the first target data back to the storage device 100.

[0213] It is worth noting that during the process of the storage device 100 reading m fragments of the first target data from m logical blocks 121 of the logical block group 120, there may be one or more fragment reading failures, such as the failure of the media module 111 corresponding to the logical block 121, or the failure of the SSD 110 where the media module 111 corresponding to the logical block 121 is located. The storage device 100 can read fragments of the first target data from other logical blocks 121 outside the m logical blocks 121 in the logical block group 120. The storage device 100 only needs to ensure that the total number of fragments of the first target data from the logical block group 120 is m to obtain the first target data using the m fragments.

[0214] As can be seen from steps 601 to 604, the storage device 100 accesses the data in the SSD 110 using the logical block group 120. Since logical blocks 121 in the logical block group 120 correspond to media modules 111, copies or fragments of the first target data can be distributed across different media modules 111. Even if some media modules 111 fail, causing the copies or fragments of the first target data stored on those media modules 111 to become corrupted, the storage device 100 can still obtain copies or fragments of the first target data from the unfailed media modules 111 corresponding to logical blocks 121, effectively ensuring the reliability of the first target data and guaranteeing the efficiency of accessing the first target data.

[0215] The foregoing description mentions the possibility of a fault in media module 111. To address this fault promptly, storage device 100 provides two solutions, described in steps 605 and 606 respectively. In practical applications, some or all of these solutions can be employed. For clarity, it is assumed that the faulty media module 111 in the media module 111 corresponding to logic block 121 in logic block group 120 is the first media module, and the SSD containing the first media module is the first SSD. The logic block 121 corresponding to this first media module is the first logic block.

[0216] Step 605: In the event of a failure of the first media module, the storage device 100 sends a prompt instruction, which is used to indicate that the first media module corresponding to the first logic block is faulty, or to prompt the replacement of the first media module.

[0217] This application does not limit the method by which the storage device 100 determines the failure of the first media module. Several methods are listed below for the storage device 100 to determine the failure of the first media module. For ease of explanation, the SSD 110 where the first media module is located is referred to as the first SSD.

[0218] The first type is that the storage device 100 has a detection function, which detects each media module 111 in the first SSD to determine whether the media module 111 in the first SSD is faulty.

[0219] Storage device 100 can manage each SSD 110 connected to it, and for any SSD 110, storage device 100 can detect the media module 111 in that SSD 110.

[0220] Taking the first SSD as an example, the storage device 100 can send a detection command to the first SSD. The detection command is used to instruct the media module 111 in the first SSD to detect whether each media module 111 in the first SSD is faulty.

[0221] After receiving the detection command, the first SSD performs a detection on the media module 111 in the first SSD to determine whether each media module 111 in the first SSD is faulty.

[0222] There are many ways to test the first SSD media module 111. Taking the testing of the first media module as an example, several testing methods will be introduced.

[0223] Detection Method 1: The first SSD can store the preset first data in the first media module, and then read the data of the first media module from the first media module. If the read data is the same as the first data, the first media module is considered to be normal. If the read data is different from the first data, the first media module is considered to be faulty.

[0224] Detection Method Two: The first SSD performs multiple data access operations on the first media module. Each data access operation involves storing a preset first data in the first media module, and then reading data from the first media module. This process is repeated cyclically. After each data access operation, the read data is compared with the first data. If the read data matches the first data, the data access operation is considered successful; otherwise, it is considered a failure. If the proportion of failed data access operations (equal to the ratio of the number of failed data access operations to the total number of data access operations) exceeds a threshold, the first media module is considered faulty; otherwise, the first media module is considered normal.

[0225] The second type is that the first SSD has a self-test function. The first SSD will detect its own media module 111. When it detects that the first media module in the first SSD has failed, it will notify the storage device 100 of the first media module failure.

[0226] Each SSD 110 connected to the storage device 100 has a self-test function, which can test the media modules 111 contained within it.

[0227] Taking the first SSD as an example, the first SSD detects each of its media modules 111. The method by which the first SSD detects the media modules 111 can be found in the previous description and will not be repeated here. When the first SSD detects a failure in the first media module, it sends a notification message to the storage device 100 to inform the storage device 100 that the first media module has failed.

[0228] The third method involves the storage device 100 or the first SSD determining whether the first media module is faulty based on historical data access information of the first media module.

[0229] As can be seen from the aforementioned process of the storage device 100 accessing data through the logical block group 120, the storage device 100 interacts with the first SSD to access the data in the media module 111 of the first SSD, such as writing or reading data from the media module 111 of the first SSD, and records the historical data access information of each media module 111.

[0230] Taking the first media module as an example, the historical data access information of the first media module indicates the success probability of data access from the first media module. The success probability of data access is equal to the ratio of the number of successful data accesses in the first media module to the total number of data accesses in the first media module. Successful data access means successfully writing data or successfully reading data from the first media module.

[0231] If the success rate of data access in the first media module is greater than the set value, it indicates that the first media module has a high probability of successful data access and is functioning normally. If the success rate of data access in the first media module is less than the set value, it indicates that the success rate of data access in the first media module is low and the first media module is faulty.

[0232] When storage device 100 determines that the first media module is faulty, it outputs a prompt command to indicate the fault in the first media module corresponding to the first logical block, or to prompt the user to replace the first media module. The recipient of this prompt command is not limited; storage device 100 can output the prompt command to a user, such as through voice announcement, email, or text display in a visual interface. Storage device 100 can also output the prompt command to a device connected to it. For example, if storage device 100 is a disk enclosure, it can send the prompt command to a host connected to the disk enclosure to notify the host of the first media module fault or to prompt the user to replace the first media module. Upon receiving the prompt command, the host can inform the user of the first media module fault or prompt the user to replace the first media module.

[0233] For users, upon receiving a prompt from storage device 100 or a notification from the host, they can promptly learn of a fault in the first media module and disassemble it in a timely manner.

[0234] It should be noted that in the event of a failure of the first media module, the storage device 100 can perform other processing operations in addition to outputting a prompt command. For example, the storage device 100 can delete the correspondence between the first media module and the first logical block. Here, "delete" can be understood as marking the correspondence between the first media module and the first logical block as invalid. As another example, if the storage device 100 detects that the first media module has been removed and a new media module 111 has been installed, the storage device 100 can replace the first media module corresponding to the first logical block with the new media module 111. Here, "replace" refers to modifying the correspondence between the first logical block and the first media module.

[0235] Step 606: In the event of a failure of the first media module, the storage device 100 replaces the first media module with the media module 111 in the hot standby SSD.

[0236] Here, the concept of "hot standby SSD" is introduced. Hot standby SSD is an SSD110 deployed to prevent failure of media module 111 in SSD110. This hot standby SSD is an additional SSD110, mainly used to deal with the situation where the logic block 121 corresponding to media module 111 cannot be generated and used when the media module 111 in SSD110 fails.

[0237] Taking the first media module as an example, when the first media module fails, the first logical block corresponding to the first media module will be unusable, that is, the data in the first logical block cannot be accessed. In this case, the storage device 100 can replace the first media module corresponding to the first logical block and replace the first media module with the media module 111 in the hot spare SSD. That is, the storage device 100 modifies the correspondence between the first logical block and the first media module to the correspondence between the first logical block and the media module 111 in the hot spare SSD.

[0238] Both steps 605 and 606 involve the replacement of the first media module. For example, in step 605, the storage device 100 can replace the first media module with a new media module 111, and in step 606, the storage device 100 replaces the first media module with the media module 111 in the hot standby SSD.

[0239] After the first media module is replaced, the data stored in the first media module will be lost, that is, the data stored in the first logical block will be lost. The storage device 100 can recover the data from the first logical block. Since the logical block group 120 to which the first logical block belongs supports a data redundancy strategy, the storage device 100 can use the data from other logical blocks 121 in the logical block group 120 other than the first logical block to recover the data stored in the first logical block.

[0240] When the data redundancy strategy supported by the logical block 121 to which the first logical block belongs is to store data in a multi-copy manner, when the storage device 100 recovers the data in the first logical block, the storage device 100 can obtain data from any logical block 121 in the logical block group 120 other than the first logical block and store the obtained data in the first logical block.

[0241] When the data redundancy strategy supported by the logical block 121 to which the first logical block belongs is to store data in EC mode, when the storage device 100 recovers the data in the first logical block, the storage device 100 can obtain data fragments from other logical blocks 121 in the logical block group 120 other than the first logical block, generate the data fragments to be stored in the first logical block according to the obtained fragments, and store the generated fragments in the first logical block.

[0242] Steps 601 to 606 describe the specific implementation method by which the storage device 100 manages the storage space of the SSD 110 using the logical block group 120. As can be seen from the foregoing, since there is a correspondence between the logical block 121 in the logical block group 120 and the media module 111, when the flash memory chip 112 in the SSD 110 fails, only the media module 111 where the flash memory chip 112 is located needs to be isolated, and the other media modules 111 of the SSD 110 can still be used normally.

[0243] As described in the SSD110 description, the SSD110's storage space can also be managed internally using internal logical block group 113. For details on its implementation, please refer to [link to relevant documentation]. Figure 7 , Figure 7 This application provides another data access method. In this data access method, the SSD 110 can also be managed using internal logical block groups 113. Since the principle by which the storage device 100 manages the storage space of the SSD 110 using logical block groups 120 is similar to the principle by which the SSD 110 manages its storage space using internal logical block groups 113, Figure 7 The data access method shown is described in a simplified manner; for its detailed implementation process, please refer to [link to relevant documentation]. Figure 6 Related descriptions.

[0244] Step 700: SSD110 constructs one or more internal logical block groups 113 and configures the data redundancy strategy of the internal logical block group 113.

[0245] When the SSD110 is first started or powered on again, it needs to complete a series of initialization operations. During the initialization process, the SSD110 constructs internal logical block group 113. The essence of constructing internal logical block group 113 is to establish the correspondence between internal logical blocks 114 and flash memory chips 112. The way the SSD110 establishes the correspondence between internal logical blocks 114 and flash memory chips 112 is similar to the way the storage device 100 establishes the correspondence between logical blocks 121 and media modules 111, which can be referred to the above description and will not be repeated here.

[0246] This application embodiment does not limit the number of internal logical block groups 113 constructed by the SSD 110. The SSD 110 can construct one internal logical block group 113 or multiple internal logical block groups 113. In step 700, in addition to constructing the internal logical block group 113, the SSD 110 can also configure a data redundancy policy for the internal logical block group 113. The way the SSD 110 configures the data redundancy policy for the internal logical block group 113 is similar to the way the storage device 100 configures the data redundancy policy for the logical block group 120. For details, please refer to the foregoing description, which will not be repeated here.

[0247] After constructing the internal logical block group 113 and configuring the data redundancy strategy, the SSD 110 can access data through the internal logical block group 113. The processes of writing and reading the second target data using the internal logical block group 113 are described below. Specifically, the process of writing the second target data using the internal logical block group 113 is described in steps 701-702, and the process of reading the second target data using the internal logical block group 113 is described in steps 703-704.

[0248] Step 701: SSD110 acquires the second target data to be stored.

[0249] SSD 110 can receive a third data write request sent by a processor 130, which can be a processor 130 deployed in the disk enclosure where SSD 110 is located to manage SSD 110 in the disk enclosure. The third data write request is used to request the writing of second target data, and the third data write request carries the second target data. After receiving the first data write request, SSD 110 obtains the second target data from the first data write request.

[0250] The SSD110 can also receive a fourth data write request sent by a host to which the SSD110 is connected. The second data write request is used to request the writing of a second target data. After receiving the second data write request, the SSD110 obtains the second target data from the second data write request.

[0251] It should be noted that, in addition to the second target data, the third and fourth data write requests may also carry other information about the second target data, such as the logical address of the second target data.

[0252] Step 702: SSD 110 determines the internal logical block group 113 in which the second target data needs to be stored, and stores the second target data in the internal logical block group 113.

[0253] The way SSD110 selects the internal logical block group 113 for storing the second target data is similar to the way storage device 100 selects the logical block group 120 for storing the first target data. For details, please refer to the foregoing description, which will not be repeated here.

[0254] After determining the internal logical block group 113 where the second target data needs to be stored, the SSD 110 can store the second target data in the internal logical block group 113. The way the SSD 110 stores the second target data in the internal logical block group 113 is related to the data redundancy strategy of the internal logical block group 113.

[0255] When the data redundancy strategy is to store data in a multi-replica manner, the SSD110 creates n replicas of the second target data, where the value of n is the same as the number of internal logical blocks 114 in the internal logical block group 113. The SSD110 stores one replica of the second target data in each internal logical block 114 in the internal logical block group 113.

[0256] Specifically, regarding the interaction between the SSD 110 and the media module 111, when the SSD 110 stores a copy of the second target data in any internal logical block 114, the SSD 110 sends a data write command to the media module 111 to which the flash memory chip 112 corresponding to the internal logical block 114 belongs. This data write command instructs the media module 111 to store a copy of the second target data in the flash memory chip 112. The data write command may carry the identifier of the flash memory chip 112 and the copy of the second target data.

[0257] The media module 111 stores a copy of the second target data in the flash memory chip 112 according to the data write instruction. The SSD 110 records the correspondence between the logical address and the physical address of the second target data.

[0258] When the data redundancy strategy is to store data in EC mode, SSD 110 generates M fragments of the second target data based on the second target data. The method for generating M fragments can be found in the aforementioned description of EC, and will not be repeated here. The value of M is the same as the number of internal logical blocks 114 in the internal logical block group 113. SSD 110 stores one fragment of the second target data in each internal logical block 114 in the internal logical block group 113.

[0259] Specifically, regarding the interaction between the SSD 110 and the media module 111, when the SSD 110 stores a fragment of the second target data in any internal logical block 114, the SSD 110 sends a data write command to the media module 111 to which the flash memory chip 112 corresponding to the internal logical block 114 belongs. This data write command instructs the SSD 110 to store the fragment of the second target data in the flash memory chip 112. The data write command may carry the identifier of the flash memory chip 112 and the fragment of the second target data.

[0260] The media module 111 stores fragments of the second target data in the flash memory chip 112 according to the data write instruction. The SSD 110 records the correspondence between the logical address of the second target data and the physical address of the fragment of the second target data.

[0261] After the second target data is written to SSD110, SSD110 can also read the second target data. The process of reading the second target data can be found in steps 703 to 704.

[0262] Step 703: SSD110 (SSD110 controller) determines that it needs to read the second target data.

[0263] SSD110 can receive a third data read request from processor 130 in the disk enclosure. The third data read request is used to request the reading of second target data. After receiving the third data read request, SSD110 determines that it needs to read the second target data.

[0264] The SSD110 can also receive a fourth data read request from the host, which is used to request the reading of a second target data. After receiving the second data read request, the SSD110 determines that it needs to read the second target data.

[0265] The third and fourth data read requests may also carry other information about the second target data, such as the logical address of the second target data.

[0266] Step 704: SSD110 (the controller of SSD110) determines the internal logical block group 113 where the second target data is located, and obtains the second target data from the internal logical block group 113.

[0267] The way SSD110 determines the internal logical block group 113 where the second target data is located is similar to the way SSD110 determines the internal logical block group 113 that needs to store the second target data in step 702. For details, please refer to the relevant description in step 703, which will not be repeated here.

[0268] After determining the internal logical block group 113 where the second target data is located, the SSD 110 reads the second target data from the internal logical block group 113. The way the SSD 110 reads the second target data from the internal logical block group 113 is related to the data redundancy strategy of the internal logical block group 113.

[0269] When the data redundancy strategy is to store data in a multi-copy manner, the SSD 110 obtains a copy of the second target data from one of the internal logical blocks 114 in the internal logical block group 113.

[0270] Specifically, regarding the interaction between SSD110 (the controller of SSD110) and media module 111, when SSD110 reads a copy of the second target data from an internal logical block 114, SSD110 determines the physical address of the second target data based on the correspondence between the logical address and the physical address of the second target data, and sends a data read command to the media module 111 to which the flash memory chip 112 corresponding to the internal logical block 114 belongs. This data read command instructs SSD110 to obtain a copy of the second target data from the flash memory chip 112. This data read command may carry the identifier of the flash memory chip 112 and the physical address of the second target data.

[0271] After receiving the data read command, the media module 111 reads a copy of the second target data at the location indicated by the physical address of the second target data in the flash memory chip 112 and sends the copy of the second target data back to the SSD 110.

[0272] It is worth noting that during the process of SSD110 reading a copy of the second target data from an internal logical block 114 of internal logical block group 113, there may be a read failure, such as the flash memory chip 112 corresponding to the internal logical block 114 failing, or the SSD110 containing the flash memory chip 112 corresponding to the internal logical block 114 failing. SSD110 can then read a copy of the second target data from other internal logical blocks 114 in the internal logical block group 113. The read process can be referred to the foregoing description and will not be repeated here.

[0273] When the data redundancy strategy is to store data in EC mode, SSD110 reads the fragments of the second target data from the m internal logical blocks 114 in the internal logical block group 113, that is, obtains the m fragments of the second target data. SSD110 obtains the second target data based on the m fragments of the second target data.

[0274] Specifically, regarding the interaction between SSD 110 and media module 111, when SSD 110 reads a fragment of the second target data from an internal logical block 114, SSD 110 determines the physical address of the second target data based on the correspondence between the logical address and the physical address of the second target data, and sends a data read command to the media module 111 to which the flash memory chip 112 corresponding to the internal logical block 114 belongs. This data read command instructs SSD 110 to retrieve the fragment of the second target data from the flash memory chip 112. The data read command may carry the identifier of the flash memory chip 112 and the physical address of the second target data.

[0275] After receiving the data read command, the media module 111 reads the fragment of the second target data at the location indicated by the physical address of the second target data in the flash memory chip 112, and feeds back the fragment of the second target data to the SSD 110.

[0276] It is worth noting that during the process of SSD110 reading m fragments of the second target data from m internal logical blocks 114 of internal logical block group 113, there may be one or more fragment reading failures, such as the flash memory chip 112 corresponding to the internal logical block 114 failing, or the SSD110 containing the flash memory chip 112 corresponding to the internal logical block 114 failing. SSD110 can read fragments of the second target data from other internal logical blocks 114 outside of the m internal logical blocks 114 in internal logical block group 113. SSD110 only needs to ensure that the total number of fragments of the second target data from internal logical block group 113 is m to obtain the second target data using these m fragments.

[0277] As can be seen from steps 701 to 704, the SSD 110 accesses the data within its internal logical block group 113. Since the internal logical blocks 114 within the internal logical block group 113 correspond to the flash memory chips 112, copies or fragments of the second target data can be distributed across different flash memory chips 112. Even if some flash memory chips 112 fail, causing damage to the copies or fragments of the second target data stored on those chips, the SSD 110 can still retrieve copies or fragments of the second target data from the unfailed flash memory chips 112 corresponding to the internal logical block 114, effectively ensuring the reliability of the second target data and guaranteeing the efficiency of second target data access.

[0278] As mentioned in the foregoing description, in order to promptly handle the failure of media module 111, SSD 110 provides two response methods, namely the methods described in steps 705 and 706. In practical applications, some or all of these two response methods can be used. For ease of explanation, it is assumed here that the media module 111 corresponding to the internal logic block 114 in the internal logic block group 113 is the second media module, and the internal logic block 114 corresponding to the flash memory chip 112 in the second media module is the first internal logic block.

[0279] Step 705: In the event of a second media module failure, the SSD110 outputs a prompt command. This prompt command is used to indicate a failure of the second media module corresponding to the first internal logic block, or to prompt for replacement of the second media module.

[0280] This application does not limit the method by which SSD110 determines the failure of the second media module. Several methods are listed below for SSD110 to determine the failure of the second media module. For ease of explanation, the SSD110 containing the second media module is referred to as SSD110.

[0281] The first type is that the SSD110 has a self-test function. The SSD110 will detect its own media module 111. When it detects that the second media module in the SSD110 has failed, it will notify the SSD110 of the second media module failure.

[0282] The method by which SSD110 detects media module 111 can be found in the foregoing description and will not be repeated here. When SSD110 detects a failure in the second media module, it sends a notification message to SSD110 to inform SSD110 that the second media module has failed.

[0283] The second method involves SSD110 determining whether the second media module is faulty based on its historical data access information.

[0284] As can be seen from the aforementioned process of SSD110 accessing data through internal logical block group 113, SSD110 accesses data in media module 111 by interacting with media module 111, such as writing or reading data from media module 111, and records historical data access information of each media module 111.

[0285] Taking the second media module as an example, the historical data access information of the second media module indicates the success probability of data access from the second media module. The success probability of data access is equal to the ratio of the number of successful data accesses in the second media module to the total number of data accesses in the second media module. Successful data access means successfully writing data or successfully reading data in the second media module.

[0286] If the success rate of data access in the second media module is greater than the set value, it indicates that the second media module has a high probability of successful data access and is functioning normally. If the success rate of data access in the second media module is less than the set value, it indicates that the success rate of data access in the second media module is low and the second media module is faulty.

[0287] When the SSD110 determines that the second media module is faulty, it outputs a prompt command to indicate the fault in the second media module corresponding to the first internal logic block, or to prompt for replacement of the second media module. The recipient of this prompt command is not limited; the SSD110 can output the prompt command to the user, such as through voice announcement, email, or text display in a visual interface. The SSD110 can also output the prompt command to devices connected to it (such as a host computer or the processor 130 in the drive enclosure).

[0288] For users, upon receiving a prompt from the SSD110 or a notification from the host, they can promptly learn of a second media module failure and replace it in a timely manner.

[0289] It should be noted that in the event of a second media module failure, the SSD110 can perform other processing operations in addition to outputting prompt commands. For example, the SSD110 can delete the correspondence between the flash memory chip 112 in the second media module and the first internal logical block. Here, "delete" can be understood as marking the correspondence between the flash memory chip 112 of the second media module and the first internal logical block as invalid. As another example, if the SSD110 detects that the second media module has been removed and a new media module 111 has been installed, the SSD110 can replace the flash memory chip 112 of the second media module corresponding to the first internal logical block with the flash memory chip 112 of the new media module 111. Here, "replace" refers to modifying the correspondence between the first internal logical block and the flash memory chip 112 of the second media module.

[0290] Step 706: In the event of a failure of the second media module, the SSD110 will replace the second media module with a hot-standby media module.

[0291] Here, the concept of "hot spare media module" is introduced. The hot spare media module is a media module 111 deployed to prevent failure of media module 111 in SSD110. The hot spare media module is an additional media module 111 set in SSD110. It is mainly used to deal with the situation where the internal logic block 114 corresponding to the flash memory chip 112 of media module 111 cannot be generated and used when the media module 111 in SSD110 fails.

[0292] Taking the second media module as an example, when the second media module fails, the first internal logic block corresponding to the flash memory chip 112 of the second media module will be unusable, that is, the data in the first internal logic block cannot be accessed. In this case, the SSD 110 can replace the flash memory chip 112 of the second media module corresponding to the first internal logic block, and replace the flash memory chip 112 of the second media module with the flash memory chip 112 in the hot spare media module. That is, the SSD 110 modifies the correspondence between the first internal logic block and the flash memory chip 112 in the second media module to the correspondence between the first internal logic block and the flash memory chip 112 in the hot spare media module.

[0293] Both steps 705 and 706 involve replacing the flash memory chip 112 in the second media module. For example, in step 705, the SSD 110 can replace the flash memory chip 112 in the second media module with the flash memory information of the new media module 111. In step 706, the SSD 110 replaces the flash memory chip 112 in the second media module with the flash memory chip 112 in the hot spare media module.

[0294] After the flash memory chip 112 of the second media module is replaced, the data stored in the flash memory chip 112 of the second media module will be lost, that is, the data stored in the first internal logical block will be lost. The SSD 110 can recover the data from the first internal logical block. The method by which the SSD 110 recovers the data from the first internal logical block is similar to the method by which the storage device 100 recovers the data from the first logical block. For details, please refer to the foregoing description, which will not be repeated here.

[0295] The descriptions of the processes corresponding to the above-mentioned figures each have their own emphasis. For parts of a process that are not described in detail, please refer to the relevant descriptions of other processes.

[0296] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, in the form of a computer program product. A computer program product includes computer program instructions, which, when loaded and executed on a computer, generate, in whole or in part, the product according to the embodiments of the present invention. Figure 3 The process or function described.

[0297] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD).

[0298] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A storage device, characterized in that, The storage device includes a logical block group and multiple solid-state drives (SSDs), and the logical storage space in the logical block group comes from the multiple solid-state drives. The logical block group includes multiple logical blocks. The logical storage space of a logical block comes from a media module contained in a solid-state drive. The media module includes multiple flash memory chips. The media module is detachably connected to the solid-state drive as a whole or the media module is soldered into the solid-state drive as a whole. The logical block group supports data redundancy strategies at the medium module level, and the data redundancy strategies include storing data in a multi-copy manner or storing data in an erasure coding (EC) manner.

2. The device as described in claim 1, characterized in that, The logical storage space of the multiple logical blocks originates from media modules located on different solid-state drives.

3. The device as described in claim 1 or 2, characterized in that, The storage device further includes a processor, wherein the processor in the storage device is configured to: In the event of a failure in the first logic block among the plurality of logic blocks, a prompt instruction is output. The prompt instruction is used to indicate that the first media module corresponding to the first logic block is faulty, or to indicate that the first media module should be replaced.

4. The device as described in any one of claims 1 to 3, characterized in that, The storage device also includes a hot-spare solid-state drive, and the processor in the storage device is further used for: In the event of a failure of the first logic block among the plurality of logic blocks, the first media module shall be replaced with the media module in the hot standby solid-state drive.

5. The device as described in claim 3 or 4, characterized in that, The processor is also used for: After replacing the first media module, the data stored in the first logic block is recovered using the data stored in other logic blocks among the plurality of logic blocks.

6. The device according to any one of claims 3 to 5, characterized in that, The processor is also used for: Retrieve the first target data to be stored; The first target data is stored in the logical block group according to the data redundancy strategy.

7. The device as described in claim 6, characterized in that, The processor is also used for: If the data redundancy strategy is to store data in a multi-replica manner, and each logical block stores the first target data, in the event of a failure of the first logical block, the first target data can be obtained from other logical blocks in the logical block group. or If the data redundancy strategy is EC mode for storing data, each logical block stores a fragment of the first target data. In the event of a failure of the first logical block, other fragments of the first target data are obtained from other logical blocks in the logical block group, and the first target data is obtained based on the other fragments of the first target data.

8. The device according to any one of claims 3 to 7, characterized in that, The processor is located on a host connected to the plurality of SSDs, or in the disk enclosure where the plurality of SSDs are located.

9. A solid-state drive, characterized in that, The solid-state drive includes logical block groups, and the logical storage space in the logical block groups comes from the solid-state drive. The logical block group includes multiple logical blocks, and the logical storage space of the multiple logical blocks comes from the flash memory chips of the media module included in the solid-state drive. The media module includes multiple flash memory chips, and the media module is detachably connected to the solid-state drive as a whole or the media module is soldered into the solid-state drive as a whole. The logical block group supports a data redundancy strategy, which includes storing data using multiple replicas or using erasure coding (EC) to store data.

10. The solid-state drive as described in claim 9, characterized in that, The logical storage space of the multiple logical blocks comes from flash memory chips located in different media modules.

11. The solid-state drive as described in claim 9 or 10, characterized in that, The solid-state drive also includes a main controller, which is used for: In the event of a failure in the first logic block among the plurality of logic blocks, a prompt instruction is output. The prompt instruction is used to indicate a failure in the second media module corresponding to the first logic block, or to prompt for replacement of the second media module.

12. The solid-state drive as described in any one of claims 9 to 11, characterized in that, The solid-state drive also includes a hot spare media module, and the main controller in the solid-state drive is further used for: In the event of a failure of the first logic block among the plurality of logic blocks, the second media module shall be replaced with the hot standby media module.

13. The solid-state drive as described in claim 11 or 12, characterized in that, The main controller is also used for: After replacing the second media module, the data stored in the first logic block is recovered using the data stored in other logic blocks among the plurality of logic blocks.

14. The solid-state drive as described in any one of claims 11 to 13, characterized in that, The main controller is also used for: Obtain the second target data to be stored; The second target data is stored in the logical block group according to the data redundancy strategy.

15. The solid-state drive as described in claim 14, characterized in that, The main controller is also used for: If the data redundancy strategy is to store data in a multi-replica manner, and each logical block stores the second target data, in the event of a failure of the first logical block, the second target data can be obtained from other logical blocks in the logical block group; or If the data redundancy strategy is to store data in EC mode, each logical block stores a fragment of the second target data. In the event of a failure of the first logical block, other fragments of the second target data are obtained from other logical blocks in the logical block group, and the second target data is obtained based on the other fragments of the second target data.

16. A data access method, characterized in that, The method is applied to a storage device, the storage device including a logical block group and multiple solid-state drives (SSDs), wherein the logical storage space in the logical block group comes from the multiple SSDs; the method includes: The storage device accesses data in the logical block group according to a data redundancy strategy. The logical block group supports the data redundancy strategy at the media module level. The data redundancy strategy includes storing data in a multi-replica manner or storing data in an erasure coding (EC) manner. The logical block group includes multiple logical blocks. The logical storage space of a logical block comes from a media module contained in a solid-state drive (SSD). The media module includes multiple flash memory chips. The media module is detachably connected to the SSD as a whole or is soldered into the SSD as a whole.

17. The method as described in claim 16, characterized in that, The logical storage space of the multiple logical blocks originates from media modules located on different solid-state drives.

18. The method as described in claim 16 or 17, characterized in that, The method further includes: In the event of a failure in the first logical block among the plurality of logical blocks, the storage device outputs a prompt instruction, which is used to indicate a failure in the first media module corresponding to the first logical block, or to prompt for replacement of the first media module.

19. The method according to any one of claims 16 to 18, characterized in that, The storage device further includes a hot-spare solid-state drive, and the method further includes: In the event of a failure of the first logical block among the plurality of logical blocks, the storage device replaces the first media module with the media module in the hot-standby solid-state drive.

20. The method as described in claim 18 or 19, characterized in that, The method further includes: After replacing the first media module, the storage device recovers the data stored in the first logical block using data stored in other logical blocks among the plurality of logical blocks.

21. The method according to any one of claims 18 to 20, characterized in that, The storage device accesses data in the logical block group according to a data redundancy policy, including: The storage device acquires the first target data to be stored; The storage device stores the first target data in the logical block group according to the data redundancy strategy.

22. The method as described in claim 21, characterized in that, The storage device accesses data in the logical block group according to a data redundancy policy, including: If the data redundancy strategy is to store data in a multi-replica manner, with each logical block storing the first target data, the storage device can retrieve the first target data from other logical blocks in the logical block group in the event of a failure of the first logical block; or If the data redundancy strategy is EC mode for storing data, and each logical block stores a fragment of the first target data, in the event of a failure of the first logical block, the storage device obtains other fragments of the first target data from other logical blocks in the logical block group, and obtains the first target data based on the other fragments of the first target data.