Operation method of storage system, storage system, host and storage controller

By combining the first partition mapping table and the second partition mapping table, abnormal partitions in the storage system can be quickly identified, solving the problem of excessively long data reconstruction time after abnormal power failure of the storage system and improving the recovery efficiency of the storage system.

CN120832073APending Publication Date: 2025-10-24YANGTZE MEMORY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410479301.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

Existing technologies make it difficult to quickly identify and rebuild abnormal partitions after a storage system experiences an abnormal power outage, resulting in excessively long restart times and data recovery times for the storage system.

Method used

By using the predicted write pointer in the first partition mapping table and the actual write pointer in the second partition mapping table, abnormal partitions in the storage system can be quickly identified. Combined with the power-on phase after an abnormal power failure, the abnormal partitions can be determined and the data can be reconstructed.

Benefits of technology

It enables rapid identification of abnormal partitions in the storage system, reducing the time required to rebuild data from abnormal partitions and the storage system restart time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120832073A_ABST
    Figure CN120832073A_ABST
Patent Text Reader

Abstract

The invention discloses an operation method of a storage system, the storage system, a host and a storage controller, and belongs to the technical field of storage. According to the method, an abnormal partition can be determined from a plurality of partitions through a predicted write pointer of the partition in a first partition mapping table and a current write pointer of the partition in a second partition mapping table; the method for determining the abnormal partition is simple, and the abnormal partition in the partition storage device can be rapidly determined.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, in particular to an operation method of a storage system, the storage system, a host and a storage controller. BACKGROUND

[0002] With the continuous upgrading of storage media and the increasing demand of users for the performance of storage systems, a storage system supporting partition storage emerges as the times require. The storage system has a zoned namespace (ZNS) interface. The ZNS interface divides the logical address space of a non-volatile storage device into a plurality of zones. Each zone is composed of a logic block address (LBA) interval. The LBA interval includes a plurality of LBAs. Each zone has a write pointer (WP) indicating the next writable LBA in the zone. Each zone can be read in any order, but must be written in order. Sequential writing can improve the data placement inside the non-volatile storage device in the storage system, thereby enabling the storage system to achieve higher performance through higher write throughput and greater storage capacity. SUMMARY

[0003] Embodiments of the present application provide an operation method of a storage system, the storage system, a host and a storage controller, which can quickly determine abnormal zones in the storage system. The technical solution is as follows:

[0004] In a first aspect, an operation method of a storage system is provided. The method comprises:

[0005] obtaining a first zone mapping table, the first zone mapping table including first write pointers of a plurality of zones, the plurality of zones being divided from a logical address space corresponding to a non-volatile storage device, and the first write pointer indicating a next writable logic block address (LBA) in a predicted zone;

[0006] obtaining a second zone mapping table, the second zone mapping table including second write pointers of the plurality of zones, and the second write pointer indicating the next writable LBA in the zone;

[0007] based on the first zone mapping table and the second zone mapping table, determining a zone in which the first write pointer and the second write pointer are different from each other as an abnormal zone.

[0008] Optionally, the method further comprises: in a power-on phase after the storage system is abnormally powered off, performing the step of determining the zone in which the first write pointer and the second write pointer are different from each other as the abnormal zone based on the first zone mapping table and the second zone mapping table.

[0009] Optionally, the plurality of zones are in an open state.

[0010] Optionally, the method further comprises:

[0011] receiving a write instruction, the write instruction comprising first data and a first logical block address (LBA), the first LBA belonging to a logical address space corresponding to the non-volatile storage device;

[0012] predicting, based on the first LBA, a next writable LBA in the logical address space to which the first data is to be written, to obtain a second LBA;

[0013] updating the first partition mapping table based on the second LBA.

[0014] Optionally, after the first partition mapping table is updated, the method further comprises: storing the updated first partition mapping table to the non-volatile storage device.

[0015] Optionally, after the first partition mapping table is updated, the method further comprises:

[0016] writing, based on the write instruction, the first data to the logical address space to obtain a third LBA, the third LBA being the next writable LBA in the logical address space;

[0017] updating the second partition mapping table based on the third LBA.

[0018] Optionally, after the second partition mapping table is updated, the method further comprises: storing the updated second partition mapping table to the non-volatile storage device.

[0019] Optionally, the method further comprises:

[0020] storing the first partition mapping table to the non-volatile storage device every first time length;

[0021] and / or, storing the second partition mapping table to the non-volatile storage device every second time length.

[0022] Optionally, the first time length is the same as the second time length.

[0023] Optionally, the first time length is different from the second time length.

[0024] Optionally, the method further comprises: storing the first partition mapping table and the second partition mapping table to the non-volatile storage device through a checkpoint operation.

[0025] In a second aspect, an operating method of a storage system is provided, the method comprising:

[0026] receiving a write instruction, the write instruction comprising first data and a first logical block address (LBA), the first LBA belonging to a logical address space corresponding to the non-volatile storage device;

[0027] predicting, based on the first LBA, a next writable LBA in the logical address space after the first data is written, to obtain a second LBA;

[0028] updating, based on the second LBA, the first partition mapping table, the first partition mapping table comprising first write pointers of a plurality of partitions in the logical address space, the first write pointer indicating the next writable LBA in the predicted partition.

[0029] Optionally, the method further comprises:

[0030] obtaining a second partition mapping table, the second partition mapping table comprising second write pointers of the plurality of partitions, the second write pointer indicating the next writable LBA in the partition;

[0031] determining, based on the first partition mapping table and the second partition mapping table, a partition in which the first write pointer and the second write pointer are different as an abnormal partition.

[0032] Optionally, the method further comprises: performing, in a power-on stage after the storage system is abnormally powered off, the step of determining, based on the first partition mapping table and the second partition mapping table, a partition in which the first write pointer and the second write pointer are different as an abnormal partition.

[0033] Optionally, after the first partition mapping table is updated, the method further comprises:

[0034] writing, based on the write instruction, the first data to the logical address space to obtain a third LBA, the third LBA being the next writable LBA in the logical address space;

[0035] updating, based on the third LBA, the second partition mapping table.

[0036] Optionally, after the second partition mapping table is updated, the method further comprises: storing the updated second partition mapping table to the non-volatile storage device.

[0037] Optionally, the method further comprises:

[0038] storing the first partition mapping table to the non-volatile storage device every first time length;

[0039] and / or, storing the second partition mapping table to the non-volatile storage device every second time length.

[0040] Optionally, the first time length is the same as the second time length.

[0041] Optionally, the first time length is different from the second time length.

[0042] Optionally, the method further comprises: storing the first partition mapping table and the second partition mapping table to the non-volatile storage device through a checkpoint operation.

[0043] Optionally, after the first partition mapping table is updated, the method further comprises: storing the updated first partition mapping table to the non-volatile storage device.

[0044] Optionally, the plurality of partitions are in an open state.

[0045] In a third aspect, a storage system is provided, which optionally comprises a storage controller and a storage device; the storage controller is configured to perform:

[0046] obtaining a first partition mapping table, the first partition mapping table comprising first write pointers of a plurality of partitions, the plurality of partitions being divided by a logical address space corresponding to the non-volatile storage device, the first write pointer indicating a predicted termination write position of to-be-written data in a partition;

[0047] obtaining a second partition mapping table, the second partition mapping table comprising second write pointers of the plurality of partitions, the second write pointer indicating a termination write position of written data in a partition;

[0048] based on the first partition mapping table and the second partition mapping table, determining a partition in which the first write pointer and the second write pointer are different as an abnormal partition.

[0049] Optionally, the storage controller is further configured to perform any of the optional implementation manners of the first aspect, or perform any of the optional implementation manners of the second aspect.

[0050] In a fourth aspect, a host is provided, which comprises a storage controller for controlling a non-volatile storage device, the storage controller being configured to perform the method of the first aspect, any of the optional implementation manners of the first aspect, the second aspect, or any of the optional implementation manners of the second aspect.

[0051] In a fifth aspect, a storage controller is provided, which comprises a memory interface for connecting a non-volatile storage device and a processor for executing program code, so that the storage controller performs the method of the first aspect, any of the optional implementation manners of the first aspect, the second aspect, or any of the optional implementation manners of the second aspect.

[0052] In a sixth aspect, a computer readable storage medium is provided, which stores at least one program code, the at least one program code being read by a processor in a storage controller to make the storage controller perform the method of the first aspect, any of the optional implementation manners of the first aspect, the second aspect, or any of the optional implementation manners of the second aspect.

[0053] In a seventh aspect, a computer program product or computer program is provided, which includes program code stored in a computer readable storage medium, the program code being read by a processor in the storage controller from the computer readable storage medium, the processor executing the program code causing the storage controller to perform the method of the first aspect, any of the optional implementation manners of the first aspect, the second aspect, or any of the optional implementation manners of the second aspect.

[0054] The technical scheme provided by the embodiments of the present application can determine the abnormal partition from the plurality of partitions by the predicted write pointer of the partition in the first partition mapping table and the current write pointer of the partition in the second partition mapping table, and the manner of determining the abnormal partition is simple and can quickly determine the abnormal partition in the partition storage device. BRIEF DESCRIPTION OF DRAWINGS

[0055] Figure 1 is a schematic diagram of an application environment of a storage system according to an example embodiment;

[0056] Figure 2 is a schematic diagram of partition division of a storage system according to an example embodiment;

[0057] Figure 3 is a schematic diagram of state switching of a partition according to an example embodiment;

[0058] Figure 4 is a flowchart of an operation method of a storage system according to an example embodiment;

[0059] Figure 5 is a flowchart of another operation method of a storage system according to an example embodiment;

[0060] Figure 6 is a schematic diagram of determining an abnormal partition according to an example embodiment. DETAILED DESCRIPTION

[0061] In order to make the purposes, technical schemes and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.

[0062] The terms "first", "second", and the like are used in the present application to distinguish between elements or items having basically the same function and effect, and it should be understood that there is no logical or time sequence dependency between "first", "second", and "n", and the number and execution order are not limited. It should also be understood that although the following description uses the terms first, second, and the like to describe various elements, these elements should not be limited by the terms.

[0063] These terms are simply used to distinguish one element from another. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element, without departing from the scope of various examples. Both the first element and the second element can be elements, and in some cases, can be separate and different elements.

[0064] Here, at least one refers to one or more than one, for example, at least one element can be one element, two elements, three elements, or any other integer greater than or equal to one. At least two refers to two or more than two, for example, at least two elements can be two elements, three elements, or any other integer greater than or equal to two.

[0065] Figure 1 FIG. 1 is a schematic diagram showing an application environment of a storage system according to an exemplary embodiment. Figure 1 As shown, the application environment includes a host 101 and a storage system 102, wherein the host 101 can be a mobile phone, a desktop computer, a laptop computer, a tablet computer, a vehicle computer, a game console, a printer, a positioning device, a wearable electronic device, a smart sensor, a virtual reality (VR) device, an augmented reality (AR) device, or any other suitable electronic device having a storage device. According to the interface protocol of the storage system 102 connected to the host 101, the storage system 102 can be configured as a storage device such as a universal flash storage (UFS) device, a solid state drive (SSD), a multimedia card (MMC), a secure digital (SD) card, a computer memory card international association (PCMCIA) card type, a peripheral component interconnect (PCI) type storage device, a high-speed PCI (PCI-E) type storage device, a compact flash (CF) card, a smart media card or a memory stick, etc., wherein the multimedia card (MMC) is such as an embedded multimedia card (eMMC), a small size multimedia card (RS-MMC) and a micro MMC, and the SD card is such as a mini SD and a micro SD.

[0066] The host 101 can control the operation of the memory system 102, for example, the host 101 can control the operation of the memory system 102 by instructions, for example, the host 101 sends instructions to the memory controller system 102, and the memory controller 102 performs corresponding operations (such as data programming, data reading, data erasing operations or other operations) in response to the instructions of the host 101. Alternatively, the host 101 can include a host processor and a host memory, and the host processor can control the operation of the host 101. For example, the host processor can interact with the storage system 102 through a storage driver to control the operation of the storage system 102. Wherein the storage driver can be a software module for controlling the storage system 102, and the storage driver can also load a mapping table into the host memory to improve the speed of the host processor controlling the storage system 102 to perform a read operation.

[0067] The storage system 102 can store data accessed by the host 101, and the host 101 can be configured to send data to the storage system 102. Alternatively, the host 101 can be configured to receive data from the storage system 103.

[0068] As shown in Figure 1 The storage system 102 includes a non-volatile storage device 21 and a storage controller 22, wherein the non-volatile storage device 21 is at least one, and the non-volatile storage device 21 is a storage medium in the storage system 102 for storing data, such as NAND flash memory devices, three-dimensional (3D) NAND flash memory devices, etc.

[0069] The storage controller 22 can control the non-volatile storage device 21. In Figure 1In the embodiment, the storage controller 22 is deployed outside the host 101. The storage controller 22 is coupled to the host 101 and communicates with the host 101. The storage controller 22 and the non-volatile storage device 21 are integrated into the storage system 102. In other embodiments, the storage controller 22 is not integrated into the storage system 102. The storage controller 22 is integrated into the host 101. The storage controller 22 in the host 101 communicates with the non-volatile storage device 21 outside the host 101 to control the non-volatile storage device 21. In other embodiments, some functional modules of the storage controller 22 are integrated into the host 101, and other functional modules are integrated into the storage system 102. These two functional modules cooperate with each other to control the non-volatile storage device 21. For example, the front end (FE) and flash translation layer (FTL) functions of the storage controller 22 are integrated into the host 101, and the back end (BE) functions of the storage controller 22 are integrated into the storage system 102; or, the FE functions of the storage controller 22 are integrated into the host 101, and the FTL and BE functions of the storage controller 22 are integrated into the storage system 102.

[0070] The storage controller 22 is also coupled to the non-volatile storage device 21, manages the data stored in the non-volatile storage device 21, and is responsible for data scheduling between the non-volatile storage device 21 and the host 101. The storage controller 22 can be configured to control operations of the non-volatile storage device 21, such as read, erase, and program operations. The storage controller 22 can also be configured to manage various functions related to data stored or to be stored in the non-volatile storage device 21, including but not limited to bad block management, garbage collection, logical to physical address translation, wear leveling, etc. The storage controller 22 can also perform any other suitable functions, such as formatting the non-volatile storage device 21.

[0071] For example, Figure 1 As shown, the storage controller 22 includes a host interface 221, a memory interface 222, a processor 223, a memory 224, and a bus 225. The various components within the storage controller 22 (e.g., 221-224) other than the bus 225 are connected to the bus 225 and communicate with each other via the bus 225. The storage controller 22 can control the storage system 102 to perform operations by driving firmware or software. The storage controller 22 can decode and drive code-type instructions or algorithms such as firmware or software. Furthermore, the storage controller 22 can be implemented as hardware or a combination of hardware and software.

[0072] The host interface 221 can connect the host 101 and communicate with the host 101 according to an interface protocol, which can be any one of an MMC protocol, a peripheral component interconnect (PCI) protocol, a PCI express (PCI-E) protocol, an advanced technology attachment (ATA) protocol, a serial ATA protocol, a parallel (ATA) protocol, a small computer small interface (SCSI) protocol, an enhanced small disk interface (ESDI) protocol, an integrated drive electronics (IDE) protocol, and a Firewire protocol.

[0073] The memory interface 222 can connect the non-volatile storage device 21 according to a corresponding interface protocol. For example, the memory interface 222 can communicate with the non-volatile storage device 21 through an open NAND flash interface (ONFI) protocol. The memory interface 222 can control the non-volatile storage device 21 according to the processor 223. The memory interface 222 can provide a control signal to the non-volatile storage device 21, which can include a command, an address, and an operation control signal for controlling the non-volatile storage device 21.

[0074] The processor 223 is responsible for calculation and system scheduling, and a firmware or software of the storage controller 22 runs on the processor 223. The processor 223 controls the storage system 102 to perform operations by driving the firmware or software, such as scheduling various hardware modules in the storage system 102, implementing writing, reading, and other background operations of data from the host 101 to the non-volatile storage device 21.

[0075] The firmware of the storage controller 22 can be various, such as FE, FTL, and BE. The FE is used to control the host interface 221 to communicate with the host 101. For example, the FE can obtain an instruction (such as a read instruction, a write instruction, or other types of instructions) sent by the host 101 through the host interface 221, send the instruction sent by the host 101 to the back end (such as the FTL and / or the BE) for processing, obtain a processing result of the instruction by the back end, and return the processing result to the host 101 through the host interface 221. In some embodiments, the FE is also used to verify whether the instruction from the host 101 is legal, and if the instruction from the host 101 is legal, the legal instruction is sent to the back end for processing.

[0076] The FTL is a core component of the storage controller firmware and has a main task of performing mapping of the logical address space of the host 101 to the physical address space of the non-volatile storage device, and in addition has functions of handling garbage collection, wear leveling, bad block management, read disturb management, data retention management, error handling, etc. The processor 223 can drive the FTL in order to control the inherent operation of the non-volatile storage device 21 and provide device compatibility to the host 101. When the FTL is driven, the host 101 can view and use the storage system 102 as a general storage device such as a hard disk.

[0077] The processor 223 can be any suitable integrated circuit configured to receive instructions from the host 101 and perform read, program, and erase operations of the storage device by transmitting commands and / or data to the non-volatile storage device 21 via the memory interface 222. For example, the processor 223 receives requests for the non-volatile storage device 21 (e.g., read or write operations) from one or more hosts 101 through the host interface. The processor 223 can also be configured to communicate with and control other components of the storage controller 22.

[0078] The processor 223 can also be used to execute program code such that the storage controller 22 implements the operation method of the storage system described below, which can be stored in the memory 224 of the storage controller 22 or in the firmware of the storage controller 22 in the non-volatile storage device 21. For example, the present application also provides a computer readable storage medium storing at least one program code, which is read and executed by the processor 223 such that the storage controller 22 performs the operation method of the storage system described below. The computer readable storage medium can be the non-volatile storage device 21 or a storage medium in the non-volatile storage device 21. In other embodiments, the present application also provides a computer program product or computer program including program code stored in a computer readable storage medium, which is read by the processor 223 from the computer readable storage medium, and the processor executes the program code such that the storage controller 22 performs the operation method of the storage system described below.

[0079] The physical address space provided by the one or more non-volatile storage devices 21 in the storage system 102 can be covered by a logical address space of the storage system 102. The physical address space includes a plurality of physical addresses, which can be physical cluster addresses (PCAs) or physical block addresses (PBAs), and the logical address space includes a plurality of LBAs, each LBA in the logical address space can be mapped to a physical address in the physical address space, so that the logical address space can cover the physical address space, i.e., the logical address controls the corresponding physical address space.

[0080] The storage controller 22 can name the logical address space of the storage system 102 as a zoned namespace (ZNS). Alternatively, the logical address space of the storage system 102 is divided into a plurality of ZNSs, and the ZNS is a namespace associated with a zoned namespace command set, and the zoned namespace command set is based on a non-volatile memory (NVM) command set. Each ZNS is an LBA range interval, including each LBA in the LBA range interval, and the capacities (i.e., sizes) of different ZNSs in the plurality of ZNSs can be the same or different, wherein the capacity of a ZNS can be represented by the offset between the start LBA and the end LBA of the ZNS, and the start LBA and the end LBA of the ZNS are the first LBA and the last LBA in the ZNS, respectively. In addition to the ZNS, the storage system 102 can also include one or more regular namespaces, which can also be provided by the non-volatile storage device 21.

[0081] For any ZNS, the ZNS can be divided into a plurality of zones with the same size, and the zones are contiguous and non-overlapping LBA ranges. As shown in FIG. 1, the storage controller 22 can divide the ZNS into X+1 zones, and number the X zones from 0 (e.g., zone 0) according to the order of the LBA from small to large in each zone, to obtain zones 0 to X, wherein X is an integer greater than 0. Figure 2

[0082] For any zone, the zone includes a plurality of LBAs, the first LBA in the zone can be referred to as the zone start logical block address (ZSLBA) of the zone, and the last LBA in the zone can be referred to as the zone termination logical block address (ZTLBA) of the zone. The ZSLBA of the zone or the number of the zone can be used as an identifier of the zone to indicate the zone. The capacity (i.e., zone size) of the zone can be represented by the offset between the ZSLBA and the ZTLBA of the zone, and the capacities (i.e., zone sizes) of different zones in the ZNS can be the same or different.​

[0083] Each partition has a partition descriptor containing a set of attributes. The zone management receive command can be used to retrieve one or more partition descriptors. A partition can have the following attributes:

[0084] Partition type: The partition type attribute defines the rules for reading and writing the partition, such as the partition type is sequential write required, the sequential write required partition type requires writing the logical block address range of the partition in sequence, the host 101 can use the command, the write zero command, the write uncorrectable command, the copy command or the partition append command and other commands to write data to the partition of this type;

[0085] Partition state: Each partition corresponds to a set of states, each state together with the partition type defines the operation characteristics of the zone, and the subsequent Figure 3 introduce the state of the partition;

[0086] Write pointer (WP): The write pointer attribute defines the next writable LBA in the partition. The validity of the write pointer is specific to the zone state and is defined according to the partition type. For details, please refer to the relevant standard protocol, and the subsequent Figure 2 introduce the write pointer;

[0087] Partition capacity: defines the writable capacity of the partition, not all logical blocks in the partition can be used by the host, the number of LBA that can be used by the host in a partition is called the partition capacity, the partition capacity is less than or equal to the partition size;

[0088] Partition descriptor extension valid: used to define the validity of the partition descriptor extension data of the partition;

[0089] Reset partition recommendation: indicates that the storage controller recommends that the host reset the partition;

[0090] Complete partition recommendation: indicates that the storage controller recommends that the host complete the partition.

[0091] For any partition, the write pointer of the partition indicates the next writable LBA in the partition, the writable LBA is the next LBA of the terminal write LBA of the data written in the partition, the terminal write LBA is the terminal write position of the data written in the partition, which can also be understood as the largest LBA among the LBA occupied by the written data. As Figure 2 shown in the black part of partition 2, the write pointer indicates the adjacent position after the black part. The write pointer can be the offset between the next writable LBA in the partition and the ZS LBA of the partition, so that the write pointer can point to the next writable LBA in the partition from the ZS LBA of the partition, for example, the write pointer of 0 points to the next writable LBA of ZS LBA.

[0092] The next writable LBA indicated by the write pointer can be used as the starting write location when writing data to the corresponding partition next time. Figure 2 Taking partition 2 in the example, data is written starting from the position indicated by the write pointer of partition 2. The position indicated by the write pointer of partition 2 will be advanced or updated to point to the writable LBA in response to the next write instruction of the host 101 in order to track the next starting write position. Therefore, the write pointer indicates where the next write to the partition will start.

[0093] like Figure 3 As shown, the status of a partition can be divided into an empty state, an open state, and a full state, wherein the empty state indicates that data has not yet been written to the partition. At this time, the partition has not been mapped to the physical address space and does not support writing data. The write pointer of the partition points to the ZSLBA of the partition; the open state indicates that the partition has supported writing data and the partition has not been full of data. At this time, the partition has been mapped to the physical address space, and the write pointer of the partition points to any LBA in the partition except the ZSLBA; the full state indicates that the partition is full of data. At this time, the partition has also been mapped to the physical address space.

[0094] Partitions can switch between empty, open, and full states, e.g. Figure 3As shown, for a partition in an empty state, the storage controller 22 responds to a write instruction for the partition and allocates a physical address space for the empty partition, so that the LBA in the empty partition is mapped to the physical address in the physical address space, switches the partition from an empty state to an open state, and performs a write operation on the physical address space corresponding to the partition to write data to the partition. If the partition is not full of data after the write operation is completed, if a write instruction for the partition is received again, the write operation will continue to be performed on the physical address space corresponding to the partition. When all LBAs in the partition have been written with data, that is, the partition is full of data, the storage controller 22 switches the state of the partition from an open state to a full state. For a partition in an open state or a full state, if the partition meets the partition reset condition, the storage controller 22 can also switch the state of the partition to an empty state by resetting the partition. For example, the host 101 sends a partition reset instruction for the partition to the storage controller 22. In response to the partition reset instruction, if the partition meets the partition reset condition, the storage controller 22 resets the partition. Alternatively, if the internal management logic of the storage controller 22 requires deletion or data recovery for the partition, the partition meets the partition reset condition, and the storage controller 22 resets the partition. Resetting the partition may involve, for example, the storage controller 22 performing a reset write pointer operation or a format unit operation on the partition to erase the written data in the partition, roll back the location indicated by the write pointer of the partition to the ZSLBA of the partition, and switch the state of the partition to an empty state, thereby achieving partition reset.

[0095] For the convenience of description, a partition in an empty state is referred to as an empty partition, a partition in an open state is referred to as an open partition, and a partition in a full state is referred to as a full partition.

[0096] The storage controller 22 may record the write pointers of each open partition in the storage system 102 through a partition mapping table. For example, the partition mapping table includes write pointers of multiple open partitions. In some embodiments, the partition mapping table also includes identifiers of the multiple open partitions, and each identifier of the open partition corresponds to the write pointer of each open partition.

[0097] In the process of writing data to a certain partition, if the storage system 102 abnormally powers off (dirty power loss), resulting in a failure to write data to the partition, the partition becomes an abnormal partition. In the case of abnormal power loss of the storage system 102, during the power-on stage after the abnormal power loss, the storage controller 22 restarts or initializes the storage system 102. During the process of restarting or initializing the storage system 102, the storage controller 22 needs to first determine each abnormal partition in the storage system 102, and then, for each abnormal partition, respectively rebuild the data that fails to be written due to the abnormal power loss in each abnormal partition. Therefore, if the abnormal partitions in the storage system 102 can be quickly determined, the time length of rebuilding data in the abnormal partition and the time length of restarting the storage system 102 can be effectively shortened. Therefore, there is an urgent need for a method that can quickly determine the abnormal partitions in the storage system 102.

[0098] In some embodiments, the storage controller 22 can determine the abnormal partition based on the above-mentioned partition mapping table. For example, the storage controller 22 scans the written data in the physical address space corresponding to each open partition based on the identifier of each open partition in the partition mapping table, obtains the termination physical address of the written data in the corresponding physical address space, obtains the write pointer of each open partition from the partition mapping table, and determines the open partition as an abnormal partition if the position indicated by the write pointer of any open partition is not the LBA corresponding to the termination physical address in the corresponding physical address space. The data that fails to be written due to the abnormal power loss is rebuilt in the abnormal partition.

[0099] In the process of determining the abnormal partition, the storage controller 22 first scans the written data in the physical address space corresponding to each open partition, and then compares whether the position indicated by the write pointer of the open partition is the LBA corresponding to the termination physical address in the corresponding physical address space to determine the abnormal partition. The determination method of the abnormal partition is complex, and scanning the written data in the physical address space also increases the time length required to determine the abnormal partition, which cannot quickly determine the abnormal partition in the storage system 102. Accordingly, it also increases the time length of rebuilding data in the abnormal partition and the time length of restarting the storage system 102.

[0100] Therefore, the present application further proposes a new partition mapping table. The storage controller can quickly determine the abnormal partition in the storage system through the new partition mapping table and the partition mapping table introduced in the foregoing.

[0101] To distinguish it from the partition mapping table described above, the new partition mapping is referred to as a first partition mapping table, and the partition mapping table described above is referred to as a second partition mapping table. The first partition mapping table is used to record the first write pointers of open partitions in the storage system. For example, the first partition mapping table includes the first write pointer of at least one partition, the at least one partition being in an open state, and the at least one partition being a partition recorded in the second partition mapping table. The first write pointer of any partition is not the actual write pointer of the partition but a predicted write pointer. The first write pointer indicates the predicted next writable LBA in the partition. For example, before writing a certain data into the logical address space of the storage system, the next writable LBA in the logical address space after the data is written is predicted. Based on the predicted next writable LBA, the predicted write pointer (i.e., the first write pointer) is determined. In some embodiments, the first partition mapping table also includes an identifier of the at least one partition, and the identifier of each partition corresponds to the first write pointer of each partition. To distinguish it from the first write pointer in the first partition mapping table, the write pointer of the partition in the second partition mapping table is referred to as the second write pointer, and the second write pointer is the actual write pointer of the partition.

[0102] Next, through Figure 4 The following describes the operation method of the storage system shown, and the maintenance and management process of the first partition mapping table and the second partition mapping table. The storage system may be the storage system 102 described above, and the storage system includes a storage controller and a non-volatile storage device. The storage controller may be the storage controller 22 described above, and the non-volatile storage device may be the non-volatile storage device 21 described above. The method is configured to be executed by the storage controller and includes the following steps.

[0103] 401. A storage controller receives a write instruction, where the write instruction includes first data and a first LBA, where the first LBA belongs to a logical address space corresponding to a non-volatile storage device.

[0104] Among them, Figure 1 Taking the storage system 102 shown as an example, the logical address space can be the logical address space corresponding to at least one non-volatile storage device 21 in the storage system 102. The logical address space includes multiple LBAs. The logical address space can be divided into multiple partitions. The partition division method has been introduced in the previous text and will not be repeated here.

[0105] The first data is data to be written carried by the write instruction, the first LBA is a starting writing position of the first data in the logical address space, the first LBA is any LBA in the logical address space, for the convenience of description, a partition in which the first LBA is located in the plurality of partitions is referred to as a first partition, the first partition is currently in an empty state or an open state, in this embodiment of the application, the state in which the first partition is currently located is not limited.

[0106] The write command can be a write instruction sent by the host to the storage controller, for example, the write command is a write instruction triggered by the host for writing user data, at this time, the first data is user data provided by the host, or the write command can also be a write instruction triggered by the host in a garbage collection (GC) process, at this time, the first data is data that needs to be saved in the garbage collection process.

[0107] After receiving the write instruction, the storage controller obtains the LBA from the write instruction, takes the LBA obtained from the write instruction as the first LBA, determines a first partition in which the first LBA is located in the plurality of partitions, queries whether the first partition is in a valid state, if the first partition is in the valid state, executes the steps after step 401 in the method, otherwise, does not execute the steps after step 401 in the method. Figure 4 Figure 4 After step 401 in the method, otherwise, does not execute the steps after step 401 in the method.

[0108] The valid state includes an empty state or an open state, based on this, the process of querying whether the first partition is in the valid state is introduced.

[0109] After determining the first partition, the storage controller can first query whether the first partition is in an open state, if the first partition is in the open state, it is determined that the first partition is in the valid state, if the first partition is not in the open state, it is further queried whether the first partition is in an empty state, if the first partition is in the empty state, it is determined that the first partition is in the valid state, if the first partition is not in the empty state, the first partition is not in the valid state, it is determined that the first partition is in an invalid state, wherein the invalid state includes a full state.

[0110] Alternatively, the storage controller can first query whether the first partition is in an empty state, if the first partition is in the empty state, it is determined that the first partition is in the valid state, if the first partition is not in the empty state, it is further queried whether the first partition is in an open state, if the first partition is in the open state, it is determined that the first partition is in the valid state, if the first partition is not in the open state, the first partition is not in the valid state, it is determined that the first partition is in an invalid state.

[0111] ​In some embodiments, the storage controller can query whether the first partition is in an open state based on the first partition mapping table or the second partition mapping table, such as, for any one of the first partition mapping table and the second partition mapping table, the storage controller queries an identity of the first partition in the partition mapping table, if the identity of the first partition exists in the partition mapping table, it is determined that the first partition is in an open state, if the identity of the first partition does not exist in the partition mapping table, it is determined that the first partition is not in an open state.

[0112] In some embodiments, a third partition mapping table is also stored in the storage system, so that Figure 1 For example, the memory 224 of the storage controller 22 or the non-volatile storage device 21 stores a third partition mapping table. The third partition mapping table is used to record each empty partition in the storage system. The third partition mapping table can include an identity of at least one empty partition, or the third partition mapping table can also include a write pointer of the at least one empty partition. The write pointer of any empty partition corresponds to the identity of the empty partition, and the write pointer of the empty partition is 0. The storage controller can query whether the first partition is in an empty state based on the third partition mapping table, such as, querying the identity of the first partition in the third partition mapping table, if the identity of the first partition exists in the third partition mapping table, it is determined that the first partition is in an empty state, if the identity of the first partition does not exist in the third partition mapping table, it is determined that the first partition is not in an empty state.

[0113] 402. The storage controller predicts a second LBA after the first data is written in the next writable LBA in the logical address space based on the first LBA.

[0114] Wherein, the second LBA is the predicted next writable LBA in the logical address space after the first data is written, and the second LBA is greater than the first LBA. The second LBA can be located in the first partition where the first LBA is located, or can not be located in the first partition where the first LBA is located. If the second LBA is not located in the first partition where the first LBA is located, the partition where the second LBA is located in the logical address space is referred to as a second partition, and the second partition is located after the first partition. There can be other partitions between the first partition and the second partition, or there can be no other partitions between the first partition and the second partition, such as, the first partition is partition 1, and the second partition is partition 2, then there is no other partition between the first partition and the second partition, and for example, the first partition is partition 1, and the second partition is partition 3, then there is partition 2 between the first partition and the second partition, wherein whether there is other partition between the first partition and the second partition depends on the position of the first LBA in the first partition and the length of the first data in the logical address space.

[0115] The storage controller can obtain the data to be written carried by the write instruction as first data, determine the number of LBAs required for storing the first data based on the data amount of the first data, determine the sum value between the number of LBAs and the first LBA as the second LBA.

[0116] In some other embodiments, if the first partition is in the invalid state, i.e., the first partition is in the full state, the storage controller can further obtain the second LBA by performing the step 402, and determine the second partition in which the second LBA is located from the plurality of partitions. If the second partition is adjacent to the first partition, i.e., there is no other partition between the first partition and the second partition, the storage controller queries whether the second partition is in the empty state (the process is the same as querying whether the first partition is in the empty state), and if the second partition is in the empty state, it indicates that the first data can be written from the second partition subsequently, and the storage controller continues to perform the steps after the step 402. Figure 4 If the second partition is not in the empty state, the steps after the step 402 are not performed. Figure 4 If the second partition is not adjacent to the first partition, i.e., there is no other partition between the first partition and the second partition, the storage controller queries whether each partition between the first partition and the second partition is in the empty state (the process is the same as querying whether the first partition is in the empty state), and further queries whether the second partition is in the empty state, and if the second partition and each partition between the first partition and the second partition are in the empty state, it indicates that the first data can be written from the partition after the first partition to the second partition subsequently, and the storage controller continues to perform the steps after the step 402. Figure 4 If the second partition or any partition between the first partition and the second partition is not in the empty state, the first data cannot be written according to the principle of sequential writing, and the steps after the step 402 are not performed. Figure 4 If the second partition or any partition between the first partition and the second partition is not in the empty state, the first data cannot be written according to the principle of sequential writing, and the steps after the step 402 are not performed.

[0117] 403. The storage controller updates the first partition mapping table based on the second LBA.

[0118] At this time, the first partition mapping table can be empty, or the first partition mapping table includes the first write pointer of at least one partition. For example, when the write instruction is received, the first write pointer of the open partition is not stored in the first partition mapping table, and the first partition mapping table is empty. For another example, before the write instruction is received, at least one partition in the storage system is in the open state, and the first partition mapping table includes the first write pointer of the at least one partition, the at least one partition is part of the plurality of partitions of the storage system or all of the plurality of partitions, and the at least one partition is in the open state.

[0119] After obtaining the second LBA, the storage controller determines a third write pointer based on the second LBA and the ZSLBA of the partition where the second LBA is located. The third write pointer indicates the predicted next writable LBA in the partition where the second LBA is located (i.e., the predicted next writable LBA in the logical address space after the first data is written). In other words, the third write pointer indicates the second LBA. The third write pointer can be determined by determining the offset between the second LBA and the ZSLBA as the third write pointer.

[0120] The storage controller can update the first partition mapping table based on the third write pointer and the partition where the second LBA is located. The partition where the second LBA is located may be the first partition or the second partition. The process of updating the first partition mapping table is described below for different situations.

[0121] When the second LBA is located in the first partition, if the first partition is currently in an open state and the first partition mapping table stores a first write pointer for the first partition, the storage controller updates the first write pointer for the first partition in the first partition mapping table to the third write pointer, thereby updating the first partition mapping table. For example, the first write pointer corresponding to the identifier of the first partition in the first partition mapping table is updated to the third write pointer.

[0122] If the first partition is currently in an empty state and the first partition mapping table does not store the first write pointer of the first partition, the storage controller first switches the state of the first partition to an open state (the switching method can be referred to Figure 3 (No further details will be given here), the relevant information of the first partition in the third partition mapping table (such as the identifier of the first partition, or the identifier and write pointer of the first partition) is set to invalid, for example, the relevant information of the first partition in the third partition mapping table is deleted to indicate that the first partition is no longer in an empty state, or an invalid identifier associated with the relevant information of the first partition is added to the third partition mapping table to indicate that the relevant information of the first partition is invalid; the third write pointer of the first partition is stored in the first partition mapping table to update the first partition mapping table, for example, the third write pointer is used as the first write pointer of the first partition, and a mapping relationship between the identifier of the first partition and the third write pointer is established in the first partition mapping table to indicate that the third write pointer is the predicted write pointer of the first partition. In this case, in other embodiments, the storage controller may also first store the third write pointer of the first partition in the first partition mapping table, and then switch the state of the first partition to the open state.

[0123] In a case where the second LBA is located in the second partition, after the first data is written from the first partition to the second partition, the first partition is full of data, based on which, if the first partition is in the empty state, the storage controller can set the related information of the first partition in the third partition mapping table as invalid, record the related information of the first partition in the fourth partition mapping table (such as recording the identifier of the first partition in the fourth partition mapping table), wherein the fourth partition mapping table is used to record each full partition in the storage system, for example, the fourth partition mapping table can include the identifier of at least one full partition.

[0124] If the first partition is in the open state, the storage controller can set the related information of the first partition in the first partition mapping table as invalid (the process is the same as setting the related information of the first partition in the third partition mapping table as invalid), and record the related information of the first partition in the fourth partition mapping table. If there are partitions between the first partition and the second partition, each partition between the first partition and the second partition is currently in the empty state, and each partition between the first partition and the second partition will be full of data after the first data is written, based on which, before the first data is written, the storage controller can also set the related information of each partition between the first partition and the second partition in the third partition mapping table as invalid (the process is the same as setting the related information of the first partition in the third partition mapping table as invalid), and record the related information of each partition between the first partition and the second partition in the fourth partition mapping table.

[0125] The second partition is currently in the empty state, and the second partition is in the open state after the first data is written, at this time, the first partition mapping table does not include the related information of the second partition, based on which, the storage controller sets the related information of the second partition in the third partition mapping table as invalid (the process is the same as setting the related information of the first partition in the third partition mapping table as invalid), and stores the third write pointer of the second partition to the first partition mapping table to update the first partition mapping table, for example, taking the third write pointer as the first write pointer of the second partition, and establishing a mapping relationship between the identifier of the second partition and the third write pointer in the first partition mapping table.

[0126] 404、The storage controller writes the first data to the logical address space based on the write instruction, and obtains a third LBA, the third LBA is the next writable LBA in the logical address space.

[0127] The third LBA is the next writable LBA of the logical address space after the first data is written, that is, the next LBA of the terminal write LBA of the first data.

[0128] The storage controller writes, based on an indication of the write instruction, first data to a logical address space in a sequential manner starting from a first LBA of the logical address space, such as performing a write operation on at least one physical address in a physical address space of a non-volatile storage device corresponding to the logical address space based on the first data to write the first data to the at least one physical address, and establishing a mapping relationship between the at least one physical address and at least one LBA after the first LBA in the logical address space in a logical-to-physical mapping table in an ascending order of the LBA to achieve writing the first data to the logical address space. The storage controller can take a next LBA of a largest LBA in the at least one LBA as a third LBA.

[0129] 405、The storage controller updates the second partition mapping table based on the third LBA.

[0130] At this time, the second partition mapping table can be empty, or the second partition mapping table includes a second write pointer of at least one partition. For example, the second partition mapping table is empty when the second partition mapping table does not store the second write pointer of the open partition upon receiving the write instruction. For another example, the second partition mapping table includes the second write pointer of the at least one partition before receiving the write instruction, the at least one partition is part of or all of the plurality of partitions of the storage system, and the at least one partition is in an open state.

[0131] The storage controller obtains a fourth write pointer based on the third LBA, the fourth write pointer being an actual write pointer of the partition where the third LBA is located after the first data is written, and a next LBA indicated by the fourth write pointer being the third LBA. The process of obtaining the fourth write pointer can be: taking an offset between the ZSLBA of the partition where the third LBA is located and the third LBA as the fourth write pointer.

[0132] After determining the fourth write pointer, the storage controller queries, based on an identifier of a target partition where the fourth write pointer is located, a second write pointer of the target partition in the second partition mapping table, such as querying the identifier of the target partition in the second partition mapping table. If the identifier of the target partition exists in the second partition mapping table, the write pointer corresponding to the identifier of the target partition in the second partition mapping table is obtained as the second write pointer of the target partition. If the identifier of the target partition does not exist in the second partition mapping table, the second write pointer of the target partition is not included in the second partition mapping table, i.e., the second write pointer of the target partition is not queried.

[0133] If the second write pointer of the target partition is found in the second partition mapping table, the storage controller updates the second write pointer of the target partition in the second partition mapping table as the fourth write pointer, and if the second write pointer of the target partition is not found in the second partition mapping table, the storage controller stores the fourth write pointer in the second partition mapping table, for example, establishes a mapping relationship between the identifier of the target partition and the fourth write pointer in the second partition mapping table.

[0134] It should be noted that in the case of successful normal writing of the first data, the third LBA should be the same as the second LBA, the fourth write pointer should be the same as the third write pointer, and the target partition should be the partition where the second LBA is located. Based on this, after storing the third write pointer in the first partition mapping table and storing the fourth write pointer in the second partition mapping table, the write pointer of the target partition in the first partition mapping table is the same as the write pointer of the target partition in the second partition mapping table. In the case of failed writing of the first data, the first data may not be written or may not be written completely. If the first data is not written, the storage controller cannot obtain the third LBA, and thus the step of updating the second partition mapping table based on the third LBA is not performed. In this way, the write pointer of the partition where the second LBA is located in the first partition mapping table is different from the write pointer of the partition in the second partition mapping table. Alternatively, if the first data is not written completely, the obtained third LBA is different from the second LBA. After updating the second partition mapping table based on the third LBA, the fourth write pointer in the second partition mapping table is also different from the third write pointer in the first partition mapping table.

[0135] After storing the fourth write pointer in the second partition mapping table, the fourth write pointer is the new second write pointer of the target partition in the second partition mapping table. Subsequently, if a new write instruction is received again, the partition indicated by the identifier of the partition in the new write instruction is taken as a new first partition, and the above steps 401 to 405 are performed for the new first partition. In this way, the first write pointer of each open partition in the storage system can be recorded in the first partition mapping table, so that the first partition mapping table can include the first write pointers of multiple (open) partitions. The second write pointer of each open partition in the storage system can be recorded in the second partition mapping table, so that the second partition mapping table can include the second write pointers of multiple (open) partitions.

[0136] The method provided by the embodiments of the present application is based on a write instruction, predicts a next writable LBA in a logical address space after this time of writing data, updates a predicted write pointer in the first partition mapping table based on the predicted next writable LBA, thereby maintaining the predicted write pointers of the plurality of partitions in the storage system through the first partition mapping table, after executing the write instruction, updates a second partition mapping table based on a next actual writable LBA in the logical address space after this time of writing data, thereby maintaining the actual write pointers of the plurality of partitions in the storage system through the second partition mapping table, so as to subsequently determine the abnormal partition in the storage system through the first partition mapping table and the second partition mapping table.

[0137] The first partition mapping table and the second partition mapping table can be initially stored in the memory of the storage controller. As the first partition mapping table and the second partition mapping table are continuously updated, the first partition mapping table and the second partition mapping table in the memory become larger and larger, and then the storage controller can store the updated first partition mapping table and the updated second partition mapping table to the non-volatile storage device. For example, after step 403 is executed, the updated first partition mapping table is obtained, and the updated first partition mapping table is stored to the non-volatile storage device. After step 405 is executed, the updated second partition mapping table is obtained, and the updated second partition mapping table is stored to the non-volatile storage device. The non-volatile storage device for storing the first partition mapping table and the non-volatile storage device for storing the second partition mapping table can be the same non-volatile storage device or different non-volatile storage devices.

[0138] In some embodiments, the storage controller can also store the first partition mapping table and the second partition mapping table to the non-volatile storage device periodically. For example, the first partition mapping table is stored to the non-volatile storage device every first time length, and / or the second partition mapping table is stored to the non-volatile storage device every second time length. The first time length and the second time length are respectively the periods of storing the first partition mapping table and the second partition mapping table to the non-volatile storage device periodically. The first time length and the second time length can be the same or different, and the first time length and the second time length can be set according to actual application scenarios. In this embodiment of the present application, the first time length and the second time length are not limited.

[0139] In other embodiments, the memory of the storage controller stores checkpoint data. The checkpoint data can be written to the non-volatile storage device in the storage system through a checkpoint operation.

[0140] In a process of writing data into the non-volatile storage device in the storage system based on one or more write instructions, the storage controller also stores checkpoint data into the memory of the storage controller, the checkpoint data including information associated with the data that has been written currently, for example, the information can include a logical-to-physical address mapping table (such as an L2P table), a first partition mapping table, a second partition mapping table, a third partition mapping table, and a fourth partition mapping table, etc. Among them, the first partition mapping table, the third partition mapping table, and the fourth partition mapping table, etc. can be updated and maintained by the FE in the firmware running on the storage controller, so that after the FE receives a write instruction, the first partition mapping table can be updated immediately based on the write instruction, and the L2P table and the second partition mapping table can be updated and maintained by the FTL in the firmware running on the storage controller, so that after the write instruction is executed, the FTL updates the second write pointer of the partition in the second partition mapping table according to the physical address corresponding to the LBA related to the write instruction after updating the physical address in the L2P table. In some embodiments, the information can also include information indicating the running status of the firmware and / or some information customized by the specific firmware, which is not limited by the embodiments of the present application.

[0141] When writing a certain amount of data from the host into the non-volatile storage device in the storage system based on at least one write instruction that has been received, a checkpoint operation can be triggered to be performed by the storage controller to store checkpoint data composed of related information to the non-volatile storage device, and the certain amount of data is a write window size. As an example, such a write window size can be set to 16MB, and the 16MB can be the sum of the amount of data written based on multiple write instructions, can be the amount of data written based on one write instruction, or can be the amount of data written based on part of the data of one write instruction. Under the control of the FTL, a checkpoint operation is triggered to write related information whenever the cumulative amount of data written reaches 16MB. For the case that the set write window size can not be an integer multiple of the unit write size (for example, 4KB), the FTL can trigger a checkpoint operation once the cumulative amount of data written exceeds the write window size.

[0142] In the case that the checkpoint data includes the first partition mapping table and the second partition mapping table, the storage controller stores the first partition mapping table and the second partition mapping table to the non-volatile storage device through the checkpoint operation.

[0143] Any of the above-mentioned storage methods of storing the first partition mapping table and the second partition mapping table in a non-volatile storage device can store the first partition mapping table and the second partition mapping table from the memory of the storage controller to the non-volatile storage device to reduce memory usage and avoid data loss in the first partition mapping table and the second partition mapping table caused by abnormal power failure. For example, in the event of an abnormal power failure in the storage system, the data in the memory of the storage controller will be lost. During the power-on phase after the abnormal power failure, the storage controller can load the first partition mapping table and the second partition mapping table stored in the non-volatile storage device into the memory of the storage controller to restore the lost first partition mapping table and the second partition mapping table in the memory, so that the storage controller can subsequently determine the abnormal partition in the storage system based on the first partition mapping table and the second partition mapping table.

[0144] Next, through Figure 5 The illustrated storage system operation method flow describes the use of the first partition mapping table mentioned above. The method is executed by a storage controller in the storage system, wherein the storage system may be the storage system 102 described above. The storage system includes a storage controller and a non-volatile storage device. The storage controller may be the storage controller 22 described above, and the non-volatile storage device may be the non-volatile storage device 21 described above. The method includes the following steps.

[0145] 501. Obtain a first partition mapping table, where the first partition mapping table includes first write pointers of multiple partitions, where the multiple partitions are divided by logical address spaces corresponding to non-volatile storage devices, and the first write pointer indicates a predicted next writable LBA in the partition.

[0146] Among them, the multiple partitions are all in an open state, and the maintenance process of the first partition mapping table can refer to the above Figure 4 , I will not go into details here. Figure 1 For example, the first partition mapping table can be stored in the memory 224 in the storage controller 22 or the non-volatile storage device 21 in the storage system 102. The storage controller 22 can query the first partition mapping table in the memory 224. If the first partition mapping table exists in the memory 224, the first partition mapping table is obtained from the memory 224. If the first partition mapping table does not exist in the memory 224, the first partition mapping table stored in the non-volatile storage device 21 is first loaded into the memory 224, and then the first partition mapping table is obtained from the memory 224. Alternatively, the first partition mapping table is first obtained from the non-volatile storage device 21, and then the first partition mapping table is loaded into the memory 224.

[0147] 502、obtain a second partition mapping table, the second partition mapping table comprising second write pointers of the plurality of partitions, the second write pointers indicating next writable LBAs in the plurality of partitions.

[0148] wherein the plurality of partitions are respective partitions in the storage system in an open state, and in some embodiments, for any open partition recorded in the first partition mapping table, there can or can not be a second write pointer of the partition in the second partition mapping table, so as to Figure 4 For the first partition involved, if the step 502 is executed after the step 405, the third write pointer stored in the first partition mapping table is the fourth write pointer of the target partition in the second partition mapping table, and if the first partition is in an empty state when the write instruction is received, the write pointer of the target partition has not been stored in the second partition mapping table. After the step 404 is executed, before the step 405 is executed, an abnormal power-off occurs in the storage system, causing the storage controller to not have time to store the fourth write pointer of the target partition in the second partition mapping table. After the abnormal power-off, the storage controller obtains the second partition mapping table without the fourth write pointer of the target partition.

[0149] The storage controller obtains the first partition mapping table and obtains the second partition mapping table in the same way, and thus the step 502 will not be described again.

[0150] 503、the storage controller determines, based on the first partition mapping table and the second partition mapping table, a partition in which the first write pointer and the second write pointer are different from each other as an abnormal partition.

[0151] For the identifier of any partition in the second partition mapping table, the first write pointer corresponding to the identifier of the partition is queried in the first partition mapping table. If the first write pointer corresponding to the identifier of the partition does not exist in the first partition mapping table, the partition is determined as an abnormal partition. If the first write pointer corresponding to the identifier of the partition exists in the first partition mapping table, the first write pointer corresponding to the identifier of the partition is compared with the second write pointer corresponding to the identifier of the partition in the second partition mapping table. If the second write pointer is the same as the first write pointer, the partition is determined as a normal partition. If the second write pointer is different from the first write pointer, the partition is determined as an abnormal partition.

[0152] For the first partition involved, if the step 502 is executed after the step 405, the third write pointer stored in the first partition mapping table is the fourth write pointer of the target partition in the second partition mapping table, and if the first partition is in an empty state when the write instruction is received, the write pointer of the target partition has not been stored in the second partition mapping table. After the step 404 is executed, before the step 405 is executed, an abnormal power-off occurs in the storage system, causing the storage controller to not have time to store the fourth write pointer of the target partition in the second partition mapping table. After the abnormal power-off, the storage controller obtains the second partition mapping table without the fourth write pointer of the target partition. Figure 6For example, assuming that the storage system has N+1 open partitions, namely open partition 0 to open partition N, N is an integer greater than 0, the write pointers (WP) of open partition 0 to open partition N stored in the first partition mapping table are all the first write pointer, and the WP of open partition 0 to open partition N stored in the second partition mapping table are all the second write pointer. Taking open partition 2 as an example, after a certain update is performed on the write pointer of open partition 2 in the second partition mapping table, the position indicated by the WP of open partition 2 in the second partition mapping table is the same as the position indicated by the WP of open partition 2 in the first partition mapping table. Assuming that a write instruction indicating writing data to open partition 2 is subsequently received, based on the write instruction, the WP of open partition 2 in the first partition mapping table is updated, and the position indicated by the updated WP of open partition 2 in the first partition mapping table is later than the position indicated by the WP of open partition 2 in the second partition mapping table. Assuming that the storage system abnormally powers off before the write instruction is executed, in the stage after the storage system abnormally powers off, to determine the abnormal partition, the storage controller obtains the first partition mapping table and the second partition mapping table, and for the same open partition, by comparing the WP of the open partition in the first partition mapping table and the second partition mapping table, it is found that the WP of open partition 2 in the first partition mapping table is different from the WP of open partition 2 in the second partition mapping table, that is, the position indicated by the WP of open partition 2 in the first partition mapping table is different from the position indicated by the WP of open partition 2 in the second partition mapping table, and then open partition 2 is determined as the abnormal partition.

[0153] In some embodiments, in the power-on stage after the storage system abnormally powers off, step 503 is performed, for example, in the power-on stage after the storage system abnormally powers off, the storage controller determines the abnormal partition in the storage system by performing the process shown in steps 501 to 503 described above, so that the storage controller reconstructs the data in the abnormal partition. In other embodiments, the storage controller periodically performs the process shown in steps 501 to 503 described above, such as performing the process shown in steps 501 to 503 described above once every third time length, so as to periodically determine the abnormal partition in the storage system, so as to process the abnormal partition.

[0154] The above description is based on the example that the first partition mapping table only records the prediction pointer of the open partition. In other embodiments, the first partition mapping table is also used to record the various empty partitions and full partitions in the storage system. For example, the first partition mapping table includes the identifier of each partition in the storage system, the status identifier of each partition, the first write pointer of each open partition in the storage system, the write pointer of each empty partition, and the write pointer of each full partition. The write pointer of the full partition is invalid. The status identifier of any partition is used to indicate the status of the partition. For example, the status identifier includes an empty status identifier, a full status identifier, and an open status identifier. The empty status identifier, the full status identifier, and the open status identifier are used to indicate that the partition is in an empty state, a full state, or an open state, respectively.

[0155] Based on this, when updating the first partition mapping table based on the second LBA, if the second LBA is located in the first partition, if the status identifier of the first partition in the first partition mapping table is an empty status identifier or a full status identifier, the storage controller updates the status identifier of the first partition in the second partition mapping table to an open status identifier, updates the write pointer of the first partition in the first partition mapping table to a third write pointer, and if the status identifier of the first partition in the first partition mapping table is an open status identifier, updates the first write pointer of the first partition in the first partition mapping table to the third write pointer, so that the third write pointer becomes the new first write pointer of the first partition. If the second LBA is located in the second partition, the status identifier of the first partition in the first partition mapping table is updated to a full status identifier, the status identifier of the second partition in the first partition mapping table is updated to an open status identifier, and the write pointer of the second partition in the first partition mapping table is updated to the third write pointer. If the second partition is not adjacent to the first partition, the status identifier of each partition between the first partition and the second partition in the second mapping table is also updated to a full status identifier.

[0156] The process of determining an abnormal partition is as follows: for the identifier of any partition in the second partition mapping table, if the state identifier corresponding to the identifier of the partition in the first partition mapping table is an empty state identifier or a full state identifier, then the partition is determined to be an abnormal partition; if the state identifier corresponding to the identifier of the partition in the first partition mapping table is an open state identifier, the second write pointer corresponding to the identifier of the partition in the second partition mapping table is compared with the first write pointer corresponding to the identifier of the partition in the first partition mapping table. If the second write pointer is the same as the first write pointer, then the partition is determined to be a normal partition. If the second write pointer is different from the first write pointer, then the partition is determined to be an abnormal partition.

[0157] Figure 5The method provided by the embodiment shown can determine the abnormal partition from the plurality of partitions by the predicted write pointer of the partition in the first partition mapping table and the current write pointer of the partition in the second partition mapping table, the way of determining the abnormal partition is simple, the abnormal partition in the partition storage device can be quickly determined, and thus the time length of reconstructing data of the abnormal partition and the time length of restarting the storage system can be effectively shortened.

[0158] The above merely describes optional embodiments of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An operating method of a storage system, characterized by, The method comprises: obtaining a first partition mapping table, the first partition mapping table comprising first write pointers of a plurality of partitions, the plurality of partitions being divided by a logical address space corresponding to a non-volatile storage device, the first write pointer indicating a predicted next writable logical block address (LBA) in the partition; obtaining a second partition mapping table, the second partition mapping table comprising second write pointers of the plurality of partitions, the second write pointer indicating a next writable LBA in the partition; based on the first partition mapping table and the second partition mapping table, determining a partition in which the first write pointer and the second write pointer are different from each other in the plurality of partitions as an abnormal partition.

2. The method according to claim 1, characterized in that The method further comprises: after power-on phase of the storage system after abnormal power-off, performing the step of determining a partition in which the first write pointer and the second write pointer are different from each other in the plurality of partitions as an abnormal partition based on the first partition mapping table and the second partition mapping table.

3. The method of claim 1, wherein, The plurality of partitions are in an open state.

4. The method according to any one of claims 1-3, characterized in that, The method further comprises: receiving a write instruction, the write instruction comprising first data and a first LBA; based on the first LBA, predicting a next writable LBA in the logical address space after the first data is written, obtaining a second LBA; based on the second LBA, updating the first partition mapping table.

5. The method of claim 4, wherein, After updating the first partition mapping table, the method further comprises: storing the updated first partition mapping table to a non-volatile storage device.

6. The method of claim 4, wherein, After updating the first partition mapping table, the method further comprises: based on the write instruction, writing the first data to the logical address space to obtain a third LBA, the third LBA being a next writable LBA in the logical address space; based on the third LBA, updating the second partition mapping table.

7. The method of claim 6, wherein, After updating the second partition mapping table, the method further comprises: storing the updated second partition mapping table to a non-volatile storage device.

8. The method according to claim 4 or 6, characterized in that, The method further comprises: storing the first partition mapping table to a non-volatile storage device every first time length; and / or, storing the second partition mapping table to a non-volatile storage device every second time length.

9. The method of claim 8, wherein, The first time length is the same as the second time length.

10. The method of claim 8, wherein, The first time length is different from the second time length.

11. The method of claim 4 or 6, wherein, The method further comprises: storing the first partition mapping table and the second partition mapping table to a non-volatile storage device through a checkpoint operation.

12. An operating method of a storage system characterized by, The method comprises: receiving a write instruction, the write instruction comprising first data and a first logical block address (LBA), the first LBA belonging to a logical address space corresponding to a non-volatile storage device; based on the first LBA, predicting a next writable LBA in the logical address space after the first data is written, obtaining a second LBA; based on the second LBA, updating a first partition mapping table, the first partition mapping table comprising first write pointers of a plurality of partitions in the logical address space, the first write pointer indicating a predicted next writable LBA in the partition.

13. The method of claim 12, wherein, The method further comprises: obtaining a second partition mapping table, the second partition mapping table comprising second write pointers of the plurality of partitions, the second write pointers indicating next writable logical block addresses (LBAs) in the partitions; determining, based on the first partition mapping table and the second partition mapping table, a partition of the plurality of partitions as an abnormal partition, if the first write pointer and the second write pointer of the partition are different.

14. The method of claim 13, wherein, The method further comprises: performing, at a power-on stage after an abnormal power-off of the storage system, the step of determining, based on the first partition mapping table and the second partition mapping table, a partition of the plurality of partitions as an abnormal partition, if the first write pointer and the second write pointer of the partition are different.

15. The method of claim 13, wherein, The method further comprises, after the updating the first partition mapping table: writing the first data into the logical address space based on the write instruction, to obtain a third LBA, the third LBA being a next writable LBA in the logical address space; updating the second partition mapping table based on the third LBA.

16. The method of claim 15, wherein, The method further comprises, after the updating the second partition mapping table: storing the updated second partition mapping table to a non-volatile storage device.

17. The method according to any one of claims 13-15, characterized by, The method further comprises: storing the first partition mapping table to a non-volatile storage device every first time duration; and / or, storing the second partition mapping table to a non-volatile storage device every second time duration.

18. The method of claim 17, wherein, The first time duration is the same as the second time duration.

19. The method of claim 17, wherein, The first time duration is different from the second time duration.

20. The method of any one of claims 13-15, wherein, The method further comprises: storing the first partition mapping table and the second partition mapping table to a non-volatile storage device through a checkpoint operation.

21. The method of any one of claims 12-16, wherein, The method further comprises, after the updating the first partition mapping table: storing the updated first partition mapping table to a non-volatile storage device.

22. The method of any one of claims 12-16, wherein, The plurality of partitions are in an open state.

23. A storage system, characterized by The system comprises a non-volatile storage device and a storage controller, the storage controller being configured to perform: obtaining a first partition mapping table, the first partition mapping table comprising first write pointers of a plurality of partitions, the plurality of partitions being divided by a logical address space corresponding to the non-volatile storage device, the first write pointers indicating next writable logical block addresses (LBAs) in the partitions; obtaining a second partition mapping table, the second partition mapping table comprising second write pointers of the plurality of partitions, the second write pointers indicating next writable LBAs in the partitions; determining, based on the first partition mapping table and the second partition mapping table, a partition of the plurality of partitions as an abnormal partition, if the first write pointer and the second write pointer of the partition are different.

24. The system of claim 23, wherein, The storage controller is further configured to perform: performing, at a power-on stage after an abnormal power-off of the storage system, the step of determining, based on the first partition mapping table and the second partition mapping table, a partition of the plurality of partitions as an abnormal partition, if the first write pointer and the second write pointer of the partition are different.

25. The system of claim 23, wherein, The plurality of partitions are in an open state.

26. The system of any of claims 22-25, wherein, The storage controller is further configured to perform: receiving a write instruction, the write instruction comprising first data and a first LBA; predicting, based on the first LBA, a next writable LBA in the logical address space after the first data is written, to obtain a second LBA; updating the first partition mapping table based on the second LBA.

27. The system of claim 26, wherein, The storage controller is further configured to perform: storing the updated first partition mapping table to the non-volatile storage.

28. The system of claim 26, wherein, The storage controller is further configured to perform: writing, based on the write instruction, the first data to the logical address space to obtain a third LBA, the third LBA being a next writable LBA in the logical address space; updating the second partition mapping table based on the third LBA.

29. The system of claim 28, wherein, The storage controller is further configured to perform: storing the updated second partition mapping table to the non-volatile storage.

30. The system of claim 26 or 28, wherein, The storage controller is further configured to perform: storing the first partition mapping table to the non-volatile storage every first time duration; and / or, storing the second partition mapping table to the non-volatile storage every second time duration.

31. The system of claim 30, wherein, The first time duration is the same as the second time duration.

32. The system of claim 30, wherein, The first time duration is different from the second time duration.

33. The system of claim 26 or 28, wherein, The storage controller is further configured to perform: storing the first partition mapping table and the second partition mapping table to the non-volatile storage through a checkpoint operation.

34. A host, comprising: The host comprises a storage controller configured to control a non-volatile storage, the storage controller being configured to perform the method of any one of claims 1 to 22.

35. A storage controller, comprising: The storage controller comprises a memory interface configured to connect a storage device and a processor configured to execute program code, so that the storage controller performs the method of any one of claims 1 to 22.

36. A computer-readable storage medium, characterized in that, The storage medium stores at least one program code, the at least one program code being read by a processor in the storage controller to make the storage controller perform the method of any one of claims 1 to 22.