Method for realizing load balancing through LBA remapping and storage device

CN119718599APending Publication Date: 2025-03-28CHENGDU STARBLAZE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311257576.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When existing storage devices process multiple storage commands, the load of the FTL table management field is unbalanced, resulting in the overall performance being under-enhanced.

Method used

By remapping the LBA carried by the storage command, the FTL table index and entry index are determined, so that the storage command is allocated to the corresponding FTL table management field, and the physical page on the page strip is assigned to each storage command to achieve load balancing.

Benefits of technology

Through the optimization of LBA remapping and FTL table organization method, load balancing of storage devices is achieved, overall performance is improved, and data security is enhanced by hiding LBA information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718599A_ABST
    Figure CN119718599A_ABST
Patent Text Reader

Abstract

The invention provides a method for realizing load balancing through LBA remapping and storage equipment, and the method comprises the following steps: responding to a plurality of received storage commands for indicating write operation, carrying out remapping on a first LBA value carried by each storage command, and obtaining a remapping result; based on the FTL table organization mode, determining an FTL table corresponding to the storage command, and distributing the storage command to a corresponding FTL table management domain; allocating a physical page on the page strip for each storage command, writing data corresponding to the storage command into the allocated physical page, recording a physical address of the allocated physical page to a corresponding target entry, and determining the target entry based on a remapping result corresponding to the storage command; wherein the page strip comprises physical pages of logic units from M FTL table management domains, and the value of M is greater than or equal to 1. According to the method and the device, the FTL table is reasonably allocated for the LBA, so that the page strip is ensured to be fully written in a relatively short time, and the XOR resource can be released in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a method and storage device for implementing load balancing through LBA remapping. Background Art

[0002] Figure 1A The block diagram of the storage device is shown. The storage device 102 is coupled to the host to provide storage capacity for the host. The host and the storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the storage device 102 through a variety of storage protocols such as SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIE (Peripheral Component Interconnect Express, PCIe), NVMe (NVM Express), Ethernet, Fiber Channel, wireless communication network, etc. The host can be an information processing device that can communicate with the storage device in the above manner, such as a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103 , a control component 104 , one or more NVM chips 105 , and a DRAM (Dynamic Random Access Memory) 110 .

[0003] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory), XPoint memory, etc. are common NVMs.

[0004] The interface 103 may be adapted to exchange data with the host via, for example, SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, Fibre Channel, etc.

[0005] The control component 104 is used to control data transmission between the interface 103, the NVM chip 105 and the DRAM 110, and is also used for storage management, mapping of host logical addresses to flash physical addresses, erase leveling, bad block management, etc. The control component 104 can be implemented in a variety of ways, such as software, hardware, firmware, or a combination thereof. For example, the control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof. The control component 104 can also include a processor or a controller, in which software is executed to manipulate the hardware of the control component 104 to process IO (Input / Output) commands. The control component 104 can also be coupled to the DRAM 110 and can access the data of the DRAM 110. The FTL table and / or the data of the cached IO commands can be stored in the DRAM.

[0006] The control component 104 includes a flash memory interface controller (or medium interface controller, flash memory channel controller), which is coupled to the NVM chip 105 and issues commands to the NVM chip 105 in a manner that complies with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives command execution results output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI" and the like.

[0007] Figure 1B A detailed block diagram showing the control components of a storage device.

[0008] The host accesses the storage device with IO commands that follow the storage protocol. The control component generates one or more media interface commands based on the IO commands from the host and provides them to the media interface controller. The media interface controller generates storage media access commands (e.g., programming commands, read commands, and erase commands) that follow the interface protocol of the NVM chip based on the media interface commands. The control component also tracks that all media interface commands generated from an IO command have been executed and indicates the processing results of the IO command to the host.

[0009] See also Figure 1BThe control components include, for example, a host interface, a host command processing unit, a storage command processing unit, a medium interface controller, and a storage medium management unit. The host interface obtains the IO command provided by the host, and generates a storage command to provide to the storage command processing unit. The storage command, for example, accesses storage space of the same size, such as 4KB. The data unit corresponding to the data accessed by a storage command recorded in the NVM chip is called a data frame. The physical page records one or more data frames. For example, the size of the physical page is 17664 bytes, and the size of the data frame is 4KB, then one physical page can store 4 data frames.

[0010] The storage medium management unit maintains the conversion of LBA (Logical Block Address) to physical address (PPA) for each storage command. For example, the storage medium management unit includes an FTL table. The FTL table can be used to maintain the mapping information from the logical address to the physical address, such as, see Figure 2A as well as Figure 2B As shown. The logical address constitutes the storage space of the storage device perceived by the upper-layer software such as the operating system, and the physical address is the address of the physical storage unit used to access the solid-state storage device. Usually, the entries of the FTL table record the address mapping relationship in the storage device in units of specified sizes (such as 512 bytes, 2KB, 4KB, etc., also known as data units DU). The address (LBA) in the logical address space corresponds one-to-one to the entry of the FTL table, so that the entry of the FTL table can be indexed according to the LBA, and the PPA recorded in the entry can be obtained. The entries of the FTL table are arranged continuously in the memory, and the LBA is also arranged continuously in the LBA space, so that the address of the corresponding entry of the FTL table in the memory can be obtained according to the LBA. Therefore, the entries of the FTL table do not need to record the LBA, and the LBA represented by the entry is implied by the position of the entry in the FTL table. Figure 2A Multiple LBAs with values ​​ranging from 0 to (2m-1) in the LBA space and entries corresponding to each LBA are displayed. Figure 2B The manner of calculating the memory address of the corresponding entry in the FTL table according to the LBA is also shown.

[0011] For read commands, the storage medium management unit outputs the physical address corresponding to the logical address accessed by the storage command. For write commands, the storage medium management unit allocates an available physical address and records the mapping relationship between the logical address accessed and the allocated physical address. The storage medium management unit also maintains functions required to manage the NVM chip, such as garbage collection and wear leveling.

[0012] The storage command processing unit operates the media interface controller to issue a storage media access command to the NVM chip according to the physical address provided by the storage media management unit. For the purpose of clarity, the command sent by the host to the storage device is called an IO command, the command sent by the host command processing unit to the storage command processing unit is called a storage command, the command sent by the storage command processing unit to the media interface controller is called a media interface command, and the command sent by the media interface controller to the NVM chip is called a storage media access command. The storage media access command follows the interface protocol of the NVM chip. SSD (Solid State Drives) includes multiple NVM chips. Each NVM chip includes one or more LUNs (Logical UNit), and each logical unit includes multiple physical blocks (Blocks). As the storage capacity increases, the number of NVM chips / LUNs / Blocks increases, and the probability of storage media failure also increases. In order to ensure the reliability of the stored data delivered to users, enterprise-level SSDs use technologies similar to RAID (Redundant Arrays of Independent Disks) (RAID technology for short) to construct data protection units across NVM chips / logic units, so that even if a single NVM chip / logic unit fails, data can still be protected from loss. This can also handle occasional data errors that occur during the operation of storage devices.

[0013] For the FTL table, the size of the FTL table is, for example, 4GB, and the entries of the FTL table record 32-bit addressed PPAs, so that the FTL table can store 2^9 PPA addresses. However, as the capacity of storage devices develops towards large capacity, 2^9 PPAs can no longer meet the needs of large-capacity storage devices, and storage devices need to manage a larger number of PPAs. In the prior art, multiple FTL tables (for example, FTL-0 table and FTL-1 table) are used to jointly manage the entire LBA space. Figure 3A The organization of the FTL table including two FTL tables is shown. According to the parity of the last bit of the LBA (denoted as LSB, Least Significant Bit), the LBA is divided according to parity, and the LBA with odd LSB is managed by the FTL-0 table, and the LBA with even LSB is managed by the FTL-1 table. That is, the FTL-0 table stores the PPAs corresponding to all LBAs with odd LSB, and the FTL-1 table stores the PPAs corresponding to all LBAs with even LSB. In the FTL-0 table and the FTL-1 table, the entries are still arranged in sequence, but in the FTL-0 table, entry 0 represents LBA1 and entry 1 represents LBA3. In the FTL-1 table, entry 0 represents LBA0 and entry 1 represents LBA2. The entries in the FTL table are represented by entries.<lba>This representation is for ease of understanding and does not represent the information stored in the actual FTL table entries. For example, entry 0 in the FTL-1 table <lba0>It indicates that the PPA stored in the entry with index 0 in the FTL-1 table is the PPA corresponding to LBA0.

[0014] Figure 3B Shown Figure 3A The storage command processing corresponding to the FTL table organization shown in the figure. Figure 3B , storage commands carry LBA. Figure 3A The FTL table organization method shown maps the LBA carried by the storage command to FTL_Table_Index and entry_index. FTL_Table_Index is also called FTL table index, which is used to identify one of the FTL-0 table and the FTL-1 table. Entry_index is also called entry index, which is used to identify the corresponding entry in the identified FTL table.

[0015] As an example, the way to map LBA to FTL_Table_Index and entry_index depends on Figure 3A The FTL table organization is shown in . For example, for LBA0, it is accommodated by entry 0 of the FTL-1 table, so the mapped FTL_Table_index=1, and entry_index=0, while for LBA9, it is accommodated by entry 4 of the FTL-0 table, so the mapped FTL_Table_index=0, and entry_index=4.

[0016] Figure 3B In the process, according to the FTL_Table_Index obtained from the LBA mapping, the storage command is provided to one of the storage medium management unit 0 and the storage medium management unit 1 for processing.

[0017] Taking the write command as an example, in response to receiving the storage command, the storage medium management unit allocates a PPA for the LBA it carries, and the allocated PPA is recorded in the entry of the FTL table that contains the LBA (the entry is determined by FTL_Table_Index and entry_index). The LBA of the storage command received by the storage medium management unit 0 is only accommodated by the FTL-0 table, so its allocated PPA is only used to update the FTL-0 table; and the LBA of the storage command received by the storage medium management unit 1 is only accommodated by the FTL-1 table, so its allocated PPA is only used to update the FTL-1 table. Furthermore, the storage medium management unit 0 allocates PPA only from LUN0-LUN3, and the storage medium management unit 1 allocates PPA only from LUN4-LUN7.

[0018] The allocated PPA is provided to the media interface controller in the form of a media interface command. Figure 3B In the example, the media interface controller includes LUN controller 0 to LUN controller 7, wherein LUN controllers 0 to 3 are respectively used to process media interface commands for accessing LUN0 to LUN3, and LUN controllers 4 to 7 are respectively used to process media interface commands for accessing LUN4 to LUN7. Since storage media management unit 0 only allocates PPA from LUN0 to LUN3, the media interface command corresponding to storage media management unit 0 is only processed by one of LUN0 to LUN3, and similarly, the media interface command corresponding to storage media management unit 1 is only processed by one of LUN4 to LUN7.

[0019] For the purpose of clarity and simplicity, the present embodiment introduces the concept of an FTL table management domain. An FTL table management domain refers to a collection of resources required to process operations associated with an LBA space managed by an FTL table.

[0020] Figure 3B In the example, the FTL-0 table, storage medium management unit 0, LUN controllers 0-3, and LUN0-LUN3 constitute the FTL-0 table management domain, while the FTL-1 table, storage medium management unit 1, LUN controllers 4-7, and LUN4-LUN7 constitute the FTL-1 table management domain. Thus, the mapping result from LBA to FTL_Table_Index in the storage command determines which FTL table management domain processes the storage command and becomes the load of the FTL table management domain. The FTL table and the FTL table management domain can be one-to-one or many-to-one. For example, N FTL tables correspond to the FTL-0 table management domain, and M FTL tables correspond to the FTL-1 table management domain.

[0021] Normally, each FTL table management domain has its own exclusive resources. For example, when the control component supports two FTL table management domains, two storage command processing units, two storage medium management units, and two media interface controllers (or two groups of LUN controllers in a single media interface controller) are provided, so that each FTL table management domain has its own storage command processing unit, storage medium management unit, and media interface controller.

[0022] The host command processing unit can be shared by multiple FTL table management domains, so that the storage command generated by the host command processing unit can be processed by any FTL table management domain, and the host command processing unit is not part of a single FTL table management domain. Optionally, the control component can provide a single storage command processing unit, a single storage medium management unit and / or a single medium interface controller to enable multiple FTL table management domains to share or reuse a single resource.

[0023] In some embodiments, when writing data to the NVM, the storage space allocation unit of the NVM chip is based on the page stripe. The page stripe is a data protection unit constructed based on the RAID technology in the storage device, and the page stripe is constructed in a large block. The large block includes physical blocks from multiple logical units, and multiple logical units that provide physical blocks for the large block are called logical unit groups. Each logical unit in the logical unit group can provide one or more physical blocks for the large block. Each page stripe includes a LUN for storing user data and a LUN for storing verification data (denoted as LUN-P).

[0024] A large block includes multiple page stripes, and a page stripe includes multiple physical pages, which are from the same large block, for example, different physical blocks. For example, among the multiple physical pages of a page stripe, P physical pages are used to store user data, and Q physical pages are used to store verification data. The data written to physical page i is recorded as D(i). The verification data D(Q) is generated by the user data of P physical pages according to a specified error correction algorithm. For example, the verification data is determined based on an XOR operation, then D(Q) = D(0)XOR D(1)XOR...XOR D(P-1). Therefore, when writing data to a page stripe, D(Q) can only be calculated if D(0) to D(P-1) are known.

[0025] In order to use RAID technology, it is necessary to calculate the check data D(Q) for the data written to the page stripe. The calculation of the check data involves a large number of XOR operations. In order to speed up this process, a dedicated hardware unit (called an XOR calculation unit) is usually used to complete the calculation of D(Q) = D(0) XOR D(1) XOR ... XOR D(P-1). The XOR calculation unit also includes an XOR cache, which is used to cache the data D(i) and the intermediate results of each XOR calculation, such as the result of D(0) XOR D(1), the result of D(0) XOR D(1) XOR D(2), until the final D(Q) is obtained, and then D(Q) is written to the page stripe. Therefore, the size of the XOR cache needs to be able to accommodate the entire D(i), and when a page stripe is allocated, from the beginning of writing data to this page stripe to the time when this page stripe is full, the entire XOR cache needs to be occupied to serve the operation of writing data to this page stripe.

[0026] In order to improve the performance of storage devices, data can be written to multiple page stripes of multiple large blocks at the same time. Accordingly, an exclusive XOR cache needs to be allocated to each page stripe that is written concurrently. Based on the latest NVM chip, the size of D(Q) can reach 192KB (including some out-of-band data), so a single XOR cache requires a capacity of about 200KB. However, the internal cache resources of the chip are very expensive, so the number of XOR caches of the XOR calculation unit is usually small (for example, 1-4). Summary of the invention

[0027] In the case of multiple storage commands, the organization of the FTL table determines the mapping result from the LBA of the storage command to the FTL_Table_Index, and also determines the load distribution result of these multiple storage commands among various FTL table management domains.

[0028] In some cases, the LBA distribution of IO commands issued by the host presents a special pattern. For example, in sequential write, the LBAs of multiple IO commands are continuous, and in random write, the LBAs of multiple IO commands are randomly distributed. For another example, for testing purposes or table lookup operations in database applications, an LBA distribution pattern with a specified span may appear in consecutive IO commands (for example, LBA=1, 5, 9, 13 indicated by consecutive multiple IO commands).

[0029] Return to view Figure 3B , if the LBAs of multiple IO commands issued by the host are continuous (for example, LBA = 0 to 100), then these IO commands will be evenly distributed to the FTL-0 table management domain and the FTL-1 table management domain. At this time, the loads of the FTL-0 table management domain and the FTL-1 table management domain are balanced. If the LBAs of multiple IO commands issued by the host are continuous odd numbers (for example, LBA = 1, 3, 5, 7, 9, 11, 13, ...), then these IO commands will all be allocated to the FTL-0 table management domain. Similarly, if the LBAs of multiple IO commands issued by the host are continuous even numbers, then these IO commands will all be allocated to the FTL-1 table management domain. This results in an unbalanced load on the FTL table management domain. One FTL table management domain bears a large load, while the other FTL table management domain is almost idle. This in turn results in the overall performance of the storage device not being fully utilized.

[0030] The present application hopes to provide a method to solve one or more of the above technical problems.

[0031] In a first aspect, an embodiment of the present application provides a data access method, including:

[0032] In response to receiving a plurality of storage commands indicating write operations, remapping a first LBA value carried by each storage command to obtain a remapping result, wherein the remapping result includes an FTL table index and an entry index corresponding to the first LBA value;

[0033] Based on the FTL table organization mode, determine the FTL table corresponding to the storage command, and allocate the storage command to the corresponding FTL table management domain;

[0034] Allocate a physical page on a page stripe for each storage command, write data corresponding to the storage command into the allocated physical page, and record a physical address of the allocated physical page into a corresponding target entry, where the target entry is determined based on a remapping result corresponding to the storage command;

[0035] The page stripe includes physical pages from logical units of M FTL table management domains, and the value of M is greater than or equal to 1.

[0036] Optionally, remapping the first LBA value carried by each storage command to obtain a remapping result includes:

[0037] For each storage command, determine a first FTL table corresponding to a first LBA value carried by the storage command in M ​​FTL tables, where an index corresponding to the first FTL table is the FTL table index;

[0038] Determine, in the first FTL table, a first entry corresponding to the first LBA value, where the index corresponding to the first entry is the entry index;

[0039] determining the remapping result based on the first FTL table and the first entry;

[0040] The target entry is the first entry.

[0041] Optionally, the remapping result is a second LBA value, and the method includes:

[0042] Determine a second FTL table corresponding to the second LBA value corresponding to the storage command in M ​​FTL tables, determine a second entry corresponding to the second LBA value in the second FTL table, and determine the second entry in the second FTL table as the target entry corresponding to the storage command.

[0043] Optionally, the overall LBA space is managed by M FTL tables;

[0044] Each of the M FTL tables includes a plurality of entry groups, each entry group being used to accommodate an LBA group;

[0045] For each of the M FTL tables, LBA values ​​belonging to the same LBA group have the same parity or the same result of taking modulo M, and LBA values ​​of adjacent LBA groups have different parities or the same result of taking modulo M;

[0046] In the M FTL tables, the parity of the LBA values ​​of the LBA groups with the same group number or the result of taking the modulus of M is different in adjacent FTL tables.

[0047] Optionally, when the results of taking the modulo M of the LBA values ​​of the same LBA group are the same, the results of taking the modulo M of the LBA values ​​of adjacent LBA groups are different, and the results of taking the modulo M of the LBA values ​​of LBA groups with the same group number are different in adjacent FTL tables, the method further includes:

[0048] According to FTL_Table_Index=(j+t)mod M, determine the FTL table index corresponding to the first LBA value, where FTL_Table_Index represents the FTL table index, j represents the result of taking the first LBA value modulo M, and t represents the result of taking the row index i of the first LBA value in the FTL table modulo M;

[0049] The entry index corresponding to the first LBA value is determined according to entry_index=i*Ng+(LBA-i*K-FTL_table_index) / M, where entry_index represents the entry index, K represents the total number of elements in the same row of M FTL tables, LBA represents the first LBA value, i=LBA / K, and Ng represents the number of LBAs in the LBA group.

[0050] Optionally, M two-dimensional matrix-shaped FTL tables constitute a target matrix, and the same rows of the M FTL tables as a whole form a row of the target matrix, and each row of the target matrix corresponds to K elements, which are used to accommodate entries of K LBA values ​​with continuous corresponding values;

[0051] The K LBA values ​​corresponding to the row with index i in the target matrix are divided into M groups, each group Gj corresponds to an FTL table and the corresponding LBA values ​​have the same modulo result of M, and the value of j ranges from 0 to M-1;

[0052] Among the M groups of the row indexed i in the target matrix, the entries of the row indexed i of the Mth FTL table contain group Gx, and the other groups except Gx are respectively contained by the entries of the row indexed i of the first M-1 FTL tables.

[0053] Optionally, the number of elements K corresponding to each row in the target matrix is ​​Q times the total number of LUNs corresponding to the M FTL tables, the value of Q is greater than 0, and Q times the total number of LUNs is an integer; or

[0054] The number of elements K corresponding to each row in the target matrix is ​​the cumulative sum of the number of LBA values ​​included in the LBA groups corresponding to the M FTL tables.

[0055] Optionally, the first LBA value corresponding to the row with index i in the target matrix is ​​K*i, and the last LBA value is K*i+(K-1).

[0056] Optionally, the index of the FTL table of the group Gx contained in the entry of the row with index i of the Mth FTL table is determined modulo M based on the difference of K multiplied by i minus 1.

[0057] Optionally, the M groups of rows with index i are sorted according to the index j of the group Gj, and the other groups except Gx are sequentially accommodated by M-1 FTL tables according to the sorting result.

[0058] Optionally, the number of LBAs included in the LBA group is determined based on the number of LUNs corresponding to the FTL table.

[0059] Optionally, when the parities of LBA values ​​in the same LBA group are the same, the parities of LBA values ​​in adjacent LBA groups are different, and the parities of LBA values ​​in LBA groups with the same group number are different in adjacent FTL tables;

[0060] The number of LBAs included in the LBA group of the FTL table is determined based on Q times the number of LUNs corresponding to the FTL table, where the value of Q is greater than 0, and Q times the number of LUNs is an integer.

[0061] Optionally, for each FTL table in the M FTL tables, each entry group corresponds to a group of serial numbers, the M entry groups with the same group serial numbers constitute an entry group set, and each entry group set corresponds to an LBA range;

[0062] For any entry group, the R entries in the current entry group are determined according to the group sequence number corresponding to the current entry group and the number of entries contained in the current entry group, and the R LBA values ​​corresponding to the current entry group are determined based on the group sequence number, parity and the first entry group set to which the current entry group belongs.

[0063] Optionally, each entry group corresponds to an LBA set, and based on the parity corresponding to the current entry group, at least one entry group can be determined in the first entry group set, based on the group sequence number corresponding to the current entry group, the current entry group can be determined in at least one entry group, and based on the correspondence between the entry group and the LBA set, an LBA set including R LBA values ​​corresponding to the current entry group is determined.

[0064] Optionally, for M FTL tables, the number of LBAs in the LBA group of each FTL table may be the same or different.

[0065] Optionally, the ratio of the number of LBAs included in the LBA groups with the same group number of the M FTL tables is equal to the ratio of the number of logical units from each FTL table management domain in the storage space for storing user data of the page stripe.

[0066] Optionally, among the multiple FTL table indexes obtained by remapping the LBA value carried by each storage command of the multiple storage commands, the ratio of the number of FTL table indexes corresponding to each FTL table management domain is equal to the ratio of the number of logical units from each FTL table management domain in the storage space for storing user data of the page stripe, so that the ratio of the amount of data written to the parts belonging to each FTL table management domain in the storage space for storing user data of the page stripe is equal to the ratio of the number of FTL table indexes corresponding to each FTL table management domain.

[0067] Optionally, the method further comprises:

[0068] After determining the FTL table corresponding to the storage command, storing the storage command in a cache;

[0069] L storage commands are obtained from the cache and provided to multiple storage medium management units, wherein the storage commands are provided to the storage medium management unit belonging to the same FTL table management domain according to the FTL table management domain to which the obtained storage commands belong; and the ratio of the number of storage commands belonging to each FTL table management in the L storage commands is equal to the ratio of the number of logical units from each FTL table management domain in the storage space for storing user data of the page stripe.

[0070] Optionally, the number of the L storage commands is the number of storage commands required to fully write the page stripe.

[0071] Optionally, the L storage commands are provided together to M storage medium management units;

[0072] For any storage medium management unit, the storage medium management unit processes the received storage command and provides a medium interface command to the corresponding medium interface controller;

[0073] The LUN controller in the media interface controller processes the media interface command and writes data to the corresponding physical page.

[0074] Optionally, the media interface controller includes multiple LUN controllers, and the multiple LUN controllers correspond to LUNs one by one; based on the LUN to which the physical address carried by the media interface command belongs, the media interface controller that processes the media interface command is determined.

[0075] Optionally, the LUN to which the physical page on the page stripe allocated to the storage command belongs corresponds to the same FTL table management domain as the storage command.

[0076] Optionally, the method further comprises:

[0077] Before writing data to the page stripe for the first time, allocating an XOR buffer to the page stripe;

[0078] After the page stripe is filled, the allocated XOR buffer is released.

[0079] In a second aspect, an embodiment of the present application provides a storage device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps of the data access method described in the first aspect when executing the program.

[0080] According to an embodiment of the present application, by remapping the LBA carried by the storage command, determining the target entry based on the remapping result, storing the data corresponding to the storage command to the physical address of the allocated physical page and then recording the physical address in the target entry, the security of data storage can be improved; by reasonably allocating FTL tables to LBA based on the FTL table organization method, the page stripe can be filled in a relatively short time and XOR resources can be released in time; by caching storage commands and allocating storage commands to M FTL table management domains at one time, the time it takes for the page stripe to be filled can be further shortened, and XOR resources can be used efficiently and reasonably. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1A A block diagram representing a storage device;

[0082] Figure 1B A detailed block diagram showing the control components of the storage device;

[0083] Figure 2A A schematic diagram showing that the FTL table maintains mapping information from logical addresses to physical addresses;

[0084] Figure 2B A schematic diagram showing a physical address recorded by an FTL table entry;

[0085] Figure 3A A schematic diagram showing LBA parity management of an FTL table based on LBA;

[0086] Figure 3B A flowchart showing the processing of storage commands by the FTL table management domain;

[0087] Figure 4A A schematic diagram showing that the LBA parities corresponding to two adjacent entries in the FTL table are different;

[0088] Figure 4B A schematic diagram showing different parities of adjacent LBA groups in an FTL table;

[0089] Figure 4C A schematic diagram showing different parities of the same LBA group in adjacent FTL tables and different parities of adjacent LBA groups in the same FTL table;

[0090] Figure 5A A schematic diagram showing that the parities of LBA groups with the same LBA group number in two FTL tables are arranged alternately, that adjacent LBA groups in the same FTL table have different parities, and that the numbers of LBAs corresponding to LBA groups in different FTL tables are different;

[0091] Figure 5B express Figure 5A The storage command processing flow chart corresponding to the FTL table organization shown;

[0092] Figure 6 A schematic diagram showing an FTL table organization method provided by the present application;

[0093] Figure 7 A flowchart showing a method of mapping LBAs to FTL table entries to obtain an FTL table organization method provided by the present application;

[0094] Figure 8 A storage command processing flow chart showing another FTL table organization method provided by the present application;

[0095] Fig. 9 A schematic diagram showing the cooperation between the write initiation circuit and the storage command processing unit;

[0096] Fig.10 A schematic diagram showing the remapping implemented by the FTL table organization method provided in this application;

[0097] Fig.11 A schematic diagram of LBA remapping based on LFSR provided by the present application is shown;

[0098] Fig. 12A A schematic diagram showing that the page stripe provided by the present application does not cross the FTL table management domain;

[0099] Fig. 12B One of the schematic diagrams showing storage command processing according to an embodiment of the present application;

[0100] Fig.13 A schematic diagram showing the allocation of storage commands and writing data to a page stripe based on the FTL table organization method provided by the present application;

[0101] Fig.14 A second schematic diagram showing storage command processing according to an embodiment of the present application.

[0102] Related technical terms:

[0103] FTL table: maintains the mapping information from logical addresses to physical addresses.

[0104] FTL table entry: The smallest unit used to record PPA in the FTL table.

[0105] FTL table management domain: A collection of resources required to process operations associated with the LBA space managed by an FTL table.

[0106] LBA group: A group of LBAs including a specified number of LBAs is called an LBA group.

[0107] LBA group number: the index corresponding to the LBA group.

[0108] Entry group: The FTL table is used to contain multiple entries of an LBA group as an entry group.

[0109] Entry group set: a set of entry groups from multiple FTL tables with the same group number.

[0110] LBA group set: a set formed by LBA groups with the same LBA group number from multiple FTL tables.

[0111] LBA group set serial number: the index corresponding to the LBA group set.

[0112] Parity: The LBA value is an odd number or an even number. The property that any LBA value in the LBA group has the same result when modulo the integer N is also called parity.

[0113] Target matrix: A matrix consisting of multiple FTL tables in the form of two-dimensional matrices. DETAILED DESCRIPTION

[0114] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0115] When there are multiple copies of the same resource (for example, storage command processing unit, storage medium management unit, medium interface controller) in a storage device, it is hoped that their respective loads are balanced (also called load balance of the FTL table management domain) to avoid overall resource waste of the control component or performance not meeting expectations due to some resources being idle.

[0116] Generally, a group of LBAs is called an LBA group, and the number of LBAs in a group of LBAs (specified number) is called the number of LBAs in the group. The LBAs in the LBA group are arranged in order according to their values. The LBA groups belonging to the same FTL table are also arranged in order according to their LBA values. Therefore, each LBA group in the FTL table has an index (called an LBA group number). A group of entries (called an entry group) is used in the FTL table to accommodate an LBA group, and the number of entries in the entry group is the same as the number of LBAs in the LBA group it accommodates. Each entry in the entry group has a continuous index.

[0117] According to an embodiment of the present application, the FTL table is organized into multiple LBA groups, and each LBA group constituting the same FTL table has the same number of LBAs. The LBA group has parity, which means that all LBAs in the same LBA group have the same parity. The set formed by the LBA groups with the same LBA group sequence number from different FTL tables is called an LBA group set. Each LBA group set is also arranged in order according to its LBA value. Thus, each LBA group set has an index (called an LBA group set sequence number). And any LBA in the LBA group set with a larger sequence number is greater than any LBA in the LBA group set with a smaller sequence number. Although the LBA group has parity (making the LBAs in the LBA group discontinuous in value), the LBAs in the LBA group set are continuous in value, so that among the LBAs in the LBA group set, the LBAs with any value between the maximum value and the minimum value are all in the LBA group set.

[0118] The parity of an LBA group means that any LBA value in the LBA group is an odd number or an even number. More generally, any LBA value in the LBA group has the same result when modulo a certain integer (such as integer N). For the purpose of simplicity, the property that any LBA value in the LBA group has the same result when modulo integer N is also referred to as having parity.

[0119] Therefore, according to the number of FTL tables, the number of LBAs in the group, and the parity of the LBA group, it is determined which entry in which FTL table will accommodate a certain LBA.

[0120] Figure 4A and Figure 4B The FTL table organization method of the embodiment of the present application is shown.

[0121] See also Figure 4A As shown, the LSB parity in the LBAs corresponding to two adjacent entries in the FTL table is different, such as the LSB in the LBA corresponding to entry 0 is even, the LSB in the LBA corresponding to entry 1 is odd, and the LSB in the LBA corresponding to entry 2 is even. Figure 4A The case where the number of LBAs in an LBA group is 1 is shown. Adjacent LBA groups have different parities. Since the number of FTL tables is 1, the number of LBA groups in an LBA group set is also 1.

[0122] See also Figure 4B As shown in FIG. 1 , the parity of adjacent LBA groups in the FTL table is different. Figure 4B In the example, three LBA groups are shown. Entry 0 to Entry 3 constitute Entry Group 0, Entry 4 to Entry 7 constitute Entry Group 1, and Entry 8 to Entry 11 constitute Entry Group 2. Entry Group 0 contains LBA Group 0, and the LBA values ​​in LBA Group 0 are all even numbers. Entry Group 1 contains LBA Group 1, and the LBA values ​​in LBA Group 1 are all odd numbers. Entry Group 2 contains LBA Group 2, and the LBA values ​​in LBA Group 2 are all even numbers, so that the LBA groups are arranged alternately in odd and even numbers. The LBA values ​​in LBA Group 0 are 0, 2, 4, and 6, respectively, the LBA values ​​in LBA Group 1 are 1, 3, 5, and 7, respectively, and the LBA values ​​in LBA Group 2 are 8, 10, 12, and 14, respectively.

[0123] against Figure 4B The FTL table organization method shown is that if multiple IO commands sent by the host are received, such as command 1 (LBA0), command 2 (LBA1), command 3 (LBA2), command 4 (LBA3), command 5 (LBA4), command 6 (LBA5), and command 7 (LBA6), the FTL table entry that matches LBA0 indicated by command 1 is determined to be entry 0, the FTL table entry that matches LBA1 indicated by command 2 is determined to be entry 4, the FTL table entry that matches LBA2 indicated by command 3 is determined to be entry 1, the FTL table entry that matches LBA3 indicated by command 4 is determined to be entry 5, the FTL table entry that matches LBA4 indicated by command 5 is determined to be entry 2, the FTL table entry that matches LBA5 indicated by command 6 is determined to be entry 6, and the FTL table entry that matches LBA6 indicated by command 7 is determined to be entry 3.

[0124] If the multiple IO commands received from the host are: command 1 (LBA0), command 2 (LBA2), command 3 (LBA4), command 4 (LBA6), command 5 (LBA8), and command 6 (LBA10), then the entries that match each LBA are determined in the FTL table entries that can accommodate even-numbered LBA values. For example, the FTL table entry that matches LBA0 indicated by command 1 is determined to be entry 0, the FTL table entry that matches LBA2 indicated by command 2 is determined to be entry 1, the FTL table entry that matches LBA4 indicated by command 3 is determined to be entry 2, the FTL table entry that matches LBA6 indicated by command 4 is determined to be entry 3, the FTL table entry that matches LBA8 indicated by command 5 is determined to be entry 8, and the FTL table entry that matches LBA10 indicated by command 6 is determined to be entry 9.

[0125] Figure 4C The organization of the FTL table according to another embodiment of the present application is shown.

[0126] See also Figure 4C , the entire LBA space is managed by two FTL tables (respectively denoted as FTL-0 table and FTL-1 table). Three LBA groups are shown in FTL-0 table and FTL-1 table respectively. Entry 0 to entry 3 of FTL-0 table constitute entry group 0, which is used to accommodate LBA group 0, where the LSB of each LBA is even. Entry 0 to entry 3 of FTL-1 table constitute entry group 0, which is used to accommodate LBA group 0, where the LSB of each LBA is odd. Entry 4 to entry 7 of FTL-0 table constitute entry group 1, which is used to accommodate LBA group 1, where the LSB of each LBA is odd. Entry 4 to entry 7 of FTL-1 table constitute entry group 1, which is used to accommodate LBA group 1, where the LSB of each LBA is even. Entry 8 to entry 11 of FTL-0 table constitute entry group 2, which is used to accommodate LBA group 2, where the LSB of each LBA is even. Entry 8 to entry 11 of the FTL-1 table constitute entry group 2, which is used to accommodate LBA group 2, in which the LSB of each LBA is odd.

[0127] In the FTL-0 table and the FTL-1 table, LBA groups with the same LBA group number constitute an LBA group set. For example, LBA group set 0 includes LBA group 0 of the FTL-0 table and the FTL-1 table, while LBA group set 1 includes LBA group 1 of the FTL-0 table and the FTL-1 table, and LBA group set 2 includes LBA group 2 of the FTL-0 table and the FTL-1 table.

[0128] Figure 4C In the example of , each LBA group includes 4 LBAs. Thus, LBA group set 0 contains LBA values ​​of LBA0 to LBA7, LBA group set 1 contains LBA values ​​of LBA8 to LBA15, and LBA group set 2 contains LBA values ​​of LBA16 to LBA23.

[0129] The parity of LBA groups with the same LBA group number in the LBA group set is arranged alternately, while the parity of adjacent LBA groups in the same FTL table is different. Therefore, in the entire LBA space, part of the LBAs with odd LSBs are managed by the FTL-0 table, while the other part is managed by the FTL-1 table. For LBAs with even LSBs, similar characteristics are also present. In addition, adjacent LBAs in the LBA space are managed by different FTL tables.

[0130] In this case, if the multiple commands received from the host are: command 1 (LBA0), command 2 (LBA1), command 3 (LBA2), command 4 (LBA3), command 5 (LBA4), command 6 (LBA5) and command 7 (LBA6); then command 1 (LBA0), command 3 (LBA2), command 5 (LBA4), and command 7 (LBA6) are processed by the FTL table management domain corresponding to the FTL-0 table, and command 2 (LBA1), command 4 (LBA3), and command 6 (LBA5) are processed by the FTL table management domain corresponding to the FTL-1 table.

[0131] In an optional implementation, the number of LBAs in the LBA group depends on the number of LUNs in the FTL table management domain to which the LBA group belongs. Figure 4C In the example, if the FTL table management domain to which the FTL-0 table belongs has 4 LUNs, and the FTL table management domain to which the FTL-1 table belongs has 4 LUNs, the number of LBAs in the LBA groups of the FTL-0 table and the FTL-1 table are both 4. The number of LBAs in the LBA group is determined according to the number of LUNs in the FTL table management domain, so that the number of LBAs managed by the FTL table of the FTL table management domain depends on or is proportional to the number of LUNs, so as to promote load balancing of each FTL table management domain.

[0132] According to another embodiment of the present application, the number of LUNs in each FTL table management domain is different. For example, there are 4 LUNs in the FTL-0 table management domain corresponding to the FTL-0 table, so the number of LBAs in the LBA group of the FTL-0 table is 4, and there are 3 LUNs in the FTL-1 table management domain corresponding to the FTL-1 table, so the number of LBAs in the LBA group of the FTL-1 table is 3. Figure 5A The organization of the FTL table of another embodiment of the present application is shown.

[0133] Figure 5A In the example, the entire LBA space is managed by two FTL tables (respectively denoted as FTL-0 table and FTL-1 table). Entries 0 to 3 of the FTL-0 table correspond to LBA group 0, and the LBA values ​​in LBA group 0 are all even numbers. Entries 0 to 2 of the FTL-1 table correspond to LBA group 0, and the LBA values ​​in LBA group 0 of the FTL-1 table are all odd numbers. Entries 4 to 7 of the FTL-0 table correspond to LBA group 1, and the LBA values ​​in LBA group 1 are all odd numbers. Entries 3 to 5 of the FTL-1 table correspond to LBA group 1, and the LBA values ​​in LBA group 1 of the FTL-1 table are all even numbers. Entries 8 to 11 (not shown) of the FTL-0 table correspond to LBA group 2, and the LBA values ​​in LBA group 2 are all even numbers. Entries 6 to 8 of the FTL-1 table correspond to LBA group 2, and the LBA values ​​in LBA group 2 of the FTL-1 table are all odd numbers.

[0134] The parity of LBA groups with the same LBA group number in the FTL-0 table and the FTL-1 table is arranged alternately, and the parity of adjacent LBA groups in the FTL-0 table and the FTL-1 table is different. In addition, the number of LBAs in the LBA group of the FTL-0 table is 4, while the number of LBAs in the LBA group of the FTL-1 table is 3.

[0135] The LBA groups with the same LBA group number in the FTL-0 table and the FTL-1 table constitute an LBA group set. Each LBA group set has 7 LBA values, and the LBA values ​​in the LBA group set with the number 0 are 0-6, the LBA values ​​in the LBA group set with the number 1 are 7-13, and the LBA values ​​in the LBA group set with the number 2 are 14-20. Therefore, generally, the LBA values ​​in the LBA group set with the number i (the minimum value of i is 0) are consecutive integers from 7*i to 7*i+6. Therefore, for a given LBA value, when the number of LBAs in the respective LBA groups of the FTL-0 table and the FTL-1 table is known, it is possible to determine which LBA group set the given LBA value belongs to, and then determine the LBA group to which the given LBA value belongs based on the parity of the LBA groups in the LBA group set, and then determine which entry of the FTL table contains it.

[0136] For example, when the host sends command 1 (LBA1), command 2 (LBA3), command 3 (LBA13), command 4 (LBA5), command 5 (LBA7), command 6 (LBA2), command 7 (LAB0), command 8 (LAB9), and command 9 (LAB15), entry 0 of the FTL-1 table is determined to be a matching entry for LBA1, entry 1 of the FTL-1 table is determined to be a matching entry for LBA3, entry 2 of the FTL-1 table is determined to be a matching entry for LBA5, and entry 0 of the FTL-0 table is determined to be a matching entry for LBA0, entry 1 of the FTL-0 table is determined to be a matching entry for LBA2, entry 4 of the FTL-0 table is determined to be a matching entry for LBA7, entry 5 of the FTL-0 table is determined to be a matching entry for LBA9, entry 7 of the FTL-0 table is determined to be a matching entry for LBA13, and entry 6 of the FTL-1 table is determined to be a matching entry for LBA15.

[0137] exist Figure 5A In the entry <lba>It means that the PPA stored in the FTL table entry is the PPA corresponding to the LBA, not that the LBA is added to the FTL table. When processing a write command carrying an LBA, the entry corresponding to the LBA in the FTL table is in an allocated state, and the allocated PPA is filled in the FTL table.

[0138] exist Figure 5A In the example, the number of LBAs in the LBA groups of the FTL-0 table and the FTL-1 table is different, while the number of LBAs in each LBA group in the same FTL table is the same. The situation where the LBA groups of different FTL tables have different numbers of LBAs is called FTL table asymmetry.

[0139] The sizes of the FTL-0 table and the FTL-1 table are different, which means that the LBA space they manage is different in size (as the number of space elements is different). In the case where multiple FTL tables are asymmetric, the number of LUN resources managed by multiple FTL tables is also different, and a larger FTL table requires more LUN resources.

[0140] Optionally, for multiple FTL tables, the number of LBAs in the LBA group of each FTL table can be the same or different. For example, the number of LBAs in the LBA group in the FTL-0 table is 4, while the number of LBAs in the LBA group in the FTL-1 table is 3. Still optionally, the number of LBAs in the LBA group of the FTL table managed by it is set according to the number of LUNs managed by each FTL table management domain. For example, the ratio of the number of LBAs in the LBA group of two FTL tables is equal to the ratio of the number of LUNs managed by the FTL table management domains to which the FTL tables belong.

[0141] As an example, the number of LBAs in the LBA group of the FTL table of the FTL table management domain is equal to the number of LUNs managed by the FTL table management domain or a multiple of the number of LUNs.

[0142] Figure 5B Shown Figure 5A The storage command processing corresponding to the FTL table organization shown in the figure. Figure 5B As shown, the storage command carries LBA. Figure 5A The FTL table organization method shown maps the LBA carried by the storage command to FTL_Table_Index and entry_index. FTL_Table_Index is also called FTL table index, which is used to identify one of the FTL-0 table and the FTL-1 table. Entry_index is also called entry index, which is used to identify the corresponding entry in the identified FTL table.

[0143] As an example, the way to map LBA to FTL_Table_Index and entry_index depends on Figure 5A The FTL table organization is shown in . For example, for LBA0, it is accommodated by entry 0 of the FTL-0 table, so the mapped FTL_Table_index=0, and entry_index=0, while for LBA8, it is accommodated by entry 3 of the FTL-1 table, so the mapped FTL_Table_index=1, and entry_index=3.

[0144] Figure 5B In the figure, for the purpose of clarity, the FTL-0 table and the FTL-1 table are displayed as a two-dimensional structure. Each row of the FTL-0 table and the FTL-1 table represents an LBA group, and the LBA groups in the same row of the FTL-0 table and the FTL-1 table have the same LBA group number and constitute an LBA group set. Therefore, the row number of the two-dimensional structure FTL table is the same as the LBA group set number. The two-dimensional structure FTL table also more clearly shows the asymmetry of the FTL-0 table and the FTL-1 table. The number of columns of the two-dimensional structure FTL table optionally depends on the number of LUNs in the FTL table management domain to which the FTL table corresponds. Displaying the FTL table as a two-dimensional structure helps to understand the organization of the FTL table, and also helps to calculate the mapped FTL_Table_Index and entry_index based on the LBA value.

[0145] Figure 5B In the example, according to the FTL_Table_Index obtained from the LBA mapping, the storage command is provided to one of the storage medium management unit 0 and the storage medium management unit 1 for processing. The FTL_Table_Index is also used to determine the FTL table management domain, and the storage command is processed by the storage medium management unit (and other resources) corresponding to the determined FTL table management domain.

[0146] Taking the write command as an example, in response to receiving the storage command, the storage medium management unit allocates a PPA for the LBA it carries, and the allocated PPA is recorded in the entry of the FTL table that contains the LBA (the entry is determined by FTL_Table_Index and entry_index). The LBA corresponding to the storage command received by the storage medium management unit 0 is only accommodated by the FTL-0 table, so its allocated PPA is only used to update the FTL-0 table; and the LBA corresponding to the storage command received by the storage medium management unit 1 is only accommodated by the FTL-1 table, so its allocated PPA is only used to update the FTL-1 table. Further, as an example, the FTL-0 table management domain includes LUN0-LUN3, and the FTL-1 table management domain includes LUN4-LUN6. When the storage medium management unit allocates the PPA, it selects the LUN to which the PPA is allocated based on the FTL table management domain determined from the FTL_Table_Index. Therefore, when FTL_Table_Index=0, the storage medium management unit 0 allocates PPA only from LUN0-LUN3, and when FTL_Table_Index=1, the storage medium management unit 1 allocates PPA only from LUN4-LUN6.

[0147] The allocated PPA is provided to the media interface controller in the form of a media interface command. Figure 5B In the example, the media interface controller includes LUN controller 0 to LUN controller 6, wherein LUN controllers 0 to 3 are respectively used to process media interface commands for accessing LUN0 to LUN3, and LUN controllers 4 to 6 are respectively used to process media interface commands for accessing LUN4 to LUN6. Since storage media management unit 0 only allocates PPA from LUN0 to LUN3, the media interface command corresponding to storage media management unit 0 is only processed by one of LUN0 to LUN3, and similarly, the media interface command corresponding to storage media management unit 1 is only processed by one of LUN4 to LUN6.

[0148] Figure 5B In the example, the FTL-0 table, storage medium management unit 0, LUN controllers 0-3 and LUN0-3 constitute the FTL-0 table management domain, while the FTL-1 table, storage medium management unit 1, LUN controllers 4-6 and LUN4-6 constitute the FTL-1 table management domain. Therefore, the mapping result from LBA to FTL_Table_Index in the storage command determines which FTL table management domain processes the storage command and becomes the load of the FTL table management domain. In the case of multiple storage commands, the organization of the FTL table determines the mapping result from LBA to FTL_Table_Index of the storage command, and also determines the load distribution result of these multiple storage commands between the various FTL table management domains.

[0149] exist Figure 5B In the example, if the LBAs of multiple IO commands issued by the host are continuous (for example, LBA = 0 to 100), then these IO commands will be allocated to the FTL-0 table management domain and the FTL-1 table management domain at a ratio of 4:3. If the LBAs of multiple IO commands issued by the host are continuous odd numbers (for example, LBA = 1, 3, 5, 7, 9, 11, 13, ...), then these IO commands will also be allocated to the FTL-0 table management domain and the FTL-1 table management domain at a ratio of 4:3. Similarly, if the LBAs of multiple IO commands issued by the host are continuous even numbers, then these IO commands will still be allocated to the FTL-0 table management domain and the FTL-1 table management domain at a ratio of 4:3. For another example, if an LBA distribution pattern with a specified span appears in continuous IO commands (for example, LBAs indicated by continuous multiple IO commands = 1, 5, 9, 13, with a span of 4), these IO commands will still be allocated to the FTL-0 table management domain and the FTL-1 table management domain at a ratio of 4:3. The ratio of resources (such as FTL table, LUN controller) between the FTL-0 table management domain and the FTL-1 table management domain is also 4:3, thereby achieving uniform distribution of multiple storage commands (consistent with the resource scale or processing capacity of the FTL table management domain) to each FTL table management domain.

[0150] The distribution of LBAs in the IO commands issued by the host is unpredictable. When LBAs are randomly distributed or evenly distributed in the IO commands issued by the host, the number of IO commands corresponding to each asymmetric FTL table is proportional to or positively correlated with the size of the FTL table, and is also proportional to or positively correlated with the number of LBAs in the LBA group in the FTL table, so that the number of LBAs managed by the FTL table of the FTL table management domain depends on or is proportional to the number of LUNs, so as to promote load balancing of each FTL table management domain.

[0151] In the FTL table organization method provided in one embodiment of the present application, for different FTL tables (including symmetric and asymmetric cases), the parities of LBA groups with the same LBA group numbers are arranged alternately according to the numbers of the FTL tables; and for the same FTL table, the parities of adjacent LBA groups are different.

[0152] Figure 6 The FTL table organization method of another embodiment of the present application is shown. Figure 6 , the storage device LBA space is managed by four FTL tables (respectively denoted as (FTL-0 table, FTL-1 table, FTL-2 table and FTL-3 table)). The storage device includes 31 LUNs, which are allocated to the four FTL tables in a ratio of 8-8-8-7. The FTL-0 table, FTL-1 table and FTL-2 table manage 8 LUNs respectively, and the FTL-3 table manages the remaining 7 LUNs.

[0153] Figure 6 In , each FTL table is displayed as a two-dimensional structure. Each row of each FTL table corresponds to an LBA group, and the LBA values ​​belonging to the same LBA group have a commonality - the same remainder as obtained by division by 4, where 4 comes from the number of FTL tables. The rows of the two-dimensional FTL table correspond to the LBA group numbers. The LBA groups in the same rows of the four FTL tables (LBA groups with the same numbers) constitute an LBA group set. The number of LBAs in an LBA group set is set according to the number of LUNs managed by the four FTL tables (for example, N=31). In Figure 6 In the example, any LBA group set includes 31 LBAs, and the values ​​of these 31 LBAs are continuous. For example, the LBA group set composed of the first row of each of the four FTL tables contains 31 LBA values ​​of 0 to 30, and the LBA group set composed of the row with index i (the minimum value of i is 0, and the row represented by i when the value is 0 is the first row) of each of the four FTL tables contains 31 LBA values ​​of 31*i to (31*i+30), where i=0, 1, 2... Optionally, the number of LBAs in the LBA group set is a multiple of the number of LUNs. And the number of LBAs in each LBA group in the LBA group set depends on the number of LUNs managed by the FTL table to which the LBA group belongs. For example, the FTL-0 table, the FTL-1 table and the FTL-2 table manage 8 LUNs respectively, and the FTL-3 table manages the remaining 7 LUNs. Then the number of LBAs in the LBA groups corresponding to the 4 FTL tables in the LBA group set are 8, 8, 8 and 7 respectively.

[0154] Continue to view Figure 6 , each entry in the four FTL tables corresponds to a different LBA value. Therefore, the corresponding FTL table and the position of the entry in the FTL table can be determined according to the LBA value. Figure 6 , the LBA space corresponds to 4 FTL tables. The LBA values ​​corresponding to the 8 entries in the first row of the FTL-0 table are integer multiples of 4, that is, the LBA value is 4 times the corresponding entry index (entry_index); the LBA value corresponding to each of the 8 entries in the first row of the FTL-1 table is 4 times the entry index plus 1; the LBA value corresponding to each of the 8 entries in the first row of the FTL-2 table is 4 times the entry index plus 2; the LBA value corresponding to each of the 7 entries in the first row of the FTL-3 table is 4 times the entry index plus 3. The LBA value corresponding to each of the 8 entries in the second row of the FTL-0 table is 4 times the difference of the entry index minus 1 plus 3; the LBA value corresponding to each of the 8 entries in the second row of the FTL-1 table is 4 times the entry index; the LBA value corresponding to each of the 8 entries in the second row of the FTL-2 table is 4 times the entry index plus 1; the LBA value corresponding to each of the 7 entries in the second row of the FTL-3 table is 4 times the sum of the entry index plus 1 plus 2. The LBA value corresponding to each of the 8 entries in the third row of the FTL-0 table is 4 times the difference obtained by subtracting 1 from the entry index plus 2; the LBA value corresponding to each of the 8 entries in the third row of the FTL-1 table is 4 times the difference obtained by subtracting 1 from the entry index plus 3; the LBA value corresponding to each of the 8 entries in the third row of the FTL-2 table is 4 times the entry index; the LBA value corresponding to each of the 7 entries in the third row of the FTL-3 table is 4 times the value of the entry index plus 2 plus 1. The LBA value corresponding to each of the 8 entries in the fourth row of the FTL-0 table is 4 times the difference obtained by subtracting 1 from the entry index plus 1; the LBA value corresponding to each of the 8 entries in the fourth row of the FTL-1 table is 4 times the difference obtained by subtracting 1 from the entry index plus 2; the LBA value corresponding to each of the 8 entries in the fourth row of the FTL-2 table is 4 times the difference obtained by subtracting 1 from the entry index plus 3; the LBA value corresponding to each of the 7 entries in the fourth row of the FTL-3 table is 4 times the value of the entry index plus 3.

[0155] Therefore, based on the LBA value, it can be determined which FTL table the corresponding entry belongs to and which entry in the FTL table. For example, if the LBA value of a certain LBA is 88, then according to Figure 6 In the FTL table organization shown in FIG. 1 , the entry corresponding to the LBA value 88 is located in the entry 22 (22*4) of the third row of the FTL-2 table, and the PPA corresponding to the LBA value 88 can be stored in the entry 22 of the FTL-2 table. In another example, the LBA value is 115, then according to Figure 6 As shown in the FTL table organization method, the entry corresponding to the LBA value 115 is located in entry 29 {(29-1)*4+3} of the fourth row of the FTL-2 table, and the PPA corresponding to the LBA with the LBA value of 115 can be stored in entry 29 of the FTL-2 table.

[0156] Generally, after determining M ( Figure 6 In the example, M=4) when the LBA is arranged in the FTL table, the LBA is divided into multiple LBA groups based on the remainder obtained by dividing the LBA by M. The remainders of the LBAs divided by M in the same LBA group are the same, and the remainders can be 0, 1, 2...M-1. The LBA group with a remainder of 0 is represented by G0, the LBA group with a remainder of 1 is represented by G1, the LBA group with a remainder of 2 is represented by G2... The LBA group with a remainder of M-1 is represented by G(M-1). It can be understood that there are multiple LBA groups G0, G1, G2...G(M-1), and in an LBA group set, there are one LBA group G0, G1, G2...G(M-1) each. Therefore, the LBA group set can be represented by a G sequence consisting of G0, G1, G2...G(M-1) included therein, and each element Gx (0<=x<=M-1) in the G sequence has a specified order.

[0157] exist Figure 6 For example, the first LBA group corresponding to the first row of the FTL-0 table has all LBAs whose remainders when divided by 4 are 0, and this LBA group is represented by G0; the first LBA group corresponding to the first row of the FTL-1 table has all LBAs whose remainders when divided by 4 are 1, and this LBA group is represented by G1; the first LBA group corresponding to the first row of the FTL-2 table has all LBAs whose remainders when divided by 4 are 2, and this LBA group is represented by G2; the first LBA group corresponding to the first row of the FTL-3 table has all LBAs whose remainders when divided by 4 are 3, and this LBA group is represented by G3. Then, in the G sequences (LBA group sets) corresponding to the first rows of the four FTL tables, G0, G1, G2, and G3 are arranged in sequence, among which LBA group G3 has one less element than other LBA groups. The LBA group set in the first row accommodates LBA 0-LBA30.

[0158] The second LBA group corresponding to the second row of the FTL-0 table has all LBAs whose remainders when divided by 4 are 3, and this LBA group is represented by G3; the second LBA group corresponding to the second row of the FTL-1 table has all LBAs whose remainders when divided by 4 are 0, and this LBA group is represented by G0; the second LBA group corresponding to the second row of the FTL-2 table has all LBAs whose remainders when divided by 4 are 1, and this LBA group is represented by G1; the second LBA group corresponding to the second row of the FTL-3 table has all LBAs whose remainders when divided by 4 are 2, and this LBA group is represented by G2. Then, in the G sequence (LBA group set) corresponding to the second row of the four FTL tables, G3, G0, G1, and G2 are arranged in sequence. Among them, G2 has one less element than the other groups, and the LBA group set in the second row accommodates LBA 31-LBA61.

[0159] The third LBA group corresponding to the third row of the FTL-0 table has all LBAs whose remainders when divided by 4 are 2, and this LBA group is represented by G2; the third LBA group corresponding to the third row of the FTL-1 table has all LBAs whose remainders when divided by 4 are 3, and this LBA group is represented by G3; the third LBA group corresponding to the third row of the FTL-2 table has all LBAs whose remainders when divided by 4 are 0, and this LBA group is represented by G0; the third LBA group corresponding to the third row of the FTL-3 table has all LBAs whose remainders when divided by 4 are 1, and this LBA group is represented by G1. Then, in the G sequence corresponding to the third row of the four FTL tables, G2, G3, G0, and G1 are arranged in sequence. Among them, G1 has one less element than other groups, and the LBA group set in the third row accommodates LBA 62-LBA92.

[0160] The fourth LBA group corresponding to the fourth row of the FTL-0 table has all LBAs whose remainders are 1 when divided by 4, and this LBA group is represented by G1; the fourth LBA group corresponding to the fourth row of the FTL-1 table has all LBAs whose remainders are 2 when divided by 4, and this LBA group is represented by G2; the fourth LBA group corresponding to the fourth row of the FTL-2 table has all LBAs whose remainders are 3 when divided by 4, and this LBA group is represented by G3; the fourth LBA group corresponding to the fourth row of the FTL-3 table has all LBAs whose remainders are 0 when divided by 4, and this LBA group is represented by G0. In the G sequence corresponding to the fourth row of the four FTL tables, G1, G2, G3, and G0 are arranged in sequence. Among them, G0 has one less element than other groups, and the LBA group set in the fourth row accommodates LBA 93-LBA123.

[0161] The same row of the four FTL tables corresponds to a G sequence, and the elements in the G sequences corresponding to different rows have different orders. Figure 6 In the example, the arrangement of the elements in the G sequence of the row with index i in each of the four FTL tables is the result of cyclic right shift of one position of the arrangement of the elements in the G sequence of the row with index i-1. Optionally, the elements of the G sequence can be arranged in other order.

[0162] The last G element in the G sequence of each row is determined in the following manner: among multiple FTL tables, when the number of columns of one FTL table is smaller than that of other FTL tables, the last G element in the G sequence is used for the FTL table with the smaller number of columns. The G sequence includes a total of M G elements, let i represent the row number (for the first row i = 0), and the last G element is determined according to the result of (N*i-1) mod M. If x = (N*i-1) mod M, then the last G element of the row with index i is Gx, where N is the number of LUNs corresponding to the LBA space, the total number of entries corresponding to a row of the M FTL tables, and the total number of LBAs included in the M LBA groups in the G sequence (the LBAs corresponding to the M FTL tables).

[0163] The non-last G element of the G sequence of each row is determined in the following manner: the number of G elements in each row of the G sequence is M. Except for Gx, which is to be the last G element of each row of the G sequence, the other G elements in the G sequence can be mapped to each FTL table in a variety of ways. However, this mapping should be definite. When the row number i and the G element number j are known, Gj has a definite position in the G sequence of the row indexed by i. As an example, the position of Gj is determined by arranging them in the order of G0, G1, G2...G(M-1) relative to Gx. For example, after Gx, Gx+1, Gx+2... are arranged in sequence, and before Gx, Gx-2, Gx-1, Gx are arranged in sequence. Wrap-around occurs when the G element number is greater than M-1 or less than 0, that is, when the G element number is greater than M-1 for the first time, the G element number j=0, and when the G element number is less than 0 for the first time, j=M-1.

[0164] It should be noted that the sorting order of each G element in the G sequence can be adjusted, and the arrangement order of each G sequence corresponding to different rows can be different.

[0165] Return to view Figure 6 , the G sequence formed by the rows of each of the four FTL tables is:

[0166] Row 1:<G0,G1,G2,G3>

[0167] Line 2:<G3,G0,G1,G2>

[0168] Line 3:<G2,G3,G0,G1>

[0169] Line 4:<G1,G2,G3,G0>

[0170] In each G sequence, the number of LBAs in the first three G elements is 8, and the number of LBAs in the last G element is 7. In each G element (LBA group), the LBAs are arranged in order of size, for example.

[0171] Thus, for any LBA value, the FTL table (FTL_Table_Index) to which the entry containing the LBA value belongs and its position in the FTL table (entry_index) can be known. For example, the quotient of the LBA value divided by 31 represents the set of LBA groups to which the LBA value belongs in the four FTL tables (denoted as the G sequence with index k, k = quotient). When k is known, according to the arrangement of the G elements mentioned above, the arrangement order of the G elements in the G sequence with index k can be obtained, and according to the remainder of the LBA value divided by 4, it is determined which G element in the G sequence the LBA value belongs to, and the FTL_Table_Index is obtained using the position of the G element in the G sequence with index k, and its position in the G element can also be determined according to the LBA value (because the LBA values ​​in the G element are sorted sequentially). Thus, use k as the row number (denoted as a), use the position of the G element to which the LBA value belongs in the G sequence and the position of the LBA value in the G element to which it belongs to obtain the column number (denoted as offset, the first column offset = 0), and obtain entry_index = Ng*k+offset, where Ng is the number of LBAs in each G group (the value here is 7 or 8, for Gx, Ng = 7, for other G, Ng = 8).

[0172] Optionally, the number of columns of each FTL table depends on the number of LUNs in the management domain of each FTL table, and the number of LUNs in the management domain of the FTL table is determined by external factors. After the number of columns of each FTL table is obtained, the elements of the LBA space (LBA values) are mapped to the entries of a certain FTL table according to the rules, and even if the LBA space is infinite, the mapped FTL table entries can be found.

[0173] For example, the number of columns of the FTL table is determined based on the number of LUNs N corresponding to the LBA space and the number of FTL tables M. When determining the number of columns of each FTL table, it is determined based on the ratio of N to M. If the two are divisible, the number of columns corresponding to the M FTL tables is the same. If the two are not divisible, the number of columns corresponding to the first M-1 FTL tables is the same, and the number of columns corresponding to the remaining FTL table is different from the other FTL tables. For example, if the number of LUNs is 31 and the value of M is 4, the number of columns corresponding to 3 FTL tables is 8, and the number of columns corresponding to the remaining FTL table is 7.

[0174] Optionally, after determining the number of columns of the FTL table, the number of rows of the FTL table is further determined, and the FTL table entry determined based on the number of rows and the table needs to be greater than or equal to the FTL table entry corresponding to the FTL table size. The FTL table size can be determined based on the space size P of the LBA and the number M of the managed FTL tables.

[0175] Figure 7 A flowchart of an embodiment of the present application is shown in which LBA is mapped to FTL table entries to obtain an FTL table organization method.

[0176] In step 710, the number of FTL tables (denoted as M) for managing the entire LBA space is determined, and the number of LUNs to be managed (denoted as N) is determined. The number of FTL tables M is determined by the design goal of the storage device. For example, considering the addressing capability of the memory, when the LBA space is large, two FTL tables are used to manage the entire LBA space. For another example, based on the architecture of the control component (for example, the number of storage medium management units, or the number of CPU cores), four FTL table management domains are provided, and four FTL tables are used accordingly.

[0177] In step 720, each FTL table is represented as a matrix of a two-dimensional structure (see also Figure 6 ), the elements of the matrix are the FTL table entries that hold each LBA value, and determine the number of columns of each FTL table. It can be understood that the number of rows of the FTL table depends on the size of the LBA space to be managed.

[0178] For M FTL tables, the total number of elements in the same row of their matrices is denoted by K (K = N, or a multiple of N). Optionally, the M FTL tables have the same number of columns (which is the quotient of N / M). Optionally, when N cannot be divided by M, the number of columns of the first M-1 FTL tables is the same, and the Mth FTL table accommodates the remaining number of columns. For example, when K = N, the number of columns of the first M-1 tables is N / M rounded up, and the number of columns of the Mth table is the remaining number of columns. See also Figure 6 , where N=31, M=4, and the first 3 FTL tables have 8 columns each, while the 4th FTL table has 7 columns.

[0179] The same row of M FTL tables is taken as a whole, and K LBA values ​​with continuous values ​​are contained in order. The K LBA values ​​corresponding to the row with index i in M ​​FTL tables are from i*K to (i+1)*K-1. Thus, any LBA in the entire LBA space is mapped to a specific row of M FTL tables, and the row number of the specific row (denoted as i) is obtained by LBA / K.

[0180] In step 730, the K LBA values ​​of the row with index i corresponding to the M FTL tables are divided into M groups (denoted as G0 / G1 / G2 / ... / G(M-1)), each group (LBA group) corresponds to one of the M FTL tables, and the number of LBAs in each group is the same as the number of columns in the corresponding FTL table, wherein all LBA values ​​in group Gj are modulo M and the result is j, and all LBAs in group Gj are arranged in ascending order of value. For example, see also Figure 6 , the first row (i=0) of each of the four FTL tables has 31 LBA values, which are divided into four groups, namely G0, G1, G2 and G3. Group G0 corresponds to the first row of the FTL-0 table, and the remainder of the LBA values ​​divided by 4 is 0; Group G1 corresponds to the first row of the FTL-1 table, and the remainder of the LBA values ​​divided by 4 is 1; Group G2 corresponds to the first row of the FTL-2 table, and the remainder of the LBA values ​​divided by 4 is 2; Group G3 corresponds to the first row of the FTL-3 table, and the remainder of the LBA values ​​divided by 4 is 3. There are 8 LBA values ​​in group G0, and the LBA values ​​are arranged in order of 0, 4, 8, ... 28.

[0181] In step 740, for the M groups corresponding to the rows with index i of the M FTL tables, determine the group Gx contained by the entries of the row with index i of the M-th FTL table. The M-th FTL table is the last FTL table in the total of M FTL tables. When the number of columns of the M FTL tables is the same, the structures of the FTL tables are the same. When the number of columns of the M FTL tables is different, the number of columns of the M-th FTL table is different from that of other FTL tables, and thus the number of LBAs of the Gx group is different from that of other groups except Gx. Therefore, the LBA groups contained in each row of the M-th FTL table require special consideration. As an example, x = (i*N-1) mod M. In Figure 6 In the example, for the row i=0 of the M=4 FTL tables, x=3, so the row i=0 of the FTL-3 table accommodates the G3 group, and when i=1, the row i=1 of the FTL-3 table accommodates the G2 group.

[0182] In step 750, for the M groups corresponding to the rows with index i of the M FTL tables, the other groups except Gx are accommodated by the entries of the rows with index i of the first M-1 FTL tables. Figure 6 , when i=0, the G3 group is accommodated by the FTL-3 table, and the other groups (G0, G1 and G2) except the G3 group are accommodated by the i=0 row of the first M-1 FTL tables, respectively. For the purpose of determinism, for example, the G0 group is accommodated by the FTL-0 table, the G1 group is accommodated by the FTL-1 table, and the G2 group is accommodated by the FTL-2 table. For another example, when i=3, x=0, so that the G0 group is accommodated by the FTL-3 table, and the other groups (G1, G2 and G3) except the G0 group are accommodated by the i=3 row of the first M-1 FTL tables, respectively.

[0183] Optionally, the M groups of rows with index i are sorted according to the label j of group Gj, and the group located in the Mth FTL table is determined by Gx, and the other groups are accommodated in the other M-1 FTL tables in sequence according to the sorting result. For example, the four groups are sorted in the order of G0, G1, G2 and G3; when i=0, x=3, the G3 group is accommodated by the FTL-3 table, and the remaining groups are accommodated by the FTL-0 table, FTL-1 table and FTL-2 table in the order of groups G0, G1, G2; when x=1, the G1 group is accommodated by the FTL-3 table, the G0 group is sorted before the G1 group, and is accordingly accommodated by the FTL-2 table, while the G2 and G3 groups are sorted after the G1 group, and are accordingly accommodated by the two FTL tables after the FTL-3 table. Since FTL-3 is the last FTL table, a wraparound occurs, and the FTL-0 and FTL-1 tables are used as the two FTL tables after the FTL-3 table to accommodate the G2 group and the G3 group respectively.

[0184] Each LBA value in group G is sequentially contained in the corresponding FTL table and each entry of the corresponding row in order of size. Thus, the mapping of K LBA values ​​from i*K to (i+1)*K-1 for the row with index i corresponding to M FTL tables is completed.

[0185] Next, it is determined whether the maximum number of rows of the FTL table has been reached, in other words, whether the mapping of all LBA values ​​to FTL table entries has been completed. If the maximum number of rows of the FTL table has not been reached, i is incremented, and the process returns to step 730, and the next row of the M FTL tables is mapped to the next K LBA values ​​through the processing of steps 730 to 750.

[0186] If the maximum number of rows in the FTL table has been reached, Figure 7 The displayed processing flow ends.

[0187] Figure 7 In the embodiment shown, each element of the LBA space is mapped to M FTL tables, thereby obtaining the FTL table organization method according to the embodiment of the present application.

[0188] When a storage command carrying LBA is received, FTL_Table_Index and entry_Index are calculated from the LBA value according to the FTL table organization mode used, which are used for subsequent processing of the storage command.

[0189] In one example, M=4, K=31, and 4 FTL tables are used to manage the complete LBA space. For the LBA carried by the storage command, let i=LBA / K, j=LBAmod M, so as to obtain the row index (i) of the LBA value in the FTL table, and the Gj group to which the row with index i belongs.

[0190] Next, the FTL_Table_Index is determined by i and j, that is, which FTL table the LBA value is mapped to. Let t = i mod M, when t = 0, FTL_Table_Index = j mod M; when t = 1, FTL_Table_Index = (j+1) mod M; when t = 2, FTL_Table_Index = (j+2) mod M; when t = 3, FTL_Table_Index = (j+3) mod M. Thus, in general, FTL_Table_Index = (j+t) mod M = (j+(i mod M)) mod M.

[0191] It is also necessary to determine entry_index. When determining entry_index, let entry_index = i*Ng + offset (offset indicates the offset (position) of the entry in the entry group, which can be understood as the column number), and i*K + FTL_table_index + offset*M = LBA, so the following relationship can be obtained: offset = (LBA-i*K-FTL_table_index) / M. Based on the above content, it can be obtained that entry_index = i*Ng + (LBA-i*K-FTL_table_index) / M.

[0192] Figure 8 A schematic diagram showing storage command processing according to an FTL table organization method according to another embodiment of the present application is shown. Figure 8 The control component includes four storage media management units (respectively recorded as storage media management unit_0, storage media management unit_1, storage media management unit_2 and storage media management unit_3), which respectively manage four FTL tables (respectively recorded as FTL-0 table, FTL-1 table, FTL-2 table and FTL-3 table). The storage device includes, for example, 16 LUNs. The FTL-3 table corresponds to LUN0 to LUN3, the FTL-2 table corresponds to LUN4 to LUN7, the FTL-1 table corresponds to LUN8 to LUN11, and the FTL-0 table corresponds to LUN12 to LUN15.

[0193] The four storage medium management units allocate PPAs to LBAs corresponding to the FTL table entries on their corresponding LUNs based on the four FTL tables.

[0194] Figure 8 A media interface controller including 16 LUN controllers is also shown. The 16 LUN controllers are used to access each of the 16 LUNs. For example, LUN controller i is used to access LUN Ni.

[0195] thereby, Figure 8 Four FTL table management domains are formed. The FTL table 0 management domain includes the FTL-0 table, storage medium management unit_0, LUN12-LUN15, and the corresponding LUN controller. The FTL table 1 management domain includes the FTL-1 table, storage medium management unit_1, LUN8-LUN11, and the corresponding LUN controller. The FTL table 2 management domain includes the FTL-2 table, storage medium management unit_2, LUN4-LUN7, and the corresponding LUN controller. The FTL table 3 management domain includes the FTL-3 table, storage medium management unit_3, LUN0-LUN3, and the corresponding LUN controller.

[0196] In response to receiving a storage command, FTL_Table_Index and entry_Index are obtained according to the LBA value carried by the storage command and the FTL table organization method used, wherein FTL_Table_Index is used to indicate one of the FTL tables, and entry_index is used to indicate an entry in the FTL table.

[0197] According to the obtained FTL_Table_Index, determine the FTL table management domain that processes the storage command. The FTL table is accessed by the storage medium management unit of the FTL table management domain. For storage commands indicating write operations, PPA is allocated from the LUN within the FTL table management domain and recorded in the FTL table entry determined by FTL_Table_Index and entry_Index. A media interface command is generated based on the PPA and provided to the media interface controller, and the media interface command is processed by the LUN controller corresponding to the LUN to which the PPA belongs. For storage commands indicating read operations, the PPA is queried from the FTL table entry determined by FTL_Table_Index and entry_Index. A media interface command is generated based on the PPA and provided to the media interface controller, and the media interface command is processed by the LUN controller corresponding to the LUN to which the PPA belongs.

[0198] According to an embodiment of the present application, the storage command is generated by, for example, a write initiation circuit. A variety of write initiation circuits are provided in Chinese patent application 202110746142.2 and Chinese patent application 202310788448.3, and the contents of the above Chinese patent applications are incorporated herein by reference.

[0199] Fig. 9 A schematic diagram of processing a storage command generated by a write initiation circuit according to an embodiment of the present application is shown.

[0200] The write initiation circuit includes a DMA command generation circuit and a storage command generation circuit. The DMA command generation circuit is coupled to the DMA transmission circuit. The DMA command generation circuit generates a DMA command in response to receiving a PRP index or SGL descriptor associated with an NVMe command, and provides the generated DMA command to the DMA transmission circuit. The DMA command is a command used to control DMA to perform data transfer, which indicates the mapping relationship between the host memory address space and the storage device cache address space (e.g., DRAM address). The DMA transmission circuit responds to the received DMA command, moves data between the host memory and the storage device cache according to the DMA command, and after the data move is completed, provides a message indicating that the DMA command processing is completed to the storage command generation circuit.

[0201] The storage command generation circuit is coupled with the DMA transmission circuit and the storage command processing unit. In response to receiving a DMA command processing completion message sent by the DMA transmission circuit, the storage command generation circuit generates a storage command and sends the storage command to the storage command processing unit. The storage command processing unit processes the received storage command.

[0202] See also Fig. 9 As shown, after receiving the storage command, the storage command processing unit determines the FTL table (indicated by FTL_Table_Index) corresponding to the LBA and the specific entry in the FTL table (indicated by entry_index) based on the LBA carried by the storage command. Fig. 9 Two storage media management units are shown, namely storage media management unit_0 and storage media management unit_1. According to the FTL table management domain determined by FTL_Table_Index, which storage media management unit allocates PPA for the LBA carried by the storage command, the allocated PPA comes from the LUN of the FTL table management domain determined by FTL_Table_Index, and the allocated PPA is recorded in the FTL table determined by FTL_Table_Index and the entry determined by entry_index. And according to the allocated PPA, a media interface command is generated and provided to the media interface controller, and the media interface command is processed by the LUN controller corresponding to the allocated PPA.

[0203] As an example, using Figure 4C In the FTL table organization shown, storage command 1 carries LBA=100, and the storage command processing unit determines FTL_Table_Index=0, entry_Index=50 based on the LBA indicated by storage command 1. Therefore, the storage medium management unit-0 allocates PPA from LUN0 to LUN3 for storage command 1. And the allocated PPA is recorded in the entry with index 50 of the FTL-0 table, so as to store the PPA corresponding to the above LBA in the FTL-0 table.

[0204] As another example, still using Figure 4C In the FTL table organization shown, storage command 2 carries LBA=51, and the storage command processing unit determines FTL_Table_Index=1, entry_Index=25 based on the LBA indicated by storage command 2, so that the storage medium management unit-1 allocates PPA from LUN4 to LUN7 for storage command 2. And the allocated PPA is recorded in the entry with index 25 of the FTL-1 table, so as to store the PPA corresponding to the above LBA in the FTL-1 table.

[0205] By generating FTL_Table_Index according to the LBA value indicated by the storage command, the FTL table management domain corresponding to FTL_Table_Index is determined to process the storage command. And according to the FTL table organization method of the embodiment of the present application, it is possible to map multiple received storage commands to different FTL table management domains as evenly as possible, so as to achieve balanced loads of various FTL table management domains in multiple LBA distribution modes of storage commands.

[0206] The various FTL table organization methods provided in the embodiments of the present application can solve the problem of load imbalance when multiple FTL table management domains manage and maintain corresponding FTL tables. One FTL table organization method is: for FTL tables with adjacent table numbers, the parity of LBA groups with the same LBA group number is arranged alternately, and the parity of adjacent LBA groups in the same FTL table is different. Another FTL table organization method is: determine the number of FTL tables that manage the entire LBA space (denoted as M) and the number of LUNs to be managed (denoted as N), represent the FTL table in a two-dimensional matrix form, determine the number of columns of each FTL table, divide the K LBA values ​​corresponding to the row with index i of the M FTL tables into M groups (denoted as G0 / G1 / G2 / ... / G(M-1)), for the M groups corresponding to the row with index i of the M FTL tables, determine the group Gx accommodated by the entries of the row with index i of the Mth FTL table, and accommodate the other groups except Gx by the entries of the row with index i of the first M-1 FTL tables respectively. The process ends when the maximum number of rows of the FTL table is reached. When the number of rows of the FTL table is not reached, continue to divide the K LBA values ​​of the next row into M groups and continue the subsequent process.

[0207] According to the embodiment of the present application, the LBA used by the host to access the storage device is mapped to<FTL_Table_Index,entry_Index> , to achieve load balancing of each FTL table management domain. In this process, each LBA value in the LBA space is remapped. In the prior art, the storage device maps LBA to PPA through the FTL table, which is also a remapping of the LBA value. The difference between the two is that the FTL table provides a nonlinear mapping that can map a specific LBA value to any PPA, but the cost is that the FTL table needs to occupy a large amount of memory space to record the mapping relationship between each LBA value and PPA. In the embodiment of the present application, the LBA value is mapped to<FTL_Table_Index,entry_Index> The process is parseable without the need to use a mapping table to store the mapping relationship, so that the mapping result is obtained only through logical operations on the LBA value without querying the mapping table, which saves storage space and completes the mapping quickly without waiting for a relatively long memory access delay.

[0208] Furthermore, by remapping the LBA value, the position and relative relationship of each data fragment (also called DU) in the LBA space are changed or hidden, thereby enhancing the security of the data stored in the NVM chip of the storage device.

[0209] In the prior art, when the host writes data to the storage device, the storage device divides the data written by the user into DUs corresponding to each LBA and records them in the NVM chip. For the purpose of data reliability, the LBA value corresponding to the DU is usually recorded in the NVM chip together with the data, so that when, for example, the FTL table fails, the data recorded in the entire LBA space of the storage device can be reconstructed by scanning all NVM chips. However, when the storage device is lost or the NVM chip of the storage device is obtained by a third party other than the owner of the data, the third party can also reconstruct part or all of the FTL table by scanning the NVM chip, and then obtain the position of each DU in the LBA space to obtain the user data, which leads to the risk of user data being stolen. The prior art protects data by encrypting user data, but this requires additional encryption / decryption operations, increases the cost of the storage device, and affects the performance of the storage device.

[0210] According to the embodiment of the present application, by mapping the LBA value to<FTL_Table_Index,entry_Index> ,use<FTL_Table_Index,entry_Index> Query the FTL table and replace the LBA value in the NVM chip to record the DU associated with it<FTL_Table_Index,entry_Index> . Therefore, even if a third party obtains the NVM chip of the storage device and reconstructs the FTL table, what is reconstructed is one or more FTL tables according to the FTL table organization method of the embodiment of the present application, and the organization method of its table entries is completely different from the organization method of the LBA space accessed by the host. Therefore, even if the FTL table according to the embodiment of the present application is reconstructed, the third party still cannot obtain the LBA space accessed by the host (called the host LBA space), and thus cannot obtain the position and relative relationship of each DU in the host LBA space, thereby improving the security of the data.

[0211] See also Fig.10 As shown, the remapping is implemented according to the various FTL table organization methods mentioned above in this application. When remapping is performed, a one-to-one mapping is performed between the original LBA space and the remapped LBA space.

[0212] For a storage device, after receiving a write command, it is necessary to allocate a PPA for the LBA indicated by the write command so as to write the data to be written indicated by the write command to the physical page corresponding to the PPA allocated to it. When allocating a PPA for an LBA, the corresponding FTL table and the position in the FTL table (FTL table entry) are calculated based on the LBA, that is, the LBA is remapped to<FTL_Table_Index,entry_Index> , implement the FTL table organization method according to the embodiment of the present application, and obtain the mapping of LBA->{FTL_Table_Index, entry_Index}. Then allocate PPA for the LBA in the FTL table management domain corresponding to FTL_Table_Index, and record it in the entry of the FTL table determined by {FTL_Table_Index, entry_Index}.

[0213] As an example, according to Figure 4C When the FTL table organization method shown is remapped, the corresponding FTL table is first determined in the FTL-0 table and the FTL-1 table based on the LBA indicated by the storage command, and then the corresponding entry is determined. For example, the LBA indicated by the storage command is 50. Since the LBA groups in the FTL-0 table and the FTL-1 table both include 4 LBAs, based on the quotient and remainder of the ratio of 50 to 4 (the quotient is 12 and the remainder is non-zero), it can be determined that the LBA indicated by the storage command corresponds to LBA group 6 (the 7th LBA group, the 1st LBA group is LBA group 0, corresponding to sequence number 0). Since the LBA values ​​corresponding to LBA group 6 of the FTL-0 table are all even numbers and the LBA values ​​corresponding to LBA group 6 of the FTL-1 table are all odd numbers, it is determined that the LBA indicated by the storage command corresponds to LBA group 6 of the FTL-0 table. LBA group 6 corresponds to entry 24, entry 25, entry 26 and entry 27, and in the LBA group with the corresponding LBA value being an even number, the relationship between the entry and the LBA value is: the LBA value is equal to 2*entry index. Therefore, it can be determined that the LBA indicated by the storage command (LBA=50) corresponds to entry 25 of the FTL-0 table.

[0214] For another example, the LBA indicated by the storage command is 71. Based on the quotient and remainder of the ratio of 71 to 4 (the quotient is 17 and the remainder is non-zero), it can be determined that the LBA indicated by the storage command corresponds to LBA group 8 (the 9th LBA group). Since the LBA values ​​corresponding to LBA group 8 of the FTL-0 table are all even numbers, and the LBA values ​​corresponding to LBA group 8 of the FTL-1 table are all odd numbers, it is determined that the LBA indicated by the storage command corresponds to LBA group 8 of the FTL-1 table. LBA group 8 corresponds to entry 32, entry 33, entry 34, and entry 35, and in the LBA group whose corresponding LBA value is an odd number, the relationship between the entry and the LBA value is: the LBA value is equal to 2*entry index+1, so it can be determined that the LBA indicated by the storage command (LBA=71) corresponds to entry 35 of the FTL-1 table.

[0215] As an example, according to Figure 6 When the FTL table organization method shown is remapped, the corresponding FTL table is also determined based on the LBA indicated by the storage command, and then the corresponding entry is determined. For example, the LBA indicated by the storage command is 91. Since the LBA group set in the first row accommodates LBA 0-LBA30, the LBA group set in the second row accommodates LBA 31-LBA61, and the LBA group set in the third row accommodates LBA 62-LBA92, it can be seen that the LBA indicated by the storage command corresponds to the LBA group set in the third row. In the G sequence corresponding to the third row, G2, G3, G0, and G1 are arranged in sequence. Since the remainder of 91 divided by 4 is 3, the LBA indicated by the storage command corresponds to the FTL-1 table and corresponds to the third LBA group of the FTL-1 table. Since the LBA value corresponding to each of the 8 entries in the third row of the FTL-1 table is 4 times the difference obtained by subtracting 1 from the entry index plus 3 (LBA value = (entry index - 1) * 4 + 3), when the LBA is 91, the corresponding entry index is 23.

[0216] For another example, the LBA indicated by the storage command is 106. Since the LBA group set of the first row contains LBA0-LBA30, the LBA group set of the second row contains LBA 31-LBA61, the LBA group set of the third row contains LBA 62-LBA92, and the LBA group set of the fourth row contains LBA 93-LBA123, it can be known that the LBA indicated by the storage command corresponds to the LBA group set of the fourth row. In the G sequence corresponding to the fourth row, G1, G2, G3, and G0 are arranged in sequence. Since the remainder of 106 divided by 4 is 2, the LBA indicated by the storage command corresponds to the FTL-1 table and corresponds to the fourth LBA group of the FTL-1 table. Since the LBA value corresponding to each of the 8 entries in the fourth row of the FTL-1 table is 4 times the difference obtained by subtracting 1 from the entry index plus 2 (LBA value = (entry index-1)*4+2), when the LBA is 106, the corresponding entry index can be obtained as 27.

[0217] The following is an example of a scheme for protecting data by LBA remapping according to the FTL table organization method. If the data to be stored by the user is video data (video data includes f0~f1000 video frames), in order to store multiple video frames, the host will send multiple write commands to the storage device. For example, each video frame corresponds to a write command. The host sends write commands 0 to write commands 1000, each of which carries an LBA. The storage device writes multiple video frames to the NVM chip according to write commands 0 to write commands 1000.

[0218] During the write operation, the LBA indicated by the write command will be remapped to {FTL_Table_Index, entry_Index}, and the LBA information is hidden through LBA remapping. When other users scan the NVM chip, they can only get the remapped and disordered video frames f0~f1000 and {FTL_Table_Index, entry_Index} recorded by the NVM chip. The values ​​and order of {FTL_Table_Index, entry_Index} of each of these video frames are different from the values ​​and order of the LBA range LBA0~LBA1000 carried by the write command sent by the host to write these video frames. Therefore, other users cannot obtain the sequential video frames f0~f1000 from the read disordered video frames, and thus cannot obtain the original video data. Therefore, through LBA remapping, LBA encryption is achieved to prevent user data leakage caused by scanning the NVM chip.

[0219] The present application also provides an LBA remapping solution based on LFSR (Linear Feedback Shift Register). Fig.11 As shown, when remapping is performed based on LFSR, the LFSR can output a pseudo-random number, and the remapped LBA is obtained by performing an XOR operation on the pseudo-random number and LBA; and the LFSR can output the pseudo-random number based on LBA or a random number seed (Seed).

[0220] In storage devices, LSFR is usually used to scramble the data written to the NVM chip so that the written data is randomized to meet the requirements of the NVM chip for the write data mode. When implementing LBA remapping based on LFSR, LBA can be provided to LFSR to generate a pseudo-random number (LBA is used as an index in the random number sequence generated by LFSR to obtain the corresponding pseudo-random number), and then LBA and the pseudo-random number are XORed to obtain the remapped LBA (recorded as mLBA), and the FTL table is queried with mLBA. When implementing LBA remapping based on LFSR, a random number seed can also be provided to LFSR, and the random number seed is recorded. LFSR generates a pseudo-random number based on the random number seed, and the generated pseudo-random number and LBA are XORed to obtain mLBA, and the FTL table is queried with mLBA to achieve remapping. Among them, the random number seed can be recorded by the control component, or recorded by the user as a password, or the LBA value can also be used as a random number seed.

[0221] As an example, the LBA indicated by the storage command is 100. When remapping is performed based on LSFR, the LBA (LBA=100) is provided to the LFSR. The LFSR generates a pseudo-random number D1 based on the input LBA value, and then performs an XOR operation on the obtained pseudo-random number D1 and the LBA value to obtain the result of remapping the LBA value (recorded as mLBA). Based on the remapped mLBA, the FTL table is queried to determine the corresponding entry, and the PPA allocated to the mLBA in response to the storage command (write command) is recorded in the corresponding entry.

[0222] In another example, the LBA indicated by the storage command is 53. When remapping is performed based on LSFR, the random number seed is provided to the LFSR. The LFSR generates a pseudo-random number D2 based on the input random number seed, and then performs an XOR operation on the obtained pseudo-random number D2 and the LBA value to obtain the remapping result (mLBA). Based on the remapped mLBA, the FTL table is queried to determine the corresponding entry, and the PPA allocated to the mLBA in response to the storage command (write command) is recorded in the corresponding entry.

[0223] Optionally, the remapped mLBA is remapped again using the FTL table organization method according to the embodiment of the present application to obtain {FTL_Table_Index, entry_Index}, and then the allocated PPA is recorded in the FTL table entry indexed by {FTL_Table_Index, entry_Index}. By remapping the LBA twice, the security of the data stored in the NVM chip is further improved.

[0224] In some implementations, when a storage device writes data to an NVM chip, the page stripe is used as a storage space allocation unit of the NVM chip. Fig. 12A The FTL-0 table management domain includes the FTL-0 table, storage medium management unit 0, LUN controllers 0-3 and LUN0-LUN3, and the FTL-1 table management domain includes the FTL-1 table, storage medium management unit 1, LUN controllers 4-7 and LUN4-LUN7.

[0225] Page stripes (e.g., page stripe 0) are constructed on LUN0 to LUN3, so that all storage resources of the page stripes constructed on LUN0 to LUN3 belong to the FTL-0 table management domain, and resources of the FTL-1 table management domain will not be used. Similarly, page stripes (e.g., page stripe 1) constructed on LUN4 to LUN7 will not use resources of the FTL-0 table management domain.

[0226] For a storage command to be processed, the storage medium management unit that processes the storage command is determined according to the FTL_Table_Index mapped by its LBA. When the storage medium management unit 0 allocates PPA for the storage command, it only allocates from the page stripes constructed on LUN0 to LUN3; and when the storage medium management unit 1 allocates PPA for the storage command, it only allocates from the page stripes constructed on LUN4 to LUN7. When a page stripe is full, the storage medium management unit allocates PPA for the storage command from another page stripe.

[0227] Fig. 12B A schematic diagram of storage command processing according to another embodiment of the present application is shown.

[0228] same Fig. 12A Compared with the embodiment of Fig. 12B In the example, page stripes are constructed on LUN0 to LUN7, so that the constructed page stripes include storage resources from LUN0 to LUN7. Fig. 12B Page stripe 0 and page stripe 1 are shown in FIG. As an example, the storage resources provided by LUN7 are used to store the check data D(Q) in the page stripe, and the storage resources provided by LUN0-LUN6 are used to store the user data D(i) in the page stripe, 0<=i<=6. It can be understood that the user data is the data written by the storage command and is managed by the FTL table, while the check data does not occupy the LBA space and does not need to be managed by the FTL table.

[0229] exist Fig. 12B In the embodiment of the present application, various FTL table organization methods can be used. As an example, using Figure 4C In the FTL table organization shown, the FTL-0 table and the FTL-1 table each manage half of the overall LBA space, and the number of LBAs in the LBA groups in the two FTL tables is the same.

[0230] When multiple storage commands indicating write operations with LBAs distributed continuously or randomly are received, these storage commands are provided to storage medium management unit 0 and storage medium management unit 1 substantially evenly based on the FTL_Table_Index corresponding to the LBAs. However, Fig. 12B As an example, the left half of page stripe 0 (belonging to the FTL-0 table management domain) can accommodate user data corresponding to C1 storage commands, and the right half of page stripe 0 (belonging to the FTL-1 table management domain) can accommodate user data corresponding to C2 storage commands. Obviously, C1 is not equal to C2. Therefore, when processing the above multiple storage commands, when these storage commands are roughly evenly provided to storage medium management unit 0 and storage medium management unit 1, the right half of page stripe 0 is filled first, and the left half of page stripe 0 is filled later. In the process of writing data to the page stripe, it is necessary to use all user data D(i) (0<=i<=6) written to the page stripe to calculate the verification data D(Q), so that the verification data can only be obtained after the entire page stripe 0 is filled. In addition, the calculation of the check data also requires the use of related resources in the media interface controller (such as the XOR cache), which is occupied from the time the first user data is written to the page stripe until the check data D(Q) is generated and written to LUN 7 (as LUN-P). Therefore, when the parts of the page stripe belonging to different FTL table management domains cannot be fully written at the same time, the XOR cache usage time will increase.

[0231] Providing more XOR resources in the media interface controller helps alleviate the above problem. When one XOR resource is occupied by a write operation of, for example, page stripe 0, other XOR resources can be used to write data to other page stripes. However, XOR resources are expensive, and when the control component is implemented in the form of an integrated circuit chip, it is difficult to provide too many XOR resources in the control component.

[0232] According to the embodiments of the present application, Fig. 12B In the embodiment shown, for example, according to Figure 5B The FTL table organization shown is advantageous. Fig. 12B In the FTL-0 table management domain, PPA is allocated from LUN0-LUN3 to LBA, while in the FTL-1 table management domain, PPA is allocated from LUN4-LUN6 to LBA. Therefore, the number of LUNs corresponding to the FTL-0 table is 4, while the number of LUNs corresponding to the FTL-1 table is 3, that is, the FTL-0 table and the FTL-1 table are asymmetric. Figure 5B In the FTL table organization shown, the number of LBAs in the LBA group of the FTL-0 table is 4, while the number of LBAs in the LBA group of the FTL-1 table is 3, so that in the entire LBA space, the ratio of the size of the portion managed by the FTL-0 table to the portion managed by the FTL-1 table is 4:3. In this case, when multiple storage commands indicating write operations are received with LBAs continuously or randomly distributed (also applicable to some other LBA distribution modes), based on Figure 5B The FTL table organization method determines the FTL table corresponding to the storage command, and these storage commands are provided to the storage medium management unit 0 and the storage medium management unit 1 in a ratio of approximately 4:3. Therefore, when the storage medium management unit 0 and the storage medium management unit 1 allocate PPA from the page stripe, they also consume the storage space of the left half of the page stripe 0 and the storage space of the right half of the page stripe 0 in a ratio of approximately 4:3. Fig. 12B In the example, the ratio of the storage space of the left half of page stripe 0 to the storage space of the right half of page stripe 0 is 4:3, so that the two parts are filled at approximately the same time, and then the check data D(Q) corresponding to page stripe 0 is generated and written to LUN 7, and the XOR cache is released. Since the XOR cache is released in time, the time the XOR cache is occupied during the process of writing data to the page stripe is reduced, the utilization rate of XOR is also improved, and the performance of the control component in processing write commands is further improved.

[0233] Fig.13 A schematic diagram of allocating storage commands and writing data to page stripes according to an FTL table organization method provided in an embodiment of the present application is shown. In the FTL-0 table management domain, PPA is allocated to LBA from LUN0-LUN3, and in the FTL-1 table management domain, PPA is allocated to LBA from LUN4-LUN6; the number of LBAs in the LBA group of the FTL-0 table is 4, and the number of LBAs in the LBA group of the FTL-1 table is 3, so that in the entire LBA space, the size ratio of the part managed by the FTL-0 table to the part managed by the FTL-1 table is 4:3.

[0234] When the host sends command 1 (LBA0), command 2 (LBA1), command 3 (LBA2), command 4 (LBA3), command 5 (LBA4), command 6 (LBA5), command 7 (LBA6), command 8 (LBA7), command 9 (LBA8), command 10 (LBA9), command 11 (LBA10), command 12 (LBA11), command 13 (LBA12), command 14 (LBA13), command 15 (LBA14), command 16 (LBA15), command 17 (LBA17), command 18 (LBA19), based on the LBA in the storage command to FTL_Table_Index The mapping results determine that command 1 (LBA0), command 3 (LBA2), command 5 (LBA4), command 7 (LBA6), command 8 (LBA7), command 10 (LBA9), command 12 (LBA11), command 14 (LBA13) and command 15 (LBA14) are processed by the FTL-0 table management domain; determine that command 2 (LBA1), command 4 (LBA3), command 6 (LBA5), command 9 (LBA8), command 11 (LBA10), command 13 (LBA12), command 16 (LBA15), command 17 (LBA17) and command 18 (LBA19) are processed by the FTL-1 table management domain.

[0235] For the first row of the FTL table, entry 0 of the FTL-0 table is an entry that matches LBA0, entry 1 of the FTL-0 table is an entry that matches LBA2, entry 2 of the FTL-0 table is an entry that matches LBA4, entry 3 of the FTL-0 table is an entry that matches LBA6, entry 0 of the FTL-1 table is an entry that matches LBA1, entry 1 of the FTL-1 table is an entry that matches LBA3, and entry 2 of the FTL-1 table is an entry that matches LBA5. When writing data to page stripe 0, as an example, data corresponding to LBA0 is written to the P0-0 physical page, data corresponding to LBA2 is written to the P0-1 physical page, data corresponding to LBA4 is written to the P0-2 physical page, data corresponding to LBA6 is written to the P0-3 physical page, data corresponding to LBA1 is written to the P0-4 physical page, data corresponding to LBA3 is written to the P0-5 physical page, and data corresponding to LBA5 is written to the P0-6 physical page. Since the ratio of the storage space of the left half of page stripe 0 to the storage space of the right half of page stripe 0 is 4:3, when writing data to page stripe 0, the FTL-0 table management domain writes data corresponding to 4 storage commands and the FTL-1 table management domain writes data corresponding to 3 storage commands, so that the two parts are filled at approximately the same time, allowing the XOR cache to be released in time.

[0236] For the second row of the FTL table, entry 4 of the FTL-0 table is an entry that matches LBA7, entry 5 of the FTL-0 table is an entry that matches LBA9, entry 6 of the FTL-0 table is an entry that matches LBA11, entry 7 of the FTL-0 table is an entry that matches LBA13, entry 3 of the FTL-1 table is an entry that matches LBA8, entry 4 of the FTL-1 table is an entry that matches LBA10, and entry 5 of the FTL-1 table is an entry that matches LBA12. When writing data to page stripe 1 (not shown in the figure), the FTL-0 table management domain writes data corresponding to four storage commands (storage commands corresponding to LBA7, LBA9, LBA11, and LBA13), and the FTL-1 table management domain writes data corresponding to three storage commands (LBA8, LBA10, and LBA12). The two parts are filled at roughly the same time, so that the XOR cache can be released in time.

[0237] For the third row of the FTL table, entry 8 of the FTL-0 table is an entry that matches LBA14, entry 6 of the FTL-1 table is an entry that matches LBA15, entry 7 of the FTL-1 table is an entry that matches LBA17, and entry 8 of the FTL-1 table is an entry that matches LBA19. When writing data to page stripe 2, as an example, the data corresponding to LBA14 is written to the P2-0 physical page, the data corresponding to LBA15 is written to the P2-4 physical page, the data corresponding to LBA17 is written to the P2-5 physical page, and the data corresponding to LBA19 is written to the P2-6 physical page. At this time, the left half of page stripe 2 is not full, and it is necessary to wait until the left half is full before releasing the XOR cache.

[0238] exist Fig.13 In the example, the total number of LBAs (7) corresponding to each row of the FTL-0 table and the FTL-1 table is equal to the number of storage commands that the page stripe can accommodate. It can be understood that this is only an example. Optionally, setting the number of storage commands that the page stripe can accommodate to a multiple of the number of LBAs in a row of the FTL table can also achieve the effect of making the page stripes belonging to different FTL table management domains be filled at the same time.

[0239] Fig.14 A schematic diagram of storage command processing according to another embodiment of the present application is shown. Fig.14 As shown, the storage command carries LBA, and based on the FTL table organization method provided in this application, the LBA carried by the storage command is mapped to FTL_Table_Index and entry_index.

[0240] As an example, the way to map LBA to FTL_Table_Index and entry_index depends on Fig.13 For example, for LBA11, it is accommodated by entry 6 of the FTL-0 table, so the mapped FTL_Table_index=0, and entry_index=6, while for LBA17, it is accommodated by entry 7 of the FTL-1 table, so the mapped FTL_Table_index=1, and entry_index=7.

[0241] Fig.14 In the example, according to the FTL_Table_Index obtained from the LBA mapping, the storage command is stored in cache 0 or cache 1. The FTL-0 table corresponds to cache 0 and the FTL-1 table corresponds to cache 1. When 4 storage commands are stored in cache 0 and 3 storage commands are stored in cache 1, these 7 storage commands are sent together and provided to storage medium management unit 0 and storage medium management unit 1 for processing. Fig.14 In an embodiment, a cache is used to temporarily record storage commands and postpone the processing of storage commands, and after the cache has accumulated a specified number of storage commands, these storage commands are processed. For example, if M storage commands are required to fill a page stripe, the cache is used to accumulate M1 storage commands belonging to the FTL-0 table management domain and M2 storage commands belonging to the FTL-1 table management domain (where M1+M2=M, and M1:M2=4:3), and then these M storage commands are processed, so that the page stripe is filled in a shorter time and the occupied time of the XOR cache is reduced. Optionally, the cache space is effective, and it is not desired that the storage commands stay in the cache for too long. For this purpose, the cache is used to provide the storage commands belonging to the FTL-0 table management domain and the FTL-1 table management domain to the outside in a ratio of, for example, 4:3. When the cache provides storage commands to the outside, it is not necessary to require that the number of storage commands provided can fill the page stripe.

[0242] Taking the write command as an example, the storage medium management unit allocates a PPA for the LBA carried by the storage command in response to the received storage command, and the allocated PPA is recorded in the entry of the FTL table that contains the LBA (the entry is determined by FTL_Table_Index and entry_index) to update the corresponding FTL table. The LBA corresponding to the storage command received by the storage medium management unit 0 is only accommodated by the FTL-0 table, so its allocated PPA is only used to update the FTL-0 table; the LBA corresponding to the storage command received by the storage medium management unit 1 is only accommodated by the FTL-1 table, so its allocated PPA is only used to update the FTL-1 table. Further, as an example, the FTL-0 table management domain includes LUN0-LUN3, and the FTL-1 table management domain includes LUN4-LUN7 (LUN7 is used to store verification data). The storage medium management unit 0 allocates PPA only from LUN0-LUN3, and the storage medium management unit 1 allocates PPA only from LUN4-LUN6.

[0243] The allocated PPA is provided to the media interface controller in the form of a media interface command. Since the media interface command carries a physical address, the accessed logical unit is determined based on the physical address carried by the media interface command, and the LUN controller corresponding to the accessed logical unit is determined based on the mapping relationship between the logical unit and the LUN controller. Fig.14 In the figure, the media interface controller includes LUN controller 0 to LUN controller 3 and LUN controller 4 to LUN controller 7, wherein LUN controller 0 to LUN controller 3 are respectively used to process the media interface commands for accessing LUN0 to LUN3, and LUN controller 4 to LUN controller 6 are respectively used to process the media interface commands for accessing LUN4-LUN6.

[0244] When the LUN controller processes the media interface command, it generates a storage media access command and sends it to the corresponding logical unit to write data to the corresponding physical page. For example, 7 storage commands obtained from the cache are sent together to the storage media management unit 0 and the storage media management unit 1. The storage media management unit 0 processes 4 storage commands and provides 4 media interface commands to the media interface controller. After the storage media management unit 1 processes 3 storage commands and provides 3 media interface commands to the media interface controller, LUN controllers 0 to 3 process the corresponding media interface commands and write data to the corresponding physical page. LUN controllers 4 to 6 process the corresponding media interface commands and write data to the corresponding physical page. The two parts of the page stripe are filled at approximately the same time, which can achieve the timely release of the XOR cache.

[0245] Fig.14 In the illustrated embodiment, after the storage commands corresponding to a page stripe are cached, these storage commands are provided as a whole to the storage medium management unit for subsequent processing, so as to implement the one-time allocation of PPA and update of FTL table operations. Thus, the storage medium access commands corresponding to these storage commands for writing data to the complete page stripe can be centrally provided to the media interface controller to ensure that the page stripe is filled in a relatively short time, and the XOR cache is released in time to avoid XOR resources being occupied.

[0246] In order to release XOR resources in time, the embodiment of the present application can control the page stripe not to cross the FTL table management domain; in case that the page stripe crosses the FTL table management domain, a method of reasonably allocating FTL tables for LBAs and a method of caching storage commands for one-time allocation are adopted to ensure that the page stripe is filled in a relatively short time and the XOR resources are released in time.

[0247] An embodiment of the present application also provides a storage device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, each process of the above-mentioned data access method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0248] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.< / lba> < / lba>

Claims

1. A data access method, characterized in that: include: In response to receiving a plurality of storage commands indicating write operations, remapping a first LBA value carried by each storage command to obtain a remapping result, wherein the remapping result includes an FTL table index and an entry index corresponding to the first LBA value; Based on the FTL table organization mode, determine the FTL table corresponding to the storage command, and allocate the storage command to the corresponding FTL table management domain; Allocate a physical page on a page stripe for each storage command, write data corresponding to the storage command into the allocated physical page, and record a physical address of the allocated physical page into a corresponding target entry, where the target entry is determined based on a remapping result corresponding to the storage command; The page stripe includes physical pages from logical units of M FTL table management domains, and the value of M is greater than or equal to 1.

2. The method according to claim 1, characterized in that in, The overall LBA space is managed by M FTL tables; Each of the M FTL tables includes a plurality of entry groups, each entry group being used to accommodate an LBA group; For each of the M FTL tables, LBA values ​​belonging to the same LBA group have the same parity or the same result of taking modulo M, and LBA values ​​of adjacent LBA groups have different parities or the same result of taking modulo M; In the M FTL tables, the parity of the LBA values ​​of the LBA groups with the same group number or the result of taking the modulus of M is different in adjacent FTL tables.

3. The method according to claim 2, characterized in that When the results of taking the modulo M of the LBA values ​​of the same LBA group are the same, the results of taking the modulo M of the LBA values ​​of adjacent LBA groups are different, and the results of taking the modulo M of the LBA values ​​of LBA groups with the same group number are different in adjacent FTL tables, the method further includes: According to FTL_Table_Index=(j+t)mod M, determine the FTL table index corresponding to the first LBA value, where FTL_Table_Index represents the FTL table index, j represents the result of taking the first LBA value modulo M, and t represents the result of taking the row index i of the first LBA value in the FTL table modulo M; The entry index corresponding to the first LBA value is determined according to entry_index=i*Ng+(LBA-i*K-FTL_table_index) / M, where entry_index represents the entry index, K represents the total number of elements in the same row of M FTL tables, LBA represents the first LBA value, i=LBA / K, and Ng represents the number of LBAs in the LBA group.

4. The method according to claim 2 or 3, characterized in that: in, The ratio of the number of LBAs included in the LBA groups with the same group number of the M FTL tables is equal to the ratio of the number of logical units from each FTL table management domain in the storage space for storing user data of the page stripe.

5. The method according to any one of claims 1 to 4, characterized in that: in, Among the multiple FTL table indexes obtained by remapping the LBA value carried by each storage command of the multiple storage commands, the ratio of the number of FTL table indexes corresponding to each FTL table management domain is equal to the ratio of the number of logical units from each FTL table management domain in the storage space for storing user data of the page stripe, so that the ratio of the amount of data written to the parts belonging to each FTL table management domain in the storage space for storing user data of the page stripe is equal to the ratio of the number of FTL table indexes corresponding to each FTL table management domain.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: After determining the FTL table corresponding to the storage command, storing the storage command in a cache; L storage commands are obtained from the cache and provided to multiple storage medium management units, wherein the storage commands are provided to the storage medium management unit belonging to the same FTL table management domain according to the FTL table management domain to which the obtained storage commands belong; and the ratio of the number of storage commands belonging to each FTL table management in the L storage commands is equal to the ratio of the number of logical units from each FTL table management domain in the storage space for storing user data of the page stripe.

7. The method according to claim 6, characterized in that The L storage commands are provided together to M storage medium management units; For any storage medium management unit, the storage medium management unit processes the received storage command and provides a medium interface command to the corresponding medium interface controller; The LUN controller in the media interface controller processes the media interface command and writes data to the corresponding physical page.

8. The method according to any one of claims 1 to 7, characterized in that: in, The LUN to which the physical pages on the page stripe allocated for the storage command belong and the storage command correspond to the same FTL table management domain.

9. The method according to any one of claims 1 to 8, characterized in that: Also includes: Before writing data to the page stripe for the first time, allocating an XOR buffer to the page stripe; After the page stripe is filled, the allocated XOR buffer is released.

10. A storage device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Method for data access and controller for data writing

    CN113485643A

  • NVMe write IO initiating circuit of NVMe controller

    CN119229912A