A method and system for automatically integrating hardware-based solid-state hard disk read commands
The automatic integration of SSD read commands through hardware solves the problems of low cache hit rate and integration delay, improves read performance and reduces power consumption, and is suitable for a variety of data access scenarios.
Patent Information
- Application Number
- CN202210237805.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-03-11
AI Technical Summary
The cache hit rate of existing solid-state drives is low, resulting in increased latency, and the traditional integrated command method cannot effectively handle associated read commands, which increases power consumption and design complexity, and cannot dynamically adjust hardware resources.
A hardware-based automatic integration method of read commands is adopted to realize automatic splitting and merging of read commands through priority classification, mapping table segmentation, page boundary segmentation and re-integration buffer integration, thereby reducing flash memory access latency and power consumption.
It improves the read performance and latency of solid-state drives, reduces power consumption, reduces hardware design consumption, achieves flexible latency control and efficient integration, and is suitable for mixed access scenarios of associated data and random data.
Smart Images

Figure CN114721590B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solid state hard disks, and in particular to a method and system for automatically integrating read commands of solid state hard disks based on hardware. Background Art
[0002] With the demand for various remote data services such as cloud computing, cloud storage, big data and the metaverse, more and more storage services are deployed on remote servers, which requires higher and higher response speeds for stored data, as well as higher and higher requirements for storage cost control and power consumption. Solid-state drives were invented to adapt to this trend of technological development. Their ultra-fast response speed and large-capacity import and export resources have obvious advantages over traditional mechanical hard drives. Among them, the performance and latency of reading data are the most important parameter indicators of solid-state drives, and are the core parameters of technical competition between master controllers.
[0003] Traditional solutions for optimizing repeated read commands are mostly to pre-read and then reuse cache hits. This method may result in penalties caused by cache misses and delays caused by cache swapping and querying.
[0004] The prior art has the following problems:
[0005] 1. In actual tests, it was found that the hit rate of random data cache (cache memory) is actually very low. In actual user scenarios, the cache utilization rate is likely to be very low, resulting in a waste of chip design resources and the increased latency penalty caused by cache misses.
[0006] 2. Even if the cache has a hit, the time span between hits is generally very large. If you want to improve the hit rate, you need to increase the cache capacity, which will cause the cache to occupy a large amount of chip memory, increasing the cost and power consumption of the chip as well as the complexity of the design.
[0007] 3. Known command integration methods can usually only integrate consecutive related commands and increase latency.
[0008] 4. Known integrated command methods are usually implemented by software, which has performance limitations and cannot be dynamically adjusted according to hardware resources and system load.
[0009] 5. When the hard disk is accessed by multiple host threads, the associated read data access (such as continuous data or regularly spaced or associated data in the database) may be crossed in a short period of time. Therefore, optimizing the read commands hitting the same flash page boundary in a short period of time can still improve the performance, latency and power consumption of the read commands in this scenario to meet the needs of specific customers. Summary of the invention
[0010] The purpose of the present invention is to address the defects of the prior art and provide a method and system for automatic integration of read commands of solid-state hard disks based on hardware, which can integrate read commands when a large number of related read commands access the hard disk, thereby reducing the access commands and delays of the flash memory of the solid-state hard disk, and greatly improving the read performance, delay and power consumption of the solid-state hard disk in data type access situations in specific scenarios (such as multiple readings of related data, mixing of related data and random data). Compared with traditional cache design solutions, while improving read performance delay and reducing power consumption, it has the advantages of small and controllable hardware design resource consumption, no hit failure penalty, and flexible and controllable delay; compared with software or hardware implementation methods that can only perform continuous command hit integration, it has higher integration efficiency, controllable integration delay penalty and no need to care about the calculation of the integration start time point.
[0011] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0012] A method for automatically integrating read commands of a solid-state drive based on hardware, comprising:
[0013] S1. Obtain a read command sent by the host, classify and sort the obtained read commands according to their priorities, and select the classified read commands;
[0014] S2. The selected read command is segmented based on the mapping table sub-read unit to obtain the segmented read command fragments;
[0015] S3. The obtained read command fragment is queried based on the mapping table to obtain the physical target address of the read command;
[0016] S4. Identify the page boundary of the physical target address of the read command in the flash memory, and re-divide the read command according to the page boundary;
[0017] S5. Put the read commands divided according to the page boundaries into the reintegration buffer for integration;
[0018] S6. The read commands hitting the same flash page in the re-integrated cache area are re-integrated according to the conditions;
[0019] S7. Re-execute steps S5-S6, and stop integrating when the command integration in the buffer times out and / or exceeds a preset number of times.
[0020] Furthermore, the priority classification in step S1 is specifically: using a machine learning method to predict whether a read command is associated in the flash memory, or predicting whether the data characteristics of the read command are random or associated within a special range specified by the user.
[0021] Furthermore, the mapping table single reading unit in step S2 is based on the single most efficient length of the cache area where the mapping table is stored; wherein the most efficient length is calculated by dividing the single mapping table read data length by the delay of reading the mapping table data back under the single mapping table read data length.
[0022] Furthermore, the reintegration in step S6 includes: when two adjacent read commands are in the same page flash memory, the two read commands will be merged.
[0023] Furthermore, the reintegration in step S6 includes: when two or more non-adjacent read commands are in the same page flash memory, the corresponding two or more read commands will be merged.
[0024] Furthermore, the reintegration in step S6 includes: when the page number positions of some flash memory pages of one or more adjacent or non-adjacent read commands are the same and the data displacement is also the same, merging the read commands of the reintegrated cache area.
[0025] Furthermore, the reintegration in step S6 includes: after a plurality of read commands are integrated into one read command, the identifiers of the original read commands exist in the new read command in the form of a linked list.
[0026] Furthermore, the condition in step S6 is: when the number of commands in the reintegrated command buffer is greater than the specified number, integration is performed; when the number of commands in the reintegrated command buffer is less than the specified number, no integration is performed.
[0027] Furthermore, in step S5, the read commands divided according to the page boundaries are placed in the reintegration buffer and stored in the reintegration buffer in a single necklace list.
[0028] Accordingly, a system for automatic integration of solid state drive read commands based on hardware is also provided, comprising:
[0029] An acquisition module is used to acquire the read commands sent by the host, classify and sort the acquired read commands according to their priorities, and select the classified read commands;
[0030] A first segmentation module is used to segment the selected read command into sub-read units based on the mapping table to obtain segmented read command fragments;
[0031] A query module, used for querying the obtained read command fragment based on the mapping table to obtain the physical target address of the read command;
[0032] A second segmentation module is used to identify the page boundary of the physical target address of the read command in the flash memory, and to segment the read command again according to the page boundary;
[0033] A first integration module is used to put the read commands segmented according to the page boundary into a reintegration buffer for integration;
[0034] A second integration module is used to integrate the read commands hitting the same flash memory page in the reintegration buffer area again according to conditions;
[0035] The loop module is used to re-execute the first integration module and the second integration module, and stop the integration when the command integration of the buffer is timed out and / or exceeds a preset number of times.
[0036] Compared with the prior art, the present invention receives host read commands; classifies according to read command priorities; extracts according to read command priority weights; splits read commands according to the maximum flash command length; reads the host logical address and flash address mapping table; splits read commands according to flash page boundaries; extracts read commands into the flash channel cache; reintegrates same-page commands according to the cache space; extracts cache reintegrated commands to the flash channel for execution; command integration times out and forces flushing; and the firmware can actively control the initiation of flushing when an abnormal situation occurs. The present invention uses a combination of hardware and software to automatically split and reintegrate read commands, avoiding short-term repeated reading of the same page of the flash memory, thereby reducing the delay and power consumption of the host read commands, improving the overall read throughput of the solid-state drive, and extending the flash data storage life; the hardware-based implementation greatly reduces the firmware load and further reduces the delay of the host read command; and provides the firmware with fully adjustable, configuration and control methods, which can well handle abnormal interrupts and dynamically adjust performance according to user scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a block diagram of a method for automatic integration of hardware-based solid-state hard disk read commands provided in Embodiment 1;
[0038] Figure 2 This is a flowchart of a method for automatically integrating hardware-based solid-state hard disk read commands provided in Example 1;
[0039] Figure 3 This is a schematic diagram of the changing state provided in Example 1;
[0040] Figure 4 This is a schematic diagram of flash memory address arrangement provided in Example 1;
[0041] Figure 5 This is a schematic diagram of the command format after splitting provided in Example 1;
[0042] Figure 6 This is a simplified view of the chain structure provided in the first embodiment;
[0043] Figure 7It is a schematic diagram of a continuous sequence provided in Example 1. DETAILED DESCRIPTION
[0044] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0045] The purpose of the present invention is to address the deficiencies of the prior art and to provide a method and system for automatically integrating read commands of a solid-state hard disk based on hardware.
[0046] Embodiment 1
[0047] This embodiment provides a method for automatically integrating read commands of a solid-state drive based on hardware, such as Figure 1-2 As shown, including:
[0048] S1. Obtain a read command sent by the host, classify and sort the obtained read commands according to their priorities, and select the classified read commands;
[0049] S2. The selected read command is segmented based on the mapping table sub-read unit to obtain the segmented read command fragments;
[0050] S3. The obtained read command fragment is queried based on the mapping table to obtain the physical target address of the read command;
[0051] S4. Identify the page boundary of the physical target address of the read command in the flash memory, and re-divide the read command according to the page boundary;
[0052] S5. Put the read commands divided according to the page boundaries into the reintegration buffer for integration;
[0053] S6. The read commands hitting the same flash page in the re-integrated cache area are re-integrated according to the conditions;
[0054] S7. Re-execute steps S5-S6, and stop integrating when the command integration in the buffer times out and / or exceeds a preset number of times.
[0055] In step S1, a read command sent by a host is obtained, the obtained read commands are classified and sorted according to their priorities, and the classified read commands are selected.
[0056] The host sends a read command to the controller through the Non-Volatile Memory Express (NVMe) driver layer.
[0057] The SSD controller extracts the read command according to the NVMe protocol. The hardware module (HIF) responsible for interpreting the NVMe command queries the read and write command queue according to the NVMe specification to obtain the NVMe read command, and packages the read command into a message to the embedded central processing unit (CPU) of the SSD controller.
[0058] The firmware running on the CPU analyzes the priority and address of the read command. Based on past historical statistics, the firmware can use machine learning methods to predict whether the read command is associated in the flash memory, or predict whether the data characteristics of the read command are random or associated within a special range specified by the user.
[0059] The following example shows how to determine whether the association is established:
[0060] (1) When it is found that the data read by the read command is the specified system boot area or Option ROM driver loading area, the data it reads is associated in the flash memory (because this part is generally cold data, which is not updated frequently and is written to the associated area once). At this time, the read command is marked as a command that can participate in the integration.
[0061] (2) When the firmware discovers through historical statistics or machine learning that the user has obvious random properties when reading and writing data in a certain logical address (LBA) range, the data it reads is likely to be unrelated in the flash memory. At this time, performing an integration command will cause delays due to multiple integration failures. In this case, the read command is marked as a non-integrable command.
[0062] (3) When the user has a very clear understanding of the purpose of the hard disk, such as random access to SQL databases, or storing cold data of large files, the user can also send a custom command (VDM) that complies with the NVMe protocol to the hard disk to specify the attributes of a special LBA range, marking the read commands in the random access range as non-integratable (ME=0), and the read commands in the large file cold data range as integratable (ME=1). If the database is frequently accessed regularly, such as extracting characteristic data from a fixed interval, the data interval with an associated page can also be set as integratable data.
[0063] According to the above, the read command is marked as associated or not associated, and the firmware returns the marked read command to the HIF, and the HIF selects the read command according to the priority of the read command.
[0064] In step S2, the selected read command is segmented into sub-read units based on the mapping table to obtain segmented read command fragments.
[0065] The hardware module (HIF) large command splitting module obtains the address and length of the read command according to the NVMe protocol, and splits the command according to the maximum read unit of the mapping table.
[0066] The master control mapping table of this embodiment is a direct mapping table stored in DDR, and the particle width of DDR is 64 bits. The minimum unit of a single access by the controller is 64B, and the flash memory address (that is, the real physical storage address) corresponding to a logical address is 32 bits. The logical address corresponding to 64B is:
[0067] 64*8 / 32=16. Therefore, the read command is divided into groups of 16 associated logical addresses.
[0068] If the mounted DDR particle is 32 bits, the minimum length unit of a single access under the same control is 32B, and the corresponding split logical boundary becomes 8.
[0069] Define the number of split logical addresses as LM.
[0070] If the address where the command starts is not on a boundary that is divisible by 16 or 8, the address is first split to the boundary that is divisible by 16 or 8, and then split again until the command ends.
[0071] For example, if the starting address is 0x10000003, the length is 32, and the segmentation size LM is 16, then:
[0072] The logical addresses 0x100000003 to 0x10000000f are the first group and constitute the first read command.
[0073] The logical addresses 0x100000010 to 0x10000001f are the second group, constituting the second read command.
[0074] Logical addresses 0x100000020 to 0x100000022 are the third group, constituting the third read command.
[0075] In this embodiment, the selected read command is divided according to the mapping table maximum read unit, and the mapping table read unit depends on the single maximum efficiency length of the cache area stored in the mapping table; the maximum efficiency is calculated by dividing the single mapping table read data length (MLen) by the delay (tRL) returned by reading the mapping table data under this length.
[0076] In the process of splitting the selected read command according to the maximum read unit of the mapping table, the split size firmware is controllable, and the split size firmware can control the split size of each read command separately, and the split unit size of each read command can be different; the firmware in this embodiment can directly specify the split module to split according to the accurate value of the read command size corresponding to the maximum mapping table read length supported by the hardware, or specify to split less than the accurate value. And in the process of splitting the selected read command according to the maximum read unit of the mapping table.
[0077] In this embodiment, the segmented read command still saves the identifier (Cmd Tag) of the original host read command, and Cmdtag will pass through subsequent modules without change until the data of the read command is returned to the module responsible for sending the return command to the host, ensuring the corresponding relationship of the data.
[0078] In step S3, the obtained read command fragment is queried based on the mapping table to obtain the read command physical target address.
[0079] The hardware module (HIF) sends the split read command to the logical-physical address translation module (FTLA) at one time.
[0080] FTLA reads the corresponding mapping table according to the starting address of the read command. The length is LM multiplied by the space size of a single logical address in the mapping table, 4B (32bit). FLTA appends the physical address to the original read command, one for each logical address, to form a new read command. The command size becomes larger but the number of commands remains unchanged. The change status is as follows: Figure 3 shown.
[0081] In step S4, the page boundary of the physical target address of the read command in the flash memory is identified, and the read command is divided again according to the page boundary.
[0082] The logical-physical address translation module (FTLA) sends the read command with the physical address added to it to the flash page boundary splitting module (FSP).
[0083] FSP will traverse the physical addresses in the read command. According to the configuration of the FSP register, whenever the flash page address and above units (including block address, logical unit address, die address and channel address) of the physical address are flipped, the physical address before the flip is merged into a flash read command, and the current flipped physical address unit starts to form the next flash read command until the last physical address unit ends. Figure 4 The flash memory address arrangement in is used as a reference for example:
[0084] In the example address arrangement, the address bits that are required to be greater than the page are all located in the high position.
[0085] In the example address arrangement, bits 31 to 4 may be the number of a page.
[0086] In the example address arrangement, bits 3 to 0 are used as the position offset of the data within a flash page, where bits 3 to 2 indicate the plane where the data is located, and bits 1 to 0 indicate the plane in which the data is located.
[0087] When bit4 to bit31 change as a 28-bit variable, it is considered to cross the flash page boundary address.
[0088] It should be noted that the values of bits 3 to 0 may not be continuous in a command group. For example:
[0089] The 15 physical addresses in the original read command are:
[0090] 0x1005510, 0x1005511, 0x1005513, 0x1005515, 0x1005514, 0x1005522, 0x1005521, 0x100 5523, 0x1005514, 0x1005515, 0x1005517, 0x1005518, 0x1005520, 0x1005521, 0x1005522.
[0091] After segmentation, it becomes 4 groups and is put into different commands with a total of 4 names:
[0092] The physical address in the first command C1: {0x1005510, 0x1005511, 0x1005513, 0x1005515, 0x1005514}
[0093] The physical address in the second command C2: {0x1005522, 0x1005521, 0x1005523}
[0094] The physical address in the third command C3: {0x1005514, 0x1005515, 0x1005517, 0x1005518}
[0095] The physical address in the fourth command C4: {0x1005520, 0x1005521, 0x1005522}
[0096] The command format will change after splitting, such as Figure 5As shown, the logical address and physical address of each data block will become two adjacent 32 bits and put together, which will facilitate (reduce the complexity of hardware implementation) the generation of the final flash memory access command and possible read command integration.
[0097] In this embodiment, the flash memory page boundary can be configured according to the characteristics of the flash memory particles mounted on the actual hard disk; and the re-division of the read command according to the page boundary is implemented in hardware. The hardware module can automatically extract the page identification bit in the flash memory address of the read command data mapping target according to the register configured by the firmware. When the identification bits in the flash memory address corresponding to two adjacent data blocks are inconsistent, the previous page identification bit will be automatically associated with the same one or more data to form a new read command and put it into the subsequent read command cache module.
[0098] In step S5, the read commands segmented according to the page boundaries are put into a reintegration buffer for integration.
[0099] The Flash Page Boundary Splitting Module (FSP) sends the split read commands to the Flash Command Merge Module (FCM). The FCM first stores the received commands in a Command Merge Buffer (CMB) that it manages internally. The CMB is a linked list structure. The received read commands are linked together after being timestamped in the order in which they were received. Therefore, the read commands that are split according to the page boundaries are placed in the reintegration buffer. The reintegration buffer exists in the core buffer of the master controller in the form of a single necklace list. The size can be flexibly configured according to actual needs, especially the size of the back-end mounted flash memory capacity. A simple view of the chain structure is as follows: Figure 6 shown.
[0100] It should be noted that the number of linked lists (not the length) is the same as the number of flash independent logical units (LUNs) mounted on the controller. This is because the flash LUNs can load data cache in parallel when reading data. Considering the consumption of hardware resources and the limitation of actual hard disk capacity, the maximum number of linked lists supported is 256. The corresponding integrated commands will be stored in the Out FIFO corresponding to each LUN, and the maximum number supported by the Out FIFO is also 256.
[0101] There are two key control tags in the command header: ME and CL, which respectively represent integration (Merge enable) and integration of one command in a flash read command (Command last).
[0102] There is also a counter MC in the command header to indicate the number of integrations (merge count), and its initial value is 0.
[0103] The initial value of ME comes from the configuration of the firmware in step S3. The initial value of CL is 1, indicating that each command is an independent command before reintegration.
[0104] It should be noted that after multiple integration commands are obtained, one or more CL=0 and CL=1 continuous sequences are obtained. This sequence is a complete flash read command in logic. For example, Figure 7 shown.
[0105] In step S6, read commands (including adjacent and non-adjacent read commands) that hit the same flash memory page in the reintegration buffer are reintegrated according to conditions.
[0106] The reintegration methods include:
[0107] When two adjacent read commands are in the same page of flash memory, the two read commands will be merged.
[0108] When two or more non-adjacent read commands are in the same page of flash memory, the corresponding two or more read commands will be merged, for example, C1 and C3 are merged, and C2 and C4 are merged in step S4.
[0109] When the page number positions of some flash memory pages of one or more adjacent or non-adjacent read commands are the same and the data displacement is also the same, that is, when the data blocks in multiple read commands are completely matched, the read commands of the corresponding data blocks will have a corresponding integration count mark after integration, which can avoid repeated data transmission from the flash memory while having the ability to repeatedly return data from the internal data cache area of the solid-state drive to the host. For example, 0x1005522 in both C2 and C4 in step S4.
[0110] When multiple read commands are integrated into one read command, the identifier of the original command will exist in the new read command in the form of a linked list. This ensures that with minimal access to the flash memory, the original read command can still be restored based on the information in the linked list after the data is returned, ensuring the consistency of the read data return target.
[0111] In step S7, steps S5-S6 are executed again, and when the command integration of the buffer times out and / or exceeds a preset number of times, the integration is stopped.
[0112] Whenever a new read command CMN arrives at FCM, FCM will perform an integration attempt according to the following steps:
[0113] (1) Check whether the current number of cache commands is greater than the specified integration threshold. If it is less than or equal to the specified threshold, directly add it to the end of the corresponding LUN linked list.
[0114] (2) If the number of cached commands is greater than the specified integration threshold, FCM will try to integrate the existing read commands starting from the first read command CMX with ME=1 at the beginning of the linked list.
[0115] (3) Extract the first physical address of CMX and compare it with the first physical address in the new read command CMN. The lower 4 bits are not compared, only bits 31 to 4 are compared. It should be noted that the page address in each group of commands is the same, so the result of comparison with any one is the same. The first one is selected for convenience.
[0116] (4) If the comparison result of step (3) does not match, find the read command with CL=1 starting from CMX and then extract the next read command with ME=1, set it as the new CMX and then repeat step (3).
[0117] (5) If the result of the comparison in step (3) matches, the new command is inserted into the linked list starting from CMX and including the read command with CL=1 in the read command header of CMX, and the CL=1 of the previous command is rewritten to CL=0, and the CL=1 of the new read command remains unchanged. And the integration count MC in CMX is increased by 1. If MC is greater than the limit number of integration times, the ME of CMX is changed to 0 and the integration of the new command CMN is stopped.
[0118] For example, when the physical address of CMX matches, and CL of CMX=0, the CL of the two read commands after CMX (CMX+1, CMX+2) is 0, the CL of the third read command after CMX (CMX+3) is 1, and the fourth read command after CMX is CMY, then:
[0119] The sequence before integration is:
[0120] CMX(CL=0), CMX+1(CL=0), CMX+2(CL=0), CMX+3(CL=1), CMY
[0121] The integrated sequence is:
[0122] CMX(CL=0), CMX+1(CL=0), CMX+2(CL=0), CMX+3(CL=0), CMN(CL=1), CMY
[0123] (6) If the linked list reaches the end or there are no more commands that can be integrated, the integration stops and the new read command CMN is added to the end of the linked list.
[0124] While the above integrated command is being executed, FCM has a firmware-configurable timer that checks the timestamp TS of the linked list header read command every configured time. When the current time of the timer minus TS is greater than the configured timeout threshold MTMAX, FCM will configure the ME of the linked list header command to 0. When there is space in FCM's out fifo, the head command will be immediately removed from the linked list and placed in the Out FIFO, and the command at the head of the new linked list will be immediately checked to see if it has timed out. If so, the previous steps will be repeated.
[0125] When the firmware finds that the system is abnormal and needs to terminate command integration, it can trigger the flush process by configuring the corresponding flush register for FCM. After FCM finds the flush configuration, it will stop the current integration, put the new command directly at the end of the linked list, and continuously take the head command and put it into the out FIFO.
[0126] The flash command execution module FSQ will check whether there is a read command in the corresponding out FIFO of the FCM according to the working status of the flash memory. If FSQ finds that the flash memory LUN is in a state where a flash memory read command can be executed, it will fetch the commands from the outFIFO one by one until a command with CL=1 is obtained. FSQ sends the optimized read command to the flash memory LUN according to the integrated read command sequence:
[0127] If the obtained read command has only one logical address, a fast flash read command with low latency and offset address is sent. After the read command is completed, the data is obtained from the flash memory and sent back to the HIF module.
[0128] If the obtained read command has only multiple logical addresses, a normal flash read command with a slightly longer delay but with page cache is sent. After the page cache is loaded, the data is extracted from the page cache using different offset addresses according to the physical address in each read sequence and sent back to the HIF module.
[0129] The HIF module returns the received data to the host according to the information in the read command header.
[0130] In this embodiment, commands in the command integration buffer are integrated only when the number of commands is greater than the specified number (MTh). When the speed of the flash memory is fast enough, the number of commands in the buffer will be less than the specified value MTh, and the commands in the buffer will not be integrated. Read latency is the highest priority of SSD performance. This method can ensure that when the flash memory speed is fast enough, there will be no additional latency due to integration.
[0131] When the speed of the flash memory is not enough to meet the linear speed of the data path, the number of commands in the buffer will gradually increase. When the number of commands is greater than the specified number MTh, it will be integrated and re-integrated. This integration will reduce the number of flash memory accesses and data transmissions, thereby reducing read latency, power consumption, and the read retention time of flash memory data.
[0132] The commands in the buffer are put back into the buffer after integration and can be integrated again. The size of the buffer can be reused to maximize integration.
[0133] In this embodiment, the command integration of the buffer has a timeout setting to prevent excessive command integration from causing a large delay. The integrated command is put back into the buffer and can participate in integration again until the time from the first integrated command to the last integrated command in the buffer exceeds the set threshold, then the integrated command stops integrating and no longer participates in subsequent integration.
[0134] The command integration of the buffer has an over-count setting to prevent excessive command integration from causing large delays. The integrated command is put back into the buffer and can participate in integration again until the number of original commands participating in the integration exceeds the set threshold, then the integrated command stops integrating and no longer participates in subsequent integration. The times include the number of integrations, the number of query buffer read commands when checking whether query integration can occur, and any two or more of the previous three times. Linear or nonlinear combination.
[0135] After the integration timeout or the number of times has expired, the commands in the buffer will be sorted according to the time of the earliest integrated command. The earliest command will be placed at the front of the buffer to ensure that the command delay does not exceed the maximum value expected by the system.
[0136] The integration module maintains a starting integration command pointer (MSP) and an integration command query pointer (MCP). The initial value of MSP is 0. It will only increase by 1 when the current integration ends (including integration and reintegration) and the number of read commands remaining in the linked list is greater than 1. When MSP points to the last command, MSP will directly return to the head of the linked list (MLH). MCP always points to the next read command of MSP after MSP is updated. When an integration operation ends, MCP will point to the next read command until MSP is updated when the integration ends.
[0137] The integration module has an outbound first-in first-out buffer (Out FIFO). The read command that has timed out or exceeded the number of times or has been forcibly terminated will be immediately deleted from the linked list and put into the Out FIFO. The read command put into the Out FIFO will no longer participate in the integration and wait for the next level module to obtain it.
[0138] The integration module has a timeout management timing module, which uses the clock unit multiplied by the register value configured by the firmware as the precision to calculate the current clock timestamp (GSTMP). The timing module stamps the read command when it is placed in the buffer. When the integration management state machine polls a read command, it calculates the current read command timestamp (CSTMP) and GSTMP to obtain the waiting time (TW) of the command in the buffer. When TW is greater than or equal to the timeout time, the command will terminate integration and be placed in the Out FIFO.
[0139] The integration module has a firmware-controllable register interface. Through this register, all read commands in the buffer can be flushed. During the flushing process, the integration state machine will be locked and stop integration until all commands are flushed out of the buffer into the Out FIFO.
[0140] Compared with the prior art, this embodiment uses a combination of hardware and software to automatically split and re-integrate the read command, avoiding short-term repeated reading of the same page of the flash memory, thereby reducing the delay and power consumption of the host read command, improving the overall read throughput of the solid-state drive, and extending the flash memory data storage life; the hardware-based implementation greatly reduces the firmware load, further reducing the host read command delay; and provides the firmware with fully adjustable, configurable and control methods, which can handle abnormal interrupts and dynamically adjust performance according to user scenarios; the command integration of the buffer in this embodiment has a timeout setting and a number limit, which can prevent delays caused by excessive command integration; the commands in the buffer can be flushed at any time according to the firmware control to prevent command congestion caused by abnormal conditions. The firmware can use historical record statistics, user-specified and machine learning methods to predict the relevance of read commands in the flash memory to decide whether to run the read command to participate in the integration.
[0141] Embodiment 2
[0142] Accordingly, a system for automatic integration of solid state drive read commands based on hardware is also provided, comprising:
[0143] An acquisition module is used to acquire the read commands sent by the host, classify and sort the acquired read commands according to their priorities, and select the classified read commands;
[0144] A first segmentation module is used to segment the selected read command into sub-read units based on the mapping table to obtain segmented read command fragments;
[0145] A query module, used for querying the obtained read command fragment based on the mapping table to obtain the physical target address of the read command;
[0146] A second segmentation module is used to identify the page boundary of the physical target address of the read command in the flash memory, and to segment the read command again according to the page boundary;
[0147] A first integration module is used to put the read commands segmented according to the page boundary into a reintegration buffer for integration;
[0148] A second integration module is used to integrate the read commands hitting the same flash memory page in the reintegration buffer area again according to conditions;
[0149] The loop module is used to re-execute the first integration module and the second integration module, and stop the integration when the command integration of the buffer is timed out and / or exceeds a preset number of times.
[0150] It should be noted that the system for automatic integration of solid state drive read commands based on hardware in this embodiment is similar to that in the first embodiment, and will not be described in detail here.
[0151] Compared with the prior art, this embodiment uses a combination of hardware and software to automatically split and reintegrate read commands, avoiding short-term repeated reading of the same page of the flash memory, thereby reducing the delay and power consumption of the host read command, improving the overall read throughput of the solid-state drive, and extending the flash memory data storage life; the hardware-based implementation greatly reduces the firmware load and further reduces the delay of the host read command; and provides the firmware with fully adjustable, configuration and control methods, which can well handle abnormal interrupts and dynamically adjust performance according to user scenarios.
[0152] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for automatically integrating read commands of a solid-state drive based on hardware, characterized in that: include: S1. Obtain a read command sent by the host, classify and sort the obtained read commands according to their priorities, and select the classified read commands; S2. The selected read command is segmented based on the mapping table sub-read unit to obtain the segmented read command fragments; S3. The obtained read command fragment is queried based on the mapping table to obtain the physical target address of the read command; S4. Identify the page boundary of the physical target address of the read command in the flash memory, and re-divide the read command according to the page boundary; S5. Put the read commands divided according to the page boundaries into the reintegration buffer for integration; S6. The read commands hitting the same flash page in the re-integrated cache area are re-integrated according to the conditions; S7. Re-execute steps S5-S6, when the command integration of the buffer times out and / or exceeds a preset number of times, stop integration; The priority classification and arrangement in step S1 specifically includes: using a machine learning method to predict whether a read command is associated in the flash memory, or predicting whether the data characteristic of the read command is random or associated within a special range specified by a user; The mapping table single reading unit in step S2 is based on the single most efficient length of the cache area where the mapping table is stored; wherein the single most efficient length is calculated by dividing the single mapping table read data length by the delay of reading the mapping table data back under the single mapping table read data length.
2. The method for automatically integrating hardware-based solid-state drive read commands according to claim 1, characterized in that: The manner of reintegration in step S6 includes: when two adjacent read commands are in the same page flash memory, the two read commands will be merged.
3. The method for automatically integrating hardware-based solid-state drive read commands according to claim 2, characterized in that: The manner of reintegration in step S6 includes: when two or more non-adjacent read commands are in the same page flash memory, the corresponding two or more read commands will be merged.
4. The method for automatically integrating hardware-based solid-state drive read commands according to claim 3, characterized in that: The reintegration method in step S6 includes: when the page number positions of some flash memory pages of one or more adjacent or non-adjacent read commands are the same and the data displacement is also the same, merging the read commands of the reintegrated buffer area.
5. The method for automatically integrating hardware-based solid-state drive read commands according to claim 4, characterized in that: The reintegration method in step S6 includes: after multiple read commands are integrated into one read command, the identifiers of the original read commands exist in the new read command in the form of a linked list.
6. The method for automatically integrating hardware-based solid-state drive read commands according to claim 1, characterized in that: The condition in step S6 is: when the number of commands in the reintegrated command buffer is greater than the specified number, integration is performed; when the number of commands in the reintegrated command buffer is less than the specified number, no integration is performed.
7. The method for automatically integrating hardware-based solid-state drive read commands according to claim 1, characterized in that: In step S5, the read commands divided according to the page boundaries are placed in the reintegration buffer and stored in the reintegration buffer in a single necklace list.
8. A system for automatic integration of solid state drive read commands based on hardware, characterized in that: include: An acquisition module is used to acquire the read commands sent by the host, classify and sort the acquired read commands according to their priorities, and select the classified read commands; A first segmentation module is used to segment the selected read command into sub-read units based on the mapping table to obtain segmented read command fragments; A query module, used for querying the obtained read command fragment based on the mapping table to obtain the physical target address of the read command; A second segmentation module is used to identify the page boundary of the physical target address of the read command in the flash memory, and to segment the read command again according to the page boundary; A first integration module is used to put the read commands segmented according to the page boundary into a reintegration buffer for integration; A second integration module is used to integrate the read commands hitting the same flash memory page in the reintegration buffer area again according to conditions; A loop module, used for re-executing the first integration module and the second integration module, and stopping the integration when the command integration of the buffer is timed out and / or exceeds a preset number of times; The priority classification and arrangement in the acquisition module is specifically as follows: using a machine learning method to predict whether a read command is associated in the flash memory, or predicting whether the data characteristic of the read command is random or associated within a special range specified by a user; The mapping table single reading unit in the first segmentation module is based on the single most efficient length of the cache area where the mapping table is stored; wherein the single most efficient length is calculated by dividing the single mapping table read data length by the delay of reading the mapping table data back under the single mapping table read data length.
