A read-write command processing method and related device

CN122633601BActive Publication Date: 2026-10-23MAXIO TECHNOLOGY (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611104682.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-10-23
Estimated Expiration
2046-07-23

AI Technical Summary

Technical Problem

[0005]本申请实施例提供一种读写命令处理方法,用以解决现有技术中由于数据集管理提示属性依赖主机逐命令配置,从而导致主机配置负担较重且存储控制器难以实施针对性闪存转换层处理的问题

Benefits of technology

采用本申请实施例提供的方法,无需由主机针对每一读写命令分别确定并配置与当前访问场景相适应的数据集管理提示属性,存储控制器也能够依据逻辑地址范围获得与目标读写命令相匹配的数据访问属性,从而可以降低主机对数据集管理提示属性进行维护和配置的处理负担,并提高存储控制器对目标读写命令实施针对性闪存转换层处理的能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633601B_ABST
    Figure CN122633601B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of storage, and discloses a read-write command processing method and related equipment, to solve the problem that, in the prior art, due to the fact that data set management prompt attributes depend on host command-by-command configuration, the host configuration burden is heavy, and the storage controller is difficult to implement targeted flash translation layer processing. The method comprises the following steps: receiving a target read-write command, and determining a target logical address range according to the target read-write command; querying stored prompt mapping information according to the target logical address range, and determining a target data set management prompt attribute corresponding to the target read-write command according to a query result; loading the target data set management prompt attribute into flash translation layer description information corresponding to the target read-write command; and performing flash translation layer processing on the target read-write command according to the flash translation layer description information loaded with the target data set management prompt attribute.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and in particular to a read / write command processing method and related equipment. Background Technology

[0002] Solid-state drives (SSDs) typically process read and write commands issued by the host through a Flash Translation Layer (FTL) to map logical addresses to physical addresses in the flash memory and manage flash storage space. Since different data may differ in access frequency, access order, and latency requirements, the SSD controller can perform targeted internal processing on corresponding read and write commands based on Data Set Management Hint (DSMHint) attributes.

[0003] In the existing Non-Volatile Memory Express (NVMe) protocol, when processing read / write commands, the host can set the corresponding DSM Hint in the Data Set Management (DSM) field of the read / write command based on the access characteristics of the data involved in the current read / write command, and then send the set read / write command to the solid-state drive (SSD) controller. The SSD controller can then perform appropriate Flash Translation Layer (FTL) processing on the read / write command based on the DSM Hint carried by the command.

[0004] However, in the above approach, since DSM hints are typically carried directly within a single read / write command, the host usually needs to determine and set the DSM field in each read / write command separately to ensure that different read / write commands carry DSM hints appropriate to their access scenarios. This increases the processing burden on the host for maintaining and configuring DSM hints. Furthermore, when the DSM field of a read / write command does not carry a valid DSM hint that can guide the flash translation layer's processing, the solid-state drive controller also struggles to implement targeted FTL processing for the read / write command based on the data access attributes matching the current read / write command. Summary of the Invention

[0005] This application provides a read / write command processing method to solve the problem in the prior art where the dataset management prompt attributes depend on the host to configure them command by command, resulting in a heavy host configuration burden and difficulty for the storage controller to implement targeted flash conversion layer processing.

[0006] This application also provides a read / write command processing device, an electronic device, a computer-readable storage medium, and a computer program product.

[0007] The embodiments of this application adopt the following technical solutions: In a first aspect, embodiments of this application provide a read / write command processing method, including: Receive target read / write commands and determine the target logical address range based on the target read / write commands; The system queries the stored hint mapping information based on the target logical address range, and determines the target dataset management hint attribute corresponding to the target read / write command based on the query results; wherein, the hint mapping information is used to characterize the mapping relationship between the logical address range and the dataset management hint attribute; Load the target dataset management hint attributes into the flash conversion layer description information corresponding to the target read / write command; Based on the flash translation layer description information loaded with the target dataset management hint attributes, perform flash translation layer processing on the target read / write commands.

[0008] Secondly, embodiments of this application provide a read / write command processing device, including a receiving module, a querying module, a loading module, and a processing module, wherein: The receiving module is used to receive target read / write commands and determine the target logical address range based on the target read / write commands; The query module is used to query the stored hint mapping information based on the target logical address range, and determine the target dataset management hint attribute corresponding to the target read / write command based on the query results; wherein, the hint mapping information is used to represent the mapping relationship between the logical address range and the dataset management hint attribute; The loading module is used to load the target dataset management prompt attributes into the flash conversion layer description information corresponding to the target read / write command; The processing module is used to perform flash conversion layer processing on target read / write commands based on the flash conversion layer description information loaded with target dataset management prompt attributes.

[0009] Thirdly, embodiments of this application provide a storage controller, including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the storage controller performs the steps of the read / write command processing method described above.

[0010] Fourthly, embodiments of this application provide a storage device, including a non-volatile storage medium and a storage controller, wherein the storage controller is connected to the non-volatile storage medium.

[0011] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor in a storage controller, it causes the storage controller to perform the steps of the read / write command processing method described above.

[0012] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: Using the method provided in this application embodiment, it is not necessary for the host to determine and configure the dataset management prompt attributes adapted to the current access scenario for each read / write command. The storage controller can also obtain the data access attributes that match the target read / write command based on the logical address range. This can reduce the processing burden of the host in maintaining and configuring the dataset management prompt attributes and improve the storage controller's ability to perform targeted flash translation layer processing on the target read / write command. Attached Figure Description

[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the functional modules of a storage controller provided in an embodiment of this application; Figure 2 A flowchart illustrating a read / write command processing method provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the matching of a target logical address range with a single entry, provided for an embodiment of this application; Figure 4 A schematic diagram illustrating the matching and splitting of a target logical address range spanning multiple entries, provided for an embodiment of this application; Figure 5 A flowchart illustrating another read / write command processing method provided in an embodiment of this application; Figure 6 A schematic diagram illustrating an application process of the method provided in the embodiments of this application in practice; Figure 7 This application provides a schematic diagram of the structure of a read / write command processing device according to an embodiment of the present application; Figure 8 This is a schematic diagram of the structure of a storage controller provided in an embodiment of this application. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0016] To address the problem in existing technologies where dataset management prompts rely on host-by-command configuration, resulting in a heavy burden on host configuration and difficulty for storage controllers to implement targeted flash memory conversion layer processing, this application provides a read / write command processing method.

[0017] In some embodiments, the read / write command processing method provided in this application can be applied to a storage device, which may include, but is not limited to, a client solid state drive (cSSD), an enterprise solid state drive (eSSD), and a universal flash storage device (UFS). The storage device may include a storage controller and a non-volatile storage medium. The storage controller is used to receive read / write commands and perform operations such as determining prompt attributes, generating Flash Translation Layer (FTL) description information (i.e., FTL description information), and processing the flash translation layer based on the read / write commands.

[0018] For ease of understanding, before describing the read / write command processing method provided in the embodiments of this application, we will first combine it with... Figure 1 This section describes the main functional modules of the storage controller used to execute read and write command processing methods. It should be noted that... Figure 1 The functional modules shown are merely an exemplary description of the functional modules of the storage controller and should not be construed as limiting the scope of protection of this application.

[0019] The storage controller can be positioned between the host and the flash storage medium. It receives read and write commands from the host and performs operations such as command parsing, logical address processing, dataset management and attribute determination, and flash translation layer processing. The storage controller can be implemented using hardware circuitry, firmware, or a combination of both.

[0020] like Figure 1The figure shows a functional block diagram of a storage controller provided in an embodiment of this application. As can be seen from the figure, the storage controller may include an access feature recognition module (i.e., Figure 1 The AI ​​recognition engine), prompt mapping information management module (i.e. Figure 1 The DSM_Hint Table management module and the flash translation layer execution module (i.e.) Figure 1 The FTL execution module and the fast recovery module.

[0021] The access feature recognition module is used to acquire and analyze the input / output access records (i.e., I0 access records) recorded by the storage controller during historical monitoring periods. These records can include one or more of the following: logical address, request size, read / write type, access time, Data Set Management Hint (DSM Hint) attribute, and namespace identifier. Based on the input / output access records, the access feature recognition module can identify data access characteristics corresponding to different logical address ranges and determine the corresponding Data Set Management Hint attribute based on the identified data access characteristics.

[0022] Data access characteristics may include one or more of the following: access frequency characteristics, access order characteristics, read / write tendency characteristics, spatial locality characteristics, and latency sensitivity characteristics. For example, an access characteristic recognition module can identify whether data within a certain logical address range is high-frequency or low-frequency access data, whether the access pattern corresponding to that logical address range is sequential or random access, or whether the data within that logical address range has high access latency requirements. The access characteristic recognition module can be implemented by an artificial intelligence recognition engine, or by a recognition component based on statistical rules, state machines, access counting, or access timing analysis; this application embodiment does not limit this.

[0023] The hint mapping information management module is used to generate, store, update, and query hint mapping information. Hint mapping information represents the mapping relationship between logical address ranges and dataset management hint attributes. In some embodiments, hint mapping information can also represent the mapping relationship between namespace identifiers, logical address ranges, and dataset management hint attributes.

[0024] Specifically, the prompt mapping information management module can receive the access feature recognition results output by the access feature recognition module, and generate or update the dataset management prompt attributes for the corresponding logical address range based on the access feature recognition results. The prompt mapping information management module can also generate or update corresponding prompt mapping information based on the dataset range description carried in the dataset management commands (i.e., DSM commands) issued by the host. Therefore, the prompt mapping information can be dynamically generated based on the input / output access features recognized by the storage controller, or it can be generated based on the dataset management prompt attributes configured by the host.

[0025] In one alternative implementation, the prompt mapping information can be stored in the form of a hardware prompt mapping table, which can be... Figure 1 The DSM_HINT Table is shown. The hardware hint mapping table can include multiple entries, each entry recording at least one mapped logical address range and the corresponding dataset management hint attribute. The hint mapping information management module can also set namespace index information to indicate the storage location and number of entries corresponding to different namespaces in the hardware hint mapping table, thereby narrowing the query scope of hint mapping information.

[0026] When the storage controller receives a target read / write command, it can parse the starting logical address and access length from the command and determine the target logical address range based on these parameters. The hint mapping information management module queries the storage's hint mapping information based on the target logical address range and determines the target dataset management hint attributes corresponding to the target read / write command based on the query results. These dataset management hint attributes can indicate the access frequency, access order, latency requirements, read / write tendency, or data release attributes of the corresponding data, providing the flash memory translation layer execution module with the basis for processing the target read / write command.

[0027] The flash translation layer execution module is used to generate or obtain the flash translation layer description information corresponding to the target read / write command, and load the target dataset management prompt attributes determined by the prompt mapping information management module into the flash translation layer description information. The flash translation layer description information can be understood as the command description data generated by the storage controller when processing read / write commands internally, used to record information such as the logical address, access length, read / write type, processing status, and dataset management prompt attributes of the target read / write command.

[0028] The flash translation layer execution module can perform corresponding flash translation layer processing on target read / write commands based on the flash translation layer description information loaded with target dataset management hint attributes. Flash translation layer processing may include one or more of the following: logical address to physical address mapping processing, data placement, cache management, prefetching processing, garbage collection, storage media selection, and processing chain scheduling.

[0029] For example, flash translation layer description information with the same dataset management hint attributes can be chained together to the same flash translation layer processing chain (i.e., FTL processing chain), and processing operations matching the corresponding dataset management hint attributes can be performed through this flash translation layer processing chain. The FTL execution module supports FTL slicing and data classification management based on different DSMHints.

[0030] The fast recovery module is used to restore the hardware prompt mapping table after the prompt mapping information in the hardware prompt mapping table is lost or invalidated due to the storage controller entering a low-power state.

[0031] In one optional implementation, the fast recovery module can store the backup data of the prompt mapping table corresponding to the prompt mapping information in a normally open storage area. When the storage controller exits the PS4 state, the fast recovery module can load the entire backup data of the prompt mapping table into the hardware prompt mapping table through the hardware control module, based on the backup data base address and backup data volume, thereby avoiding the need to restore each entry one by one.

[0032] exist Figure 1 In this architecture, the access feature recognition module, the prompt mapping information management module, the flash conversion layer execution module, and the fast recovery module form a closed-loop data processing architecture: the access feature recognition module obtains access feature recognition results based on input and output access records; the prompt mapping information management module generates or updates prompt mapping information based on the access feature recognition results; the flash conversion layer execution module manages prompt attributes and processes read and write commands based on the queried dataset; performance information after the application of prompt attributes can also be fed back to the access feature recognition module for subsequent updates to the prompt mapping information. The fast recovery module provides support for the continuous availability of prompt mapping information during low-power state switching.

[0033] It should be noted that, Figure 1 The diagram illustrates one possible functional module of the storage controller. In different embodiments, each functional module can be configured separately, or at least two functional modules can be integrated into the same processor, hardware control module, or firmware functional module. The access feature recognition module and fast recovery module are not necessarily required in every embodiment. For example, prompt mapping information can be pre-configured by the host and stored in the storage controller; the storage controller can directly query the prompt mapping information based on the target logical address range and manage the prompt attributes based on the queried dataset to perform flash translation layer processing.

[0034] Based on the storage controller described above, the read / write command processing method provided in the embodiments of this application will be described in detail below.

[0035] Example 1 Specifically, the implementation flow of the method provided in this application embodiment is as follows: Figure 2 As shown, it includes the following steps: Step 102: Receive the target read / write command and determine the target logical address range based on the target read / write command.

[0036] In some embodiments, the storage controller can receive target read / write commands from the host via the host interface. These target read / write commands refer to read or write commands that the storage controller needs to process, such as read or write commands issued based on the Non-Volatile Memory Fast Access Protocol (NVIP).

[0037] Optionally, the target read / write command may include a starting logical address and access length information. The starting logical address indicates the starting storage location of the data accessed by the target read / write command; the access length information indicates the number of logical address units accessed consecutively starting from the starting logical address, or it indicates the amount of data corresponding to the target read / write command. A logical address is a logical storage location identifier used by the host when accessing the storage device, and can be represented by a Logical Block Address (LBA), a Logical Allocation Address (LAA), or other equivalent logical address forms used internally by the storage controller.

[0038] In this embodiment, after receiving a target read / write command, the storage controller can parse the command and obtain the starting logical address and access length information from the corresponding command field. When the access length information is represented by the number of logical address units, the storage controller can determine all logical address units covered by the target read / write command based on the starting logical address and the number of logical address units. Alternatively, when the access length information is represented by the number of bytes, the storage controller can determine the number of logical address units corresponding to the target read / write command based on the ratio between the access length information and the data volume corresponding to a single logical address unit.

[0039] For example, a storage controller can determine the starting logical address as the starting boundary of the target logical address range, and determine the ending boundary of the target logical address range based on the starting logical address and the number of logical address units. Specifically, when logical addresses are represented by consecutive integers and the access length represents the actual number of logical address units, the ending boundary can be the sum of the starting logical address and the number of logical address units minus one. The logical address interval defined by the starting and ending boundaries is the target logical address range. The target logical address range is used to characterize the complete logical memory area actually accessed by the target read / write command, not just a single starting logical address in the target read / write command.

[0040] In one optional implementation, the target read / write command may further include a namespace identifier, which identifies the namespace accessed by the target read / write command. The storage controller can obtain the target namespace identifier from the target read / write command and interpret the target logical address range as the logical address range within the namespace corresponding to the target namespace identifier. Therefore, even if logical addresses with the same value exist in different namespaces, the logical address ranges in different namespaces can be distinguished using the namespace identifier.

[0041] Furthermore, when the logical block address granularity used by the host is different from the logical address granularity used by the flash translation layer inside the storage controller, the storage controller can also convert the logical block address extracted from the target read / write command into the logical allocation address used inside the flash translation layer according to the correspondence between the two address granularities, and use the converted logical allocation address range as the target logical address range used when querying the mapping information later.

[0042] For example, suppose the storage controller receives a target read command indicating a starting logical address of LAA 65536, an access length of 2048 LAAs, and each LAA corresponding to 4KB of data. The hardware hint mapping table is managed at a DBMT granularity of 4MB, with each DBMT address unit corresponding to 1024 LAAs. Therefore, the target logical address range corresponding to this read / write command is from LAA 65536 to LAA 67583, covering the two consecutive DBMT address units numbered 64 and 65. The storage controller can query the hint mapping information corresponding to these two DBMT address units to determine the target dataset management hint attributes corresponding to this read / write command.

[0043] Step 104: Query the stored hint mapping information according to the target logical address range, and determine the target dataset management hint attribute corresponding to the target read / write command based on the query results.

[0044] The hint mapping information is used to characterize the mapping relationship between logical address ranges and dataset management hint attributes. For any logical address range, the hint mapping information can record the starting logical address, address length, or ending logical address of the logical address range, as well as the dataset management hint attributes corresponding to that logical address range. Dataset management hint attributes can be attributes used to characterize the access characteristics or processing requirements of the corresponding data, such as one or more of the following: access frequency attributes, sequential access attributes, random access attributes, access latency attributes, read / write tendency attributes, and data release attributes.

[0045] In some implementations, the hint mapping information can be stored in the form of a hint mapping table. For example, the hint mapping table can be a DSM_HINT Table, which can include multiple entries. Each entry records a mapped logical address range and the corresponding dataset management hint attribute. The mapped logical address range indicates the data storage area to which the entry applies.

[0046] Table 1 below shows an exemplary DSM_HINT Table provided in an embodiment of this application.

[0047] Table 1

[0048] In some optional implementations, each DSM_HINT Table entry may include a validity flag (vld), a namespace identifier (nsid), a starting table logical address (start_tlaa), a logical address length (len), a dataset management field (i.e., a DSM field), and a dataset management field value (dsm). Here, vld indicates whether the current entry is valid; start_tlaa and len together define the corresponding mapped logical address range; and dsm records the dataset management hint attributes corresponding to this mapped logical address range. dsm can be an 8-bit field, and its value can correspond to the DSM field in read / write commands. It should be noted that the above fields and their specific bit widths are optional hardware table structures and do not constitute a limitation on the data organization form of the hint mapping information.

[0049] In some alternative implementations, the prompt mapping information can be either prompt mapping information written to the storage area during the storage device initialization process, or generated or updated according to the dataset management command issued by the host, or dynamically generated or updated by the storage controller after identifying data access characteristics based on historical input / output access records.

[0050] In some embodiments, when generating or updating prompt mapping information based on dataset management commands issued by the host, the following implementation methods can be adopted: The storage controller can receive dataset management commands issued by the host and obtain at least one dataset range description item carried in the dataset management command.

[0051] Dataset management commands can be used to pass one or more dataset ranges and their context attributes to the storage controller. A dataset range descriptor is a command data structure within a dataset management command that describes a dataset range. A dataset management command can carry one or more dataset range descriptors to describe multiple logical address ranges respectively.

[0052] For each dataset range description, the storage controller can obtain the starting configuration logical address, configuration logical address length, and configuration dataset management hint attributes from that dataset range description.

[0053] The starting configuration logical address indicates the starting position of the logical address range for which the dataset management prompt attribute needs to be configured; the configuration logical address length indicates the number of consecutive logical address units configured starting from the starting configuration logical address; and the configuration dataset management prompt attribute indicates the data access or processing prompts that the host wants to apply to this logical address range.

[0054] The storage controller can determine the starting configuration logical address as the starting boundary of the configuration logical address range, and determine the ending boundary of the configuration logical address range based on the starting configuration logical address and the configuration logical address length, thereby obtaining the configuration logical address range.

[0055] For example, when the configuration logical address length represents the number of actual logical address units, the ending logical address of the configuration logical address range can be the sum of the starting configuration logical address and the configuration logical address length minus one. When using a left-closed, right-open interval representation, the configuration logical address range can be represented as: [Starting configuration logical address, starting configuration logical address + configuration logical address length].

[0056] After determining the configuration logical address range, the storage controller can establish a mapping relationship between the configuration logical address range and the configuration dataset management prompt attributes, and generate prompt mapping information based on the mapping relationship.

[0057] If there is no entry corresponding to the configured logical address range in the prompt mapping information, an entry can be added, and the configured logical address range and the configuration dataset management prompt attributes can be written into the new entry.

[0058] Alternatively, if an entry corresponding to the configured logical address range already exists in the prompt mapping information, the dataset management prompt attribute in the existing entry can be replaced by the configured dataset management prompt attribute, or the logical address range of the existing entry can be merged, split, or adjusted according to the new configured logical address range to update the prompt mapping information.

[0059] When a dataset management command includes multiple dataset range descriptions, the storage controller can perform the above processing for each dataset range description separately, thereby generating or updating the mapping relationship between multiple sets of logical address ranges and dataset management prompt attributes at once.

[0060] In other embodiments, the prompt mapping information can be automatically generated or updated by the storage controller based on historical input / output access data. Specifically, firstly, the storage controller can obtain input / output access records recorded within a historical monitoring period. The historical monitoring period refers to the time interval preceding the current processing moment, used to statistically analyze or identify data access characteristics. For example, the historical monitoring period could be the time range corresponding to the most recent 100 milliseconds, the most recent 1 second, or a preset number of recent read / write commands.

[0061] In some embodiments, each input / output access record may include a logical address and access attribute information corresponding to that logical address. Optionally, the access attribute information may include one or more of the following: request size, read / write type, access time, number of accesses, access time interval, namespace identifier, and dataset management fields carried by the command.

[0062] Among them, request size can represent the amount of data or logical address units accessed in a single input / output request; read / write type can be used to indicate whether the corresponding input / output request is a read request or a write request; access time can be used to indicate when the corresponding input / output request occurs; access count or access time interval can be used to determine the access frequency of the corresponding logical address; and the logical address changes in multiple consecutive access records can be used to determine whether the access mode is sequential or random access.

[0063] After acquiring the input / output access records recorded during the historical monitoring period, the storage controller can aggregate the input / output access records according to logical addresses, divide the input / output access records with adjacent logical addresses or similar access characteristics into the same candidate logical address range, and analyze the access attribute information corresponding to each candidate logical address range to obtain the access feature identification results corresponding to each candidate logical address range.

[0064] The candidate logical address range refers to the logical address intervals that may have the same or similar access characteristics, initially determined based on input and output access records. The access feature identification results can be used to characterize the access frequency characteristics, access order characteristics, read / write tendency characteristics, spatial locality characteristics, or latency sensitivity characteristics of the candidate logical address range.

[0065] For example, when a candidate logical address range is accessed more than a preset threshold number of times during a historical monitoring period, its access frequency characteristic can be identified as high-frequency access; when the logical addresses accessed in multiple consecutive accesses change in ascending or descending order, its access order characteristic can be identified as sequential access; when the logical addresses of each access are scattered and there is no continuous change relationship, it can be identified as random access.

[0066] After obtaining the access feature identification results, the storage controller can determine the dataset management prompt attribute corresponding to the candidate logical address range based on the pre-configured conversion relationship between the access features and the dataset management prompt attribute.

[0067] For example, the identification results of high-frequency and sequential access can be converted into dataset management cue attributes to indicate high-frequency access, sequential access, and low-latency requirements; the identification results of high-frequency and random access can be converted into dataset management cue attributes to indicate high-frequency access, random access, and low-latency requirements; and the identification results of low-frequency access can be converted into dataset management cue attributes to indicate low-frequency access.

[0068] The storage controller can then establish a mapping between candidate logical address ranges and their corresponding dataset management hint attributes, and generate new entries based on the mapping, or update existing entries in the hint mapping information.

[0069] Therefore, the hint mapping information can be dynamically adjusted according to changes in the actual input and output access patterns, without having to rely entirely on the host to configure the dataset management hint attributes separately for each read and write command.

[0070] In this embodiment, when the storage controller queries the hint mapping information based on the target logical address range, it can first determine the start and end logical addresses of the target logical address range, and then compare the target logical address range with the mapping logical address range of each entry. If the target logical address range overlaps with the mapping logical address range of a valid entry, the entry can be determined as a hit entry; if the target logical address range does not overlap with the mapping logical address range of any valid entry, the hint mapping information can be determined as a miss.

[0071] In some embodiments, the hint mapping information can also be used to characterize the mapping relationship between namespace identifiers, logical address ranges, and dataset management hint attributes.

[0072] In this context, a namespace is a logical storage space provided by the storage device to the host. Considering that different namespaces can have independent logical address systems, logical addresses with the same value may exist in different namespaces. Therefore, to avoid mismatching a logical address range from one namespace to a logical address range with the same value in another namespace when querying hint mapping information, thus incorrectly determining the dataset management hint attribute corresponding to the target read / write command, each entry, in addition to including the mapped logical address range and dataset management hint attribute, may also include a namespace identifier corresponding to the mapped logical address range. The namespace identifier is used to distinguish different namespaces and indicate the namespace to which the corresponding entry applies.

[0073] Accordingly, upon receiving a target read / write command, the storage controller can retrieve the target namespace identifier from the command and query the hint mapping information based on both the target namespace identifier and the target logical address range. Only if the namespace identifier in an entry matches the target namespace identifier, and the mapped logical address range of that entry intersects with the target logical address range, is the entry identified as a hit. This allows for limiting the applicability of the hint mapping information at the namespace level, preventing mismatches of dataset management hint attributes between different namespaces.

[0074] In some embodiments, the hint mapping information may include namespace index information and multiple entries. Each entry may include a namespace identifier, a mapping logical address range, and dataset management hint attributes.

[0075] The namespace index information is used to indicate the storage location and number of entries for each namespace in the hint mapping table, so that the storage controller can quickly limit the query range of entries for the corresponding namespace when querying.

[0076] The storage controller can group multiple entries according to namespace identifiers, divide entries with the same namespace identifier into the same entry group, and arrange entries in the same entry group in a contiguous entry storage area.

[0077] A contiguous entry storage area refers to a set of storage locations that have consecutive entry indexes in the hint mapping table. For example, entries corresponding to one namespace can be stored contiguously in entries 0 to 4, and entries corresponding to another namespace can be stored contiguously in entries 5 to 9, instead of scattering entries corresponding to the same namespace across non-contiguous locations.

[0078] For each namespace corresponding to a contiguous entry storage area, the storage controller can also sort the corresponding entries in ascending order of the starting logical address of the mapped logical address range of each entry.

[0079] For example, if a namespace corresponds to three entries with starting logical addresses of 0x20000, 0x0, and 0x10000 respectively, then after sorting, the three entries with starting logical addresses of 0x0, 0x10000, and 0x20000 can be stored sequentially.

[0080] After completing the continuous arrangement and sorting, the storage controller can determine the starting entry index and the number of continuous entries corresponding to each namespace identifier based on the continuous entry storage area corresponding to each namespace.

[0081] The starting entry index indicates the position of the first entry in the hint mapping table corresponding to the namespace; the consecutive entry count indicates the number of consecutive entries occupied by the namespace after the starting entry index.

[0082] The storage controller can associate the starting entry index and the number of consecutive entries corresponding to each namespace identifier to generate namespace index information. When entries corresponding to a namespace are added, deleted, rearranged, or migrated, the starting entry index and the number of consecutive entries can be redefined, and the namespace index information can be updated accordingly.

[0083] In an alternative implementation, NSID_MAP_TBL can serve as a specific implementation of namespace index information. The NS_MAP_SIDX field in NSID_MAP_TBL can be used to indicate the starting entry index of the corresponding namespace in the DSM_HINT Table, and the NS_MAP_LEN field can be used to indicate the number of consecutive entries occupied by the namespace.

[0084] When the hint mapping information includes namespace index information and multiple ordered entries, the storage controller can query the hint mapping information in the following manner.

[0085] First, the storage controller can query the namespace index information based on the target namespace identifier to obtain the target starting entry index and the number of consecutive target entries corresponding to the target namespace identifier.

[0086] For example, if the namespace index information records that the starting entry index of the target namespace is 10 and the number of consecutive entries is 4, it means that the entries corresponding to the target namespace are stored consecutively in entries 10, 11, 12 and 13.

[0087] Secondly, the storage controller can determine the target entry query range corresponding to the target namespace identifier based on the target starting entry index and the number of consecutive target entries.

[0088] The target entry query range can be represented as: [Target starting entry index, target starting entry index + number of consecutive target entries - 1].

[0089] By defining the target entry query range, the query scope can be narrowed from the entire hint mapping table to the continuous entry storage area corresponding to the target namespace.

[0090] Subsequently, the storage controller can perform a binary search on entries within the target entry query interval based on the starting logical address of the target logical address range to determine the initial candidate entries.

[0091] In one implementation, the entry whose starting logical address is no greater than the starting logical address of the target logical address range, and whose values ​​are closest to the target logical address range, can be determined as the initial candidate entry. If there is no entry whose starting logical address is no greater than the starting logical address of the target logical address range, the first entry in the target entry query interval can be determined as the initial candidate entry.

[0092] After determining the initial candidate entries, the storage controller can start from the initial candidate entries and, according to the order of the entries, sequentially determine whether the mapped logical address range of each entry intersects with the target logical address range.

[0093] For each entry being inspected, the storage controller can determine the mapped logical address range based on the entry's starting logical address and address length, and determine whether the following conditions are met: The starting logical address of the mapped logical address range is less than the ending boundary of the target logical address range; and the ending boundary of the mapped logical address range is greater than the starting logical address of the target logical address range.

[0094] When the above conditions are met simultaneously, it can be determined that the entry intersects with the target logical address range, and the entry is identified as a hit entry.

[0095] When the starting logical address of the entry being checked is no less than the end boundary of the target logical address range, the storage controller can stop checking because the starting logical address of subsequent entries is larger.

[0096] If at least one hit entry is identified, the storage controller can read the dataset management hint attributes from at least one hit entry and determine the target dataset management hint attributes accordingly.

[0097] Alternatively, if only one hit entry is identified, the dataset management hint attribute in that hit entry can be directly identified as the target dataset management hint attribute.

[0098] Alternatively, if multiple hit entries are identified, the dataset management hint attributes in each hit entry, along with the corresponding hit logical address portion, can be associated to determine the target dataset management hint attribute. Subsequently, based on this association, different dataset management hint attributes can be loaded into the corresponding flash conversion layer description information.

[0099] Alternatively, if no matching entry is identified, the storage controller can set a preset attribute as the target dataset management hint attribute.

[0100] Among them, the preset attribute refers to the attribute used to guide the storage controller to process the target read and write commands according to the default processing strategy when no dataset management prompt attribute matching the target logical address range is found. The preset attribute can be an attribute value indicating that special data classification processing is not enabled, or it can be a general dataset management prompt attribute pre-configured by the firmware.

[0101] For example, such as Figure 3 The diagram shown illustrates the matching of a target logical address range with a single entry, as provided in an embodiment of this application. Figure 3 As can be seen, the namespace index information includes the information in Table 2 below: Table 2

[0102] The entries corresponding to namespace identifier 30 are stored consecutively in entries 0 to 2. These three entries are shown in Table 3 below: Table 3

[0103] For ease of description, it is assumed that the `len` value in each entry has been converted back to the actual number of address units, and the corresponding range is represented by a left-closed, right-open logical address range. If the `len` value in the hardware uses base-0 encoding, the memory controller can first convert `len` into the actual number of address units according to the corresponding encoding rules.

[0104] Based on this, assume the storage controller receives a target read command and determines: The target namespace identifier is 30; The starting logical address of the target logical address range is 0x10100; The target logical address length is 0x100; The target logical address range is [0x10100, 0x10200].

[0105] Therefore, according to the information storage controller in Table 3 above, Hint Entry 1 can be identified as the hit entry.

[0106] Finally, the dataset management hint attribute in Hint Entry 1 is read. Since the dsm value in Hint Entry 1 is 3, the attribute value 3 is determined as the target dataset management hint attribute corresponding to this target read command.

[0107] Through the above query process, even if the target read command itself does not carry a valid dataset management hint attribute, the storage controller can still determine that the dataset management hint attribute is 3 from the hint mapping information in the storage based on the target namespace identifier 30 and the target logical address range [0x10100, 0x10200].

[0108] Step 106: Load the target dataset management hint attributes into the flash conversion layer description information corresponding to the target read / write command.

[0109] The flash translation layer description information is command description information generated or maintained by the storage controller when processing target read / write commands internally. It is used to pass processing parameters of the target read / write commands to the flash translation layer. The flash translation layer description information may at least include attribute fields for recording dataset management prompt attributes; optionally, it may also include one or more of the following: logical address, address length, namespace identifier, read / write type, command identifier, and processing status corresponding to the target read / write command.

[0110] Loading refers to writing the target dataset management hint attributes into the attribute fields of the flash translation layer description information used to record dataset management hint attributes, or establishing a correspondence between the flash translation layer description information and the target dataset management hint attributes by setting attribute references, attribute identifiers, etc. This loading process is an attribute transfer process within the storage controller and does not require modification of the original target read / write commands issued by the host.

[0111] In one specific implementation, the flash translation layer description information can be an FTL desc, and the attribute field can be the DSM field in the FTL desc. When a mapping information query hits, the hardware control module can read the dsm value from the hit entry and fill the corresponding FTL desc's DSM field with that dsm value. For example, the dsm field value of the hit entry can be written to the dsm_field of the ftl_desc corresponding to the target read / write command.

[0112] If the dataset management field of the target read / write command is not configured with a valid dataset management hint attribute, and the hint mapping information query is successful, the dataset management hint attribute can be read from the successful entry and populated into the flash conversion layer description information corresponding to the target read / write command.

[0113] When the entire target logical address range corresponds to the same target dataset management hint attribute, if the target read / write command corresponds to one flash translation layer description information, the target dataset management hint attribute can be directly written into the attribute field of that flash translation layer description information; if the target read / write command corresponds to multiple flash translation layer description information, the target dataset management hint attribute can be loaded into multiple flash translation layer description information covering the target logical address range respectively, so that multiple flash translation layer description information carry the same target dataset management hint attribute.

[0114] For example, the storage controller can organize a target read / write command into one or more flash translation layer descriptions according to the granularity of its internal command processing. Each flash translation layer description can correspond to a continuous address range within the target logical address range. Based on the address ranges corresponding to each flash translation layer description, the storage controller can determine which flash translation layer descriptions need to load the target dataset management hint attributes and write the target dataset management hint attributes into the attribute fields of the corresponding flash translation layer descriptions.

[0115] In this way, the subsequent flash translation layer does not need to re-query the hint mapping information, and can directly obtain the dataset management hint attribute corresponding to the corresponding logical address range from the flash translation layer description information.

[0116] In some embodiments, the query results may indicate that the target logical address range only partially overlaps with the mapped logical address range of a hit entry. In this case, if the dataset management hint attribute from the hit entry is loaded into all flash translation layer description information corresponding to the target read / write command, the missing portion of the target logical address range may incorrectly use the dataset management hint attribute.

[0117] Based on this, the storage controller can determine the hit subrange according to the overlap between the target logical address range and the mapped logical address range of the hit entry.

[0118] A hit subrange refers to the address portion of the target logical address range that falls within the mapped logical address range of a hit entry. The storage controller can also define the portion of the target logical address range that is outside the hit subrange as a miss subrange.

[0119] Subsequently, the storage controller can divide the flash translation layer description information corresponding to the target read / write command according to the hit sub-range and the miss sub-range to obtain the hit flash translation layer description information and the miss flash translation layer description information.

[0120] The division here can be either splitting the original flash translation layer description information corresponding to the target logical address range into multiple flash translation layer description information corresponding to different logical address sub-ranges, or generating the corresponding flash translation layer description information directly according to the hit sub-range and the missed sub-range when generating the flash translation layer description information.

[0121] The obtained hit flash translation layer description information is used to describe the hit sub-range, and its starting logical address and address length correspond to the hit sub-range; the miss flash translation layer description information is used to describe the miss sub-range, and its starting logical address and address length correspond to the miss sub-range.

[0122] The storage controller can identify the dataset management hint attribute in the hit entry as the target dataset management hint attribute and load the target dataset management hint attribute into the hit flash conversion layer description information; for the missing flash conversion layer description information, it can load preset attributes.

[0123] The preset attribute is used to instruct the flash translation layer to process the logical address subrange according to the default processing strategy when no valid entry is matched in the corresponding logical address subrange.

[0124] After attribute loading is complete, the matched and unmatched flash conversion layer descriptions can be concatenated to the corresponding flash conversion layer processing chains based on the target dataset management prompt attributes and preset attributes. Specifically, matched flash conversion layer descriptions can be concatenated to the flash conversion layer processing chain corresponding to the target dataset management prompt attributes, while unmatched flash conversion layer descriptions can be concatenated to the flash conversion layer processing chain corresponding to the preset attributes.

[0125] In this way, the portion of the target read / write command that actually hits an entry can use the dataset management hint attributes corresponding to the hit entry, while the portion that misses still uses the preset attributes. This avoids applying the same dataset management hint attributes indiscriminately to the entire logical address range of the target read / write command. In some embodiments, only the corresponding DSM value can be filled into the FTL desc corresponding to the hit portion, and the missing portion can be processed according to the default strategy.

[0126] In other embodiments, the query results may indicate that the target logical address range spans the mapped logical address ranges of multiple hit entries. Different hit entries may have the same dataset management hint attributes or different dataset management hint attributes.

[0127] The storage controller can determine the overlapping portion between the target logical address range and the mapped logical address range of each hit entry, and define each overlapping portion as a hit subrange.

[0128] When there is a portion within the target logical address range that does not overlap with the mapped logical address range of any hit entry, that portion can be identified as at least one hit subrange.

[0129] The storage controller can divide the flash memory translation layer description information corresponding to the target read / write command into the following categories according to the order of each hit sub-range and each miss sub-range within the target logical address range: Description information of the hit flash memory conversion layer corresponding to each hit sub-range; Description information of the missed flash memory translation layer corresponding to each missed sub-range.

[0130] For each hit subrange, the storage controller can read the dataset management hint attributes from the hit entries corresponding to that subrange, and determine the read dataset management hint attributes as the sub-target dataset management hint attributes corresponding to that subrange. The sub-target dataset management hint attributes corresponding to each hit subrange collectively constitute the target dataset management hint attributes corresponding to the target read / write command.

[0131] Subsequently, the storage controller can load the management hint attributes of each sub-target dataset into the corresponding hit flash conversion layer description information, and load the preset attributes into each miss flash conversion layer description information.

[0132] For hit flash conversion layer description information that has the same dataset management hint attribute, it can be chained to the same flash conversion layer processing chain; for hit flash conversion layer description information that has different dataset management hint attributes, it can be chained to different flash conversion layer processing chains; and each hit flash conversion layer description information can be chained to the flash conversion layer processing chain corresponding to the preset attribute.

[0133] Therefore, even if a target read / write command spans multiple mapped logical address ranges with different dataset management hint attributes, the storage controller can still load the corresponding dataset management hint attributes according to the different logical address sub-ranges, without having to uniformly configure a single attribute for the entire target read / write command.

[0134] like Figure 4 The diagram shown illustrates the matching and splitting of a target logical address range spanning multiple entries, as provided in an embodiment of this application. From... Figure 4As can be seen, the command logical address range corresponding to the target read / write command can span multiple mapped logical address ranges, and there can also be miss intervals between each mapped logical address range. The storage controller can sequentially divide the target logical address range into multiple hit sub-ranges and miss sub-ranges, forming multiple command split logical address ranges corresponding to each hit logical address sub-range and each miss logical address sub-range, respectively. Then, the dataset management hint attributes corresponding to each hit logical address sub-range are loaded into the corresponding flash translation layer description information, and the preset default attributes are loaded into the flash translation layer description information corresponding to each miss logical address sub-range.

[0135] Step 108: Perform flash conversion layer processing on the target read / write command based on the flash conversion layer description information loaded with the target dataset management prompt attributes.

[0136] In this embodiment of the application, the flash memory translation layer processing may include at least: determining the corresponding flash memory physical address based on the logical address corresponding to the target read / write command, and performing data reading or data writing based on the determined flash memory physical address.

[0137] In some embodiments, flash translation layer processing may also include one or more of the following: data classification management, data placement, sequential access prefetching, cache management, garbage collection, or data migration.

[0138] In some implementations, when performing flash conversion layer processing on a target read / write command based on the flash conversion layer description information loaded with the target dataset management prompt attributes, the target flash conversion layer processing chain corresponding to the target dataset management prompt attributes can be determined first. Specifically, the same dataset management prompt attributes correspond to the same flash conversion layer processing chain, and different dataset management prompt attributes correspond to different flash conversion layer processing chains. If no target flash conversion layer processing chain exists corresponding to the target dataset management prompt attributes, a target flash conversion layer processing chain corresponding to the target dataset management prompt attributes is established. The flash conversion layer description information loaded with the target dataset management prompt attributes is then concatenated to the target flash conversion layer processing chain. Finally, the target read / write command is processed using the target flash conversion layer processing chain, performing the flash conversion layer processing corresponding to the target dataset management prompt attributes.

[0139] The flash conversion layer processing chain refers to a logical processing structure used to classify and concatenate flash conversion layer description information according to the dataset management hint attributes, and process the flash conversion layer description information in a corresponding processing order. The flash conversion layer processing chain can be implemented using a linked list, a description information queue, a head and tail pointer structure, or other data structures that can maintain the processing order among multiple flash conversion layer description information.

[0140] Each flash conversion layer processing chain can correspond to a dataset management hint attribute. The same dataset management hint attribute corresponds to the same flash conversion layer processing chain, while different dataset management hint attributes correspond to different flash conversion layer processing chains. This avoids mixing flash conversion layer description information with different data access characteristics or different processing requirements within the same processing chain.

[0141] In one specific implementation, the storage controller can configure processing chain mapping information. This processing chain mapping information records the correspondence between dataset management hint attributes and flash translation layer processing chains. For example, it may include dataset management hint attributes, processing chain identifiers, the head position of the processing chain, and the tail position of the processing chain.

[0142] After the flash conversion layer execution module reads the target dataset management hint attribute loaded in the flash conversion layer description information, it can use the target dataset management hint attribute to query the processing chain mapping information to determine the target flash conversion layer processing chain corresponding to the target dataset management hint attribute.

[0143] For example, if the attribute value of the target dataset management prompt attribute is 3, attribute value 3 can be used as the query key to find the flash conversion layer processing chain corresponding to attribute value 3 in the processing chain mapping information. If the corresponding flash conversion layer processing chain is found, then that flash conversion layer processing chain is determined as the target flash conversion layer processing chain.

[0144] In the absence of a target flash conversion layer processing chain corresponding to the target dataset management hint attribute, the storage controller may establish a target flash conversion layer processing chain corresponding to the target dataset management hint attribute.

[0145] Specifically, the storage controller can assign processing chain control information to the target flash memory conversion layer processing chain, record the target dataset management prompt attribute as the attribute corresponding to the target flash memory conversion layer processing chain, and initialize the head and tail positions of the target flash memory conversion layer processing chain. After initialization, the correspondence between the target dataset management prompt attribute and the target flash memory conversion layer processing chain can also be established in the processing chain mapping information.

[0146] After identifying or establishing the target flash translation layer processing chain, the storage controller can connect the flash translation layer description information loaded with the target dataset management hint attributes to the target flash translation layer processing chain.

[0147] Serialization refers to adding flash memory translation layer description information to the target flash memory translation layer processing chain, making the flash memory translation layer description information a node to be processed in the target flash memory translation layer processing chain. Serialization does not physically connect the flash memory translation layer description information, but rather establishes the subordinate relationship and processing order between the flash memory translation layer description information and the target flash memory translation layer processing chain through pointers, indices, queue positions, or other logical association methods.

[0148] When the target flash memory conversion layer processing chain is empty, the flash memory conversion layer description information can be simultaneously designated as both the head and tail nodes of the target flash memory conversion layer processing chain. If other flash memory conversion layer description information already exists in the target flash memory conversion layer processing chain, the newly received flash memory conversion layer description information can be concatenated to the tail of the target flash memory conversion layer processing chain, and the tail position of the target flash memory conversion layer processing chain can be updated.

[0149] In one implementation, the flash translation layer description information can be concatenated according to the order in which it is generated or received to maintain the processing order of read and write commands corresponding to the same dataset management prompt attributes. In other implementations, the concatenation position of the flash translation layer description information in the target flash translation layer processing chain can be further determined by combining command priority, logical address order, or read / write type.

[0150] After the concatenation is completed, the flash conversion layer execution module can perform flash conversion layer processing corresponding to the target dataset management prompt attributes on the target read / write commands through the target flash conversion layer processing chain.

[0151] Specifically, the flash conversion layer execution module can sequentially read the description information of each flash conversion layer from the head of the target flash conversion layer processing chain, perform basic flash conversion layer processing according to the logical address, address length and read / write type in each flash conversion layer description information, and call or configure the corresponding flash conversion layer processing strategy according to the target dataset management prompt attribute corresponding to the target flash conversion layer processing chain.

[0152] For example, when the target flash memory translation layer processing chain corresponds to a high-frequency access attribute, it can perform data placement processing suitable for high-frequency access data on the flash memory translation layer description information connected in series through the target flash memory translation layer processing chain; when the target flash memory translation layer processing chain corresponds to a sequential access attribute, it can perform continuous physical space allocation or prefetching processing on the flash memory translation layer description information connected in series; when the target flash memory translation layer processing chain corresponds to a preset attribute, it can be processed according to the general flash memory translation layer processing method.

[0153] After processing a flash memory conversion layer description, the description can be removed from the target flash memory conversion layer processing chain, and the head position of the target flash memory conversion layer processing chain can be updated. When there is no flash memory conversion layer description to be processed in the target flash memory conversion layer processing chain, the target flash memory conversion layer processing chain can be retained for use by subsequent flash memory conversion layer descriptions with the same dataset management prompt attributes; alternatively, the control information corresponding to the target flash memory conversion layer processing chain can be released. The above-mentioned methods of retaining or releasing the processing chain are optional implementation methods.

[0154] By setting different flash conversion layer processing chains for different dataset management prompt attributes, flash conversion layer description information with the same data access characteristics or processing needs can be processed centrally, while flash conversion layer description information with different data access characteristics or processing needs can be isolated from each other. This avoids interference between different processing strategies and improves the convenience of flash conversion layers performing targeted processing based on dataset management prompt attributes.

[0155] Using the method provided in this application embodiment, it is not necessary for the host to determine and configure the dataset management prompt attributes adapted to the current access scenario for each read / write command. The storage controller can also obtain the data access attributes that match the target read / write command based on the logical address range. This can reduce the processing burden of the host in maintaining and configuring the dataset management prompt attributes and improve the storage controller's ability to perform targeted flash translation layer processing on the target read / write command.

[0156] Example 2 In some embodiments, hint mapping information may be stored in a hint mapping table in the storage controller. To enable hardware modules in the storage controller to directly query hint mapping information based on the target namespace identifier and the target logical address range, the hint mapping table may be configured as a hardware hint mapping table accessible by the hardware modules.

[0157] The hardware hint mapping table may include a namespace index area and an entry storage area. The namespace index area stores the aforementioned namespace index information; the entry storage area stores the aforementioned multiple entries. The consecutive entry storage area corresponding to each namespace identifier can be a contiguous segment of the entry storage area. Therefore, the starting entry index and the number of consecutive entries in the namespace index information can be used to indicate the storage location and number of entries corresponding to the respective namespace in the hardware hint mapping table.

[0158] In one specific implementation, the hardware hint mapping table can be a DSM_HINT Table, the namespace index area can be used to store NSID_MAP_TBL, and the entry storage area can be used to store multiple DSM_HINT Table Entry. It should be noted that DSM_HINT Table, NSID_MAP_TBL, and DSM_HINT Table Entry are merely specific implementations of the corresponding data structures and do not constitute a limitation on this application.

[0159] In the above implementation, when the storage controller needs to configure newly generated or updated hint mapping information to the hardware hint mapping table, it can use a block download operation to write the namespace index information to be updated and multiple entries to be written into the hardware hint mapping table.

[0160] Considering that updating the hardware hint mapping table by inserting or deleting entries one by one can easily create invalid entry positions between valid entries, disrupting the continuous arrangement of entries corresponding to the same namespace, and potentially causing inconsistencies between the namespace index information and the actual storage location of the entries, this embodiment of the application, when the hardware hint mapping table needs to be updated, can obtain the namespace index information to be updated and multiple entries to be written arranged continuously according to the corresponding continuous entry storage area. Based on the namespace index information to be updated and the multiple entries to be written, a hint mapping table data to be downloaded is generated, and the hardware control module performs a block download operation. In this way, since multiple entries to be written can be continuously written to the hardware hint mapping table in a predetermined order, and the namespace index information to be updated can be synchronously written to the corresponding namespace index area, table holes caused by inserting or deleting entries one by one can be avoided. This maintains the storage continuity and orderly arrangement of entries, and ensures that the namespace index information corresponds to the actual storage location of the entries. This provides a data structure foundation for subsequent binary search queries within a limited continuous entry query interval and reduces the update management overhead of the hint mapping table.

[0161] Specifically, before performing a full block download operation, the storage controller can first determine the namespace index information to be updated and the multiple entries to be written based on the hint mapping information in the hardware hint mapping table to be written.

[0162] The namespace index information to be updated refers to the index information in the namespace index area of ​​the hardware hint map that needs to be written to or updated after the current download operation is completed. The namespace index information to be updated may include at least one namespace identifier, as well as the starting entry index and the number of consecutive entries corresponding to each namespace identifier. The starting entry index indicates the position of the first entry corresponding to the namespace in the hardware hint map, and the number of consecutive entries indicates the number of consecutive entries occupied by the corresponding namespace starting from that starting entry index.

[0163] For example, the namespace index information to be updated could indicate that the entries corresponding to namespace 30 are stored consecutively starting from entry index 0, with a total of 3 consecutive entries. Accordingly, when the hardware control module subsequently queries the hardware hint mapping table based on namespace 30, it can determine entry 0 to entry 2 as the query range for the entries corresponding to namespace 30.

[0164] The multiple entries to be written refer to the multiple entries that need to be written to the hardware hint mapping table for this whole block download operation. Each entry to be written may include a namespace identifier, a mapped logical address range, and a dataset management hint attribute. The namespace identifier is used to indicate the namespace to which the corresponding entry belongs; the mapped logical address range is used to indicate the logical address range to which the corresponding dataset management hint attribute applies; the dataset management hint attribute is used to guide the storage controller to perform flash translation layer processing on the data within the corresponding logical address range.

[0165] In one specific implementation, each entry to be written may also include a validity flag. The validity flag indicates whether the corresponding entry stores a valid mapping relationship that can participate in the query for hint mapping information.

[0166] Multiple entries to be written are arranged consecutively according to their corresponding consecutive entry storage areas. Specifically, the storage controller can group multiple entries to be written according to namespace identifiers, arrange entries to be written with the same namespace identifier consecutively, and sort multiple entries to be written belonging to the same namespace in ascending order of the starting logical address of the mapped logical address range of each entry to be written.

[0167] For example, if a namespace corresponds to three entries to be written, and the starting logical addresses of these three entries are 0x20000, 0x0, and 0x10000 respectively, the memory controller can arrange the three entries in the order of 0x0, 0x10000, and 0x20000. After arrangement, no entries belonging to other namespaces or invalid blank entries are inserted between the three entries, so that the three entries form a contiguous storage area in the hardware hint mapping table.

[0168] The namespace index information to be updated should match the multiple entries to be written. For example, if the namespace index information to be updated indicates that the starting entry index of a certain namespace is 16 and the number of consecutive entries is 4, then the four entries to be written for that namespace should be written to entries 16 to 19 in the hardware hint mapping table.

[0169] After obtaining the namespace index information to be updated and the multiple entries to be written, the storage controller can encode and arrange the namespace index information to be updated and the multiple entries to be written according to the data storage format adopted by the hardware prompt mapping table, and generate the prompt mapping table data to be downloaded.

[0170] The data to be downloaded in the hardware prompt mapping table refers to a data set organized in a data format that the hardware control module can recognize and read, used for writing to the hardware prompt mapping table. This data may include namespace index information to be updated, and multiple entries to be written arranged consecutively in corresponding consecutive entry storage areas.

[0171] In one specific implementation, the firmware in the storage controller can encapsulate each entry to be written into fixed-length entry data according to the bit width of each field in the hardware hint mapping table, and arrange multiple entry data consecutively according to the target write order. For example, each entry can occupy two double words. The firmware can encapsulate the starting table logical address and dataset management hint attributes in one double word, and encapsulate the address length, namespace identifier, and validity flag in the other double word.

[0172] When generating the download prompt mapping table data, the storage controller can also perform validity checks on the namespace index information to be updated and the multiple entries to be written. For example, it can check whether the number of consecutive entries indicated by the namespace index information to be updated is equal to the number of entries to be written in the corresponding namespace, check whether the namespace identifier in each entry to be written is consistent with the corresponding namespace index information to be updated, and check whether the multiple entries to be written belonging to the same namespace are arranged in ascending order of the starting logical address of the mapped logical address range. The above validity checks are optional implementation methods.

[0173] After generating the download prompt mapping table data, the storage controller can write the download prompt mapping table data into the download buffer.

[0174] A download buffer is a storage space used to temporarily store download prompt mapping table data between the firmware-managed storage area and the hardware control module. The download buffer can be located in the static random access memory (SRAM), dynamic random access memory (DRAM), on-chip memory, or other storage areas accessible to the hardware control module within the storage controller.

[0175] In one implementation, the storage controller can allocate a contiguous storage space as a download buffer for this whole block download operation, and write the namespace index information to be updated and multiple entries to be written into the contiguous storage space according to the organization order of the data in the download prompt mapping table.

[0176] The storage controller can also determine the base address of the download buffer, the target starting entry index, and the number of target entries.

[0177] The download buffer base address indicates the starting storage location of the prompt mapping table data to be downloaded within the download buffer. The hardware control module can locate the prompt mapping table data to be read based on the download buffer base address. The download buffer base address can be the physical address of the download buffer, the bus address, the device address, or other addresses recognizable by the hardware control module.

[0178] The target start entry index indicates the starting write position in the entry storage area of ​​the hardware hint map for this block download operation. The target entry count indicates the number of entries to be written consecutively for this block download operation.

[0179] In one implementation, the target starting entry index can be determined based on the starting entry index in the namespace index information to be updated, and the number of target entries can be determined based on the number of consecutive entries in the namespace index information to be updated. For example, if four entries to be written need to be written to entries 16 to 19 of the hardware hint mapping table, the target starting entry index can be determined to be 16, and the number of target entries can be determined to be 4.

[0180] In another implementation, a single block download operation can also be used to write multiple adjacent contiguous entry storage areas. In this case, the starting entry index of the first contiguous entry storage area can be determined as the target starting entry index, and the total number of entries to be written across the multiple adjacent contiguous entry storage areas can be determined as the target number of entries.

[0181] Therefore, the download buffer base address is used to indicate where the hardware control module reads the data from the hardware prompt mapping table to be downloaded, the target start entry index is used to indicate which entry position in the hardware prompt mapping table the hardware control module starts writing from, and the target entry number is used to indicate how many entries to be written need to be written consecutively by the hardware control module.

[0182] After determining the base address of the download buffer, the starting index of the target entry, and the number of target entries, the storage controller can initiate a block download operation to the hardware control module based on the base address of the download buffer, the starting index of the target entry, and the number of target entries.

[0183] The hardware control module refers to the hardware circuitry, processing unit, or hardware state machine within the storage controller used to perform data reading, data transfer, and hardware hint map write operations. A block download operation refers to instructing the hardware control module to continuously read multiple entries to be written from the download buffer and write these multiple entries consecutively into the hardware hint map, rather than initiating independent insert operations for each entry separately.

[0184] In one specific implementation, the storage controller firmware can issue a block download operation request to the hardware control module through hardware configuration registers, hardware command queues, or other control interfaces between the firmware and the hardware control module. The block download operation request may include an opcode indicating the type of block download operation, the base address of the download buffer, the target starting entry index, the number of target entries, and the namespace identifier or number of namespaces to be updated.

[0185] After receiving a request for a full block download operation, the hardware control module can parse the base address of the download buffer, the index of the target starting entry, and the number of target entries, and then perform the full block download operation based on the parsing results.

[0186] Specifically, the hardware control module can read the download prompt mapping table data from the download buffer based on the download buffer base address, and obtain multiple entries to be written corresponding to the target number of entries from the download prompt mapping table data. The hardware control module can determine the target starting entry index as the current write entry index, and write the first entry to be written to the entry storage location indicated by the current write entry index; after completing the writing of one entry to be written, the current write entry index is incremented, and the reading and writing of the next entry to be written continues until the number of consecutively written entries reaches the target number of entries.

[0187] For example, when the target starting entry index is 16 and the number of target entries is 4, the hardware control module can write the four entries to be written sequentially into entries 16, 17, 18 and 19 in the hardware prompt mapping table.

[0188] By using the sequential writing method described above, the arrangement of multiple entries to be written in the download buffer can be maintained in the hardware hint mapping table. That is, if multiple entries to be written are already sequentially arranged in the download buffer according to the ascending order of their respective mapped logical address ranges, then after the entire download operation is completed, the multiple entries to be written will still maintain the same arrangement order in the hardware hint mapping table.

[0189] The hardware control module can also write the namespace index information to be updated into the namespace index area corresponding to the hardware hint mapping table. The namespace index area is a dedicated storage area in the hardware hint mapping table for storing the starting entry index and the number of consecutive entries for each namespace.

[0190] In one implementation, the hardware control module can first write multiple entries to be written to the entry storage area, and then write the namespace index information to be updated to the namespace index area, so that when the query client reads the updated namespace index information, the corresponding entries have already been written. In other implementations, other write orders can also be used according to the internal consistency control mechanism of the hardware control module.

[0191] After the entire download operation is completed, the hardware control module can also provide feedback on the operation completion status to the firmware via a status register, a completion flag, or a hardware interrupt. The firmware can then confirm the completion of the operation and either enable or continue using the updated hardware prompt mapping table to perform prompt mapping information queries. Note that the above completion feedback mechanism is an optional implementation method.

[0192] Example 3 In the aforementioned Embodiment 2, the prompt mapping information can be stored in the hardware prompt mapping table of the storage controller, and entries with the same namespace identifier can be arranged in the corresponding consecutive entry storage area. The following will explain, in conjunction with Embodiment 3, how to read the entire sequence of consecutive entries from the hardware prompt mapping table into the upload buffer.

[0193] Considering that when acquiring multiple entries using a read-by-read method, it is necessary to configure an entry index, initiate a read operation, and wait for the read to complete for each entry, resulting in numerous interactions between the firmware and hardware control module in the storage controller, it is inconvenient to centrally check and manage multiple consecutive entries. In this embodiment, when multiple consecutive entries in the hardware hint mapping table need to be acquired, the upload start entry index and the number of upload entries corresponding to the consecutive entries can be determined, and the base address of the upload buffer used to store the consecutive entries can be determined. Based on the upload start entry index, the number of upload entries, and the base address of the upload buffer, the hardware control module performs a block upload operation. In this way, since the hardware control module can continuously read multiple entries in a single block upload operation and write them into the upload buffer according to the order of the multiple entries in the hardware hint mapping table, the number of operation requests and parameter configurations required for reading entries one by one can be reduced, the interaction overhead between the firmware and the hardware control module can be reduced, and it is convenient for the firmware to centrally debug, check, and manage consecutive entries.

[0194] Specifically, when the storage controller needs to read some or all entries in the hardware hint mapping table, it can first determine the consecutive entries to be uploaded, and then determine the starting entry index and the number of entries to be uploaded based on the storage location of the consecutive entries in the hardware hint mapping table.

[0195] The upload start entry index indicates the position of the first entry to be read in the hardware hint mapping table for this entire upload operation; the upload entry count indicates the number of entries to be read consecutively starting from the upload start entry index.

[0196] In one implementation, when it is necessary to upload all entries corresponding to a certain namespace identifier, the storage controller can determine the starting entry index in the namespace index information as the upload starting entry index based on the namespace index information corresponding to the namespace identifier, and determine the number of consecutive entries in the namespace index information as the number of upload entries.

[0197] For example, if the starting entry index corresponding to a certain namespace identifier is 3 and the number of consecutive entries is 7, then the starting entry index for uploading can be determined to be 3 and the number of upload entries can be determined to be 7, so as to upload entries 3 to 9 in the hardware prompt mapping table as a whole.

[0198] In another implementation, only a portion of consecutive entries in a contiguous entry storage area can be uploaded. For example, if entries corresponding to a certain namespace identifier are stored in entries 3 to 9, but only entries 5 to 7 need to be read in this instance, the starting entry index for the upload can be set to 5, and the number of entries to be uploaded can be set to 3. Therefore, this application embodiment does not limit the requirement that a single block upload operation must cover all entries corresponding to a certain namespace identifier.

[0199] The storage controller can also determine the base address of the upload buffer used to store consecutive entries. Specifically, it can determine the storage space required for this entire upload operation based on the number of upload entries and the data size of a single entry, allocate the corresponding upload buffer in the storage area accessible by the hardware control module, and determine the starting address of the upload buffer as the upload buffer base address.

[0200] For example, if a single entry occupies two double words, or 8 bytes, and the number of uploaded entries is 7, an upload buffer with a capacity of not less than 56 bytes can be allocated for this entire upload operation.

[0201] Therefore, the upload start entry index is used to indicate where the hardware control module should start reading from the hardware hint mapping table, the upload entry number is used to indicate how many consecutive entries the hardware control module needs to read, and the upload buffer base address is used to indicate where the hardware control module should write the consecutive entries it reads.

[0202] After determining the starting entry index, the number of upload entries, and the base address of the upload buffer, the storage controller can initiate a block upload operation to the hardware control module based on the starting entry index, the number of upload entries, and the base address of the upload buffer.

[0203] In one specific implementation, the firmware in the storage controller can configure the upload start entry index, the number of upload entries, and the base address of the upload buffer to the hardware control module through hardware configuration registers, hardware command queues, or other control interfaces between the firmware and the hardware control module, and configure the opcode used to represent the entire upload operation.

[0204] For example, the entire block upload operation can be recorded as an UPLD operation, with an opcode of 3'h6. Input parameters can include the starting index of the entry, the number of entries, and the buffer base address. The UPLD operation can be used to upload consecutive entries from the DSM_HINT Table to a specified buffer for firmware debugging and management. The above opcode and interface parameter formats are only one specific implementation method.

[0205] After receiving a request for a block upload operation, the hardware control module can parse the starting entry index, the number of upload entries, and the base address of the upload buffer, and then perform the block upload operation based on the parsing results.

[0206] Specifically, the hardware control module can determine the upload start entry index as the current read entry index, read the complete entry data of the entry corresponding to the current read entry index from the hardware prompt mapping table, and write the read entry to the storage location indicated by the upload buffer base address.

[0207] After completing the reading and writing of an entry, the hardware control module can increment the index of the currently read entry and increment the current write address in the upload buffer according to the data volume of a single entry, and continue to read and write the next entry until the number of entries written to the upload buffer reaches the number of upload entries.

[0208] For example, if the starting entry index is 3 and the number of entries to be uploaded is 7, the hardware control module can read entries 3, 4, 5, 6, 7, 8 and 9 from the hardware prompt mapping table in sequence, and write the above seven consecutive entries into the upload buffer in the same order.

[0209] If i represents the entry number starting from zero, and E represents the data size of a single entry, then the starting write position of the i-th consecutive entry in the upload buffer can be determined by the position after offset i×E from the base address of the upload buffer.

[0210] Through the above processing, consecutive entries in the hardware prompt mapping table, starting from the upload start entry index and corresponding to the number of upload entries, can be written into the upload buffer in a single block upload operation, and the order of consecutive entries in the hardware prompt mapping table can be maintained in the upload buffer.

[0211] Optionally, after the entire block upload operation is completed, the hardware control module can report the completion status of the entire block upload operation to the firmware through a completion flag, a status register, or a hardware interrupt. Once the firmware confirms the completion of the entire block upload operation, it can read consecutive entries in the upload buffer to perform status checks, data consistency verification, firmware debugging, or fault diagnosis on the prompt mapping information in the hardware prompt mapping table.

[0212] Example 4 In some embodiments, before querying the stored hint mapping information based on the target logical address range, such as Figure 5 As shown, it can also be determined whether the dataset management field of the read / write command to be processed has a valid dataset management hint attribute configured. If a valid dataset management hint attribute is configured, the valid dataset management hint attribute carried by the read / write command to be processed is used directly. If no valid dataset management hint attribute is configured, it is further determined whether to query hint mapping information based on the current load characteristics of the storage controller. When the hint mapping query status is enabled, the read / write command to be processed is identified as the target read / write command. When the hint mapping query status is disabled, the hint mapping information query for the read / write command to be processed is skipped, and flash translation layer processing is performed on the read / write command to be processed according to preset attributes. Specifically, when the current load characteristics indicate that the storage controller is in a high load state, the hint mapping query status is determined to be disabled; when the current load characteristics indicate that the storage controller is in a low load state, the hint mapping query status is determined to be enabled.

[0213] Specifically, the storage controller can receive read and write commands to be processed through the host interface and parse the read and write commands to obtain the dataset management fields from the read and write commands.

[0214] Here, "read / write commands to be processed" refers to read or write commands that have been received by the storage controller but for which it has not yet been determined whether querying hint mapping information is required. "Target read / write commands" are those selected from the pending read / write commands that require querying hint mapping information according to the aforementioned embodiments.

[0215] After obtaining the dataset management field, the storage controller can determine whether the read / write command to be processed has a valid dataset management hint attribute configured based on the dataset management field.

[0216] In one specific implementation, a valid attribute code range or a valid attribute code set can be pre-defined. The storage controller can determine whether the attribute code in the dataset management field belongs to the valid attribute code range or valid attribute code set. When the attribute code can be recognized by the storage controller and can be used to guide the flash translation layer processing, it can be determined that the read / write command to be processed has a valid dataset management hint attribute configured; otherwise, it can be determined that the read / write command to be processed does not have a valid dataset management hint attribute configured.

[0217] For example, a value of 0 in the dataset management field can be used as a condition for determining that a dataset management prompt attribute is invalid, while a non-zero valid code in the dataset management field can be used as a condition for determining that a valid dataset management prompt attribute is configured. It should be noted that this method is merely an example; in other implementations, the determination can also be made based on valid flags, reserved codes, or attribute code ranges specified in the protocol.

[0218] If the dataset management field determines that the pending read / write command has a valid dataset management hint attribute, the storage controller can skip querying the hint mapping information for the pending read / write command because the valid dataset management hint attribute in the dataset management field can provide a clear processing basis for the flash translation layer processing of the pending read / write command.

[0219] Secondly, if the dataset management field indicates that the pending read / write command lacks a valid dataset management hint attribute, directly using preset attributes may not fully utilize the stored hint mapping information. Furthermore, querying the hint mapping information for each pending read / write command when the storage controller is under high load would increase the overhead of accessing the hardware hint mapping table and processing the query results. To avoid these problems, in some embodiments, the storage controller can obtain its current load characteristics.

[0220] Current load characteristics may include one or more of the following: the number of pending commands, the occupancy of the input / output command queues, the number of incomplete read / write commands, processor utilization, hardware task queue occupancy, current average command processing latency, and current data transfer bandwidth utilization. The storage controller can obtain current load characteristics through internal performance counters, queue status registers, or load statistics maintained by firmware.

[0221] After obtaining the current load characteristics, the storage controller can determine the hint mapping query status based on these characteristics. The hint mapping query status includes an enabled state and a disabled state. An enabled state indicates that hint mapping information can be queried for the currently pending read / write command, while a disabled state indicates that hint mapping information queries for the currently pending read / write command are skipped.

[0222] In one implementation, a corresponding load determination threshold can be set for the current load characteristic. For example, when the occupancy of the input / output command queue reaches or exceeds a preset load threshold, it can be determined that the current load characteristic indicates that the storage controller is in a high-load state; when the occupancy of the input / output command queue is lower than the preset load threshold, it can be determined that the current load characteristic indicates that the storage controller is in a low-load state.

[0223] In another implementation, the current load state can be determined based on multiple load metrics. For example, when the number of pending read / write commands exceeds a first load threshold, or the processor utilization exceeds a second load threshold, the storage controller can be determined to be under high load; when the number of pending read / write commands does not exceed the first load threshold and the processor utilization does not exceed the second load threshold, the storage controller can be determined to be under low load.

[0224] When the current load characteristics indicate that the storage controller is under high load, the storage controller can disable the hint mapping query state. At this time, the storage controller can skip the hint mapping information query for the pending read / write command and perform flash translation layer processing on the pending read / write command according to preset attributes.

[0225] In one implementation, preset attributes can be loaded into the flash translation layer description information corresponding to the read / write command to be processed, and then flash translation layer processing can be performed according to the flash translation layer description information loaded with preset attributes. In another implementation, the read / write command to be processed can directly enter the default flash translation layer processing path corresponding to the preset attributes, without needing to explicitly write attribute codes into the flash translation layer description information.

[0226] Preset attributes can be used to indicate that special processing strategies targeting specific access frequencies, access modes, or latency requirements will not be adopted, and that pending read / write commands will be processed according to the general flash memory translation layer processing strategy. Since the pending read / write command does not enter the prompt mapping information query process, it will not be identified as the target read / write command in this processing branch.

[0227] When the current load characteristics indicate that the storage controller is in a low-load state, the storage controller can determine the hint mapping query status to be enabled and identify the pending read / write commands as the target read / write commands.

[0228] It should be noted that identifying the pending read / write command as the target read / write command here means identifying the pending read / write command as the read / write command that needs to enter the prompt mapping information query process, rather than regenerating or replacing the original read / write command.

[0229] After identifying the read / write command to be processed as the target read / write command, the storage controller can determine the target logical address range based on the target read / write command, query the storage hint mapping information based on the target logical address range, and determine the target dataset management hint attributes based on the query results. The above-described process of determining the target logical address range and querying the hint mapping information has been described in the preceding embodiments and will not be repeated here.

[0230] Through the above processing, three read / write command processing paths can be formed: The first processing path involves read / write commands with valid dataset management hint attributes. In this case, the hint mapping information query is skipped, and the valid dataset management hint attributes in the dataset management field are directly loaded into the corresponding flash conversion layer description information, and flash conversion layer processing is performed accordingly.

[0231] The second processing path is when the pending read / write command does not have a valid dataset management hint attribute configured, and the storage controller is under low load. In this case, the hint mapping query status is set to enabled, and the pending read / write command is identified as the target read / write command to initiate the hint mapping information query process.

[0232] The third processing path is when the read / write command to be processed does not have a valid dataset management hint attribute configured, and the storage controller is under high load. In this case, the hint mapping query status is set to disabled, the hint mapping information query is skipped, and the read / write command to be processed is processed by the flash translation layer according to the preset attributes.

[0233] The above three processing paths can prioritize the use of valid dataset management hint attributes carried by the read / write commands themselves, supplement the corresponding dataset management hint attributes for read / write commands that do not carry valid dataset management hint attributes by using hint mapping information when the storage controller has sufficient processing resources, and avoid further increasing command processing overhead by querying hint mapping information under high load conditions.

[0234] Example 5 In some embodiments, considering that the storage area where the hardware hint mapping table is located may stop receiving power after the storage controller enters the PS4 state, which may result in the loss of hint mapping information in the hardware hint mapping table, and that restoring each entry one by one after exiting the PS4 state requires multiple write operations, it is easy to increase the exit delay of the PS4 state.

[0235] To avoid the aforementioned problems, this embodiment of the application, when maintaining the hint mapping information, can store the backup data of the hint mapping table corresponding to the hint mapping information in a normally open storage area. When the storage controller exits PS4 state, the hardware control module loads the entire backup data of the hint mapping table into the hardware hint mapping table. In this way, since the normally open storage area can still maintain the backup data of the hint mapping table in PS4 state, and multiple entries can be restored through a single block recovery operation, the number of operations required to restore each entry individually and the software / hardware interaction overhead can be reduced, shortening the recovery time of the hardware hint mapping table. Simultaneously, by re-enabling the hint mapping information query only after confirming that all the backup data of the hint mapping table has been loaded, the read / write command query for the incompletely restored hardware hint mapping table can be avoided, improving the reliability of the query results.

[0236] Specifically, the storage controller can generate backup data for the hint mapping table based on the currently valid hint mapping information, and store the backup data in the normally open storage area. The backup data can be formed according to the data layout adopted by the hardware hint mapping table, and may include namespace index information and multiple entries from the hardware hint mapping table, so that the hardware hint mapping table can be reconstructed subsequently based on the backup data.

[0237] A normally open storage area refers to a storage area that retains stored data even after the storage controller enters the PS4 state. In one specific implementation, the normally open storage area can be an AON area, i.e., an Always-On area. The storage controller's firmware can store its maintained hint mapping table data in the normally open storage area, allowing the hint mapping table data to be retained during the PS4 state.

[0238] During the operation of the storage controller, when the hint mapping information is updated, the backup data of the hint mapping table in the normally open storage area can be updated synchronously. For example, when adding an entry, modifying the mapping logical address range or dataset management hint attributes of an entry, invalidating an entry, adjusting the arrangement of entries, or updating namespace index information, the corresponding updated content can be synchronously written to the hint mapping table backup data.

[0239] Synchronous updates here refer to ensuring that the hint mapping table backup data is consistent with the currently effective hint mapping information, without requiring the hardware hint mapping table and the normally open memory area to be written in exactly the same clock cycle. In one implementation, only the changed parts of the hint mapping table backup data can be updated; in another implementation, the complete hint mapping table backup data can be regenerated based on the updated hint mapping information.

[0240] Therefore, before the storage controller enters the PS4 state, the normally open storage area stores backup data of the prompt mapping table corresponding to the current prompt mapping information, thus avoiding the restoration of an invalid historical version after exiting the PS4 state.

[0241] When the storage controller switches from PS4 state to working state, it can respond to the storage controller exiting PS4 state by obtaining the backup data base address and backup data volume of the backup data in the normally open storage area of ​​the prompt mapping table.

[0242] The backup data base address indicates the starting storage location of the hint mapping table backup data in the normally open storage area, and the backup data volume indicates the amount of hint mapping table backup data stored contiguously starting from the backup data base address. The backup data volume can be represented in bytes, double words, or other data units supported by the hardware control module.

[0243] In one specific implementation, DSM_HINT_TBL_BADR can be used to represent the backup data base address, and this parameter can be 32 bits; DSM_HINT_TBL_SIZE can be used to represent the backup data volume, and this parameter can be 10 bits, with double words as the data volume unit. The above parameters can be pre-recorded in a configuration area that the storage controller can read after exiting the PS4 state.

[0244] After obtaining the backup data base address and backup data volume, the storage controller can initiate a block-wide recovery operation to the hardware control module based on these parameters. Specifically, the firmware in the storage controller can configure the backup data base address and backup data volume to the hardware control module through configuration registers, hardware command queues, or other software and hardware control interfaces, and then send a recovery startup command to the hardware control module.

[0245] A block recovery operation refers to instructing the hardware control module to continuously read the backup data from the prompt mapping table corresponding to the amount of backup data from the normally open storage area through a single recovery operation request, and then loading the read data into the hardware prompt mapping table as a whole, instead of initiating an insert operation for each entry separately.

[0246] After receiving a request for a full recovery operation, the hardware control module can start from the location indicated by the backup data base address, read data continuously according to the order of the backup data in the prompt mapping table, and load the read backup data in the prompt mapping table into the corresponding storage area in the hardware prompt mapping table.

[0247] For example, if the hint mapping table backup data includes namespace index information and multiple entries, the hardware control module can load the namespace index information into the namespace index area of ​​the hardware hint mapping table and load the multiple entries into the entry storage area of ​​the hardware hint mapping table. Since the hint mapping table backup data is formed according to the data layout of the hardware hint mapping table, the hardware control module does not need to parse and insert each entry individually; instead, it can complete the restoration of the hardware hint mapping table through continuous data transfer.

[0248] In one alternative implementation, the hardware control module can perform the entire block recovery operation via a direct memory access unit or a dedicated data transfer circuit to reduce the number of times the firmware is involved in data transfer. Specifically, the hardware can directly complete the recovery of the entire DSM_HINT Table and can accelerate the transfer of hint mapping table data through a dedicated DMA engine.

[0249] During the full recovery operation, hint mapping information queries based on the hardware hint mapping table can be kept disabled. In other words, even if the storage controller has exited PS4 state, target read / write commands are not allowed to access the hardware hint mapping table until all the hint mapping table backup data has been loaded into the hardware hint mapping table, in order to avoid querying hint mapping information that indicates only a partial recovery has been completed.

[0250] When the hardware control module determines that the amount of data read and loaded has reached the amount of backup data, it can indicate that the mapping table backup data loading is complete and generate a recovery completion notification.

[0251] The recovery completion notification can take the form of a hardware interrupt, a completion flag, a status register, or an operation completion response. For example, in some embodiments, the hardware control module can notify the firmware via a hardware interrupt after completing the entire recovery.

[0252] In response to a recovery completion notification, the storage controller can enable hint mapping information queries based on the hardware hint mapping table. For example, it can enable the query enable flag corresponding to the hardware hint mapping table, remove the query prohibition state for the hardware hint mapping table, or allow the read / write command processing flow to re-invoke the query function of the hardware hint mapping table.

[0253] After re-enabling the hint mapping information query, when the storage controller receives a target read / write command that requires querying hint mapping information, it can determine the corresponding target dataset management hint attributes based on the restored hardware hint mapping table.

[0254] Optionally, before enabling the prompt mapping information query, the integrity of the restored hardware prompt mapping table can be verified based on the verification information corresponding to the backup data of the prompt mapping table. If the verification passes, the prompt mapping information query is enabled; if the verification fails, the prompt mapping information query remains disabled, and the full block recovery operation is re-executed or read / write commands are handled using preset attributes.

[0255] Example 6 The following describes how the methods provided in the embodiments of this application are applied in practice, taking into account real-world scenarios.

[0256] Please see Figure 6 This diagram illustrates an application flow of the method provided in this application embodiment. The flow includes a stage for generating and updating prompt mapping information and a stage for applying the prompt mapping information. Specifically, in the stage for generating and updating prompt mapping information, prompt mapping information can be generated or updated based on dataset management commands issued by the host or based on the access feature recognition results of input / output access records, and the generated or updated prompt mapping information is configured in the hardware prompt mapping table. In the stage for applying the prompt mapping information, the processing path for the read / write command to be processed can be determined based on the dataset management field of the read / write command to be processed, the queryable status of the hardware prompt mapping table, and the current load characteristics of the storage controller. Flash conversion layer processing is then performed based on the corresponding dataset management prompt attributes, including the dataset management command update path, the input / output access pattern recognition path, and the dataset management prompt attribute loading path for the read / write command.

[0257] Specifically, the host can issue a dataset management command to the storage controller. Upon receiving the dataset management command, the storage controller can initiate dataset management command processing and retrieve at least one dataset range description item carried by the dataset management command. When the dataset management command carries multiple dataset range description items, the storage controller can retrieve and process each dataset range description item sequentially according to their order of appearance in the dataset management command.

[0258] For the currently acquired dataset range description, the storage controller can determine whether the dataset range description is valid. For example, it can determine whether the logical address length in the dataset range description is a valid length, or whether the corresponding dataset range description is set to a valid state. If the dataset range description is invalid, it can skip the current dataset range description and continue to acquire the next dataset range description; if the dataset range description is valid, it can retrieve the starting configuration logical address, configuration logical address length, and configuration dataset management hint attributes from the dataset range description.

[0259] In one specific implementation, configuration dataset management hints can be carried in the context attribute field of the dataset scope description item. For example, Figure 6 The “DSM range CATTR bit 0-7” shown can be the field location used to carry configuration dataset management hint attributes. The storage controller can parse the corresponding field and determine whether the field contains valid configuration dataset management hint attributes.

[0260] If the dataset scope description already carries a valid configuration dataset management hint attribute, the storage controller can directly use that configuration dataset management hint attribute. If the dataset scope description does not carry a valid configuration dataset management hint attribute, the storage controller may optionally query a pre-maintained dataset management hint attribute record pool to determine if a valid dataset management hint attribute exists applicable to the current dataset scope description.

[0261] The dataset management hint attribute record pool can be used to store dataset management hint attributes obtained based on historical input / output access patterns, as well as the logical address range or data access characteristics corresponding to each dataset management hint attribute. If a valid record matching the current dataset range description item exists in the dataset management hint attribute record pool, the dataset management hint attribute in the corresponding valid record can be used as the configuration dataset management hint attribute corresponding to the current dataset range description item; if no matching valid record exists, the hint mapping information can be updated without using the current dataset range description item, and the next dataset range description item can be obtained.

[0262] After determining the configuration dataset management hint attribute corresponding to the current dataset range description item, the storage controller can determine the configuration logical address range based on the starting configuration logical address and the configuration logical address length, and generate or update hint mapping information based on the configuration logical address range and the configuration dataset management hint attribute.

[0263] When generating or updating hint mapping information, the storage controller can compare the configured logical address range with the mapped logical address range of existing entries in the hint mapping information.

[0264] If the configured logical address range overlaps with the mapped logical address range of an existing entry, and both correspond to the same dataset management hint attribute, the configured logical address range and the mapped logical address range of the existing entry can be merged, and the corresponding entry can be updated based on the merged logical address range. By merging adjacent or overlapping logical address ranges with the same dataset management hint attribute, duplicate entries can be reduced.

[0265] When the configured logical address range overlaps with the mapped logical address range of existing entries, but the corresponding dataset management hint attributes are different, the configured logical address range and the mapped logical address range of existing entries can be segmented according to the logical address portion applicable to each dataset management hint attribute. The corresponding entries can then be generated or updated based on the segmentation results. This avoids incorrectly applying a dataset management hint attribute to a logical address portion that should use a different dataset management hint attribute.

[0266] If the configured logical address range does not overlap with the mapped logical address range of an existing entry, a new entry can be generated that includes the configured logical address range and the configured dataset management prompt attribute. If the configured dataset management prompt attribute is a preset attribute that does not need to be recorded separately in the prompt mapping information, a new entry may not be generated.

[0267] After processing the current dataset range descriptor, the storage controller can retrieve the next dataset range descriptor and repeat the above process until all dataset range descriptors in the dataset management command have been processed. Afterward, the mapping information update process can be terminated, and the corresponding commands for the dataset management command can be executed to complete the processing.

[0268] In addition to generating or updating prompt mapping information based on dataset management commands, the storage controller can also obtain input and output access records recorded during historical monitoring periods, analyze the input and output access records, and obtain access feature identification results corresponding to at least one candidate logical address range based on the logical address and access attribute information in each input and output access record.

[0269] Access feature identification results can characterize the access frequency, access latency requirements, sequential access characteristics, random access characteristics, or read / write tendencies of a corresponding candidate logical address range. For example, hot and cold data can be identified based on the number of accesses within a certain time range, sequential or random access can be identified based on the changing relationship between adjacent access logical addresses, and latency sensitivity can be identified based on historical command processing latency. The identification content can include access frequency classification, sequential or random access identification, read / write tendencies, and access latency requirement evaluation.

[0270] The storage controller can determine the dataset management hint attributes corresponding to the candidate logical address ranges based on the access feature identification results, and generate or update hint mapping information based on the candidate logical address ranges and the corresponding dataset management hint attributes. For example, dataset management hint attributes can be determined for candidate logical address ranges that are frequently accessed and latency-sensitive to characterize high-frequency access and low-latency requirements, and dataset management hint attributes can be determined for candidate logical address ranges that have sequential access characteristics to characterize sequential access.

[0271] In one implementation, the access feature recognition module that analyzes input and output access records can be located within the storage controller, and the recognized dataset management prompt attributes can be directly used to generate or update prompt mapping information. In another implementation, access feature recognition can also be performed by the host, which can generate dataset management commands based on the recognition results and send the corresponding dataset management prompt attributes to the storage controller through the dataset scope description item.

[0272] For hint mapping information generated or updated through dataset management commands or input / output access record analysis, the storage controller can arrange and sort the entries sequentially according to the aforementioned data organization method, and generate or update the corresponding namespace index information. Subsequently, the storage controller can configure the generated or updated hint mapping information into the hardware hint mapping table through the hardware configuration interface.

[0273] For example, the firmware in the storage controller can send the entries to be written and their corresponding namespace index information to the hardware control module through the hardware hint mapping configuration interface shown in the figure. The hardware control module then writes these entries into the hardware hint mapping table. Thus, both the dataset management hint attributes configured by the host through dataset management commands and the dataset management hint attributes determined by the storage controller based on input / output access records can be uniformly stored in the hardware hint mapping table and used by subsequent read / write commands.

[0274] After generating and updating the prompt mapping information, the host can issue pending read / write commands to the storage controller. The storage controller can receive the pending read / write commands through the command receiving module, and the command processing module can parse the pending read / write commands to obtain the dataset management fields from them.

[0275] The storage controller can determine whether the read / write command to be processed has a valid dataset management hint attribute based on the dataset management field.

[0276] If the storage controller determines that the pending read / write command has a valid dataset management hint attribute, it can skip querying the hint mapping information for the pending read / write command and load the valid dataset management hint attribute from the dataset management field into the flash translation layer description information corresponding to the pending read / write command. Therefore, the dataset management hint attribute provided by the host for the current pending read / write command can be used directly without repeatedly accessing the hardware hint mapping table.

[0277] If it is determined that the pending read / write command is not configured with a valid dataset management hint attribute, the storage controller can further determine whether the hardware hint mapping table has query conditions and determine the hint mapping query status based on the current load characteristics of the storage controller.

[0278] For example, when the hardware hint mapping table has not yet been fully restored due to the storage controller exiting the PS4 state, hint mapping information queries based on the hardware hint mapping table can remain disabled until the hardware hint mapping table is fully restored. When the current load characteristics indicate that the storage controller is under high load, the hint mapping query status can also be set to disabled; when the hardware hint mapping table has been fully restored and the current load characteristics indicate that the storage controller is under low load, the hint mapping query status can be set to enabled.

[0279] When the prompt mapping query status is disabled, the storage controller can skip the prompt mapping information query for the pending read / write command and perform flash translation layer processing on the pending read / write command according to preset attributes.

[0280] When the prompt mapping query status is enabled, the storage controller can identify the pending read / write command as the target read / write command, determine the target logical address range based on the target read / write command, and query the hardware prompt mapping table based on the target logical address range.

[0281] If the hint mapping information further includes a namespace identifier, the storage controller can also obtain the target namespace identifier from the target read / write command and query the hardware hint mapping table based on the target namespace identifier and the target logical address range. The query operation of the hardware hint mapping table can determine the entry that matches the target logical address range based on the target namespace identifier, the starting logical address of the target logical address range, and the corresponding address length.

[0282] When a query finds at least one entry, the storage controller can read the dataset management hint attribute from the at least one entry and determine the target dataset management hint attribute corresponding to the target read / write command. When no entry is found, a preset attribute can be set as the target dataset management hint attribute.

[0283] When the entire target logical address range hits an entry, the dataset management hint attribute in the hit entry can be loaded into the flash translation layer description information corresponding to the target read / write command.

[0284] When the target logical address range only partially hits one entry, or when the target logical address range spans multiple entries, the flash translation layer description information corresponding to the target read / write command can be divided into corresponding hit flash translation layer description information and miss flash translation layer description information according to each hit sub-range and miss sub-range. For hit flash translation layer description information, the dataset management hint attribute in the corresponding hit entry can be loaded; for miss flash translation layer description information, preset attributes can be loaded.

[0285] After the dataset management hint attributes are loaded, the storage controller can perform flash conversion layer processing on the corresponding read and write commands based on the dataset management hint attributes loaded in the description information of each flash conversion layer.

[0286] Specifically, the corresponding flash conversion layer processing chain can be determined based on the dataset management prompt attributes. Flash conversion layer description information with the same dataset management prompt attributes can be chained to the same flash conversion layer processing chain, while flash conversion layer description information with different dataset management prompt attributes can be chained to different flash conversion layer processing chains. If no flash conversion layer processing chain corresponds to a particular dataset management prompt attribute, a flash conversion layer processing chain corresponding to that dataset management prompt attribute can be established.

[0287] Through the corresponding flash memory conversion layer processing chain, the corresponding data can be mapped from logical address to physical address, read or write data according to the logical address, address length and read / write type in the flash memory conversion layer description information, and perform corresponding data classification and data placement processing according to the dataset management prompt attributes.

[0288] For example, when a dataset management hint attribute indicates that the corresponding data has high-frequency access or low-latency requirements, the data can be placed in a storage area with high access performance; when a dataset management hint attribute indicates that the corresponding data is low-frequency access data, the data can be placed in a storage area suitable for long-term storage. In the illustrated embodiment, the corresponding data can be placed in an eSLC storage area or a TLC storage area according to different dataset management hint attributes. In some embodiments, when the dataset management field of a read / write command is valid, the dataset management hint attribute in the command can be used directly; when the dataset management field is invalid and the hardware hint mapping table query hits, the dataset management hint attribute in the hit entry can be filled into the corresponding flash conversion layer description information, and the flash conversion layer independent chaining can be performed according to the loaded attribute.

[0289] After completing the flash translation layer processing of the pending read / write commands, the storage controller can also record the input / output access records generated during this processing and use these records for subsequent access feature analysis. As the input / output access patterns change, the storage controller can redetermine the dataset management hint attributes corresponding to each candidate logical address range and update the hint mapping information and hardware hint mapping table accordingly.

[0290] Therefore, this embodiment forms a closed-loop processing procedure consisting of input / output access record analysis, dataset management prompt attribute determination, prompt mapping information generation or update, hardware prompt mapping table configuration, dataset management prompt attribute loading of read / write commands, and flash memory conversion layer processing. This enables read / write commands that do not carry valid dataset management prompt attributes to obtain matching dataset management prompt attributes based on their logical address range, and allows the prompt mapping information to be dynamically updated as the actual input / output access characteristics change.

[0291] Example 7 To address the problems in existing technologies where dataset management prompts rely on host-based command-by-command configuration, resulting in a heavy host configuration burden and difficulty for storage controllers to implement targeted flash memory translation layer processing, this application provides a read / write command processing device. A schematic diagram of the specific structure of this device is shown below. Figure 7 As shown, it includes a receiving module 71, a query module 72, a loading module 73, and a processing module 74. The functions of each module are as follows: The receiving module 71 is used to receive target read / write commands and determine the target logical address range based on the target read / write commands; The query module 72 is used to query the stored prompt mapping information based on the target logical address range, and determine the target dataset management prompt attribute corresponding to the target read / write command based on the query results; wherein, the prompt mapping information is used to characterize the mapping relationship between the logical address range and the dataset management prompt attribute; Loading module 73 is used to load the target dataset management prompt attributes into the flash conversion layer description information corresponding to the target read / write command; Processing module 74 is used to perform flash conversion layer processing on target read / write commands based on flash conversion layer description information loaded with target dataset management prompt attributes.

[0292] The read / write command processing device provided in this application is used to implement any of the foregoing method embodiments. Other optional steps in the foregoing method embodiments can be executed by modules with corresponding functions within this device, and their specific implementation processes will not be repeated.

[0293] Furthermore, the read / write command processing device provided in this application embodiment is based on the same inventive concept as the aforementioned method embodiment 1, and its implementation principle and technical effect are the same. For details, please refer to the aforementioned method embodiment 1, which will not be repeated here.

[0294] Example 8 Figure 8 A schematic diagram of the hardware structure of a storage controller for implementing various embodiments of this application is shown. Figure 8As shown, the storage controller may include a processor 801, a memory 802, a communication interface 803, and a bus 810, wherein the processor 801, the memory 802, and the communication interface 803 are connected via the bus 810.

[0295] The processor 801 is used to control and process data from the memory controller. The processing functions of the memory controller can be implemented by a programmable processing unit executing a computer program, by dedicated hardware logic circuitry, or by a combination of the programmable processing unit and dedicated hardware logic circuitry. For ease of explanation, Figure 8 The programmable processing unit and dedicated hardware logic circuits used to implement the above processing functions are collectively referred to as processor 801.

[0296] The memory 802 is used to store computer program instructions and data used during the operation of the storage controller. In some embodiments, the computer program instructions may include firmware corresponding to the storage controller. The firmware may be stored in the program storage area and loaded into the runtime storage area when the storage controller starts up, and read and executed by the programmable processing unit in the processor 801. For processing functions implemented by dedicated hardware logic circuits, they can be executed directly by the corresponding dedicated hardware logic circuits without the programmable processing unit executing the corresponding program instructions one by one.

[0297] The communication interface 803 is used to enable communication between the storage controller and other components or devices. The bus 810 is used to transmit data and control information between the processor 801, the memory 802, and the communication interface 803. The processor 801 causes the storage controller to execute the read / write command processing method provided in any of the foregoing embodiments by reading and executing computer program instructions stored in the memory 802, and / or by running the dedicated hardware logic circuit.

[0298] Furthermore, in conjunction with the read / write command processing methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the read / write command processing methods in the above embodiments.

[0299] It should be noted that the above description is only an exemplary implementation of this application. The specific working process of the system, module and unit can be referred to the method embodiment, and will not be repeated here.

[0300] Secondly, those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0301] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for processing read and write commands, characterized in that, Applied to a storage controller, the method includes: Receive target read / write commands and determine the target logical address range based on the target read / write commands; The stored prompt mapping information is queried according to the target logical address range, and the target dataset management prompt attribute corresponding to the target read / write command is determined according to the query result; wherein, the prompt mapping information is used to characterize the mapping relationship between the logical address range and the dataset management prompt attribute; Load the target dataset management prompt attributes into the flash conversion layer description information corresponding to the target read / write command; Based on the flash conversion layer description information loaded with the target dataset management prompt attributes, perform flash conversion layer processing on the target read / write command; Wherein, if the query result indicates that the target logical address range partially overlaps with the mapping logical address range of at least one hit entry in the prompt mapping information, the step of loading the target dataset management prompt attribute into the flash translation layer description information corresponding to the target read / write command includes: Based on the overlap between the target logical address range and the mapped logical address range of each hit entry, the flash memory translation layer description information corresponding to the target read / write command is divided into hit flash memory translation layer description information corresponding to the hit portion and miss flash memory translation layer description information corresponding to the miss portion. The dataset management hint attribute in the hit entry is loaded into the hit flash conversion layer description information, and the preset attribute is loaded into the miss flash conversion layer description information.

2. The method as described in claim 1, characterized in that, Before querying the stored hint mapping information based on the target logical address range, the method further includes: Receive a dataset management command and obtain at least one dataset scope description item carried by the dataset management command; Obtain the starting configuration logical address, configuration logical address length, and configuration dataset management prompt attributes from the dataset range description item; The configuration logical address range is determined based on the starting configuration logical address and the configuration logical address length; Generate or update the prompt mapping information based on the configured logical address range and the configured dataset management prompt attributes.

3. The method as described in claim 1, characterized in that, Before querying the stored hint mapping information based on the target logical address range, the method further includes: Obtain the input / output access records recorded by the storage controller during the historical monitoring period; wherein, the input / output access records include logical addresses and access attribute information corresponding to the logical addresses; The input and output access records are analyzed, and based on the logical address and the access attribute information, at least one access feature identification result corresponding to a candidate logical address range is obtained. Based on the access feature identification results, determine the dataset management prompt attribute corresponding to the candidate logical address range; Based on the candidate logical address range and the corresponding dataset management prompt attributes, generate or update the prompt mapping information.

4. The method as described in claim 1, characterized in that, The prompt mapping information is used to represent the mapping relationship between namespace identifier, logical address range and dataset management prompt attributes; The step of querying the stored hint mapping information based on the target logical address range includes: Obtain the target namespace identifier from the target read / write command; The prompt mapping information is queried based on the target namespace identifier and the target logical address range.

5. The method as described in claim 4, characterized in that, The prompt mapping information includes namespace index information and multiple entries, each of which includes a namespace identifier, a mapping logical address range, and a dataset management prompt attribute; The method further includes: Entries with the same namespace identifier are arranged in a contiguous entry storage area, and the entries in the contiguous entry storage area are sorted in ascending order of the starting logical address of the mapped logical address range of each entry. Based on the consecutive entry storage area corresponding to each namespace identifier, determine the starting entry index and the number of consecutive entries corresponding to each namespace identifier; The namespace index information is generated or updated based on the starting entry index and the number of consecutive entries corresponding to each namespace identifier.

6. The method as described in claim 5, characterized in that, The method further includes: Obtain the namespace index information to be updated and multiple entries to be written, and generate download prompt mapping table data based on the namespace index information to be updated and the multiple entries to be written; wherein, the multiple entries to be written are arranged consecutively according to the corresponding consecutive entry storage area; Write the data of the download prompt mapping table to the download buffer, and determine the base address of the download buffer, the target starting entry index, and the number of target entries; Based on the download buffer base address, the target start entry index, and the number of target entries, a block download operation is initiated to the hardware control module in the storage controller. The hardware control module executes the block download operation, continuously writing the entries corresponding to the target number of entries in the download buffer into the entry storage area of ​​the hardware hint mapping table starting from the target start entry index, and writing the namespace index information to be updated into the namespace index area corresponding to the hardware hint mapping table; wherein, the hint mapping information is stored in the hardware hint mapping table in the storage controller, and the hardware hint mapping table can be accessed by the hardware module in the storage controller.

7. The method as described in claim 5, characterized in that, The method further includes: The upload starting entry index and the number of upload entries corresponding to the consecutive entries to be uploaded in the hardware prompt mapping table in the storage controller are determined, and the base address of the upload buffer used to store the consecutive entries is determined; wherein, the prompt mapping information is stored in the hardware prompt mapping table in the storage controller, and the hardware prompt mapping table can be accessed by the hardware module in the storage controller; Based on the upload start entry index, the number of upload entries, and the upload buffer base address, a block upload operation is initiated to the hardware control module in the storage controller. The hardware control module executes the block upload operation, writing the consecutive entries in the hardware prompt mapping table, starting from the upload start entry index and corresponding to the number of upload entries, into the upload buffer.

8. The method as described in claim 5, characterized in that, The step of querying the hint mapping information based on the target namespace identifier and the target logical address range includes: Based on the target namespace identifier, query the namespace index information to obtain the target starting entry index and the number of consecutive target entries corresponding to the target namespace identifier; Based on the target starting entry index and the number of consecutive target entries, determine the target entry query range corresponding to the target namespace identifier; Based on the starting logical address of the target logical address range, perform a binary search on the entries arranged in ascending order of the starting logical address within the target entry query interval to determine the initial candidate entries; Starting from the initial candidate entries, and following the order in which the entries are arranged, determine the hit entries that intersect with the target logical address range; If at least one hit entry is identified, the target dataset management prompt attribute is determined based on the dataset management prompt attribute in the at least one hit entry; If no matching entry is found, the preset attribute will be set as the target dataset management prompt attribute.

9. The method as described in claim 1, characterized in that, The target read / write command is a read / write command selected from the read / write commands to be processed, and the method further includes: Receive pending read / write commands and obtain the dataset management field from the pending read / write commands; Based on the dataset management field, determine whether the read / write command to be processed is configured with a valid dataset management prompt attribute; If it is determined from the dataset management field that the pending read / write command has not been configured with a valid dataset management prompt attribute, the current load characteristics of the storage controller are obtained, and the prompt mapping query status is determined based on the current load characteristics; If the prompt mapping query status is enabled, the pending read / write command will be identified as the target read / write command. When the prompt mapping query status is disabled, skip the prompt mapping information query for the pending read / write command, and perform flash conversion layer processing on the pending read / write command according to preset attributes; Specifically, when the current load characteristic indicates that the storage controller is in a high load state, the prompt mapping query state is determined to be the disabled state; when the current load characteristic indicates that the storage controller is in a low load state, the prompt mapping query state is determined to be the enabled state.

10. The method as described in claim 9, characterized in that, The method further includes: If it is determined from the dataset management field that the pending read / write command has a valid dataset management prompt attribute, skip the prompt mapping information query for the pending read / write command; The valid dataset management hint attribute in the dataset management field is loaded into the flash conversion layer description information corresponding to the read / write command to be processed, and flash conversion layer processing is performed on the read / write command to be processed according to the flash conversion layer description information loaded with the valid dataset management hint attribute.

11. The method as described in claim 1, characterized in that, The step of performing flash conversion layer processing on the target read / write command based on the flash conversion layer description information loaded with the target dataset management prompt attributes includes: Based on the target dataset management prompt attribute, determine the target flash conversion layer processing chain corresponding to the target dataset management prompt attribute; wherein, the same dataset management prompt attribute corresponds to the same flash conversion layer processing chain, and different dataset management prompt attributes correspond to different flash conversion layer processing chains; If there is no target flash conversion layer processing chain corresponding to the target dataset management prompt attribute, establish a target flash conversion layer processing chain corresponding to the target dataset management prompt attribute; The flash conversion layer description information loaded with the target dataset management prompt attributes is concatenated to the target flash conversion layer processing chain; The target flash conversion layer processing chain performs flash conversion layer processing on the target read / write command, corresponding to the target dataset management prompt attribute.

12. The method as described in claim 11, characterized in that, If the query result indicates that the target logical address range partially overlaps with the mapped logical address range of a hit entry, the step of loading the target dataset management hint attribute into the flash translation layer description information corresponding to the target read / write command includes: The hit subrange is determined based on the overlap between the target logical address range and the mapped logical address range of the hit entry; The missing sub-range is determined based on the portion of the target logical address range that is outside the hit sub-range; Based on the hit sub-range and the miss sub-range, the flash memory translation layer description information corresponding to the target read / write command is divided into hit flash memory translation layer description information and miss flash memory translation layer description information; Load the dataset management hint attribute from the hit entry into the hit flash conversion layer description information; Load the preset attributes into the description information of the missed flash memory translation layer; Based on the target dataset management prompt attributes and the preset attributes, the hit flash conversion layer description information and the miss flash conversion layer description information are respectively concatenated to the corresponding flash conversion layer processing chain.

13. The method as described in claim 11, characterized in that, When the query results indicate that the target logical address range spans the mapped logical address ranges of multiple hit entries, loading the target dataset management hint attribute into the flash translation layer description information corresponding to the target read / write command includes: Based on the overlapping portions between the target logical address range and the mapped logical address ranges of the multiple hit entries, multiple hit sub-ranges are determined, and when there is a portion in the target logical address range that does not overlap with the mapped logical address range of any hit entry, at least one miss sub-range is determined. Based on the plurality of hit sub-ranges and the at least one miss sub-range, the flash memory translation layer description information corresponding to the target read / write command is divided into hit flash memory translation layer description information corresponding to each hit sub-range and miss flash memory translation layer description information corresponding to each miss sub-range; For each hit sub-range, the dataset management hint attribute in the hit entry corresponding to the hit sub-range is determined as the sub-target dataset management hint attribute corresponding to the hit sub-range; wherein, the sub-target dataset management hint attributes corresponding to each hit sub-range together constitute the target dataset management hint attribute; Load the management prompt attributes of each sub-target dataset into the corresponding hit flash conversion layer description information, and load the preset attributes into each miss flash conversion layer description information; Hit flash conversion layer description information with the same dataset management prompt attribute is concatenated to the same flash conversion layer processing chain; hit flash conversion layer description information with different dataset management prompt attributes is concatenated to different flash conversion layer processing chains; and each hit flash conversion layer description information is concatenated to the flash conversion layer processing chain corresponding to the preset attribute.

14. The method as described in claim 1, characterized in that, The method further includes: The backup data of the prompt mapping table corresponding to the prompt mapping information is stored in a normally open storage area, and the backup data of the prompt mapping table in the normally open storage area is updated synchronously when the prompt mapping information is updated. In response to the storage controller exiting the PS4 state, the backup data base address and backup data volume of the prompt mapping table backup data in the normally open storage area are obtained; Based on the backup data base address and the backup data volume, initiate a block recovery operation to the hardware control module in the storage controller; The hardware control module performs the whole-block recovery operation, reads the entire backup data of the prompt mapping table from the normally open storage area, and loads the read backup data of the prompt mapping table into the hardware prompt mapping table. After the backup data of the prompt mapping table is loaded, the hardware control module generates a recovery completion notification. In response to the recovery completion notification, a prompt mapping information query based on the hardware prompt mapping table is enabled.

15. A read / write command processing device, characterized in that, It includes a receiving module, a query module, a loading module, and a processing module, among which: The receiving module is used to receive target read / write commands and determine the target logical address range based on the target read / write commands; The query module is used to query the stored prompt mapping information according to the target logical address range, and determine the target dataset management prompt attribute corresponding to the target read / write command according to the query result; wherein, the prompt mapping information is used to characterize the mapping relationship between the logical address range and the dataset management prompt attribute; The loading module is used to load the target dataset management prompt attributes into the flash conversion layer description information corresponding to the target read / write command; The processing module is used to perform flash conversion layer processing on the target read / write command based on the flash conversion layer description information loaded with the target dataset management prompt attributes; Wherein, if the query result indicates that the target logical address range partially overlaps with the mapping logical address range of at least one hit entry in the prompt mapping information, the loading module is configured to: Based on the overlap between the target logical address range and the mapped logical address range of each hit entry, the flash memory translation layer description information corresponding to the target read / write command is divided into hit flash memory translation layer description information corresponding to the hit portion and miss flash memory translation layer description information corresponding to the miss portion. The dataset management hint attribute in the hit entry is loaded into the hit flash conversion layer description information, and the preset attribute is loaded into the miss flash conversion layer description information.

16. A storage controller, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it causes the memory controller to perform the method as described in any one of claims 1 to 14.

17. A storage device, characterized in that, It includes a non-volatile storage medium and a storage controller as described in claim 16, wherein the storage controller is connected to the non-volatile storage medium.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor in the storage controller, causes the storage controller to perform the method as described in any one of claims 1 to 14.

Citation Information

Patent Citations

  • Optimizing data mapping by utilizing multiple indirection unit sizes

    US20250110651A1

  • Managing namespace mapping in a memory sub-system

    US20250173060A1